Arduino Nano 33 BLE - USBMIDI Device

Hi everyone, this is my first post so I will try to make it a clear one, here goes

Ive been designing a midi controller for a while now. I`ve experimented with the Teensy 3.2 and Teensy 3.5 which make it quite straightforward to use MIDIUSB, however I wanted to have Bluetooth in my project and a way of writing apps to control the midi device and it doesn't seem possible with the Teensy platform.

I came across the Arduino Nano 33 BLE which at first seemed to be a good solution and it is supposed to be USBMIDI compatible. Well I've tried everything I can think of but I just cant get my PC (WIN 10) to see the Nano 33 BLE as a USBMIDI device.

There seems to be several different midi libraries floating around the net with no real clarity on which one to use, I've tried several with no luck.

The code I am using for my application works fine with the Teensy, so I wont over complicate things by adding it here. The problem appears to be library related I think and Im guessing there is no library that supports the Arduino Nano 33 BLE currently.

To be clear, I'm not currently trying use the Bluetooth, just MIDI over USB at the moment!

Ive tried using both of theses header files:

#include <usbmidi.h>
#include <MIDIUSB.h>

and also the following code for the Control-Surface library:

// Include the library
#include <Control_Surface.h>

// Instantiate a MIDI Interface to use
USBMIDI_Interface midi;

However, nothing allows my Nano 33 BLE to show as a USBMIDI device.

I checked the Device Manager (see pic) but nothing showing.

I'm stumped, if anyone could offer me a little support, it would be great.

thanks
Ged.

Device Manager.jpg

Device Manager.jpg

USB MIDI support for the Nano 33 BLE was only added to Control Surface very recently (February 8th), and it has not yet been merged into the master branch, so you'll have to install the new-input branch for now.

There seem to be some issues with the underlying USB stack, probably data races in the Arm mbed os or Nordic USB code. It seems to affect the serial communication as well. I have opened an issue with the ArduinoCore-mbed repository, but I haven't received any responses from the Arduino team :frowning:

Sending MIDI seems to work fine, but the receiving code sometimes gets the wrong USB packet size, which means that some bytes get lost. I believe this is not something I can fix without help from someone who has experience with the Nordic USB hardware and firmware.

Pieter

Hi PieterP, thanks for the quick reply.

I followed your link, installed the new library and I tried to upload the Note-LED sketch onto my Nano 33 BLE. However, it wasn't successful but I'm not sure why.

I've attached the compile error file for you to have a look at.

thanks again
Ged.

P.S. If you help me to solve this, ill be adding you to my Christmas card list....

ErrorMsg.txt (301 KB)

Ah, right, this is pins_arduino.h macros unavailable during library discovery phase · Issue #124 · arduino/ArduinoCore-mbed · GitHub. You can fix it by editing your ~/.arduino15/packages/arduino/hardware/mbed/1.3.2/cores/arduino/Arduino.h file to ignore the ARDUINO_LIB_DISCOVERY_PHASE macro:

  20   │ #if ARDUINO_LIBRARY_DISCOVERY_PHASE == 1
  21   │ #define ARDUINO_LIB_DISCOVERY_PHASE
  22   │ #endif
  23   │ #if !defined(Arduino_h)
  24   │ // && !defined(ARDUINO_LIB_DISCOVERY_PHASE)    <--- This line
  25   │ #define Arduino_h
  26   │ 
  27   │ #if defined(__cplusplus)
  28   │ #if !defined(ARDUINO_AS_MBED_LIBRARY)

Hi PieterP

That seems to have done it, I'm really happy, thankyou, I would have never of figured it out on my own....

Just one last thing, you wouldn't happen to know why I keep getting this line:

Invalid library found in C:\Program Files (x86)\Arduino\libraries\libraries: no headers files (.h) found in C:\Program Files (x86)\Arduino\libraries\libraries

Cant thank you enough...
Ged.

The correct library folder structure is C:\Program Files (x86)\Arduino\libraries\Control-Surface, not C:\Program Files (x86)\Arduino\libraries\libraries\Control-Surface. See https://www.arduino.cc/en/Guide/Libraries.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.