Arduino Forum

Using Arduino => Audio => Topic started by: Monoth on Aug 28, 2018, 08:24 pm

Title: Successfully sending MIDI CC over Bluetooth? (Not note on/off)
Post by: Monoth on Aug 28, 2018, 08:24 pm
Hi there,

I recently got a few adafruit bluefruit feather LE boards as I read that they can send MIDI over USB:
https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/overview (https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/overview)

I tried one and yes indeed, it sure can. However, it only seems to be able to send note values and not continuous control messages for pots/sliders etc..

The only examples I see of midi being sent are in these examples, and they only concern note on/off:
https://learn.adafruit.com/bluetooth-le-midi-controller/software (https://learn.adafruit.com/bluetooth-le-midi-controller/software)
https://learn.adafruit.com/wireless-untztrument-using-ble-midi/overview-uniontownlabs (https://learn.adafruit.com/wireless-untztrument-using-ble-midi/overview-uniontownlabs)

I have already posted on the Adafruit forum and no response so I'm just wondering if anyone on here has found a way to send CC over bluetooth?

p.s. if this post is not permitted as it's not an Arduino product then my apologies.

Thank you :)
Title: Re: Successfully sending MIDI CC over Bluetooth? (Not note on/off)
Post by: PieterP on Aug 28, 2018, 09:00 pm
CC messages are almost identical to note messages. Just replace the 0x8 or 0x9 status nibble (for note off and note on resp.) with the 0xB status nibble for CC. Data 1 is the controller number instead of the note number, and data 2 is the CC value instead of the velocity.

Pieter
Title: Re: Successfully sending MIDI CC over Bluetooth? (Not note on/off)
Post by: Monoth on Aug 28, 2018, 09:37 pm
Thanks so much for your response. So, if I understand you correctly, the setup would not be like this?:

Code: [Select]
  // send note on
  midi.send(0x90, current_note, 0x64);

  // send note off
  midi.send(0x80, current_note, 0x64);

  // Send cc instead
  midi.send(0xB, contoller_number, ccvalue);



"midi.send" is the function used in the BLE library for the Adafruit controller
Title: Re: Successfully sending MIDI CC over Bluetooth? (Not note on/off)
Post by: PieterP on Aug 28, 2018, 10:09 pm
Almost, 0xB is the high nibble of the status byte. The low nibble is the channel (0x0 - 0xF for channels 1 - 16 respectively). So if you want to send on channel 1, you use 0xB0 as status byte, 0xB1 for channel 2, 0xB2 for channel 3, etc.
Title: Re: Successfully sending MIDI CC over Bluetooth? (Not note on/off)
Post by: Monoth on Aug 28, 2018, 10:58 pm
Great. Thanks so much for clearing that up:) I was used to using the midi serial midi library which has separate functions for notes and cc's. That's why I was confused.

I'll test this out asap and report back!
Title: Re: Successfully sending MIDI CC over Bluetooth? (Not note on/off)
Post by: wheels1758 on Oct 27, 2018, 02:21 am
I am not the OP but I am having an issue sending CC messages using the adafruit blemidi library. I was able to successfully send a CC signal, but it is hit and miss. If I print my Cc value to the serial monitor, I can see that it is changing, so the hardware setup seems to be fine, but it only occasionally sends the signal (testing by controlling loopcommunity PRIME via midimittr). Is there a way to flush the midi commands to ensure they actually send?