I’m having issues with some of my looper / bufPlayer synths. I have written a few variants but here is the simplest one: playback of a soundfile read simultaneously by different playback heads which is then processed by delay and filter effects. A variant of this is to record into a buffer and loop the playback at different rates. The inspiration is the Destroy FX Transverb AU plugin and also the classic Max/MSP stutter patch.
{ |rate=#[1,1,1,1],buf,rq=0.25,t_trig=1|
var playbackEnv,sig,phasor,delayedSig;
var lfo = SinOsc.ar(4.collect({0.1.rand})).range(100,10000);
// Playback Head
phasor = Phasor.ar(0, (BufRateScale.ir(buf) * rate), TRand.kr(0,BufSamples.ir(buf),t_trig), BufSamples.ir(buf));
sig = BufRd.ar(2, buf, phasor);
// Spatialization
sig = RLPF.ar(sig, lfo, rq);
sig = Splay.ar(sig);
delayedSig = CombL.ar(sig, 0.2,LFSaw.ar(0.001.rand,1.0.rand), 10, \wet.kr(0.7));
sig = Mix.ar([sig, delayedSig]);
sig = sig*EnvGen.kr(Env.asr(releaseTime: \rel.kr(6)), \gate.kr(1),doneAction:Done.freeSelf)*\amp.kr(0);
Out.ar(\out.kr(0),sig);
}
I can get this fairly reliably to cause audio processing to completely stop on my machine. It doesn’t crash the server or client, just a loud click and no more sound. In the past, all audio processing would cease however, recently I observed this only occuring only after the point on the node graph where the synth was running.
How do I debug this type of problem if there is no crash, heap log or error message? What causes scsynth to stop processing audio entirely?
Is this a node order thing? An i/o issue? Is the buffer not properly allocated in memory (I am using Buffer.read
)? Is there some kind of race condition? Is it simply too CPU intensive. Does it matter in this context if I am using .ir
vs. .kr
for the BufRateScale UGens?
Any help would be appreciated.