Very simple question about release vs free

sometimes when I try to use the release message I am unable to and resort to using free… I was curious why one works and one not… Im sure it’s something simple thats by design that I am just not understanding.

(
x = {
	var sig;
	sig = VarSaw.ar(330, mul:0.1);
}.play;
)


x.release

/// x fades out

(
SynthDef(\test, { |out = 0|
	var sig;
	sig = VarSaw.ar(330, mul:0.1);
	Out.ar(out, sig)
}).add;
)

x = Synth(\test);
x.release

/// x dose not release but the free message dose work 

From the ‘Node’ help file under .releaseMsg:

This method causes the receiver to be freed after the specified amount of time. This is a convenience method which assumes that the synth contains an envelope generator (an EnvGen, Linen, or similar UGen) running a sustaining envelope (see Env: Sustained Envelope Creation Methods) and that this envelope’s gate argument is set to a control called \gate .

So in other words, release works if there is sustaining envelope present which is not the case in your example.

1 Like

Ahhh I get it.
Thank you so much for the explanation. The help files are great but I am still trying figure out how to navigate them more usefully

Yes it can be confusing indeed. A lot of useful info about synths are found in the Node help file.

1 Like