pre release typos and new examples

nix
Pierre Alexandre Tremblay 5 years ago
parent f948988167
commit b24701daa1

@ -57,3 +57,18 @@ Routine{
// look at the interpolated values // look at the interpolated values
~mappingresult.plot ~mappingresult.plot
// change the number of neighbours to regress on
~knn.numNeighbours_(5)
~knn.fit(~simpleInput, ~simpleOutput, action:{"fitting done".postln})
// instead of doing the mapping per point, let's do a dataset of 512 points
~target = FluidDataSet(s)
~target.load(Dictionary.newFrom([\cols, 1, \data, Dictionary.newFrom(512.collect{|i|[i.asString, [i.asFloat * 61]]}.flatten)]))
~regressed = FluidDataSet(s)
~knn.predict(~target, ~regressed, action:{"prediction done".postln})
//dump the regressed values
~outputArray = Array.newClear(512);
~regressed.dump{|x| x["data"].keysValuesDo{|key,val|~outputArray[key.asInteger] = val[0]}}
~outputArray.plot

@ -60,63 +60,63 @@ RETURNS::
EXAMPLES:: EXAMPLES::
code:: code::
//basic tests: absThresh sanity //basic tests: threshold sanity
( (
{var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs); {var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs);
env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12); env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12);
[source, env] [source, env]
}.plot(0.1); }.plot(0.1);
) )
//basic tests: absThresh hysteresis //basic tests: threshold hysteresis
( (
{var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs); {var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs);
env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -16); env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -16);
[source, env] [source, env]
}.plot(0.1); }.plot(0.1);
) )
//basic tests: absThresh min slice //basic tests: threshold min slice
( (
{var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs); {var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs);
env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minSliceLength:441); env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minSliceLength:441);
[source, env] [source, env]
}.plot(0.1); }.plot(0.1);
) )
//basic tests: absThresh min silence //basic tests: threshold min silence
( (
{var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs); {var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs);
env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minSilenceLength:441); env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minSilenceLength:441);
[source, env] [source, env]
}.plot(0.1); }.plot(0.1);
) )
//mid tests: absThresh time hysteresis on //mid tests: threshold time hysteresis on
( (
{var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs); {var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs);
env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minLengthAbove:441); env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minLengthAbove:441);
[DelayN.ar(source,0.1,441/44100), env] [DelayN.ar(source,0.1,441/44100), env]
}.plot(0.1); }.plot(0.1);
) )
//mid tests: absThresh time hysteresis off //mid tests: threshold time hysteresis off
( (
{var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs); {var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs);
env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minLengthBelow:441); env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minLengthBelow:441);
[DelayN.ar(source,0.1,441/44100), env] [DelayN.ar(source,0.1,441/44100), env]
}.plot(0.1); }.plot(0.1);
) )
//mid tests: absThresh with lookBack //mid tests: threshold with lookBack
( (
{var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs); {var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs);
env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, lookBack:441); env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, lookBack:441);
[DelayN.ar(source,0.1,441/44100), env] [DelayN.ar(source,0.1,441/44100), env]
}.plot(0.1); }.plot(0.1);
) )
//mid tests: absThresh with lookAhead //mid tests: threshold with lookAhead
( (
{var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs); {var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs);
env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, lookAhead:441); env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, lookAhead:441);
[DelayN.ar(source,0.1,441/44100), env] [DelayN.ar(source,0.1,441/44100), env]
}.plot(0.1); }.plot(0.1);
) )
//mid tests: absThresh with asymetrical lookBack and lookAhead //mid tests: threshold with asymetrical lookBack and lookAhead
( (
{var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs); {var env, source = SinOsc.ar(320,0,LFTri.ar(10).abs);
env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, lookBack:221, lookAhead:441); env = FluidAmpGate.ar(source, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, lookBack:221, lookAhead:441);

@ -91,47 +91,47 @@ code::
) )
b.play b.play
b.plot b.plot
//basic tests: absThresh sanity //basic tests: threshold sanity
FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12) FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12)
c.query c.query
c.getn(0,c.numFrames*2,{|item|item.postln;}) c.getn(0,c.numFrames*2,{|item|item.postln;})
//basic tests: absThresh hysteresis //basic tests: threshold hysteresis
FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -16) FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -16)
c.query c.query
c.getn(0,c.numFrames*2,{|item|item.postln;}) c.getn(0,c.numFrames*2,{|item|item.postln;})
//basic tests: absThresh min slice //basic tests: threshold min slice
FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minSliceLength:441) FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minSliceLength:441)
c.query c.query
c.getn(0,c.numFrames*2,{|item|item.postln;}) c.getn(0,c.numFrames*2,{|item|item.postln;})
//basic tests: absThresh min silence //basic tests: threshold min silence
FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minSilenceLength:441) FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minSilenceLength:441)
c.query c.query
c.getn(0,c.numFrames*2,{|item|item.postln;}) c.getn(0,c.numFrames*2,{|item|item.postln;})
//mid tests: absThresh time hysteresis on //mid tests: threshold time hysteresis on
FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minLengthAbove:441) FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minLengthAbove:441)
c.query c.query
c.getn(0,c.numFrames*2,{|item|item.postln;}) c.getn(0,c.numFrames*2,{|item|item.postln;})
//mid tests: absThresh time hysteresis off //mid tests: threshold time hysteresis off
FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minLengthBelow:441) FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, minLengthBelow:441)
c.query c.query
c.getn(0,c.numFrames*2,{|item|item.postln;}) c.getn(0,c.numFrames*2,{|item|item.postln;})
//mid tests: absThresh with lookBack //mid tests: threshold with lookBack
FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, lookBack:441) FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, lookBack:441)
c.query c.query
c.getn(0,c.numFrames*2,{|item|item.postln;}) c.getn(0,c.numFrames*2,{|item|item.postln;})
//mid tests: absThresh with lookAhead //mid tests: threshold with lookAhead
FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, lookAhead:441) FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, lookAhead:441)
c.query c.query
c.getn(0,c.numFrames*2,{|item|item.postln;}) c.getn(0,c.numFrames*2,{|item|item.postln;})
//mid tests: absThresh with asymetrical lookBack and lookAhead //mid tests: threshold with asymetrical lookBack and lookAhead
FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, lookBack:221, lookAhead:441) FluidBufAmpGate.process(s, b, indices:c, rampUp:5, rampDown:25, onThreshold:-12, offThreshold: -12, lookBack:221, lookAhead:441)
c.query c.query
c.getn(0,c.numFrames*2,{|item|item.postln;}) c.getn(0,c.numFrames*2,{|item|item.postln;})

Loading…
Cancel
Save