For OPN series this might work based on the datasheet (though really not tested):
Code:
Fc / 144 / 2^(10-Block) * Fnum / 2048
8000000 / 144 / Math.pow(2,10-4) * 1038 / 2048 = 439.9617513020833
For OPM you'll need a lookup table to convert the keycode to MIDI notes then you can do something like
Code:
440 * 2^((kc - 56 + kf / 64)/12)
this example assumes note count starts at C#0 and A4 freq is 440hz. For this you might need to define a different reference frequency based on the chip clock. If you want to be completely accurate you need to use yet another lookup table that converts it to the internal F-num/block.