Thursday, February 6, 2014

Getting GBA/NDS Music Multitracks

So some months back, I found out about GBA Mus Riper and how it was possible to rip high-quality GBA music with its easy-to-use tools. Later on, though, I realized midis could store each channel's parts separately and that it should be possible to just listen to certain channels in the midi. My search for this led to mostly installing bloated trialware/crippleware that just wasn't what I was looking for.
The NDS side wasn't looking too bright either since the mini2sf format wasn't as workable. I even found a YouTube video that claimed foobar could output multitrack files, but I never found out how (because that would still be faster).

And now, even after being more-or-less familiar with Reaper, there still wasn't a fast enough way to rip each midi channel efficiently. And of course with no installs. My search led me to midicut, a program so old, even modern Windows won't run it. Combined with the light msdos.exe tool which allows midicut to run, I knew it was now possible to rip GBA/NDS multitracks by the batch load.

Keep reading to find out how!

Download all the tools here!

Inside the Tools folder, you'll find a version of VGMTrans where someone finally had the brilliant idea to add an export to midi and SF2 option instead of that DLS nonsense. The other 3 tools are links to the website so you can always have the latest version. You'll need Audacity to listen to the audio more efficiently at the end. Foobar will be necessary to convert the midis and I believe it has a portable install option. Get GBA Mus if you haven't already. I hear the January 2014 version is even better than the old one.

Ripping GBA

Ripping music from the GBA has never been easier! Just open gba_mus_riper.exe (that's with the typo) in Command Prompt. Type out the name of the executable, then drag and drop the GBA rom you want to rip from. Hit enter and it should perform all its work. Some games may requires the -sb option to rip to a separate sound bank, but not many require this.

It should have made a folder by the same name as the rom. Inside, there should be a bunch of midi files and a SF2 file. Copy all of this and paste it into the input folder provided in my download. Finally, run InputSplitter.bat. The midicut program isn't very fast, but it's still much faster than doing this manually. It's best to just let it split music and not sound effects.

When the operation finishes, check the output folder. It should be full of folders now. Make sure there are 16 midi files named by number inside. The next step is the best part. When you're in the output folder, do a search for .mid. All the midis you just made should come up. Drag and drop all of the midis with numbers in them into Foobar. Right-click on them and go to Convert > ...

In the Converter Setup window, click on Destination. Next, set Output Path to Source Track Folder. Choose an output format of preference too. FLAC will sound the best and compress better than WAV, but something like OGG or MP3 is fine too. Save this configuration so you can use it later. Finally, run the converter. It should be processing all the midis at about 500x speed. Now, check your output folders and if it worked correctly, there should be audio files! (usually less than 16)

You can select all the output audio files and open them in Audacity. Playing them all back at once is how the music should sound like, but you can mute or solo certain audio channels you imported. Now that's kind of cool

Ripping NDS

Fortunately, NDS is a similar procedure. Using the included VGMTrans, you can drag-and-drop into it either an SDAT file, or the NDS rom directly. It should load all the music and list it across the bottom. Unfortunately, there doesn't seem to be a way to batch export everything to midi and SF2. You'll just have to right-click each of the items and export them one by one.
Take all of the files it exported and drop them into the input folder. You should have a folder full of midi and SF2 files all named the same thing. Run MakeTrees.bat and let it prepare those files in the tree folder for you.

After that, run TreeSplitter.bat to let it split all your midi files inside. This is just like the GBA part now. Run a search for .mid and drag all the numbered .mid files into Foobar. Convert all the selected files and you should have audio files for every track it extracted!

Check out some samples I converted.

I hope this works for others. It worked really efficiently for me and I've enjoyed it.


Anonymous said...

did capcom update over-3 spec2 with the missing in-game energy shields art?

MegaRockEXE said...

You're going to have to tell me what that is. I don't know about that.

Anonymous said...

you see, when they teased the armor, it was shown with energy shields

but when released, its in-game art was missing those shields

and i heard that the spare arm parts (like the ones with the energy claws for over-2spec2) didn't have those shields either. so i was wondering if they've updated the game and added them recently.

MegaRockEXE said...

Yeah, it's still way too soon for that.

mcpower said...

Damn, I've been doing something similar.

If you're looking for accuracy, it seems that both gbamusriper and VGMTrans both aren't exactly accurate in their own ways.

Both rippers sometimes mess up channel volumes, compared to a console. An example for VGMTrans is BGM_FINALBOSS from Star Force 3, where the lead coming in the 6th bar is way too loud. I don't recall an example for gbamusriper.

In gbamusriper, the pulse channels (square / 25% / 12.5%) are not entirely accurate, although it depends on what you define as accurate.
Here's a 25% pulse:
and a square:
What's weird is that the bass channel is a "true" pulse wave, which I don't understand why.
The pulse channel is actually different between each Game Boy (Advance), as seen here:
It just depends on what sound you like. I personally prefer a "true" pulse wave for all channels.

VGMTrans has appears to have different panning between a .DLS and a .SF2, at least in FL Studio. Samples also appear to be slightly lower quality than in-game using .SF2, possibly due to audio compression cutting high frequencies out.

A tip: if you're ripping multiple songs for DS, you can rip the MIDIs using another romhacking tool (like Tinke), and just use a .SF2/DLS from VGMTrans. Keep in mind that some games use more than one soundbank for its music, but the Star Force games do not.

MegaRockEXE said...

Yeah, I've been told that gbamusriper can't rip entirely 100% accurate audio. For the Battle Network games, a handful of sound effects won't sound correct and it's apparently due to a limitation of the midi format. Generally, VGMTrans rips everything too loud because when played back together, the sound clips. One channel is on average, as loud as the full mix. I don't know if the difference in the pulse and square renditions can be "fixed", but most of the time the music tends to sound "better" than it does wrong, I think...

I haven't tried Tinke as of late, so I don't know if it could get midis. And then in that case, would it still be compatible with the SF2 ripped with VGMTrans, since that's still an easier format to use in batch.

Anonymous said...

I wish I could get this to work, but it seems the msdos tool doesn't work on my computer. I'm running Windows Vista on a 2009 iMac via Boot Camp (although I don't think that last bit is relevant.) Any thoughts?

MegaRockEXE said...

It could be because how how old 16-bit MS-DOS programs work in compatibility. I don't have Vista to test, but are you on 64-bit? What does the command prompt say when you try to run "msdos"?

Anonymous said...

Hello, Mega Rock. I used to be a member of TREZ a long time ago, so reaching your blog through a Google search (looking for other ways of ripping GBA music) was quite a surprise.
Have you tried SynthFont? It is a cool MIDI player with support with soundfonts. I used to use it with high-quality soundfonts and MIDIs. Then, I played around with VGMTrans and now with GBA Mus Ripper. Synthfont has a free version with full functionality (it will only show a nagging window inside the application once in a while, but it's nothing intrusive or dangerous). You can mute some channels, use different soundfonts for each one, exporting in different audio formats... it's a very versatile tool.
Also, about GBA Mus Ripper, it also has some limitations with some games. For example, the Golden Sun game series (of which I am a big fan) has problems with some instruments due to the way they are implemented (the developer says those instruments are created with mathematic functions, so go figure), which is a shame, since GBA Mus Ripper can output audio without noise and with higher quality than recording audio with Visualboy Advance. Of course it is 100% accurate, but I am quite satisfied with the results. I have been upgrading my MMBN music library with it.
I hope this is useful for you. Cheers!

Unknown said...

First off, I love GBA music and find it discouraging so few soundtracks have been ripped in Gbamusriper's quality.
A request if possible for FFVI Advance. Even with the usual staticky sound, there's some clear potential and some aspects like the synth vocals appear to be higher quality than the original.
I ask because I'm visually impaired. Normally I wouldn't ask this of folks and for the most part I have workarounds with accessibility problems, but I can't do it myself, commandlines hate my guts for whatever reason.
If it is indeed possible, then I'd be grateful with just the standard font and midis, I'll gladly convert, rename, and organize the tracks myself.

MegaRockEXE said...

I actually recently did some converting on the SNES version of the game. However, the GBA version also has a patch available that promises higher quality audio. I don't know how they're doing it, but that would just be another option. I think it's still worth doing though and I could get around to it.

MegaRockEXE said...

Here is the FF6 GBA music rip.
Battle and Boss themes are split for you, in case you wanted to try that, though it will take up more room. The rest is organized to rip by soundbank.

Post a Comment

Note: Only a member of this blog may post a comment.