beat_track
beat_track(
y,sr?,opts?):object
Defined in: packages/pleco-xa/src/scripts/xa-beat-tracker.js:602
Dynamic programming beat tracker.
Pipeline (Ellis 2007):
- onset_strength(y, aggregate=‘median’) (skipped if onsetEnvelope given)
- tempo(onsetEnvelope) with the log-normal prior (skipped if bpm given)
- DP peak picking consistent with the estimated tempo
Parameters
Section titled “Parameters”any[] | Float32Array<ArrayBufferLike>
audio time series (may be null when opts.onsetEnvelope is provided)
number = 22050
sample rate
number | number[] | Float64Array<ArrayBufferLike>
known tempo (skips estimation). A scalar tracks a static tempo; an ARRAY of per-frame BPM values (length 1 or one per onset-envelope frame, e.g. the output of tempo(…, {aggregate: null})) tracks time-varying tempo.
hopLength?
Section titled “hopLength?”number
onsetEnvelope?
Section titled “onsetEnvelope?”any[] | Float32Array<ArrayBufferLike>
pre-computed onset envelope
sparse?
Section titled “sparse?”boolean
sparse indices vs dense boolean array
startBpm?
Section titled “startBpm?”number
prior center for tempo estimation
tightness?
Section titled “tightness?”number
beat distribution tightness
boolean
trim weak leading/trailing beats
units?
Section titled “units?”string
‘frames’ | ‘samples’ | ‘time’ (default is ‘frames’)
Returns
Section titled “Returns”object
tempo echoes a caller-provided bpm as given; when estimated it is a scalar
beats:
number[] |boolean[]
tempo:
number|number[] |Float64Array<ArrayBufferLike>
Throws
Section titled “Throws”on missing/empty input or invalid parameters