Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
5de3938ee5
|
|
@ -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)
|
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
|
# Supported devices
|
||||||
ESP32
|
ESP32
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include <BLEDevice.h>
|
#include <BLEDevice.h>
|
||||||
#include <BLEUtils.h>
|
#include <BLEUtils.h>
|
||||||
#include <BLEServer.h>
|
#include <BLEServer.h>
|
||||||
|
#include <BLE2902.h>
|
||||||
|
|
||||||
#include "utility/AbstractMidiInterface.h"
|
#include "utility/AbstractMidiInterface.h"
|
||||||
using namespace Midi;
|
using namespace Midi;
|
||||||
|
|
@ -202,6 +203,9 @@ bool BleMidiInterface::begin(const char* deviceName)
|
||||||
BLECharacteristic::PROPERTY_NOTIFY |
|
BLECharacteristic::PROPERTY_NOTIFY |
|
||||||
BLECharacteristic::PROPERTY_WRITE_NR
|
BLECharacteristic::PROPERTY_WRITE_NR
|
||||||
);
|
);
|
||||||
|
// Add CCCD 0x2902 to allow notify
|
||||||
|
_characteristic->addDescriptor(new BLE2902());
|
||||||
|
|
||||||
_characteristic->setCallbacks(new MyCharacteristicCallbacks(this));
|
_characteristic->setCallbacks(new MyCharacteristicCallbacks(this));
|
||||||
// Start the service
|
// Start the service
|
||||||
service->start();
|
service->start();
|
||||||
|
|
|
||||||
|
|
@ -277,11 +277,11 @@ namespace Midi {
|
||||||
public:
|
public:
|
||||||
// sending
|
// sending
|
||||||
void sendNoteOn(DataByte note, DataByte velocity, Channel channel) {
|
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) {
|
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) {
|
void sendProgramChange(DataByte number, Channel channel) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue