Pokemon HeartGold and SoulSilver

Latest Shouts In The Shoutbox -- View The Shoutbox · Rules -  

  Reply to this topicStart new topicStart Poll

» Music Importing Tutorial, Transferring Music between GBA Games
 Posted: Apr 17 2010, 05:46 AM
Quote Post

Level 4
Group Icon
Group: Member
Posts: 31
Member No.: 65
Joined: 24-February 10

Gender: Male

Music Importing Tutorial

Yeah, I think Blazer told me to make a tutorial at one time or another... and someone made a thread wondering about it...
Anyways, yeah, here's what I know about how to import music from one game into another...


1) Knowledge of how to use a hex editor
2) How to copy and paste using a hex editor http://i406.photobucket.com/albums/pp148/TheLeafeonFan/Emoticons/tongue.gif
3) A Hex editor (LMAO) and Sappy (I use 2006, but any of them will work provided they have the "Export Samples" and "Import/Export Tracks"
4) ROM you're going to import from, and ROM you're going to import to
5) You've at least skimmed through Blazer's Music Hacking Tutorial to familiarize yourself with the terminology
6) You know how to use Windows Calculator or have Hex converting embedded into your brain (which I don't)
7) You know how to find free space in your destination ROM...
8) You worship Captain Falcon and have dedicated yourself to learning how to FALCOOOOOWN PAUUUUNCH user posted image properly

Moving on... Your starting screen...

user posted image

Backup both copies of your ROMs... so you can edit one and use the other as a reference or something...
HxD cannot edit any ROM that is open in Sappy at the same time...

user posted image

In this example, we will be replacing the FE7 Arena Music, with the FE6 Arena music...
A helpful note, you may want to keep Notepad/Notepad++ to keep all your notes... it WILL save you a lot of headaches...

First thing's first, we need to extract the tracks of the song we want...
Open up FE6 in Sappy, scroll to the "Arena ~ Battle ~ Arena 2 (Battle)" and "Export Tracks"

user posted image

You will see this screen:
user posted image

Check all the boxes, and type the file path for where to save the tracks...

user posted image

and press "OK", and then "Exit"...

You should get files in the folder, corresponding to the number of tracks you had checkboxed ._.

user posted image

If you look in those files with a Hex Editor, it's nothing more than the track... if you want to know what the commands are in that track... look at the documentation provided in the PDF version of Blazer's Music Hacking tutorial (best place to get it would be FEShrine ._.)

user posted image

Still looking at Sappy, copy down the information on the song... Meaning this:

FE6 Arena Battle
Table 0x3996A8
Header 0x582678
Voicegroup 0x3929FC

Close Sappy first (the "another process" issue) and go to the "Voicegroup" offset... This is the instrument map that Blazer refers to in his very useful patch... it is the instrument map for this song... and contains the 128 instrument info... each instrument is 12 in length in HxD... the "numbers" you see in Sappy, when you play the song in sappy and expand it (click the green arrows on the very right) is from 0 - 127...

user posted image

Look at the pink numbers on the very left... that's it...

(More documentation on what the "instruments" are (in hex) in the documentation section of Blazer's PDF...

Go to the Voicegroup offset of the FE6 Arena:

user posted image

12 in hex is "C"... and multiply that by 128(to include all of them, not just the start of the 128th instrument aka "127" since it starts from "0" as teh first instrument, which in hex is "80" (I use windows calculator for everything like this)

and you get: 1536, which is "600" in hex...
So add that to the offset of 3929FC (for the beginning of the voicegroup) and you get: 392FFB (Since 392FFC is when the next voicegroup starts)

Put that in your text file somewhere... open up the FE7 ROM using Sappy, and get the info for the song you want to replace:

FE7 Arena Battle
Table 0x69D920
Header 0xAC9A18
Voicegroup 0x68E840

Close Sappy and go to the voice group offset in your Hex Editor...

Go to your FE6 ROM... Copy everything from 3929FC until 392FFB and Paste overwrite (IMPORTANT, OVERWRITE) (Ctrl + B in HxD) in the FE7 ROM at the Voicegroup/Instrument map offset (68E840)

Copy from FE6:
user posted image

Paste in FE7:
user posted image

(Save it, it should go without saying http://www.majhost.com/gallery/BlueLeafeon/Emoticons/argh_01.gif)

Now, we move on to extracting the actual "sounds" from the instruments...
Open up FE6 again in Sappy and the FE6 Arena song and this time go to "Export Samples" and choose "raw"...
Just like the tracks, there's a "file pattern"...

user posted image

I just know they're instruments so I just put "$I.raw"...

Press "OK" and you should have something like this (I have RAW files associated with HxD, so don't worry about the icons):

user posted image

Now, here's the tricky part... they have their header's cut off... so you have to open up each instrument that is used in the song (you can tell by looking while playing the music in sappy and see which numbers come up) and search for it in the FE6 ROM and copy the row of data before it to get the data, and paste WRITE at the beginning of the RAW file to get the entire "wav" data...

(If you didn't understand any of that... just do exactly as my instructions say ._.)

The FE6 Arena Music uses these instruments:
"34" Instrument
"38" Instrument
"48" Instrument
"61" Instrument

and the "127" drum Instrument... but I don't know how to extrac those since export samples doesn't do it for you...

Open up 34.raw:
user posted image

Press "Ctrl + A" or "Select All" or whatever to highlight everything...

Copy it...

Go to the FE6 ROM and use your find function... paste it in the box, and make sure it's a Hex Values search...
(You won't see the numbers in the box if the data is large enough... just know it's there...)

user posted image

And then you'll find it in the ROM (if you didn't, you did something wrong ._.)

Scroll back to where the highlighting starts...

user posted image

Copy the 15 before the start... as in if your cursor is at the start of where the highlighting was, hold shift and press up once ._.

user posted image

Copy that and Paste WRITE at the beginning of your original RAW file... Save it...

Take THAT, and put it in Free space in your FE7 ROM... WRITE DOWN THE OFFSET...
Do this for every instrument...

In my case, this is from my notes:

Offset for Imported .wav instruments/sound effects:
"34" Instrument from FE6 (Arena): D71000 - D72A70
"38" Instrument from FE6 (Arena): D72A70 - D75B80
"48" Instrument from FE6 (Arena): D75B80 - D781E0
"61" Instrument from FE6 (Arena): D781E0 - D79DD0

Remember the offset for the voicegroup/instrument map for FE7 that you pasted over?


Go there...

Now, we have the instrument numbers 34, 38, 48, and 61...

Get those numbers... Multiply by 12.. convert them to Hex... we get:

34: 408 ---> 198 + 68E840 = 68E9D8
38: 456 ---> 1C8 + 68E840 = 68EA08
48: 576 ---> 240 + 68E840 = 68EA80
61: 732 ---> 2DC + 68E840 = 68EB1C

We look at "68E9D8" and we have: "00 3C 00 00 E4 7C 3A 08 FF 00 FF A5"

user posted image

The "E4 7C 3A 08" is a pointer to the "34" instrument sound, back in FE6... at 3A7CE4

SOOOOO... what we have to do is repoint that to where we pasted the sound effect...
From the notes up there... the "34" instrument was pasted at D71000... so we have to replace the pointer with "00 10 D7 08"...

That's why I told you to write them down... Do that for every instrument...

Done? But wait, didn't the song use a "127" instrument? Yep, it's the drums... and right now... it's pointing to the FE6 offset of it...

We're lucky, since the FE7 Arena has the "127" instrument pointer...

So... open up you backup ROM and do the calculations from before to get where the instrument is:

127 x 12 = 1524 ---> 5F4 + 68E840 = 68EE34

So just go to that offset in the backup clean ROM... Copy the 12 numbers... and Paste overwrite into the same offset on the import ROM...
Okay, now you've successfully setup your instrument map... Now it's the easy part now...

Make sure you have some free space that you know of where to place the tracks...

Copy those "Track Files" you extracted to your desktop, as it seems that's the only place Sappy can find them...

Open the FE7 Rom and scroll to the song you want to replace, which is the FE7 Arena...

Press "Import Tracks"

user posted image

Check the boxes for the files with the tracks, and change the Header and First track offsets to free space...
Just to be safe, I put the header BEFORE the tracks (unlike the game, which puts the header at the end of the tracks) and keep some space between them...

user posted image

Say "Yes" to "Done. Do you want to set the proper entry in the Song Table?"

You are Finished http://i406.photobucket.com/albums/pp148/TheLeafeonFan/Emoticons/grin.gif

Enjoy your song, if there's no noise that makes your ears bleed ._.

Here's the result:

Fire Emblem: Final FE6 Arena Music Import

I hope I did a good job of describing my process http://i406.photobucket.com/albums/pp148/TheLeafeonFan/Emoticons/grin.gif
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll



» Affiliates [ View All | Link-us ]
Pet Actorz Cattery FEShrine FEND