First, thanks for all the input.
Mnemonic, yes, this was basically what I've come up with so far as well:
I see the global timer runs in milliseconds, correct?
So you can use GetMusicPosition() or GetMusicChannelPosition() to sync the two. Then read from an external file at what relative time positions you are looking for keystrokes (obviously adding a margin of error for human motor skills
) and that should do it?
My concerns are these, and please correct me where I am wrong or ignorant:
1. I read a forum post about problems with GetMusicPosition().
http://forum.dead-code.org/index.php?topic=2773.0 Has this been fixed?
2. You might want to give the player a heads up about what's coming (ala Guitar Hero), and that's where I believe Spellbreaker is voicing his concern for maintaining graphical sync. I suppose you could script a way to periodically check sync as you go and make corrections for unwanted drift either way.
Truthfully, the precision of time required is not
that loose, but certainly not accurate to the ms or anything like that. Music tempos are thought of in BPM (beats per minute). So, a tune in 4/4 (4 beats per measure) at 120BPM has two beats each second. So if you wanted the player to play 2 notes in the course of a beat, you're talking about a sync point every 250ms (give or take maybe 30ms either way).
Another couple questions about music functionality:
1. Does SetMusicPosition work without delay or is there a pause?
2. Do the loop points work without a pause?
3. When playing back multiple music channels at once can I maintain a tight sync between the two?
Clearly some of this stuff will be trial and error. But I appreciate your thoughts on the matter.