gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Audio > Mod timing based on tempo & ticks/row

#107743 - sumiguchi - Wed Nov 01, 2006 6:35 pm

I am trying to figure out how to calculate the time in seconds/miliseconds when a note in a mod is played.

For example, my song has tempo of 125 with 5 ticks/row - and total of 64 rows (per pattern)

So on row 30 (of pattern 1) a note is played - say C-5 Sample 1 - how can I calculate in seconds or miliseconds, the time until that note is played?

Thanks in advance!

EDIT: Maybe it is as simple as .02 seconds per tick?? So if 5 ticks/row - then that it .1 seconds per row so 30th row would be 3 seconds? But I don't see how tempo plays into that...

#107784 - headspin - Wed Nov 01, 2006 11:43 pm

I'm not sure, but DekuTree's tutorial on making a mod player for GBA might be helpful

http://deku.gbadev.org/program/sound5.html
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game

#107791 - tepples - Thu Nov 02, 2006 12:48 am

sumiguchi wrote:
EDIT: Maybe it is as simple as .02 seconds per tick?? So if 5 ticks/row - then that it .1 seconds per row so 30th row would be 3 seconds? But I don't see how tempo plays into that...

Tempo tells how long each tick lasts. There are (2.5/tempo) seconds per tick.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#107799 - sumiguchi - Thu Nov 02, 2006 2:24 am

Quote:
Tempo tells how long each tick lasts. There are (2.5/tempo) seconds per tick.

Thats exactly what I wanted to know.

I guess my calculations worked out because I was using .02 and my tempo is set 125.

Thanks!