·( VGM Optimising )·

What you'll need


VGM Header

If you made the file using Meka, these entries should already be correct, in line with the VGM 1.01 specification; if you used Dega, they won't.

To make the file VGM 1.01 compliant:

Alternatively, press the Detect button. This will scan through the file, looking for 1-frame wait commands; when it finds one, it will see if it corresponds to a 50Hz or 60Hz file. It will also update the VGM version, unless the value is greater than 1.01.

Finally, click on Update header to write the new header to the file.


Removing offsets

When you look at a VGM file's output WAV file you might notice that sometimes, the waveform is offset from the centre line. For example (Out Run 3D Magical Sound Shower):

In the areas I've marked in red, the waveform has deviated from the centre. The technical reason for this is, the PSG has had one or more channels set to a zero (or very low) frequency value, which stops it outputting any sound; but the volume has not been set to zero. This effect is used by some games to play samples (voices), so it cannot be automatically removed from every file, just those without samples.

If there is an offset affecting music, it is noticeable as most speakers don't operate as efficiently when there is an offset to the audio. So it is desirable to remove it if possible. To do this, check the Remove silent PSG/offsets box and click on Optimise. The results message box will tell you how many offsets have been removed.

Remember, removing offsets will also remove sampled sounds!


Removing unnecessary data

It is quite common for a game playing PSG music to write to the FM chip, or vice versa. The data it writes will be included in the VGM, but it does not produce any sound. So,

There is also a problem with some emulators producing VGM files containing data for unused chips.

Additionally, it is common for there to be data in a VGM file which produces no output. It is difficult to reliably detect these problems in code, which is why you are needed.

Whenever a file is loaded, the data is analysed and the number of writes to each channel of each chip is counted. If a channel has no writes then its checkbox will be disabled, otherwise the number will be displayed next to the checkbox.

The All button will check all the checkboxes, although there's very little point stripping all data. The None will deselect all of them - again, there's no point stripping no data. The Invert button will invert the selection - checked become unchecked and vice versa. Guess will do a very basic guess as to which channels should be removed - all it does is select the channels which are used less than 2% as much as the most commonly used channel for that chip.

Note that the YM2413 uses channels 6 to 8 as dual-purpose channels, as the data in the corresponding chip registers also affects the rhythm mode instruments (percussion). So, when stripping those channels you'll ususally find that not all of the data is removed.

When you have selected the channels you want to remove, click on Strip checked to remove them. Because this is a destructive process, the data will always be output to a new filename, based on the old. You should check that no necessary data has been removed.

One way to check to see if channels can be safely removed is to remove all channels except the ones you think can be removed, then write the output VGM to a wave file. You can look very quickly in a wave editor to see if it is a flat line or not.


Optimising existing VGMs

What if you're an existing VGM pack creator? Wouldn't you like to take advantage of some of the new features of VGMTool, such as VGM data optimisation? Well, it's easy: if you want to remove the offsets or strip unnecessary data, both those functions will automatically pass the data through the optimiser anyway. If you don't happen to want to do that, just use the Optimise button with the offset removal turned off.

< 3. Tagging5. Packing >



Return to How to make VGM music files and packs
Return to VGM Tools
Return to Music
Return to SMS Power