feat: add optional BLE MIDI support for ESP32 - #187
Open
godden-sys wants to merge 2 commits into
Open
godden-sys wants to merge 2 commits into
godden-sys wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.