Skip to content

Instantly share code, notes, and snippets.

@moxuse
Created April 4, 2020 14:38
Show Gist options
  • Save moxuse/0b060b06f07e12afe05a2d75172987ec to your computer and use it in GitHub Desktop.
Save moxuse/0b060b06f07e12afe05a2d75172987ec to your computer and use it in GitHub Desktop.
(
SynthDef(\lead, {arg note=0, gate=1;
var osc, env, freq, dPat;
dPat = (0.45, 0.4 .. 0.1);
freq = (60 + note).midicps;
env = EnvGen.ar(Env.perc(0.2, 6, 1, -2), gate, doneAction:2);
osc = DynKlank.ar(
`[[freq, freq * 0.75, freq * 1.5, freq * 5], nil, [1, 1, 1, 1]],
ClipNoise.ar(0.02)
)
* Decay2.ar(TDuty.ar(Dseq(dPat, inf)), 0, 1)
* env;
4.do({
osc = AllpassC.ar(
osc,
[{0.01.rand}, {0.02.rand}],
{0.04.rand},
2
);
});
Out.ar(0,
(osc * 16).softclip * 0.4
);
}).store;
)
s.sendMsg("/s_new", \lead, s.nextNodeID, 1, 0, \note, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment