Music Insertion Guide for Beginners


#1

But Music is Hard!

When you first look into hacking, music can seem to be one of the most intimidating and difficult parts. Well, I’m here to show you that that impression is completely wrong! Music is very easy once you know what you’re doing; in fact, I’d argue that it may be one of the easiest parts of hacking.

Step 1: Making Music

I won’t spend too long on this, but there’s a few important things you should keep in mind while making your music if you want to later insert it into GBA.

Make your music as a MIDI. This is probably the most important rule. If you’re brand-new to this, you may wonder, “Why does my music have to be a MIDI?” Well, let me explain it like this.

The sound engine that many GBA games use is called m4a. In this engine, instead of having the entire song already mixed into a single file, there’s a collection of instrument samples stored in the ROM that are called whenever a note is to be played with that instrument. The songs themselves are just a set of instructions as to what noises to make when and at what pitch.
Similarly, a MIDI file is just a set of instructions as to what note to play when; therefore, a MIDI file can be easily converted into a compatible file for inserting into your game. Note that an .mp3 or similar file cannot be converted to a compatible file. .wav files technically can be inserted, but that is not only a fairly complicated process, it is also not recommended in general and will not be covered in this guide as a result.

“But Sme,” you may be asking, “I found generic mp3 to midi converter! Can’t I use this to make the music I want into a MIDI?”
Short answer: No.
Long answer: Noooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo.
Serious answer: Files like mp3s and wavs are already mixed audio; they can’t be turned into a MIDI. If you want to know what your mp3 as a MIDI would sound like, here’s a few examples as to why that’s a bad idea. Or, to put it more concisely:

Loop Points. We’ll go over how exactly to set them in the next step, but keep in mind that you’ll need a point for your song to end and a point for it to loop back to from the end, assuming you want your song to loop (which the vast majority of the time you will).

Track Limit. There is a limit of 16 (8 in vanilla, a patch ups it to 16) tracks that your song can have at one time and 12 (again, lower in vanilla but same patch makes it 12) notes that can be played at the same time. When creating your music, keep these limitations in mind.

Step 2: Formatting your MIDI

Before we can convert our MIDI to be insertable we need to format it so the converter knows what various things are. For this, we will be using Anvil Studio.
Anvil Studio has a number of useful features that we can use to format our MIDI. There’s 2 features we’re going to use here; the first of which is cues.
Cues are how we’re going to set our loop points. When you open your MIDI in Anvil Studio, look to the top bar:

Here there’s a number of playback controls, but the one relevant to us at the moment is the button currently labeled as New cue. Take the playback cursor and place it over the spot you want to loop back to. If you don’t have a staff editor or piano roll editor visible, as these can make finding the correct position easier, go to the View tab above the bar in the image and click on your preferred editor. Once your cursor is in place, press New cue. It should open this window:

This cue should be called [. Now, go to where your loop area ends and create a cue called ]. These cues will be interpreted as the beginning and end points for your loop. Now, go to the File menu and press Export MIDI-Format 0 file.... This will export your MIDI in a standardized format, which is a requirement for our converter to pick up on stuff like the loop points we just set. With this, our MIDI is now ready to be formatted for insertion!

Step 3: Inserting your MIDI, Part 1

The program we’re going to use to format our MIDI-Format 0 is mid2agb. This is a program designed to convert MIDI files to an insertable format, as the name suggests. To convert your MIDI, it’s as simple as dragging the file from the previous step onto mid2agb.exe. This will out put a midifilename.s file, where midifilename is, well, the filename of your MIDI. Note: If your MIDI has spaces or symbols in its name, it will not convert correctly. And with that, you’ve got a file you can insert into your game!

Step 4: Inserting your MIDI, Part 2

Here is where this guide splits two ways. Depending on whether you’re hacking with FEBuilderGBA or EA Buildfiles, the method by which you insert your music will be a bit different. For buildfiles, you should follow this section of the Ultimate Tutorial 2. Additionally, using this method you won’t have access to the instrument changing features we’ll be using in FEBuilder, which leaves you with a few options. The first is to use a Native Instrument Map soundfont alongside Anvil Studio or whatever program you use to create your song to begin with, which won’t be directly covered by this guide. Your second option is to continue with the FEBuilder method, then export your song from FEBuilder, convert it to work with buildfiles, and use it that way.

If you’re using FEBuilder, there’s a few things you’ll want to do. First, apply the Native Instrument Map and 16 Tracks 12 Sounds patches to your ROM, before importing any music at all. Second, go to the Song Track editor. Here, you’ll see a window like this:

Along the left side is a list of every song, so click on the one you wish to overwrite with your own music. From there, click Import music. You’ll notice that with FEBuilder you can import MIDIs directly. FEBuilder has a built-in MIDI converter, however it’s not the greatest and tends to break the song. Luckily, you can link mid2agb in Settings and FEBuilder can import with that instead. If you plan on using FEBuilder I highly recommend doing this, as it will save you the step of manually converting your MIDIs. When you import your file, make sure to import with Native Instrument Map!!!

Step 5: nice Music

Once your song is imported, it’s time to start tweaking it to make it sound nice. If you want your song to sound nice, you’ll need to mess with the instruments, volume, etc. Luckily, you can do all of this in FEBuilder after your song is imported.

In this image, virtually everything you can see is a button or editable field. Starting off, click on Musical score. This will bring up a window where you can edit every instrument used in the song, the overall volume, the overall pan, and the song’s tempo. As a general rule, do not touch the pan unless you know what you’re doing. From this window you can edit instruments to your liking, but what if you want to edit an individual track’s instruments or volume, independent from the rest of the song? Well just click on the header above each track (track 1, track 2, track 3, etc.) and it’ll open up a similar window that lets you edit all of the instruments used just in that track, as well as the track’s volume, independently from the rest of the tracks.

Play around with instruments and volume and you’ll probably want to listen to your music at some point. There’s two ways you can do this. The first is to link Sappy in FEBuilder Settings, then press the Play with Sappy button in the music editor. The other option is to just use the in-game Sound Room; you can set all of the songs to be unlocked with a patch in FEBuilder. This is slower, but if you can’t get Sappy to work for whatever reason it’d be a viable alternative.

Step 6: Sharing Your Music

If you want to share your music with others, the easiest way is to Export song from FEBuilder. This will output the song as a .s file with all of the changes you’ve made in FEBuilder. This file can be imported into any project using the Native Instrument Map and it will sound exactly as you exported it!

If you’d like to share your music in a form other people can enjoy immediately, then using Windows’ Stereo Mix and Audacity in tandem to record your music playing as an audio file, or record a video of it playing with a program like OBS. Then, you can share these files with others for all to hear.

##Bonus: Porting Music

I guess I’ll touch on this here as well. Your MIDIs don’t have to be self made; you can pull them from other sources. If you elect to find MIDIs on the internet and use those, make sure to credit their original creators. However, if there’s a particular song from a particular game that you want to use, depending on what that game is (and how much effort you put into making it work in-game) it may be possible to rip the music as a MIDI and port it yourself.
The most useful program for doing this is VGMTrans. The following formats are compatible with VGMTrans:

Squaresoft's PS2 sequence and instrument formats (.bgm, .wd)
Nintendo's Nintendo DS sequence and instrument formats (SDAT)
Late versions of Squaresoft's PS1 format known as AKAO - sequences and instruments
Sony's PS1 sequence and instrument formats (.seq, .vab)
Heartbeat's PS1 sequence format used in PS1 Dragon Quest games (.seqq)
Tamsoft's PS1 sequence and instrument formats (.tsq, .tvb)
Capcom's QSound sequence and instrument formats used in CPS1/CPS2 arcade games
Squaresoft's PS1 format used in certain PS1 games like Final Fantasy Tactics (smds/dwds)
Konami's PS1 sequence format known as KDT1
Nintendo's Gameboy Advance sequence format
Nintendo's SNES sequence and instrument format known as N-SPC (.spc)
Squaresoft's SNES sequence and instrument format (AKAO/SUZUKI) (.spc)
Capcom's SNES sequence and instrument format (.spc)
Konami's SNES sequence and instrument format (.spc)
Hudson's SNES sequence and instrument format (.spc)
Rare's SNES sequence and instrument format (.spc)
Heartbeat's SNES sequence and instrument format used in SNES Dragon Quest VI and III (.spc)
Akihiko Mori's SNES sequence and instrument format (.spc)
Pandora Box's SNES sequence and instrument format (.spc)
Graphic Research's SNES sequence and instrument format (.spc)
Chunsoft's SNES sequence and instrument format (.spc)
Compile's SNES sequence and instrument format (.spc)
Namco's SNES sequence and instrument format (.spc)
Prism Kikaku's SNES sequence and instrument format (.spc)```

You'll notice that a fair number of them are listed as `(.spc)`.  In this case, these are files ripped from SNES games.  You can find large collections of them free to use (with credit of course) [here](http://snesmusic.org/v2/). 
EDIT: The files you download from that site are .rsn files.  These are archives and can be opened with 7-Zip or a similar program to access the .spc files within.

Beyond VGMTrans, N64 music can be ripped with [N64 Midi Tool](http://www.goldeneyevault.com/viewfile.php?id=211).  This will allow you to export any N64 song you would like as a MIDI, which can then be inserted into GBA.

Otherwise, I've attempted to rip Genesis music as MIDIs but there aren't many tools for it and the few that do exist are...less than stellar.

##But Music is Easy!

And there you have it; a guide on how to import music into GBA.

Uh

I'm bad at ending things

Have a meme

<img src="/uploads/default/original/2X/6/6aefa1e96a95213a55acaa086415decdc369ba10.jpg" width="100" height="150">

The Grand Library of FEU [UNDER CONSTRUCTION]
A database of all generations of s. music and character portraits from non-gba FE games in one place?
Music Blitz - 156 Songs Submitted
Making music for an FE hack
#2

This is wonderful, I can finally get into music hacking. Thanks, Sme.


#3

This guide is exactly what I needed! Thanks so much for putting this together, excited about the possibilities of porting in other music for easily.

Question for you though:

  1. with VGMtrans, the github says to drop the music file into the “application”, not sure which file in the VGMtrans download folder that is. Is there any sort of framework or code that needs to be set up on my machine before running this?

  2. Do you find that there are limitations with the tracks that can be imported due to their quality or size besides those you’ve outlined? I’ve done a few midi imports and many come in scratchy sounding, like they’re breaking the GBA’s sound card. Curious if there’s some implicit limitation, or if I’m simply doing it wrong.

Thanks!


#4

With GBAFE, you can play up to 8 tracks by default.
When 16_tracks_12_sounds patch is applied, 16 tracks, 12 sounds at the same time playable.


#5

I hope that such a helpful guide like this will eventually lead to an archive of ported songs that anyone can use. Nice job!


#6

Edit: Never mind, just renamed the file into a .rar and extracted

So, I went to that website for smcs there and downloaded Fe4 sountrack, it came as an rsn file and I opened it with Winamp. Now how do I extract any of the song into smc or midi?


#7

Oh yeah, forgot to mention this part in the guide. I’ll edit it in.

The .rsn file is an archive that contains all of the .spc files. Just open it with 7-Zip or similar program to extract the files.


#8
  1. On the Github for VGMTrans, go to the Releases tab. There you can download it as an executable. This is the file that you run.

  2. If your music sounds scratchy, try lowering the volume. Chances are you’re just peaking the audio, which causes that sound.


#9

Good to know - already on my way. Thanks again for your help, stoked to mess around with this.


#10

What program would you recommend a budget(read broke) person to use for MIDI making? You linked Anvil in the post but how good is the free version of that?


#11

Anvil is very good to start with because it doesn’t confound with bells and whistles everywhere, as something like Mixcraft might. The free version sometimes nags you, but you can actually do everything that’s doable with the paid add-ons by setting hotkeys to insert midi events (e.g. pan and volume changes) and program changes (changing instruments mid-song).