Pitch detection when successive notes are the same I want to program a microcontroller in C but I am asking about the theoretical aspect of it. I think I've got an idea what I am going to do but there is one thing I can't quite get. To begin with, I will use a guitar, so there is a 82Hz-987Hz range. So roughly, I'm going to low-pass the data on 1KHz, "window" them and apply FFT. Supposedly, I am going to have a good estimate.

Since highest frequency is ~1KHz, I decided my sample rate to be 2KHz (haven't tested yet if it works).

Suppose I have a 2 seconds track with 1 note each second. If the first note is C, my result would be 2000 C notes for the first second right? We can say that every time there is a note change, that's when you recognize a note, so if the second note is D, the program will acknowledge C, then D (and not 2000 times C and 2000 times D). The problem I see, is that if the second note is also C, how would I know that indeed there is a note hitting?

I believe I need an extra step to the process but I can't quite find what would that be. Might be that I have to go a different route though.. (if this is the case just mention the method, no need to elaborate on it and lose your time, I will read about it).
Usually, the envelope of a note will decay.  A new note pluck will start (add or replace) a new amplitude envelope with an attack transient.

So you might add envelope tracking to your spectral frequency analysis (which may or may not be appropriate for correct pitch estimation).