Multiple doneAction:2?

Hi list,

sorry if this has been asked before:

In one synthdef I have two EnvGens with doneAction:2 which both take different
times to complete their envelopes. It seems the earlier one will free
the synth node. Is there a way to have the EnvGen that finishes last
free the node instead? I have looked at the docs for Done but can’t seem
to find it.


Yes. Use two’s and a outputs 1 if the input UGen’s done flag is set, otherwise 0. Multiply the two’s together so that is triggered if and only if both’s are nonzero.

	var env1, env2, snd;
	env1 =[0, 1, 0], [0.1, 1]));
	env2 =[0, 1, 0], [0.1, 5]));
	snd = * env1 * env2; *;
	snd ! 2;
}.play(fadeTime: 0);

thank you so much, this sounds like a great solution!
Btw, what does .play(fadeTime: N) specify?

fadetime is a jitlib thing. If you were using jitlib, it would control the crossfading time between proxyspace nodes

fadeTime isn’t only jitlib – it’s also an argument to Function:play – “Crossfade time for attack and release of the synth. The default is 0.02 seconds, which is just enough to avoid a click.”


1 Like

Ah cool! So you don’t have to use an EnvGen