Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - How to rip samples from multipcm vgm files?

Reply to topic
Author Message
  • Joined: 11 Mar 2018
  • Posts: 6
  • Location: a closet
Reply with quote
How to rip samples from multipcm vgm files?
Post Posted: Sun Mar 11, 2018 6:14 pm
I know this might not be the correct forum to post this on but I need some help.

I've been trying to compile a full .it file that has all the possible Daytona USA arcade samples in it. I've already found one(attached below) but it is severely incomplete. It is missing a lot of sounds.

I already tried extracting the 28 channels from the vgm files of the music, and extracting the individual samples from each one. However, multipcm is really stupid and it dynamically reassigns channels on the fly. So it looks for when a channel isn't playing anything, and plays the next note.
However, going that route would be time wasting.

I'm wondering if there's a tool that can extract all the samples from the vgm file, and save them to a location. I'm willing to spend the time going through each file, and naming each one.

What I haven't tried yet is importing the vgm file into audacity using raw data import, and messing around with the settings of the import until there's something comprehensible. But then again, it'll take a long time to export each individual sample and then rename them, and then put them into the it file.

The benefit of finding and spreading news of a tool like that means that old sega games that use multipcm music and sound effects can have readily available sample packs. This could, in turn, allow for interesting remixes.

Some guy on youtube made a video of a remix like that:
look up Daytona Hell on youtube to find it (not embedded due to recent member rule)
and provided a download. Somebody else made a comment on his video giving a download link to an .it file with most of the samples(attached) and correct looping. But, it's missing some key samples.

TL;DR I'm asking if anyone knows a utility that can extract every sample(no repeats) of a multipcm vgm file(like Daytona USA arcade's soundtrack). All suggestions are welcome.

  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12477
  • Location: London
Reply with quote
Post Posted: Sun Mar 11, 2018 6:54 pm
Maybe better to ask on vgmrips, we only have expertise in the 8-bit stuff here. There's a danger the VGM may hold the data after it's been split across channels, plus maybe better to extract it from the original ROMs if possible - but I really don't know anything...
  View user's profile Send private message Visit poster's website
  • Joined: 31 Jan 2014
  • Posts: 35
Reply with quote
Post Posted: Sun Mar 11, 2018 7:15 pm
As the author of the remix in question, I guess I'm somewhat obliged to reply...

The easiest route would be to just pull the samples from the original game data rather than mucking around with VGMs. The game uses a very simple format for its samples, including loop points and so on, which is how I was able to extract them in the first place (considering I could barely program back then, anything more complicated would have made it impossible for me). I don't know why the tool I made couldn't extract all the samples, but I'd be surprised if it's anything particularly difficult to overcome.

I've got my hands pretty full at the moment, though, so I can't take a look at this right now. Sorry.

For the more general issue of extracting samples from VGMs, I'm not familiar with the parts of the format related to sample playback, but I think the loop points if nothing else would be difficult to get.
  View user's profile Send private message
  • Joined: 11 Mar 2018
  • Posts: 6
  • Location: a closet
Reply with quote
Reply to supper:
Post Posted: Sun Mar 11, 2018 7:48 pm
So you made a tool to extract the sounds. If you can by any chance, give me a download to the tool? Or at least tell me how it worked or what code was used?
Also, I should rip the samples from the actual game rom instead of the VGMs? That's interesting. Also, your remix sounds really nice!
  View user's profile Send private message Visit poster's website
  • Joined: 31 Jan 2014
  • Posts: 35
Reply with quote
Post Posted: Sun Mar 11, 2018 9:15 pm
It's been years, so I can't really tell you much. I do have the source code for the extractor, though it's absolutely abysmal because I had no idea what I was doing. It'd probably be easier to start from scratch than to try to make sense of this mess, but here it is if it helps: http://www.mediafire.com/file/qj2ubjy16jbe4x8/daytonarip.cpp

And thanks, glad you liked the song. It's one of the dumber things I've made, but somehow it seems to pop up somewhere every few years.
  View user's profile Send private message
  • Joined: 11 Mar 2018
  • Posts: 6
  • Location: a closet
Reply with quote
Post Posted: Mon Mar 12, 2018 12:27 am
I just looked through the code and I can barely understand it, even though I've been programming Python for 3 years. Can you help me a little with how to run it? I can compile and run cpp programs, it's just that the program you made makes it a bit confusing to use. Thanks for the help so far though.
  View user's profile Send private message Visit poster's website
  • Joined: 30 Jun 2016
  • Posts: 118
  • Location: Victoria, Australia
Reply with quote
Post Posted: Mon Mar 12, 2018 3:02 am
There is a tool called Multidumper, but it will dump the channels as they are played, rather than the individual samples as in their native source.

Regardless, if you're interested, give myself a poke on the #vgmrips IRC channel.
  View user's profile Send private message Visit poster's website
  • Joined: 11 Mar 2018
  • Posts: 6
  • Location: a closet
Reply with quote
Post Posted: Mon Mar 12, 2018 4:45 am
Flygon, you know I did post a thread on the vgmrips forum and nobody replied? Also, you might not remember this, but we've met before. I've made a(pretty dead) forum for multidumper and sidwiz downloads and discussion. I remember how you told me in an IRC chat how you've always wanted a centralized place, so I made one: sidwiz.boards.net

Also, I've used multidumper a lot. The problem is, it's really, REALLY slow.

I figured out that importing the mpr game files as 8 bit signed mono in audacity shows every sample. Now the challenge is to make a program to extract each one and put proper loop points in them.
  View user's profile Send private message Visit poster's website
  • Joined: 31 Jan 2014
  • Posts: 35
Reply with quote
Post Posted: Mon Mar 12, 2018 4:15 pm
8bit_coder wrote
I just looked through the code and I can barely understand it, even though I've been programming Python for 3 years. Can you help me a little with how to run it? I can compile and run cpp programs, it's just that the program you made makes it a bit confusing to use. Thanks for the help so far though.


The tool expects to find the sample ROMs with their MAME filenames (mpr-16491.32 and mpr-16492.33) in the folder it runs in. It then outputs .WAV samples according to some hardcoded parameters for where to find the sample index table and when to switch between the input files.

Like I said, the code is really, really bad, and I wouldn't expect it to be of much use (it doesn't extract anything that wasn't already in the sample pack I uploaded). I'm only really providing it because multiple people have asked me about it, and it's probably a little better than nothing.
  View user's profile Send private message
  • Joined: 11 Mar 2018
  • Posts: 6
  • Location: a closet
Reply with quote
Post Posted: Tue Mar 13, 2018 2:11 am
I just tried to compile your code and I got some errors from it.


Process started >>>
C:\Users\Some username\Desktop\Experiments\daytonarip.cpp:42:44: error: narrowing conversion of '240' from 'int' to 'char' inside { } [-Wnarrowing]
 const char SAMP_HEAD[3] = {0x00, 0xF0, 0x00};
                                            ^
C:\Users\Some username\Desktop\Experiments\daytonarip.cpp: In function 'int write_wave(Sample, std::__cxx11::string, std::__cxx11::string)':
C:\Users\Some username\Desktop\Experiments\daytonarip.cpp:411:35: error: narrowing conversion of '147' from 'int' to 'char' inside { } [-Wnarrowing]
  char data2[4] = {0x93, 0x58, 0, 0};
                                   ^
C:\Users\Some username\Desktop\Experiments\daytonarip.cpp:445:46: error: narrowing conversion of '128' from 'int' to 'char' inside { } [-Wnarrowing]
   0x80, 0, 0, 0x01, 0x40, 0, 0, 0, 0, 0, 0, 0};
                                              ^
<<< Process finished. (Exit code 1)


And I can't seem to figure out how to fix it.
  View user's profile Send private message Visit poster's website
  • Joined: 11 Mar 2018
  • Posts: 6
  • Location: a closet
Reply with quote
Post Posted: Tue Mar 13, 2018 2:16 am
Also, after reading this section of code:

const string SAMP_FILE = "mpr-16491.32";
const string SAMP_FILE_2 = "mpr-16492.33";
const int BANK_SWITCH_ADDR = 1960;


I had done some experiments earlier and concluded that there are multiple mpr files that have music sounds in them. So technically, could I switch the filenames with the other ones and it would still work? Also, is there any piece of code I can add that can allow me to have SAMP_FILE_3 and so on? This could be a seriously powerful tool, if it can have those features.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12477
  • Location: London
Reply with quote
Post Posted: Tue Mar 13, 2018 6:33 am
Yes, ROMs often have samples inside. No, it's not trivial to add more. The hard part is finding the table of data to allow you to split and loop the data.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!