Ble HID and MIDI + USB midi in one sketch

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
TheNothingMan
 
Posts: 3
Joined: Thu Feb 22, 2018 3:26 am

Ble HID and MIDI + USB midi in one sketch

Post by TheNothingMan »

Hello,

I built a custom pageturn pedal with a Feather 32u4 ble. It has two operation modes: First is acting as ble HID device and sending keypresses. Second is acting as MIDI USB device sending MIDI commands (currently NoteOn and NoteOff only).
Now I got a new tablet as scorereader that supports MIDI over ble, which allows me to use all buttons, instead of being limited to 6 "pedals". (ScoreReader is the excellent MobileSheets Pro that supports both pedal and MIDI external controls).
So, my question is, is it possible to set up the Feather for BLE HID and MIDI at the same time and switch operation mode on the fly? I did a quick test by implementing the MIDI example code into my working sketch, but this didn't go well.
Further, in MIDI mode, is it possible to have BLE and USB MIDI active at the same time, e.g. when pressing a button, send NoteOn 60 to a device that is attached by either BLE (tablet) or USB (PC)?
If you need my code, feel free to ask.

Kind regards!

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Ble HID and MIDI + USB midi in one sketch

Post by adafruit_support_mike »

You should be able to swap back and forth between the two modes by calling AT+BLEKEYBOARDEN and AT+BLEMIDIEN when you want to emit one kind of packet or the other.

We haven't tested that though, so you'll have to see how it works in practice. You may end up needing to re-pair the device every time you change modes.

User avatar
TheNothingMan
 
Posts: 3
Joined: Thu Feb 22, 2018 3:26 am

Re: Ble HID and MIDI + USB midi in one sketch

Post by TheNothingMan »

Thanks, I will see what I can do and report if I get it done or have other problems.

User avatar
TheNothingMan
 
Posts: 3
Joined: Thu Feb 22, 2018 3:26 am

Re: Ble HID and MIDI + USB midi in one sketch

Post by TheNothingMan »

It worked as suggested. Thanks!

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”