cleanup

fun cleanup(contour: PitchContour, options: ContourCleanup, hopMs: Int = 10): PitchContour

Apply cleanup options to a pitch contour.

Processing order:

  1. fixOctaveErrors - Mid-phrase frame-to-frame octave jumps

  2. fixBoundaryOctaves - Onset/offset octave errors

  3. removeBlips - Short runs below minimumNoteDurationMs

  4. smoothPitch - Optional pitch smoothing

Return

Cleaned pitch contour

Parameters

contour

Input pitch contour

options

Cleanup options (use ContourCleanup.SCORING, .DISPLAY, or .RAW)

hopMs

Hop size between frames in milliseconds (default: 10)