VGM Tools

From vgmrips

Over the years various programs have been written to work with different aspects of VGM files, beginning with the original all-in-one VGMTool by Maxim. An update to the original VGMTool (tagged as version 2R6) was released by NeoLogiX to resolve YM2612 and YM2151 processing issues, but was found to have numerous other bugs (including buggy support for the particular UTF-16/UCS2 used for GD3 tagging) that rendered it unsuitable for widespread use. Blargg's optvgm, as updated by Valley Bell, is still used today for YM2612 VGMs.

Valley Bell currently releases the most up-to-date tools for working with VGMs, though they are all command-line. For most of the tools, you can specify an output file:

tool.exe "input.vgm" "output.vgm"

If vgm tools are not working, make sure either of these is true:

  • There's no spaces in the path (folders + filename). E.g., C:/folders/containing/vgms/example.vgm.
  • If there are spaces, that the path is surrounded by quotes. E.g., "C:/vgms/another example.vgm".

Or, you can drag and drop your files directly onto the tools.

Some, like vgm_ptch and vgm_tag, accept and can modify multiple files; others process only one file per launch, even if you drop multiple files. The latter accept a second filename, which creates a new file with the tool output (if the default is to modify in-place) or determines the name of the file it creates.

Tools by Valley Bell

Command-line tools dacopt, dro2vgm, opt_oki, optvgm, optvgmrf, vgm_cmp, vgm_cnt, vgm_dbc, vgm_facc, vgm_ndlz, vgm_ptch, vgm_ren, vgm_smp1, vgm_sptd, vgm_spts, vgm_sro, vgm_stat, vgm_tag, vgm_trim, vgm_tt, vgm_vol, vgm2txt, vgmlpfnd, vgmmerge
Please refer to the Readme (or individual pages linked above) for further information on what the tools do and how they are used.
For the most up-to-date versions, please visit the official release thread or the GitHub Repository.
vgm2mid
The most recent update to Paul Jensen's original VB6-based VGM2MID; handles most VGM v1.51 and a few 1.61 chips.

Compiling

All source files compile with MS VC++ 6.0, but they should also compile with any other 32-bit compiler. GCC / MinGW should build with little issue; when using Visual Studio, you may need to build zlib manually first.

It should also work with 64-bit compilers, but this wasn't tested.

Some tools need additional c-files. These are:

Tool Additional Files
vgm_cmp chip_cmp.c
vgm_sptd vgm_trml.c
vgm_spts vgm_trml.c
vgm_sro chip_srom.c
vgm_trim vgm_trml.c
vgm2txt chiptext.c

The source is best viewed with 4-space tabs. Lines are up to 96 characters long.

Tools by NeoLogiX

vgm2pre
official release thread | open beta thread
Win64 binary | Win32 binary | source
vgm2pre is a program to save instrument presets from VGMs to formats usable in various trackers and sequencers. It currently dumps FM presets from VGMs with YM2612 data.
YM2612 FM presets can be dumped to VGI, TFI, TYI, EIF, DMP, Y12, and GYB formats.
vgm2mid, Sphere edition
A port of Paul Jensen's original VGM2MID program to JavaScript; due to its reliance on Sphere's file APIs it only runs in the Sphere engine.
NeoLogiX has plans to port the script to web-compatible JavaScript, though no date has been given for its release.
VGMTool v3
source
As early as 2012 NeoLogiX announced plans to completely revamp VGMTool for modern systems with the goal of making the codebase easier to update and maintain than the original Win32-only VGMTool source. Though he released screenshots of work-in-progress to garner attention and has uploaded source code to it, development is not complete. Release date is currently unknown.

When to use vgm_sro vs optvgmrf?

[Posted verbatim from the IRC for now.]

<Gnome> Btw, is optvgmrf obsolete now or something? I thought that's what should be used on RF packs
<BoxCubed> No, vgm_sro for FMT is used to get rid of dummy data.
<VB|work> vgm_sro = a single sample ROM block
<VB|work> optvgmrf = when the game streams data in realtime
<VB|work> so vgm_sro is used when the game preloads data
<VB|work> sorry, I don't have an exe at hand right now
<BoxCubed> ah, but it also gets rid of excess 0xFF writes, right?
<VB|work> yes
<VB|work> and ... it used to get rid of too many of them
<VB|work> causing the bug that GTG had
<Gnome> Does the order in which they're used matter?
<VB|work> You use only one of them.
<Gnome> Oh so on FMT we use sro
<VB|work> I tihnk vgm_sro refuses the file if data is streamed.
<Gnome> Optrf for Sega arcades
<VB|work> FMT *may* stream data
<VB|work> but I think just trying vgm_sro first works
<VB|work> of vgm_sro accepts it, then use it
<VB|work> if it refuses and complains about streamed data, use optvgmrf
<BoxCubed> it's vgm_sro -> optvgmrf
<Gnome> Well the raw log was pretty small, so no streamed data I believe
<VB|work> On the Sega MegaCD for example, the Japanese BIOS had static samples
<VB|work> but the US BIOS streamed data
<BoxCubed> I helped marklincadet with this when he was working on Dengeki Nurse
<VB|work> So it doesn't depend on the platform, but mostly on the sound driver.
<VB|work> (or how the sound driver is used, in case of MCD SMPS)
<VB|work> All the tooling is unfortunately not very obvious
<VB|work> but I never found the time and passion to write a proper guide to "when to use which tool"