From 9cd8f0b6fec3a200d5a8f3d22acfee68b702faed Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Thu, 21 Mar 2019 20:26:31 +0000 Subject: [PATCH] OnsetSlice: corrected typo in class def, matched minima with algo, and started on a backbone of helpfile --- release-packaging/Classes/FluidOnsetSlice.sc | 4 +- .../HelpSource/Classes/FluidOnsetSlice.schelp | 65 +++++++++++++++++++ 2 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 release-packaging/HelpSource/Classes/FluidOnsetSlice.schelp diff --git a/release-packaging/Classes/FluidOnsetSlice.sc b/release-packaging/Classes/FluidOnsetSlice.sc index 166614e..d507838 100644 --- a/release-packaging/Classes/FluidOnsetSlice.sc +++ b/release-packaging/Classes/FluidOnsetSlice.sc @@ -1,5 +1,5 @@ FluidOnsetSlice : UGen { - *ar { arg in = 0, function = 0, threshold = 0.1, debounce = 2, filterSize = 5, frameDelta = 0, winSize = 1024, hopSize = 256, fftSize = 1024, maFFTSize = 16384; - ^this.multiNew('audio', in.asAudioRateInput(this), function, threshold, debounce, filterSize, frameDelta, winSize, hopSize, fftSize, maFFTSize) + *ar { arg in = 0, function = 0, thresh = 0.5, debounce = 2, filtSize = 5, frameDelta = 0, winSize = 1024, hopSize = -1, fftSize = -1, maxFFTSize = 16384; + ^this.multiNew('audio', in.asAudioRateInput(this), function, thresh, debounce, filtSize, winSize, hopSize, frameDelta, fftSize, maxFFTSize) } } diff --git a/release-packaging/HelpSource/Classes/FluidOnsetSlice.schelp b/release-packaging/HelpSource/Classes/FluidOnsetSlice.schelp new file mode 100644 index 0000000..b3db235 --- /dev/null +++ b/release-packaging/HelpSource/Classes/FluidOnsetSlice.schelp @@ -0,0 +1,65 @@ +TITLE:: FluidOnsetSlice +SUMMARY:: Spectral Difference-Based Real-Time Audio Slicer +CATEGORIES:: Libraries>FluidDecomposition +RELATED:: Guides/FluCoMa, Guides/FluidDecomposition + +DESCRIPTION:: +This class implements many spectral based onset detection algorythms, most of them taken from the literature (http://www.dafx.ca/proceedings/papers/p_133.pdf) + +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 an audio steam with sample-long impulses at estimated starting points of the different slices. + + +CLASSMETHODS:: + +METHOD:: ar + The audio rate version of the object. + +ARGUMENT:: in + The audio to be processed. + +ARGUMENT:: function + 0 - Energy =sum of squares of magnitudes / nBins (\power) + 1 - HFC = sum of (squared mag * binNum) / nBins + 2 - SpectralFlux = dif in mag between consecutive frames (half rectified) + 3 - MKL = sum of log of mag ratio per bin (or: sum of dif of log mag per bin) (\mkl) + 4 - IS = itakura - saito divergence + 5 - Cosine = cosine distance + 6 - PhaseDev = takes 2 past frames, project to current, as anticipated steady state, then compute differences (sums) (\phase) + 7 - WPhaseDev = same, but weighted by magnitude to remove chaos noise floor (\wphase) + 8 - ComplexDev = same as kPhaseDev, but in the complex domain - anticipated amp(steady) and phase(projected) - complex subtraction -> sum of mag (\complex) + 9 - RComplexDev =same as above, but rectified (\rcomplex) + +ARGUMENT:: thresh +diff for each... + +ARGUMENT:: debounce + The minimum duration of a slice in number of hops. + +ARGUMENT:: filtSize + The size of a smoothing filter that is applied on the novelty curve. A larger filter filter size allows for cleaner cuts on very sharp changes. + +ARGUMENT:: frameDelta +distance in samples between the comparison window (flux,mkl,kls,cosine) + +ARGUMENT:: winSize + The window size. As novelty estimation relies on spectral frames, we need to decide what precision we give it spectrally and temporally, in line with Gabor Uncertainty principles. http://www.subsurfwiki.org/wiki/Gabor_uncertainty + +ARGUMENT:: hopSize + The window hope size. As novelty estimation relies on spectral frames, we need to move the window forward. It can be any size but low overlap will create audible artefacts. + +ARGUMENT:: fftSize + The inner FFT/IFFT size. It should be at least 4 samples long, at least the size of the window, and a power of 2. Making it larger allows an oversampling of the spectral precision. + +ARGUMENT:: maxFFTSize +(describe argument here) + +RETURNS:: + An audio stream with impulses at detected transients. The latency between the input and the output is XXXXXXX. + +EXAMPLES:: + +code:: +(some example code) +:: \ No newline at end of file