Go Down

Topic: Leonardo direct MIDI USB (Read 30518 times) previous topic - next topic


Hi all!
I was using the hacked FTDI drivers / roland serial MIDI drivers to have old arduino (duemilanove) show up as MIDI port, and send/receive data directly from ableton withouth having further converters,
i saw that now Leonardo has been released! Would it be possible to use this board to have Arduino <=> Ableton Live communicate directly via MIDI over USB or i would need additional software converters ?
Thanks in advance!



yes it is possible, and I am very interested in this topic also. Please read: http://hifiduino.wordpress.com/2011/09/30/arduino-leonardo/, you can see that the new Arduino supports USB-HID class (HID=Human Interface Device), and in this class cathegory you will not need any driver on your computer, it will use the default one for MIDI.

The big step ahead of leonardo is that the USB interface-protocol is fully programmable, hence your Leonardo can act as USB mouse, keyboard, MIDI, as well as USB storage or USB-serial converter.
The big problems is that you need to have a USB protocolstack running on Leonardo, and for me it is not yet clear how to do it. I have had a look at the following stacks:
- AVR USB Stack
- Teensy
- FreakUSB

but I wanted something where the source code is simple and clear to understand (I want to learn some USB internals). I am looking into this direction...



thanks a lot so it was like i was thinking, it could be done but no one has already come out with an easy to understand and working tutorial :)
I will try to learn something from the stacks you have mentioned, and report here any news! thanks again and good luck !


Another interesting software is V-USB (http://www.obdev.at/products/vusb/index.html), which provides an USB stack and also an emulation of the USB physical layer using the old Arduino I/O ports.
Maybe the code can be changed so that instead of using the I/O ports, we configure directly the USB HW interface of Leonardo, in order to let Leonoardo to take care of the physical layer.

I am sorry if something is not precise, there is big confusion/lack of docs/explained code for the new USB capability of leonardo...



from morecatlab:
Moco firmware can use as USB-MIDI <-> USB-Serial bridge with a 8u2 or 32u4 board, like Adafruit's 32u4 breakout board.

The Arduino Leonardo is a microcontroller board based on the ATmega32u4

I tried the MocoLUFA on an Arduino UNO R1 and it worked well
While R3 has the Atmega16U2 chip, the Leonardo seems like the best solution for me.
I'll try in a few days and post my results.


hi, I am also looking into using the leonardo to be a midi input for my ipad or a midi output using a custom drum kit.
So far no luck to get the usb midi code for the leonardo, any help would be appreciated.



No luck over here as well...Flip doesn't recognize the 32u4 for some reason  :~
I'm quite disappointed with the Leonardo, and would love to have my 8u2 uno back on stores.


BTW you could always use this: http://projectgus.github.com/hairless-midiserial/#downloads

What's nice about it, is that its both for Windows and for mac, so you could develop your projects on windows, but run them on mac too.

And for now, Teensy has an onboard MIDI driverm which makes it better than the Leo. for this usage.


thanks for the hint I will try with a teensy 2.0


Unfortunately, to add support for MIDI you have to hack in the Arduino core files. I've hacked in a MIDI-USB implementation in an alternative set of core files, which is available at https://github.com/rkistner/arcore. The MIDI-USB protocol is fairly simple (once you get around the USB interface descriptors), and the implementation is quite similar to CDC (I based my implementation off that).

In the long run it might be better if we could use an existing stack with MIDI support, but it seemed complicated to replace Arduino's USB stack with another one.


Looks interesting
Might try it sometime


interesting but i ask now,i know can do but how (im newbie)
leonardo or uno who have better thats ?
i need 32 button interface hid interface
8 analog inbut and 16 encoder inbut.
how make hid interface to have all thats ?
ino to in arduino, what more need ?
i understand leonardo have hid ready board no need change bootloader, and uno no have hid compatiple need bootloader new write.

and hid device can adding 32 button, 16 encoder,8 analog inbut.
but how :(
i need only buttons and encoders my computer.
analog can take old joystick.mean usb board if need,


This thread is about MIDI
Please don't add unrelevant information


This is interesting topic.

i have made a midi controller with Uno R3 about one year ago (http://popo.webatu.com/) and now i'm starting to think about building some kind of midi Foot Controller.
I don't know much about electronics or programming and i had A LOT of help here from the forum to complete this last project, but it was also a great way to learn by doing.

The thing is that needing a serial to midi converter is a little bit annoying. It works, but there are some inconveniences (like for instance, not everyone has Processing and a Serial do Medi Converter Sketch).

So, when i heard that Leonardo had native ubs hid i was excited about it.

But now when i have read your thread i was a little bit less enthusiastic.
Is it not so easy to use the Leonardo to create a "Plug and Play" device?
If i would wrote a sketch that works on Uno R3 would it also work on a Arduino Leonardo?

My idea is to create a foot controller with maybe 8+2 foot switches, maybe 4 "banks" and some LEDs to use with softwares like Ableton.
Would you say that Leonardo would be better than Uno R3?

Thank you!

Go Up