Replies: 2 comments
-
Central mode is currently not supported. If you have some BLE background, adding it to your application should be relatively straightforward though, as most of the Control Surface components can be reused. Here's the rough outline:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks Pieter. I think it's beyond my current skills. Gonzo. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi.
I'm trying to set up a PicoW to receive BLE MIDI from an instrument, and send it to USB-MIDI.
Using the ArduinoIDE, I set the USB stack to "Adafruit TinyUSB", and the IP/Bluetooth stack to "IPV4+IPV6+Bluetooth-32K". It all compiles and loads OK. I can see the USB MIDI device plugged into my PC, and (using my phone) I can see the BLE device, but it is set up as a peripheral, not a central.
How to I get the BLE to be a central so it can connect to my peripheral instruments?
When I connect to the BLE device with my phone, the LED comes on - so I think that's working.
Code:
`#include <Control_Surface.h>
#include <MIDI_Interfaces/BluetoothMIDI_Interface.hpp>
// Instantiate a MIDI over USB interface
USBMIDI_Interface midi_usb;
// Instantiate a MIDI over BLE interface
BluetoothMIDI_Interface midi_ble;
// Instantiate the pipe to connect the two interfaces
BidirectionalMIDI_Pipe pipes;
void setup() {
// Change the name of the BLE device (must be done before initializing it)
midi_ble.setName("BLE-PICO");
// Manually route MIDI input from the BLE interface to the USB interface,
// and the MIDI input from the USB interface to the BLE interface
midi_ble | pipes | midi_usb;
// Initialize the MIDI interfaces
MIDI_Interface::beginAll();
// Initialize the built-in LED
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
// Continuously poll all interfaces and route the traffic between them
MIDI_Interface::updateAll();
// Display the connection status using the built-in LED
digitalWrite(LED_BUILTIN, midi_ble.isConnected() ? HIGH : LOW);
}
`
Beta Was this translation helpful? Give feedback.
All reactions