Hey,
I want to do a fadein/fadeout with a buffer that is running in a loop (see code below). But everytime the buffer has played once, the SynthDef stops, even with doneAction:0 in the envelope.
Is there a workaround? I think I could use a Tdef, but I would like to solve the problem within the SynthDef. Any Suggestions? Thank you
(
SynthDef(\pback, {
arg out = 0, bufnum = 0;
var playbuf, env, e;
e = Env([0, 1, 1, 0],[1, 2, 1 ]);
env = EnvGen.ar(e,1, doneAction:0);
playbuf = PlayBuf.ar(2, b, rate:1, loop:1);
playbuf = playbuf * env;
Out.ar(out, playbuf);
}).play;
)