Skip to content

VGM Tool Collection

All you need to work with VGMs. Last update: 2022-12-30

Technical discussion about the VGM format, and all the software you need to handle VGM files.

Moderator: Staff

  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Code: Select all

0x000000C3: B3 16 00    GB DMG:		Sound Off
...
0x000000CF: B3 14 FF    GB DMG:		Master Volume L: 7 = 100%, Volume R: 7 = 100%
...
0x0000010E: B3 16 FF    GB DMG:		Sound On (Reset Chip if chip was disabled)
0x00000111: B3 14 FF    GB DMG:		Master Volume L: 7 = 100%, Volume R: 7 = 100%
It handles the "Sound Off/On" command incorrectly. That one resets the complete sound chip when turning it off and on again and vgm_cmp doesn't handle that case.

About that PC-8801 trimming issue: I made a somewhat hackish fix for it in vgm_trim, but I still need to fix a timing issue I introduced after the last release.

Post by Sonic of 8! »

ValleyBell wrote:It handles the "Sound Off/On" command incorrectly. That one resets the complete sound chip when turning it off and on again and vgm_cmp doesn't handle that case.
It means that I can rip it, but cannot optmise... It is strange, because in DKL 2, DKL 3 and GBC Donkey Kong Country does not have this problem found in DKL (GBC DKC re-uses most of DKL musics, as well some ones from DKL 2 and DKL 3).
オモいカルチャーをオモチャーと言う - 細野晴臣

Post by GTheGuardian »

Another vgm_cmp OPX bug, now the Guitars in F1 Super Battle log sound weird after optimizing the file.

https://www.dropbox.com/s/351xevwh3btfy ... trimmed.7z

Post by vampirefrog »

I'd like to make a few requests:

1. On this thread, please add a description after each tool. So instead of
ValleyBell wrote: Current tool list:
dro2vgm, optvgmrf, vgm_cmp ...
you can write:
ValleyBell wrote: Current tool list:
dro2vgm - Drowns two vegan monks,
optvgmrf - Opens tomb of vortigaunt mistery friend
vgm_cmp - Very green monster comparison
...
2. Have the tools behave more 'normally', like unix commands. So instead of vgm_cmp waiting for user input of parameters and after it has finished, add some command-line options such as:

Code: Select all

-o --output  Output file
-s --start  Start sample
-e --end  End sample
-l --loop  Loop sample
-a --auto  Detect and remove silence from start and end automatically
-h --help  Display help
-v --version  Display version
and remove the wait-for-key at the end. For that sort of thing, use a batch file that reads input and then runs vgm_cmp at the end. Have sane defaults for -e and -l (-2 -1).

3. vgm_cmp (or another tool) should detect and remove silence. I know there are some initialization commands separated by waits, but the silence can be removed intelligently, even if it ends up being chip-specific. Just error out or don't remove any silence if the chip is not supported for auto silence removal. I would suggest supporting YM2151 and MSM6258 for starters, since that is what I need.

Post by vampirefrog »

Also, is there a way to make vgm2txt output to stdout? If not, can you add this option?
  • User avatar
  • MaliceX Offline
  • Posts: 226
  • Joined: 2012-09-29, 11:45:48
  • Location: Australia
  • Contact:

Post by MaliceX »

vampirefrog wrote:Also, is there a way to make vgm2txt output to stdout? If not, can you add this option?
10MB-150MB of text flushing to console... Do you really want that? :o You could always fiddle with the source code to make it happen, seeing as you're using MinGW.
-dj.tuBIG/MaliceX

Post by vampirefrog »

MaliceX wrote:
vampirefrog wrote:Also, is there a way to make vgm2txt output to stdout? If not, can you add this option?
10MB-150MB of text flushing to console... Do you really want that? :o You could always fiddle with the source code to make it happen, seeing as you're using MinGW.
It's a nice option to have. I am dumping small VGM files, a few seconds worth of data, and I'm piping it to less.

Post by GTheGuardian »

https://www.dropbox.com/s/myt1scjm193ku ... trimmed.7z
vgm_cmp now causes OPL3 to be silent after running it on this VGM.
Last edited by GTheGuardian on 2014-04-13, 22:08:45, edited 1 time in total.
  • User avatar
  • 2ch-H Offline
  • Posts: 280
  • Joined: 2012-01-03, 2:10:28

Post by 2ch-H »

vgm_trim bug?
ADPCM is silent when I use the vgm_trim. (Or it becomes correctly in opt_oki?)

This VGM sample, Syvalion (X68000) - Main Theme:
Edit: I delete file.

Code: Select all

vgm_trim -state "Main Theme.vgm" 352950 354398 3155251
Last edited by 2ch-H on 2014-05-09, 12:29:06, edited 1 time in total.
  • muteKi Offline
  • Posts: 17
  • Joined: 2012-07-10, 3:53:51

Post by muteKi »

I had a vaguely similar issue when I was making the Turbo Outrun rip -- if you're setting the trim point too close to when the song starts you can end up cutting out some initialization data. Not sure if that's what's causing it but you might want to try setting the trim point a little earlier (probably not more than a few frames) to test it.

Post by The Golden Horse »

As I look into how to do Duke Nukem II, I'm sorry to report that imf2vgm does not convert its instruments correctly.

For example, here's "Duke Kicks Ass" (kickbuta.imf) as it plays in-game:
http://www.vgmpf.com/Wiki/index.php?tit ... ks_Ass.ogg

And here's how it plays after using imf2vgm on it:
[link removed]
Last edited by The Golden Horse on 2014-05-02, 22:49:13, edited 1 time in total.
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Sorry for the late reply.
2ch-H wrote:vgm_trim bug?
ADPCM is silent when I use the vgm_trim.
It looks like the "Play" command (B7 00 02) is missing, so the chip never starts playback.
vgm_trim is supposed to copy that one to the new VGM, so I'll need to investigage that.
The Green Herring wrote:As I look into how to do Duke Nukem II, I'm sorry to report that imf2vgm does not convert its instruments correctly.
The imf2vgm conversion is very direct (and lossless), but it just came to my mind that there is one thing that may be missing.
Try to insert a "Waveform Enable" command (5A 01 20) at the beginning of the file and see if it sounds better.

The driver may write this command during the initialization phase, so the songs lack it.

Post by The Golden Horse »

ValleyBell wrote:The imf2vgm conversion is very direct (and lossless), but it just came to my mind that there is one thing that may be missing.
Try to insert a "Waveform Enable" command (5A 01 20) at the beginning of the file and see if it sounds better.

The driver may write this command during the initialization phase, so the songs lack it.
Ah! That was the problem. The resulting file: [link removed]

Which sounds identical to how it sounds when I record a DRO file and convert it:
[link removed]
This starts with me opening the main menu and restoring a saved game to show the reason I need imf2vgm in the first place: there's no space to split a source file for recording most of the tracks in-game and some of them can never be heard in their entirety (e.g. the loading screen music you hear after the main menu music in the recording, unless your computer is really slow).

Thank you! I can now proceed with the project. :)
Last edited by The Golden Horse on 2014-05-02, 22:49:31, edited 1 time in total.
  • User avatar
  • 2ch-H Offline
  • Posts: 280
  • Joined: 2012-01-03, 2:10:28

Post by 2ch-H »

ValleyBell wrote:It looks like the "Play" command (B7 00 02) is missing, so the chip never starts playback.
vgm_trim is supposed to copy that one to the new VGM, so I'll need to investigage that.
Thank you, VGM is working in add a play command.

Another problem.
I noticed that the sound is goes wrong with vgm_cmp.

This VGM sample, Arcade Donkey Kong 3 - Clear A:
https://www.dropbox.com/s/k2cpd8stk8sw4 ... Clear_A.7z
06 Clear A.vgm - Original file
06 Clear A_optimized.vgm - Use vgm_cmp

Same cause Mach Rider and Donkey Kong?

Post by GTheGuardian »

2ch-H wrote: Another problem.
I noticed that the sound is goes wrong with vgm_cmp.

This VGM sample, Arcade Donkey Kong 3 - Clear A:
https://www.dropbox.com/s/k2cpd8stk8sw4 ... Clear_A.7z
Just throught I'd say it but I noticed that the optimized VGM seems to sound same as the unoptimized one if the sound core is set to MAME. Same case with Mach Rider and Donkey Kong.

EDIT: Also, I noticed that vgm_sro does seems to have Trouble optimizing Viper Phase 1 VGMs - It crashes instantly.
Example: https://www.dropbox.com/s/6nbxpcqrkoqiy ... rimmed.vgm
Post Reply