Synchronizing events on a music / XGM question

SGDK only sub forum

Moderator: Stef

Post Reply
astrofra
Interested
Posts: 28
Joined: Sun Dec 14, 2014 8:50 am
Location: Orleans | France
Contact:

Synchronizing events on a music / XGM question

Post by astrofra » Wed Jan 06, 2016 10:36 pm

Hi!

working on a demoscene project with the amazing SGDK, I would like to know if there's a way to synchronize my visual events with the music.
I'm currently using the XGM Driver, and I was looking for a function that would either give me the current clock/position of the VGM file being replayed, or even better, a way to access the current instruction executed by the player.

I'm aware that XGM driver is 100% Z80-driven, so it might not be straigtforward to fetch data and have them available in my C code, however I'm all hears if anyone have any idea, suggestion, technique, code snippet or pointers on that topic :D

I was thinking of a specific FX or Instrument that I could catch or detect but considering the structure of a VGM file, this might not even be possible, right ?

Thanks in advance.
640 polygons are enough for everyone.

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Re: Synchronizing events on a music / XGM question

Post by KanedaFr » Thu Jan 07, 2016 1:30 am

if you find a trick, it won't be long until a Guitar Hero MD appears ;)

astrofra
Interested
Posts: 28
Joined: Sun Dec 14, 2014 8:50 am
Location: Orleans | France
Contact:

Re: Synchronizing events on a music / XGM question

Post by astrofra » Thu Jan 07, 2016 7:31 am

With a clock, be it in ms, ticks or wathever unit is available, it could be quite easy to get precomputed levels from such a table :
https://code.google.com/p/within-the-me ... _beeps.nut
and then, in the code, decide what event to trigger or not.
640 polygons are enough for everyone.

Nainain
Interested
Posts: 14
Joined: Sat Oct 11, 2014 3:34 pm

Re: Synchronizing events on a music / XGM question

Post by Nainain » Fri Jan 08, 2016 5:32 pm


Post Reply