News:

As a consequence of the forum being updated and repaired, the chatbox has been lost.
However, you can still come say hi on our Discord server!

Main Menu

Transferring GS instruments

Started by Mariobro3828, 07, June, 2011, 05:58:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mariobro3828

Hello GS hackers,

I'm a huge fan of Golden Sun music and have always wanted to transfer a lot of it to my FE ROM hack. What I have tried so far is MIDIs, but those really don't do the songs from GS justice, as they're different instruments that just don't produce the same quality of sound that was strived for and achieved by GS instruments.

Now, using Zahlman's song editor (an editor made for transferring songs from one ROM to another), I could transfer the songs one by one (if I knew the offsets of their headers) but to me, it seems like a highly inefficient method. From what I can gather (I really don't know the specifics) the song editor takes the instruments necessary for a ripped song and transfers them. That would cause a lot of redundant data if songs were transferred in mass.

What I ideally want to do is transfer all the GS instrument data necessary from here to my FE rom via...more or less...copy paste methods, then transfer whatever songs I need via the same method and enjoy them in lossless quality.

I have some questions. Is the knowledge of GS song data here sufficient to do this?
How big is the GS instrument map data wise?
Is there restrictions that FE has (eg no. of instruments allowed) that GS doesn't have/is more lenient on? (or more rather, does GS have an 8 track limit as well?)
If this is plausible, exactly how much about music data am I going to need to know to pull this off? Is it all documented or are there certain techniques I need to explore? Or would it really just come down to copying and pasting the instrument and repointing every pointer with a calculator? (tedious I know, but I'm willing to do it)

I apologize if that is a lot of questions. I just think it would be cool to be the first person in FE hacking to have ported over the entire instrument map from GS, a game I nostalgically love.

Thanks for any feedback,

Mariobro3828

EDIT: I do apologize if this is in the wrong section, I think I may have jumped the gun when posting, this probably belongs in general hacking right?


I was originally going to send this as a PM to Charon the Ferryman (I know she's rather knowledgeable of this kind of thing), but the validation images seem to be buggy.

Atrius (He/Him)

Well, there's my handy dandy GBA audio data ripper which can rip ALL of the audio data from most GBA games, or append it to the end of another file.  I've been meaning to upgrade it so it can insert it anywhere in another file, but never really got around to it.  Anyway, it just transfers all of the audio data, adjusting pointers accordingly, you'd still have to go into FE's audio data, and repoint some of it's audio slots to the newly inserted audio instead.

QuoteI have some questions. Is the knowledge of GS song data here sufficient to do this?
Yes, myself and Charon are very knowledgeable of the format.

QuoteHow big is the GS instrument map data wise?
Instrument data alone... I'm not 100% sure, but ALL of the audio data combined is 1,403Kb.

QuoteIs there restrictions that FE has (eg no. of instruments allowed) that GS doesn't have/is more lenient on? (or more rather, does GS have an 8 track limit as well?)
I do recall hitting that limit at one point, I don't remember exactly what it was though...  I know it does have some synthesized instrument types that many other GBA games don't support though.

QuoteIf this is plausible, exactly how much about music data am I going to need to know to pull this off? Is it all documented or are there certain techniques I need to explore? Or would it really just come down to copying and pasting the instrument and repointing every pointer with a calculator? (tedious I know, but I'm willing to do it)
Well, my tool could definitely make things easier.  Charon also wrote a guide on the format at the bottom of the first post in this topic.
[sprite=220,4,0]I'm shaking my head in general disapproval of everything[/sprite]

Charon

#2
On the limit... I've fit 13 tracks into one song at once with at least 7-8 playing without cancellation. If you want I'll preform a test (after work today) to see what it really is...

I've heard Blazer was able to locate the actual programming for the sound data so if you could repoint all that data, you could in theory get the exact sound as Golden Sun gets.

Mariobro3828

Quote from: Atrius on 07, June, 2011, 03:15:06 PM
Well, there's my handy dandy GBA audio data ripper which can rip ALL of the audio data from most GBA games, or append it to the end of another file.  I've been meaning to upgrade it so it can insert it anywhere in another file, but never really got around to it.  Anyway, it just transfers all of the audio data, adjusting pointers accordingly, you'd still have to go into FE's audio data, and repoint some of it's audio slots to the newly inserted audio instead.

Meaning simply the song array the points to song headers correct? Or will I have to alter some pointers in the ASM code of the game? Either way, that's a very handy little tool you made there.



Quote
QuoteHow big is the GS instrument map data wise?
Instrument data alone... I'm not 100% sure, but ALL of the audio data combined is 1,403Kb.
That's...not too bad. I had 17 MB available in the beginning, am about halfway through the event programming of my ROM hack and have only used about 2 out of those 17 (and about 1.3 MB of that was used for MIDI conversion instrument maps...so really song and instrument data is gonna be my biggest filler here).

Quote
QuoteIs there restrictions that FE has (eg no. of instruments allowed) that GS doesn't have/is more lenient on? (or more rather, does GS have an 8 track limit as well?)
I do recall hitting that limit at one point, I don't remember exactly what it was though...  I know it does have some synthesized instrument types that many other GBA games don't support though.
Hmm, that's....troubling but maybe it isn't so bad.

Quote
QuoteIf this is plausible, exactly how much about music data am I going to need to know to pull this off? Is it all documented or are there certain techniques I need to explore? Or would it really just come down to copying and pasting the instrument and repointing every pointer with a calculator? (tedious I know, but I'm willing to do it)
Well, my tool could definitely make things easier.  Charon also wrote a guide on the format at the bottom of the first post in this topic.
I'll get to reading that guide.


Quote from: Charon the Ferryman on 07, June, 2011, 03:17:08 PM
On the limit... I've fit 13 tracks into one song at once with at least 7-8 playing without cancellation. If you want I'll preform a test (after work today) to see what it really is...

I've heard Blazer was able to locate the actual programming for the sound data so if you could repoint all that data, you could in theory get the exact sound as Golden Sun gets.
Hmmm...13...that's quite a bit better than FE does. Yeah, exact sound is what I'm going for but I'm pretty unfamiliar with sound data formats so I might come to you two for questions if that's ok.

Mariobro3828

Actually, on second thought, I just want to start out by trying to transfer the songs directly and see what kind of results I get.

If you guys have them, could I possibly get the offset of the array that contains all the pointers to the various songs in the game as well as a list of the values of the songs? If I have those I can calculate the location of the pointer to the header of the song desired and I can try this direct transfer with a few songs.

Charon

IIRC TLA's is located at 0x81C4530

Mariobro3828

Tested the direct import method with 2 tracks.

Try one: Saturos battle theme (1 instrument unsupported)

Nothing. Completely blank, no sound. (Disappointing to me, Saturos battle theme was my fave, and the midi version came out "meh" at best upon importation).

Try two: Colosso battle theme (1 instrument unsupported)

Perfect transfer, minus percussion (D:) which is vital. (the midi version for this one actually wasn't too bad, original is still better but the midi actually comes close)


Bah. This leaves me undecided. The Saturos battle theme was a big one. Ugh.


Did I get the value for the song right though? The list I referenced said it was this:

0x02ef Saturos Battle!

But the list jumped around a lot (and randomly went up and down 0x100 or so, so I don't know how trustworthy it is).

Charon

I would check your instruments and pointers if you're not getting any sounds. Also, make sure you fix all the loop pointers because there's tons of them, and if you don't fix them... well... then they go to the wrong place and play the wrong notes.

Mariobro3828

So I tried the first one again, and this time it was successful, but I got this:


http://www.youtube.com/watch?v=xyfJhTMZp1M


It would seem that once again the percussion is not compatible with FE, and whatever weird synth instrument (that's noticeably missing from the beginning and the 5/8 bars) it has is not compatible as well. Also the song has 10 tracks, 9 of which were transferred. FE has an 8 track limited so I moved 9 on to 8 after recording that video, and it turned out it was just an echo effect for the oboe melody.

Here's the data that was transferred:

http://dl.dropbox.com/u/20463170/gssaturosbattransferdata

I was wondering, is there any way to repoint the percussion and synth instrument to another instrument set while keep the others pointed to the current ones? I have a working version of percussion and that synth instrument I can use.

Charon

I think I understand what the problem with the percussion is - FE probably uses a different percussion instrument. GS uses 0x7F as its percussion instrument, FE is probably 0x00 or something.

If there are beeps that are produced because of this, then there are certain drum notes in the song that are unsupported by FE. The best way to fix this is to just clear the data of the "Blank" drumkit instruments,  this way they make no sound instead of that awful beep.

Mariobro3828

Oh sorry for not being clear.


The method I was using was Zahlman's GBA song editor for the transfer, which takes the instruments necessary, and transfers them along with the song data. So the data had a consistent BD 01, BD 02, BD 03, etc per different track going since the instrument list is tailored to it.

I tried using FE instruments but they sounded worse than the midi for this purpose.

Charon

It might be the limit then, what I would do is go into the header and remove the echo tracks and see if that fixes anything.

Sleipnir36

Hi Mariobro, good to see you still progressing with the (seriously) best FE7 hack ever. Charon thankfully inheired the nessesary computer skills from her daddy to help you out with all these weird (for me) hacking stuff thingies things etc.

Mariobro3828

#13
Hahaha! Awesome to see ya here too.


http://www.youtube.com/watch?v=nIJW-pK3VFE

So apparently it is possible to do this with a little magic (and an apparently undeletable beep...).

I really need to learn more about music hacking and data structures. I'm a computer engineering major but have not progressed that far in my major (just switched to it last semester) so this knowledge definitely wouldn't be pointless to me.


EDIT: SUCCESS! I had to repoint some instruments for the ones that were incompatible, but these turned out alright. Only the Saturos battle lost some data because of the amount of tracks (half of them were just echoes)

http://www.youtube.com/watch?v=4IO154H3cNM   Karst & Agatio battle
http://www.youtube.com/watch?v=du6PzNlej7Y    Colosso Battle Theme
http://www.youtube.com/watch?v=tObZ1T3n5n8    Saturos Battle Theme


Mariobro3828

http://www.youtube.com/watch?v=kYv2v_I3Tbw


Sorry for the double post, but I just wanted to show how close to the original I was able to make some of these tracks with a simple bit of splicing tracks together (to fit in the 8 track limit) and finding out that the FE7 drumset is waaaaay better than the midi default.