Hey there,
First of all, I want to say that although I finished Computer Science and have the general gist of how to write code, I have no background in engineering or low-level/hardware coding. This is also going to be my first arduino and DIY project. On paper it might appear pretty straight-forward, but I'm sure it's going to be more complex than it looks.
What I want to do is, basically, a series of fingers that can be fitted on any piano with standard sized keys, each hovering above it's respecting key until it's activated, then pressing it's respective finger for a variable duration, and then letting it go until it's reactivated. The system will, ideally, be able to read MIDI files and replay them on an actual piano or keyboard/synth, as long as all the notes of the MIDI are included in the octaves that the system will cover, and disregarding all else notes that are out of range.I guess I can put it on table with adjustable size, or just on the floor with my keyboard piano.
The components of the system will be installed on a foam surface (unless you suggest something else).
A Raspberry Pi will load a midi file from the SD card and then check, perhaps let's say once every 1/36th of a second, which notes are pressed down and send the necessary instructions via pins to a series of Arduino Uno slaves. I could research on writing boot-up Raspberry Pi python boot-up scripts of some sort and how they can communicate with arduinos via pins. The number of the arduinos will be variable, but I thought that one Arduino can control each octave, 12 fingers (7 fat ones on white keys and 5 lifted thinner ones on the black keys). The Raspberry Pi can assign which octave each arduino represents automatically, by the series on which the Arduinos are connected to the Pi, therefore defining which notes each Arduino is responsible for. Each Arduino will be connected, via breadboard I imagine, to 12 servos which will either pull back or let loose a string. Each string will activate and deactivate its respective finger (which is basically 3 pieces of foam with angles, glued with elastic band together), so when tension is applied to the string, the finger will become curved, thus hitting the note.
The fingers will have to somehow be sturdied on the foam surface as well as the servos, I can think hot glue but something more elegant will be a bonus.
The keyboard I currently own covers 5 octaves, so I'll make 5 sets which will need 5 arduinos and 60 servos and fingers in total. I know creating two hands with 5 fingers that slide above the piano keys would be more practical, but a real hand can stretch its fingers to play notes out of reach as well as overlap the other hand to play on different octaves, higher or lower, so I thought this would make the project less complex. I'll start with a finger, then programming one servo for that finger, then one octave and see how it goes.
Before I start buying and researching, I'd like to ask if the project is feasible and if I am missing anything? Can you point me to any useful resources on how to control servos with arduino and how to make a raspberry pi communicate with them? Power supply is also a concern, what do you think will be needed exactly to power such a system? Also, can servos move with variable intensity and is it possible to increment variable power to the press of each button?
I tried doing some google search, found robotic hands playing piano but not my exact implementation, which I imagine would be simpler. If you can point me to any similar projects, it'll be wonderful.
Sorry for the long post,
Thanks in advance!