View Full Version : TimeStretch tempo formulas
speedyrazor
17th February 2015, 13:27
Hi, I am looking for the formulas for changing audio tempo. I have the one for going from 24fps to 25fps:
TimeStretch(tempo = 25.0/(24000.0/1001.0)*100.0)
What would be the correct ones for:
23.98 to 25
23.98 to 24
24 to 23.98
25 to 24
25 to 23.98
Kind regards.
Selur
17th February 2015, 13:33
It's always to/from to get a multiplier with base one and if your multiplier needs to have hundred as base you multiply the result by hundred like you do in your example,...
Not sure what you expected, but this seems to be basic math and you could simply replace your numbers in your example,...
speedyrazor
17th February 2015, 13:43
My math is not that good. Is this correct?:
23.98 to 25 - tempo = 25.0/(24000/1001)*100.0)
23.98 to 24 - tempo = 24.0/(24000/1001)*100.0)
24 to 23.98 - tempo = 23.976/(24000.0/1001.0)*100.0)
25 to 24 - tempo = 24.0/(25000.0/1001.0)*100.0)
25 to 23.98 - tempo = 23.976/(25000.0/1001.0)*100.0)
I am unsure of the 23.976 formular
wonkey_monkey
17th February 2015, 17:12
23.976 is a standard approximation for the correct "NTSC" film rate, which is accurately 24000/1001, so you're getting things a bit mixed up, I think.
Your initial piece of code is actually for 23.976 to 25, not 24 to 25. Sometimes people say 24fps when they really mean 23.976fps (and even then, they really mean 24000/1001 fps!)
The formula is: target_fps/source_fps*100.0
23.976 to 25 - tempo = 25.0/(24000/1001)*100.0
23.976 to 24 - tempo = 24.0/(24000/1001)*100.0
24 to 23.976 - tempo = (24000/1001)/24.0*100.0
25 to 24 - tempo = 24.0/25.0*100.0
25 to 23.976 - tempo = (24000/1001)/25.0*100.0
I think these are correct.
creaothceann
17th February 2015, 17:57
(24000 / 1001) / 24.0 * 100.0
(24000 / 1001) / 25.0 * 100.0
This will perform an integer divison first, so the result would be incorrect. Therefore:
(1.0 * 24000 / 1001) / 24 * 100
(1.0 * 24000 / 1001) / 25 * 100
speedyrazor
17th February 2015, 18:18
So ultimately it should be?
23.976 to 25 - tempo = 25.0/(24000/1001)*100.0
23.976 to 24 - tempo = 24.0/(24000/1001)*100.0
24 to 23.976 - tempo = (1.0*24000/1001)/24*100
25 to 24 - tempo = 24.0/25.0*100.0
25 to 23.976 - tempo = (1.0*24000/1001)/25*100
Just checking these are all correct?
Groucho2004
17th February 2015, 18:33
I would stick to the notation that is used in the documentation (and your first post), adding ".0" to all numbers.
speedyrazor
18th February 2015, 11:44
Adding the .0 made a lot of difference, they are now correct.
Thanks for the tip.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.