Here's a little Stream Byter script to monitor the BPM of an incoming clock signal. Merge this scene (or paste the code below) and feed it a clock signal.
The left hand label will show the bpm in whole numbers and the right hand label will show the bpm in 100ths. Note we do have a bit of integer rounding inaccuracy, so the 100ths may not be perfect and may also fluctuate, but it's not too bad.
# bpm monitor by audeonic IF LOAD # tick count ASS L0 = 0 END IF M0 == F8 MAT I0 = L0 % 18 IF I0 == 0 # quarter note ASS I1 = T0 IF L0 != 0 # 25th tick onwards, interval (ms) in i1 MAT I2 = EA60 / I1 SET LB0 I2 +D MAT I3 = EA60 % I1 MAT I1 = I1 / 64 MAT I3 = I3 / I1 SET LB1 I3 +D END END
MAT L0 = L0 + 1 END IF M0 >= FA IF M0 <= FC ASS L0 = 0 END END
thanks for posting this. I wanted to implement a "Beat Repeat", holding down a drum pad, and have it repeat the note at various regular intervals, 1/4 note, 1/8, 1/, etc., and seeing this post pinned to the top was all I needed to figure out the clock part of it. Cheers!