USB-MIDI and MIDI interface

Hello everyone, I'm a new user, my name is Dimitri and I'm from Italy.
I'm an electronics hobbist and programmer too.
I've always used microchip devices, but now I'd like to start with Arduino.

I'd like to start a really small project:
I want an arduino to convert USB-Midi to standard Midi, pretty simple (already made on the web).
Furthermore, I'd like to add an "interface layer" between the arduino and pc/mac, in order to use arduino as a midi interface (that should be pretty simple too).
So I would have a USB-Midi input, a standard Midi input, and I would redirect those inputs both to the USB-to-pc/mac and to standard Midi out.

So, please correct me if I'm wrong, I'd need:

  • Arduino Uno R3
  • USB Host Shield + its library (this is used for USB-Midi devices without standard midi).
  • Some midi connectors and some other passive components (I don't need the Midi shield here, it's too much for my use).

My questions are:

  1. can I connect more that 1 USB device, at the same time, to the Host Shield? If yes, simply using another USB connector in parallel with the main one? or do I need some circuitry?
  2. is it right that using the USB host shield I still have RX/TX port free? I need them to use standard Midi without a serial port emulation.
  3. when connecting the arduino to pc/mac, will it power the USB devices connected to the host (of course only if they are designed to be usb powered), or I need the DC power supply too?
  4. when connecting the arduino to pc/mac, can I show a custom name (like "midi interface" or something like that) ?

many thanks and sorry if I said stupid things! :slight_smile:

Anyone please?

up =(

USB Host Shield + its library (this is used for USB-Midi devices without standard midi).

I think you are getting mixed up with what a host is. It is a master, it controls things like a mouse and a keyboard.
A MIDI device is not a host it is a client.

If you want your arduino to look to a PC like a USB MIDI device you need something like the Leonardo, however I am not sure if a MIDI client library has been written for it yet although you can get a keyboard and mouse client for it.

No I don't think I mixed up..as I wrote, I'd like my arduino to act as a host (like if it was a pc) for USB MIDI devices. Then arduino should send midi signals based on what it receives as host. Furthermore if possible I'd like to send those signals to pc via usb (and here I'd like to have the arduino to be seen as usb device or custom-name device)

So I would have a USB-Midi input, a standard Midi input, and I would redirect those inputs both to the USB-to-pc/mac and to standard Midi out.

In which case you run out of serial ports. Assuming you can get a MIDI driver for a USB host shield, you need a serial input from the real MIDI and a serial in / out from the PC.
This would imply you would need a Mega with its 4 serial ports, not a UNO.
Also there is a bit of difficulty with buffering the two input streams into one, as any finite buffer might be over run when the traffic gets heavy.

Indeed my question n.2 on the first post was if I have the rx/tx port free, and I believe yes, from what I learnt on the web. But I may be wrong. If I'm right, I could use rx and tx for standard MIDI operations, since the shield is indipendent (and so there should be two buffers, and no need to be alarmed with heavy traffic since MIDI is quite slow related to arduino). Please correct me if I'm wrong.
And there is already someone who succesfull used usb host shield drivers to handle usb-midi data

The problem is that while MIDI is indeed much slower that the arduino, it consists of multi byte messages. So when merging two streams you have to transfer the messages not just the bytes. This means that while you are waiting for one message to compleat you must buffer the bytes of the other stream. If the MIDI traffic is heavy, that is exceeds half the maximum on both streams, then messages back up and fill any buffer space allocated to it.

The USB and the TX & RX pins on a Uno use the same on board UART, they can not be used independently.

1 Like