I am starting simple, but for some reason I cannot find any examples online and I stuck with my task.

I have a usb midi keyboard, Arduino Yun, and a synthesiser that can accept midi via usb. The problem is that the synth doesn't send a voltage through its usb and the keyboard has only one usb that is used to send midi data and it's powered via it at the same time.

My idea is to use my Yun's USB host (which sends voltage too) to power my midi keyboard and grab all incoming midi data from the keyboard, then simply pass it unchanged through to my synth.

Where do I start? Do I need some python code for it or everything can be done with sketch code? I've done few arduino projects but I am new to usb host functionality . This is my first step, later I would like to also convert usb-midi to 5-din-midi (old school connection), but that's different story.

Can you guys help me and point into the right direction? Anyone done something similar on Yun? I've seen some examples done on different boards, but it's all overcomplicated, I need simple read/pass usb solution. Thanks!

  • If the problem is simply power, you are far better off making a power injection cable than trying to proxy things through software. Only resort to that if there are other things you need to do as well. Mar 9, 2015 at 14:17
  • If you are going to try and sniff USB, don't even start. It's not ever going to happen at your skill level. USB is a very very complicated software stack to even get "hello world" working. If you are dealing with pure midi signals, this is a different story. MIDI is very simple and there are tons of guides
    – benathon
    May 11, 2015 at 13:10

1 Answer 1


You need the USB Audio kernel driver and the aconnect utility:

$ opkg update
$ opkg install kmod-usb-audio
$ opkg install alsa-utils-aconnect

Then just connect the ports:

$ aconnect -lio
client 0: 'System' [type=kernel]
    0 'Timer           '
    1 'Announce        '
client 14: 'Midi Through' [type=kernel]
    0 'Midi Through Port-0'
client 40: 'SC-8820' [type=kernel]
    0 'SC-8820 Part A  '
    1 'SC-8820 Part B  '
    2 'SC-8820 MIDI    '
client 44: 'My Little Keyboard' [type=kernel]
    0 'My Little Keyboard MIDI 1'
$ aconnect "My Little Keyboard" SC-8820

(This is plain Linux and does not need to run anything on the ATmega.)

  • Thanks for you answer, but I need to do it with Arduino, not Linux computer, I will be later extending that project to convert to 5-din midi socket. Also, I won't have the laptop next to the keyboard and synth when using that set-up so it has to go through Arduino I am afraid.
    – lokers
    Mar 9, 2015 at 9:53
  • 1
    The Yun runs a Linux on the AR9331's CPU. And that is where the USB host ports are.
    – CL.
    Mar 9, 2015 at 9:54
  • I got confused by your comment it doesn't need Arduino ; ) Ok I will need to test this solution then!
    – lokers
    Mar 9, 2015 at 10:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.