I would go for OpenCV objects. The can be used in many ways. I have some experience in this field and can tell you, that the task you want to accomplish could turn out quite difficult, depending on how "fast and intuitive" you want to play your piano. Main reason for that are delays and detection errors due to lighting etc. etc... but nonetheless it's a world of fun
There you go: http://hangar.org/wikis/lab/doku.php?id=start:puredata_opencv
My approach for your idea would be(schematic):
[pix_video]
|
[pix_opencv_colorfilt 255 0 0 20] // for red, but i have not tested those values!
|
[pix_opencv_contours_boundingrect]
|
[... here comes the complicated(progamming-wise) part, where i would filter out detected rectangles that are smaller than the full size]
please post your patch, if you suceed to make something great