Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #CHANGE THE TWO OPTIONS BELOW
- frame_rate = 24 #This is the frame rate at which you're animating
- beats_per_minute = 174 #This is the beats per minute of the music
- k = 60
- beats_per_second = beats_per_minute / k
- alternative_rates = [24, 25, 30, 60]
- fpb = beats_per_second * frame_rate
- print("The Frames Per Beat (FPB) is {} at {} FPS and {} BPM.".format(fpb, frame_rate, beats_per_minute))
- if not fpb.is_integer():
- print("Your chosen frame rate of {} does not provide an integer.".format(frame_rate))
- print("You could try one of these other common frame rates:")
- chosen = 0
- for rate in alternative_rates:
- fpb = beats_per_second * rate
- print("{} FPS: {} Frames Per Beat".format(rate, fpb))
- if fpb.is_integer() and not chosen:
- chosen = rate
- break
- print("Luckily, {} FPS provides an integer, so consider using that.".format(chosen))
Advertisement
Add Comment
Please, Sign In to add comment