Add MIDI to a real piano action

Hey,

I'm wondering, if it's possible to add MIDI to a real piano action by using Arduino. I think about optical sensors. But I need to access every single sensor to set the "rest area" and the position where the sensor should send a note on with a calculated velocity.
Any chances & ideas & thoughts?

Thanks,
Chris