Go Down

Topic: Transmit/ Receive message SysEx in USB (Read 2621 times) previous topic - next topic

PieterP

How are you routing the MIDI data from the Arduino to the pedal?

ard2000

#16
May 18, 2020, 09:11 pm Last Edit: May 18, 2020, 09:12 pm by ard2000
Through the pedal's USB port

If i connect it to raspberry i can send th C0 YY command with amidi

PieterP

Through the pedal's USB port

If i connect it to raspberry i can send th C0 YY command with amidi

That won't work. Both the Arduino and the pedal are USB devices. You need one of the two to be a USB host.

ard2000

Ok. i am confused. Can i tell the Leonardo to act as a usb host?

PieterP

Can i tell the Leonardo to act as a usb host?
No, that is not possible, the Leonardo is device only. Some Teensies support host mode, and you get a USB host shield, but finding/writing USB drivers is often a problem.

How are you connection them anyway? What cable connects the two?

You can use the Raspberry as a USB host, and route the MIDI messages between the Leonardo and the Zoom in software.

ard2000

So for a standalone project that communicates with the pedal there's the option of arduino due or then the raspberry pi zero.

An option with a USB host shield for the Leonardo would be too difficult to code and handle?

Thanks anyway for all the info!


PieterP

I wouldn't recommend the Arduino Due, it has terrible software support. For example on the USB Host library page:
Quote
The USBHost library allows an Arduino Due board to appear as a USB host, enabling it to communicate with peripherals like USB mice and keyboards. USBHost does not support devices that are connected through USB hubs. This includes some keyboards that have an internal hub.

NB : The USBHost library and associated functions are experimental. While it is not likely the API will change in future releases, it is still under development.
It doesn't even mention MIDI at all. There are third-party USB Host MIDI libraries for the Due, but they seem to be no longer actively maintained. They don't support USB Hubs either, so if the Zoom has a built-in hub, you're out of luck.

The disadvantage of the Raspberry Pi is that it takes much longer to boot, while an Arduino starts instantly.

A USB host shield is not too difficult, if you're lucky, your Zoom is a simple USB MIDI device with no hubs or other endpoints, and you can simply use a working USB Host MIDI example you find online. But chances are it won't work and you'll have to be prepared to study how USB works, botch together a driver if necessary, and keep in mind that it might not be possible with your particular hardware.

The newer Teensy boards (3.6, 4.0) have better support for USB host. They support hubs, and have MIDI examples as well:
https://github.com/PaulStoffregen/USBHost_t36/blob/b4956555019850b0a9bcf3050e2aa8afa677e7ca/examples/Serial/MIDI/Interface_16x16/Interface_16x16.ino
A Raspberry Pi will be plug'n'play, but the Teensy will probably be the easiest Arduino-like option.

Grumpy_Mike

Quote
The disadvantage of the Raspberry Pi is that it takes much longer to boot, while an Arduino starts instantly.
Also don't forget you can't just remove the power to turn of a Pi like you can with an Arduino. You have to give it a software command to turn off. Then wait until the green LED stops it intermittent flashing and then wait a few seconds before you can remove the power. If you don't go through this rigmarole then the SD card will fail after a few tens of switch off.

Even if you follow this procedure I have found there are times during development it gets stuck and you can't software command it and you have to pull the plug. I have had about 12 SD cards fail over the last seven years.

ard2000

Maybe its time to start playing an acoustic guitar.... :)

Thanks for all the info. I'll consider the options, after all!!!

Go Up