Veni, Midi, Vici
With the synth section feeling done, it looks like I'm gonna try my hand at MIDI out on the D-Lev. Just ordered a $15 Tbox M3 USB MIDI interface to help with the development process:
MIDI seems fairly doable from a computing resource angle. Current SW currently consumes ~97% of BRAM so there's no room there, but there is a default "golden" SW load in the FPGA BRAM when it gets pumped @ power-up via its configurator, which gets overwritten by the SW load in the EEPROM (via the bootloader in FPGA BRAM, which never gets overwritten). One can manually prevent the overwrite by holding down encoder 7 pushbutton @ power-up, a feature that allows the pump of an otherwise bricked load. (Overwrite also doesn't take place if the EEPROM load doesn't pass the CRC check.) So one could make the "golden" FPGA load a MIDI only load, and the EEPROM load the normal load, and select between them at power-up via encoder 7 PB.
There's tons of data room left within the preset files, but I'm thinking the slots beyond +/-99 could be used instead, as 199 presets wouldn't be necessary for MIDI. Maybe 16 user and 4 system presets?
I suppose MIDI out would be sufficient (no MIDI in), a single FPGA pin connected to internal 8N1 UART support logic at 31.25k Baud (1MHz / 32) which I would have to find room for somewhere in the register set. Since the baud rate is 31.25k, and it takes 10 bits to transfer a byte, that's 3.125k byte rate. And since high res commands are often 3 bytes, that's a ~1kHz command rate. Even assuming you can absolutely flood the synth input with MIDI, a single Hive thread would have all the time in the world to assemble that and ship it out. 180MHz / 1kHz / 8 threads = 22500 cycles per 3 byte command. Everything could probably be in floats and still easily meet timing.
I think I can keep the preview, tuner, pitch correction, volume knee & envelope, and the axis calibration UI pages and functionality pretty much intact. When engaged, the D-Lev pitch correction already tries to start on the center of a note, so that might be sufficient in terms of how to handle true note-on situations? Outside of that (say one really wants to start off-note, or a gliss goes out of bounds) I guess note bend should be associated with note-on (i.e. come before it) to properly position it pitch-wise. Otherwise there might be two separate systems duking it out attempting to do the same thing.
Moog himself made a MIDI Theremin, and the Theremini does it too, so it must be possible. Though having both the controller and the synth in the same package probably helps. Anyone out there who understands MIDI and has some insights into how best to implement something like a Theremin MIDI controller, please pipe up if you have any suggestions.