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

FluidPitch : FluidRTMultiOutUGen : MultiOutUGen : UGen : AbstractFunction : Object
ExtensionExtension

Real-time Pitch Descriptor

Description

Three popular monophonic pitch descriptors, all of which compute frequency and confidence.

FluidPitch returns both pitch and confidence values. When no pitch can be detected, a pitch of 0 Hz is returned (or -999.0 when the unit is in MIDI note mode).

For information about the pitch descriptor algorithms, see the algorithm parameter below.

The "confidence" output is a value between 0 and 1 indicating how confident the algorithm is in the pitch that it is reporting. In effect this can be an estimation of how "noisy" (closer to 0) or "harmonic" (closer to 1) the spectrum is. The confidence may also be low when a signal contains polyphony, as the algorithms are not intended for multiple pitch streams.

The unit argument indicates whether the pitch output should be in hertz (indicated by 0) or MIDI note numbers (indicated by 1). MIDI note numbers may be useful, not only because of their direct relationship to MIDI-based synthesis systems, but also because of the logarithmic relationship to hertz, making them perceptually evenly-spaced units (1 MIDI note = 1 semitone).

For more information visit https://learn.flucoma.org/reference/pitch/.

Read more about FluidPitch on the learn platform.

Class Methods

FluidPitch.kr(in: 0, select, algorithm: 2, minFreq: 20, maxFreq: 10000, unit: 0, windowSize: 1024, hopSize: -1, fftSize: -1, maxFFTSize: -1)

Arguments:

in

Audio-rate signal to analyze

select

An array of symbols indicating which analyses to return. The options are pitch and confidence. If nothing is specified, the object will return all the analyses. The analyses will always appear in their normal order, this argument just allows for a selection of them to be returned. Reordering the options in this argument will not reorder how the analyses are returned.

algorithm

The algorithm to estimate the pitch. (The default is 2.) The options are:

0Cepstrum: Returns a pitch estimate as the location of the highest peak (not including DC) in the Cepstrum of the signal.
1Harmonic Product Spectrum: Implements the Harmonic Product Spectrum algorithm for pitch detection . See e.g. A. Lerch, "An Introduction to Audio Content Analysis: Applications in Signal Processing and Music Informatics." John Wiley & Sons, 2012.https://onlinelibrary.wiley.com/doi/book/10.1002/9781118393550
2YinFFT: Implements the frequency domain version of the YIN algorithm, as described in P. M. Brossier, "Automatic Annotation of Musical Audio for Interactive Applications.” QMUL, London, UK, 2007. See also https://essentia.upf.edu/documentation/reference/streaming_PitchYinFFT.html

minFreq

The minimum frequency that the algorithm will search for. This sets the lowest value that can be generated. The default is 20.

Constraints

  • Minimum: 0
  • Maximum: MIN(maxFreq, 10000)
maxFreq

The maximum frequency that the algorithm will search for. This sets the highest value that can be generated. The default is 10000.

Constraints

  • Minimum: MAX(minFreq, 1)
  • Maximum: 20000
unit

The unit of the pitch output. The default of 0 indicates output in Hz. A value of 1 will output MIDI note values.

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

Returns:

The two descriptors: [pitch, confidence]. The latency is windowSize.

Inherited class methods

Undocumented class methods

FluidPitch.features

FluidPitch.prProcessSelect(a)

FluidPitch.prWarnUnrecognised(sym)

Instance Methods

Inherited instance methods

Examples

Use the pitch and confidence descriptions to control some filtered noise.

Use the confidence descriptor to modulate a send amount to a delay line.

Just watch the parameters come out.

Just watch the parameters come out on a stereo signal.

Comparison with Pitch.kr