New VGM to MIDI + OPM + SYSEX tool for YM2151
Technical discussion about the VGM format, and all the software you need to handle VGM files.
Moderator: Staff
New VGM to MIDI + OPM + SYSEX tool for YM2151
Hi, I've just spent the last week creating a program to convert VGM into MIDI with voices in SYX for the Yamaha FB-01 that I just bought!
It also creates OPM files for VOPM.
The idea is that the MIDI generated has its instrument numbers match the SYX or OPM voice numbers, so you can simply load the SYX into your FB-01 or import the OPM into VOPM and then play the MIDI file to it and it will simply just work!
It maximises all the voices volumes, it uses the algorithm to determine which operators' TL value to pay attention to (the carriers and not the modulators).
It then finds the lowest TL in this group of carriers and then subtracts that value from all of the carriers.
The cool thing is this amount can then be used for the midi's volume command (with some maths to do db to gain)
It also helps when comparing voices to find duplicates.
I tested my program thoroughly with my FB-01, there were loads and loads of snags on the way.
It's been quite tough to get everything right.
A couple of things I learnt...
1. The operator order of the YM2151 registers is different than the FB-01 (and OPM files too)
2. You must set the modulator/carrier flag on the FB-01, otherwise volume dosent work!
The tool lacks proper Windows style, i.e no menu strip or proper file open dialog, theyre are easy to add, but not done yet.
The tool wont open VGZ files (yet!)
I haven't added support for L/R pan yet.
I am struggling pinning down a problem when converting Street Fighter II - Ken, the bell sounds seem all wrong, but all my other tunes seem spot on, anyone care to test this for me?
I have attached a zip file with source, the exe is in bin\Debug
My thanks to:
Paul Jensen for vgm2mid 0.5 (dunno if this an old version, I downloaded it years ago)
Martin Tarenskeen for TX convert (I found 2 little bugs in this BTW which I have fixed in my code)
Luke McQueen for his arcade OPM collection
Without these people and their hard work, there is no way I could have done this.
09/05/16 Fixed a sysex writing bug and file open bug, zip file re-uploaded
17/05/16 Changed note decoder function to work a different way to try and fix dropped notes, zip file re-uploaded
25/12/17 File re-uploaded
29/12/17 Added the ability to change the BPM and TQN
It also creates OPM files for VOPM.
The idea is that the MIDI generated has its instrument numbers match the SYX or OPM voice numbers, so you can simply load the SYX into your FB-01 or import the OPM into VOPM and then play the MIDI file to it and it will simply just work!
It maximises all the voices volumes, it uses the algorithm to determine which operators' TL value to pay attention to (the carriers and not the modulators).
It then finds the lowest TL in this group of carriers and then subtracts that value from all of the carriers.
The cool thing is this amount can then be used for the midi's volume command (with some maths to do db to gain)
It also helps when comparing voices to find duplicates.
I tested my program thoroughly with my FB-01, there were loads and loads of snags on the way.
It's been quite tough to get everything right.
A couple of things I learnt...
1. The operator order of the YM2151 registers is different than the FB-01 (and OPM files too)
2. You must set the modulator/carrier flag on the FB-01, otherwise volume dosent work!
The tool lacks proper Windows style, i.e no menu strip or proper file open dialog, theyre are easy to add, but not done yet.
The tool wont open VGZ files (yet!)
I haven't added support for L/R pan yet.
I am struggling pinning down a problem when converting Street Fighter II - Ken, the bell sounds seem all wrong, but all my other tunes seem spot on, anyone care to test this for me?
I have attached a zip file with source, the exe is in bin\Debug
My thanks to:
Paul Jensen for vgm2mid 0.5 (dunno if this an old version, I downloaded it years ago)
Martin Tarenskeen for TX convert (I found 2 little bugs in this BTW which I have fixed in my code)
Luke McQueen for his arcade OPM collection
Without these people and their hard work, there is no way I could have done this.
09/05/16 Fixed a sysex writing bug and file open bug, zip file re-uploaded
17/05/16 Changed note decoder function to work a different way to try and fix dropped notes, zip file re-uploaded
25/12/17 File re-uploaded
29/12/17 Added the ability to change the BPM and TQN
- Attachments
-
- VGM_to_MID.zip
- (101.05 KiB) Downloaded 6564 times
Last edited by Yarm on 2017-12-29, 14:06:24, edited 6 times in total.
- 1983parrothead Offline
- Posts: 130
- Joined: 2014-12-30, 1:38:48
- 1983parrothead Offline
- Posts: 130
- Joined: 2014-12-30, 1:38:48
I have just tried it again and it sounded like it was dropping notes so I have re-written the note decoder function in a different way and its seems better to me.
I've not used FL Studio before so am not sure if something else is happening too.
Please try it out and let me know if its better.
Edit: It seems to have fixed Street Fighter II - Ken 1 too (as I mentioned in my first post)
I've not used FL Studio before so am not sure if something else is happening too.
Please try it out and let me know if its better.
Edit: It seems to have fixed Street Fighter II - Ken 1 too (as I mentioned in my first post)
- 1983parrothead Offline
- Posts: 130
- Joined: 2014-12-30, 1:38:48
- 1983parrothead Offline
- Posts: 130
- Joined: 2014-12-30, 1:38:48
- vampirefrog Offline
- Webmaster
- Posts: 1522
- Joined: 2014-01-28, 5:51:54
- 1983parrothead Offline
- Posts: 130
- Joined: 2014-12-30, 1:38:48
MDX format uses the MSM6258 (used in the X68000) while VGM files support both the 6258 and MSM6295 (Used in arcade machines). The chips work differently, the 6258 reads streamed APDCM data while the 6295 reads data from a ROM. In the case of the 6295 it would be pretty easy to both rip samples and convert commands to MIDI.
For the 6258 this is much harder, it's hard to detect where a sample begins and where it ends. Fortunately, Valley Bell has spent a lot of effort into optimization and the optimized VGMs should contain at least some data (DAC stream commands) that might help with conversions. But it might not be perfect...
For the 6258 this is much harder, it's hard to detect where a sample begins and where it ends. Fortunately, Valley Bell has spent a lot of effort into optimization and the optimized VGMs should contain at least some data (DAC stream commands) that might help with conversions. But it might not be perfect...
- 1983parrothead Offline
- Posts: 130
- Joined: 2014-12-30, 1:38:48
- 1983parrothead Offline
- Posts: 130
- Joined: 2014-12-30, 1:38:48