From 8e79203b1e13f797958f42eba48d4797db9b86ad Mon Sep 17 00:00:00 2001 From: Leo Coogan Date: Tue, 1 Apr 2025 08:30:25 -0400 Subject: [PATCH] the vision is coming together --- bas.scd | 40 ++++++++++++++++++++ live/granular_EF-edit.scd | 10 ++--- pads/mel leftovers.scd | 79 +++++++++++++++++++++++++++++++++++++++ pads/mel.scd | 72 +++++++---------------------------- padsynth practice.scd | 2 +- 5 files changed, 139 insertions(+), 64 deletions(-) create mode 100644 bas.scd create mode 100644 pads/mel leftovers.scd diff --git a/bas.scd b/bas.scd new file mode 100644 index 0000000..715cd24 --- /dev/null +++ b/bas.scd @@ -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 +]); diff --git a/live/granular_EF-edit.scd b/live/granular_EF-edit.scd index aa80f27..2b750ca 100644 --- a/live/granular_EF-edit.scd +++ b/live/granular_EF-edit.scd @@ -43,13 +43,13 @@ SynthDef(\cantorial_tremolo, { |out, pan = 0, dur = 0.1, atk=0.3, dec=0.4, sus=0 Ppar([ Pbind( \instrument, \cantorial_trill, - \dur, 1, // Adjust as needed - \amp, 1, // Amplitude (adjust as needed) + \dur, 0.1, // Adjust as needed + \amp, 0.5, // Amplitude (adjust as needed) \pan, 0, // Pan position ), Pbind( \instrument, \cantorial_tremolo, - \dur, 0.2, // Adjust as needed + \dur, 0.1, // Adjust as needed \amp, 1, // Amplitude (adjust as needed) \pan, 0, // Pan position for the second synth (can be changed) ) @@ -83,7 +83,7 @@ SynthDef(\cantorial_trill, { |out, pan = 0, dur = 0.5, atk=0.3, dec=0.4, sus=0.1 dur: dur, sndbuf: b, rate: 1, - pos: 0.01, + pos: 0.02, interp: 2, pan: pan, envbufnum: -1, @@ -95,7 +95,7 @@ SynthDef(\cantorial_trill, { |out, pan = 0, dur = 0.5, atk=0.3, dec=0.4, sus=0.1 sig = LPF.ar(sig, crf); Out.ar(out, sig); -}).play; +}).add; ) ) diff --git a/pads/mel leftovers.scd b/pads/mel leftovers.scd new file mode 100644 index 0000000..9e0016e --- /dev/null +++ b/pads/mel leftovers.scd @@ -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; +) \ No newline at end of file diff --git a/pads/mel.scd b/pads/mel.scd index 43ff385..31c959e 100644 --- a/pads/mel.scd +++ b/pads/mel.scd @@ -1,98 +1,54 @@ ( -SynthDef(\mellotronFlute, { +SynthDef(\mellotron, { arg freq = 440, amp = 0.8, gate = 1, pan = 0, vibratoRate = 1, vibratoDepth = 0.15, noiseLevel = 0.2, ringModFreq = 3, lpfFreq = 2000, res = 0.8, lpfLfoRate = 1, lpfLfoDepth = 100, - detune = 0.005; // Detune amount (in ratio) + detune = 0.005; 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 * (0.99); // Slightly sharp - freq2 = freq * (1.01); // Slightly flat + freq1 = freq * (0.99); + freq2 = freq * (1.01); - // 1st Oscillator: Triangle waves with vibrato osc1 = Mix([ LFTri.ar(freq1 * vibrato), LFTri.ar(freq2 * vibrato) - ]) * 0.5; // Mix detuned voices + ]) * 0.5; - // Pink noise mixed into the first oscillator for breathiness noise = WhiteNoise.ar(noiseLevel); - osc1 = Mix([osc1, noise * 0.5]); // Blend noise into osc1 + osc1 = Mix([osc1, noise * 0.5]); - // 2nd Oscillator: Detuned ring modulation for a natural tone - osc2 = Mix([ + osc2 = Mix([ Saw.ar(freq1 * ringModFreq), SinOscFB.ar(freq2 * ringModFreq) - ]) * 0.5 * osc1; // Ring-modulated with detuned pair + ]) * 0.5 * osc1; - // 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, 2), 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([[48, 20, 53], [10, 58, 60], [55, 72, 74], [10, 63, 70]].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.08 - ; -).play; -) - - - - - - ( Pbind( - \instrument, \mellotronFlute, // Use your SynthDef - // \freq, Pseq([[53]].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, 1.01, // Varying detune values - \dur, Pseq([0.8], inf), // Duration per note - \amp, 0.1; + \instrument, \mellotron, + \freq, Pseq([ + [48, 20, 53], [10, 58, 60], [55, 72, 74], [10, 63, 70], + [48, 20, 53], [10, 58, 60], [10, 55, 63], [12, 55, 58] + ].midicps, inf), + \dur, 2, ).play; ) - diff --git a/padsynth practice.scd b/padsynth practice.scd index 79b1184..cfb0f6d 100644 --- a/padsynth practice.scd +++ b/padsynth practice.scd @@ -71,7 +71,7 @@ MIDIdef.noteOn(\noteOnTest, { arg vel, nn, chan, src; [vel, nn].postln; ~notes[nn] = Synth.new( - \rhubarb, + \mellotronFlute, [ \freq, nn.midicps, \amp, vel.linexp(1,127,0.01,0.3),