BufNoveltySlice: now with corrected class definition, a shell of helpfile, and a cool example.

nix
Pierre Alexandre Tremblay 7 years ago
parent a0da9ecd2a
commit 235cc09806

@ -1,13 +1,11 @@
FluidBufNoveltySlice{
*process { arg server, src, offsetframes = 0, numframes = -1, offsetchans = 0, numchans = -1, transbuf, kernelsize = 3, threshold = 0.8, winsize = 1024, hopsize = 512, fftsize = 2048;
server = server ? Server.default;
if(src.isNil) {Error("Invalid Source Buffer").format(thisMethod.name, this.class.name).throw};
if(transbuf.isNil) {Error("Invalid Slices Buffer").format(thisMethod.name, this.class.name).throw};
server.sendMsg(\cmd, \BufNoveltySlice, src, offsetframes, numframes, offsetchans, numchans,
transbuf, kernelsize, threshold, winsize, hopsize, fftsize);
*process { arg server, srcBufNum, startAt = 0, nFrames = -1, startChan = 0, nChans = -1, transBufNum, kernelSize = 3, threshold = 0.8, winSize = 1024, hopSize = 512, fftSize = 2048;
if(srcBufNum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
if(transBufNum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
server = server ? Server.default;
}
server.sendMsg(\cmd, \BufNoveltySlice, srcBufNum, startAt, nFrames, startChan, nChans, transBufNum, kernelSize, threshold, winSize, hopSize, fftSize);
}
}

@ -2,9 +2,9 @@ FluidBufTransientSlice{
*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};
if(transBufNum.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);
}

@ -0,0 +1,58 @@
TITLE:: FluidBufNoveltySlice
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:: kernelSize
(describe argument here)
ARGUMENT:: threshold
(describe argument here)
ARGUMENT:: winSize
(describe argument here)
ARGUMENT:: hopSize
(describe argument here)
ARGUMENT:: fftSize
(describe argument here)
returns::
Nothing, as the various destination buffers are declared in the function call.
EXAMPLES::
code::
(some example code)
::

@ -65,4 +65,3 @@ EXAMPLES::
code::
(some example code)
::

@ -3,15 +3,15 @@ s.reboot
// test for efficiency
(
b = Buffer.read(s,"/Users/owen/Box Sync/FluCoMa/Temporary/GLRSegmentation/SegmentationExample.wav");
b = Buffer.read(s,"../../release-packaging/AudioFiles/Tremblay-AaS-AcousticStrums-M.wav".resolveRelative);
c = Buffer.new(s);
)
b.query
(
// with basic params
Routine{
t = Main.elapsedTime;
FluidBufNoveltySlice.process(s,b.bufnum, transbuf:c.bufnum, threshold:0.5);
FluidBufNoveltySlice.process(s,b.bufnum, transBufNum: c.bufnum, threshold:0.6);
s.sync;
(Main.elapsedTime - t).postln;
}.play
@ -19,6 +19,7 @@ Routine{
//check the number of slices
c.query;
c.getn(0,34,{|x|x.postln})
//loops over a splice
(
@ -63,7 +64,7 @@ c.query;
(
Routine{
t = Main.elapsedTime;
FluidBufNoveltySlice.process(s,b.bufnum, 44100, 44100, 0, 0, c.bufnum, d.bufnum, 100, 512,256,1,2,1,12,20);
FluidBufNoveltySlice.process(s,b.bufnum, 44100, 44100, 0, 0, c.bufnum, d.bufnum, 100, 512,256,1,2,1,12,20);//needs something else
s.sync;
(Main.elapsedTime - t).postln;
}.play

Loading…
Cancel
Save