[SOLVED] It only goes like "beeeeeeeeeeeeeep...."

PaulS:

240/(bpm*4)

When bpm is 60, this evaluates to 1. When bpm is greater than 60, this evaluates to 0.

You are assuming that all arithmetic is performed using floating point arithmetic. It is not. If you want to force floating point arithmetic, you must use floats, like 240.0 or 4.0. Or make bpm a float.

Woops, I changed that to float as a test. Forgot to reset it to integer. But thanks to your post, I found the problem! Thank you!