A pedalboard zynthian .. .

It looks like the MKR ZERO does not support USB MIDI. I can compile the script for another MCU but selecting the MKR ZERO I get compile errors. Arduino MIDIUSB library does not mention those devices.

A lot of Arduino boards have a microcontroller that interfaces with a computer via serial and often have a USB serial interface chip. This can only operate as a serial interface (RS232-like) and present as themselves, expecting the OS to have the suitable driver. They can’t pretend to be class compliant USB MIDI interface. Only a few devices with native USB interfaces can be programmed such.

I suspect Ed something as such.

If / when you find a board that does work you will have the challenge that you can’t flash new firmware to the board when it is programmed as class-compliant USB-MIDI. Some (most?) Arduino boards with USB use a separate chip to implement USB interface. Many use dedicated USB-serial adapters which won’t work here whilst others use a second microcontroller which can have it’s firmware flashed, changing it between USB-Serial and USB-MIDI. You have to reflash the interface chip before updating your core script then reflash the interface chip to get USB-MIDI back. An alternative is to use chip programmer hardware but that requires extra hardware. (You can use another Arduino as a ISP). Some boards have a DFU mode that you can trigger during initial boot allowing the serial port to be enabled for programming. This is implemented in the chip’s bootloader firmware.

Those USB power-only cables should be forbidden… Manufacturing or selling or even giving one of them should be punishable by prison…
I don’t see any reason why an electric cigarette or a ladyshave should use such kind of plug…
Standardisation ? So that we don’t need a specific cable for them… ok but their cable can’t be used for cellphones or data storage, so dwe factly need another cable for that… so it’s fake standardisation which in the end, leads to errors and hours of wondering why it doesn’t work…

I wonder how many people sent their machine, whatever it could be, to the bin, persuaded that it was faulty and not working, when the reason was simply that they used the wrong cable which looks exactly like the right one…

“She looks like the real thing, tastes like the real thing…”

1 Like

Maybe @wyleu can devise a torture device using suboptimal USB cables… hanging deviants by their ankles from the battlements. :confused:

I have ordered some more STM32 development boards which might be purposed for USB MIDI. I am quite interested in this 15x15 MIDI router, processor, USB interface. Of course the code that @wyleu found should work on these boards too but seen to give a compilation warning. I will check it out when my new toys arrive in a few days.

1 Like

Torturing with +5V ?
Is it not a little bit too… agressive ? Excessive ?

1 Like

We can wind it down to 3.3V for those with a weak disposition.


The Teensy doesn’t seem to have this problem, but I don’t know why.


Eh eh…

Is that with a Linux host? This description of the mapleleaf bootloader explains the challenges of handling different USB channels on different OS.

Nope. Windows. I was able to flash to my Teensy multiple times without problems, using the Arduino IDE and the Teensyduino bootloader.

@wyleu, would standard 5-pin MIDI work for you? That can be done quite trivially with any MCU. USB MIDI is a little more tricky

USB seems the best answer I can power it from the pi so saving separate power supply wiring and it is easily disconnected and tested separately.

Okay - let’s see what we can do :wink:. I reckon your MKR Zero should work as it is a SAMD which is listed as supported but it doesn’t. You could try reporting to the relevant projects to see if they can help. In the meantime we can pool our resources and see if any of us get something similar working. As @Jtunes says, the Teensy seems to do USB MIDI quite well and I expect to get the STM32 working when it arrives. (Teensy is somewhat more expensive!)

I haven’t read it but this site describes how to get USB MIDI working on a MKR Zero.

[Edit] I just tried the examples from USBMIDI and they compile for the MKR Zero. Give it a bash. You should be able to get the USB MIDI bit working. You can then either craft your own interface to the hardware sensors or integrate an existing library. That is the easy bit :stuck_out_tongue:

I can confirm that the teensy is both easy to reprogram and easy to become a midi class compliant controller too. My ‘orange box’ uses one and even I struggled to screw it up.

1 Like



A testament to the absolute brilliance of the Teensy.

That should be an official quality standard:

:white_check_mark:Survived @MrBroccoli :white_check_mark:


1 Like

It’s even more of a shock when you see how it happened…


So as detailed here…

I’ve uploaded the write example…

and it compiled! albeit with three warnings about
warning: narrowing conversion of ‘(int)(176 | ((unsigned char)((int)channel)))’ from ‘int’ to 'uint8_t A ‘c’ case crisis from long forgotten memories. . .

But the code made it the arduino!!

So firing up the Raspberry Pi Desktop HAL9000 and looking in all the normal places. . .

I first started asqdump as a background task

with aseqdump & (not displayd in the screen shot below) You could also run it in a sperate terminal window . . . .

So we is doing MIDI over USB to a Raspberry Pi4 … now do we know any Pi4 softwares that can make useful advantage of such a rig…? :roll_eyes:

Now I can hear the clammering shouts for a touch of :face_with_monocle: so I plugged it into zynthian-amp2.local that was still sulking form having it’s Roland A88 note keyboard removed…

so here we go …

and for the real pedants ( you know who you are…)
Here it is as a MIDI recording…

usbmidi_test_write.mid (77 Bytes)

Obviously many buckets of hot thanks to all who contributed, but, unfortunately, you are not coming of any lists as :-

1/ I LIKE lists…
2/ I bare grudges.


Pedalboard developments have been on hold while I fixed the All-In-One board issues … But that’s working now, and I’ve got the breadboarded MKR-ZERO, Control_surface https://github.com/tttapa/Control-Surface running with 3 hall effect sensors and it’s really painless. Very impressive piece of software.

Just needed to add the invert statements into the button definition setups to invert the polarity to deal with the sensors switching high when activated.

All 13 Hall effect sensors on a test rig and only one wire crosses the midline :smiley: