Expand description
Top-level predominant-F0-per-frame melody line (mono melody from poly input).
Given a stream of per-frame pitch-salience curves (from
crate::features::salience::pitch_salience), emit one fundamental frequency
per frame: the pitch of the frame’s strongest salience ridge, refined to
sub-bin resolution, provided that ridge is salient enough to be voiced.
Frames whose peak salience falls below a data-driven voicing floor abstain
(out_f0 = 0.0) rather than guess.
ASSUMPTION (declared): this collapses each frame to a single F0 — a monophonic melody reading of possibly polyphonic input. The output is an epistemic proposal for the predominant voice, not an assertion that only one pitch sounds. Callers needing all voices should use the salience peaks / contour tracker directly.
Zero-heap hot path: reads a caller-owned flat salience buffer and writes into
a caller-owned out_f0; allocates nothing.
Functions§
- predominant_
melody - Estimate the predominant fundamental frequency of each frame.