Personal Mirror
Go to file
RobertoHE 4a99e1e2ea
Removed size filter and added runningStatus enable
Previous size filter might add a 2-bytes full midi and other running status (other byte) like a 3-bytes full midi message wrongly. It may cause a bug depending if serial Parser accepts or not running status messages.
This commit removes that previous and unnecessary size filter but it still discriminte the size of message after this point:
2f48b0f25b/test/msvc/ConsoleApplication2.cpp (L78-L91)

If #define RUNNINGSTATUS_ENABLE is commented, it will transform all incoming runningStatus messages in full midi messages. Else, it will put in the buffer the same info that it had received (runningStatus will be not transformated).
I recommend not use runningStatus by default. Only use if parser accepts runningStatus and your application has a so high transmission rate.
2021-08-05 12:57:14 +02:00
docs Delete Bluetooth LE MIDI Specification.url 2021-08-03 21:54:07 +02:00
examples Update MidiBle.ino 2020-12-20 23:38:43 +01:00
src parser pointer types as int, not byte 2021-08-04 05:40:29 +02:00
test/msvc Removed size filter and added runningStatus enable 2021-08-05 12:57:14 +02:00
.gitignore parser test project in MSVC2019 2021-08-03 21:46:31 +02:00
LICENSE Initial commit 2018-10-23 21:45:25 +02:00
README.md Update README.md 2020-10-18 07:49:50 +02:00
keywords.txt rename BLEMIDI to BLEMIDI_Transport & cleanup 2020-10-11 11:37:45 +02:00
library.properties Add mbed_nano to list of compatible architectures 2021-05-04 02:01:20 -07:00

README.md

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, 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.