Skip to content

Instantly share code, notes, and snippets.

@Rampoina
Created November 20, 2015 19:32
Show Gist options
  • Save Rampoina/9fb555c053faf5e97b24 to your computer and use it in GitHub Desktop.
Save Rampoina/9fb555c053faf5e97b24 to your computer and use it in GitHub Desktop.
3DPulse
SynthDef.new("3DPulse",
{
arg freq=440, z=0, gate=0, bend=0, y = 0;
var f, signal, env;
f = freq * bend.midiratio;
env = EnvGen.kr(Env.adsr(attackTime: 0.1,sustainLevel: 1, releaseTime: 0.5), gate, doneAction: 2);
signal = Pulse.ar(freq: f, width: y.linlin(0, 127, 0.5, 0.2), mul: 0.2);
signal = LPF.ar(in: signal, freq: z.linexp(0, 127, 50, 2500))!2*env;
Out.ar(0, signal);
}).add;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment