Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Custom event type for wiring up effects
name
code content
( // add custom event Event.addEventType(\nbind, {arg server; var id = (currentEnvironment[\ndef] ? currentEnvironment[\instrument]).asSymbol; var type = \note; if (Ndef(id).isPlaying.not) { Ndef(id).play; }; ~type = type; ~group = Ndef(id).group; ~out = Ndef(id).bus; currentEnvironment.play; }); // synth SynthDef(\synth1, {arg freq = 440, out = 0; var env = Env.perc.kr(doneAction:2); var sig = SinOscFB.ar(freq * [1, 1.01], 0.7); sig = sig * env; OffsetOut.ar(out, Splay.ar(sig)); }).add; // set up first set of fx Ndef(\fx1).play; Ndef(\fx1)[0] = \filter -> {arg in; in.abs; }; // set up additional fx Ndef(\fx2).play; Ndef(\fx2)[0] = \filter -> {arg in; in + AllpassC.ar(in, 0.2, 0.2, [3, 5]); }; ) // play a pattern Pbind(\instrument, \synth1, // specify custom event type \type, \nbind, // switch between fx \ndef, Pseq([\fx1, \fx2], inf), \degree, Pwhite(0, 5, inf) ).play;
code description
use markdown for formating
category tags
comma separated, i.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identificators, i.g. "1-C,1-1,1-4M,1-x"
Private?
the code will be accessible by direct url and not visible in public activity
signup to submit public code without captcha
comment of change