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

Post by nitrofurano »

ctr wrote:
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.
i'm a github boycotter - i migrated everything i had there to gitlab, and then i deleted everything from my github account and closed it - so i hope there are more alternative ways available to contribute with code...

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.
thanks!

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.
"It always seems impossible until it’s done" (Nelson Mandela)

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).
would be great if the vgm2txt could be rearranged for allowing it being possible

my proposal is to have the resulting text line starts just like merely hexdumps (all information, including those you mentioned were lost), and then, commented, what are these hexdumps about (everything mentioned in the vgm specification, address, registers, frequencies, germanic notation, volume, and etc.) - having it done, would be a lot easier fot these txt files being playable - and more, would be far easier to develop converters (like mod to vgm and back, ay-3-8910 to ym2203 and back and obviously considering the resulting information lost ), and so on - that would even allow us to compose or fix vgm files using text editors if needed --- just imagine how neat and useful would be having the text result from vgm2txt this way

Post by vampirefrog »

I host my own git repo with gogs, but I don't mind mirroring on github.
  • TheYokai Offline
  • Posts: 5
  • Joined: 2018-06-22, 5:11:41

Post by TheYokai »

I'm curious to know if anyone has any examples / source of ripping wavetables (GBA) or samples (GEN/NES PCM, Arcade Samples) from a vgm file and exporting to a wav file. I'm kind of curious to know how to properly do such a feature for my own personal tools.
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

The vgmtools do not have any programs for ripping samples from vgm files. For PCM samples, try audacity. If you want to discuss a tool for automatically ripping samples, consider making a new thread.
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Looking at vgm_sro might be a good idea when you want to extract samples.
During the process, it goes through the whole VGM and creates a mask of used sample data. And in order to do so, it calculates all the sample start/end offsets.
  • kirishima Offline
  • Posts: 82
  • Joined: 2015-06-18, 22:26:41

Post by kirishima »

Is there anything can be done to further reduce the size of a Megadrive vgm ripped with Mame .200? I used it to rerip Streets of Rage, and after trimming and compressing (both the vgm_cmp and gzip), one if the files still ended up larger than 1 mb which seems kinda odd to me since it doesn't seem more pcm heavy than any other typical megadrive game.

(Asking here because I'm not a member of project2612)
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

For MegaDrive rips (and only for those), there is an optvgm tool.
See the Project2612 tutorial for instructions.

I recommend to run optvgm before running vgm_cmp, because it doesn't like some of the optimizations that vgm_cmp does.
  • VGM_CODE Offline
  • Posts: 1
  • Joined: 2019-09-01, 10:58:21

Post by VGM_CODE »

I tried to give https://vgmrips.net/wiki/VGM_Specification as well as vgm2txt a grock. Let's just say it numbed my eyes a smidge. (How am I supposed to know the end time for example?) I see mml2vgm... what are the odds (or can you recommend a method to do similar) of vgm2mml popping up? vgmtrans maybe seemed like a method from getting "vgm2midi" and then taking "midi2mml" from there, can you recommend a better way if vgm2mml (or txt2mml) isn't on your roadmap?
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

MML conversion I think is even harder than MIDI, since all timing information (BPM, time signature, etc) is lost in VGM files. To generate human-readable MML files you'd at least have to know the song's tempo and any eventual tick offset. With MIDI it is still important but not absolutely required as the piano roll usually looks ok even if the tempo doesn't match.

Vgm2txt is mostly useful for debugging VGM files (broken loop point, emulator development) as well as FM patch or PCM sample ripping. Trying to get note info from it is not a good idea, indeed.

I think the best way to get MIDI or MML is to just transcribe a song by ear. If you use the fb2k or winamp plugins, muting channels is very easy.

Btw, to get the "end" time, just take the # of samples (offset 0x18) and divide by 44100 to get the length in seconds. In vgm2txt you can just specify 0 or press enter to read the whole song anyway.

Vgmtrans is a completely different program and it doesn't handle VGM files at all, rather the focus there is to extract sequences from the original game data (ROM dumps/SPC etc).
  • denjhang Offline
  • Posts: 95
  • Joined: 2021-03-24, 4:44:34
  • Location: hk

vgm_sro cannot handle OPL4 using custom ram pcm

Post by denjhang »

I am studying MSX Moonsound recently, and used openmsx to extract a lot of OPL4 VGM, I found that using the latest version of vgm_sro can handle most of the captured vgm, but the following file cannot be processed.
Attachments
timesup_optimized.vgm
This vgm uses a large number of pcm samples loaded in ram.
(2.58 MiB) Downloaded 234 times
  • denjhang Offline
  • Posts: 95
  • Joined: 2021-03-24, 4:44:34
  • Location: hk

Is there something wrong here?

Post by denjhang »

Is there something wrong here? Please check vgm_sro.jpeg
Attachments
vgm_sro.jpeg
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

see https://github.com/vgmrips/vgmtools/issues/10

vgm_sro can not optimize OPL4 RAM when the VGM writes every byte with a single command. (= realtime RAM reloading)
You need to trim the file first, stripping all the silence from the beginning. This will coalesce all the single-byte RAM write commands into one large "OPL4 RAM data block", which can be optimized.
I still had to fix one crash though, which occoured when the VGM plays a sample that is not filled in by the OPL4 RAM data block.
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

New release after ... a way too long time.

I didn't keep track of all the changes and fixes, so I recommend to just update everything.
Win32 Binaries / Source (GitHub repo)
  • rick_z Offline
  • Posts: 3
  • Joined: 2022-03-28, 14:12:19

Get the sound file not compressed

Post by rick_z »

Hello guys, thanks for accept me at this forum.

Is there any way that I can download a music file from here without been compressed?

Thank you very much, I appreciate it.

:D
  • andlabs Offline
  • Posts: 185
  • Joined: 2011-12-04, 22:00:12

Post by andlabs »

What are you trying to do with the music file? VGM programs should already handle compressed files.
Post Reply