Pmono, gate, and Pdefn

classic Classic list List threaded Threaded
1 message Options
emf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Pmono, gate, and Pdefn

emf
I'm a little unclear on how Pmono works with \gate and Pdefn. I'm sure there's a quick explanation of how and how not to do what I'm trying to do, I would appreciate a brief clarification, thanks!

Eli

(
SynthDef(\testTone, {
        arg freq=440, gate=1;
        var sig, env;
        env = EnvGen.kr(Env.asr(5,0.5,5), gate, doneAction:2);
        sig = SinOsc.ar(freq);
        sig = sig * env;
        Out.ar(0, sig);
}).add;
)

//test via Synth
x = Synth(\testTone); //instantiate
x.set(\gate, 0); //fade and free
//(behaves as expected)

(
q = Pmono(
        \testTone,
        \dur, Plprand(0.1,0.7,inf),
        \freq, Pwhite(220,880,inf),
        \gate, Pdefn(\testGate, 1),
)
)

x = q.play; //instantiate

Pdefn(\testGate, 0); //this doesn't fade and free the node?

x.stop; //but this does fade and free the node
Loading...