How do you find the actual BPM of a module when the speed periodically changes?

Started by Kyleroo, October 12, 2019, 13:04:51

Previous topic - Next topic

Kyleroo

Previous title:


"How does OpenMPT's "Approximate Real BPM" feature works?"

Previous content:


Is there some kind of mathematical equation to get the musical BPM of a module? I'm using it as a tutorial to trackers in the future. EDIT: I just saw https://forum.openmpt.org/index.php?topic=6231.0 and https://wiki.openmpt.org/Manual:_Song_Properties#Tempo_Mode. But I'm still struggling to understand the manual. :D

New question: How do you find the actual BPM of a module when the speed/tempo periodically changes? The "Approximate Real BPM" feature comes in handy if the module's speed/tempo is the same from start to end. Is there any way to do that or it's currently being worked on yet?

Here are some examples of modules that has periodically-changing speeds:
- "Flowerguy's Pool Party" by Virt (Download: ftp.modland.com/pub/modules/Impulsetracker/Virt/flowerguy's%20pool%20party.it)
- "Weather Girl" by Radix (Download: https://api.modarchive.org/downloads.php?moduleid=68787#weather_girl.xm)

Saga Musix

The function computes the BPM based on the current tempo, speed and ticks per row according to the chosen tempo mode. The table in the linked wiki page explains how the computation works in theory, but in practice one has to take some rounding inaccuracies into account that appear only in classic and alternative tempo mode, so the end result is not exactly the same as those formulas would suggest.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Kyleroo

Quote from: Saga Musix on October 12, 2019, 13:10:47
The function computes the BPM based on the current tempo, speed and ticks per row according to the chosen tempo mode. The table in the linked wiki page explains how the computation works in theory, but in practice one has to take some rounding inaccuracies into account that appear only in classic and alternative tempo mode, so the end result is not exactly the same as those formulas would suggest.

Yep! I have read the other thread with almost the same* question and I saw your reply there.

Kyleroo


Saga Musix

Please post a reply instead of changing the initial post next time, to avoid confusion.

To calculate the average of an alternating tempo, you can do several things:
1. Compute the average of the tick speeds (4 in this case) and set the initial speed to that value, then do approximation while playback is stopped. This only works if the average is not a fractional number, because tick speeds are integers.

2a. Otherwise, change the initial speed/tempo values to 3 and 5 respectively and do the approximation while playback is stopped.  Note down the results.
2b. Alternatively, use "Play Row" to start playback (but not advance playback) on a row with F03, approximate BPM and then repeat the same thing on a row with F05. This works because BPM approximation uses the current speed and tempo if playback is running. Note down the two results.

After you have done either 2a or 2b, you simply take the average of the resulting BPMs.
If the pattern is not as regular (let's assume 3 rows of F03, then four rows of F05 as a random example), you would have to weigh the results accordingly, i.e. (3 * (BPM at F03) + 4 * (BPM at F05)) / 7.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Kyleroo

Sorry about the editing. Thanks for the help!

I find instruction 1 much easier to do but 2a and 2b are useful when the average of the tick speeds are fractional.

Again, thanks!