Musicians, makers and Raspberry Pi enthusiasts looking for inspiration for their next project may enjoy this light -controlled piano powered by a Raspberry Pi. Check out the unique project below which has been inspired by the concept of a laser harp. Following the same principle but rather than using the sometimes dangerous lasers its equipped with LEDs making the finished instrument a little safer for younger musicians to play.
For each playable tone, an LED is mounted opposite a light dependent resistor, creating an array of switches that is then connected to the Raspberry Pi’s GPIO pins. A Python script has been written to process the inputs into sound by polling the GPIO states with help from pygame, and then trigger the appropriate MIDI playback whenever the light stream is broken by the player. There are 15 pairs of LED and LDR, 12 for a full octave of notes, 1 to go up and octave, 1 to go down and octave, and 1 for menu.
If you are interested in building your very own DIY LED light powered piano or an instrument using similar technology jump over to the Instructables website by following the link below for a component list, full instructions which have been published by member “2fishy” complete with all the code you require.