computeHistogram

fun computeHistogram(contour: PitchContour, tonicHz: Float, config: HistogramConfig = HistogramConfig.DEFAULT): PitchHistogram

Compute a pitch histogram from a PitchContour.

Converts Hz → cents relative to tonic, filters unvoiced frames, optionally folds octaves, then bins and optionally smooths.

Return

PitchHistogram with musical metadata

Parameters

contour

Input pitch contour

tonicHz

Tonic frequency in Hz

config

Histogram configuration (bins, density, folding, smoothing)