FluidBufToKr has optional numFrames argument

nix
Ted Moore 4 years ago
parent 8c63d3532f
commit 7736fb0f1d

@ -94,8 +94,7 @@ s.waitForBoot{
(
// FluidBufToKr
// 100 is fine
/// 1000 is fine
s.waitForBoot{
Routine{
var buf = Buffer.loadCollection(s,Array.fill(1001,{arg i; i}));
@ -112,8 +111,7 @@ s.waitForBoot{
(
// FluidBufToKr
// 100 is fine
/// 1000 is fine
// This should throw an error because this sound file buffer is longer than 1000 samples
s.waitForBoot{
Routine{
var buf = Buffer.read(s,"/Users/macprocomputer/Desktop/_flucoma/code/flucoma-core-src/AudioFiles/Harker-DS-TenOboeMultiphonics-M.wav");
@ -130,8 +128,7 @@ s.waitForBoot{
(
// FluidKrToBuf test with super long buffer
// 100 is fine
// 1000 is fine
// This should throw an error because this sound file buffer is longer than 1000 samples
s.waitForBoot{
Routine{
// var buf = Buffer.alloc(s,1000);
@ -151,3 +148,63 @@ s.waitForBoot{
}
)
// ===================== pass a buffer to a running synth =======================
(
s.waitForBoot{
Routine{
~synth = {
arg buf;
FluidBufToKr.kr(buf,5).poll;
}.play;
2.wait;
"make buffer".postln;
~buffer = Buffer.alloc(s,5);
s.sync;
~buffer.setn(0,Array.fill(5,{rrand(0,100)}));
s.sync;
~synth.set(\buf,~buffer);
}.play;
};
)
(
// throws error because number of frames not specified
s.waitForBoot{
Routine{
~synth = {
arg buf;
FluidKrToBuf.kr(SinOsc.kr(Array.fill(5,{rrand(0.0,1.0)})),buf);
FluidBufToKr.kr(buf).poll;
}.play;
2.wait;
~buffer = Buffer.alloc(s,5);
s.sync;
~synth.set(\buf,~buffer);
}.play;
};
)
(
// works
s.waitForBoot{
Routine{
~synth = {
arg buf;
FluidKrToBuf.kr(SinOsc.kr(Array.fill(5,{rrand(0.0,1.0)})),buf);
FluidBufToKr.kr(buf,5).poll;
}.play;
2.wait;
~buffer = Buffer.alloc(s,5);
s.sync;
~synth.set(\buf,~buffer);
}.play;
};
)
Loading…
Cancel
Save