Skip to content

VGM2PRE - VGM preset dumper

Source is available!

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

Moderator: Staff

  • User avatar
  • neologix Offline
  • Posts: 211
  • Joined: 2012-04-22, 4:03:45
  • Location: New York, NY, USA

VGM2PRE - VGM preset dumper

Post by neologix »

After some testing and deliberation, I've decided to put up the source to my VGM preset dumper 'VGM2PRE' early. So far I've only tested it personally on Windows 7 64-bit and can only guarantee it compiles on MinGW/MSYS+GCC >= 4.6.1, but I'm confident with a small amount of tweaking to Makefile.win (swap out the Windows-dependent stuff with the necessary OS dependencies and save separately) it will compile on Linux and possibly even OSX.

https://github.com/vgmtool/vgm2pre

32-bit Win binary - http://lux.mdscene.net/vgmtool/vgm2pre-32.7z
64-bit Win binary - http://lux.mdscene.net/vgmtool/vgm2pre-64.7z

Features:
  • On par with shiru's VGM2TFI, which means:
  • ...can process one VGM file or a directory of VGM files
  • ...can output TFI format YM2612 presets
  • ...prevents duplicate presets when processing multiple files
  • Can also output TYI format YM2612 presets
Coming Soon:
  • Output Y12 format YM2612 presets
  • Output OPM format YM2151 presets
  • Output presets and preset banks compatible with ValleyBell's various MID2VGM converters
  • A GUI
For now, if you want a VGM preset dumper with a GUI and only need/care about TFI, use Aly James's excellent one. Many thanks to Nemesis for the YM2612 thread, Tiido/TmEE co, KanedaFr, ValleyBell, and Aly James for helping me make this tool happen, Oerg866 for hosting me, and shiru for having provided the code for his VGM apps before he rage-quit. Future thanks to Charles McDonald and Eke for the Genesis Plus emulator from which I derive almost all my YM2612 code now and in the future :D
Last edited by neologix on 2013-04-27, 22:13:24, edited 4 times in total.
  • User avatar
  • neologix Offline
  • Posts: 211
  • Joined: 2012-04-22, 4:03:45
  • Location: New York, NY, USA

Post by neologix »

Binaries and source updated! Same links as above.

YM2612 outputs to FIVE file formats now:
  • Dump YM2612 presets to .VGI for Shiru's VGM MM, among other apps
  • Dump YM2612 presets to .TFI for Shiru's TFM Maker and Aly James's FMDRIVE VSTi
  • Dump YM2612 presets to .TYI for superjoebob's YM2612 VSTi
  • Dump YM2612 presets to .EIF for use with the Echo Sound Format
  • Dump YM2612 presets to .DMP for use with DefleMask Tracker
Also, new command line parameter pOPN allows toggling of output file formats of YM2612 presets. Use as follows:

Code: Select all

vgm2pre.exe -pOPN 111110 files
The six-digit argument following -pOPN uses 1 or 0 for the digits and toggles formats in the following order from left to right:

VGI, TFI, TYI, EIF, DMP, Y12 (Y12 is currently unsupported and for now will only print a message to the console when enabled)

Of limited documentation is the ability to pass multiple files or directories to the app. Use this feature at your own risk, as this allows the potential to process the entire Genesis VGM library at once at the cost of using all your comp's memory and possibly BSODing as a result. It also saves the presets into the directory of the song it's chosen from rather than a single directory for all the found presets.

Once I finish Y12 and GYB formats the YM2612 is done, then onto YM2151!
  • dma Offline
  • Posts: 8
  • Joined: 2013-08-13, 14:48:02

Post by dma »

Hi Neologix,

Thanks for coding such a tool.

But so i tried getting .tyi files out of VGM dumps, to open those on YM2162 VST.

- I took the latest (this day) vgm2pre binary, on the 32bit link here on this topic.
- I took the latest (this day) YM2162 VST, available here : http://wonthelp.info/2612/ym2612-vst-release-v-0-9/
- I took "Fighting in the Street" track from this Genesis .vgz set : http://project2612.org/details.php?id=53
- I depacked VGM data file out of the .vgz file.
- I ran this command : vgm2pre-32.exe "Streets of Rage - Fighting in the Street"
- It said :
OK: Processing 'Streets of Rage - Fighting in the Street' (VGM v1.50)
OK: 10 instrument(s) were found
VGM2Pre v1.0 VGM Preset Dumper by Apollolux
- I got 0 to 9 numbered instruments in each output format, including .tyi
- I run the YM2162 VST, either in Renoise ( http://www.renoise.com/ ) or in savihost ( http://www.hermannseib.com/english/savihost.htm ).
- I try opening any of the .tyi file in the VST.
- YM2162 VST crashes, either in Renoice or in savihost.

Could you point me to the mistake i may have made here?
  • User avatar
  • neologix Offline
  • Posts: 211
  • Joined: 2012-04-22, 4:03:45
  • Location: New York, NY, USA

Post by neologix »

Hi dma, thanks for your interest in my app!

Regarding the TYI import issue, if you visit superjoebob's thread on SpritesMind Forums you'll see that he acknowledges that the import function is broken on that version and that he's redoing it entirely for the updated release that he renamed "GENNY."

The steps you listed are correct (you can also use VGZ, you don't have to "depack" it), it's just that import on that VSTi needs to be fixed. If you give him some time the next release should have it working. If you want a YM2612 VSTi with working preset import now and are willing to pay a small bit of money for it, Aly James has released the excellent FMDRIVE VSTi that can import TFI presets and IIRC he should be adding VGI import in a later version (both of which can be dumped by VGM2PRE).
  • Cris Offline
  • Posts: 19
  • Joined: 2013-07-16, 20:14:22

Post by Cris »

I have the same problem that has dma.
  • dma Offline
  • Posts: 8
  • Joined: 2013-08-13, 14:48:02

Post by dma »

Thanks for the fast answer, Neologix.

Well then, I (and Cris) will wait the next VST release to fix the .tyi import problem.
As this VST features everything i need (just the Genesis FM synth reproduction).

Thanks again!
  • Cris Offline
  • Posts: 19
  • Joined: 2013-07-16, 20:14:22

Post by Cris »

The new version will log vgms?
  • zzo38 Offline
  • Posts: 51
  • Joined: 2013-02-18, 3:17:44
  • Contact:

Post by zzo38 »

Can you add the MML formats?
  • User avatar
  • neologix Offline
  • Posts: 211
  • Joined: 2012-04-22, 4:03:45
  • Location: New York, NY, USA

Post by neologix »

@Cris - I don't know what you mean by "log vgms;" please elaborate so I may give a better response, thanks!

@zzo38 - I haven't touched the source in a couple of months, but I do still plan on adding MML output to the app. For now, my only MML plans are for v1.50 chips (PSG, YM2413, YM2612, YM2151) but more can be added in the future after that.
  • Cris Offline
  • Posts: 19
  • Joined: 2013-07-16, 20:14:22

Post by Cris »

the new version of the genny vsti plugin will log vgm of the channels?
and about the dmf and tfm formats?Already have a program that can convert vgm or mid files to dmf/tfm?
Last edited by Cris on 2013-09-15, 7:41:27, edited 1 time in total.
  • User avatar
  • neologix Offline
  • Posts: 211
  • Joined: 2012-04-22, 4:03:45
  • Location: New York, NY, USA

Post by neologix »

Cris wrote:the new version of the genny vsti plugin will log vgm of the channels?
You'll have to ask superjoebob about how that will work.
Cris wrote:and about the dmf and tfm formats?Already have a program that can convert vgm or mid files to dmf/tfm?
You'll have to ask Delek about any MIDI-to-DMF conversion; check the DefleMask forums to see if anyone's working on it. I don't think I'm going to do anything with TFM since it's been obsoleted by VGM MM, but I may look into converting to VGE for VGM MM in the future.
  • Cris Offline
  • Posts: 19
  • Joined: 2013-07-16, 20:14:22

Post by Cris »

i already see a mid2dmf converter but i don't know how to convert.i converted some files but the dmf file is empty.
  • User avatar
  • MaliceX Offline
  • Posts: 226
  • Joined: 2012-09-29, 11:45:48
  • Location: Australia
  • Contact:

Post by MaliceX »

zzo38 wrote:Can you add the MML formats?
I adapted my BNK to MSOPL-based converter to a BNK to MML (SiON and VGMCK targets). I'm having trouble getting some of the patches to work correctly with VGMCK (they work fine in SiON). The documentation isn't particular clear with the byte order of each parameter.

Could you elaborate this, in simple terms what the register correspondence would be for each @x instrument for OPL2, OPL3, and OPL4? As far as the docs says, this is what I got:

OPL2:
{ $20, $23,
$40, $43,
$60, $63,
$80, $83,
$E0, $E3,
$C0
}

OPL3:
{ $20, $40, $60, $80, $E0,
$23, $43, $63, $83, $E3,
n/a. n/a, n/a, n/a, n/a, ; not used for 2op patches in BNK
n/a, n/a, n/a, n/a, n/a,
$C0, n/a
}

Thanks.
Last edited by MaliceX on 2013-09-19, 8:14:31, edited 3 times in total.
-dj.tuBIG/MaliceX
  • User avatar
  • AJ Offline
  • Posts: 1
  • Joined: 2013-10-02, 0:41:50

Post by AJ »

Finally I have register to the VGM homeland :)
keep up the good work Neo!
dma wrote:Thanks for the fast answer, Neologix.

Well then, I (and Cris) will wait the next VST release to fix the .tyi import problem.
As this VST features everything i need (just the Genesis FM synth reproduction).

Thanks again!
I take the opportunity to clarify one point regarding FMDrive Vsti (YM2612 emu)

Some features of the YM2612 chip were not very documented until reverse engineered, that is why some people may think that some features are not possible on a real YM2612.

Everything FMDrive does was and is possible on the hardware except for these optional features : bit-crushing effect, high resolution mode, Un-Sync PMS and Modulation index filtering.

Explanation:

-Custom LFOs, were usually done directly in the code or via a custom music engine. FMDrive does it for you without the hassle.
-Custom envelope generator, made also in the code by directly writing to TL register, however, not as smooth as the internal EG.
-CSM Mode Speech Synthesis is perfectly working on the chip, however there was no driver provided for it... so programmers had to code their own, the hard way.

FMDrive gives you a much easier control over CSM including a way to sync the timer speed to the current FNumber (playing note frequency).

There are two octave range that are usable "musically" so this makes some pretty cool "talking" sounds or instrument.
Game arts studio were among the rare teams who developed in the past a great engine on MSX computer that permitted them to provide unique sounding CSM synthesized speech in their games at the fraction of the size of PCM data.

Learn more on the CSM mode>> (edit I forgot the link ^_^)
http://chipmusic.org/forums/topic/11028 ... sm-sounds/

-Ladder effect emulation (DAC distortion of Model 1). I have found a way to emulate accurately the characteristic DAC distortion from the Model 1 Genesis witch greatly affect the tone...as far as I know, there is currently not even a game emulator platform that provides this feature yet (hope it will at some point as I have provided some public infos :) ).
-Direct DAC waveforms. If you can play PCM, you can write waveforms...
-SSG is a very powerful way of looping the entire envelope generator. this can easily reach audio rate to provides ring modulated type of sounds.


hope it clarify some points :)

Best
Last edited by AJ on 2013-10-04, 16:23:09, edited 2 times in total.
Post Reply