nesdev.com
https://forums.nesdev.com/

Improve sound quality of GBA games
https://forums.nesdev.com/viewtopic.php?f=5&t=6408
Page 1 of 3

Author:  Bregalad [ Mon May 24, 2010 11:13 am ]
Post subject:  Improve sound quality of GBA games

After seeing something DWedit said on this board, I made some research and I found a way to find and modify the settings of GBA games that uses the standard ("sappy") sound driver. In theory, by increasing the sampling rate, the games should sound better. However, I have issues with it.
See chapter 3 here

The main issues are this :
1) Some games just ignores if you change the values and this has absolutely no effect (ex : Fire Emblem games)
2) Some games let you change the values, but will glitch. (ex : Golden sun, which apparently let you change the sampling rate but "force" the frequency of the DMA, which result in terrible sound if you change the rate)
3) Some games eventually let you change the value, but the percussion instruments and sound effects, which are "non-resampled" instruments (see in my doc) will also play faster and won't sound good.

I know those problems won't go away, but I'd like to see GSF ripped with forced high-quality parameters. I've been able for example to make a GSF rip of Castlevania - Aria of Sorrow and force the game to have 12 channels and sampling rate of 44 kHz, and it does sound a bit better than the original. However, I've had to change manually all percussion instrument from mode 8 to mode 0 (so they are down-sampled), and because most of the time all instruments are down-sampled (because the engineers designed it game for 13 kHz) it doens't sound that much better.

I'd like the help of someone who knowns a lot about ARM and the GBA to be able to make high quality GSFs.

Author:  blargg [ Mon May 24, 2010 11:26 am ]
Post subject: 

Since so many games use this sound engine, it'd be interesting to just rewrite the whole playback portion in a high-level language and not even run it on GBA hardware. This would allow making the best of the available data without any limitations. I'm guessing though that many games make slight alterations to the format.

Author:  Bregalad [ Tue May 25, 2010 9:48 am ]
Post subject: 

Well, I invite everyone to compare :
Normal quality Aria of Sorrow GSF (8 channels, 13 kHz) : http://gsf.caitsith2.net/gsfs/aos.rar
My high quality hack dump (12 channels, 42 kHz) : http://jonathan.microclub.ch/GSF/Castlevania_Aria_of_Sorrrow_high_Quality.7z

Is the difference noticeable ? Is it worth re-dumping GSF of other games hacking it to get a high sampling rate ?

Author:  lidnariq [ Tue May 25, 2010 3:35 pm ]
Post subject: 

Some of the songs in the set (Clock Tower, Black Sun) really benefit from it; others (Castle Corridor), not so much.

I find myself wondering, though -- what's the point in improving the quality of the sound a little? It's no longer what the GBA did play in-game, and it's not as good as it could be if it were just converted to midi or whatnot.

Author:  blargg [ Tue May 25, 2010 4:04 pm ]
Post subject: 

Somewhat related, I once did something similar for an old Mac music program (Super Studio Session), patching the program to double the sampling rate from 11 to 22 kHz. There were some problems with some samples playing faster than the engine could handle, but it worked for most songs. Similar to this, the idea was to improve sound quality without drastically altering it, so as to keep the nostalgic feel.

Author:  tepples [ Tue May 25, 2010 6:28 pm ]
Post subject: 

lidnariq wrote:
what's the point in improving the quality of the sound a little? It's no longer what the GBA did play in-game, and it's not as good as it could be if it were just converted to midi or whatnot.

what's the point in Super Mario Advance 1 (SMB2U) and Super Mario Advance 4 (SMB3)? It's no longer what the NES did play in-game, and it's not as good as it could be if it were just converted to a 3D engine or whatnot.

Author:  Bregalad [ Wed May 26, 2010 5:30 am ]
Post subject: 

Quote:
It's no longer what the GBA did play in-game, and it's not as good as it could be if it were just converted to midi or whatnot.

It is what the GBA play in game, just with a higher sampling rate. The point is to listen the OST of your favorite games but with less muffled sound.
Quote:


Since so many games use this sound engine, it'd be interesting to just rewrite the whole playback portion in a high-level language and not even run it on GBA hardware. This would allow making the best of the available data without any limitations.

It'd be interesting, but I have no skills in ARM. This would require completely disassemble the code and figure it out which sounds... more complicated than re-create another sound engine to me.

However if you're talking about building a program that can play music from GBA games "directly" without emulating the GBA (aside the PSG channels) I fully agree with you. That way you could get rid of this annoying 8-bit "sshhhh" sound in songs which aren't very loud by using more bits (not possible on GBA hardware). Also you could use cubic interpolation with higher sampling rate and thus recreate treble when down sampling, which would sound better than the GBA even at 42 kHz (which only does linear interpolation to what it seems, altough I suspect a few games to use no interpolation to save CPU time).

Quote:
I'm guessing though that many games make slight alterations to the format.

They don't. I was able to make game use music and sound effect from other games with only minimal effort. Because the ROM from both the host game and the one the music is played form is located in the same area, I need to paste the data from the ROM the music should be played from at the end of the host ROM, and I made a java program that tries to fix all pointers and remove the size of the host ROM to them. The only issues with is was :
- Sample playing at wrong rate (which can be easily fixed as I said in my document)
- Pitch of instruments has a few times been off, probably because the pitch information in sample header was considered a "pointer" by my program and was "fixed", while it shouldn't have been affected, resulting in the sample playing too low.

So no, games makes no variant over the format, they only varies in a few aspect like mono/stereo, sampling rate and # of channels.

Author:  ccovell [ Wed May 26, 2010 5:54 am ]
Post subject: 

The sound quality of your fixed GSFs sound pretty good, quite a bit clearer than the original ones. Keep up the hacking if you want to!

Author:  Bregalad [ Wed May 26, 2010 6:53 am ]
Post subject: 

Now some new dones :
Mega Man Battle Network High Quality (42 kHz instead of 10 kHz) : here
Original here

Because the game uses mostly PSG channels for it's music, it doesn't sound very different. In fact I don't think the improved rate makes any difference in any song, but I might be wrong.

Fire Emblem : The Sacred Stones High Quality (42 kHz instead of 13 kHz) : here
Original here
Some songs, especially the ones with high pitched instruments, sounds a little better. However, for the most part the increase of quality is surprisingly less striking than in Castlevania Aria of Sorrow (unfortunately) for the same original sample rate.

Author:  RushJet1 [ Wed May 26, 2010 11:31 am ]
Post subject: 

ccovell wrote:
The sound quality of your fixed GSFs sound pretty good, quite a bit clearer than the original ones. Keep up the hacking if you want to!


I agree! These are amazing. One I'd love to see is Metroid Fusion.

Author:  RushJet1 [ Wed May 26, 2010 11:37 am ]
Post subject: 

Bregalad wrote:
Now some new dones :
Mega Man Battle Network High Quality (42 kHz instead of 10 kHz) : here
Original here

Because the game uses mostly PSG channels for it's music, it doesn't sound very different. In fact I don't think the improved rate makes any difference in any song, but I might be wrong.


It's occasionally noticeable, like in Doubtful Mood's strings, and in a couple other songs, but the squares do take over in most songs so it's harder to tell ... but for the most part I noticed an increase in quality.

Author:  blargg [ Wed May 26, 2010 11:43 am ]
Post subject: 

RushJet1 wrote:
These are amazing. One I'd love to see is Metroid Fusion.

Seconded! The theme for Sector 4 AQA is just pure '80s instrumental bliss.

Author:  Bregalad [ Wed May 26, 2010 1:59 pm ]
Post subject: 

Now I moved files to the new folder http://jonathan.microclub.ch/GSF
Fire Emblem high quality is new. Like it's sequel sacred stones, it sounds a bit better but the difference is not as striking as I would have it to be.

Quote:
It's occasionally noticeable, like in Doubtful Mood's strings, and in a couple other songs, but the squares do take over in most songs so it's harder to tell ... but for the most part I noticed an increase in quality.

Well even in Doubtful Mood's, Boundless Network or VS Dream Virus (which makes the most use of non-PSG channels) the increase in quality isn't very much noticeable I find.
However, I made another version which is the same sampling rate as the original, but with boosted reverb. Tell me what you thing of it :p

Author:  Dwedit [ Wed May 26, 2010 4:34 pm ]
Post subject: 

I think you need to reduce the roms before you saptapper them. Otherwise they're just basically zipped roms.

Author:  Bregalad [ Fri May 28, 2010 6:54 am ]
Post subject: 

How am I supposed to do that ?

Page 1 of 3 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/