Nobody remembers, but I made something very similar to this almost a year ago. It even has the ability to play chords. Of course, it's only two octaves instead of three, but the idea is the same; take out all the "accidental" notes so most anything you play still sounds at least decent. This might inspire me to redo my build to have more notes/features/etc. though.
Here's the gallery topic in case anyone's interested. I doubt the saves still work, but whatever.
http://forum.blockland.us/index.php?topic=144246.0