# 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