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

Thanks MrMark for your help. I'll test the code today. I've got only one question. Is it possible and usefull to change to constant samplefrequency that you've implemented to a higher one for the high frequencies / strings?

Edit:
So I've tested the code. The problem with my code was that I had implemented interpolation wrong, and the problem with yours was that the sample buffer was too large. I don't know why, but when I changed it to 512 samples (instead of 1024) it worked unbelievably well! With the larger amount of samples it puts out almost nothing, like you said.