(buf)ampslice and (buf)ampgate helpfiles done

nix
Pierre Alexandre Tremblay 6 years ago
parent 27272ee6fb
commit d31e3f0dde

@ -1,5 +1,5 @@
TITLE:: FluidAmpGate TITLE:: FluidAmpGate
SUMMARY:: Amplitude-based Slicer SUMMARY:: Amplitude-based Gating Slicer
CATEGORIES:: Libraries>FluidDecomposition CATEGORIES:: Libraries>FluidDecomposition
RELATED:: Guides/FluCoMa, Guides/FluidDecomposition RELATED:: Guides/FluCoMa, Guides/FluidDecomposition
@ -126,10 +126,10 @@ code::
//drum slicing, many ways //drum slicing, many ways
//load a buffer //load a buffer
b = Buffer.read(s,File.realpath(FluidAmpGate.class.filenameSymbol).dirname.withTrailingSlash ++ "../AudioFiles/Nicol-LoopE-M.wav"); b = Buffer.read(s,File.realpath(FluidAmpGate.class.filenameSymbol).dirname.withTrailingSlash ++ "../AudioFiles/Nicol-LoopE-M.wav");
//have fun with a gate (explore lookahead and lookback, but correct for latency) //have fun with a gate (explore lookahead and lookback, but correct for latency, which will be the greatest of the lookahead and lookback)
( (
{var env, source = PlayBuf.ar(1,b); {var env, source = PlayBuf.ar(1,b);
env = FluidAmpGate.ar(source, rampUp:1103, rampDown:2205, onThreshold:-27, offThreshold: -31, minSilenceLength:1100, lookBack:441, highPassFreq:40); env = FluidAmpGate.ar(source, rampUp:441, rampDown:2205, onThreshold:-27, offThreshold: -31, minSilenceLength:1100, lookBack:441, highPassFreq:20);
[DelayN.ar(source,delaytime:441/44100), env] [DelayN.ar(source,delaytime:441/44100), env]
}.plot(2, separately:true); }.plot(2, separately:true);
) )

@ -1,5 +1,5 @@
TITLE:: FluidAmpSlice TITLE:: FluidAmpSlice
SUMMARY:: Amplitude-based Slicer SUMMARY:: Amplitude-based Detrending Slicer
CATEGORIES:: Libraries>FluidDecomposition CATEGORIES:: Libraries>FluidDecomposition
RELATED:: Guides/FluCoMa, Guides/FluidDecomposition RELATED:: Guides/FluCoMa, Guides/FluidDecomposition
@ -52,23 +52,23 @@ EXAMPLES::
code:: code::
// detrending explained // detrending explained
// the source is a sinewave that does not go to silence and has sharp-ish amplitude bumps as onsets we try to track // Our source here is a sinewave that does not go to silence and has sharp-ish amplitude bumps as onsets we try to track
( (
{var env, source = SinOsc.ar(320,0,LFSaw.ar(20,0, -0.4, 0.6)); {var env, source = SinOsc.ar(320,0,LFSaw.ar(20, 0, -0.4, 0.6));
env = FluidAmpSlice.ar(source,fastRampUp: 5,fastRampDown: 50,slowRampUp: 220,slowRampDown: 220, onThreshold: 10, offThreshold: 10,floor: -60); env = FluidAmpSlice.ar(source,fastRampUp: 5,fastRampDown: 50,slowRampUp: 220,slowRampDown: 220, onThreshold: 10, offThreshold: 10,floor: -60);
[source, env] [source, env]
}.plot(0.08); }.plot(0.08);
) )
//beware of double trigger at the begining of the 2nd cycle above). A solution: Schmidth triggers //beware of double trigger at the begining of the 2nd cycle above). A solution: Schmidth triggers
( (
{var env, source = SinOsc.ar(320,0,LFSaw.ar(20,0, -0.4, 0.6)); {var env, source = SinOsc.ar(320,0,LFSaw.ar(20, 0, -0.4, 0.6));
env = FluidAmpSlice.ar(source,fastRampUp: 5,fastRampDown: 50,slowRampUp: 220,slowRampDown: 220, onThreshold: 10, offThreshold: 7,floor: -60); env = FluidAmpSlice.ar(source,fastRampUp: 5,fastRampDown: 50,slowRampUp: 220,slowRampDown: 220, onThreshold: 10, offThreshold: 7,floor: -60);
[source, env] [source, env]
}.plot(0.08); }.plot(0.08);
) )
// another solution: minslicelength // another solution: minslicelength
( (
{var env, source = SinOsc.ar(320,0,LFSaw.ar(20,0, -0.4, 0.6)); {var env, source = SinOsc.ar(320,0,LFSaw.ar(20, 0, -0.4, 0.6));
env = FluidAmpSlice.ar(source,fastRampUp: 5,fastRampDown: 50,slowRampUp: 220,slowRampDown: 220, onThreshold: 10, offThreshold: 7,floor: -60, minSliceLength: 220); env = FluidAmpSlice.ar(source,fastRampUp: 5,fastRampDown: 50,slowRampUp: 220,slowRampDown: 220, onThreshold: 10, offThreshold: 7,floor: -60, minSliceLength: 220);
[source, env] [source, env]
}.plot(0.08); }.plot(0.08);

@ -1,5 +1,5 @@
TITLE:: FluidBufAmpGate TITLE:: FluidBufAmpGate
SUMMARY:: Amplitude-based Slicer for Buffers SUMMARY:: Amplitude-based Gating Slicer for Buffers
CATEGORIES:: Libraries>FluidDecomposition CATEGORIES:: Libraries>FluidDecomposition
RELATED:: Guides/FluCoMa, Guides/FluidDecomposition, Guides/FluidBufMultiThreading RELATED:: Guides/FluCoMa, Guides/FluidDecomposition, Guides/FluidBufMultiThreading
@ -145,7 +145,7 @@ c = Buffer.new(s);
) )
// slice the samples // slice the samples
FluidBufAmpGate.process(s, b, indices:c, rampUp:1103, rampDown:2205, onThreshold:-27, offThreshold: -31, minSilenceLength:1100, lookBack:441, highPassFreq:40) FluidBufAmpGate.process(s, b, indices:c, rampUp:110, rampDown:2205, onThreshold:-27, offThreshold: -31, minSilenceLength:1100, lookBack:441, highPassFreq:40)
c.query c.query
c.getn(0,c.numFrames*2,{|item|item.postln;}) c.getn(0,c.numFrames*2,{|item|item.postln;})
//reformatting to read the onsets and offsets as pairs //reformatting to read the onsets and offsets as pairs
@ -184,7 +184,7 @@ c = Buffer.new(s);
// with basic params // with basic params
Routine{ Routine{
t = Main.elapsedTime; t = Main.elapsedTime;
FluidBufAmpGate.process(s, b, indices: c, rampUp:1, rampDown:20); FluidBufAmpGate.process(s, b, indices: c, rampUp:1, rampDown:10, onThreshold: -30);
(Main.elapsedTime - t).postln; (Main.elapsedTime - t).postln;
}.play }.play
) )

@ -1,5 +1,5 @@
TITLE:: FluidBufAmpSlice TITLE:: FluidBufAmpSlice
SUMMARY:: Amplitude-based Slicer for Buffers SUMMARY:: Amplitude-based Detrending Slicer for Buffers
CATEGORIES:: Libraries>FluidDecomposition CATEGORIES:: Libraries>FluidDecomposition
RELATED:: Guides/FluCoMa, Guides/FluidDecomposition, Guides/FluidBufMultiThreading RELATED:: Guides/FluCoMa, Guides/FluidDecomposition, Guides/FluidBufMultiThreading
@ -79,7 +79,7 @@ code::
// detrending explained // detrending explained
// define a test signal and a destination buffer // define a test signal and a destination buffer
( (
b = Buffer.sendCollection(s, Array.fill(44100,{|i| sin(i*pi/ (44100/640)) * ((((35000-i)/30000)%0.8) + 0.2)})); b = Buffer.sendCollection(s, Array.fill(44100,{|i| sin(i*pi/ (44100/640)) * ((((79000-i) % 22050).abs / 28000.0) + 0.2)}));
c = Buffer.new(s); c = Buffer.new(s);
) )
// the source is a sinewave that does not go to silence and has sharp-ish amplitude bumps as onsets we try to track // the source is a sinewave that does not go to silence and has sharp-ish amplitude bumps as onsets we try to track

Loading…
Cancel
Save