Project2612 ripping tutorial

From vgmrips
Note: This tutorial has been retired in favor of the universal R(er)ipping for the Out-of-Element Contributor. It's retained for historical purposes.

This tutorial will show you how to create a VGM package like the ones available at Project2612. We have devised our own formatting and quality standards to assure the finest collection of Mega Drive/Genesis music on the Internet, and to get your set included in our website you will have to follow our guidelines.

If there's anything you feel was left unexplained, or if you feel you need more help on any aspect of the ripping process, please contact us in the VGMRips chatroom. It is also strongly advised that you make a post in the Offical Pack WIP topic on the forum and tell us what game(s) you're working on, so we can avoid other people working on the same project as you simultaneously. The topic wilfl list which sets are currently in progress.

The base tutorial was written for Project 2612 by DukeNukem; modernization(s) by Jazz Jackalope.

Note: Although this tutorial has been modernized, you can find in R(er)ipping for the Out-of-Element Contributor any tidbits I neglected to add here.

Getting Started

You will need to download the programs you will use. They are:

  • BlastEm; all new Genesis/Mega Drive VGM logs must be recorded using it. You should use the most recent nightly (currently 5d3411f52d00z) or release (final) version. The nightly builds are usually very stable, so there's not much reason to fear them.
  • You will need a music player which can play VGM logs and create wave files from them. Three options are:
  • If using Winamp/XMPlay, you will also need the VGM Input plugin to play VGMs. Download the VGM Plugin.
  • You will need the latest VGM Tools to trim and tag files. VGMTool and VGMToolbox can also be used for GUI-based tagging.
  • You will need a sound editor to find trim and loop points. Some options, mostly freeware:
  • To properly optimise files, you will need to have optvgm, which comes packaged with the VGM Tools above. Using it and vgm_cmp is the last thing you'll ever do with the VGM files.

Once you know you have these ready, proceed to the next step, the logging.

Logging

Once you have everything at hand, it's time to log a few VGMs. First, have a look at BlastEm's wiki page to learn how to set the VGM paths to places you can find them. It's a must, because otherwise the VGM logs will land in a confusing place (your root user folder).

Open the Game...

Once your paths are set, open BlastEm and load the ROM image of the game you'd like to rip. You might like to take a moment and test your settings by making test logs and screenshots with the m and p shortcut keys; not just to see if they're correctly set, but because BlastEm will silently fail to record VGMs if the path (all folders + filename) of the vgm log is too long.

A screenshot will let you know if logging will fail, if the paths are similar. Or, you can open the debugger by pressing the U key, enter c or continue to make emulation proceed, then see if an error appears in the debugger window if you try to record. If you're satisfied you can find your VGMs and screencaps (and they do get created), it's time to consider the next consideration:

See That the Hz (~FPS) is Correct...

There are certain games which, for full accuracy, should be ripped at 50hz (PAL/Europe settings). Those are, of course, European games - and the games being documented on the 50Hz Mega Drive Games page, a work-in-progress. (If you have solid information or fixes for this list, it'll be most appreciated!). All others run at 60hz. Each game must be ripped at the correct clock rate (Hz), or you'll get songs playing too fast or too slow.

You can see the clock rate in the BlastEm title bar, as the Frames Per Second; make sure it's the right average for your game. BlastEm should detect the region automatically, but if you need to you can change the Default Region from the "System" menu in BlastEm's Settings - or force BlastEm to only emulate one region with a command line switch (see its wiki page).

Go to the Songs and Begin Logging.

If the game has a sound test, use it. In-game rips are always discouraged; sound effects are also logged, so you must make sure none play while you're logging the VGM. Some games have cheat codes that enable secret sound tests, so a little research is always a good idea. Some games give you the option to disable sound effects entirely; this can be very useful if you only have access to an in-game log of some or all songs.

Proceed to the place where the song you're going to rip is going to play (sound test, game level, etc). Once you're ready to record a VGM, make sure the game is silent first. Play a jingle that stops with silence if you need to. Then start logging by pressing the shortcut key M.

By default, BlastEm will dump a log-in-progress in its set vgm_path with a name like blastem_20211117_160122.vgm. You can rename this log while logging it; use names that will give you all the information you'll need later when you tag (such as level name, number, part, boss names, etc).

If you're logging from the sound test, this is a convenient time and place to record sound test numbers/names; they can be dynamically written into file comments or titles if you're an expert with .bats and use vgm_tag.

And if you're having to log from gameplay, that way you won't have to play the game again. (Of course, if you really like the game that won't be much of an issue ;P)

Once you're logging, wait about a second, then make the song play by playing it through the sound test, entering an area, starting the level, pressing pause, etc. Once you've recorded enough (a bit over two or even three+ loops is the best; this way you'll have plenty of data to work with on trimming), hit M again to stop logging.

Do this with all the songs in the game you can find, and don't forget to include game over and death tunes as well. Once you think you have all the songs logged, proceed to the next part, the trimming.

Important notes, tips and tricks

  • If you know the song quite well, you might want to speed up the logging process by increasing the emulator speed in BlastEm. Just press + to increase and - to decrease. It's safe and quick.
    • However, if you're not using the most recent BlastEm nightly, be sure to change the speed from normal only after you've begun each log.
  • Although the default Audio options should generally not be touched for pack consistency, there are Gain options that might be useful if the song is too quiet.
  • Some games, when paused, play the music normally. You can take advantage of this by pausing before any sound effect gets a chance to play. Be careful: some games do play the song when paused, but with a volume reduction. You don't want that.
    • Sometimes you can get the song to play in a different part of the game, where sound effects don't happen.
    • If the game uses GEMS, you can try to use GemsScan and gems2rom to get a playable jukebox to record from instead. (Note that you might have to set some song tempoes manually, as for games like Taz-Mania.
    • If everything fails, you can try to hack the game using BlastEm's debugger. See that emulator's page, as well as Sound Hacking/Sega Consoles.
    • If you couldn't get a hack yourself, just meet us on IRC or the Forums and we'll see what we can do about it.
  • There is a slowdown bug affecting certain Genesis songs on certain Genesis hardware (for instance, the title screen and first level music for EarthWorm Jim). This is a bug that doesn't affect other Genesis models. At current, I don't know the preferred BlastEm Model setting for recording such songs as they were intended to be played.

If you have experience with your game on real hardware, you may note some sound differences. Note that BlastEm defaults to emulating a Model 1 VA3 Genesis, which may be different from your model. Emulation of other models may not be fine-tuned yet, and Model 2 emulation isn't currently available.

If in doubt, and your model is a 1 VA3, it's best to confirm BlastEm is really to blame before filing a bug report. The best way is to use VGM_PLAY on a Mega Everdrive to test your strange-sounding VGM; rather than the original program, you should use the 16-bit Audiophile Project's version of VGM_PLAY to ensure best possible accuracy. (Although there are some flaws there too, it's better than nothing.) Alternatively, just use the game!

Using BlastEm's Debugger to Play SMPS Songs

Recent builds of BlastEm have improved the debugger (opened by pressing u in BlastEm's main window, or using a command line switch; see its wiki page for details) and made it easier to use. It's also simpler to rip certain games. If your game uses an SMPS sound driver, making any song play whenever you want could be as simple as:

z80 set [$1C09] 150

"But wait!" you say: "When I tried that, it just made the game go silent." That fact does mean the command is working. (If it didn't work for this game, the music would continue.) The issue is, the numbers you need to input don't necessarily match anything sensible (such as the in-game sound test or ValleyBell's research notes).

Note: M1 is not acceptable for recording VGMs, but you can use its playlist for a game, if one exists, to find the start of the numbers.

Here's my suggested workflow:

  • Songs in SMPS engines usually begin at 129 (hex 0x81). It's not impossible that lower numbers could have songs(?), but your best bet is to start here.
  • If you are trying to find unused songs or 129 isn't the first song; bouncing between the debugger and BlastEm windows is a pain in the ass, so use the frames command to see if you've yielded music or sound. (Some songs may take more than 60 frames to start, so beware.)
  • Once you've found where the music/sound numbers are, you can either record as you go or find all the right numbers first.
  • For recording:
    1. Use z80 set [$1C09] 0 to stop all sound; don't forget the $ to make sure this number is read as hex. (This resets the sound engine, so you don't need to worry about pollution from what was playing before.)
    2. Use frames 60 to advance one second in an NTSC game (50 for Pal). This ensures the silence takes.
    3. Begin logging with bindup ui.vgm_log.
    4. Use the same frames command again to make the buffer.
    5. Use z80 set [$1C09] with the desired song number. If using hex numbers, be sure to prefix them with 0x.
    6. Enter c or continue to reactivate the main BlastEm window. (Afterwards, you'll have to press U again to go back to the debugger.)

This can get tedious. But fortunately, you can menu-click on the title bar of the debugger to access Edit->Paste. When you paste a number of lines inside, the debugger will execute each command in order. (It's like a crude .bat file for the debugger.)

When ready to record:

z80 set [$1C09] 0
frames 60
bindup ui.vgm_log
frames 60
z80 set [$1C09] ##
continue

(The empty line is on purpose.) Just replace ## with the number you want each time.

You can do the same with an in-game sound test, if you want the buffer before recording to be more consistent (but beware that there'll still be a difference between frames; for tracks beginning with silence, you might still want to confirm the true beginning). This will involve using binddown and bindup for the correct buttons.

Trimming

This is the most important and the hardest part of the whole process. There are three types of tools to help you find loop points: vgmlpfnd, vgm2txt, and VGM -> WAV file conversion. If you choose (or use, along with other methods) the last one, you should already be familiar with your sound editor to do this step properly and quickly. If you still have no experience with it, it's suggested you try out the everyday tasks in that last link until you're comfortable with performing them.

vgmlpfnd can help you find loops (sometimes), but you also have to find the proper start points of each VGM too. Sometimes, as with Tiny Toon Adventures: Buster's Hidden Treasure, using vgm2txt to find a good cutoff can be tricky or confusing; the TXT shows that commands are still running leading up to the start (or after the end in an unlooped song). You should still be able to determine a good song start in that case, but things may call for examining a WAV.

Because of length (and general applicability to all VGM-supported systems), vgm2txt has its own walkthrough page and the method for finding trim points using .wav files has a walkthrough linked in the starting paragraph of this section. You'll find a much more comprehensive explanation on those pages than can fit here without making for one enormous tutorial!

Note: GemsPlay isn't suitable for logging VGMs, but sometimes it can help you find trim points or the exact length of a non-looping song. If it's too complex for you just yet, though, just use normal methods.

Trimming with vgm_trim

Note: Please use vgm_trim to trim VGMs instead of VGM Tool, as it is more precise.

vgm_trim is a command line tool. You can simply drag (from within the folder) and drop VGMs on it, and input the numbers needed as it prompts. But if you have all the trimming points written down, it's easier to make a trim.bat file with lines like:

vgm_tag "Spliffyfop.vgm" 2986 40440 626409

for each track. This also keeps a handy log of the trim points, just in case something goes wrong.

In order, the numbers are the Start Sample, Loop Beginning, and End Sample. None of these will be zero for a song that loops. For a song that doesn't loop, use 0 for the Loop Beginning. (Make sure your Start Sample doesn't cut off beginning silence that's part of the song!)

Once the files are trimmed, it's time to check if everything is sounding good. Open the file in VGMPlay or Winamp. Pay special attention at the start, loop and ending points.

Here's an excellent hint to help you with checking your trim and loops: configure VGMPlay's .ini/the VGM input plugin to loop 1 time and fade for 60000 milliseconds (that is, 60 seconds). Since the fade is not added to the song length, you can find it easier by just moving the trackbar to just before the end and let the song finish. (For VGMPlay, use the right arrow to seek forward if this doesn't funkify playback.) When the song reaches the end with these settings, it will loop with a fade of one minute; you'll have plenty of time to check if everything sounds right, and the trackbar position/playback percentage jumping to the start will let you know the exact moment where the song looped.

(For VGMPlay, you can specify config options (each one with -c) on the command line, so your normal playback settings can stay intact. To do as suggested above, use VGMPlay -c General.MaxLoops=1 -c General.FadeTime=60000 file.vgm.

(Alternatively, you can also put VGMPlay.ini files in your working folder that have the options you want set. If VGMPlay finds a file with that name with the VGMs, it'll use that instead.)

If after all this everything sounds good, then congratulations!

If not, something went wrong and you'll have to change your edit points to try again. Sometimes songs sound a bit off or weird, or a note gets cut or hangs. Moving the edit points around by the same few samples (commands willing) will usually avoid this. Keep trying, there's always a valid place! If you're having trouble finding an edit point at the exact place the song loops, you may try it in a different place, in a position later in the song where the sound wave drops to a quick silence, or perhaps just before a drum hit, etc. Anything easier to deal with is fine.

Keep in mind that, as long as it sounds right and it doesn't have excessive information, the trimming is good.


Once you think you've got the trimming correct, you'll proceed onto tagging. If you trim before you tag, you'll probably want all songs trimmed and good before you start that.

Tagging & Naming

With files trimmed correctly (or ready to be trimmed), it's time to tag them. Tagging files means filling up the VGM metadata information (called GD3), such as game name, original composer, release date, track title etc. It is also vital to get this as right and accurate as possible.

A common way to start tagging the songs is simply playing the game. Chances are you don't know who composed the soundtrack, so beating the game will not only make you aware of which song plays where, but will ultimately give you the game credits. So go ahead, load the game and have fun!

On the other hand, if you logged the songs during gameplay and followed the excellent naming advice I gave earlier, you're pretty much ready by now.

Just like with trimming, I've moved a lot of the tagging info to Filling Out the Tags and Text File, since this applies to all VGM packs; that tutorial tells you what you need to find, how to find it, what programs you can use to tag, and how to make a playlist of the VGMs (since you need you, both for the pack and to create the Song List in the TXT file!). The rest of this section, then, tells you what MD/Genesis-specific things you have to do/add.

Note: On Project 2612, the complete game name was discouraged for filenames. Here on VGMRips, it's usually the opposite: the complete game name is preferred, no matter how long it is.
Note: Older packs often have incomplete Package Histories: they're missing dates from when the packs were added/updated back on Project2612. If you're of a mind, it's both possible and appreciated to try digging through Project2612 timestamps/captures in the Wayback Machine, see if you can harvest them from pages or file dates inside packs, and preserve this information in the text file. (If a few dates are still missing, dummy dates can be used.) We now have a tutorial to help in this quest... but this can be tricky and sometimes impossible, so if you have no interest in doing this, you can ignore it.

System name

In both the TXT file and the VGM tags, this should be "Sega Mega Drive / Genesis". You shouldn't need to type it out in the latter: most of the tagging programs can fill this in for you quicker.

  • In VGMTool, just select it from the drop down menu and it will do you the favour of tagging the Japanese name for it as well.
  • For vgm_tag, use vgm_tag -System:SMD filename.vgm to get the same result.
  • In VGMToolbox, you have to set both names manually; the right Japanese name for Mega Drive / Genesis is at the very bottom of the drop-down list.

Music hardware

Often you'll be listing YM2612 and SEGA VDP PSG; these are common to most Genesis games. But double-check the chips listed by VGMPlay for any differences (other than VDP PSG being listed as just "Sega PSG"). If only one or the other is used, or if there are more/other chips used, make this section match what you see.

The date format

In older packs that haven't been touched up, you'll see a little discrepancy in date format; the US Team (Dimitri and Dark_Pulse) preferred the US standard MM/DD/YYYY format, and non-US people, DD/MM/YYYY or even YYYY-MM-DD.

On VGMRips, YYYY-MM-DD is the format decided on for consistency and clarity. If you're updating any sets and you notice the date uses slashes or has the Month and Day reversed, do fix them up and add dashes.

Complete Music Dump

You'll only see this line in older Genesis packs that you're reripping in BlastEm. As mentioned in that tutorial, if you do, get rid of it as it's not needed anymore in the new format.


Easy, huh? But you're not entirely done yet!

Naming the VGM files

Files are almost ready now, so it's about time you give them proper names. Our naming convention for VGM/VGZs is:

## Track Title.vgm

Where "##" is the playlist number of the track. (The file extension is of course .vgm or .vgz depending on whether it's GZipped.)

This too isn't something you should ever need to do by hand on each VGM; following along with the TXT and tag tutorial, you should already have an M3U playlist of all the tracks, and each track should have its English title filled. (You've also probably already used vgm_ren, too.) That's all you need to chuck the M3U into vgm_ren and have it rename the VGMs for you. It'll also update the M3U to use these new filenames.

The screenshot(s)

At the very least, there'll be one screenshot of the game's title screen in your pack. Sometimes different regions of the game have different title screens, an example being Castle of Illusion; we'd like those included. If your pack includes the game's beta songs, if any (ideal for smaller numbers of different/changed tracks), you should include screenshots of the beta's title screen as well - if it's different, of course.

(Also, if you're reripping a game, you probably should replace the existing screencaps with new ones, as those in older packs tend to be low-quality.)

Remove scanlines from the screenshot, but as with the VGM logs, be careful not to remove blank space that's part of the image. The correct resolution should be either of 320x224 or 256x224 (for NTSC), or 320x240 orMove 256x240 (for PAL).

Name your single screenshot with the game name (i.e., "Dynamite Headdy.png"), or name each of them with the right name as well as the region letter in parentheses (i.e., "Castle of Illusion (U).png" and "Fushigi no Oshiro Daibouken (J).png").

Now, use any of FileOptimizer, ImageOptim, or Trimage, or an equivalent to compress all the screenshots as small as possible. All these batch compressors run many compressing programs for you; they should include PNGOut in them, but get better results than PNGOut alone.


Now that everything's filled out the best you can, you're done! All you have to do now is optimise the files, zip them up and send it to us.

Optimising

Time for the optimisation, but first, a little background on this.

"A few months ago we decided to start Project2612 because we love Mega Drive/Genesis soundtracks, and because there wasn't a good place to find quality soundtracks anywhere. (And let's face it, GYMs suck!) There were plenty of GYM files out there, but they were big, inaccurate, didn't support loop or tags and just sounded terrible. There was no quality control or standard either. The only decent format for storing YM2612 data was VGM, but its good accuracy and no optimisation made files extremely large.

"Regardless of that, Project2612 was started, and soon had a big collection of soundtracks, some over 20 MB in size. (Pulseman, formerly the biggest set, was 29.6 MB!) Size had always been an issue and was holding the VGM popularity down, but it was all we had. But then some nice folks, namely blargg, came around with an idea to solve this, proposing a few changes on the format that would optimise file sizes tremendously.

"A couple of weeks of actual work resulted on the updated VGM format, 1.50, which now supports PCM sample banks. This new optimised version of the format was able to reduce file sizes tremendously, sometimes with over 75% of size reduction. This certainly removed the only barrier against VGM ruling as THE Mega Drive/Genesis music format, and all this is thanks to the following optimisation process you're going to use. :)"

The above refers to the program OptVGM. After this tutorial was first written in the days when dinosaurs were still getting rocks chucked at them by caveman ninjas, another compressing tool has been created: vgm_cmp. This compressor is lossy, and files it's used on will no longer work with vgm_trim. (A good thing, then, you'll only be using it on the trimmed files.) vgm_cmp must be used after optvgm, or you won't get optimum results.

You should already have both compressing tools, because you've already used vgm_trim. Copy them to the same directory as the VGMs. There's a handy batch (.BAT) file you can create which will use the tools in the correct order for you:

for %%f in (*_trimmed.vgm) do optvgm "%%f" "%%~nf.vgz" & vgm_cmp "%%~nf.vgz" & gzip.exe "%%~nf_optimized.vgm" & ren "%%~nf_optimized.vgm.gz" "%%~nf_optimized.vgz"

If you'd like to know brief details:

  1. For each VGM file with "_trimmed" at the end of the filename,
  2. run optvgm on it (with output file set to "[filename].vgz")
  3. then (&) run vgm_cmp on that (producing "[filename]_optimized.vgm")
  4. then run gzip on that (producing "[filename]_optimized.vgm.gz")
  5. and finally, ren(ame) that to "[filename]_optimized.vgz".

You may not already have gzip.exe. In that case, you can

  • just remove everything beyond the second "%%~nf.vgz" and send in the results. The VGMs will be properly GZipped during the finishing process after pack acceptance and before pack posting. That's the simplest option, but if you really want to do it yourself, then
  • get a copy of GZip,
  • change the "gzip.exe" part to use 7z gzipping instead (it should just be 7z a -tgzip if 7z is installed/pathed properly,
  • or do the first option but then use VGMToolbox's gzip compressor, under "Compression Tools". But beware! VGMToolbox won't rename the files to use .vgz for you, so you must do it yourself.

(Either way, your final results will always end with "_trimmed_optimized", VGM or VGZ.)

With the VGM files optimised, you can delete the copies of the optimizers. Now you should make it so all your final optimized files are the only vgms/vgzs inside their folder, and run vgm_name there to clean up all the suffix gunk.

Once that's done, all you have to do now is pack the files up.

Packing & Uploading

With your VGM files trimmed, tagged, named and optimised, all you need now is to pack the files together as a soundtrack pack. Just compress all the files in a .zip file; for clarity, name this zip file after the full game name.

  • If your pack is new (that is, not an update to an existing pack), make a thread for it on the Submissions board. Note that this board closes when 100 non-stickied topics are posted and won't reopen until the queue is much clearer.
  • Updates to any packs should go in the Pack Update Topic. Even if the Submissions forum is closed, you can still add updates to this thread.

If the pack is small enough, you can upload it directly there as you post. Otherwise, it is recommended to upload the .zip to a site like Dropbox or MEGA.nz and include a link in your thread/post.

Further Notes

  • We do not guarantee your pack will be accepted and included on the website at all, and there's a chance we request you to completely redo the pack. This will depend solely on the quality of your work.
  • You don't always have to rip, trim and tag everything yourself. You might find someone in the chatroom that's willing to do part of the process for you.
  • And again, if you have any questions or if you need any help, just join our IRC.

External Links