[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Playbuf Done Actions / Triggering Samples and PlayBufs



Hi,

not sure if I got the whole picture but as I understand it, a number of samples should be played without rest. That's sequencing and can most easily be done with patterns, there's no need for a trigger logic inside a SynthDef or from server back to language.

(
~bufNames = ["a11wlk01-44_1.aiff", "a11wlk01.wav"];
~bufs = ~bufNames.collect { |n| Buffer.read(s, Platform.resourceDir +/+ "sounds" +/+ n) };

SynthDef(\playBuf, { |out, buf, rate = 1|
Out.ar(out, PlayBuf.ar(1, buf, BufRateScale.kr(buf) * rate))
}).add;
)


// fast tempo and random sequence, dur must fit

(
x = Pbind(
\instrument, \playBuf,
\rate, 10,
\buf, Prand(~bufs, inf),
\dur, Pkey(\buf).collect(_.duration) / Pkey(\rate)
).play
)

x.stop


Regards

Daniel

-----------------------------
http://daniel-mayer.at
-----------------------------