Arduino pitch detection in realtime (using autocorrelation and peak detection)

Alright thanks, now I understand. I'm also taking a look at how a circular buffer works, like Grumpy_Mike posted.