Skip to content

feat: add optional BLE MIDI support for ESP32 - #187

Open
godden-sys wants to merge 2 commits into
corrados:mainfrom
godden-sys:main
Open

godden-sys wants to merge 2 commits into
corrados:mainfrom
godden-sys:main

Conversation

@godden-sys

Copy link
Copy Markdown

Description

This adds an optional Bluetooth Low Energy MIDI transport for ESP32 targets, using the BLE library already included in the arduino-esp32 core. USB/serial MIDI and Teensy paths remain unchanged. The feature is opt-in via a build flag so it does not affect existing behavior.

What changed

Added USE_BLE_MIDI build-flag gating in platformio.ini for ESP32 environments.
Extended edrumulus.ino with:
BLE MIDI server, characteristic, and advertising setup
BLE-MIDI packet framing for note on/off, control change, and aftertouch
Inbound MIDI handling over BLE for the existing control surface
Dual-path MIDI output so USB/serial MIDI and BLE MIDI can coexist

Files

platformio.ini
edrumulus.ino

How to use

Build with USE_BLE_MIDI=1 enabled for an ESP32 environment.
Pair/connect from a BLE MIDI host; the device advertises as Edrumulus.
MIDI events are sent over BLE when a client is connected; existing USB/serial MIDI continues to work.

Compatibility

Teensy and non-BLE ESP builds are unaffected.
No new external libraries are required beyond the ESP32 BLE library bundled with arduino-esp32.
USB MIDI/TinyUSB behavior is preserved.

Notes

Initial testing shows functional BLE MIDI output; latency tuning may still need feedback from users.
Current implementation sends multiple messages per hit; further optimization is possible if needed.

@godden-sys godden-sys closed this Oct 4, 2026
@godden-sys godden-sys reopened this Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant