You can also make a simple table showing Beats Per Second vs. Frames Per Second; then you know exactly which key frames will be in sync with the music.
For example, a 120 BPMinute soundtrack has 2 beats per second. PAL video runs at 25 FPS so there are 12.5 frames per beat. If you list them all out (12.5, 25, 37.5, 50, etc.) for the entire sound sample you won’t get lost and your PI footage will be animated in perfect sync.
Good luck and don’t forget to post the results!