BLEMIDI-Adapter
Turns an Arduino into a Bluetooth Low Energy (BLE) to 5-pin DIN MIDI adapter.
- Boards: 🛈
- Nano 33 IoT, Nano 33 BLE, ESP32, ESP32-S3, Pi Pico W
Configuration
- If you're using a Pi Pico W, you'll have to enable the Bluetooth stack from the Tools > IP/Bluetooth Stack menu in the IDE.
- If you're using an ESP32, you can optionally switch to the NimBLE backend by installing the h2zero/NimBLE-Arduino library, and adding
#define CS_USE_NIMBLE
at the top of this sketch.
- If you're not using a Pico or an ESP32, you'll have to install the ArduinoBLE library.
Connections
- TXD: connected to a MIDI 5-pin DIN output connector (with series resistor, possibly through a buffer)
- RXD: connected to a MIDI 5-pin DIN input connector (with an optocoupler)
See https://midi.org/specifications/midi-transports-specifications/5-pin-din-electrical-specs for the schematic, optocoupler models and resistor values.
Behavior
- The Arduino will advertise itself as a Bluetooth Low Energy MIDI device with the name
MIDI Adapter
.
- When you connect to the Arduino using your phone or computer, the built-in LED turns on to indicate that the connection was successful.
- Any MIDI messages sent to the Arduino over BLE are sent out to the 5-pin DIN output connector.
- Any MIDI messages sent to the Arduino through the 5-pin DIN input connector are sent over BLE.
- See also
- MIDI over BLE
-
MIDI Tutorial
Written by PieterP, 2024-01-21
https://github.com/tttapa/Control-Surface
void setup() {
midi_ser | pipes | midi_ble;
}
void loop() {
}
constexpr PinStatus_t LOW
constexpr PinStatus_t HIGH
constexpr PinMode_t OUTPUT
The main header file that includes all Control-Surface header files.
static void updateAll()
Update all enabled instances of this class.
static void beginAll()
Begin all enabled instances of this class.
bool isConnected() const
Returns true if a BLE central is currently connected.
void setName(const char *name)
Set the BLE device name.
A class for MIDI interfaces sending and receiving MIDI messages over a Hardware Serial port.
void digitalWrite(pin_t pin, PinStatus_t val)
An ExtIO version of the Arduino function.
std::pair< MIDI_Pipe, MIDI_Pipe > BidirectionalMIDI_Pipe
A bidirectional pipe consists of two unidirectional pipes.
A class for MIDI interfaces sending MIDI messages over a Bluetooth Low Energy (BLE) connection.