If, hypthetically, I like the crude down-sampling and skipping over samples… is there a way to do this? I noticed that I like the sound of the LFDNoise controlling the BufWr/BufRd functions, but that I couldn’t get it to repeat itself or “stop”, which is how I ended up in this rabbit hole.
If I understand what you’re saying correctly, it sounds like there’s no “good” way to scale Sweep to the BufFrames.kr(buf) range, but that replacing line 12 with the following partially “works” :
phase = Sweep.ar(trig, BufRateScale.kr(buf)*rate) * BufFrames.kr(buf);
It does remove the “gap”, at least… but using a sampled random waveform as a “guide” for successive iterations of BufRd and BufWr seem riddled with difficulty.
I was thinking the following could work, but with the Sweep.ar synchronized, I suspect that’s at least one reason I’m not getting the sound I’m expecting.
Should I be using a different uGen for this or is the idea just weird?
~b = Buffer.alloc(s, s.sampleRate * 4, 1);
(
SynthDef(\bufWrExample, { arg buf, rate = 1, loop = 0, trig = 0, trig2;
var signal, pos, phase, phase2, sig2, lb;
// Generate a random signal
signal = LFDNoise1.ar(0.4) + PinkNoise.ar(0.1);
lb = LocalBuf(48000*4, 1);
// write it into a localbuffer and scale the sweep across the BufFrames.
phase = Sweep.ar(trig, BufRateScale.kr(lb)*rate) * BufFrames.kr(lb);
BufWr.ar(signal, lb, phase, loop);
//take a fixed signal.
sig2 = SinOsc.ar(1000);
//write a buffer using the sampled noise buffer as a way of breaking the linearity.
BufWr.ar(sig2, buf, BufRd.ar(1, lb, phase*BufFrames.kr(lb))*BufFrames.kr(buf));
Out.ar(0, BufRd.ar(1, buf, Phasor.ar(1, 4, 0, BufFrames.kr(buf))));
}).add;
)
x = Synth(\bufWrExample, [
\buf, ~b,
\rate, 1,
\loop, 0
]);
x.set(\trig, 0);
x.set(\trig, 1);
// wait a moment, so the buffer is filled
~b.plot;