Mod Archive Forums
Music Production => Tracking => Topic started by: asmodeus on April 01, 2009, 21:28:29

I know that there are two values in modules (IT) that the play speed is depending on. But how can I calculate the real speed? I'd like to know how long a single row takes in ms or seconds, when tempo=x and ticks=y. Is there a formula? Is the formula the same with MOD, S3M, XM and IT? Please help.

If it's for your own compositions, then your best bet is to fire up a modern tracker (like OpenMPT), and use it for playback. OpenMPT has a tempo mode which is bangon accurate at the tempo you specify, and ignore ticks per row.
The problem is that ticks per row are dependent on the player and the system, which means that you can't guarantee an exact playback speed.

Does that mean that modules can be played by different players with different speeds?

Pretty much... Although most coders will try to make it play back at roughly the same speed, so in a four minute mod you'll normally only get a few seconds deviation.

Not even a few seconds, that would be far too much. However, the BPM in a tracker are never 100% accurate, which is maybe also due to historical reasons (Amiga timer). Also, OpenMPT has a BPM calculator which calculates the correct BPM at speed x and tempo y.

yeah, sound advice, but you're missing a subtle point:
I'm a programmer, not a composer.
He's not a composer, he's a programmer looking for the formula to figure this out, not to use a tracking program, necessarily. Perhaps you could tell us all how the BPM calculator works so we won't have to go through this thing over and over again the next time someone else shows up asking the same thing? ;)

I don't know the formula by heart, but OpenMPT is opensource, everyone can download and read the sources. :)

Well, I coudn't find the formula in the source, but I've tested the program a little bit, viewed what takes how much time, and I think the formula is about like this (time is in ms, 1000ms=1sec):
// Tempo is T
// Ticks/row is M
// Rows/pattern is R
// Total Patterns is P
timepertick = 2500/T;
timeperrow = 2500/T*M;
timeperpattern = 2500/T*M*R;
timeofsong = 2500/T*M*R;
Of course the formulas can only be true is the speed doesn't change during playing. Maybe you should try the formulas out and tell me whether they are actually correct.