the vision is coming together

master
Leo Coogan 9 months ago
parent c63e565483
commit 8e79203b1e
Signed by: lcoogan
SSH Key Fingerprint: SHA256:vnrR5ilHkdr6L4t2yOMUMINFPpxEh+53N3nMel66mCw

@ -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
]);

@ -43,13 +43,13 @@ SynthDef(\cantorial_tremolo, { |out, pan = 0, dur = 0.1, atk=0.3, dec=0.4, sus=0
Ppar([ Ppar([
Pbind( Pbind(
\instrument, \cantorial_trill, \instrument, \cantorial_trill,
\dur, 1, // Adjust as needed \dur, 0.1, // Adjust as needed
\amp, 1, // Amplitude (adjust as needed) \amp, 0.5, // Amplitude (adjust as needed)
\pan, 0, // Pan position \pan, 0, // Pan position
), ),
Pbind( Pbind(
\instrument, \cantorial_tremolo, \instrument, \cantorial_tremolo,
\dur, 0.2, // Adjust as needed \dur, 0.1, // Adjust as needed
\amp, 1, // Amplitude (adjust as needed) \amp, 1, // Amplitude (adjust as needed)
\pan, 0, // Pan position for the second synth (can be changed) \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, dur: dur,
sndbuf: b, sndbuf: b,
rate: 1, rate: 1,
pos: 0.01, pos: 0.02,
interp: 2, interp: 2,
pan: pan, pan: pan,
envbufnum: -1, 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); sig = LPF.ar(sig, crf);
Out.ar(out, sig); Out.ar(out, sig);
}).play; }).add;
) )
) )

@ -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;
)

@ -1,98 +1,54 @@
( (
SynthDef(\mellotronFlute, { SynthDef(\mellotron, {
arg freq = 440, amp = 0.8, gate = 1, pan = 0, vibratoRate = 1, vibratoDepth = 0.15, 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, 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; var sig, osc1, osc2, vibrato, noise, env, lpfMod, freq1, freq2;
// Natural vibrato (LFO)
vibrato = SinOsc.kr(vibratoRate, 0, vibratoDepth).range(0.98, 1.02); vibrato = SinOsc.kr(vibratoRate, 0, vibratoDepth).range(0.98, 1.02);
// Detuned frequencies (slight offsets) freq1 = freq * (0.99);
freq1 = freq * (0.99); // Slightly sharp freq2 = freq * (1.01);
freq2 = freq * (1.01); // Slightly flat
// 1st Oscillator: Triangle waves with vibrato
osc1 = Mix([ osc1 = Mix([
LFTri.ar(freq1 * vibrato), LFTri.ar(freq1 * vibrato),
LFTri.ar(freq2 * 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); 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), Saw.ar(freq1 * ringModFreq),
SinOscFB.ar(freq2 * 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]); sig = Mix([ osc1, osc2 * 0.5]);
// LFO for filter frequency modulation
lpfMod = SinOsc.kr(lpfLfoRate).range(lpfFreq - lpfLfoDepth, lpfFreq + lpfLfoDepth); lpfMod = SinOsc.kr(lpfLfoRate).range(lpfFreq - lpfLfoDepth, lpfFreq + lpfLfoDepth);
// Low-pass filter with LFO modulation and slight resonance
sig = RLPF.ar(sig, lpfMod, res); 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); env = EnvGen.kr(Env.adsr(0.2, 3, 1, 2), gate, doneAction: 2);
// Apply envelope and amp
sig = sig * env * amp; sig = sig * env * amp;
sig = sig.tanh(8); sig = sig.tanh(8);
sig = BLowShelf.ar(sig, 200, 0.5, 9); 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)); Out.ar(0, Pan2.ar(sig, pan));
}).add; }).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( Pbind(
\instrument, \mellotronFlute, // Use your SynthDef \instrument, \mellotron,
// \freq, Pseq([[53]].midicps, inf), // Sequence of MIDI notes converted to Hz \freq, Pseq([
\freq, Pseq([[50, 65], [55, 72], [72, 74], [48, 20]].midicps, inf), // Sequence of MIDI notes converted to Hz [48, 20, 53], [10, 58, 60], [55, 72, 74], [10, 63, 70],
\detune, 1.01, // Varying detune values [48, 20, 53], [10, 58, 60], [10, 55, 63], [12, 55, 58]
\dur, Pseq([0.8], inf), // Duration per note ].midicps, inf),
\amp, 0.1; \dur, 2,
).play; ).play;
) )

@ -71,7 +71,7 @@ MIDIdef.noteOn(\noteOnTest, {
arg vel, nn, chan, src; arg vel, nn, chan, src;
[vel, nn].postln; [vel, nn].postln;
~notes[nn] = Synth.new( ~notes[nn] = Synth.new(
\rhubarb, \mellotronFlute,
[ [
\freq, nn.midicps, \freq, nn.midicps,
\amp, vel.linexp(1,127,0.01,0.3), \amp, vel.linexp(1,127,0.01,0.3),

Loading…
Cancel
Save