Midi over USB Arduino Uno

Hi every one, im new on Arduino and i have Arduino uno, im working on a project to build a breath controller and scale tune button, i just obtain my codes wich i want to send it from the Arduino through USB midi and look like " F0 42 7F 60 01 01 10 7D 00 4E 00 00 00 00 00 00 00 00 00 00 00 00 F7"..
My quastion is it possible to send HEX midi message from Arduino to pc or another product through USB midi?
Thanks
Best regard

Def boseble, massage good. Goggle it.

a7

Thanks for your advice and sorry for my poor english, i fix it..:slight_smile:

Hexadecimal is a human-readable representation of MIDI data, the messages themselves are not hexadecimal.

The Arduino Uno is not suitable for this purpose. You can flash custom firmware to the Uno's USB chip, but it's very cumbersome. I'd highly recommend looking into Arduino boards that support USB natively, you can find an overview here: Control Surface: MIDI over USB

It depends on whether that other product is a USB Host or a USB Device. Most Arduinos are USB Devices, so you can only connect them to USB Hosts like computers, not to other USB Devices.

sorry for my poor english

Sry, I couldn’t resist.

Could you use traditional MIDI, which looks easy enough to interface to any Arduino? Then follow that with a commercial MIDI <-> USB interface cable or box?

Although doing USB with a different Arduino to the UNO is much easier, it’s still sorta a PITA. Or I’ve been unlucky...

a7

I think you've just been unlucky. If you have an Arduino Leonardo or a Teensy, you can just do something like this:

#include <Control_Surface.h>
 
// Instantiate the MIDI over USB interface
USBMIDI_Interface midi;
 
// Push button connected between pin 2 and ground.
// SysEx message is sent when pressed.
Button pushbutton {2};

constexpr uint8_t sysex_msg[] {
    0xF0, 0x42, 0x7F, 0x60, 0x01, 0x01, /* ... */ 0xF7,
};
 
void setup() {
  pushbutton.begin(); // enables internal pull-up
  midi.begin();
}
 
void loop() {
  // Send a SysEx message when the push button is pressed
  if (pushbutton.update() == Button::Falling)
    midi.sendSysEx(sysex_msg);
  midi.update(); // Read and discard incoming MIDI messages
}

This might be useful as well: Control Surface: MIDI Tutorial

1 Like

If you want to do that with an Arduino Uno and without the complications of messing with the bootloader then you need a helper application inside the PC that converts the serial data it receives into a MIDI port. A popular helper app is called Hairless and will save you from having to buy another type of Arduino.

Not sure what you mean by other product. Using hairless or similar applications will only work on a computer, PC, Mac or Linux.

For other devices it depends on if those devices are a host or a client (referred to as a device).

And you need an actual UNO, not something called a UNO but which is not a UNO! :roll_eyes:

Hi my friends, thanks for your answers, but what about this?

(12) Arduino MIDI Controller and Instrument! - Arduino Tutorials - YouTube

He seems to be using firmware like Hiduino. This is explained in the “ Arduino boards with an ATmega16U2 (ATmega8U2)” section in the link I posted earlier.
I'm not saying it's impossible, I'm saying it's unnecessarily cumbersome.

1 Like

Hi, I'm doing this in the same way to get a midi message, but it's just sending 2 bytes not a full 23 bytes.

constexpr uint8_t data[23] = {0xF0,0x42,0x7F,0x60,0x01,0x01,0x08,0x7D,0x00,0x00,0x4E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF7}

MIDI.sendSysEx(23,data, false);

And it just sending F0F7?!!!

Have a look at the documentation of thesendSysEx function. What does the third argument do?

do mean MIDI.sendSysEx(23,data, false); bool ArrayContainsBoundaries=false

Yes, you say ArrayContainsBoundaries=false, but your array does contain the boundaries.

Yes, but Im changing this to true, and it is the same, getting just 2 bytes F0 F7!!!