# Determining the consistency of the BPM of a track

I have a track that I'd like to create an animation for. I'm creating the animation dynamically with code, so I need to know the intervals between beats to sync the video with the audio. I opened up Audacity and ran `Analyze > Beat Finder...`, and then calculated the milliseconds between two of the labels it generated, which turned out to be around 500 milliseconds, or 120 beats per minute. The problem is that when I try to animate something in my video to match this tempo, after a while it becomes visibly out of sync.

So my question is: how can I determine if it's my animation that's out of sync or if the audio's tempo is "shifted"; i.e, the tempo remains the same but there is a pause that's not a factor of 500 ms? For example, if each of the two dots below represent 500 milliseconds, how can I determine if a break like the one in the middle occurs?

``````|..|..|..|.....|..|..|..|
``````

Edit: Or put another way: if I animated a square to flash every 500 milliseconds from the first beat of a 120 BPM track, and at some point the flashing went out of sync, how could I determine where in the track the sync was broken?

• I'd start by timing more than one beat. Try a minute's worth for a much more accurate subdivision. Like Keef says, '500-ish or 120 BPM-ish isn't going to carry for the entire song. Commented Dec 5, 2014 at 11:34
• Ok, so it just needs a bit more manual work. :) Commented Dec 5, 2014 at 14:27
• Yeah. It's an electronic track so it shouldn't drift over time. You just have to time 100 beats/100 etc. The longer you time, the more decimal places you'll get in the result. If you're working to a large granularity like 24 fps, then I guess you might have to periodically 'gain' a frame etc to keep pace. Commented Dec 5, 2014 at 15:58

Depends...

If it's a track played by humans then unless they played to a click then it's unlikely the BPM is consistent because people will fluctuate tempo. Obviously the best will fluctuate only microscopically but fluctuate all the same.

However it's electronic then the BPM is (likely) to be consistent. Therefore what happens isn't that it suddenly goes out of sync but the out of sync finally reaches the point where it's perceivable. So if something's at 120.1 for example, it'll take some time before it seems out of sync but because of the way the human brain works it will suddenly appear to have gone out of sync because it no longer fits the way the brain quantizes.

Sorry if that sounded a bit weird. Basically, if it's electronic just try small fractions on top of your BPM, it could be a drift in CPU clock between programs or even the different computers that turns 120BPM into 120.014BPM

• Great answer, thanks. I understand what you mean about it gradually going out of sync. I had to leave the computer and come back after a minute just to make sure it wasn't my eyes (and ears) playing tricks on me. So basically, there's no tool that can help me with this; it's down to trial and error? Commented Dec 5, 2014 at 14:26
• Not one I'm personally aware of... That doesn't mean there isn't one. Commented Dec 11, 2014 at 17:12