Matching beats per minute and frame number
Googlefood only…
You have:
- BPM: Beats per minute for some music
- FPS: Frame Rate of your video
You want to (a) figure out what beat is at a certain frame, and (b) decide if a certain frame is on a beat.
Math:
Beat Number(FrameNum) = Integer( ( FrameNum / FPS ) * ( BPM / 60 ) )
Is a Beat Frame(FrameNum) = BeatNumber(FrameNum) – BeatNumber(FrameNum – 1)
If (Is a Beat Frame(FrameNum) ) == 1, then it is a beat. 0 if it’s not a beat.
Example:
Song is 202 bpm, frame rate is standard SMTP Drop-Frame; what about frame 24?
BeatNumber(24) = Integer ( ( 24 / 29.97 ) * ( 202 / 60 ) )
BeatNumber(24) = Integer ( 2.696 ) = 2
IsABeatFrame(24) = BeatNumber(24) – BeatNumber(23)
IsABeatFrame(24) = 2 – 2
IsABeatFrame(24) = 0
Leave a Reply