yup, Melodyne has already been mentioned multiple times, but I have to say that program does (almost) exactly what you want.

You can set the desired key and snap notes to it. You still have the libety to move notes around at will.... But, melodyne is basically an audio program, and you asked for a midi alternative.