[JW Lua] FCTempoElement: ratio calculation

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Sat Nov 29 17:27:48 CET 2014


On 2014-11-23 22:20, Jan Angermüller wrote:

> do you know how the ratio from FCTempoElement is calculated ?
>
> I came up with the equation:
> Ratio / 1118 = BPM
>
> That gave me a rough estimation in the three Finale docs where I tested it.
> It's not the exact BPM value from the text expression or playback prefs,
> but the value plus/minus a few decimal places.

For relative time changes, it's the percentage * 1000. (75% would be 750)

For absolute time changes, it's the ratio of EDUs to RTUs. But I now see 
that you lack a "RTU unit" parameter which is used in the calculation. 
This RTU is often set to 1000. A ratio of 60 bpm (a quarter note per 
second) would then be ( 1024 << 16 ) / 1000.

There's no reason when a script programmer should need to deal with 
these stuff. I'll add calculation methods for this as well to the next beta.


Best regards,

Jari Williamsson






More information about the JWLua mailing list