«Buffers & LFNoise1» by BROKENCODE//

on 07 Jun'17 21:13 in buffersamplecontrolbuffers

a simple BufRd with the starting point of lecture randomized by LFNoise1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// you have to write the sample path in the firts line

~bufferdue = Buffer.read(s," WRITE YOUR SAMPLE PATH HERE ", bufnum:2);

(
SynthDef.new(\bufbeat, {
	arg amp = 1, out = 0, buf, start, end, freq = 1;
	var sig, ptr;
	ptr = LFNoise1.ar(freq).range(0.0,end);
	sig = BufRd.ar(2, buf, ptr);
	sig = sig * amp;
	Out.ar(out, sig);
}).add
)

x = Synth.new(\bufbeat, [\buf, ~bufferdue.bufnum, \start,0, \end, ~bufferdue.numFrames-1, \freq, 1, \amp, 0.5],g);

x.free;
descendants
«Re: Buffers & LFNoise1» by mutedial (private)
full graph
raw 478 chars (focus & ctrl+a+c to copy)
reception
comments
p.dupuis user 08 Jun'17 06:15

If you want to change the start position without changing the playback rate, use PlayBuf with a trigger : PlayBuf.ar(numChannels:2, bufnum:buf, rate:1, trigger:Impulse.ar(freq), startPos:ptr, loop:1)