Skip to content

Updated vgm2mid?

Can it be done without much effort?

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

Moderator: Staff

  • User avatar
  • dissident93 Offline
  • Posts: 204
  • Joined: 2012-02-17, 5:54:01
  • Location: USA

Updated vgm2mid?

Post by dissident93 »

Or would it involve a complete code overhaul? It's a pretty useful tool to me, and it having more compatible chips than the YM2612 and SN76489 would be very awesome.
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Because I got quite some requests about vgm2mid recently, here's my most recent WIP.

WIP means, that the update readme is outdated and I actually planned to add a few more features before releasing a new version.


Most v1.51 are already supported by the version here (vgm2mid_Update.txt is unchagned since this version).

New updates are:
  • fixed a small bug with YM2151 conversion
  • added GameBoy DMG and NES APU support
btw: The NES APU has three ways of making the triangle channel silent.

Enjoy!
  • Tom Offline
  • Ragequit Member
    Ragequit Member
  • Posts: 496
  • Joined: 2011-11-30, 17:26:44
  • Location: Italy
  • Contact:

Post by Tom »

My favourite song from Rainbow Islands (2151) still has some problems :(
Image

But I'm happy to read about the Game Boy. Now to find a way to dump a song I always wanted since 1994...
Also known as nineko.
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Yes, I know. I fixed another YM2151 bug.
The one I fixed could cause the notes to be in the wrong octave. It was a last-minute bugfix and I didn't feel like rewriting the note conversion code.

btw: The GameBoy has no "Key Off" command, just a command note length that I can't convert without completely rewriting vgm2mid.
  • Tom Offline
  • Ragequit Member
    Ragequit Member
  • Posts: 496
  • Joined: 2011-11-30, 17:26:44
  • Location: Italy
  • Contact:

Post by Tom »

ValleyBell wrote:The one I fixed could cause the notes to be in the wrong octave.
Ah, yes, I noticed that in the older midi, so that's why the new midi sounded better than before, I see. Thanks for fixing that.
Also known as nineko.
  • User avatar
  • dissident93 Offline
  • Posts: 204
  • Joined: 2012-02-17, 5:54:01
  • Location: USA

Post by dissident93 »

Awesome! The only nitpick I have is that the README claims that it can work with uncompressed files (.vgm), yet I get an error and I have to use VGMTools decompression option to get vgm2mid to convert it. But everything else is great!
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Yes, because there are lots of .vgm-files that are actually compressed.
Simply rename them to .vgz and it will work.
  • User avatar
  • dissident93 Offline
  • Posts: 204
  • Joined: 2012-02-17, 5:54:01
  • Location: USA

Post by dissident93 »

That easy, huh? :P
  • blindfold Offline
  • Posts: 2
  • Joined: 2012-08-04, 21:53:56

Post by blindfold »

Hi.
Is there a chance for more updates of vgm2mid?

I'm in love in VGM's (specially MD/Genesis). Recently I have tried to convert music from 'Adventures of Batman and Robin' by Jesper Kyd, but I was unable to get good results... ;(

Too bad there aren't any vgm2xm I know of, since it is easier to use samples then.
  • User avatar
  • dissident93 Offline
  • Posts: 204
  • Joined: 2012-02-17, 5:54:01
  • Location: USA

Post by dissident93 »

thats because how the song was composed. bass and drums shared a channel, meaning the MIDI would have both in one, making it sound terrible unless you did major tweaking. nothing a updated vgm2mid could do for that, im afraid
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Maybe you find this commandline tool useful.
It splits the tracks of MIDI files, so that you get one track for each instrument.


I imagine that it would be difficult to make a vgm2xm with working FM instruments, because FM is based on the modulation of sine waves, not samples.
And finding a proper tempo for the XMs is a whole other story.
  • blindfold Offline
  • Posts: 2
  • Joined: 2012-08-04, 21:53:56

Post by blindfold »

Thank you for your advices. I will try to make something out of it.

Unfortunately I'm starting to worry that there is something wrong with octaves.
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Due to the way FM sound chips work, it is possible that you can send the same frequency to the chip with 2 different instruments and get tones at different frequencies.

vgm2mid ignores the frequency modifiers (it's barely possible to guess the real frequency anyway), so the octaves can be wrong with certain instruments.
  • User avatar
  • Sik Offline
  • Not a musician
    Not a musician
  • Posts: 75
  • Joined: 2011-12-12, 12:43:15

Post by Sik »

Having worked with the YM2612 I can safely say that's extremely true - every instrument needs to get transposed to get the right octave. I suppose that's why the documentation talks about blocks and not octaves. The output frequency depends a lot on the multipliers, and then modulation can change the frequency quite a lot too (especially since it changes the waveform).
Sik is pronounced like "seek", not like "sick".
http://www.mdscene.net/
  • Tom Offline
  • Ragequit Member
    Ragequit Member
  • Posts: 496
  • Joined: 2011-11-30, 17:26:44
  • Location: Italy
  • Contact:

Post by Tom »

Besides, XM files aren't really designed to play notes at an arbitrary frequency. You can do that, but it is tricky. Midi files are really more suited as target format when you're converting from vgm files, at least when it comes to the note pitch (samples are an entirely different matter, as already pointed out by ValleyBell and Sik), especially because pitches are often questionable in vgm files, as proven by Maxim here.
In short, in Midi files you can simply abuse the Pitch Bend and do this:
1 Pitch Bend = 1234
2 Note On: A-4 (which won't be played at 440Hz thanks to the Pitch Bend)
3 Note Off: A-4
4 Pitch Bend = -1234
5 Note On: A-4 (which won't be played at 440Hz thanks to the Pitch Bend)
6 Note Off: A-4
The Portamento controls in XM files can't be applied to a note that's yet to be played instead, so other complex ways to get the intended pitch have to be used.
And this is why I'm not interested into writing a vgm2xm converter, not even for SN76496 files (which would otherwise be possible since the only "samples" would be a square wave and a white noise).
Also known as nineko.
Post Reply