After a few dozen bug fixes, the code appears to be successfully doing pitch correction. I'm still working on improving the smoothing code to make the quality acceptable at the FFT block boundaries. So the automatic retuning code isn't finished, but with a few more tweaks this thing should be shippable.
I have to stop working on this to draw tomorrow's Tech Magazine strip. I hope to finish this tomorrow night.