FluidBufToKr help file

nix
Ted Moore 4 years ago
parent e6e37130e5
commit 289360f5d3

@ -14,6 +14,9 @@ Initialize an instance of this pseudo UGen
ARGUMENT:: buffer ARGUMENT:: buffer
The link::Classes/Buffer:: that this pseudo UGen will read out of. Must be a one-channel buffer. The link::Classes/Buffer:: that this pseudo UGen will read out of. Must be a one-channel buffer.
ARGUMENT:: numFrames
How many frames the buffer is that will evenutally passed. If providing a buffer directly (instead of as an argument to a SynthDef), the default of -1 will get the number of frames from the buffer passed.
returns:: a Kr stream that has the same number of channels as frames in the link::Classes/Buffer::. returns:: a Kr stream that has the same number of channels as frames in the link::Classes/Buffer::.
INSTANCEMETHODS:: INSTANCEMETHODS::
@ -21,19 +24,37 @@ INSTANCEMETHODS::
EXAMPLES:: EXAMPLES::
code:: code::
// make a buffer with some data in it
~buf = Buffer.loadCollection(s,[0,1,2,3,4,7]);
// play it on the server and read out of this buffer!
( (
// FluidBufToKr {
s.waitForBoot{ var sig = FluidBufToKr.kr(~buf);
Routine{ sig.poll;
var buf = Buffer.loadCollection(s,[0,1,2,3,4,7]); }.play;
)
s.sync; // =============== passing a buffer as an argument ======================
{ // create a synth that both writes into a buffer (with FluidKrToBuf) and reads
var sig = FluidBufToKr.kr(buf); // out of the same buffer (with FluidBufToKr)
sig.poll; (
}.play; ~synth = {
}.play; arg buf = 999;
} FluidKrToBuf.kr(SinOsc.kr(Array.fill(5,{rrand(0.0,1.0)})),buf);
// you need to specify the 5 so the synth here will know how many channels to make
// the output proxy
FluidBufToKr.kr(buf,5).poll;
}.play;
// you should see all zeros! (unless your buffer #999 has something in it already!)
) )
// ...then after it is running, instantiate the buffer
~buffer = Buffer.alloc(s,5);
// ...then send it to the buffer
~synth.set(\buf,~buffer);
// you should be able to see the sine oscillators now!
:: ::
Loading…
Cancel
Save