Build a MIDI controller with capacitive touch pads + Teensy LC

Asked 2 weeks ago Modified 3 days ago Viewed 11 times
Build a MIDI controller with capacitive touch pads + Teensy LC

What it is: a flat MIDI controller with 12 capacitive touch pads on a sheet of acrylic. Plug it into a computer over USB and it shows up as a native MIDI device — no drivers, no extra software. Ableton, FL Studio, GarageBand all see it instantly.

Why Teensy LC: it has native USB MIDI in hardware. An Arduino UNO can be made to look like a MIDI device but requires reflashing the USB chip — not fun. Teensy makes it a one-line change in the Tools menu.

Parts

  • Teensy LC (or Teensy 4.0 if you want headroom)
  • MPR121 12-channel capacitive touch breakout (I²C)
  • 1 sheet of 3mm acrylic, ~200×150mm
  • Copper foil tape (the kind sold for stained glass)
  • A few inches of single-core wire for soldering to the foil
  • USB-C cable

Building the pads

1. Lay a grid on paper, 4×3 cells, each ~40mm square.
2. Cut 12 squares of copper foil and stick them onto the underside of the acrylic.
3. Solder a short wire to each pad — use a low-temp iron and flux, the foil is thin.
4. Run each wire to a channel on the MPR121.

Wiring (Teensy LC ↔ MPR121)

  • 3.3V → VCC
  • GND → GND
  • SDA → MPR121 SDA
  • SCL → MPR121 SCL
  • IRQ → any digital pin (optional — for interrupt-driven reads)

Code outline (Arduino IDE with Teensyduino installed; Tools → USB Type → MIDI)

#include <Adafruit_MPR121.h>
Adafruit_MPR121 cap;
void setup() {
  cap.begin(0x5A);
  usbMIDI.begin();
}
uint16_t prev = 0;
void loop() {
  uint16_t cur = cap.touched();
  for (int i = 0; i < 12; i++) {
    bool now = cur & (1 << i);
    bool was = prev & (1 << i);
    if (now && !was) usbMIDI.sendNoteOn(60 + i, 127, 1);
    if (!now && was) usbMIDI.sendNoteOff(60 + i, 0, 1);
  }
  prev = cur;
  delay(5);
}

Debouncing: I added a 50ms hold timer per pad — without it the chip sometimes flickers a touch off-on-off when your finger arrives. Velocity sensitivity isn't possible with the MPR121; for that you'd need force-sensing resistors instead.