# HG changeset patch # User Laurens Holst # Date 1538834909 -7200 # Sat Oct 06 16:08:29 2018 +0200 # Node ID a0990fc2a46c9499fc7e07c9a9f7ea9c48c59c2b # Parent 9946f14ccfd93ef3d824a8f803267743b8c897b6 OPLLTone: Make half the octave keys have fnum < 256 for key scaling. The key scaling offset (0..15) is composed of the block number and fnum MSB. Without this adjustment, the LSB of the key scaling offset would always be 1. Comes at the cost of losing a bit of precision for half of the keys, but ’s ok. diff --git a/src/modules/OPLLTone.asm b/src/modules/OPLLTone.asm --- a/src/modules/OPLLTone.asm +++ b/src/modules/OPLLTone.asm @@ -72,6 +72,12 @@ jp m,Continue cp 8 << 3 jr nc,Clamp + bit 2,h + jr z,NoAdjust + cp 7 << 3 + jr nc,NoAdjust + add a,1 << 3 ; make half the octave keys have fnum < 256 for key scaling +NoAdjust: ld c,a ld a,h sub c