ipatix / agbplay

Music player for the most common GBA sound format
GNU Lesser General Public License v3.0
119 stars 20 forks source link

Envelope Issue in Pokémon Ruby/Sapphire/Emerald #49

Closed N6661 closed 1 year ago

N6661 commented 2 years ago

The attack of some notes on PSG ch 1 & 2 in the Ending Theme from Pokémon Ruby/Sapphire/Emerald (song 455 on all three ROMs) are completely missing.

Issue originated in 00f4fe5 and has persisted since.

See attached zip for examples of mGBA output and agbplay output. example.zip

N6661 commented 2 years ago

For what it's worth, 00f4fe5 introduced the above-mentioned attack bug into Pokémon Center from Pokémon Ruby/Sapphire/Emerald (song 400 on all three ROMs) and while the issue in Pokémon Center was fixed in 04cfdb, the same issue in Ending Theme was not. (Example of the problem in Pokémon Center).

To clarify, neither Ending Theme nor Pokémon Center had the attack bug before 00f4fe5.

It seems that there're still some edge cases in regards to volume calculation that still isn't quite accurate.

ipatix commented 2 years ago

Maybe this is related to #44, I'll have to check. I haven't really spent much time with agbplay lately, but perhaps I may be able to have a look at it some time soon.

ipatix commented 2 years ago

So would you say the problem in the first example can be described as the tone dropping out even though it should not?

N6661 commented 2 years ago

It may or may not be, idk. That's why I opened a separate issue since #44 existed before 00f4fe5. And yes, I suppose you could call it dropping out in both examples.

ipatix commented 1 year ago

Can you check if the problem is fixed?

N6661 commented 1 year ago

Unfortunately the issue has not been fixed. Regardless of what simulate-cgb-sustain-bug is set to, the error still persists. However, this issue was previously fixed in the psg_debugging branch which doesn't seem to have been merged into the current master branch. It also means that this issue is a separate issue from #44.

edit: spelling

N6661 commented 1 year ago

I did a preliminary test by manually merging the code changes from psg_debugging with the current master branch and that fixes this issue without undoing the fix for #44. I'll let you have a more thorough look at the code though since I don't know if my janky manual splicing has any unintended consequences. Just letting you know, that seems to be the right direction.

ipatix commented 1 year ago

Lol, I don't remember this branch at all. I'll have to check what I've done there...

ipatix commented 1 year ago

Okay, I remember the idea but were always smarter afterwards and I already see edge cases where that fix doesn't work. I'm working on a proper fix right now.

ipatix commented 1 year ago

Should be fixed now.