Pitch2Midi

standard mode | Pitch category

Inputs

  • pitch (real) - pitch given in Hz for conversion

  • voiced (integer) - whether the frame is voiced or not, (0, 1)

Outputs

  • messageType (vector_string) - the output of MIDI message type, as string, {noteoff, noteon, noteoff-noteon}

  • midiNoteNumber (vector_real) - the output of detected MIDI note number, as integer, in range [0,127]

  • timeCompensation (vector_real) - time to be compensated in the messages

Parameters

  • applyTimeCompensation (bool ∈ {true, false}, default = true) :

    whether to apply time compensation in the timestamp of the note toggle messages.

  • hopSize (integer ∈ [1, ∞), default = 128) :

    Pitch Detection analysis hop size in samples, equivalent to I/O buffer size

  • midiBufferDuration (real ∈ [0.005, 0.5], default = 0.015) :

    duration in seconds of buffer used for voting in the note toggle detection algorithm

  • minFrequency (real ∈ [20, 20000], default = 60) :

    minimum detectable frequency

  • minNoteChangePeriod (real ∈ (0, 1], default = 0.03) :

    minimum time to wait until a note change is detected (s)

  • minOccurrenceRate (real ∈ [0, 1], default = 0.5) :

    minimum number of times a midi note has to ocur compared to total capacity

  • minOffsetCheckPeriod (real ∈ (0, 1], default = 0.2) :

    minimum time to wait until an offset is detected (s)

  • minOnsetCheckPeriod (real ∈ (0, 1], default = 0.075) :

    minimum time to wait until an onset is detected (s)

  • sampleRate (integer ∈ [8000, ∞), default = 44100) :

    Audio sample rate

  • transpositionAmount (integer ∈ (-69, 50), default = 0) :

    Apply transposition (in semitones) to the detected MIDI notes.

  • tuningFrequency (integer ∈ {432, 440}, default = 440) :

    reference tuning frequency in Hz

Description

This algorithm estimates the midi note ON/OFF detection from raw pitch and voiced values, using midi buffer and uncertainty checkers.

Source code