Here's the code,
(
SynthDef("Moog",{
arg oscType =0, oscType2 = 0, pan = 0, level = 0.5, cutoff = 500, gain = 3.3,
attack = 0.1, decay = 0.1, sust = 0.7, rel = 0.2, attackf = 0.1, decayf = 0.1,
sustf = 0.9, relf = 0.2, gate = 1, freq =440, lagLev = 0.2, lfo1Rate = 12,
lfo2Rate =4, lfo3Rate = 6;
var lfo1 = Lag2.kr(LFSaw.kr(lfo1Rate), 0.1);
var lfo2 = Lag2.kr(LFTri.kr(lfo2Rate), 0.1);
var lfo3 = Lag2.kr(SinOsc.kr(lfo3Rate), 0.1);
var oscArray = [Saw.ar(Lag.kr(freq, lagLev)), SinOsc.ar(Lag.kr(freq, lagLev)),
Pulse.ar(Lag.kr(freq, lagLev)),Saw.ar(Lag.kr(freq, lagLev), lfo1),
SinOsc.ar(Lag.kr(freq, lagLev),0, lfo1), Pulse.ar(Lag.kr(freq, lagLev), lfo1),
Saw.ar(Lag.kr(freq, lagLev),lfo2), SinOsc.ar(Lag.kr(freq, lagLev), 0,lfo2),
Pulse.ar(Lag.kr(freq, lagLev), lfo2), Saw.ar(Lag.kr(freq, lagLev), lfo3),
SinOsc.ar(Lag.kr(freq, lagLev), 0, lfo3), Pulse.ar(Lag.kr(freq, lagLev), 0, lfo3)];
var oscArray2 = [Saw.ar(Lag.kr(freq, lagLev)), SinOsc.ar(Lag.kr(freq, lagLev)),
Pulse.ar(Lag.kr(freq, lagLev)),Saw.ar(Lag.kr(freq, lagLev), lfo1),
SinOsc.ar(Lag.kr(freq, lagLev),0, lfo1), Pulse.ar(Lag.kr(freq, lagLev), lfo1),
Saw.ar(Lag.kr(freq, lagLev),lfo2), SinOsc.ar(Lag.kr(freq, lagLev), 0,lfo2),
Pulse.ar(Lag.kr(freq, lagLev), lfo2), Saw.ar(Lag.kr(freq, lagLev), lfo3),
SinOsc.ar(Lag.kr(freq, lagLev), 0, lfo3), Pulse.ar(Lag.kr(freq, lagLev), 0, lfo3)];
var ampEnv = EnvGen.ar(Env.adsr(attack, decay, sust, rel), gate, doneAction:2);
var filterEnv = EnvGen.ar(Env.adsr(attackf, decayf, sustf, relf), gate, doneAction:2);
var osc1 = Select.ar(oscType, oscArray);
var osc2 = Select.ar(oscType2, oscArray2);
var fade = Pan2.ar(XFade2.ar(osc1, osc2, pan , level * ampEnv, 0));
var filter = MoogFF.ar(fade, cutoff * filterEnv, gain);
Out.ar(0,filter)
}).store
)
And here's a download link
I'll talk a bit more about this later.
Hail Atlantis.
No comments:
Post a Comment