Firmware (Teensy 4.1): The fret-sensing firmware is written. Every millisecond it reads the 126 fret pads through the 8 MCP23S17 chips over SPI. It uses the pad map exported from the PCB design to turn each pad into a string and fret, and keeps the highest fret held on each string. A change has to hold for 3 scans before it counts. When a string is plucked, the firmware combines that string’s open note with the current fret and sends the result to the AI model as a USB-MIDI note with velocity. The fret input is swappable with one compile-time switch: today it comes from the simulator, and when the overlay PCB arrives it will come from the board. Everything after the input is the same code.
Chord simulator (Python): Since the PCB hasn’t arrived, I wrote a chord simulator that stands in for it. It converts chord names or shapes into the same bits the 8 chips will report and streams them to the Teensy over USB, along with strum events. It can play full songs on the beat; the demo song is Smoke on the Water at 111 BPM. In PC tests, the simulator input and the real-board SPI input produced identical notes, and the simulator has played the full song end to end. Next is running it on the Teensy itself.
Piezo integration (Aaqib): Aaqib’s piezo pluck-detection code is merged into the firmware unchanged and runs in the same loop as the fret scan. Right now it only prints pluck events, so we can confirm detection without affecting the MIDI output. For the demo, one flag switches the plucks from the simulator’s strum events to Aaqib’s piezo detections. A real pluck will then set the note’s timing and velocity, the fret state will set the pitch, and the note will go to the AI model over USB-MIDI.
Next steps:
- Flash and test on the Teensy
- Enable piezo-triggered notes to the AI
- Assemble and bring up the PCB when it arrives, then switch from the simulator to the board
- Measure pluck-to-MIDI latency against the 10 ms target