FluidOnsetSlice:
Filter:
Classes (extension) | Libraries > FluidCorpusManipulation

FluidOnsetSlice : FluidRTUGen : UGen : AbstractFunction : Object
ExtensionExtension

Spectral Difference-Based Realtime Audio Slicer

Description

Implements a selection of spectrum-based onset slicers

Performs segmentation based on the difference between spectral frames.

The metric for calculating difference can be chosen from a curated selection, lending the algorithm toward slicing a broad range of musical materials.

The argument for metric can be passed as an integer (see table below) which is modulatable, or as one of the following symbols: \power, \hfc, \flux, \mkl, \is, \cosine, \phase, \wphase, \complex, or \rcomplex.

Read more about FluidOnsetSlice on the learn platform.

Class Methods

FluidOnsetSlice.ar(in: 0, metric: 0, threshold: 0.5, minSliceLength: 2, filterSize: 5, frameDelta: 0, windowSize: 1024, hopSize: -1, fftSize: -1, maxFFTSize: -1)

Arguments:

in

Audio-rate signal to slice

metric

The metric used to derive a difference curve between spectral frames. It can be any of the following:

0Energy thresholds on (sum of squares of magnitudes / nBins) (like Onsets power)
1HFC thresholds on (sum of (squared magnitudes * binNum) / nBins)
2SpectralFlux thresholds on (difference in magnitude between consecutive frames, half rectified)
3MKL thresholds on (sum of log of magnitude ratio per bin) (or equivalently, sum of difference of the log magnitude per bin) (like Onsets mkl)
4IS (WILL PROBABLY BE REMOVED) Itakura - Saito divergence (see literature)
5Cosine thresholds on (cosine distance between comparison frames)
6PhaseDev takes the past 2 frames, projects to the current, as anticipated if it was a steady state, then compute the sum of the differences, on which it thresholds (like Onsets phase)
7WPhaseDev same as PhaseDev, but weighted by the magnitude in order to remove chaos noise floor (like Onsets wphase)
8ComplexDev same as PhaseDev, but in the complex domain - the anticipated amp is considered steady, and the phase is projected, then a complex subtraction is done with the actual present frame. The sum of magnitudes is used to threshold (like Onsets complex)
9RComplexDev same as above, but rectified (like Onsets rcomplex)

threshold

The thresholding of a new slice. Value ranges are different for each metric, from 0 upwards.

Constraints

  • Minimum: 0
minSliceLength

The minimum duration of a slice in number of hopSize.

Constraints

  • Minimum: 0
filterSize

The size of a smoothing filter that is applied on the novelty curve. A larger filter size allows for cleaner cuts on very sharp changes.

Constraints

  • Minimum: 1
  • Maximum: 101
  • Snaps to odd numbers
frameDelta

For certain metrics (HFC, SpectralFlux, MKL, Cosine), the distance does not have to be computed between consecutive frames. By default (0) it is, otherwise this sets the distance between the comparison window in samples.

Constraints

  • Minimum: 0
  • Maximum: 8192
windowSize

The window size. As sinusoidal estimation relies on spectral frames, we need to decide what precision we give it spectrally and temporally. For more information visit https://learn.flucoma.org/learn/fourier-transform/

hopSize

The window hop size. As sinusoidal estimation relies on spectral frames, we need to move the window forward. It can be any size, but low overlap will create audible artefacts. The -1 default value will default to half of windowSize (overlap of 2).

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. The -1 default value will default to windowSize.

maxFFTSize

Set an explicit upper bound on the FFT size at object instantiation. The default of nil or -1 sets this to whatever the initial FFT size is

Inherited class methods

Undocumented class methods

FluidOnsetSlice.metrics

FluidOnsetSlice.prSelectMetric(sym)

Instance Methods

Inherited instance methods

Examples