diff --git a/release-packaging/Examples/buffer_compositing/bufcompose-MS-FIR.scd b/release-packaging/Examples/buffer_compositing/bufcompose-MS-FIR.scd index b13b37a..d72ecc9 100644 --- a/release-packaging/Examples/buffer_compositing/bufcompose-MS-FIR.scd +++ b/release-packaging/Examples/buffer_compositing/bufcompose-MS-FIR.scd @@ -19,7 +19,11 @@ FluidBufCompose.process(s,b, numChans: 1, gain: -3.0.dbamp * -1.0, startChan: 1, // (optional) compare auraly the stereo with the MS b.play; -{PlayBuf.ar(1,[c,d])}.play; +{PlayBuf.ar(1, [c,d])}.play; + +//check nullsum with real-time versions +{PlayBuf.ar(1, c) - PlayBuf.ar(2, b).madd(-3.0.dbamp).sum}.play; +{PlayBuf.ar(1, d) - PlayBuf.ar(2, b).madd(-3.0.dbamp * [1,-1]).sum}.play; // The geeky bit: copy the side (buffer d) on itself with specific amplitudes and delays, in effect applying a FIR filter through expensive convolution diff --git a/release-packaging/Examples/buffer_compositing/fileiterator-2passes.scd b/release-packaging/Examples/buffer_compositing/fileiterator-2passes.scd index e1d05ef..502518c 100644 --- a/release-packaging/Examples/buffer_compositing/fileiterator-2passes.scd +++ b/release-packaging/Examples/buffer_compositing/fileiterator-2passes.scd @@ -40,6 +40,6 @@ c.postln b.play -{PlayBuf.ar(1,b.bufnum,startPos:c[740])}.play +{PlayBuf.ar(1,b.bufnum,startPos:c[15])}.play Buffer.freeAll \ No newline at end of file diff --git a/release-packaging/Examples/buffer_compositing/fileiterator.scd b/release-packaging/Examples/buffer_compositing/fileiterator.scd index 9808f72..7e0f32a 100644 --- a/release-packaging/Examples/buffer_compositing/fileiterator.scd +++ b/release-packaging/Examples/buffer_compositing/fileiterator.scd @@ -37,4 +37,4 @@ b.plot c.postln b.play -{PlayBuf.ar(1,b.bufnum,startPos:c[740])}.play +{PlayBuf.ar(1,b.bufnum,startPos:c[15])}.play diff --git a/release-packaging/Examples/nb_of_slices.scd b/release-packaging/Examples/nb_of_slices.scd index c30174e..430c18d 100644 --- a/release-packaging/Examples/nb_of_slices.scd +++ b/release-packaging/Examples/nb_of_slices.scd @@ -7,6 +7,8 @@ c = Buffer.new(s); // with basic params Routine{ var startTime, target, tolerance, startThresh, prevThresh, curThresh, curVal, prevVal, iters, maxIters, dVal, dThresh; + var cond = Condition.new; + startTime = Main.elapsedTime; prevThresh = 0.1; //initial threshold (between 0.00001 and 0.99999 target = 10; //number of slices desired @@ -14,14 +16,17 @@ Routine{ maxIters = 100; //max number of iterations acceptable //makes a first iteration - FluidBufNoveltySlice.process(s,b, indices: c, threshold:prevThresh,action:{|x|prevVal = x.numFrames}); + FluidBufNoveltySlice.process(s,b, indices: c, threshold:prevThresh, action:{|x|prevVal = x.numFrames;\there.postln;cond.unhang;}); + \here.postln; + cond.hang; //makes a second iteration if ( (prevVal < target), { curThresh = (prevThresh * 0.5).max(0.000001); }, { curThresh = (prevThresh * 2).min(0.999999); }); - FluidBufNoveltySlice.process(s,b, indices: c, threshold:curThresh,action:{|x|curVal = x.numFrames}); + FluidBufNoveltySlice.process(s,b, indices: c, threshold:curThresh,action:{|x|curVal = x.numFrames;cond.unhang;}); + cond.hang; //makes further iterations until the result is achieved, or the maximum of acceptable iterations is reached iters = 2; @@ -42,7 +47,8 @@ Routine{ //if we have curThresh = (((dThresh / dVal) * (target - curVal)) + curThresh).min(0.999999).max(0.000001); }); - FluidBufNoveltySlice.process(s,b, indices: c, threshold:curThresh,action:{|x|curVal = x.numFrames}); + FluidBufNoveltySlice.process(s,b, indices: c, threshold:curThresh,action:{|x|curVal = x.numFrames;cond.unhang;}); + cond.hang; } ); //depending on the outcome, gives the right info back