Or more precise the OT stores and works with tempo multiplied by 24, makes sense because of MIDIs amount of ticks per Beat. Why multiply? It allows to work with Integers only which is CPU friendly.
No Float values at all in that regard.
Examples:
120,02 bpm = 120,02 * 24 == 2.880,48 which results in 2.880 == 2880 / 24 = 120bpm
120,03 bpm = 120,03 * 24 == 2.880,72 which results in 2.881 == 2881 / 24 = 120,0416666667bpm
there is your tiny difference.
For those who might think that makes things difficult, that is still much more precise than Abletons Midi Clock introduces Jitter by pure math compared to clock ticks of CPU’s
for the nerds in C it looks like…
#include <stdio.h>
uint16_t dspFriendly_x24(double audioFileBpm) {
double bpmDouble = audioFileBpm * 24.0f; //user assumed bpm
uint16_t bpmInteger = (uint16_t)bpmDouble; //casting cuts the commata
if (bpmDouble - bpmInteger >= 0.5f) bpmInteger++; //round up if needed
return bpmInteger;
}
double machineAlignedBPM(double audioFileBpm) {
return (double)dspFriendly_x24(audioFileBpm) / 24.0f;
}