PitchHistogram

data class PitchHistogram(val binCenters: FloatArray, val values: FloatArray, val tonicHz: Float, val isDensity: Boolean, val isFolded: Boolean, val mode: HistogramMode)

Pitch histogram with musical metadata. Wraps Histogram from common.

Entry point for peak analysis: getPeaksValleysPeakDatacomputePeakStats.

Constructors

Link copied to clipboard
constructor(binCenters: FloatArray, values: FloatArray, tonicHz: Float, isDensity: Boolean, isFolded: Boolean, mode: HistogramMode)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun computePeakStats(peakData: PeakData, rawPitchCents: FloatArray, refIntervalsCents: FloatArray, config: PeakStatsConfig = PeakStatsConfig.DEFAULT): PeakStatsCollection

Compute per-peak statistics against reference intervals.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun getPeaksValleys(targetIntervalsCents: FloatArray, config: PeakDetectionConfig = PeakDetectionConfig.DEFAULT): PeakData

Detect peaks and valleys using the specified method and target intervals.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Normalize so total area = 1. Returns a new PitchHistogram.

Link copied to clipboard
fun smooth(sigma: Float = 5.0f): PitchHistogram

Apply Gaussian smoothing. Returns a new PitchHistogram.