Hello,
Goal: to move to specific locations of a sound file contained in a buffer, in sync with the clock (quant).
It seems that .set can not be synchronized with the quant parameter. So I tried to work around this problem with Ndefs:
// Loading sound into a buffer:
b = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
(// Definition of the tempo and the quantization:
t = TempoClock.default.tempo = 110/60;
Ndef(\sound).proxyspace.quant = 4.0;
)
Ndef(\sound).play;
//the initialization Ndefs for the settings:
(
Ndef(\rate, 1.0); Ndef(\start, 0); Ndef(\end, b.numFrames-1);
//Le Ndef qui jouera le son
Ndef(\sound, {
var ptr = Phasor.ar(trig:0, rate:Ndef(\rate), start:Ndef(\start), end:Ndef(\end));
BufRd.ar(2, b, phase:ptr, loop:1)
});
)
Then, I change the \ start and \ end parameters of the Phasor:
Ndef(\start, (40000)); Ndef(\end, 80000);
Ndef(\start, (10000)); Ndef(\end, 100000);
Ndef(\start, (30000)); Ndef(\end, 160000);
Ndef(\start, (60000)); Ndef(\end, 200000);
Ndef(\start, (20000)); Ndef(\end, 80000);
And here is the problem:
Sometimes, when I go from one setting to another (ctrl + enter on one of the lines above), there is a click, or a pop… or more. On the sound a11wlk01.wav, it is not necessarily very obvious but it happens. By cons, with some sounds, it happens very often.
My question: Is there a way to avoid that? (crossfade? how?)