Skip to content

mod2vgm - Protracker MOD to VGM converter

Using up to two OPL4 (YMF278B) chips.

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

Moderator: Staff

  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

mod2vgm - Protracker MOD to VGM converter

Post by ctr »

For some reason I never made a thread on the vgmrips forums about this, but now here it is.

This program converts .MOD format modules to VGM. It supports up to 48 channel (24 channels per chip) modules. Compatibility is fairly good (some vanity modules like ode_to_protracker won't work obviously), however there are some limitations; one being that samples have to be 8-bit and can't be larger than 65535 bytes. Please see the readme for full details.

The converted VGMs can be played back on an MSX with the Moonsound (or compatible) expansion cartridges using grauw's VGMPlay.

The source code and binaries can be found here. Enjoy!
  • lo zaffo Offline
  • Posts: 39
  • Joined: 2016-08-03, 22:36:09
  • Location: Italy

Post by lo zaffo »

I'm a heavy user of mod2vgm (on Windows platforms) and I like it a lot! Terrific job! :beer:
  • User avatar
  • 2ch-H Offline
  • Posts: 280
  • Joined: 2012-01-03, 2:10:28

Post by 2ch-H »

There are two problems.

1. There is a place where vocal samples are cut off when converting to VGM.
sample: Spectral vs. Generation - Freedom to Fight
mod
https://www.dropbox.com/s/687up7gn18fpe ... 1.mod?dl=1
vgm
https://www.dropbox.com/s/2mb0q2u6fveu4 ... 1.vgm?dl=1

2. I want to maintain the stereo state of mod, or want to set stereo panning.

Is that possible?
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

Yes, the timing isn't 100% accurate. In fact, even the timing on the PGM differ slightly from most trackers. But you can try to align the samples by messing with the song tempo.

You can use the -p parameter to use the usual MOD panning. Otherwise it will default to mono. You can also use 8xx commands to set panning directly.
  • User avatar
  • 2ch-H Offline
  • Posts: 280
  • Joined: 2012-01-03, 2:10:28

Post by 2ch-H »

Thanks for the advice.
I think that it is difficult to change the tempo so I lowered YMF278B Clock,
and I use -p parameter to make it stereo.
It was my desired result.
https://www.dropbox.com/s/bl00ddld644ao ... x.vgm?dl=1

Thank you very much.
  • Tom Offline
  • Ragequit Member
    Ragequit Member
  • Posts: 496
  • Joined: 2011-11-30, 17:26:44
  • Location: Italy
  • Contact:

Post by Tom »

This is very interesting, you managed to pull me back here, which isn't something that happens everyday, congratulations :P

I noticed you mentioned both XM input and YMZ280B output; I know that my XM to YMZ280B converter is written in another language (VB opposed to C), but it goes without saying that I would look very forward to a possible integration of our two tools, if there is anything about the XM format I can help you with, please let me know, as that's my module format of choice and I might have some tips for you -- unless you're good at XM too, in which case I wouldn't be needed, of course :P

Still, I'll keep an eye on this project.
Also known as nineko.
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

Thanks for the kind words, Tom.

I haven't really worked much on this tool since I released it. While I am probably not adding XM or YMZ280B support, i decided to try to implement FM by hacking the MOD format a bit.

Link here, instructions are in the "FM readme.txt". I planned to use this to make VGM rips of the music from Zone 66, but that didn't really go as planned, probably because the conversion from the original sound format to S3M wasn't perfect. (The conversion from S3M to MOD was fairly simple thanks to the song not using any effects, it should have had detune effects but those were missing in the S3M).

Still it should be usable for anyone that wants to make FM+PCM music with the OPL4. Limitations include not being able to use quite all FM channels, and no rhythm mode or 4op support.
  • cmccaff1 Offline
  • Posts: 15
  • Joined: 2021-01-06, 5:20:01

Post by cmccaff1 »

To ctr: though the last update was a while ago (and I apologize for the necro-bump), I wanted to thank you for this great program.
The YMF278B (OPL4) was (and is) an absolute beast: a full OPL3 + 24 PCM channels on a single chip.
Despite the chip's limitations it has stood the test of time, and is still capable of producing beautiful music.
This converter is a great showcase of what the OPL4 can do, and thanks to the abundance of .mod files on the Internet it may never cease to be useful.
If this project is ever revisited, I will definitely be excited to test out any future updates.
Much respect and appreciation to you!
Post Reply