milliseconds to bpm formula

mcQ's icon

i can only find bpm to milliseconds and i dont remember how to switch around algebraic equasions that have 2 variables.
this is what someone said in a forum:
y = (240,000 * (d / t)) / x

where t is the divisions of a bar (e.g. 16)
and d is the delay time (e.g. 3)
and x is the bpm of your song

y is the delay time in milliseconds

so what would it look like the other way around please.

cudnylon's icon
Max Patch
Copy patch and select New From Clipboard in Max.

that formula converted would be x = (240,000 * (d/t)) * y i think but i've never seen that formula before for bpm to ms. the bpm to ms formula i use is [expr 60000./$f1] and it's the same for ms to bpm.

mcQ's icon

thanks, i had devised (1000/milliseconds)*60 = bpm but that yields slightly less accurate results than your method once i divide the result by 16 or something.

seejayjames's icon

(1000. / milliseconds) * 60. ---use all floats for better precision, even if your msec is originally in ints. Same for dividing afterward if you do that.

Also note that sending a float to an int will truncate, not round it. use [round] if needed.