See...
I should have beaten you to the chase when I had this idea about 2 years ago. I even made the synthesizer part, I use pygame for the input and output the notes to MIDI, so it's usable with any MIDI-capable studio/sequencer/synth. I'll dig up the code sometime...
However I did something significantly different. You set the scale of the keyboard (only two options so far, major/minor, along with the ability to transpose the root key +/- as many steps as you want) and now all the keys play in this scale, so it's impossible to play something out of key. This might not be what you're aiming for, but feel free to use my idea if you want.
I haven't made anything yet. And putting an idea here isn't calling dibs on it. If you wanna do an endo around me, be my guest.