Improve sound quality of GBA games

You can talk about almost anything that you want to on this board.

Moderator: Moderators

User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Improve sound quality of GBA games

Post by Bregalad »

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.
User avatar
blargg
Posts: 3715
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

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.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

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/Castle ... Quality.7z

Is the difference noticeable ? Is it worth re-dumping GSF of other games hacking it to get a high sampling rate ?
Last edited by Bregalad on Wed May 26, 2010 2:08 pm, edited 1 time in total.
Useless, lumbering half-wits don't scare us.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Post by lidnariq »

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.
User avatar
blargg
Posts: 3715
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

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.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

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.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

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.


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).
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.
Useless, lumbering half-wits don't scare us.
ccovell
Posts: 1045
Joined: Sun Mar 19, 2006 9:44 pm
Location: Japan
Contact:

Post by ccovell »

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!
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

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.
Last edited by Bregalad on Wed May 26, 2010 2:09 pm, edited 1 time in total.
Useless, lumbering half-wits don't scare us.
User avatar
RushJet1
Posts: 155
Joined: Wed Nov 10, 2004 10:17 pm
Contact:

Post by RushJet1 »

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.
User avatar
RushJet1
Posts: 155
Joined: Wed Nov 10, 2004 10:17 pm
Contact:

Post by RushJet1 »

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.
User avatar
blargg
Posts: 3715
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

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.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

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.
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
Useless, lumbering half-wits don't scare us.
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

I think you need to reduce the roms before you saptapper them. Otherwise they're just basically zipped roms.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

How am I supposed to do that ?
Useless, lumbering half-wits don't scare us.
Post Reply