how to connect midi keyboard to computer

hello guys
i have a midi keyboard and i want to use it in programs like fruity loops and synthesia... but i don't have a midi cable nor can i buy it from any shop nearby.
i thought of connecting the midi port of the keyboard to arduino so i can use the arduino to convert the midi messages from the keyboard.
is this a possible thing to do?
how should i programm the arduino ?
and how can i make the music programs like fruity loops recognize it as a midi device ?
thanks in advance

Most newer keyboards have a MIDI-USB port. If your keyboard has the regular (round DIN) MIDI connector, you can buy a [u]MIDI interface[/u].

Or if you want to build something yourself, there is a [u]MIDI USB library[/u] for the Arduino (which I don't know anything about) and you can get a MIDI shield for the regular MIDI connection/interface.

thanks for your reply
actually my keyboard has the regular round midi connecter and i couldn't find a midi interface in my area to buy
so i thought of using arduino as a midi interface
i will check the midi library and see if it can help me

Depends on which Arduino you have. Only some of them have native USB. Most have serial only.

i couldn't find a midi interface in my area to buy

If you have a music store in your area that sells musical instruments, amplifiers, microphones, etc., try them. Or, you can buy online.

It's probably not practical or economical to build an interface yourself once you add-up the cost for the Arduino, an enclosure, and all the "bits & pieces". So I'd only recommend building it yourself if you want to do it as a project, and if you have the time to figure it all out. (The time you spend on the electronics & programming is time and delay that you can't spend on your music. :wink: )

i have arduino uno so i guess it is not a native usb
can you please explain to me why it should be a native usb ?
for example : if it can receive the midi signals via its pins and tranfer it to pc via serial. the only remaining job is the software (writing the code and making arduino appear in the computer as a midi device).
thanks for your reply

DVDdoug:
It's probably not practical or economical to build an interface yourself once you add-up the cost for the Arduino, an enclosure, and all the "bits & pieces".

of course buying it would be a much easier job than building one but you can't imagine how long i have been searching for this simple device and sadly i couldn't find one

You could flash custom firmware to your ATmega16U2 chip (the small second microcontroller on the Arduino Uno that converts the TTL serial signal from the main microcontroller to a virtual USB COM port). You could upload firmware like Hiduino, to turn it into a MIDI to MIDI-USB converter. Make sure you upload a blank sketch to the main microcontroller first, so it doesn't interfere with the serial MIDI connection (it also uses pins 1 and 0). You may want to do some more research though, since it's not that easy, and you could brick you Arduino. Also make sure to build a decent MIDI circuit, you can't just connect the MIDI cable directly to the Arduino.

Hope this helps!
Pieter

i didn't know about the ATmega16U2 chip. i will definitely try this method first
thank you Pieter