Team Status Report (11/7)

Jai: Model prototype complete with music generation at ~70% accuracy with in sample data sets. Out of sample music tested. For now, the music sounds blocky (as expected with MIDI notes), however, further steps may involve quantizing to better output music.

Tim: Fret Matrix PCB firmware written and combined with Piezo element scanning. Used chord simulator to test.

Aaqib: Piezo implementation for 2/6 channels complete. Further steps involves combining with bridge of guitar.

Tim’s Status Report (11/7)

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

Aaqib’s Status Report (11/7)

Completed prototype implementation of piezo circuit on two channels and firmware w/o guitar string tapping.
Tapping works as intended and preliminary measurements show good results (i.e. slow, medium and fast taps correspond to variable values at least to an approximation).

Next Steps:
– Connect to guitar bridge to see string vibrations. If guitar vibrations captured accurately, then move to rest of the strings (this is simply a copy paste of original schema).

Tim’s Status Report (10/31)

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

  1. Write IOCON (register 0x0A) with HAEN = 1. Until HAEN is set, every chip answers address 000, so one write reaches all 8.
  2. 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

  1. 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.
  2. A pressed pad reads 0. A lookup table generated from pad_map.csv converts (chip, pin) into (string, fret). U8 GPA0/GPA1 are unused.
  3. 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.

Team Status Update 10/31

Model:
Waiting for hardware to be done to test actual performance. Currently at a reasonable point when testing manually

Risks are that the delay for the input from guitar is higher than expected limiting the amount of time the model gets for generation. The mitigation here would be to predict farther in the future and use a smaller faster model and sacrifice output note quality for more realtime output

Jai Status Report 10/31

Tested generation manually in order to tune the models and see current performance.

Currently waiting on the hardware to test the whole pipeline to determine what needs to be fixed. The manual test is good but not really indicative of how an actual performance would sound like given the latency and jitter matters

On track, hopefully with be able to test using some hardware by next week