Sonic and Sega Retro Message Board: MIDI to VGM converter - YM2612 edition - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Loading News Feed...
 

MIDI to VGM converter - YM2612 edition Very early proof of concept beta

#1 User is offline nineko 

Posted 20 December 2010 - 07:35 PM

  • I am the Holy Cat
  • Posts: 5238
  • Joined: 17-August 06
  • Gender:Male
  • Location:italy
  • Project:I... don't even know anymore :U
  • Wiki edits:5,251
PLEASE NOTE: ValleyBell improved the midi to vgm converter, and he released it just a few posts below.

What follows below this line is the very old release of my ultra broken beta version. It should not be used, and it's only for archival purposes.
---------------------------------------------------
Download here. It is highly unfinished but I fail at postponing releases, so I can let you all have some fun with this. Happy early Christmas, I guess v.png

It imports (almost) any MIDI file in format 0 to output VGM files. No PSG, no YM2413 (use ValleyBell's converter for that one), no YM2151 (yet, but I plan to add it soon, if I can understand the few docs available). Yes, it is technically possible to have 2612 and 2151 in the same vgm file, resulting into 6+8 FM channels at the same time. Neat, isn't it?

No YM2612 PCM channel, it's 6FM only. I won't make any guarantee about the PCM channel being added anytime soon if at all.

What works: Volume changes (via the Main Volume Controller), Pitch bends, Pan changes (via the Pan Controller), Instrument changes. Please note that I didn't finalize the instrument interface yet, so I'm relying on a temporary solution for now. Future versions will have a comprehensive instrument editor with parameters and whatnot.

To achieve the best results you should use this on a MIDI file with strictly monophonic channels; you should get an error message if a MIDI channel tries to play more than one note at the same time, though there is a "cheat mode" which forces a Note Off if a new Note On event is encountered while another note is still playing. Please note that I don't recommend to use that mode, though it will be needed to convert MIDI files which weren't prepared beforehand. Future versions *might* implement a "chord mode" where you can set a MIDI channel to spread on several YM2612 channels. Though I can't confirm this feature yet.

So yeah there's not much more to say now, this is an early beta just to see if it can gather some interest. Oh by the way the slider on the right sets the maximum volume achievable in the VGM file. Keep in mind that it's logarithmic so you DO NOT WANT to raise it too much.

Both Andlabs and TmEE gets tons of credit for their invaluable help. If it wasn't for them this converter wouldn't exist.

Obligatory sample files:
LBZ1 PC
Unused S&KC song
Proof of concept of pitch bend

edit: this version should not be uploaded on the wiki, as it's an early proof of concept, likely to have dozens if not hundreds of bugs. I will give this a green light when I'll fell comfortable with that.

This post has been edited by nineko: 11 July 2011 - 07:05 PM

#2 User is offline LordOfSquad 

Posted 20 December 2010 - 07:50 PM

  • Tell me why you came here, squatting 'round a Game Gear, like Sega never died.
  • Posts: 3454
  • Joined: 19-February 08
  • Gender:Male
  • Project:Do a music and do a art.
  • Wiki edits:1
Sexy! Anything that makes music hacking less complicated (and hopefully actually able to work on my computer) is a godsend. Please do keep working on this!

HAHAHA WAIT. For some reason I thought this was a MIDI to SMPS converter. Oh well, it's still neat.
This post has been edited by LordOfSquad: 20 December 2010 - 07:54 PM

#3 User is offline Shadow Hog 

Posted 20 December 2010 - 09:12 PM

  • He's the Nostalgia Anime, he animes so you don't have to
  • Posts: 2863
  • Joined: 05-November 06
  • Gender:Male
  • Location:Earth
  • Wiki edits:10
That's pretty awesome, actually. Nice work! Eager to see where this goes.

Should play around with this, in fact...

EDIT: doesn't run. Closes instantly.
This post has been edited by Shadow Hog: 20 December 2010 - 09:49 PM

#4 User is offline ValleyBell 

Posted 21 December 2010 - 08:41 AM

  • Posts: 137
  • Joined: 08-September 10
  • Gender:Male
  • Project:vgm tools and vgm packs, other random projects
  • Wiki edits:10
Nice tool! And it works quite well.
Here is S&K PC - CNZ1: VGM, Source MIDI (the MIDI was already patched for mid2vgm YM2413, that's why it's called OPLLpatch)

Because I've no experience with XMs (and modules in general) and I simply love MIDIs, I'm looking forward for future releases.

#5 User is offline nineko 

Posted 21 December 2010 - 11:23 AM

  • I am the Holy Cat
  • Posts: 5238
  • Joined: 17-August 06
  • Gender:Male
  • Location:italy
  • Project:I... don't even know anymore :U
  • Wiki edits:5,251
Wow, positive feedback from ValleyBell himself, I'm honoured smile.png

#6 User is offline Shadow Hog 

Posted 21 December 2010 - 12:43 PM

  • He's the Nostalgia Anime, he animes so you don't have to
  • Posts: 2863
  • Joined: 05-November 06
  • Gender:Male
  • Location:Earth
  • Wiki edits:10
Update on the closes-instantly thing: it runs fine on my work laptop (Win XP, pretty sure it's 32-bit). It doesn't even start up on my home computer (Windows 7 x64). Not sure what else to mention... Can't mess around with it much on the computer it does work on, regrettably, considering, well, work computer.

#7 User is offline nineko 

Posted 21 December 2010 - 12:51 PM

  • I am the Holy Cat
  • Posts: 5238
  • Joined: 17-August 06
  • Gender:Male
  • Location:italy
  • Project:I... don't even know anymore :U
  • Wiki edits:5,251
Make sure you have MSVBVM50.DLL and COMCTL32.OCX installed. I'm not sure about how Vista and 7 handle permissions on external libreries, you might need to be an administrator or something to install them.

Aside from that I can't think of any reason which would prevent this program from running into any Windows OS from Windows 95 onwards.
This post has been edited by nineko: 21 December 2010 - 12:53 PM

#8 User is offline Shadow Hog 

Posted 22 December 2010 - 02:15 AM

  • He's the Nostalgia Anime, he animes so you don't have to
  • Posts: 2863
  • Joined: 05-November 06
  • Gender:Male
  • Location:Earth
  • Wiki edits:10
That got it working. Took a while to figure out how to deal with the second file (won't natively install on Win 7 64-bit, see - had to settle for the quick-and-dirty fix of just putting the OCX file in the program's folder instead of properly installing it in System32).

So yeah, while you guys went with a fairly obvious PC game choice, considering the board, I went with the other obvious one. I think the last one in particular sells me.

Looking forward to drums working, if they ever do!

#9 User is offline nineko 

Posted 22 December 2010 - 08:05 AM

  • I am the Holy Cat
  • Posts: 5238
  • Joined: 17-August 06
  • Gender:Male
  • Location:italy
  • Project:I... don't even know anymore :U
  • Wiki edits:5,251
Ironically, I converted your "Song1" too while I was testing this. Nice work, glad to hear you got it to work. I especially like Song3 :o

edit [several minutes after the original post]: seriously I can't stop listening to Song3, lol v.png
This post has been edited by nineko: 22 December 2010 - 10:40 AM

#10 User is offline Hendricks 266 

Posted 22 December 2010 - 11:12 PM

  • Posts: 326
  • Joined: 01-June 05
  • Gender:Male
  • Location:United States
  • Wiki edits:58
I made one from the third obvious choice. Neat program!

#11 User is online Kiddo Cabbusses 

Posted 22 December 2010 - 11:28 PM

  • Posts: 1191
  • Joined: 26-February 08
  • Gender:Male
  • Location:Doylestown, PA
  • Wiki edits:100
QUOTE (nineko @ Dec 21 2010, 12:51 PM)
Make sure you have MSVBVM50.DLL and COMCTL32.OCX installed. I'm not sure about how Vista and 7 handle permissions on external libreries, you might need to be an administrator or something to install them.

Aside from that I can't think of any reason which would prevent this program from running into any Windows OS from Windows 95 onwards.


I installed both, but the program is still saying that COMCTL32.OCX is not registered correctly. sad.png

(EDIT: Got past that, now get "Unexpected Error". PFfftt.)
This post has been edited by Kiddo Cabbusses: 22 December 2010 - 11:32 PM

#12 User is offline Shadow Hog 

Posted 22 December 2010 - 11:33 PM

  • He's the Nostalgia Anime, he animes so you don't have to
  • Posts: 2863
  • Joined: 05-November 06
  • Gender:Male
  • Location:Earth
  • Wiki edits:10
"Sir, the possibility of successfully navigating an asteroid field is approximately 3720 to 1!"
"Never tell me the odds!"

An attempt at converting piano-only MIDIs to VGM. The results are... okay. The source MIDI had a few issues which I worked to correct, but it's still rather inaccurate to the original song.

#13 User is offline MaliceX 

Posted 10 July 2011 - 06:07 AM

  • I'm back, mofos!!!!!
  • Posts: 42
  • Joined: 29-July 06
  • Location:Laverton, VIC, AU
  • Project:Audjoo Helix VSTi Alternate Manual
This tool is certainly looking promising. Fooled around with it while testing the ability of ValleyBell's vgmmerge (OPNA+PSG+OPLL), and well, obviously it's certainly not intuitive for a beginner without patience. smile.png

Second part of Genesis - The Cinema Show (Note: yes notes are wrong, blame the conversion and lazy channel monofication)
initial stolen source (not split-prepared)
This post has been edited by MaliceX: 10 July 2011 - 06:08 AM

#14 User is offline nineko 

Posted 10 July 2011 - 07:19 AM

  • I am the Holy Cat
  • Posts: 5238
  • Joined: 17-August 06
  • Gender:Male
  • Location:italy
  • Project:I... don't even know anymore :U
  • Wiki edits:5,251
Since this thread was bumped I might as well take this chance to say that while I completely discontinued this converter, and I didn't improve it in any way whatsoever after the first release, a few days ago I sent the source code to ValleyBell, so a decent release (e.g. something without a gigantic "this is a beta version" label) might be on its way. No promises though, for me this project is dead.

#15 User is offline ValleyBell 

  Posted 11 July 2011 - 01:58 PM

  • Posts: 137
  • Joined: 08-September 10
  • Gender:Male
  • Project:vgm tools and vgm packs, other random projects
  • Wiki edits:10
Actually I wanted to bump this thread since some days, but the time passed while I was thinking what bugs could still be in mid2vgm 2612 and 2612edit.

But here it is: an updated and improved mid2vgm 2612.
New features (I hope I didn't forget some):
- DAC support (via ini-file and vgm v1.60 extensions), if no DAC is used, version is set to v1.50 (for compatibility with foo_gep and other stupid players that refuse reading the file just because of the version tag)
- loop support (via Controller 111 with value 0/1, like mid2smps, but global)
- GYB v2 support (new 2612edit is included)
- vibrato support (MIDI Modulation Wheel -> FMS/LFO Vibrato)
- fixed a bug with overlapping notes (and some others I don't remember anymore)
- volume calculation is now 100% GM correct (including L/R panning) and doesn't ignore operator volumes anymore
- automatic internal midi format 1 -> 0 conversion (midi1to0.exe didn't work on Win7x64 anyway)

mid2vgm Notes:
- You can enable the DAC and FM channel 6 at the same time, but they will turn each other off.
- The drum bank of GYB files is still ignored.
- If you use the DAC, be sure that you comment out unused sounds in the ini, else your vgm will contain (huge) unused samples.
- You can adjust the vibrato speed in 2612edit (LFO Freq)
- mid2vgm is still terribly slooow. (making a 150 KB vgm on a PentiumII takes 2 minutes!)

I included various DAC samples (the sounds of the most common GM drums) and various FM banks.

Instruments.gyb is the default bank with all instruments from the old mid2vgm and some new ones.
Instruments_WinFM.gyb is a conversion of the OPL2 instrument bank Windows FM used. Not all instruments are accurate because I don't know how I need to convert some of the rates correctly. Also all instruments with notes in [brackets] use special OPL2 wave forms the YM2612 doesn't have. (more inaccurateness)
fmmidi_programs*.gyb are FM patches converted from fmmidi. They were originally stored in some opm-like format, but I was unable to convert them properly because the TL operators seem to behave slightly different from a usual YM2612. The _volfix bank usually sounds better, except for all sounds that use a strong noise.


New 2612edit features:
- support for AMS/FMS and global LFO
- a lot more formats can be imported (amongst others .opm and .gyb, so copying and pasting instruments is now possible)
- import multiple instruments at once (All button now only marks all instruments)
- some small bugfixes


Final note:
mid2vgm is now quite usable, so I don't think I'll work on it a lot more. (I'll fix bugs if someone finds any)
When I have a lot of free time I'll maybe rewrite it so that it doesn't use so many string operations anymore (-> huge speedup) and that it will check for used DAC samples.

I think that's all.
Enjoy and happy converting!

  • 3 Pages +
  • 1
  • 2
  • 3
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users