View Categories

Pitch Detect Node

3 min read

The Pitch Detect Node analyzes a connected audio signal, and attempts to determine its pitch. The detected pitch is then output either as a frequency value, or a MIDI code (configurable).

Note: this Node processes the audio signal in real time, and has some processing latency. Additionally, while it supports more complex, even polyphonic audio signals, it doesn’t guarantee a high accuracy. Thus, you may need to experiment with settings to get the results right.

If you have a melody you want to analyze for its pitch, consider using the Pitch Emitter Node instead.


Inputs

Audio Input

The audio signal to analyze.

This should carry a clearly audible signal. This input generally doesn’t support control signals, unless the control signal itself changes fast enough to yield meaningful frequency information.


Settings

Output Format

The output format of the detected pitch, either as a frequency value (Hz), or as a MIDI code.

Note Pitch Display Mode

★ With AudioNodes HD

Controls how the detected pitch is labelled on the Node. Project default follows the Note Pitch Display Mode set in the Settings Dialog. This setting does not change the Pitch Output, which always follows Output Format.

  • Notation shows the nearest note name (e.g. A4)
  • MIDI Code shows the MIDI number (e.g. 69.12)
  • Frequency (Hz) shows the frequency, in Hz (e.g. 443.07 Hz)
  • Note + cents shows the nearest note name and how far the pitch is from it, in cents (e.g. A4 +12 cents), which is useful for tuning an instrument

Without AudioNodes HD, the Node always uses the project’s Note Pitch Display Mode. Pitch Detect Nodes saved before this setting existed keep showing the value in their Output Format.

Hold Duration

The maximum duration, in milliseconds, for which the last detected pitch value will be kept, in case the pitch can no longer be determined. Greater values will reduce occasional jumps to 0, but might provide increasingly false values over time if the pitch is often indeterminable.

Buffer Size

Number of samples to process in each analysis pass. Larger values increase accuracy. They are also needed to detect lower frequencies, but also increase latency. Buffer sizes up to 1024 are available with AudioNodes HD.


Outputs

Pitch Output

The detected pitch value, or 0 if the Node cannot find a pitch in the source audio signal.

The meaning of this value depends on what you selected as the Output Format setting (i.e. it’s either a frequency value, or a MIDI code).


Technical details

This Node uses an autocorrelation algorithm to determine pitch, and supports polyphonic audio sources.

The analysis of autocorrelation is a mathematical tool for finding repeating patterns, such as the presence of a periodic signal obscured by noise, or identifying the missing fundamental frequency in a signal implied by its harmonic frequencies. It is often used in signal processing for analyzing functions or series of values, such as time domain signals.

https://en.wikipedia.org/wiki/Autocorrelation

Displayed frequencies and note names are calculated with A4 (MIDI code 69) at 440 Hz. The Middle C setting only changes the octave numbers of note names, not the frequencies. While no pitch is detected, the Node shows 0 in its Output Format (0 Hz or M 0).


Similar Nodes

  • Pitch Emitter Node – converts a melody signal to a control signal containing its pitch, similarly to the Pitch Detect Node, but without latency, and it’s always perfectly accurate
  • Pitch Shift Node – changes the pitch of an audio signal in real time