Tim’s Status Report (11/14)

I’ve received the overlay PCB from JLCPCB. Test-fitting it on the Squier Telecaster neck confirmed that the frets and strings line up exactly with the pads on the board, so the pad layout needs no changes.

I’m now testing ways to mount it. I’m using insulating tape between the frets so the PCB sits just below the fret crowns. That way a pressed string still seats properly on the fret, so the guitar plays and sounds normal, while still closing the contact on the pad. I’ll settle on the tape height through play-testing across the neck.

I’m still waiting on the solder-paste stencil from JLCPCB. Once it arrives, I’ll mount the parts I’ve already ordered (the 8 MCP23S17 chips, decoupling capacitors and the J1 connector). I’m also ordering a pre-crimped 6-pin JST SH (1.0 mm pitch) cable to connect J1 to the Teensy 4.1. It will carry the SPI lines plus 3.3 V and ground. After assembly, I’ll check that all 8 chips and 126 pads respond, then switch the firmware from the simulator to the real board.

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

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.

Tim’s Status Report (10/24)

We are ordering the fret-overlay flex PCB as bare boards and soldering the parts ourselves, instead of paying JLCPCB to assemble it. The assembled quote came to $390.36 for 5 boards, with 2 of them assembled.
Two decisions got us here:

  • Rails. JLCPCB’s flex-assembly panel rule forced a much larger panel than the board itself. We found a layout that passes the rule, but the extra area and the assembly fees made the order expensive.
  • Self-assembly. We will order bare boards plus a cheap stencil, buy the chips and parts from LCSC, and reflow them ourselves. A bare board doesn’t need rails, so it is ordered at its own size.

    The assembled order cost $390.36. Most of that is board area and assembly fees, not parts: the chips and other parts were only about $25 of it.

We dropped JLCPCB assembly. We will order the board bare at its own size and reflow the parts ourselves.

  • Board. A single bare board, 471.15 x 160.05 mm, with no rails or frame. The 240 mm rule only applies to assembly, and the board fits JLCPCB’s 234 x 490 mm single-piece flex limit. Price: $154.80
  • Stencil. Ordered separately as a stencil-only item, using a 111 x 53 mm crop of the chip area. That cost $17.16, versus $31.58 for the 520 x 420 mm stencil the PCB-linked order required. All 248 openings were checked against the copper pads.
  • Parts. Bought from LCSC, JLCPCB’s sister store, with shipping combined into the JLCPCB box. Price: $25.62

Total comes to $197.58 + shipping which is significantly lower than price for two assembled boards.

Tim’s Status Report (10/3)

MIDI Guitar Hardware Update

Donor guitar

  • Fender Squier Telecaster (25.5″ scale, 21 frets)
  • Chosen for its bolt-on neck, roomy control cavity, and low cost
  • An initial check showed 18″ from the nut to fret 21, which matches the theoretical 25.5″ scale layout

Fret sensing plan

  • A custom flex PCB overlay sits on the frets, with 126 pads (6 strings × 21 frets)
  • Each pad has its own trace, and the grounded string pulls a pad low when pressed
  • This lets us detect chords with several strings on the same fret

Measurements we’re collecting for the PCB layout

  • Nut-to-fret-crown distances, checked against the calculated fret positions
  • Fret crown width, height, and length
  • Fretboard width at the nut, fret 12, and fret 21, plus the fretboard radius
  • Each string’s lateral position at frets 1, 12, and 21, plus at the nut and saddle
  • String gauges and nut-to-saddle distance
  • Baseline string action, to plan for the overlay thickness

Pluck and velocity sensing: Roland GK-3

  • We selected the Roland GK-3 divided (hexaphonic) pickup, which gives a separate signal for each string
  • It mounts without drilling, so the stock bridge stays in place and each string’s ground path is preserved
  • It also makes the setup reversible, which suits prototyping
  • Our own ADC and firmware will read the six signals for pluck timing and velocity
  • Still to confirm: breakout box and cable, mounting position on the Tele, and ADC front end

Next steps

  • Finish the measurements and generate the pad layout
  • Order a test flex PCB, and prototype the scanning firmware on a bench board first

Team Status Update 10/3

Trained and tested prediction model
Model Risks:
Next-chord prediction is way under the 80% top-1 target (best: 50.7%). Root-only accuracy is 58%, so the gap is probably mostly label noise, not model weakness.

Robustness to live timing jitter misses our target with a 29% relative accuracy drop vs. a 10% goal. We are considering ordering simultaneous notes deterministically before tokenizing, and training with more jitter variety.

Piezo Pickups:

Looking for a cheaper alternative to make an affordable product.
Piezo circuitry schematic close to completion.

Tim’s Status Report (9/26)

Found suitable donor guitar on Facebook Marketplace. Negotiating and planning to purchase this week.

Finalized overall design for the guitar’s fret matrix. Planning to implement in KiCad and order flex PCB after the precise measurements are taken of our guitar neck.

 

Aaqib’s Status Report (9/26)

  • Researched piezo pickups and implementation to analyze drum’s frequency.
  • Considering different methodologies of pickup filtering for quality audio (and also so that I don’t create a crater on the Teensy).
  • Slightly behind schedule; however, I should be able to achieve required implementations which include piezo mounting, wiring and testing along with calibrations.