In the 2.0.0 release of the Arduino Mbed OS Boards platform, the mbed architecture split into four architectures: - mbed_edge: Arduino Edge Control - mbed_nano: Nano 33 BLE and Nano RP2040 Connect - mbed_rp2040: Raspberry Pi Pico - mbed_portenta: Portenta H7 The mbed architecture should be retained for backwards support, but the new mbed_nano should also be added to avoid spurious incompatibility warnings and the library's examples being shown under the File > Examples > INCOMPATIBLE menu of the Arduino IDE when the Nano 33 BLE board is selected. |
||
|---|---|---|
| examples | ||
| src | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
| keywords.txt | ||
| library.properties | ||
README.md
Arduino BLE-MIDI Transport
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, you have to 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.
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
Other Transport protocols:
The libraries below the same calling mechanism (API), making it easy to interchange the transport layer.