Axis Processing Update
Yesterday I thought I'd take a more or less final look at the assembly code that processes the axis information. The main thing that was bugging me was the borderline OK behavior of the volume side when set to non-inverting mode sense, or what most people think of as "normal" where farther = louder response. The sensitivity and offset controls were working fine for the "abnormal" mode where closer = louder. Here is what I have in there now for both the pitch and volume axes:
The number comes from the down-sampling, acquisition, & filtering section (CIC & 4th order IIR) to get nulled via K0. The minimum is limited to 1 so as to fix inverse overflow downstream. This is converted to a fractional float, LOG2 is taken, K1 is fractionally multiplied and negated, and then EXP2 is taken to complete the linearization. The new thing here is K2, which pulls the result center down to the x axis to make it +/-. After this it is multiplied by K3 (sensitivity) and offset via K4, after which it is converted to an unsigned integer and fed to the rest of the logic.
K2 is a semi-constant in the range 3 to 12. The value is chosen to place zero roughly in the middle of the range, so as to "pivot" the result via multiplication with K3. It's a different value for the pitch vs the volume side, it is strongly influenced by the oscillator parameters and K1, and it has a lot of control over the normal vs. abnormal mode of the volume side, so I'm thinking it should be a system parameter rather than a hard-coded constant in the assembly. I don't like adding variable parameters to things as just one more increases the complexity of adjustment geometrically, but what do you do? It will largely be a set & forget thing like linearity.
The sign of K3 is used to control the sense of the axis (negative for the pitch side and "abnormal" volume side). Note that K3 and K4 have switched positions from the old way I was doing things here. You really want to bring the thing to the axis (-K2), tilt (*K3), then offset (+K4) and in that order. There's no need to restore K2 after doing K3, as K4 will swamp K2 in this scenario.