transcribeNotes

fun transcribeNotes(contour: PitchContour, tonicHz: Float, template: SvaraTemplate, config: NoteTranscriptionConfig = NoteTranscriptionConfig.DEFAULT): List<NoteEvent>

Transcribe a pitch contour into discrete labelled notes against a SvaraTemplate.

Assigns each contour frame to a template svara when within NoteTranscriptionConfig.vicinityCents, groups consecutive frames into notes, and drops notes shorter than NoteTranscriptionConfig.minDurationSeconds. Each note carries its onset, offset, svara frequency (tonic ยท 2^(cents/1200)), and label.

Return

Notes sorted ascending by onset time (may be empty).

Parameters

contour

Input pitch contour.

tonicHz

Tonic frequency in Hz (must be > 0).

template

Svara grid from computeSvaraTemplate.

config

Transcription configuration (vicinity, minimum duration).

Throws

if tonicHz <= 0.