Receiving USB MIDI data with Arduino

I have an Akai APC mini with a USB MIDI output, and I want to send signals from the Akai into an Arduino Uno R3.

I've researched this topic a decent amount, but most posts I've found are about using the Arduino as a MIDI controller, which is not what I want. I only want to receive USB MIDI data with the Arduino, I don't want to send out any MIDI data. The Arduino will process the USB MIDI data received and drive a string of LED lights based on what button is pushed on the Akai.

Can this be done by plugging the Akai directly into the Uno R3 via a USB host shield? Or do I need USB MIDI host like this to process the data in between?

If you are using an UNO, then you have USB support, no idea why you would want to add a shield. In a nutshell, you want a sketch to read the USB data and use that data to light some LEDS.
Have a look at this library and the samples, I had a peek and think it is doable by modifying one or more of the samples.

The uno has a USB-B jack, the MIDI controller is USB-A. Can I just use an adapter?

It's also my understanding that the uno can't act as a USB host?

Hi @tinhuynh94.

No.

That is correct. And this is the reason why the answer to your question above is "no".

What about a NANO with lib USBMIDI?

What about a NANO. Use library USBMINI and take the example sketch called USBMidiLoopback and change the one line where the input byte is written back out to the USBMidi and instead change it to your LED function.
That sounds like it should work but I have not tested it.

No it will not work. You need a USB Host circuit. There are several available:-
Spark Fun host

The one I have used a lot:- Hobbytronics

I think AdaFruit used to do one but there is a fundamental problem with the chip they chose to use to base it on.

Or do a web search for USB host boards.

I think you can use a Teensy 4.1 board as a host as well.

1 Like

What about https://docs.arduino.cc/libraries/usbhost/

Nope, that is talking about things like keyboards and mice. It will not work with MIDI. Also it is for a Arduino Due only.

A USB MIDI Host is a different class than the USB HID class.

1 Like

I believe that even with a USB host shield, this can only be done with an Arduino that can act as a USB host, like a Due or, like you mentioned, a Teensy

Well believe what you want. However, it is not in any way true.

?

I was agreeing with you. But respect for staying true to your username.

I think you are getting mixed up about hosts and classes of hosts.

There is the HID (Human Interface Device) class, this handles things that are relatively slow, like mouse movement, keyboard input, joysticks and so on. There are lots of different classes see:- USB defined classes

A pdf giving details of the USB MIDI class can be downloaded by clicking on this link Click to Download PDF about the MIDI USB class

There will be a lot of detail here you do not need / wish to know. But just take the point that there are different classes of USB device, and a HID interface is not a USB MIDI device.

I have made the Hobbytronics board into a universal USB to MIDI Host. I have put this into a box and used this to implement a host on a project that is built around an Arduino Micro board. Note that the Arduino Micro board is not capable of acting as a host.

Hence your assertion that:-

Is not in fact true.

I hope that this clears things up for you.

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