zondag 28 november 2010

Attempt at creating my own simple MIDI controller


I started on a new project, converting a cheap toy piano into a MIDI keyboard. The toy piano has 23 keys, which it reads using a 4x6 grid of scanlines. The resistors are already in place, and fortunately there are places for me to solder my wires to. The PIC16F690 should have enough pins (I only need 10, it has 20), and I already have MIDI code for my Beethoven playing box, that I described earlier. Hooking up a MIDI output is very easy as well: just connect +5V to pin 4 of a 5-pin female DIN plug with a 220 Ohm resistor, and hook up the TX pin of the PIC16F690 to pin 5. The step I forgot before is that pin 2 definitely needs to be grounded, so don't forget that. You can of course also use sketch one or sketch two, or any of the others found on the Internet.

I used the Pic kit 2 to try different voltages, and the MIDI works with my CASIO keyboard even at 2.5V. Since the piano has a 3V battery, I was glad to see this. Using 3V of course makes it not entirely MIDI compliant, but I'm sure most pianos will behave just fine with it.