Previous Page | Next Page

by SmartOne at 8:57 AM EDT on September 9, 2014
I learned some ARM (and Thumb) assembly and reverse-engineered a bit of Donkey Kong Country 3's software mixer. I hacked the foobar2000 GSF Decoder (aka VBA-M) to spit out the mixed samples before the DMA and hardware "DirectSound" stage.

The result avoids the GBA DirectSound hardware and VBA-M's resampling. It sounds slightly better:

https://www.sendspace.com/file/jwf1lg

This is the purest form of the music. If I have more of my life to waste, I might try applying per-instrument interpolation using "Sinc" or whatever algorithm, so I can produce CD-quality, fake samples (yay).

It's probably possible to fix that one underwater song that cuts itself off due to the lack of available software channels. That would be the purest version (fixing Rare's stupid bug).

Potential arbitrary enhancements include stereo panning.

edited 2:10 PM EDT September 9, 2014
by drfsupercenter at 9:03 AM EDT on September 9, 2014
I tried Pokémon Sapphire and it didn't work at all.

Any idea how to extract the music from those? I'd love to get multi-channel files somehow!
by SmartOne at 9:08 AM EDT on September 9, 2014
The thread at Sonic Retro has a Pokémon Emerald MIDI + SF2 rip. Hopefully that completely covers Pokémon Sapphire?
by drfsupercenter at 9:31 AM EDT on September 9, 2014
Yeah, probably... does it say how they actually ripped it? I tried using a guide and ended up with like 400+ folders of 1KB MIDI files, obviously that's not what is supposed to happen!
by Dais! at 5:32 PM EDT on September 9, 2014
drfsupercenter - that's almost certainly what is actually supposed to happen, depending upon the parameters you gave. The MIDI files all represent songs (or sound effects), with the samples stored in the .sf2 files. If you use the -sb command line parameter (as is recommended), depending on the game, you may end up with dozens or even hundreds of folders. Post 55 (easily missed) in that thread mentions this:

I took a look at the Mother 1+2 set you put up for download and some of the MIDI files weren't playing the proper instruments. I tried extracting it myself, and discovered that it's probably best to use the -sb flag to separate the sample banks. Sometimes different samples are applied to the same patch number in different banks, and compiling them all to one soundfont means some samples get excluded and some songs won't play right. Thankfully it extracts to individual folders with each folder containing the soundfont and all MIDI files that use it.

I'm not sure exactly what happens, but with some games - the Boktai titles, for example - instead of getting a half-dozen or less folders, it seems like you get one for nearly every song in the game. Whether this is a shortcoming of GBAMusRiper or something I'm not thinking through properly, I'm guessing the exact same thing is happening with Pokemon. So it's harder to manage than not using -sb, and often takes up significantly more space, but you need to do it to get the best results (usually).

--

SmartOne - oh, nice work. I don't have the means to compare the rips you did to the GSF set at the moment, but I appreciate the effort. Do you think the process could be easily repeated with other games, or is the method only really suitable for DKC3/Rare games?
by SmartOne at 7:23 AM EDT on September 10, 2014
It was difficult for me. I had to figure out how the DMA worked, what fills the DMA buffer, and what fills the DMA buffer's buffer. Then DKC3's software mixer iterates over the buffer, accumulating the samples for each channel. I extracted the purest form of the samples I could find (the 8-bit samples are read from ROM). I assume the samples' rate is 13378 Hz, like the mixed output.

I'm guessing other games are completely different.
by soneek at 11:13 AM EDT on September 10, 2014
I ripped Emerald last year. I had to insert the song tables and data into a Sonic Advance 2 rom to get it working.

Pokemon Emerald MIDI + SF2

It's 4 MB compressed, and ~700 MB extracted. It includes all the songs from Ruby, Sapphire, Emerald, Fire Red, and Leaf Green.
by drfsupercenter at 6:29 PM EDT on September 10, 2014
That's awesome, thanks.

I tried just a Sapphire ROM by itself with the batch tools and it bombed. Interesting what you did with Sonic.
by Kurausukun at 7:58 PM EDT on September 10, 2014
soneek, I hate to burst your bubble, but that ingenious idea you had is now obsolete--GBAMusRiper 2.1 now has support for GBA Pokemon games, and it sounds better than your Frankenstein method :/
by TheUltimateKoopa at 7:08 AM EDT on September 11, 2014
God I hate sites like sendspace, where they have a reduced speed and only let you download at a decent speed if you are a pro member. But what is really annoying is the fact that the "free" speed is just over the top. My normal download speed is about 6.25 MB (megabytes) per second. I'm currently downloading at just 76 kB per second.

That's roughly 1.2%, or a drop of 98.8%.

Previous Page | Next Page
Go to Page 0 1 2 3 4 5 6 7

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source