Users browsing this thread: 1 Guest(s)
Ripping GBA music/sound effects - the SUPERIOR WAY
#1
Hrlo and welcrum, I happened upon a handy program recently and I'm not sure if tSR is quite aware of its existence yet. Along with it are instructions to both use it and to convert the resulting files to various audio formats. I might give a visual aid sometime, but :effort:, so right now it's text only.

This program reads a .gba ROM and extracts the soundbank from it, processing it into a .sf2 (soundfont) file, along with a .mid for every song/sound effect in the game. You can also convert these files into MP3/WAV if you so desire... say, for sound effects. This requires a little extra though.

I hope I don't come off as patronizing when I'm writing this but I'm basically trying to explain it so anyone could do it. I know everyone on tSR is intelligent but guests might not understand these things Tongue

Requirements for this program and associated conversions, with links:
- Java runtime environment, as GBAMusRiper is a Java program.
- Foobar2000 (handy free program that can play MIDIs with Soundbanks. A pretty good music player in general, to boot Wink)
- Foo_MIDI, a plugin for Foobar200 that allows it to process MIDI files.
- LAME MP3 encoder (if converting to MP3. I haven't verified this yet but this download link should be safe - SourceForge is having issues currently)
- WAVPack (if converting to compressed WV)
- Oggenc (if converting to Ogg. Ogg's pitch seems higher for some reason though...)

It works with ~90% of GBA titles, but some don't use the most common sound engine, which this program is only able to support, sadly. However, it should work for most Nintendo published games - with a notable exception of Zero Mission/Fusion.

Usage:
- Extract somewhere (Anywhere really, but I suppose categorizing doesn't hurt!) and browse to it in Windows Explorer. Copy the address of the folder from the title bar.
- Open Windows Command Prompt (WinKey+R, type "cmd" and hit enter)
- Once the window is open, type "cd " and paste in the address that you copied from the Explorer window*, hitting Enter
- You should now be in the previously extracted GBAMusRiper directory.
- Enter "cd bin" and hit enter.
- To extract music, enter/paste "java gbaMus.GBAMusRiper your_rom.gba", where "your_rom.gba" is the filename of the ROM you want music/SE from**. The program shall do all of the work for you, spitting out a .sf2 file named after the directory and an arbitrary number of MIDI files named songXXX.mid***. Now the fun part comes, you need to manually rename all of those files Smile
- To install the foo_midi component, open up Foobar2000. Click [File -> Preferences -> Components] and simply drag the .component file from above into the window, it should automagically install itself and prompt you for a restart. Do it. Now Foobar2000 plays the MIDIs, but chances are high that they sound terrible****.
- To get Foobar2000 to recognize a sf2 file it normally won't (it sometimes will if the sf2 is named after the directory it is in, i.e a directory named LttP_FS with a LttP_FS.sf2 file inside it), go into [File -> Preferences -> Playback -> Input -> MIDI Synthesizer Host].
- Change Plug-In to BASSMIDI instead of Emu De Midi. Next, go down to the BASSMIDI section and click the space to the right of SoundFont. Navigate to your sf2 file and select it. Now when you open a MIDI, it will play using the instruments ripped from your game. It should sound exactly like it did ingame, perhaps even better!
- If you wish to allow looping, select "When Loop info detected" or "Always" and check loopStart/loopEnd Track Markers (FF7PC, HMI). It doesn't always loop perfectly (a note may skip) but it works. Converted files do not appear to have this issue.


To convert these MIDIs into WAVs/MP3s:
- Open a song (or multiple songs) in Foobar and right click one/several under Title/Track Artist. Click [Convert -> ...] and configure/select your method of choice for output. Selecting a format may require codecs which are listed above for WV/MP3/Ogg. You can also configure where they are output/whether they are in separate files and what not. It should be self-explanatory.
- You may be prompted to open a file when you try to convert. In this case, simply navigate to the folder containing the codec you previously extracted (if you didn't, better do it now Nervous).
- Enjoy your ripped music! Wink

Man this took way more time than I thought it would Surprise
If you wanna copy/embed this tutorial somewhere (ignore this if you're merely linking it), just please let me know where you're doing this since I may need to update this eventually (say if one of the links break).

To show you what this program can output, I'll link some music/SE I extracted below; LttP_FS is mostly named at this point but there may be some mistakes and most sound effect files are currently un-named/un-converted. Gonna need to play Four Swords again so I know what's what.

I also plan to submit the sound effects from these games myself if they're not already on tS(ounds)R but if you can't wait for them, just tell me so I don't need to do any conversions Cool



* It may vary for your CMD window but I was able to paste by hitting right-click. You can alter this by right clicking the top of the window (where it says C:\Windows\system32\cmd.exe) and selecting Properties, checking the Quick Edit and Insert Mode boxes.
** "your_rom.gba" should be copied to the bin directory just to simplify things, but if you want you can always navigate to the .gba file via "../"s. imo that's a pain in the ass though. Another note is that GBAMusRiper supports various command-line switches but if you really want to know about them, chances are you really don't need me to tell you how to do it Wink
*** You can try playing these MIDI files in Windows Media Player if you want, but I wouldn't recommend it. Without a program that plays MIDIs with Soundbank (sf2) support, it's going to sound terrible - if you hear anything at all! This is where Foobar2000 comes in. I'll have assumed you already installed it from here on.
**** According to the component, you should not need to manually add the Soundfont to Foobar, but I found for LttP: Four Swords and Minish Cap I had to. I did not need to do this for Nightmare in Dream Land. Next instruction shall be italicized since it may not be necessary.
#2
Skimmed it, looks helpful. Extracting SF2s and MIDIs is way better than just recording or snipping the raw data with Audacity.

Will read it in detail when I need to rip GBA sounds. Hell, I might rip them just to try this out Wink
You may have a fresh start any moment you choose, for this thing that we call "failure" is not the falling down, but the staying down. -Mary Pickford
Thanked by:
#3
(10-04-2012, 04:47 PM)puggsoy Wrote: Skimmed it, looks helpful. Extracting SF2s and MIDIs is way better than just recording or snipping the raw data with Audacity.

Will read it in detail when I need to rip GBA sounds. Hell, I might rip them just to try this out Wink

It's a lot easier than the Audacity method - no snipping of one massive chunk of audio either Big Grin
Thanked by:
#4
Brilliant! I'll definitely try this out. However, .OGG is not a preferred format on TSoR just so you know.
[Image: sweet-capn-cakes-deltarune.gif]
Thanked by:
#5
(10-04-2012, 05:02 PM)Mighty Jazzers Wrote: Brilliant! I'll definitely try this out. However, .OGG is not a preferred format on TSoR just so you know.

Yeah I figured (Not to mention it has the pitch issue) but it's one of the 'major' filetypes out there, essentially being akin to an 'open MP3' format.
Thanked by:
#6
Okay well, question. I already have Winamp which can play MIDIs, and even if they sound bad in the player they will still sound fine when converted.
Couldn't you just convert the MIDIs to .WAV with any program?
[Image: sweet-capn-cakes-deltarune.gif]
Thanked by:
#7
Depends!

See, the big deal are the sound fonts! Your converter should be able to use those! Otherwise, you won't get an authentic result.
Aside from that, yeah, any converter than can converti Midi to wav using these soundfonts should be suitable.
Thanked by: Garamonde
#8
It looks like something like this would work then?
I don't want Foobar and have no need for it since I have my favorite player already, so I'm trying to find other things.
[Image: sweet-capn-cakes-deltarune.gif]
Thanked by:
#9
Well, if it works I'll add it to the OP I s'pose (could just link to your post(s)), I just like Foobar2000 vOv
Thanked by:
#10
Is there any way to use the soundfonts for other midis (as in, not GBA midis)
edit- oh wait, you can

how about looping them as they do ingame? is that possible?
[Image: ndsMEF0.gif][Image: sig.gif]
Thanked by:
#11
(10-23-2012, 08:59 PM)Vipershark Wrote: Is there any way to use the soundfonts for other midis (as in, not GBA midis)
edit- oh wait, you can

how about looping them as they do ingame? is that possible?

They should loop automatically (with the setting enabled - Foobar2000 has such a setting mentioned above), though I noticed some MIDIs have a little issue with the placement of the loop markers. I don't have experience with editing MIDIs so I'm not sure of a solution for this, yet, sorry Sad
Thanked by:
#12
I tried it on 21 GBA games, but the only ones out of those that worked were The Hobbit, Tales of the Tohunga, Chain of Memories, FFVI, FF Tactics, Cybeast Gregar, and Circle of the Moon. That's a 33% accuracy rate.
It does a great job with them, provided the tracks are played with the corresponding SF2, but there are several tracks in each of the Bionicle midis that play loud annoying beeps throughout the tracks. The beeps should be some sort of drums, but either because the midi extractor mapped the tracks to the wrong instrument or because the SF2 extractor didn't extract the right samples to that instrument, it plays garbage instead.
Could someone analyze gbaMuseRipper's behavior handling GBA game #0130 and determine what the cause of the mismapped tracks is?
Thanked by:
#13
I'm having trouble. I get this error

Microsoft Windows [Version 6.1.7601]
Copyright © 2009 Microsoft Corporation. All rights reserved.

C:\Users\Miles>cd C:\

C:\>cd bin

C:\bin>java gbaMus.GBAMusRiper Kingdom Hearts Chain of Memories.gba
Exception in thread "main" java.io.FileNotFoundException: Kingdom (The system ca
nnot find the file specified)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(Unknown Source)
at java.io.RandomAccessFile.<init>(Unknown Source)
at gbaMus.GBAMusRiper.parseArgs(GBAMusRiper.java:207)
at gbaMus.GBAMusRiper.main(GBAMusRiper.javaCute4)

Did I do this right?
Thanked by:
#14
(01-24-2013, 06:24 PM)peronmls Wrote: I'm having trouble. I get this error

Microsoft Windows [Version 6.1.7601]
Copyright © 2009 Microsoft Corporation. All rights reserved.

C:\Users\Miles>cd C:\

C:\>cd bin

C:\bin>java gbaMus.GBAMusRiper Kingdom Hearts Chain of Memories.gba
Exception in thread "main" java.io.FileNotFoundException: Kingdom (The system ca
nnot find the file specified)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(Unknown Source)
at java.io.RandomAccessFile.<init>(Unknown Source)
at gbaMus.GBAMusRiper.parseArgs(GBAMusRiper.java:207)
at gbaMus.GBAMusRiper.main(GBAMusRiper.java: 34)

Did I do this right?

Try renaming Kingdom Hearts to something without spaces.
Thanked by:
#15
(01-24-2013, 06:24 PM)peronmls Wrote: I'm having trouble. I get this error
C:\bin>java gbaMus.GBAMusRiper Kingdom Hearts Chain of Memories.gba
Right, I forgot about that. It's funny because I technically use CLI all the time. I guess I'm just accustomed to making filenames with underscores Big Grin

Either enclose the filename in quotes like so:
Code:
C:\bin>java gbaMus.GBAMusRiper "Kingdom Hearts Chain of Memories.gba"

Or simply rename the file to one without spaces. Replace " " with "_", perhaps?
Thanked by:


Forum Jump: