Expand description
Predominant-melody contour selection (Melodia-class).
After tracking (contour_tracking), a frame may be covered by several
competing contours. Melodia’s melody stage chooses the contour that is both
salient (loud, harmonically strong) and smooth (low pitch variance —
melodies move stepwise, not erratically), rejecting octave-jumping or noisy
candidates.
This selects, among a set of candidate contours summarised by their mean salience and their pitch variance, the index of the predominant-melody contour. It encodes an explicitly monophonic reading: exactly one melody line is chosen. In genuinely polyphonic material that assumption is a proposal, not a claim that only one voice exists.
Zero-heap: reads two caller slices, returns an index; allocates nothing.
Functions§
- select_
melody_ contour - Choose the predominant-melody contour among
ncandidates.