pub fn check_octaves(
notes: &NoteList,
track: &PitchTrack,
) -> (NoteList, OctaveCheck)Expand description
Checks every note against the median of the voiced f0 frames inside it, and returns the notes with their octave flag set.
A note within OCTAVE_AGREEMENT of the median is fine. A note an
octave above it, within OCTAVE_TOLERANCE, moves down 12 semitones
when the median lies within OCTAVE_TOLERANCE of
OCTAVE_FIX_CEILING or below, and a note of that lower key with a
higher velocity holds it within COPY_SLACK at each end. Any other gap keeps
the pitch and sets the flag. A note with fewer than
OCTAVE_MIN_FRAMES voiced frames keeps its flag unset.