SPDIF x2
A while back Roger requested a second SPDIF output for pitch preview, and now that the inharmonic resonator supports pseudo-stereo there is more of a pressing need for this feature. With a single SPDIF the right audio output gets co-opted for pitch preview (when the pitch preview volume is greater than zero), but the introduction of a second SPDIF output allows for a better division of labor, where the original SPDIF output may be used as the line level PA output (and never passing the pitch preview signal), and the second SPDIF as headphone or personal monitor output. With proper switching, this would cover the scenarios where a player:
1. Practices alone and monitors the stereo output via stereo headphones (this is me most of the time).
2. Performs with accompaniment and monitors pitch preview in one ear via a single headphone (this is many players I've watched perform).
3. Performs with accompaniment and monitors pitch preview in one ear and mono in the other ear via stereo headphones (does anyone do this?).
With all of the above also supporting mono or stereo going to the PA.
SPDIF only takes one output pin of the FPGA, and Roger's experiments have found that an electrical connection works as well as an optical connection (I thought optical was necessary to keep digital noise out of the output audio). We want the analog outputs to be in phase with each other, and SPDIF TX is a timing master, so the most natural solution in the FPGA logic is to replicate the data shift registers. I did this with an SV "generate" statement around the shift block, but intentionally excluded the master counter / state machine and flags decode from replication. This ensures output phase alignment, that internal data for both components is taken at the same time, and saves a bit of logic here and there. There were two convenient Hive register locations left unoccupied, so I used these for the HW / SW interface to the new SPDIF component, one for the left channel and one for the right (24 bits each). FPGA usage has gone from 88% to 91% with no obvious dramatic increase in difficulty in meeting timing closure during the FPGA build. I'm kind of amazed that the FPGA is this full of logic running at ~200MHz and it isn't too hard to build, nor does it seem to have a thermal problem.
I added a new "Mntr" knob to the SYSTEM UI page to switch between the old single SPDIF arrangement and the new dual SPDIF arrangement. Regardless of knob settings, both SPDIF channels are always driven by the software.
===================
Another request of Roger's was reduced sensitivity for the axis auto calibration knob. This is a dual use knob on the main page which, when turned performs a instant auto calibration of both axes, and when pressed writes to the preset slot. A slip when pressing the knob can accidentally turn it, thus erasing one's current edits, as well as performing an undesired auto calibration. My prototype has small diameter knobs that are actually kind of hard to slip and turn when pressing, but the possibility is always on my mind when storing a preset (which actually requires two presses, for double the chance of slippage). My solution here was to have the software examine the knob rotation delta, with anything over 1 detent in either direction during the sample interval triggering an auto calibration, and anything less ignored, so the knob rotation must have some deliberate minimal velocity to register as an event. This was a much easier edit than I imagined it would be, and I want to again thank Roger for coming up with these excellent suggestions for improving the prototype.
===================
I also added a bass tone control to the pitch preview, so that it now has bass and treble knobs. And I FINALLY fixed a command line stack fault bug that's been a minor nuisance for what seems like forever (and this after thinking I fixed it several times in the past).