XGM song change bug, eternal note

SGDK only sub forum

Moderator: Stef

Post Reply
cero
Very interested
Posts: 233
Joined: Mon Nov 30, 2015 1:55 pm

XGM song change bug, eternal note

Post by cero » Fri May 05, 2017 1:31 pm

Looks like there's a bug in XGM that causes one note to play for ever on hardware.

1. Play an XGM song
2. Play a different XGM song that doesn't use all the channels song 1 used
3. The unused channel plays a note for ever

I don't have a small test ROM right now, and I haven't had it happen in emulators either, got a report on hw.

Moon-Watcher
Very interested
Posts: 117
Joined: Sun Jan 02, 2011 9:14 pm

Re: XGM song change bug, eternal note

Post by Moon-Watcher » Fri May 05, 2017 1:52 pm

I have experienced the same behavior

User avatar
Stef
Very interested
Posts: 2799
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: XGM song change bug, eternal note

Post by Stef » Fri May 05, 2017 6:55 pm

It happens only on real hardware ? it would be nice to have a test rom but just to be sure, maintened notes are the ones from previous xgm music ? did you try to insert a stop command (waiting a frame or 2) before starting the next music ?

cero
Very interested
Posts: 233
Joined: Mon Nov 30, 2015 1:55 pm

Re: XGM song change bug, eternal note

Post by cero » Sat May 06, 2017 7:43 am

Yes, the maintaining notes are from the previous song. I didn't try the stop command since the commands inside it look identical to the ones when starting a new song; the current attempted workaround is to start an empty song (all channels silence) before switching to a new song, I don't know yet if that works.

I haven't been able to reproduce in any emulator, but perhaps the accurate (and windows-only) ones would also do it.

User avatar
Stef
Very interested
Posts: 2799
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: XGM song change bug, eternal note

Post by Stef » Sat May 06, 2017 5:54 pm

Well i'm a bit surprised as by default all XGM music has a kind of header command to initialize the YM2612 and so turn off all channels. The fact it happens only on real hardware means there is probably a timing issue, maybe the registers are wrote too quickly (key on/off sequence) so they are not correctly interpreted. when you use stop command the XGM driver send a "dummy" music play command which only contains commands to reset / turn off the YM2612 sounds.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests