Reapply a SynthDef-filter after freeing a previous one


I’ve defined this SynthDef-Filter and applied it on a signal. It works fine.

SynthDef(\stomperFilter, {
	arg in=0, out = 0, freq= 440, effect=1, mix=1;
	var orig,sig,rq;;
	rq=effect.neg.lincurve(-1,0,0.0001,1,8,\minmax);,freq,rq,1/rq.pow(1.2).sqrt);,sig,mix.linlin(0,1,-1,1));, sig);

// Play noise and apply the effect
~noise={}.play;\stomperFilter, args: [\in:0, \out:0]);
// Stop the effect
~filter.release(1); // KO -- doesn't stop the effect; // OK

However, when I try to apply another SynthDef-Filter after having closed the previous one, it doesn’t work. I still got my plain White Noise.

// And reapply another effect\stomperFilter, args: [\in:0, \out:0]); // KO -- doesn't apply that filter

Why ?

You need to control the order of execution.


1 Like
~filter.release(1); // KO -- doesn't stop the effect

That’s because there is no gate in your \stomperFilter synthdef, .release set the gate to 0 to release the synth

1 Like