-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OPM (YM2151) support #87
Comments
After some work on this branch: https://github.com/Wohlstand/OPN2BankEditor/tree/sketch-psg-and-wt, I'll be able to easier support more chips and things. At first I'll support OPN2+SN and OPNA, and then OPM too. I have to re-create |
Can we have a flag returned from the chip core, indicating which of OPN/OPM register language is spoken by this instance ? |
More notes as I interpret the OPM emulator code.
So it does not seem af first too difficult to implement this in substitution of OPN2 without extra functionality yet, just 2 things to manage: (1) how to tune it, and (2) allow ADLMIDI usage of 2 extra FM channels (6 OPN vs 8 OPM) |
libOPNMIDI can now speak to OPM, in the work branch opm Notes
|
Some observations about the tuning As seen from datasheet and most MAME machines using OPM, we have an indication of recommended clock rating as 3.579545 MHz. Also from MAME, it's indicated that it has a fixed sample clock division of 64, from which is deduced a sample rate 55.930 kHz.
The datasheet indicates a 440 Hz note is produced from a (Oct=4 Note=10) KC register, under the condition of 3.579545 MHz clock. This leads me to why it worked to apply an exact factor 2.25 to frequency for tuning in OPNMIDI: that is the ratio of the OPM vs OPN dividers (144/64). Please note: datasheet seem to only explain the tuning at that fixed clock frequency, and does not have a generic formula that I can find. |
Interesting, I thought YM2151 has a sample rate of 62400 Hz, as provided here: |
Just tried this rate and.. guess what: On this clock, the drums will sound more off on OPN instruments than will the previous rate. So this gives a clock at 3993600 Hz (as samplerate*64). It's very near the max chip rating 4 MHz. The clock |
X68Sound (the emu that VOPM uses) uses a value of 4000000. Regarding the LFO, I think both PMS and PMD must be a non-zero value to take effect. Edit: It seems that LFO Sync is a chip feature of OPM that should be looked into. The Yamaha keyboards (DX21, DX27, DX100) have a "LFO Key Sync" parameter in SysEx which might control LFO Sync. It is just a single bit (0-1). OPN series seems to lack this LFO Sync bit. |
Just wondering, what are the chances of OPM support getting into master? Or maybe it is already? |
Didn't complete yet. As explained above, the work on OPN2BE is needed, the WOPNv3 is needed (to get a set of extra fields required for OPM support), and, finally, the internal refactoring to properly process commands for different chips without the pain. |
That's cool, was just curious. |
OK hopefully here is better place to discuss (coming from jpcima/ADLplug#47), Re:
The differences between OPN2/OPM is not major. OPN2 is just a cost-reduced version of OPM.
OPN2 core:
OPM core:
0x80
=AMD/PMD mode,0x7F
=depth value (0-127) )For LFO frequency , just change AND mask depending on chip mode?
MAME source code of ym2151.cpp driver is accurate and readable :). Here is a comparison of the register map of OPN and OPM from my notes:
You can see OPN series is more compact in memory (it is a cheaper version of OPM after all). OPM is actually the basis of OPP/OPZ chips in DX21/DX11 keyboards. The rows labeled 4x4 and 8x4 are the FM operator data.
So all that is needed is to implement YM2151 emulator core, with support of new OPM parameters.. and a way to select OPN2/OPM mode. I would do it myself and PR.. but my C++ skills very bad. It would be hard enough to figure out how to compile this ;)
The text was updated successfully, but these errors were encountered: