The fret-overlay flex PCB and its stencil are on order from JLCPCB (order W2026102801223865), and the parts are on order from LCSC (WM2610280045). Both vendors’ engineering and shipping questions have been answered.
The two orders ship separately. Next, we prepare hand assembly and write the Teensy 4.x firmware that scans all 126 fret pads over SPI and combines them with pluck events from the GK-3.
Firmware plan
The Teensy 4.x reads all 8 MCP23S17 expanders over one SPI bus at least 1,000 times a second. It turns the pressed pads into a fret per string, and sends a USB-MIDI note when the GK-3 detects a pluck. The whole path has to stay under 10 ms.
Wiring. J1 connects to the Teensy as follows. All 8 chips share one chip select and are told apart by their hard-wired addresses: U1 = 000 through U8 = 111.
- J1 pin 1, MISO: Teensy pin 12
- J1 pin 2, MOSI: pin 11
- J1 pin 3, SCK: pin 13
- J1 pin 4, CS: pin 10
- J1 pin 5, GND: GND
- J1 pin 6, 3V3: 3.3 V
A separate wire from the guitar’s ground (bridge or jack sleeve) to Teensy GND is required, because the grounded strings are what pull a pressed pad low.
Start-up
- Write IOCON (register 0x0A) with HAEN = 1. Until HAEN is set, every chip answers address 000, so one write reaches all 8.
- On each chip, enable the pull-ups on both ports: GPPU A/B (0x0C/0x0D) = 0xFF. The pins are already inputs by default.
Scan loop
- For each chip, read GPIOA and GPIOB (0x12/0x13) in one 4-byte SPI transfer. All 8 chips take about 0.1 ms at the chip’s 10 MHz SPI limit.
- A pressed pad reads 0. A lookup table generated from
pad_map.csv converts (chip, pin) into (string, fret). U8 GPA0/GPA1 are unused.
- For each string, take the highest pressed fret; no fret pressed means the open string. Accept a change only after 2-3 identical scans, which is the debounce.
Turning frets into notes. The GK-3 gives a pluck onset and velocity for each string. On a pluck, the note is the open-string note (E2 40, A2 45, D3 50, G3 55, B3 59, E4 64) plus the current fret. The Teensy sends it as a USB-MIDI Note On with that velocity. The note ends when the string is muted or the fret changes.