nukeykt / Nuked-OPL3

Highly accurate Yamaha OPL3 (YMF262, CT1747) emulator
GNU Lesser General Public License v2.1
158 stars 17 forks source link

More than 8 octaves? #23

Open fawtytoo opened 1 year ago

fawtytoo commented 1 year ago

OPL is limited to 8 octaves by hardware design. Could this limit be lifted?

fawtytoo commented 4 months ago

I made the common mistake of referring to the frequency blocks as "octaves". However ...

I've been studying this. The limitation is NOT the number of blocks but the range of frequencies within each block. So the range within each block which would need to be doubled for block 7 to reach midi note 127 (currently wraps at note 115). To do that, the f_num would require 11 bits instead of 10. This could be achieved using 2 spare bits available in register B0 (bits 6 & 7). Bit 6 could be the extra required bit for f_num, and bit 7 could be used as a test bit so the "feature" could be turned on/off.