Little Problem with Doneaction:

Dear Community, I try to over work my FormatianSynth in Supercollider.
And there I have a big Problem.
I’m try to use DoneAction to delete a Synth after he has play.
So this my Synthdef:
// Prototyp Single_Formant_Filter
(
SynthDef(“Single_Formant_Filter”, { arg out=0, in=0, frequ = 200, freqo = 400, stability = 1, percusion = 1, hold = 1;
var input, output, middle, wide, env, noiseFx, modFreqo, modFrequ;
input = In.ar(in, 1);
env = Linen.kr();
noiseFx = Crackle.kr(env);
wide = (freqo - frequ);
// center = (frequ+freqo)/2;
modFrequ = frequ*(1+(noiseFx));
modFreqo = freqo*(1+(noiseFx));
middle = BLowPass4.ar(input, modFrequ);
output = RHPF.ar(middle, modFreqo);

    Out.ar(out, output);

}).send(s);
)
And this my calling Routine:

(r = Routine{
var bf1, x, y, time, freq;
bf1=Bus.audio(s, 1);
x = Synth.new(\Gran_Source, [out: bf1, bufnum: b]);
loop{
freq = rrand(0.3, 3);
x.set(\freq, freq);
Synth.after(x, “Single_Formant_Filter”, [\out, 0, \in, bf1] );
“One”.postln;
“Tne”.postln;
time = 1;
time.yield;
}
}:wink:

r.play;
r.stop;

not sure if it’s just out of scope but looks like \Gran_Source is not defined here

edit: sorry maybe was that part was pseudo code actually

Ok, dear Community,
I think I should use my brain more.
The Problem is easy, when I have no headache.
I’m was trying to use Linen as it is defined by standard.
But by Standard the Gate is set to 1.
Which will open the Sustain Level for infinite.
So it must correctly set down to 0, when the release would be called.
So this easy problem, is a misunderstanding of the manual.

So sorry for this little silly Question.

CreCo

No need to apologize, everyone has moments like this, no matter how experienced. :slight_smile: Glad you found a solution!

Brian