ROM Hack Emulation Emulator Record each NDS Channel as Wav?

JOSW28

Member
OP
Newcomer
Joined
Oct 13, 2021
Messages
6
Trophies
0
Age
20
XP
39
Country
Mexico
Due not every nds game uses .sdat file, I decided to Rip music of some games recording it in a emulator (DeSmuMe). But, for better ripping results I'd like to record each channel (I'm referring to each of the 16 ADPCM channels that NDS has) separately, DeSmuMe has te capability to enable an disable each ADPCM channel, but it doesn't have an option that let me record each channel separately at the same time, it only records every channel that is enabled mixed in one wav file.
I could try to record a channel one by one, but it will take a lot of time, because I have to repeat that process like 10 times or more (depends of the song).
I'd like to know if there is an emulator, program, plugin, or something that let me do that.
Thanks for reading.
 
Last edited by JOSW28,

CoolMe

Watcher of the Skies
Member
Joined
Apr 16, 2019
Messages
3,791
Trophies
1
Age
27
XP
12,475
Country
United States
DS outputs stereo sound, so if the emulator does that too it should generate both channels(when you record it), and you just have to split the signals in an audio software like Audacity and the like.
 
  • Like
Reactions: impeeza

JOSW28

Member
OP
Newcomer
Joined
Oct 13, 2021
Messages
6
Trophies
0
Age
20
XP
39
Country
Mexico
DS outputs stereo sound, so if the emulator does that too it should generate both channels(when you record it), and you just have to split the signals in an audio software like Audacity and the like.
I think I explained bad.
I'm refering to each of the 16 APDCM channels that NDS has. Where music and sound effect reproduces.
 

ChiefReginod

Well-Known Member
Member
Joined
Jun 11, 2016
Messages
614
Trophies
0
Location
California
XP
2,044
Country
United States
It can be done, but setting it all up is kind of clunky. In this method you'll need to find the music in .2SF format (do some searches, it's not hard to find archives of this stuff).

1. Install WinAmp.
http://winamp.com/

2. Download the "vio2sf" WinAmp plugin from this page.
https://www.zophar.net/utilities/2sf/vio2sf.html
It's an older version. That's fine.

3. Extract these files from the vio2sf archive:
in_vio2sfu.dll
vio2sf.bin

Put them here:
C:\Program Files (x86)\Winamp\Plugins\

3. Launch WinAmp (or restart it).

4. Options > Preferences > 2SF Decoder > (You can mute all but your desired channel here)

5. To output to WAV, go to Options > Preferences > Plugins > Output > Nullsoft Disk Writer > Configure

6. Now just select your format and file destination and press the Play button on the file you want to convert to WAV. The progress bar will start moving but you won't hear any audio. This is normal since it's writing the WAV file, not playing it.

IMPORTANT: At long as the NullsoftDisk Writer plugin is selected in Plugins > Output, it will save every audio file as WAV instead of playing them. To revert back to playing audio normally, just select "Nullsoft DirectSound Output" or "Nullsoft Wave Output".

There's a more recent vio2sf plugin for foobar2000 by kode54, but it doesn't have the option to mute channels. It's still a good option for just playing 2SF files. And there is a more recent version of the plugin for WinAmp 5, but you would need to compile it yourself. Kind of a hassle, tbh. The older one works well enough anyway.
 
  • Like
Reactions: Rednorka

JOSW28

Member
OP
Newcomer
Joined
Oct 13, 2021
Messages
6
Trophies
0
Age
20
XP
39
Country
Mexico
It can be done, but setting it all up is kind of clunky. In this method you'll need to find the music in .2SF format (do some searches, it's not hard to find archives of this stuff).

1. Install WinAmp.


2. Download the "vio2sf" WinAmp plugin from this page.

It's an older version. That's fine.

3. Extract these files from the vio2sf archive:
in_vio2sfu.dll
vio2sf.bin

Put them here:
C:\Program Files (x86)\Winamp\Plugins\

3. Launch WinAmp (or restart it).

4. Options > Preferences > 2SF Decoder > (You can mute all but your desired channel here)

5. To output to WAV, go to Options > Preferences > Plugins > Output > Nullsoft Disk Writer > Configure

6. Now just select your format and file destination and press the Play button on the file you want to convert to WAV. The progress bar will start moving but you won't hear any audio. This is normal since it's writing the WAV file, not playing it.

IMPORTANT: At long as the NullsoftDisk Writer plugin is selected in Plugins > Output, it will save every audio file as WAV instead of playing them. To revert back to playing audio normally, just select "Nullsoft DirectSound Output" or "Nullsoft Wave Output".

There's a more recent vio2sf plugin for foobar2000 by kode54, but it doesn't have the option to mute channels. It's still a good option for just playing 2SF files. And there is a more recent version of the plugin for WinAmp 5, but you would need to compile it yourself. Kind of a hassle, tbh. The older one works well enough anyway.
Thanks for replying, unfortunately the game that I'm trying to rip the music doesn't have any 2sf files ripped yet (and I don't think it'd ripped, because it's and oscure and very rare game), and It's that the reason why I would like to record it by emulator.
 

ChiefReginod

Well-Known Member
Member
Joined
Jun 11, 2016
Messages
614
Trophies
0
Location
California
XP
2,044
Country
United States
Yeah, I couldn't find that one either.

But I did find this tutorial to do all of this with vgmtrans and FL Studio:


Basically, you'll be exporting the MIDI file from the ROM with vgmtrans. You'll also be exporting a soundfont file in a format that FL Studio can use (this contains the unique sounds of each instrument since none of that is saved in MIDI). Then you just Import the MIDI file into FL Studio and set it to use the .DLS soundfont.

I just tried it out with a few of my DS ROMs and it actually worked as promised. I'm gonna make heavy use of this myself. :D

The hard part will be using FL Studio if you're not yet familiar with it. I don't know if exporting to WAV is supported in the trial version. Also note that each individual song has its own soundfont, so you'll need to export the MIDI and DLS file for each and every song.
 

JOSW28

Member
OP
Newcomer
Joined
Oct 13, 2021
Messages
6
Trophies
0
Age
20
XP
39
Country
Mexico
Yeah, I couldn't find that one either.

But I did find this tutorial to do all of this with vgmtrans and FL Studio:


Basically, you'll be exporting the MIDI file from the ROM with vgmtrans. You'll also be exporting a soundfont file in a format that FL Studio can use (this contains the unique sounds of each instrument since none of that is saved in MIDI). Then you just Import the MIDI file into FL Studio and set it to use the .DLS soundfont.

I just tried it out with a few of my DS ROMs and it actually worked as promised. I'm gonna make heavy use of this myself. :D

The hard part will be using FL Studio if you're not yet familiar with it. I don't know if exporting to WAV is supported in the trial version. Also note that each individual song has its own soundfont, so you'll need to export the MIDI and DLS file for each and every song.
Thanks for the suggerence. But, the game isn't compatible with VGMTrans, because it doesn't use .sdat file as sound storage instead of that, it uses and strange filename with the extension ".mus". So I can't do this
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
35,543
Trophies
2
Website
trastindustries.com
XP
25,467
Country
United Kingdom
First do check https://gbatemp.net/threads/the-various-audio-formats-of-the-ds.305167/ and make sure it is not a known format otherwise (.mus would be a new extension to me but extension is normally just a mild suggestion/convenience, bust out the hex editor and see what it starts as or has early on). Unless it is ported from some other platform I would not expect a game like this to go full custom and instead just use another known format, go direct to the (AD)PCM the DS hardware understands or some common one.

Beyond that I don't know any emulators or builds thereof that dump channels offhand to wave files, nor external programs you might readily hook for it. There are many open source emulators
If it does come to pass that you have to rip things manually do bear in mind you a) have cheats, b) savestates, c) ROM editing* and d) might well be able to silence audio even if you don't understand it**.

*in the classic scenario of standing still somewhere in a level with no enemies or whatever to do loop back then level editing to remove enemies might be the easier option rather than trying to understand and audio format.

**volume command, if there is a loop back then looping silence, reducing apparent size to zero with pointers, if there is silence in a track then copying that across the track, if the instrument library are wave files then replacing those with silence... many things and approaches here depending upon what you are doing.
 

JOSW28

Member
OP
Newcomer
Joined
Oct 13, 2021
Messages
6
Trophies
0
Age
20
XP
39
Country
Mexico
First do check https://gbatemp.net/threads/the-various-audio-formats-of-the-ds.305167/ and make sure it is not a known format otherwise (.mus would be a new extension to me but extension is normally just a mild suggestion/convenience, bust out the hex editor and see what it starts as or has early on). Unless it is ported from some other platform I would not expect a game like this to go full custom and instead just use another known format, go direct to the (AD)PCM the DS hardware understands or some common one.

Beyond that I don't know any emulators or builds thereof that dump channels offhand to wave files, nor external programs you might readily hook for it. There are many open source emulators
If it does come to pass that you have to rip things manually do bear in mind you a) have cheats, b) savestates, c) ROM editing* and d) might well be able to silence audio even if you don't understand it**.

*in the classic scenario of standing still somewhere in a level with no enemies or whatever to do loop back then level editing to remove enemies might be the easier option rather than trying to understand and audio format.

**volume command, if there is a loop back then looping silence, reducing apparent size to zero with pointers, if there is silence in a track then copying that across the track, if the instrument library are wave files then replacing those with silence... many things and approaches here depending upon what you are doing.
Thanks for replying.
I've already seen your post, but I didn't found the file that the game uses.
The only thing that I could notice of the ".mus" file, is that at the start of it, there are written the name of several ".pcm" files that there are in the .nds file too, which are the samples of different instruments that the music uses. Also, at some point, it starts a sucesion of different values where the most present value is FF, but sincerily I don't understand it.
I've already noticed that that DeSmuMe have source code, but sincerily I don't understand almost of its code. I'd try to modify it, but there's a high probability that I couldn't do it.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
    KenniesNewName @ KenniesNewName: 10 year old hardware now still emulates switch pretty decently