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
  • kyusawamura Offline
  • Posts: 33
  • Joined: 2015-06-08, 20:42:22
  • Location: Argentina
  • Contact:

Post by kyusawamura »

Hey, ValleyBell! I hope you're doing well.

I have a doubt. Is it actually possible to remove activity from certain channels on a Sega Mega Drive VGM, more specifically, YM2612 channels? I'm logging VGMs from a game I know that uses a certain channel for sound effects, and I could have only the music playing normally just by removing the activity from that channel. I read somewhere, doing a keyword search on the forum, that channel stripping isn't yet possible for the YM2612 with vgm_ptch; I tried with VGMTool 2r6 and I still have no idea what it does, if I'm doing it right or wrong, or if it's actually reliable or not. I would really appreciate some feedback on this.

Thanks in advance!
  • User avatar
  • ValleyBell Offline
  • Posts: 4767
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Actually, the preferred way would be to get someone to hack the game for you to prevent SFX from playing at all.
SFX mute music channels temporarily (in most sound drivers), so logging a VGM that includes SFX involves losing a part of the music already. (We have this problem with the current VGM rip of [pack] Bonanza Bros., btw.)
  • User avatar
  • kyusawamura Offline
  • Posts: 33
  • Joined: 2015-06-08, 20:42:22
  • Location: Argentina
  • Contact:

Post by kyusawamura »

Well, yes, that's what I want to do primarily, but it'll take me a while to learn to hack and I don't want to have to pester someone to do it for me every time I want to make a rip.
These songs I wanted to rip, I already made sure that they don't play any music notes in the SFX assigned channel so there would be no interferences. In any case, hacking the game will still be the optimal solution.

Thanks for your feedback!
  • User avatar
  • ValleyBell Offline
  • Posts: 4767
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Please don't use vgm_cmp on GameBoy VGMs until there is an update.
The current version of vgm_cmp was written with the old (inaccurate) GameBoy core in mind and optimized VGMs play half-broken with the new GB core used by the most recent VGMPlay update.

Post by The Golden Horse »

Attempting to use vgm_sro on Sound ID E4 from Ninja Master's ("Karasu Ending") results in vgm_sro crashing without an error message (besides "vgm_sro.exe has stopped working").

Raw recording from power on:
https://www.dropbox.com/s/75c2mr1jkueir ... 4.vgm?dl=1
  • User avatar
  • ValleyBell Offline
  • Posts: 4767
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Bug found and fixed. You can get an updated version of vgm_sro (and vgm_cmp with "fixed" GameBoy support) here.

btw: The reason it crashed was that I forgot a check for (sample end address < sample start address).

Post by The Golden Horse »

Using vgm_cmp on VGMs that use the OKI M6295 "Set Master Clock" command, such as some Data East games, will strip the command from the file, causing OKI samples that require an altered master clock to not play correctly.

Examples follow:

Captain America and The Avengers, "Scene 1: 'The Avengers'":
Before - https://www.dropbox.com/s/8zsck1578s291 ... .vgm?raw=1
After - https://www.dropbox.com/s/efhgmpvn1itf6 ... .vgm?raw=1

Desert Assault / Thunder Zone, "Operation Thunder Zone":
Before - https://www.dropbox.com/s/165lsfw1rvxxn ... .vgm?raw=1
After - https://www.dropbox.com/s/s8xe5f4x4bvgo ... .vgm?raw=1
  • Wanny Offline
  • Posts: 1
  • Joined: 2018-04-01, 0:56:56

Post by Wanny »

Whoa, this sure is an old topic and it's still going?

I'm trying to convert the Boss tune from Snow Bros (whose chip is YM3812) using vgm2mid 0.5 r61... and quite a bunch of instruments/tracks aren't converted (specially the bassline of the 2nd half of the song) so the resulting MIDI sounds "empty" in comparison.
I don't know what to do from here D;

EDIT: OH DAMN. Thanks to in_vgm I noticed that the bassline is actually done in the BASS DRUM channel. There should be a way to convert it to a regular instrument track instead of a drum one... hmmm.
  • kirishima Offline
  • Posts: 82
  • Joined: 2015-06-18, 22:26:41

Post by kirishima »

I've had a question for a long time. Is it possible to log vgm_stat's text to a text file? I have a couple Neo Geo rips that I've been sitting on too long, but never got around to making description files for them because I no longer have the patience to type all the timing stuff out for that stuff anymore, plus I need to start limiting how much computer screen time I'm getting(hurts my eyes). I haven't looked through this thread for an answer, so if it has been answered, please just point me to it.
  • Tom Offline
  • Ragequit Member
    Ragequit Member
  • Posts: 496
  • Joined: 2011-11-30, 17:26:44
  • Location: Italy
  • Contact:

Post by Tom »

Step 0: open a command prompt and navigate to the directory where your vgm files are. If you don't know how, look for "chdir" on Google.

Step 1: make sure you have a playlist to go along with your files in the same directory. If you don't have one yet, you can create it by typing:

Code: Select all

C:\SOMETHING>dir *.vg? /b > playlist.m3u
There are other ways to create it of course, and you can add/remove files later. Note: "playlist.m3u" is a generic placeholder name; ideally you should name it according to the naming conventions (e.g. the name of the game or something, it's been years since I made a pack), but make sure to retain the ".m3u" extension.

Step 2: once the playlist is in place and it contains all the files of your pack, you can type:

Code: Select all

C:\SOMETHING>vgm_stat.exe playlist.m3u > mytext.txt
Once again, "mytext.txt" is a generic placeholder, rename it all you want, but keep the ".txt" extension.

Step 3: ?????

Step 4: profit!
Also known as nineko.
  • kirishima Offline
  • Posts: 82
  • Joined: 2015-06-18, 22:26:41

Post by kirishima »

@Tom

Thanks. That command worked as a bat file.

Post by nitrofurano »

about vgm2txt, how far is going the log of germanic notation info on the frequencies of all supported sound chips? and how can we help there?
(i think it is important, because it helps us to study/analise better these chiptunes, convert them more easily from one soundchip to another like from ym3812 to ym2413 or sn76489, etc. ) - and would be awesome seeing vgmplay playing also these txt files generated from vgm2txt (i guess it would be not that impossible, since all information can be there in both binary and text formats) - and how can we help there, if needed?
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

nitrofurano wrote:the log of germanic notation info on the frequencies of all supported sound chips? and how can we help there?
It's not very hard, but it's also not a big priority. You're welcome to help by submitting pull requests in our GitHub repository.

Anyway, if you plan on writing your own converters; first you have to figure out the frequency from the values written to the registers by the VGM. Then you can use a logarithm to get the difference in semitones from dividing your frequency with a reference frequency (such as A4=440hz in the example below).

Code: Select all

12.0*log2(523.25/440.0)
.
After that, converting the note numbers to alphabetic notation is trivial.
nitrofurano wrote:would be awesome seeing vgmplay playing also these txt files generated from vgm2txt (i guess it would be not that impossible, since all information can be there in both binary and text formats) - and how can we help there, if needed?
This probably won't happen. Also some information is lost by vgm2txt, such as datablock contents and the hexadecimal raw data of commands longer than 4 bytes (including the command word itself).
  • User avatar
  • kyusawamura Offline
  • Posts: 33
  • Joined: 2015-06-08, 20:42:22
  • Location: Argentina
  • Contact:

Post by kyusawamura »

Hey ValleyBell!

I have a question; would it be possible to update vgm_trim so that there's an option to save the state of the chip(s) in the looping point and not just the starting point? I keep having issues with sound drivers that use dynamic channel allocation. It used to be just a GEMS problem before but now I'm also experiencing it in MIDI based drivers in DOS games - doesn't matter where I place the loop points, it won't change instruments properly or it will do weird bugs.

Thanks in advance!
  • User avatar
  • ValleyBell Offline
  • Posts: 4767
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

I'm afraid I'll deny this request.

Save states at loop points would be a pretty dangerous thing and will likely introduce artifacts unless you know *exactly* what you are doing.
The main problem is, that reloading an earlier state of the sound chip may cut and restart notes due to changed channels. (example: instrument A was playing on channel 1 when entering the loop and is playing on channel 2 at the end. Reloading will stop ch2 and restart ch1.)
Sustaining notes can get their sound modified as well due to changed instrument parameters.

The only real solution for dynamic allocation is to search for a point where no note is playing (hopefully that happens somewhere in the song) and cutting there.
Of course it gets more difficult when the sound driver optimizes register writes. (That's probably the case for you, hinted by improper/missing instrument changes.) In that case you'll just have to ask for help in the chat/IRC.
The GEMS driver has really been nice in regard to such issues. It tries to keep the MIDI <-> hardware channel assignment constant, it resends all instrument data for every note and it never optimizes anything. Optimizing happens a lot more with DOS games, because writing to the OPL2 is slow. (And there is more RAM, so keeping a copy of all registers is no problem.)
Post Reply