FluidBufTransientSlice cleaned class definition, helpfile skeleton, and various test codes for other classes

nix
Pierre Alexandre Tremblay 7 years ago
parent 2a8049beb8
commit cc655a5d6c

@ -1,13 +1,11 @@
FluidBufTransientSlice{
*process { arg server, src, offsetframes = 0, numframes = -1, offsetchans = 0, numchans = -1, transbuf, order = 200, blocksize = 2048, padding = 1024, skew = 0, threshfwd = 3, threshback = 1.1, windowsize = 14, debounce = 25;
server = server ? Server.default
;if(src.bufnum.isNil) {Error("Invalid Buffer").format(thisMethod.name, this.class.name).throw};
server.sendMsg(\cmd, \BufTransientSlice, src.bufnum, offsetframes, numframes, offsetchans, numchans,
if( transbuf.isNil, -1, {transbuf.bufnum}), order, blocksize, padding, skew, threshfwd, threshback, windowsize, debounce);
*process { arg server, srcBufNum, startAt = 0, nFrames = -1, startChan = 0, nChans = -1, transBufNum, order = 200, blockSize = 2048, padding = 1024, skew = 0, threshFwd = 3, threshBack = 1.1, windowSize = 14, debounce = 25;
if(srcBufNum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
server = server ? Server.default;
transBufNum = transBufNum ? -1;
server.sendMsg(\cmd, \BufTransientSlice, srcBufNum, startAt, nFrames, startChan, nChans, transBufNum, order, blockSize, padding, skew, threshFwd, threshBack, windowSize, debounce);
}
}
}

@ -76,4 +76,5 @@ EXAMPLES::
code::
(some example code)
::
::

@ -60,4 +60,5 @@ EXAMPLES::
code::
b = Buffer.read(s,"../../../AudioFiles/01-mix.wav".resolveRelative);
b.play
::
::

@ -94,4 +94,5 @@ EXAMPLES::
code::
b = Buffer.read(s,"../../../AudioFiles/01-mix.wav".resolveRelative);
b.play
::
::

@ -60,11 +60,13 @@ ARGUMENT:: hopSize
ARGUMENT:: fftSize
(describe argument here)
returns:: (describe returnvalue here)
returns::
Nothing, as the various destination buffers are declared in the function call.
EXAMPLES::
code::
(some example code)
::
b = Buffer.read(s,"../../../AudioFiles/01-mix.wav".resolveRelative);
b.play
::

@ -1,7 +1,68 @@
s.reboot
b = Buffer.read(s,"/Users/owen/Desktop/denoise_stn/sources/01-mix.wav",0,44100);
c = Buffer.new
FluidBufTransientSlice.process(s,b,0,-1,0,-1,c,20,1024,1024,0,3,1.1,14,25)
//Num frames => num transients, values = indices (in samps)
c.query
TITLE:: FluidBufTransientSlice
summary:: Buffer-Based Transient-Based Slicer
categories:: Libraries>FluidDecomposition
related:: Guides/FluCoMa, Guides/FluidDecomposition
DESCRIPTION::
A non-real-time transient-based slice extractor implementing footnote::This was made possible thanks to the FluCoMa project (http://www.flucoma.org/) funded by the European Research Council (https://erc.europa.eu/) under the European Unions Horizon 2020 research and innovation programme (grant agreement No 725899).::
CLASSMETHODS::
METHOD:: process
(describe method here)
ARGUMENT:: server
(describe argument here)
ARGUMENT:: srcBufNum
(describe argument here)
ARGUMENT:: startAt
(describe argument here)
ARGUMENT:: nFrames
(describe argument here)
ARGUMENT:: startChan
(describe argument here)
ARGUMENT:: nChans
(describe argument here)
ARGUMENT:: transBufNum
(describe argument here)
ARGUMENT:: order
(describe argument here)
ARGUMENT:: blockSize
(describe argument here)
ARGUMENT:: padding
(describe argument here)
ARGUMENT:: skew
(describe argument here)
ARGUMENT:: threshFwd
(describe argument here)
ARGUMENT:: threshBack
(describe argument here)
ARGUMENT:: windowSize
(describe argument here)
ARGUMENT:: debounce
(describe argument here)
returns::
Nothing, as the various destination buffers are declared in the function call.
EXAMPLES::
code::
(some example code)
::

@ -66,4 +66,5 @@ EXAMPLES::
code::
(some example code)
::
::

@ -59,15 +59,5 @@ returns:: (describe returnvalue here)
EXAMPLES::
code::
(some example code)
s.reboot
b = Buffer.cueSoundFile(s,"/Users/owen/Desktop/denoise_stn/sources/01-mix.wav",0,1)
//The world's most expensive stereoizer
({
var hpss = FluidHPSS.ar(DiskIn.ar(1,b.bufnum,loop:1),harmonicBinaryMask:1,percussiveBinaryMask:1, harmonicThreshAmp1:SinOsc.kr(1.5,mul:20,add:20),harmonicThreshAmp2:SinOsc.kr(3,mul:25,add:25), percussiveThreshAmp1:SinOsc.kr(1.6,0,mul:30,add:30),percussiveThreshAmp2:SinOsc.kr(1.7,0,mul:17,add:24));
[hpss.at(2) + 0.5 * hpss.at(0),hpss.at(1) + 0.5 * hpss.at(0)];
}.play;)
::

@ -36,3 +36,13 @@ Routine{
(Main.elapsedTime - t).postln;
}.play
);
// owen's sexy example (The world's most expensive stereoizer)
(
{
var hpss = FluidHPSS.ar(PlayBuf.ar(1,b.bufnum,loop:1),harmonicBinaryMask:1,percussiveBinaryMask:1, harmonicThreshAmp1:SinOsc.kr(1.5,mul:20,add:20),harmonicThreshAmp2:SinOsc.kr(3,mul:25,add:25), percussiveThreshAmp1:SinOsc.kr(1.6,0,mul:30,add:30),percussiveThreshAmp2:SinOsc.kr(1.7,0,mul:17,add:24));
[hpss[2] + 0.5 * hpss[0], hpss[1] + 0.5 * hpss[0]];
}.play;
)

@ -31,7 +31,7 @@ d.play;
(
Routine{
t = Main.elapsedTime;
FluidBufSines.process(s,b.bufnum, 44100, 44100, 0, 0, c.bufnum, d.bufnum, 50,0.2,5,0.2,0.9,2048,512,4096); // need to change these for something sensible
FluidBufSines.process(s,b.bufnum, 44100, 88200, 0, 0, c.bufnum, d.bufnum, 30,0.3,3,0.1,0.9,2048,512,4096);
s.sync;
(Main.elapsedTime - t).postln;
}.play

@ -12,7 +12,7 @@ d = Buffer.new(s);
// without basic params
Routine{
t = Main.elapsedTime;
FluidBufTransients.process(s,b.bufnum, transBufNum:c.bufnum, resBufNum:d.bufnum);
FluidBufTransientSlice.process(s,b.bufnum, transBufNum:c.bufnum, resBufNum:d.bufnum);
s.sync;
(Main.elapsedTime - t).postln;
}.play

@ -31,7 +31,7 @@ d.play;
(
Routine{
t = Main.elapsedTime;
FluidBufTransients.process(s,b.bufnum, 44100, 44100, 0, 0, c.bufnum, d.bufnum, 100, 512,256,1,2,1,12,20);
FluidBufTransients.process(s,b.bufnum, 0, 88200, 0, 0, c.bufnum, d.bufnum, 100, 512,256,1,2,1,12,20);
s.sync;
(Main.elapsedTime - t).postln;
}.play

@ -7,7 +7,7 @@ b.play
{FluidSines.ar(PlayBuf.ar(1,b.bufnum,loop:1))}.play
// sexier params
{FluidSines.ar(PlayBuf.ar(1,b.bufnum,loop:1),threshold:MouseX.kr())}.play
{FluidSines.ar(PlayBuf.ar(1,b.bufnum,loop:1),30,MouseX.kr(),5)}.play
// null test (the process add a latency of (( hopSize * minTrackLen) + windowSize) samples
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidSines.ar(sig).sum - DelayN.ar(sig, 1, ((( 512 * 15) + 2048)/ s.sampleRate))]}.play

@ -0,0 +1,11 @@
s.reboot;
b = Buffer.read(s,"/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/archives-2017-18/denoise_stn/sources/01-mix.wav");
// basic param
x = {FluidTransients.ar(PlayBuf.ar(1,b.bufnum,loop:1))}.play
// sexier params
x = {FluidTransients.ar(PlayBuf.ar(1,b.bufnum,loop:1))}.play //change to something sensible
// add null test

@ -3,10 +3,10 @@ s.reboot;
b = Buffer.read(s,"/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/archives-2017-18/denoise_stn/sources/01-mix.wav");
// basic param
x = {FluidTransients.ar(PlayBuf.ar(1,b.bufnum,loop:1))}.play
{FluidTransients.ar(PlayBuf.ar(1,b.bufnum,loop:1))}.play
// sexier params
x = {FluidTransients.ar(PlayBuf.ar(1,b.bufnum,loop:1))}.play //change to something sensible
{FluidTransients.ar(PlayBuf.ar(1,b.bufnum,loop:1),80,threshFwd:MouseX.kr(0,5),threshBack:MouseY.kr(0,2))}.play
// null test (the process add a latency of (blockSize + padding - order) samples
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidTransients.ar(sig).sum - DelayN.ar(sig, 1, ((256 + 128 - 20)/ s.sampleRate))]}.play
Loading…
Cancel
Save