.opm to FMX Sunvox converter [Release]

Post Reply
CoryCulley
Posts: 30
Joined: Wed Aug 03, 2016 1:09 am

.opm to FMX Sunvox converter [Release]

Post by CoryCulley »

Edit: Updated with bug fixes
opm2fmx is a PixiLang application that will batch convert
.opm files over to .sunvox projects containing FMX modules.
Each instrument in an opm becomes an FMX module with
conversion of FM synth parameters being approximate.

Warning: This app is incomplete. Some things like LFO and AMS
won't be converted. There are probably bugs. If you try to batch convert hundreds of
.opms, you could run into issues like the app freezing. If that
happens try reducing the number of .opms

What are .opm files?
They are plain text files with parameters mainly for the YM2151 soundchip.
However, they are quite compatible with the Sega Genesis/Megadrive
YM2612 soundchip with some slight exceptions. There are large archives
of .opm files available online that have the synth parameters for many classic games.



How compatible with FMX are .opm files?
Alot of the converted instruments will sound close.
There quite a few big differences to note though:
1) Both soundchips have a 2nd Decay stage to their envelopes
so they use ADDSR where FMX only does ADSR. Because of this,
it's impossible to 100% accurately convert .opms for use in Sunvox.
Some instruments will sound just like the original, others may
require parameter adjustments to get a sound more similar to the
original. It might be possible in the future to create a more complex
module arrangement to accommodate D2R.

2) Not sure about the YM2151, but I believe the YM2612 has
9-bit depth output (and a multiplexer as opposed to mixer).
You can achieve the 9-bit depth output by connecting FMX
to a Distortion module in Sunvox and adjusting the bit depth
down to 9.

3) There are various other differences in synthesis and such
that makes 1:1 conversion impossible.



How do I use this program?
1) Extract the root folder from the archive.
2) Copy the .opm files you want converted, into the same directory
as the source code.
3) Run opm2fmx.pixi using PixiLang. I've only tested this
on Android, which requires you to have the program and opm
files in PixiLang's /Android/data directory. However, you should
be able to run this on other OSes as well
4) Your converted .opms will be in the ./output folder when finished.



If you have suggestions or run into bugs, you can head over to
the official Sunvox forums in the thread where this zip can be downloaded.
DM me or reply to the main post.
Attachments
opm2fmx.zip
(6.42 KiB) Downloaded 66 times
Last edited by CoryCulley on Tue Jul 04, 2023 10:10 pm, edited 1 time in total.
RainGem
Posts: 1
Joined: Fri Jun 16, 2023 1:41 am

Re: .opm to FMX Sunvox converter [Release]

Post by RainGem »

This is awesome, just testing it out MK3 Sounds work great through this. Thank you!
CoryCulley
Posts: 30
Joined: Wed Aug 03, 2016 1:09 am

Re: .opm to FMX Sunvox converter [Release]

Post by CoryCulley »

Ok I've updated the opm to fmx converter. Fixed some bugs, added keyscaling and added checks to make sure that controllers were getting written correctly (there was a chance some writes could be missed, causing some parameters to be missed in the conversion)

I think some things can be made more accurate by implementing LUTs instead of trying to approximate things with math. That'll be for the next update though.
Post Reply