This is the most important and the hardest part of the whole process. You should already be familiar with your sound editor in order to do this step properly and quickly, so if you still have no experience with it, it suggested you toy with it for a while.

Writing the WAV file

In order to know where to trim, you will need to output a WAV file. You do this by using Winamp, the VGM input plugin and the Disk Writer output plugin. You should probably have them all by now anyway.

Here's what you do:

  1. Run Winamp
  2. Press CTRL+P to open the prefence screen, and then go to the "output" section
  3. Select the "Nullsoft Disk Writer plug-in" from the output list (if you don't have it, download the full version of Winamp, which has it bundled)
  4. Click on the configure button below the list and set the output directory. Also, make sure you select the proper output format: PCM, 16 Bit, Stereo, 44.100 kHz. Just make sure the option "kill null samples" is disabled, because the file won't give you correct times if any samples are removed.
  5. Now go to the input section and configure the VGM input plugin. Set the option "pause after non-looped tracks" to zero.
  6. If shuffle, repeat, the equalizer or any DSP plugin is activated, turn them off. They won't do you any good here.
  7. Now just drop the file(s) into Winamp and play them. You won't hear a thing because the audio is being written to your hard drive. This process will be very resource-intensive and will probably slow down your computer for a while (depending of the size of the VGMs), and the resulting WAV file(s) will be very large, but you will soon get rid of them.
  8. Once Winamp is done writing the files, press CTRL+P again and turn the output plugin back to what was it before you changed it to the disk writer. This way you can listen to files again.

Good! So now you have the WAV file. Now, open it with your sound editor and take a listen. This is what the VGM currently sounds like. You'll have now to look for the exact time where the song starts, finishes and where it jumps to when it loops. These are the three numbers you'll be looking for here: start, loop and finish, and there are three possible cases of these values showing up.

Type 1 - no loop

These are songs that play just once and then stop in a silence, that is, there is no loop point. Theme, game over and intro songs are usually of this type. Here's an example from Aladdin, "Ne Naw Tune":

♪ listen to this ♪

As you can see, the song is complete on its own. There's a leading silence at the beginning of the VGM (black area), and we'll cut this off by placing the start marker (yellow line) closer to where the sound actually begins. On the other hand, the music finishes without extra silence (see note below), and hence the finish marker (red line) is at the very end. Naturally, sometimes you'll have to cut extra silence or sound after the song finishes as well.

Note: to generate silence, the games send wait comands to the sound chip when all the registers are null. Some songs don't send anything at all once they finished playing, so the VGM won't have anything else logged after the song is finished either. The ending of the file will then be the exact end of the song as well.

Type 2 - entire song loops (loop = start)

The second type of music you'll find is when the entire song loops. That means it doesn't have any intro, and then the song just starts over once it finishes playing. Here's an example, also from Aladdin, "Storyline":

♪ listen to this ♪

As you can see (and listen), the song drops to a silence and begins all over again. The start marker (yellow) is just at the start of the song (removing a leading silence at the beginning), and the ending marker (red) is at the exact place where the song starts again. Trimming like this will remove the redundant data after the red marker and the unwanted silence at the beginning.

Type 3 - songs with intro and loops (loop ≠ start)

The third type happens when the song has an intro part which plays only once. In this case, the loop point is different than the start point. Here's an example from Ghouls 'n Ghosts, the first boss (Shielder) battle song:

♪ listen to this ♪

This time we have three different edit points. The start marker (yellow) cuts a tiny bit of leading silence at the beginning. What follows is a small intro (colored in light yellow), which then introduces the part of the song that repeats (in lime green). This is the loop point, marked here with a cyan line. The finish marker (red) is positioned at the exact point the song loops later on, trimming the repeated part that comes afterwards (the second loop logged).

Finding the correct edit points

Now you know what you're looking for, you'll have to find the precise times for these makers. This time value should be in samples, not seconds. VGM stores data at a resolution of 44100 samples per second (hence, 44.1Hz), and this is why it was important to write the WAV file at this sample rate: you'll get the numbers you need right away. The default time values you'll get with a sound editor are in seconds, minutes and so on, and these numbers are hard to work with. So, to change to sample mode: Now the program is giving you what you need, the position of the selection markers in samples.

Now go ahead, play the WAV file on your sound editor and find where the song starts. Select the part of the sound around this spot and zoom to fit the view (GoldWave: SHIFT+S, Audacity: CTRL+E). Zooming in lets you get more precise values. Keep zooming until you get a nice, close look at the sound wave.

This is the start of the Ghouls 'n Ghosts song in a close zoom. You can have a good look at the sound wave at this scale, but it's not abusively close either. As you probably noticed, the start marker (yellow) is set a few samples away from the first noticeable changes in the wave. This is important because we don't want to trim out the starting commands at the beginning of the music, so we always give a bit of a space. Here's a hint: any space or gap below 500 samples is not noticed by the human ear at all. The above space is only 50 samples, which is less than 2 miliseconds in length!

Also worth noticing, some sounds actually start long before you can actually see them at this amplitude scale. You can extrapolate the sound wave on the amplitude axis with the sound editor and see where the sound actually starts. The command for this is CTRL+UP and CTRL+DOWN on GoldWave and Right Click and Left Click on the amplitude scale on Audacity.

This is the last sound wave with expanded amplitude. The tiny bump you noticed before is now a big obvious hump pointing down. Doing this is a good way to find silence gaps in songs, which make good and safer edit points. You can also make your sound editor "snap" to these zero-crossings. Just hit Z under Audacity or go to Edit > Marker, under GoldWave, and select "snap to zero crossing".

Anyway, once you placed the selection marker at the appropriated position, check the status bar on you sound editor. In GoldWave, the status bar will give you numbers like "selection-start to selection-end (selection-size smp)". Audacity will give you "start - end (size samples)". Get the number that is where you want (depending on how you selected) and write it down as the start position. Discard the commas. Do the same thing with the end and loop points, listen carefully to the sound at these points and see if they're correct. If they are, it's time to do the actual trimming.

Trimming with VGM Tool

the trimming tab on VGM Tool 2 Release 5

Open VGM Tool and drop the VGM file you want to trim over it (just drag it from within the folder and drop it over the program). VGM Tool will then load the file.

Select the "Trim/optmise" tab and feed the numbers you've found on the appropriate editboxes. If the song has a loop, check the "Include looping" option, and if not, leave it unchecked (the loop point value will be ignored then). You might want to keep a log of the edit points too, just in case something goes wrong. In case you're wondering, the optimise option and the "round times" over there are useless for Mega Drive\Genesis songs. Ignore them.

Once you have your values in place, hit the trim button and let VGM Tool do his thing. This can be a heavy process and might take a while, maybe even hang your computer for a few seconds, so don't panic. Once the file is trimmed, VGM Tool will ask you if you want to open the file in Winamp. Say yes and check if everything is sounding good. Take special attention at the start, loop and ending points.

Here's an excellent hint to help you on checking your trim and loops: configure 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. Whenever the song reaches the end in Winamp, it will loop with a fade of one minute, so you'll have plenty of time to check if everything sounds right, and the trackbar position jumping to the start will let you know the exact moment where the song looped.

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 agan. Sometimes songs sound a bit off or weird, or a note gets cut or hangs. Moving the edit points around a few samples 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 correctly, you'll proceed onto tagging. You'll probably want all songs trimmed and good before you start this, though.

<< Logging | Tagging & Naming >>

(Getting started|Logging|Trimming|Tagging & Naming|Optimising|Packing & Uploading|Further notes|Basic Hacking)