/ Examples / NoteStream / PitchTrack

Projects .. AudioIO .. Control
NoteStreams .. Instruments
Filters .. Effects .. LiCK Effects
Plot .. Utility .. Pure ChucK


Wherein we present the modest details of the PitchTrack node (chugin).

Right-click to copy this example to your workspace

PitchTrack

PitchTrack is a monophonic autocorrelation pitch tracker with a fast response and extremely high accuracy, even at low frequencies. It is adapted from [helmholtz~] for Pd by Katja, excellently documented here.

inlet connect the audio signal for analysis.

Controller optionally connect a controller to signal performance events.

Fidelity a threshold for certainty about the result. A highly periodic signal (ie one that has a strong pitch center) should produce a result with a high fidelity, which a non-periodic signal (eg noise) will have a very low fidelity. Setting this parameter close to 1 should reduce the number of inaccurate reports.

Sensitivity the minimum RMS value to trigger a pitch calculation. Setting this parameter low forces PitchTracker to attempt to find the pitch of even very quiet sounds. Higher values will cause it to trigger only on louder notes.

Overlap sets the overlap between successive analysis frames. Higher values should produce smoother values, at the cost of an increase of CPU load.

Frame sets the size of the analysis window, measured in samples.

QuantizeFreq causes sucessful frequency results to be quantized to the nearest MIDI note.

HoldNotes produces variable length notes which depend on the analysis result. When not checked, every successful track will produce notes whose duration is given by the Beats parameter.

Beats controls the frequency we consult the analysis, measured in TimeKeeper beats. This is also the smallest duration of notes in the output stream.

The Example

In this example we perform pitch tracking on a speech by US President Obama.

The two PitchTrack nodes have slightly different settings and the resulting notes are routed to a Note Plot. Here's the resulting plot. Orange notes result from the Player0 pipeline while blue are the result of Player1 which includes a NSFilter node which produces a notestream whose notes are guided by a musical scale and transposed.

Here are the NSFilter values used.

Notes incoming notestream connection port.

NoteRange the min and max MIDI notes to pass through the filter.

Transpose the number of MIDI notes (semitones) to transpose the result. Here you'll notice that all the blue notes are to the right of the orange ones. 7 semitones is a musical fifth.

Constraints controls a scale-based contraint to further limit the notes within the NoteRange. None adds no additional contraints. ScaleOnly filters out any notes that aren't part of the requested scale. NearestNote causes incoming notes to be converted to the nearest note in the scale.

Scale selects from a menu of scales/modes including Major, Minor, Mixolydian, etc.

Base selects the root note of the scale expressed as a MIDI note number. Here the number 50 represents D2. More details can be found here.

Subset selects a subset of notes from the selected scale including triad, fifth, seventh.

home .. topics .. interface .. reference .. examples .. tipjar