In this example, the pattern will return an error every time it releases the synth because the Synth has already freed himself:
FAILURE IN SERVER /n_set Node 1060 not found
(
SynthDef(\beep, { |out, gate = 1, freq = 440, time = 0.1, amp = 0.1|
var sig = SinOsc.ar(freq);
var eg = EnvGen.ar(Env.perc(0.01, time), doneAction: 2);
Out.ar(out, (sig * amp * eg).dup);
}).add;
)
x=Pbind(\instrument,\beep,\dur,3,\freq,Pn(440,4)).play;
I don’t like having sets playing with errors, even “acceptable” ones.
So, is there a way to get rid of this error ?
In this simple example, one could just remove the doneAction
but in more complex examples this doneAction
can remain useful: the Synth can free himself automatically or after a gate. So this removing the doneAction
is (in my opnion) not an option.