Normally Pianos be it electric or mechanical work on the simple mechanism of pushing button.
But here is a twist, we could just eliminate the need of keys in a piano by using some sensors. And Infra-red Proximity sensors best fit the cause because they are easy to use and they also occupy just one digital pin of microcontroller board. And also these sensors are one of the cheapest sensors available out there. I am using a buzzer as a musical output, but you can use a proper speaker/ subwoofer . In future I look forward to upgrade the project with bass boost using Subwoofer.