max22- / ESP32-BLE-MIDI

An Arduino library to use Midi over BLE (Bluetooth Low Energy), on ESP32 boards
MIT License
236 stars 28 forks source link

ESP32-BLE-MIDI

An Arduino library to use Midi over Bluetooth Low Energy (BLE) on ESP32 boards.
If you find it useful you can Buy Me a Coffee at ko-fi.com if you want.

Quick start

#include <Arduino.h>
#include <BLEMidi.h>

void setup() {
  Serial.begin(115200);
  Serial.println("Initializing bluetooth");
  BLEMidiServer.begin("Basic MIDI device");
  Serial.println("Waiting for connections...");
  //BLEMidiServer.enableDebugging();  // Uncomment if you want to see some debugging output from the library
}

void loop() {
  if(BLEMidiServer.isConnected()) {             // If we've got a connection, we send an A4 during one second, at full velocity (127)
      BLEMidiServer.noteOn(0, 69, 127);
      delay(1000);
      BLEMidiServer.noteOff(0, 69, 127);        // Then we stop the note and make a delay of one second before returning to the beginning of the loop
      delay(1000);
  }
}

Check the header file here to view all available MIDI commands and callbacks.

Changes

Future work

Thanks

Thanks to the authors of those pages / pieces of code :

Message to users

If you make some noise with it, I would be glad to see your projects ! Don't hesitate to drop me an e-mail.