Skip to content

Instantly share code, notes, and snippets.

@catfact
Created November 3, 2016 22:58
Show Gist options
  • Save catfact/1b7b7fa9f4c82602b03b9ed405aff7ef to your computer and use it in GitHub Desktop.
Save catfact/1b7b7fa9f4c82602b03b9ed405aff7ef to your computer and use it in GitHub Desktop.
filter excitation signal generator
Routine {
/* // continuous white noise
~noise = { arg out=1, amp=0.125; Out.ar(out, WhiteNoise.ar * amp) }.play;
~noise.free;
*/
SynthDef.new(\ping_noise_decay, {
arg out=1, amp=0.25, atk=0.0, rel=0.001;
Out.ar(out,
WhiteNoise.ar
* EnvGen.ar(Env.perc(atk, rel),doneAction:2)
* amp);
}).load(s);
SynthDef.new(\ping_noise_pulse, {
arg out=1, amp=0.25, dur=0.001;
Out.ar(out,
WhiteNoise.ar
* EnvGen.ar(Env.linen(0.0, dur, 0.0), doneAction:2)
* amp);
}).load(s);
SynthDef.new(\ping_dc_decay, {
arg out=1, amp=0.25, atk=0.0, rel=0.001;
Out.ar(out,
EnvGen.ar(Env.perc(atk, rel),doneAction:2)
* amp);
}).load(s);
SynthDef.new(\ping_dc_pulse, {
arg out=1, amp=0.25, dur=0.0001;
Out.ar(out,
WhiteNoise.ar
* EnvGen.ar(Env.linen(0.0, dur, 0.0), doneAction:2)
* amp);
}).load(s);
s.sync;
~def = \ping_dc_decay;
~ping_dt = 1.0;
~ping_r = Routine { inf.do {
Synth.new(~def, [], s);
~ping_dt.wait;
} }.play;
/* // execute one at a time to change the ping type
~def = \ping_noise_pulse;
~def = \ping_noise_decay;
~def = \ping_dc_pulse;
~def = \ping_dc_decay;
*/
}.play;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment