You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
164 lines
3.9 KiB
Plaintext
164 lines
3.9 KiB
Plaintext
(
|
|
SynthDef(\junoPad, {
|
|
arg gate=1, freq=220, atk=4, sus=2, rel=6, amp=0.3;
|
|
var sig, env, freqs, lfo, chorus, modRate, modDepth;
|
|
|
|
// Slightly detuned saw waves
|
|
freqs = freq * [1, 1.01, 0.99]; // Small detune
|
|
sig = Mix(Saw.ar(freqs)); // Stack saw waves
|
|
|
|
// LFO to slowly move filter cutoff
|
|
lfo = SinOsc.kr(0.1).range(500, 2000);
|
|
sig = RLPF.ar(sig, lfo, 0.3); // Low-pass filter with modulation
|
|
|
|
// Envelope for smooth rise
|
|
env = EnvGen.kr(Env.asr(atk, 1, rel), gate, doneAction:2);
|
|
sig = sig * env * amp;
|
|
|
|
// Chorus effect (emulates Juno-chorus)
|
|
modRate = [0.3, 0.4]; // Two different modulation rates
|
|
modDepth = 0.01; // Small pitch variation
|
|
chorus = sig + DelayC.ar(sig, 0.02, SinOsc.kr(modRate).range(0, modDepth));
|
|
|
|
// Reverb for space
|
|
// sig = FreeVerb.ar(chorus, mix: 0.5, room: 0.8, damp: 0.5);
|
|
|
|
sig = sig * chorus;
|
|
|
|
Out.ar(0, sig);
|
|
}).play;
|
|
)
|
|
|
|
|
|
(
|
|
|
|
x = {
|
|
|
|
var sig = WhiteNoise.ar(1!2);
|
|
|
|
sig = CombL.ar(sig, 0.05, 1/[36.7, 37.3], 1, 0.2);
|
|
|
|
sig = sig.blend(BPF.ar(sig, 1500, 0.5), 0.9);
|
|
|
|
}.play(fadeTime: 2);
|
|
|
|
)
|
|
|
|
|
|
x.release;
|
|
|
|
|
|
MIDIClient.init;
|
|
MIDIClient.sources.do;
|
|
|
|
|
|
(
|
|
SynthDef(\rhubarb, {
|
|
|freq = 440, gate = 1, cutoff = 1000, rq = 0.3, amp = 0.05, modDepth = 1, noiseLevel = 0.05|
|
|
var env, osc, filt, lfo, noise, sig;
|
|
|
|
// Single Sawtooth Oscillator
|
|
osc = SinOsc.ar(freq);
|
|
osc2 = SinOsc.ar(freq);
|
|
|
|
// Subtle Noise Layer
|
|
// noise = PinkNoise.ar(noiseLevel);
|
|
|
|
// LFO to Modulate Filter
|
|
lfo = LFNoise0.kr(4).range(1 - modDepth, 1 + modDepth); // Triangle LFO at 2.94 Hz
|
|
|
|
// Low-pass filter modulated by LFO
|
|
filt = SVF.ar(osc, cutoff * lfo, rq);u
|
|
filt2 = BMoog.ar(osc, freq * lfo, rq);
|
|
|
|
// ADSR Envelope with Long Attack & Release
|
|
env = EnvGen.kr(Env.adsr(0.0, 0.3, 0.8, 2.0), gate, doneAction: 2);
|
|
|
|
sig = Pan2.ar(filt * env * amp, 0);
|
|
sig2 = Pan2.ar(filt * env * amp, 0);
|
|
|
|
// Output
|
|
Out.ar(0, sig);
|
|
}).add;
|
|
)
|
|
|
|
(
|
|
SynthDef(\rhubarb, {
|
|
|freq = 440, gate = 1, cutoff = 1e4, rq = 0.3, amp = 0.05, modDepth = 0.3, modDepth2 = 0.5, noiseLevel = 0.8, ringFreq = 80|
|
|
var env, osc1, osc2, osc3, filt1, filt2, filt3, lfo, lfo2, noise, noiseFilt, sig1, sig2, sig3, mix;
|
|
|
|
// Slightly Different Oscillators
|
|
osc1 = SinOsc.ar(freq);
|
|
osc2 = SinOsc.ar(freq * 0.5); // Slight detune for variation
|
|
osc3 = SawDPW.ar(freq * 2);
|
|
|
|
// LFO to Modulate Filter Frequency
|
|
lfo = LFNoise0.kr(4).range(1 - modDepth, 1 + modDepth);
|
|
lfo2 = LFNoise2.kr(4).range(1 - modDepth, 1 + modDepth);
|
|
// lfo2 = noise;
|
|
|
|
// Apply Different Filters to Each Oscillator
|
|
filt1 = SVF.ar(osc1, cutoff * lfo, rq);
|
|
filt2 = LPF.ar(osc2, cutoff * lfo, rq);
|
|
filt3 = BPF.ar(osc3, cutoff * lfo2, rq);
|
|
|
|
|
|
// ADSR Envelope
|
|
env = EnvGen.kr(Env.adsr(0.0, 0.3, 0.3, 0.1), gate, doneAction: 2);
|
|
|
|
// Panning and Mixing
|
|
sig1 = Pan2.ar(filt1 * env * amp, -0.3);
|
|
sig2 = Pan2.ar(filt2 * env * amp, 0.3);
|
|
sig3 = Pan2.ar(filt3 * env * amp, 0);
|
|
|
|
mix = sig1 + sig2; // Mix main signals
|
|
// mix = mix + (noise * env * noiseLevel); // Add noise with envelope control
|
|
|
|
// mix = DelayC.ar(mix, maxdelaytime: 0.2, delaytime: 0.3);
|
|
|
|
// Output
|
|
Out.ar(0, mix);
|
|
}).add;
|
|
|
|
|
|
~synths = Dictionary.new; // Store active notes
|
|
|
|
MIDIFunc.noteOn({ |vel, num, chan, src|
|
|
var freq = num.midicps; // Convert MIDI note to Hz
|
|
var amp = vel.linexp(1, 127, 0.05, 0.5); // Velocity mapping
|
|
|
|
~synths[num] = Synth(\rhubarb, [\freq, freq, \amp, amp]); // Store synth instance
|
|
});
|
|
)
|
|
|
|
|
|
|
|
(
|
|
Pbind(
|
|
\instrument, \rhubarb,
|
|
/*\degree, Pseq([
|
|
[2, 4, 7, 12], [1, 5, 9], [4, 7, 11], [5, 9, 8]
|
|
], inf), // Chord progression*/
|
|
// \degree, Pseq([[2, 7, 11], [1, 5, 9], [3, 9], [1,3,5]], inf),
|
|
\degree, Pseq([2, 4, 11,], inf),
|
|
// \dur, 0.5, // Duration of each chord
|
|
\amp, 0.08, // Volume
|
|
// \cutoff, 1200,
|
|
\detune, 0, // Slight detune
|
|
\pan, Pwhite(-0.3, 0.3), // Random stereo width
|
|
).play;
|
|
)
|
|
|
|
|
|
(
|
|
SynthDef(\pad, {
|
|
var sig;
|
|
|
|
sig = Mix(
|
|
|
|
Out.ar(0, sig);
|
|
}).play;
|
|
)
|
|
|
|
|