Golden Sun (The Lost Age) MIDI/Sound Engine

Started by MetaKnick, August 20, 2014, 05:00:37 AM

Previous topic - Next topic


So I'm going to be blunt. I can't hack or mod much really. I'm interested in it, but asm looks like a nightmare to me.

I've been messing around with Golden Sun's music lately with the use of "GBA Mus Riper" and I noticed some things in the midi events. Every song has a midi controller that says "NOT USED: Effects level=79". Now obviously it's not used because it's something specific to the sound engine. I'm pretty sure it's the reverb.
There's also the synth instruments that weren't converted at all because they're produced with the game's sound engine. They have "NRP [fine/course], RP [fine/course], and Data Entry [coarse].

I don't even know where to start reverse engineering. As I said, I've never done it before. It would be really cool if someone was willing to check this out! And if not, at least someone could point me in the right direction.


The sound format used internally by Golden Sun (and the majority of other GBA games) is similar to MIDI, but is not exactly MIDI, as you seem to be thinking. For instance, there is no "controllers" in this format.
The format is described in the notes I have uploaded here.

GBAMusRiper by default does not do a 1:1 conversion of the data that is in the ROM, it makes them more usable : It logarithmizes the volume changes and the note velocities, and converts various commands to controllers, pitch wheels and RPNs. I think I also added a reverb controller at the start of every track if reverb was enabled for the song, this "controller" is not existant in the original data : The reverb is enabled song-wise : Either the reverb is enabled for all Direct Sound channels, or it is disabled. You can't enable it individually for each track. Again this is to make the resultant MIDI more "usable". Reverb depth is controller 91 by the way, I'm pretty sure this is General MIDI standard.

As for the special instruments this is a speciality of Golden Sun. They are not releated with RPNs in any way, this is just an extension to the normal sound engine that Camelot made in order to have those special instruments.

RPNs are produced by GBAMusRiper when the game change the pitch wheel's range, or when it uses detune command. Those have no controller equivalent in the General MIDI standard, so RPNs have to be used. Without them you can only have a range of +/- 2 semitones, which is not super cool to do the glissando effects very present in the Golden Sun's soundtrack.

Also, I pratically didn't look at a single line of ASM code to reverse the sappy sound engine back then. Just pointers modifications and experimentation :)


Though Bregalad is undoubtedly one of the people I would like to have a chat with were I to be reverse engineering a sappy sound format game I do have to mention that Golden Sun is one of those fairly well hacked games, to the point of having quite high level editors (in some ways probably more so than pokemon). They took it to the point of having voice acting added to the game, is probably the main site for golden sun work (though like most things there is/was drama, splits and spinoffs). Most tools from them seem to be aimed at playback but it should at least give you some directions.


@Bregalad, thanks for the quick reply!! The documentation is very interesting so far. I'm super curious about finding a way to get that reverb and synth outside of the game though. Do you think it's possible in the long run?

Also, I found some tracks in certain songs that have no program assigned to it. They appear to be unused. It appears in GS:TLA's world map song, and Lemuria. Is there any way to find out what instrument would have been there, or was that data probably erased before release?

@FAST6191, I've actually been a member of that community for years now. Around when it was first started. Sadly, music hacking wasn't Atrius's specialty, and the only person that knew a lot about hacking music (Charon) left the hacking scene.

EDIT: and since Atrius has left the hacking scene as well, it's been at a standstill. Kinda depressing.


What exactly do you mean by "getting that reverb and synth outside of the game" ?

The tracks with no program assigned to them are exactly that in the original game. This is really weird. They appear to be silent in the game, but I guess they were supposed to be hearable with god-knows-what instrument, and that the team messed up when releasing the game. This is just my supposition.