the vision is coming together
parent
c63e565483
commit
8e79203b1e
@ -0,0 +1,40 @@
|
||||
// Define the bass synth
|
||||
(
|
||||
SynthDef(\boC_bass, {
|
||||
arg freq = 440, detune = 1.001, amp = 0.4, cutoff = 1000, attack = 0.5, decay = 1;
|
||||
|
||||
var osc1, osc2, mix, filter, env;
|
||||
|
||||
// Two sawtooth oscillators detuned slightly
|
||||
osc1 = Pulse.ar(freq, amp); // First oscillator, base frequency
|
||||
osc2 = Pulse.ar(freq * detune, amp); // Second oscillator, slightly detuned
|
||||
|
||||
// Mix both oscillators
|
||||
mix = osc1 + osc2;
|
||||
|
||||
// Apply a low-pass filter to smooth the high frequencies
|
||||
filter = LPF.ar(mix, cutoff); // Low-pass filter with customizable cutoff
|
||||
|
||||
// Envelope for shaping the sound
|
||||
env = EnvGen.kr(Env.perc(attack, decay), doneAction: 2); // Short attack and decay
|
||||
|
||||
// Apply envelope to the filter and mix the result
|
||||
filter = filter * env;
|
||||
|
||||
// Output the final sound to both left and right channels
|
||||
Out.ar(0, filter.dup);
|
||||
}).add;
|
||||
)
|
||||
|
||||
// Play the synth with default values
|
||||
x = Synth(\boC_bass, [\freq, 30.midicps]);
|
||||
|
||||
// You can also play the synth with custom arguments
|
||||
x = Synth(\boC_bass, [
|
||||
\freq, 220, // Set frequency
|
||||
\detune, 1.005, // Slightly different detune
|
||||
\amp, 0.5, // Amp (volume)
|
||||
\cutoff, 400, // Filter cutoff frequency
|
||||
\attack, 0.05, // Attack time
|
||||
\decay, 0.3 // Decay time
|
||||
]);
|
||||
@ -0,0 +1,79 @@
|
||||
(
|
||||
SynthDef(\mellotronFlute, {
|
||||
arg freq = 440, amp = 0.3, gate = 1, pan = 0, vibratoRate = 1, vibratoDepth = 0.15,
|
||||
noiseLevel = 0.2, ringModFreq = 3, lpfFreq = 1200, res = 0.8, lpfLfoRate = 1, lpfLfoDepth = 80,
|
||||
detune = 0.005; // Detune amount (in ratio)
|
||||
|
||||
var sig, osc1, osc2, vibrato, noise, env, lpfMod, freq1, freq2;
|
||||
|
||||
// Natural vibrato (LFO)
|
||||
vibrato = SinOsc.kr(vibratoRate, 0, vibratoDepth).range(0.98, 1.02);
|
||||
|
||||
// Detuned frequencies (slight offsets)
|
||||
freq1 = freq * (1.01); // Slightly sharp
|
||||
freq2 = freq * (1.01); // Slightly flat
|
||||
|
||||
// 1st Oscillator: Triangle waves with vibrato
|
||||
osc1 = Mix([
|
||||
LFTri.ar(freq1 * vibrato),
|
||||
LFTri.ar(freq2 * vibrato)
|
||||
]) * 0.5; // Mix detuned voices
|
||||
|
||||
// Pink noise mixed into the first oscillator for breathiness
|
||||
noise = PinkNoise.ar(noiseLevel);
|
||||
osc1 = Mix([osc1, noise * 0.5]); // Blend noise into osc1
|
||||
|
||||
// 2nd Oscillator: Detuned ring modulation for a natural tone
|
||||
osc2 = Mix([
|
||||
Saw.ar(freq1 * ringModFreq),
|
||||
SinOscFB.ar(freq2 * ringModFreq)
|
||||
]) * 0.5 * osc1; // Ring-modulated with detuned pair
|
||||
|
||||
// Mix oscillators together
|
||||
sig = Mix([ osc1, osc2 * 0.5]);
|
||||
|
||||
// LFO for filter frequency modulation
|
||||
lpfMod = SinOsc.kr(lpfLfoRate).range(lpfFreq - lpfLfoDepth, lpfFreq + lpfLfoDepth);
|
||||
|
||||
// Low-pass filter with LFO modulation and slight resonance
|
||||
sig = RLPF.ar(sig, lpfMod, res);
|
||||
|
||||
// Envelope (slow attack for a natural swell)
|
||||
env = EnvGen.kr(Env.adsr(0.2, 3, 1, 1), gate, doneAction: 2);
|
||||
|
||||
|
||||
// Apply envelope and amp
|
||||
sig = sig * env * amp;
|
||||
|
||||
// sig = sig.tanh(8);
|
||||
sig = BLowShelf.ar(sig, 200, 0.5, 9);
|
||||
// sig = sig.blend(GVerb.ar(sig, 200, 4), 0.15);
|
||||
|
||||
|
||||
|
||||
|
||||
// sig = sig.blend(BPF.ar(sig, 800, 0.5), 0.9);
|
||||
// Output with panning
|
||||
Out.ar(0, Pan2.ar(sig, pan));
|
||||
}).add;
|
||||
)
|
||||
|
||||
// Play the flute synth
|
||||
x = Synth(\mellotronFlute, [\freq, 53.midicps, \detune, 0.1]); // Slight detune for a richer sound
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(
|
||||
|
||||
Pbind(
|
||||
\instrument, \mellotronFlute, // Use your SynthDef
|
||||
// \freq, Pseq([40, 37, 38, 30, 45, 30].midicps, inf), // Sequence of MIDI notes converted to Hz
|
||||
\freq, Pseq([[48, 20, 53], [10, 58, 60], [10, 55, 63], [12, 55, 58]].midicps, inf), // Sequence of MIDI notes converted to Hz
|
||||
// \freq, Pseq([[50, 65], [55, 72], [72, 74], [48, 20]].midicps, inf), // Sequence of MIDI notes converted to Hz
|
||||
\detune, Pseq([0.2], inf), // Varying detune values
|
||||
\dur, Pseq([2], inf), // Duration per note
|
||||
// \amp, 0.02;
|
||||
).play;
|
||||
)
|
||||
Loading…
Reference in New Issue