diff --git a/release-packaging/HelpSource/Classes/FluidBufStats.schelp b/release-packaging/HelpSource/Classes/FluidBufStats.schelp index 090e6d3..8d2aa67 100644 --- a/release-packaging/HelpSource/Classes/FluidBufStats.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufStats.schelp @@ -1,14 +1,13 @@ TITLE:: FluidBufStats -SUMMARY:: Buffer-Based Novelty-Based Slicer +SUMMARY:: Computing Statistics on Buffers as Series. CATEGORIES:: Libraries>FluidDecomposition, UGens>Buffer RELATED:: Guides/FluCoMa, Guides/FluidDecomposition DESCRIPTION:: -This class implements a non-real-time slicer using an algorithm assessing novelty in the signal to estimate the slicing points. A novelty curve is being derived from running a kernel across the diagonal of the similarity matrix, and looking for peak of changes. It implements the seminal results published in 'Automatic Audio Segmentation Using a Measure of Audio Novelty' by J Foote. It is part of the Fluid Decomposition Toolkit of the FluCoMa project. 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 Union’s Horizon 2020 research and innovation programme (grant agreement No 725899).:: - - The process will return a buffer which contains indices (in sample) of estimated starting points of different slices. +This class implements non-real-time statistical analysis on buffer channels. Typically, a buffer would hold various time series (i.e. descriptors over time), and link::Classes/FluidBufStats:: allows this series to be described statistically. It is part of the Fluid Decomposition Toolkit of the FluCoMa project. 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 Union’s Horizon 2020 research and innovation programme (grant agreement No 725899).:: +The process returns a buffer where each channel of the STRONG::source:: buffer has been reduced to 7 statistics: mean, standard deviation, skewness, kurtosis, followed by 3 percentiles, by default the minimum value, the median, and the maximum value. Moreover, it is possible to request the same 7 stats to be applied to derivative of the input. These are useful to describe statistically the rate of change of the time series. The STRONG::stats:: buffer will grow accordingly, yielding the seven same statistical description of the n requested derivative. Therefore, the STRONG::stats:: buffer will have as many channel as the input buffer, and as many frames as 7 times the requested STRONG::numDerivatives::. CLASSMETHODS:: @@ -22,49 +21,77 @@ ARGUMENT:: source The index of the buffer to use as the source material to be processed. The different channels of multichannel buffers will be considered independently as time series. ARGUMENT:: stats -(describe argument here) + The index of the buffer to write the statistics to. Each channel is the fruit of the statistical computations on the same channel number of the source buffer. -ARGUMENT:: numDerivatves -(describe argument here) +ARGUMENT:: numDerivatives + The number of derivatives of the original time series for the statistic to be computed on. By default, none are computed. This will influence the number of frames the stats buffer will have. ARGUMENT:: low -(describe argument here) + The rank requested for the first percentile value. By default, it is percentile 0.0, which is the minimum of the given channel of the source buffer. ARGUMENT:: middle -(describe argument here) + The rank requested for the second percentile value. By default, it is percentile 50.0, which is the median of the given channel of the source buffer. ARGUMENT:: high -(describe argument here) + The rank requested for the third percentile value. By default, it is percentile 100.0, which is the maximum of the given channel of the source buffer. ARGUMENT:: action - A Function to be evaluated once the offline process has finished and indices instance variables have been updated on the client side. The function will be passed indices as an argument. + A Function to be evaluated once the offline process has finished and indices instance variables have been updated on the client side. The function will be passed stats as an argument. RETURNS:: Nothing, as the destination buffer is declared in the function call. EXAMPLES:: +STRONG::A didactic example:: + CODE:: // make a buffer of known lenght -b = Buffer.alloc(s,7); +b = Buffer.alloc(s,101); -// add known values - b.setn(0, Array.fill(7,{|i|i / 6})); +// add known values - here, a ramp up +b.setn(0, Array.fill(101,{|i|i / 100})); // create a new buffer as destinations c = Buffer.new(s); //run the process on them ( -// with basic params Routine{ t = Main.elapsedTime; - FluidBufStats.process(s,b, stats: c); + FluidBufStats.process(s,b, c, 1); (Main.elapsedTime - t).postln; }.play ) -// list the indicies of detected attacks - the two input channels have been summed +// list the statistics. The first seven are for the source buffer values themselves, the last seven for the first derivative of the source buffer. c.getn(0,c.numFrames,{|item|item.postln;}) + +// replace the source values by a ramp down +b.setn(0, Array.fill(101,{|i| 1 - (i / 100)})); + +// run the process and read the values +FluidBufStats.process(s,b, c, 1, action:{c.getn(0,c.numFrames,{|item|item.postln;})}); + +// replace the source values by halfsine +b.setn(0, Array.fill(101,{|i| (i * pi/ 100).sin})); +b.plot + +// run the process and read the values +FluidBufStats.process(s,b, c, 1, action:{c.getn(0,c.numFrames,{|item|item.postln;})}); + +// replace the source values by partial halfsine +b.setn(0, Array.fill(101,{|i| (i * pi/ 50).sin.max(0)})); +b.plot + +// run the process and read the values +FluidBufStats.process(s,b, c, 1, action:{c.getn(0,c.numFrames,{|item|item.postln;})}); + +// replace the source values by positive white noise +b.setn(0, Array.fill(101,{1.0.rand})); +b.plot + +// run the process and read the values +FluidBufStats.process(s,b, c, 1, action:{c.getn(0,c.numFrames,{|item|item.postln;})}); ::