Error("FluidBufToKr:kr needs to be passed either an existing buffer or an OutputProxy and a number of frames for the buffer that will be supplied").throw;
});
if(numFrames==-1,{
numFrames=buffer.numFrames;
});
if(numFrames==0){"FluidKrToBuf:kr indicated numFrames is zero.".warn};
if(numFrames>1000){
Error("FluidKrToBuf: Buffer is indicated to have % frames. This is probably not the buffer you intended.".format(numFrames)).throw;
@ -14,6 +14,9 @@ Initialize an instance of this pseudo UGen
ARGUMENT:: 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::.
INSTANCEMETHODS::
@ -21,19 +24,37 @@ INSTANCEMETHODS::
EXAMPLES::
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!
(
{
var sig = FluidBufToKr.kr(~buf);
sig.poll;
}.play;
)
// =============== passing a buffer as an argument ======================
// create a synth that both writes into a buffer (with FluidKrToBuf) and reads