How to ripping SSF files by caius at 6:38 AM EDT on March 28, 2009
Hi all, I'm trying to rip SSF files form Sega Saturn game.First I tried to use ssdump.py script by Kingshriek but I only manaed to dump one .SSF from each game (the one playng during the dumping..). Then I came across VGMToolBox and his extraction tools but I didn't understand well how it works (what I have to put in "driver and source" path fields?).And I didn't understand where I have to install Python, in which directory. Could anyone explain me better or point me to a tutorial?.I have nearly 1400 Saturn games and I'd want to extract music (sequenced music, obviously..) from them. Thanks in advance.
ssfdump.py does only rip the song that was playing at the time of making a savestate, but if the game has a soundtest, you can just use it to rip all music (sometimes required, if say, the data on the disc is compressed).
If you don't want to do a savestate rip, you need to use ssfmake.py, which has a nicely done tutorial included (just open the script in a text editor).
Doesn't matter where you install Python, as long as it's installed.
When I find an easy to make Saturn game (been having bad luck with it lately, everything requires at least some level of hackery), I'll upload the source files with a step by step tutorial, hope that helps.
Thanks for replying.And if I use VGMtoolbox is the the same as if I use ssfmake.py? For "source path and driver" what does it mean? Maybe driver is SDDRVS.TSK? I open the ssfmake.py with a text editor but it seems are needed skills of programming to dump .ssf files or I'm wrong?
"I open the ssfmake.py with a text editor but it seems are needed skills of programming to dump .ssf files or I'm wrong?"
Not always, some games are easy enough you just need to find the music files, edit the ssfmake.py script and run it.
Read the part in the script starting from:
# There are 6 things that a ripper needs to concern him(/her)self with when ripping SSFs from the game data itself. # (1) Sound driver - 68000 executable, usually called SDDRVS.TSK (or something with "SDDRVS" in it).
If that doesn't help you though, I don't believe I can be much of help.
Not to discourage you or anything, but most Saturn games use CDDA or other streamed formats for music (which is perfectly ripable of course, but tends to be on the large side).
the game you mention doesn't really sound like it would use sequenced music (since it's an arcade port, most probably they just recorded the music from the real machine.
Yes, I know most of Saturn games use CDDA tracks ver yeasy to rip. Irem Arcade classics has music in .bin files , so maybe you are right, it's not sequenced musics.. How can I treat .bin files?
Please, if you want, make a small tutorial on how to rip .ssf (also using VGMtoolbox..). In particular, I didn't understand well how to customize the sssfmake.py adding parameters,
Are these your archives?: http://ssf.hcs64.com/ and http://dsf.hcs64.com/
Okay, let's go step by step. Just a word of worning, each game is different, there's no failproof, no brain required method of ripping. I'm still learning stuff myself, games that scared me off few month earlier now I do without trouble.
Irem Arcade Classics is very simple, so it may be a good start...
Oh, and this requires doing some things that are not really possible (or very hard to do) with standard Windows Explorer (hex editing a file, running DOS commands). I'd recommend using Total Commander (www.ghisler.com), fits all my needs like a glove.
1. First you need to check the music driver's version. Some driver revisions simple don't work, or work bad, so this will save you some wondering why the files don't play later.
Open the Sddrvs.tsk file (take note, this might be called differently in other games) in a hex editor, and check around offset 0x1020
"Ver1.33 95/08/07"
So, we're good to go (reffer to http://snesmusic.org/hoot/kingshriek/ssf/ for nonworking driver versions).
2. Now let's extract the needed data. Let's check first if the game uses DSP. Quickest way to do is to search all the music datafiles (or the game ISO) for '.exb' string. Nothing here, so we can ignore it completely.
3. Since the game uses a datafile, which has both the sequence and sample set joined together in one .bin file, we need to separate those. seqext.py and tonext.py scripts from kingshriek page do the trick.
Let's create an empty directory for the files, say, extract
>> md extract
And now let's extract the files there, writing the log to seq_ext.txt and ton_ext.txt
So that's a yes, actual number doesn't really matter (ssfmake.py does everything automatically after setting multisong creation mode).
3. Let's copy the newly created files, the sound driver, ssfmake.py and a correct sound map to the same folder.
Sound maps tell the sound driver where exactly in memory is each data. There are some basic ones created by kingshriek in the ssfmake.py archive. You need to be careful when choosing one, if you try and load a 500 kB sample file with a sound map that has only 400 kB of memory allocated for samples, the resulting SSF files will play bad.
Largest SEQ in the Irem game has 0x3C51 bytes, largest TONE bank has 0x5BF5E bytes. Looking at the generic sound map data (this is from ssfmake.py):
We can't use the GEN_SEQ20000.MAP one, since it has less allocated for TONE. But GEN_SEQ10000.MAP fits here. So let's copy that.
4. Now all we need is running ssfmake.py with correct parameter. Open it in text editor, and scroll to this section:
# filenames - use an empty string if file isn't needed ndrv = '' # sound driver nmap = '' # sound area map nbin = '' # tone data nseq = '' # sequence data nexb = '' # DSP program # ----------------------------------------------------------------------------------------------------- nout = 'ssfdata.ssf' # output file name (if .ssflib, create ssflib and minissfs for each track in the bank)
So, let's fill this in:
ndrv = 'Sddrvs.tsk' # sound driver nmap = 'GEN_SEQ10000.MAP' # sound area map nbin = 'MENUSND_000.BIN' # tone data nseq = 'MENUSND_000.SEQ' # sequence data nexb = '' # DSP program # ----------------------------------------------------------------------------------------------------- nout = 'MENUSND.ssflib' # output file name (if .ssflib, create ssflib and minissfs for each track in the bank)
Sound driver we have from the game, map we chose just before, tone and sequence data should match, DSP program field we should leave empty, since the game doesn't use DSP, and we need to set the output filename to .ssflib, since the SEQ file has more than one song.
Save, run. It should create a 3 minissf files.
Playing those will tell us that the first two are only SFX, but the third one is actually music. You can delete the first two and leave it as that, but having a ssflib and only one minissf file that use it is rather sloppy, so let's fix this. Delete both the minissf files and the ssflib.
5. Above the filenames section in ssf is a section called # PARAMETERS. The minissf file we want to have was called MENUSND_00_02.minissf. First number refers to bank parameter, second to the track parameter. So let's edit those:
# PARAMETERS bank = 0x00 # sequence bank number track = 0x02 # sequence track number
and let's tell the script to only make a single ssf file:
nout = 'MENUSND.ssf' # output file name (if .ssflib, create ssflib and minissfs for each track in the bank)
Save, run.
6. Now you just repeat step 4 (and 5 if necessary) for all the other files. Then remove the unneeded/repeated minissf files. Add timing data:
Ok, many many thanks for your step-by-step guide, it's very precious, now starting from this I'll try to rip SSF from other games ( as I said before I have nearly 1400 Saturn ISOs..)
The problem is to find the .SEQ and .TON, often they are embedded in other files like in Iream Arcade Classics and choose the right sound map. Ok, I'll try and if results are good, I will send you the SSF files.. Thanks again for the help!
The problem is to find the .SEQ and .TON, often they are embedded in other files like in Iream Arcade Classics and choose the right sound map.
You can use VGMToolbox for this. Just drag and drop the contents of your disc onto the text area in the seqext/tonext front end (Misc Tools > xSF > SSF). This can help you find relevant files. I built it to save this hassle of calling seqext/tonext for evey file on the disc.
Be aware that the driver can also be inside other files. The Simple Cutter/Offset Finder (Misc. Tools > Extraction Tools > Generic) was created for times like this. With these settings (based on section 1 of kingshriek's ssfmake.py script), you can hopefully find them:
You can also use the Finder to search for exb files, though you will likely need to cut them yourself since the filename is sometimes inside the file so the offsets can vary. Just remember that the Offset Finder is case sensitive, so search for .exb and .EXB.
Please, if you want, make a small tutorial on how to rip .ssf (also using VGMtoolbox..).
Lastly, for simple rips such as this, you can use VGMToolbox. More complex rips are best done manually. The following settings will perform a complete rip of the Irem set. You will need to remove SFX of course, but it will be ripped and timed:
Source path will be the directory with all of your data files. You would still need to remake the SSF with only one non-SFX song, but it's a nice way to get all the tracks built and then clean the set.
Currently VGMToolbox will choose a MAP file based on the TON data size. Eventually I'll use the info inside the data files. Be sure to check the output window for errors (double clicking on it will open it as a .txt file).
I highly recommend reading the ssfmake.py scripts introduction. It will explain the other parameters and how all of this works.
One other thing, don't forget to check for CPK movies. Using ffmpeg (grab the Windows build here) you can demux the audio using this code:
ffmpeg -i input.CPK -vn -acodec copy input.WAV
It usually works, though in this case it does have a bit static, could be my older version.
OK, thanks also to you for your explanation.Are you the author of VGMToolbox?
Update: I tried VGMToolBox with the parameters above but it doesn't work, it only copies all the data from source path in a "working_ssf_seek" folder created inside of VGMToolBox folder.I use VGMToolbox 2.0
Not sure what happened. I've tested with your data and had no problems. Do you have Python installed? Since my program still calls kingshriek's scripts to make the SSFs, you will still need it.
You can always visit IRC if you want to try and recreate the error so I can help you fix it. Try this link to get online quickly: #console_stream
OK, it works.It was fault of the PATH environment variable not stated, so Python was not running.
Thanks for the bug report, I've added some code to check for Python in the path and throw an error if it is not found. It's now in the latest binary release.
Ok,thanks.I'm starting to rip music from Saturn games using your VGMToolBox, the only thing difficult to me is to associate .SEQ files with right tone .BIN (with same name otherwise program doesn't work..), because often the names are not the same for both.How can I find them?Only trying and listening if musics play well?
Yea, that's one of the problems I mentioned earlier.
They might be grouped together (if they are in one big datafile, you can look at the offsets they are in, and pick SEQ and TONE that are close to each other). You can also use the savestate rips to look up which TONE is used.
But you see, the biggest problem is that one SEQ file can use more than one TONE file. When I see stuff like that in a game without a soundtest, I usually run for the hills.
ssfinfo.py output might help a bit here, as it shows how many banks and how many samples each SEQ file uses...
From Tactical Fighter (1997)(TamTam)(Media Rings) rip:
Sequence Bank 1 - Track 0 ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ Channel 0: Bank 0, Voice 2 Channel 1: Bank 1, Voice 1 Channel 2: Bank 1, Voice 1 Channel 3: Bank 0, Voice 20 Channel 4: Bank 0, Voice 20 Channel 5: Bank 1, Voice 0 Channel 6: Bank 0, Voice 26
As you can see, the sequence file here needs two TONE files, one with only 2 samples (tonext.py can give you the amount of samples each TONE file has), and another one with at least 26.
Other than that, yeah, you're stuck with listening and matching the files manually.
Also, be sure to read on kingshriek's site about DSP, this is really easy to miss, and will result in badly played, unfixable files.
Thanks for the explanation.Now,I found one .SEQ file that uses two TONE Files, how can I combine them to output a proper .ssf file? I have to put the two TONE filenames in 'nbin' parameter in the ssfmake.py? And, sssinfo.py has to be executed with 'a' parameter to output all info?
That should do the trick. The script supports wildcards, so you can just use *.ssf or *.minissf.
And as to the first one, from kingshriek's script:
# NOTE: The script is really only set up to handle a single bank of tone data (matching the sequence bank). # Some games contain sequences that reference multiple tone banks. To handle these, the script # needs to be run multiple times (each time with a different tone data file and bank #). Each time # script is run, a file named 68000ram.bin will be dumped out. This is a 512K file that corresponds # to sound memory. For additional runs, just set the driver file name to this file ('68000ram.bin') # as well as setting the corresponding bank numbers and tone data files, leaving the other file name # parameters blank. Finally, the last pass of the script needs to have the bank number set to the # desired sequence bank since the script always writes this value into the SEQUENCE_START command.
So it's possible, but generally annoying to do so. I've been doing some manual building myself, but this of course needs different approach with each set of files.
Ok, thanks.But if I execute multiple times the script sssfmake.py (each time with a different tone data file and bank #) then each time it will output ssf or minissf files , then how can I combine them to obtain definitive .ssf ?
But if I execute multiple times the script sssfmake.py (each time with a different tone data file and bank #) then each time it will output ssf or minissf files , then how can I combine them to obtain definitive .ssf ?
# NOTE: The script is really only set up to handle a single bank of tone data (matching the sequence bank). # Some games contain sequences that reference multiple tone banks. To handle these, the script # needs to be run multiple times (each time with a different tone data file and bank #). Each time # script is run, a file named 68000ram.bin will be dumped out. This is a 512K file that corresponds # to sound memory. For additional runs, just set the driver file name to this file ('68000ram.bin') # as well as setting the corresponding bank numbers and tone data files, leaving the other file name # parameters blank. Finally, the last pass of the script needs to have the bank number set to the # desired sequence bank since the script always writes this value into the SEQUENCE_START command.