Simple valid melody recognition