This is super cool! Using an FFT to detect pitch is a natural approach, but my understanding is that most pitch detectors work in the time domain using some form of auto-correlation. See:
For this I used the simplest approach I could think of - using sox [1] with its builtin power spectrum analyzer. It works pretty well as the resulting tuning is fantastic. It would be nice to a faster pitch detector - could speed up tuning from ~15 seconds to maybe just a few seconds.