phase / sbhs

Sonic Battle Hack Suite - GUI program for reverse engineering & patching Sonic Battle for the GBA.
https://jadon.io/sbhs/
Mozilla Public License 2.0
11 stars 3 forks source link

Music Hacking #12

Open phase opened 6 years ago

phase commented 6 years ago

@Glimmericious created a nice tutorial that I'm copying here to archive. (Copying all of these images was very annoying because Google Docs makes it a hassle.)


Alright, so, to transfer music from one game to another, you’ll want to do a few things:

Export the tracks from the game you want to borrow a track from.

a

This one’s self-explanatory - just hit ‘export tracks’ while the track you wanna use is selected.

b

Check everything on the list and name them in 2 however you would like. I would recommend naming it something simple. $T is replaced by the track number and $P is replaced by the track’s pointer, so do what you gotta. After that:

c

It’s important to make sure that $I is included, as it shows what instrument you’ll be replacing in your voice table. The format I usually use is $I $T, for simplicity’s sake.

Now, on the target game…

Go to the track you’re replacing and import the tracks.

d

The tracks you exported will be where your ROM file is, which is lovely.

Use

e

To navigate to the folder where your rom is, and hit ‘OK’. Then, check off of the tracks you want to import, and hit ‘Import.’ Viola! Now your tracks from the song are imported, but you still need to import samples to make sure that your song sounds right.

Importing Samples

This is a bit less simple.

You’ll want to browse to where your samples are stored. How you stored them doesn’t matter that much - .raw, .s, .wav, et cetera. Once it’s selected, you’ll need free space to import it to. In Sonic Battle, you’ll find that FB0000 and beyond are free, so if you haven’t messed with anything, use that instead.

f

And then, Import. It will tell you what space is being occupied by the samples, and I suggest you keep track of it and which instrument is stored where. You don’t want to import your samples in places overlapping, and you definitely want to know where you stored everything for later.

You can only insert samples at the beginnings of lines. What that means is that if your sample is stored from, say, FB0000 to FB1432, you would have to import the next sample at FB1440.

Checking Instrument Use/The Voice Table

Beside every track, there’s a handy-dandy arrow. Click it to show more detailed information about the track.

g

There’s a lot of stuff here, but what you’re really worried about are the red numbers on the far left. Play the song for a moment, and those will change to something else -

h

These numbers are what instrument is playing. On your imported track, these numbers will be important, so pull up the Voice Table.

i

This is where keeping track of where each track is stored is important - go to the instrument shown that isn’t playing correctly. Change the Output Device to DirectSound, and change Address1 to where you stored your track earlier. For example, if Instrument 48 isn’t right, you will Import sample 48 and change Address1 to where you imported Sample 48 to. You’ll want to repeat this process for every instrument that plays.

Other Instruments

If the instrument is not a DirectSound, it doesn’t have a sample. So, instead, you’ll want to pull up the game you’re copying from again. Go the defective instrument in its Voice Table, and copy down the properties of the instrument.

j

This instrument has an Atk of 0, Dec of 0, Sus of 15 and Rel of 0. Copy everything down and head back to your other game. Copy the properties down, and you’re already done! Way fewer steps than with samples.

From a MIDI

This is a bit out of my territory, but I can try. You can use mid2agb to convert midis to tracks that Sappy can then use. You’ll want to Assemble the Song instead of something else, however.

k

That part’s simple. After that, you have to get the samples that the MIDI is using. I’m not sure how to do this, but Google does provide a few samples you could import and probably get something pretty similar. The process of importing the samples and changing the instruments to the new addresses should, theoretically, remain the same.

Character Voices

Character voices are also on instruments, so it’s pretty easy. Import the voice you want to use - although it has to be a .wav file - and repeat the process of finding the instrument and changing the Address1 of the instrument.