ProjectsAboutExperienceSkillsContactRésumé
← All projects

Wireless MIDI Interface · Custom PCB

AirMidi

CESP32FreeRTOSMIDIPCB Design

A battery-powered wireless MIDI interface that gives any TRS MIDI device Bluetooth and Wi-Fi. The hardware is my own design: a custom PCB carrying a XIAO ESP32-C6 (or S3), an optocoupled MIDI input, and a Li-ion cell feeding a buck-boost regulator, inside a 3D-printed enclosure. One button switches between Play mode (Wi-Fi off), Network mode, and a Setup access point, and everything else is configured from a web UI the box serves itself.

The firmware is C on ESP-IDF and FreeRTOS, built around a portable C11 core that never includes an ESP-IDF header, so all of it can be unit tested on a laptop. Around that core it covers most of the ways MIDI travels without a cable: BLE MIDI (8.4 ms median from the air to the TRS jack, nothing lost in the hardware tests), Network MIDI 2.0 with forward error correction that macOS connects to natively, RTP-MIDI with lost packets repaired from the recovery journal, USB MIDI on the S3, a BLE central mode that connects to wireless keyboards by itself, and ESP-NOW so two boxes can act as a wireless cable. Over MIDI-CI it asks the synth on its jacks for its controls, and the web UI draws faders, pickers, and toggles for them.

Updates can come from the browser, the latest GitHub release, or over BLE when the box isn't on Wi-Fi, and every image has to be signed; a new image has to pass a self-test or the box rolls back. 17 host unit test suites run under AddressSanitizer and UndefinedBehaviorSanitizer in CI, including property tests that push the RTP-MIDI journal through 30-50% packet loss. On the hardware side, an audio interface cabled to the box puts both ends of every test on the same clock, so latency and loss get measured one way with no round trip to guess at.