C++ MIT

Arduino-BLE-MIDI

MIDI over Bluetooth Low Energy (BLE-MIDI) 1.0 for Arduino

L

lathoub

Dernière activité 14 juil. 2026
lathoub/Arduino-BLE-MIDI

305

étoiles

45

forks

17

issues ouvertes

arduinoarduino-libraryarduino-midi-libraryarduino-nanoarduino-nano-33-blearduino-nano-rp2040-connectbleble-midibluetooth-low-energyesp32midirp2040transport-layer

Ce README est souvent en anglais.

Arduino BLE-MIDI Transport

arduino-library-badge

This library implements the BLE-MIDI transport layer for the FortySevenEffects Arduino MIDI Library

Installation

This library depends on the Arduino MIDI Library.

When installing this library from the Arduino IDE, the dependency be downloaded and installed in the same directory as this library. (Thanks to the depends clause in library.properties)

When manually installing this library, you have to manually download Arduino MIDI Library from github and install it in the same directory as this library - without this additional install, this library will not be able to compile.

When using ESP32 consider using NimBLE (NimBLE-Arduino). When using the Arduino NANO 33 BLE or Arduino NANO RP2040 Connect, you must install ArduinoBLE

Usage

Basic / Default

#include <BLEMIDI_Transport.h>
#include <hardware/BLEMIDI_ESP32.h>
...
BLEMIDI_CREATE_DEFAULT_INSTANCE()
...
void setup()
{
   MIDI.begin();
...
void loop()
{
   MIDI.read();

will create a instance named BLEMIDI and listens to incoming MIDI.

Namespace collision with ArduinoBLE

Note: error: redefinition of 'class BLEDescriptor' is a namespace collision on class BLEDescriptor between ESP32 BLE and ArduinoBLE. Solution: remove ArduinoBLE

using NimBLE for ESP32 with a custom name and turns LED on when its connected

#include <BLEMIDI_Transport.h>
#include <hardware/BLEMIDI_ESP32_NimBLE.h>
...
BLEMIDI_CREATE_INSTANCE("CustomName", MIDI)
...
void setup()
{
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, LOW);

  BLEMIDI.setHandleConnected(OnConnected);
  BLEMIDI.setHandleDisconnected(OnDisconnected);
  
  MIDI.begin();
...
void loop()
{
  MIDI.read();
...
void OnConnected() {
  digitalWrite(LED_BUILTIN, HIGH);
}

void OnDisconnected() {
  digitalWrite(LED_BUILTIN, LOW);
}
   

will create a instance named BLEMIDI and listens to incoming MIDI.

Tested boards/modules

  • ESP32 (OOB BLE and NimBLE)
  • Arduino NANO 33 BLE
  • Arduino NANO RP2040 Connect

Other Transport protocols:

The libraries below the same calling mechanism (API), making it easy to interchange the transport layer.

Projets similaires

An Arduino library to use Midi over BLE (Bluetooth Low Energy), on ESP32 boards

C++
Mmax22-
353 étoiles40

A fork of the NimBLE library structured for compilation with Arduino, for use with ESP32, nRF5x.

Carduinoarduino-ble-libraryarduinoble
Hh2zero
1,1 k étoiles221

Android Bluetooth Low Energy (BLE) Fast Development Framework. It uses simple ways to filter, scan, connect, read ,write, notify, readRssi, setMTU, and multiConnection.

Javaandroidbleblue
JJasonchenlijian
5,5 k étoiles1,2 k