0

Can anyone verify "AT+BLEMIDITX" works for multiple events?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Can anyone verify "AT+BLEMIDITX" works for multiple events?

by keithgroover on Tue Jun 01, 2021 12:14 pm

Hello all,

I'm trying to send multiple MIDI events in one packet using AT+BLEMIDITX. It works perfectly for one event, but if I try to send more than one it does not.

Here's what's on the adafruit site:
https://learn.adafruit.com/introducing-adafruit-ble-bluetooth-low-energy-friend/ble-services

AT+BLEMIDITX
Sends a MIDI event to host.

Codebase Revision: 0.7.0

Parameters: The MIDI event in hex array format, which can be either:

A series of full MIDI events (up to 4 events)
Exactly 1 full MIDI event + several running events without status (up to 7)
Output: None


# Send 1 event (middle C with max velocity)
AT+BLEMIDITX=90-3C-7F
OK

# Send 2 events
AT+BLEMIDITX=90-3C-7F-A0-3C-7F
OK

# Send 1 full event + running event
AT+BLEMIDITX=90-3C-7F-3C-7F
OK


Can anyone verify that this would work with a synth? According to the hex in that example it should be a channel one middle C followed by an aftertouch message.

I would love to be able to send four events in one packet, but I've had no luck so far.

Thank you.

keithgroover
 
Posts: 7
Joined: Tue Aug 15, 2017 11:07 pm

Re: Can anyone verify "AT+BLEMIDITX" works for multiple even

by mikeysklar on Tue Jun 01, 2021 3:12 pm

Might be related and the issue apperas to be still open.

https://github.com/adafruit/Adafruit_Bl ... /issues/29

mikeysklar
 
Posts: 4920
Joined: Mon Aug 01, 2016 8:10 pm

Re: Can anyone verify "AT+BLEMIDITX" works for multiple even

by keithgroover on Tue Jun 01, 2021 3:21 pm

mikeysklar wrote:Might be related and the issue apperas to be still open.

https://github.com/adafruit/Adafruit_Bl ... /issues/29


Thank you. I found that one also and a few more like it. No one has seemed to be able to get it to work with multiple messages in a single packet. If that's the case I'm thinking the documentation should be updated.

Getting this to work would be HUGELY helpful when it comes to MIDI controllers, since it's pretty common to need to be able to send multiple messages simultaneously.

keithgroover
 
Posts: 7
Joined: Tue Aug 15, 2017 11:07 pm

Re: Can anyone verify "AT+BLEMIDITX" works for multiple even

by keithgroover on Tue Jun 15, 2021 2:04 pm

I've been working on this without much luck. If anyone else has a solution I'd greatly appreciate it. Thank you!

keithgroover
 
Posts: 7
Joined: Tue Aug 15, 2017 11:07 pm

Re: Can anyone verify "AT+BLEMIDITX" works for multiple even

by keithgroover on Wed Jun 16, 2021 10:39 am

I'm pretty sure I've figured out what the problem is, though I don't know how to fix it.

Basically, the AT+BLEMIDITX command sends a header and timestamp and then sends whatever you put into it, but it's supposed to put another timestamp after every midi command. It doesn't do this, so if you use the example code it doesn't work:

https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/ble-services
Code: Select all | TOGGLE FULL SIZE
# Send 2 events
AT+BLEMIDITX=90-3C-7F-A0-3C-7F
OK

There should be a timestamp between the 7F and A0, in other words. I ended up just putting "FD" between there and it seems to work fine, but it's a hack.
Attachments
midipacket2.png
midipacket2.png (82.66 KiB) Viewed 115 times

keithgroover
 
Posts: 7
Joined: Tue Aug 15, 2017 11:07 pm

Re: Can anyone verify "AT+BLEMIDITX" works for multiple even

by mikeysklar on Wed Jun 16, 2021 11:21 am

@keithgroover,

Good find. Thanks for digging in and sharing. Can you update the existing github issue on the topic with your findings?

https://github.com/adafruit/Adafruit_Bl ... /issues/29

mikeysklar
 
Posts: 4920
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.