nils b53d29b340 Hardware: MIDI 1 in + 3 hardwired mirror out jacks
One UART0 TX fans to 3 identical TRS-A output jacks (J4/J5/J6) via a
shared MIDI_TX node — a hardwired MIDI-thru splitter for cabling
convenience, no per-jack channel separation. Refdes cascade: CV outs
shift J5-J8 -> J7-J10, keypad header J9 -> J11. BOM jack count 6 -> 8.
2026-08-21 20:17:05 +02:00
2026-08-21 09:34:59 +02:00

pico-pi-midi (Rust)

BLE-MIDI keypad firmware for the Raspberry Pi Pico W (RP2040 + CYW43439), written in Rust using embassy, the cyw43 driver (Bluetooth), and the TrouBLE BLE host.

This is the Rust port of the original C/BTstack firmware (now kept separately as pico-pi-midi-c). It talks BLE-MIDI 1.0 to iOS / macOS Core MIDI, turning the Pimoroni Pico RGB Keypad into a 16-pad wireless MIDI controller.

What it does

  • 16-pad keypad (Pimoroni RGB Keypad Base): reads buttons over I²C (GPIO expander @ 0x20) and drives APA102 RGB LEDs over SPI (CS=17, SCK=18, MOSI=19).
  • BLE-MIDI 1.0 GATT server (MIDI Service 03B80E5A-…), advertised so Core MIDI discovers it as a MIDI device. Pad presses → Note On/Off over Bluetooth; incoming Note On lights the pad.
  • Octave display: the BOOTSEL button cycles the keypad's note offset by +12 and flashes the active octave as a digit on the 4×4 grid for 500 ms.
  • Onboard LED heartbeat (driven via the CYW43 chip — the Pico W's LED is on the wireless chip, not an RP2040 pin).
  • USB serial logging via embassy-usb-logger — connect and read with screen /dev/cu.usbmodem* 115200 to see boot/advertising logs.

Roadmap

This is v1: a BLE-MIDI keypad. The goal is a flexible MIDI router — MIDI over USB, BLE, keypad, TRS, and 4 stereo CV outputs, with channels configurable at runtime via an LCD. See the architecture notes (kept in the session memory) for the plan.

Building

Requires Rust stable (≥1.93) and the thumbv6m-none-eabi target:

rustup target add thumbv6m-none-eabi
cargo build --release

The CYW43 firmware blobs (cyw43-firmware/*.bin) are committed here so no network access is needed at build time. They are redistributable under the permissive binary license in the upstream embassy cyw43-firmware directory.

Flashing

cargo build --release
elf2uf2-rs convert target/thumbv6m-none-eabi/release/rgb-keypad target/uf2/rgb-keypad.uf2
# hold BOOTSEL + plug in the Pico W, then:
picotool load target/uf2/rgb-keypad.uf2 -x

License

GPL-3.0-or-later (see LICENSE).

src/codec.rs is a Rust port of the BLE-MIDI 1.0 packet codec from rppicomidi/pico-w-ble-midi-lib, which is MIT-licensed; that attribution is retained in the file header. MIT is GPL-3.0-compatible, so the repository as a whole is GPL-3.0-or-later while that file preserves its MIT provenance.

S
Description
No description provided
Readme GPL-3.0
306 KiB
Languages
Rust 99.6%
RPC 0.4%