For a MIDI input, we don't have many difficulties to define what is a right note and what is a wrong one: The pitch of the played note is not exactely the same as the expected one, then we have a wrong note.
It's a little bit more difficult with an audio input: We must in this case define a frequency threshold f and consider we have the right note if its frequency is between
and