I am writing a drum machine program. I need a function that takes the amount of microseconds between two sixteenth-notes as input, and outputs a beats-per-minute value. I would prefer the function to be in C.
I already have the drum machine working, but I would like a beats-per-minute representation so users can increase the value to increase tempo.
Henning’s answer is correct as to the mathematics. Here is an actual C function.