First I had a doneAction in PlayBuf, which didn’t work with the DelayN of 1 sec on a very short sample. Supposedly the disposal happens before I can hear the sound. DelayN has no doneAction, as I understand the documentation. So I tried DetectSilence with several Done values, but now disposal doesn’t happen at all. Any suggestion, how to fix that? Thanks for your help.
(My intention here is bring in some temporal randomness.)
(
SynthDef.new(\bufplay, {
arg buf=0, rate=1, amp=1, pan=0, delay=1;
var sig;
sig = PlayBuf.ar(1, buf, BufRateScale.kr(buf) * rate); // , doneAction: 2);
sig = DelayN.ar(sig, delay, delay);
sig = sig * amp;
sig = Pan2.ar(sig, pan);
DetectSilence.ar(sig, doneAction: Done.freeSelfAndDeepFreeNext);
Out.ar(0, sig);
}).add;
)
x = Synth.new(\bufplay, b['mid'][0])