Skip to content

API Reference


API Reference / Tempo

Type Alias: Tempo ​

ts
type Tempo = {
  tempo: number;
  count: number;
  confidence: number;
};

Defined in: core/types.ts:145

Detected tempo with confidence metrics

Properties ​

PropertyModifierTypeDescriptionDefined in
temporeadonlynumberDetected tempo in beats per minutecore/types.ts:147
countreadonlynumberNumber of peak intervals that voted for this tempo. Candidates are ranked by it.core/types.ts:149
confidencereadonlynumberShare of all interval votes that agree with this tempo, from 0 to 1. Computed as (count(tempo − 1) + count(tempo) + count(tempo + 1)) / totalVotes, where totalVotes sums the counts of every tempo group, not only the returned candidates. The ±1 BPM window absorbs rounding jitter. Remarks A perfect click train scores about 0.46, not 1: each peak is paired with the next 9 peaks, and only pairs 1, 2, 4 and 8 beats apart fold back onto the beat tempo. Compare values against each other; no absolute cut-off has been calibrated on real music yet.core/types.ts:162