VGM2PRE - VGM preset dumper

Talk about development tools here

Moderator: BigEvilCorporation

Post Reply
neologix
Very interested
Posts: 122
Joined: Mon May 07, 2007 5:19 pm
Location: New York, NY, USA
Contact:

VGM2PRE - VGM preset dumper

Post by neologix » Sat Apr 27, 2013 7:11 pm

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. I don't know how much interest this will have outside of the music scene here, but if you want to study the source you can. 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

TmEE co.(TM)
Very interested
Posts: 2443
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sat Apr 27, 2013 8:07 pm

This seems cool, I'll give it a go sometime soon :)
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

neologix
Very interested
Posts: 122
Joined: Mon May 07, 2007 5:19 pm
Location: New York, NY, USA
Contact:

Post by neologix » Tue May 07, 2013 5:39 pm

The next version will be able to output VGI format YM2612 presets for VGM MM use and I'm currently polling people to test the EIF format output as well. Once EIF is confirmed source and binaries will be updated.

neologix
Very interested
Posts: 122
Joined: Mon May 07, 2007 5:19 pm
Location: New York, NY, USA
Contact:

Post by neologix » Fri Jun 14, 2013 10:27 pm

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!

superjoebob
Very interested
Posts: 66
Joined: Fri Oct 15, 2010 7:06 am
Location: Vancouver, Canada
Contact:

Post by superjoebob » Tue Jul 02, 2013 6:13 pm

Hey neo! I might be crazy, but I've been working on TYI and TFI import support in my VST, and it seems the values for DT are inconsistent between the two. When you're writing a TFI, you write:

dtTable[op->dt] + 3;

which I don't really understand. With TFI isn't the DT written the same way as in TYI, from 0-7 instead of -3 to 3? In shiru's spec he put:

Detune 0..7 (0=-3,3=0,7=3)

The two sound pretty similar, but looking at what's happening with the TFI detune value leads me to believe the TYI is correct.
On a never ending quest to compose for the Genesis/Megadrive

neologix
Very interested
Posts: 122
Joined: Mon May 07, 2007 5:19 pm
Location: New York, NY, USA
Contact:

Post by neologix » Tue Jul 02, 2013 6:29 pm

@superjoebob - TFI (and VGI as a result) stores detune differently from TYI.

TYI stores it as the raw DT1 value that's combined with MUL as if it was setting the YM2612's DT1/MUL register directly.

TFI/VGI displays the "resulting" values of -3 to 3 but stores it as (result+3) so to display a value of -3 it stores 0, -2 stores 1, etc.

My TFI output is almost a direct copy of shiru's algorithm and the VGI output is a modified version of that. Both TFI and VGI dumped files work in shiru's trackers and load properly in DefleMask and FMDRIVE (TFI only) as well.

My recommendation is if you're still in the midst of writing the preset import code that you give VGI priority over TFI since VGI is more YM2612-specific (it includes the modulation registers that TYI does but TFI doesn't). TYI and VGI are on equal footing for YM2612 storage. I'm actually going to ask Aly James to consider adding VGI import as well.

superjoebob
Very interested
Posts: 66
Joined: Fri Oct 15, 2010 7:06 am
Location: Vancouver, Canada
Contact:

Post by superjoebob » Tue Jul 02, 2013 7:07 pm

Oh my god I totally screwed up the fact that the first bit in DT is a sign bit -.-'
so in TYI a DT value of 3 actually means +3, which is 6 in TFI. Damn.

Sorry about that misunderstanding man! I'm gonna look into VGI support, I want to add import support for pretty much everything.
On a never ending quest to compose for the Genesis/Megadrive

superjoebob
Very interested
Posts: 66
Joined: Fri Oct 15, 2010 7:06 am
Location: Vancouver, Canada
Contact:

Post by superjoebob » Tue Jul 02, 2013 9:07 pm

OH and thanks a ton for writing this tool man, it's been really useful! Since it's open source, would you allow me to use the VGM instrument parser if I credit you? Mine is just awful in comparison :oops:
On a never ending quest to compose for the Genesis/Megadrive

neologix
Very interested
Posts: 122
Joined: Mon May 07, 2007 5:19 pm
Location: New York, NY, USA
Contact:

Post by neologix » Wed Jul 03, 2013 10:30 pm

By all means you can use the instrument parser if you can get the code working. :)

It uses the nall library (which makes SO MANY THINGS EASIER), but I'm sure if you need to you'll be able to port the file reading code to the standard library or something.

Post Reply