thanks, but I don't think the example is correct, because the example usage gives an incorrect output of 30 BPM, whereas a typical 4/4 loop is four beats and the correct output would be 120 BPM. The code should also take the loop time signature (4/4, 3/4, ...) into account somehow