diff --git a/README.md b/README.md index ff4992e..ecc62c4 100644 --- a/README.md +++ b/README.md @@ -3,5 +3,7 @@ MIDI over Bluetooth Low Energy (BLE-MIDI) 1.0 for Arduino Call interface similar to [FortySevenEffects/MIDI](https://github.com/FortySevenEffects/arduino_midi_library) and [lathoub/AppleMIDI](https://github.com/lathoub/Arduino-AppleMIDI-Library) +Inspired by Pedalino https://github.com/alf45tar/Pedalino by alf45tar + # Supported devices ESP32 diff --git a/src/Ble_esp32.h b/src/Ble_esp32.h index 9db221f..313281d 100644 --- a/src/Ble_esp32.h +++ b/src/Ble_esp32.h @@ -4,6 +4,7 @@ #include #include #include +#include #include "utility/AbstractMidiInterface.h" using namespace Midi; @@ -202,6 +203,9 @@ bool BleMidiInterface::begin(const char* deviceName) BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_WRITE_NR ); + // Add CCCD 0x2902 to allow notify + _characteristic->addDescriptor(new BLE2902()); + _characteristic->setCallbacks(new MyCharacteristicCallbacks(this)); // Start the service service->start(); diff --git a/src/utility/AbstractMidiInterface.h b/src/utility/AbstractMidiInterface.h index 26a0071..3b41bf7 100644 --- a/src/utility/AbstractMidiInterface.h +++ b/src/utility/AbstractMidiInterface.h @@ -277,11 +277,11 @@ namespace Midi { public: // sending void sendNoteOn(DataByte note, DataByte velocity, Channel channel) { - sendChannelMessage(MidiType::NoteOn, channel, note, velocity); + sendChannelMessage(MidiType::NoteOn, note, velocity, channel); } void sendNoteOff(DataByte note, DataByte velocity, Channel channel) { - sendChannelMessage(MidiType::NoteOff, channel, note, velocity); + sendChannelMessage(MidiType::NoteOff, note, velocity, channel); } void sendProgramChange(DataByte number, Channel channel) {