Skip to main content

Module tempo

Module tempo 

Source
Expand description

Tempo detection for audio items, stored at import as bpm.

Eagle runs a beat tracker over the decoded audio (the first minutes of long files) and stores the tempo it settles on, between 60 and 200 BPM, with up to three decimals. Falcon estimates the same quantity its own way: a loudness-rise (“onset”) envelope at about 100 frames a second, whose autocorrelation is scored by a comb of beat periods over 60–200 BPM, with a mild preference for tempos near 120 to settle octave ties.

Constants§

MAX_BPM
MIN_BPM
The tempo range searched, in beats per minute.

Functions§

analysed_seconds
How much of a file Eagle analyses, by its length in seconds: the first minute of files over an hour, two minutes past ten minutes, three past three, otherwise all of it.
bpm
The tempo of an audio file in BPM, rounded to three decimals, or None if it can’t be decoded or holds no beat (silence, too short).
estimate
Estimates the tempo of mono samples at rate Hz, in BPM rounded to three decimals.
json_value
bpm as Eagle’s JSON holds it: a whole tempo without a fraction.