USF sample dumper- in_usfdump by coda at 5:13 PM EDT on April 4, 2011
hi guys, i really wanted some goemon 64 samples so today i downloaded the source to 64th note and made this thing: http://dl.dropbox.com/u/2494245/in_usfdump.zip
it "rips" samples from usfs while playing them in the dumbest way possible- a hook in the RESAMPLE() function of audio ucode1 that saves the output to a wav file. sounds like this: http://dl.dropbox.com/u/2494245/yamatolead.wav.mp3
of course this gets around the issues srip has with certain uncooperative games.
files are dumped into c:/usfdump/, named by their address (i think). better clear it out after ripping each song or everything will get mixed up.
Since your method of enabling Audio HLE crashes here in the GUI...... I am thinking just taking the 64th Note source, neutering it down as much as I can to a bare minimum for emulation, write up a harness to just load that DLL, and then do the dumping that way.
Of course, you will be credited for the initial idea.
my code has nothing to do with the config GUI nor contains a method of enabling Audio HLE, but you can enable HLE via the ini directly if the GUI doesn't work, as seems to occur in winamp plugin wrappers like xmplay.
Which I did in the end. Was using XMPlay. Fucked up.
Now using this method of:
A) A UTTERLY BUTCHERED USF build so nothing remains except R4300i core emulation and audio hle. LLE RSP was completely removed. B) A app to call said functions and dump.
while ripping the mystical ninja samples lunar discovered that there is some rather harsh aliasing going on which was remedied by resampling the output down to 32khz (could probably also be fixed with a steep lowpass filter.) as far as i can tell, this is simply a fact of life due to the HLE resampling method which uses nearest neighbor interpolation. i would have liked to grab the sample data PRIOR to resampling, but couldn't manage. any insight into the ucode or relevant hardware would be appreciated.
Nice idea by Yoshinkeru at 1:51 PM EDT on April 8, 2011
I've been looking for something like this for a while myself. Good thinking. But I can't get it to work for me...
Coda, I tried your plugin, and XMPlay crashed for me too when I tried to enable Audio HLE in the GUI. I then did as you suggested and turned it on in the .ini file. But it just plays the file normally, and no ripping occurs. Am I doing something wrong?
Mudlord, I tried your program as well, but it only rips sounds from certain miniusfs, and yet the WAVs won't play anyway; it just cranks out 1 KB files which don't work. What's going on?
Just to let you guys know I just figured out the .ctl and .tbl files for Mystical Ninja. You can rip it with SRIP.EXE with this: /c 0x07EC20 /t 0x0973C0
For Goemon's Great Adventure just input this into SRIP.exe /c 0x03F910 /t 0x060890
Assuming your extracting from the USA versions, this method will work.
If anyone makes a soundfont do let me know as I am interested.
when i tried it with SRip in the past (and indeed when i tried it just now) just with the string srip foo.v64, it ripped 1/79 instruments (just a "click" sound) before throwing an "Illegal predictor number 14" error. i assumed it was an incompatibility with the game so i just didn't pursue it further, and since i have no idea how you're supposed to find ctl/tbl offsets that was the end of the line. even asked for help repeatedly here before, no-one said anything or did anything to help.
once again i've spent ages doing something around this joint only to see all the time and energy go to waste. i already spent 3 solid days collecting/recording sounds and building that soundfont, with all the tedious looping... i really don't think i have the willpower to pick it up again.
here is the crap soundfont i made already, for what it's worth: http://vgmusic.com/~lunar/soundfonts/Mystical%20Ninja%20Starring%20Goemon.sf2
I would like to explain but I do not know how to explain it in detail. I only know what they look like. If a picture would help, this is what your standard ctl headers look like this
The magic number being 42 31 00 0X. The tbl data is most commonly at the end of all the ctl headers and just looks like mixed data. Here is a shot of your standard tbl table
I see, that helps. How do you know for sure where the tbl is? Do you just look for the gibberish located after the ctl? Sorry if it's a dumb question, I'm not that experienced with hex editors.
Okay thought so. I guess I was wondering whether there was a definitive way to know what signifies the end of the ctl. 000 padding or something. I'll give this a shot later tonight.
I just spent two hours trying to find the tbl(s) for Dōbutsu no Mori A.K.A Animal Forest... I just can't seem to find them. Srip finds a list of possible ctls, but no tbls, and I keep looking in a hex editor and plugging in addresses into Srip but to no avail. I don't even know how to identify where a tbl starts, I've just been looking for packs of zeroes after the ctl adress.
Something that I think is complicating the process is the existence of "Nintendo Style" ctl, which differ from the normal "magic number" style. I just have no idea where to go with this. Anyone have any luck finding the tbls to Animal Forest? Advice? I've been wanting the sounds for years ;_;
punk7890: If it's easy for you to find the tbls, maybe you could post them here? If you would want the resulting soundfont I would definitely post it when I finished it.
If not I understand; If it's as tedious for you to find as it is for me to not find(not to mention the fact that you might not even be interested in the sounds of this game), I wouldn't really want to do it.
Yeah, you're right. I've already ripped a few samples using it, it is very handy (Though the output is very sporadic and sped up with this particular game, it is possible but difficult); I was just testing the waters to see if anyone knew the tbl address for the game, since it would cut down a lot of the work excising samples, wading through the sped up .wavs, checking duplicates, etc.
But you are right, if it comes down to it, I will be using usfdump. I forgot to thank you for the initial concept/hack, sorry about that, I'm very grateful even if I don't sound like I am :] .
I took a quick look at it and it is indeed on of Nintendo's standard formats. Unfortunately, it seems there is no way of ripping it. They may be ctl headers but I'm not familiar with them.
Here is Super Smash Bros 64 if anyones interested: /c 0xB4E5C0 /t 0xB54CE0
Thanks for taking the time to look at it punk7890, I appreciate it. I guess it's up to in_usfdump to save the day.
edit: Thanks for the SSB addresses! Perhaps looking at more of them might help me wrap my brain around the process, if you find any more it would be cool of you to post them.
The easiest way to automate this is to hook into the sequencer setup calls, which are given the ROM offsets of the ctl and tbl. I had done this for the generic USF driver program, I'll see if I still have that source around anywhere.
What Lunar said. I looked at the hex for Smash Bros and could not glean any sort of pattern compared to the Goemon games :| . The ctl doesn't even begin with the "magic number". You are a wizard.
Do you have any tips for being able to do what you do, punk7890? Maybe even just how you have the skill-set to do this? A lot of experience with hex or something? Like I said earlier, I don't even know how you know what constitutes the end of a ctl file /beginning of a tbl, let alone actually finding them.
And hcs: Are you saying you might be able to rig up something that locates these files? Because that would be a godsend!
Well, I located (after a lot of digging on old drives) the modified pj64 I'd been using. It needed some more work to do just what we need. I now have it up and running after 8 hours. The bad news is that a lot of games (the tricky ones anyway) don't use the standard alBnkfNew call. We might be able to track down some other common calls, but who knows. In any case, it works on Mystical Ninja, but not Star Fox, Animal Forest, or F-Zero X. ctl_tbl_helper v1 (and source) Run it in interpreter CPU mode and it will pop up a window whenever it sees a alBnkfNew call. It displays the RAM address of the ctl, which it will try to locate in the ROM (there may be > 1 match, which should mean they're identical), and the ROM address of the tbl.
Wow, incredible work hcs. It's too bad it doesn't work on Animal Forest, etc. Do you know how difficult it would be/ whether it would even be possible to make this work with the more stubborn games?
It seems odd that there is a working USF for Animal Forest yet the way it calls instruments/ produces music is a mystery. Thanks for all your work on this though, should be very useful for some of the difficult games.
usf ripping is a lot lazier than other emulated formats. We essentially just take the full rom, locate a song select, and then break the graphics.
There was work on a more thorough extraction of the music data, to produce cleaner rips, but there is so much variation in the drivers that it wasn't practical. Or maybe I just did a shitty job of it.
It took awhile to find but I managed to find it (you do mean Goemons Great Adventure right?) SFX bank 1 /c 0x048D30 /t 0x285020 There is 2 more banks, but its just a mess to look for them.
Bomberman 64 seems to use the Nintendo format again. If anyone manages to figure it out it should go like this (at least I think) /c 0x409150 /t 0x4139A0
@Bolt I guess the experience if any comes from editing Zelda 64. I used to do that back in the day.
@hcs
That would come in very handy!
Is there any way to make a sf2 out of the ctl+tbls(not manually but auto or at least semi auto)?
@punk7890: Incredible. Thanks for the additional addresses. Does the fact that you found BM64 addresses despite them being Nintendo style have any bearing on Animal Forest? (I assume no, I'm just a desperate man and thought it wouldn't hurt to ask.)
Zelda hacking makes sense, I'm sure you'd learn a lot about n64 structure through something like that. Thanks for the answer.
That's unfortunate. If you ever do-- well let's just say I'd be a very happy camper.
And as far as I know, I don't know of any way to automate sf2s out of that data (though I don't know much so there might be tons of ways). I just plan on looping/tuning/setting envelopes manually.
P.S. Considering your experience with Zelda 64 specifically, any chance you'd know the addresses offhand? I've always wanted those choral chants in the Fire Temple. If you don't that's fine, just thought I'd ask.
@Bolt It would be possible to locate the calls that these other games use, but I don't know how much work would be involved. I only wanted to resurrect this code because I thought it was already done (though it turned out to need a lot of work).
@hcs I understand. You've already done a great deal of work just getting this up and running (not to mention everything else). It's times like these I really wish I knew anything about programming though.
It also uses Nintendo format for the ctl. The offsets are as follows but will not work with srip: /c 0x0190C0 /t 0x094870
I've made a incomplete sf2 awhile back from OoT by importing custom music (I only imported notes that where held for about 5 seconds so I could record the instruments and get a good loop point)
Once I found out what you meant by setting CPU to interpreter, I tried it on some ROMs that I wanted to grab sounds from. I found out it also won't work with Mario Tennis or Yoshi's Story.
Interestingly, it does give me these addresses for Excitebike 64: ctl=800fe08 (size 00000008:) tbl=80011630 But when it gets to the title screen, it gets a "Div by 0" error, then says:
"It took awhile to find but I managed to find it (you do mean Goemons Great Adventure right?)"
I meant mystical ninja starring goemon ~ all the sound effects, voice samples, etc. many of them are likely in goemon's great adventure as well though. i'll try your values for it and bomberman 64 later.
"Is there any way to make a sf2 out of the ctl+tbls(not manually but auto or at least semi auto)?"
sounds tricky. i doubt it could be fully automated. however, if you can at least parse the looppoint information into the respective wav files (or make a tool to do it), that saves a huge amount of work, well over half. and i might commit to building the soundfont again if that part is done. stuff like sample ranges, ADSR, tuning (i very much doubt there is any required) etc. is trivial by comparison. manual looping takes a long time.
Automobili Lamborgini by pushlda at 8:23 AM EDT on April 24, 2011
Hi,
As I don't understand mips code nor ripping n64 stuff could somone manage to extract the samples of Automobili Lamborghini?, it has smooth samples could make some relaxing dnb or dubstep from that. If someone has the time for it or so ^^ That would be so amazing :)
Did you try redownloading it? 7zip says the file is fine (though, to be 100% honest, I didn't try extraction. I just ran the "test archive" on the *.RAR file). With as small as it is (183 KB (187,790 bytes)) I doubt it's actually broken.
Sorry I can't actually test this for you. I'm out of time, and I have no N64 ROMs, and although I think this is awesome, I have no reason to actually use it (my interest in pulling out N64 audio samples isn't very high right now). Mouser X over and out.
I've downloaded it at least 3 times now with no luck. Interesting when you mentioned the filesize, I only have 150 KB (154,148 bytes) on mine! What's going on here??
Update: Just re-loaded this in Internet Explorer, and it downloaded just fine. Maybe it's this extension I just got for Firefox? (And in which case, DANG. I thought I'd like it...)
Wow this is awesome news! So excited that Glover is on the list. Can't wait till the remaining (Nintendo especially) games make it on there, if that's even in the cards that is.
Awesome!! Thanks for the heads up and for sharing the soundfont punk7890, and thanks to everyone involved in this tool. I'm truly grateful.
RE: punk7890 by Yoshinkeru at 10:09 PM EDT on June 20, 2011
Nice job! If I may, there are a few instruments that I think could be renamed more appropriately. Your first instrument "(?)" could be a violin or fiddle. The "Drum (?)", I believe, is a xylophone; the one termed "Xylophone" sounds more like a marimba. (And the "Goron Related" is actually a cuica.)
I also notice you've sorted them all alphabetically, rather than placing them in a more GM standard format. Of course, this is all aesthetic, and in fact, I can do all the edits I wish myself with the SoundFont editor I have if I so choose.
That'd be cool if you rename them and upload it. I have a few more soundfonts in the works but they are rather big and I don't really feel like renaming/make them GM friendly.
So, I'm going to ask the most ridiculous question(s) possible. Lunar mentions (on Iridescent Audio) that coda hacked 64th note to dump usfs on a channel-by-channel basis, which I assume is what this thread is about. My question is, after putting "in_usfdump.dll" in the Winamp plugins directory, how do I actually get the USFs to dump on a channel-by-channel basis? (In other words, why isn't a usfdump folder appearing anywhere?) Also, does it actually dump entire channels, for example, would it dump the entire 'steel drums' section of Treasure Trove Cove, or the entire bass line of a tune, or whatever, or am I misinterpretting the "channel by channel" part? Basically, how do you use in_usfdump.dll?
Well, if anyone wants details of what I've done, so they can tell me what I have done wrong: I have "in_usfdump.dll" in the Winamp plugins directory, which winamp displays as "64th Note v1.2 beta 3 Apr 4 2011" (IIRC, the normal in_usf.dll has some 2007 date or something), I also have copied the following files within a folder containing miniusfs: usfdump.dll usfsampledumper.exe cmd.exe
After launching cmd.exe, I then type "usfsampledumper.exe", which then tells me how to use it, so, then, I do as it says: "usfsampledumper.exe [miniusf files]" -- just to test it, I just typed in one, for example: "usfsampledumper.exe 18a - Rainbow Road.miniusf"
It then comes up with: "N64 audio sample dumper 0.1 by mudlord
On an unrelated note, when Lunar says coda hacked 64th note to rip USFs on a channel by channel basis, does he mean that literally each instrument will be ripped separately? For example, is it possible to rip just the bass line, and strings of Dire, Dire Docks, so that it sounds something like this?: http://www.youtube.com/watch?v=lXv7br0qVSg
Or rip Hazy Maze Cave, but take out the main "slap bass" melody, like this?: http://www.youtube.com/watch?v=7242KiaYbkw
Calm the frick down. We're not not responding because we don't notice your posts or we're just ignoring you. We're not responding because we don't know!
in_usfdump.dll is NOTHING to do with usfsampler.exe.
Start the cmd prompt as an admin.
Rename the file you want to use to something small like c.miniusf because it doesn't like special characters, spaces or numbers. (sometimes)
Make sure the folder C:\usfdump exists and you have full privileges to it. I did my ripping in the folder itself.
If it still fails, the game isn't supported. Maybe it might be supported by the sound extractor tool in this thread instead.
And as far as I'm aware for the games I have ripped samples from, they are too heavily "trackfucked" to be able to just get one channel to play fluently.
It was bits of several channels mashed into one WAV file.
Here is an example of what a DKR track produced (only one of the files it produced). Note: It exports the files as mono 44,100Hz files which need to be changed to their original Hz rating (around 22,050Hz) before they sound reasonable.
Ok, so I looked at ugetab's Hazy Mazy Cazy variations and worked out how to knock out particular instruments. Here's the USF set. The only problem is that I can't figure out how to turn off the drum tracks, so they're present in all of 'em. The bass melody is 03.miniusf.
(fwiw it works by knocking out the entries for the instruments in the CTL in the ROM)
I'm sure it can be muted, I just need to figure out how... I've not been able to get n64soundtool to run right in Wine to dump the samples, nor was I able to find srip last night.
How do you think I did these? Exactly the same way: [url]http://www.youtube.com/watch?v=eLjZAXEe7O0[/url] [url]http://www.youtube.com/watch?v=Jo5xNLjMI_8[/url] [url]http://www.youtube.com/watch?v=YOSS0mHLdl0[/url] [url]http://www.youtube.com/watch?v=KORrlxWqKXQ[/url] [url]http://www.youtube.com/watch?v=UaNA2T70WSQ[/url] [url]http://www.youtube.com/watch?v=IcA-jDBPQDI[/url] [url]http://www.youtube.com/watch?v=hZdh9dBuqSQ[/url] [url]http://www.youtube.com/watch?v=eqDtjp-Rd8c[/url] [url]http://www.youtube.com/watch?v=4ya0zs44n0k[/url]
Look at the example (aka, next to the text box where you type your message). Look at it carefully. It's quite simple, once you realize the conventions the forum expects. Do note that it needs a complete address (including "http://"), because otherwise, it will attempt to link you to - "http://hcs64.com/www.snesmusic.com/" when, obviously, you meant "http://www.snesmusic.com". I've noticed that there's some malformed links on the forums, because the link they're providing is incomplete....
Basically, the link needs to be inside the brackets, not outside the brackets. In your post, the link are outside the brackets, and thus do not work. Hope that helps. Mouser X over and out.
Ok, because some forums, you can either have text with a hyperlink, which you do by what you said, but other times you can simply have the link itself inside URL tags, like I did.
I can't seem to get it to work with the Majora's Mask usf set (yes I know I can rip the whole bank, but I need to know the specific samples used for each track, and this seems to be one, if not the only way to do this). I'm on Winamp v5.65. Am I doing it right?
As someone has suggested, I created the c:\usfdump before trying to dump the samples. I also renamed the usfs to something very short, without spaces.
Am I supposed to change the output plugin.. ? The only additional input plugin I have is the in_usfdump plugin uploaded here. And as mentioned, I have enabled Audio HLE, but it still outputs nothing...