correctBoundaryOctaves

fun correctBoundaryOctaves(pitchesHz: FloatArray, hopMs: Int = 10, boundaryWindowMs: Float = 50.0f): FloatArray

Correct octave errors at phrase boundaries (onset/offset).

YIN sometimes detects the wrong octave at the start or end of a phrase where the signal is weaker. This corrects by comparing boundary regions to the stable interior of each phrase.

Return

Corrected pitch array

Parameters

pitchesHz

Input pitch array in Hz (-1 for unvoiced)

hopMs

Hop size between frames in milliseconds (default: 10)

boundaryWindowMs

How much of phrase edges to check (default: 50)