pub fn track_multi_pitch(
frame_f0: &[f32],
n_frames: usize,
max_per_frame: usize,
n_voices: usize,
max_jump_semitones: f32,
out_tracks: &mut [f32],
) -> Result<usize, AudioError>Expand description
Track multiple concurrent pitch contours across frames.
frame_f0: row-majorn_frames × max_per_framebuffer of per-frame F0 estimates in Hz; a0.0(or non-finite) slot means “no estimate”. Rows need not be sorted, and estimates may appear in any column order from frame to frame — continuity is resolved by pitch, not by column.n_frames/max_per_frame: shape offrame_f0.n_voices: declared maximum number of concurrent voices to track (1..=MAX_VOICES).max_jump_semitones: the largest pitch step (semitones) an estimate may be from a voice’s last pitch and still continue that voice.out_tracks: row-majorn_voices × n_framesbuffer;out_tracks[v * n_frames + f]is voicev’s F0 at framef, or0.0where the voice is inactive/abstaining. Cleared on entry.
Returns the number of voices that were assigned at least one estimate.
§Errors
AudioError::InvalidParameterifn_voicesis0or> MAX_VOICES,max_per_frame > MAX_ESTIMATES,max_jump_semitonesis not positive finite, orframe_f0.len() < n_frames * max_per_frame.AudioError::OutputBufferTooSmallifout_tracks.len() < n_voices * n_frames.