The audio to process will be delivered into your plugin with the processBlock method. You need to set up your DAW application to send audio from your microphone into the plugin, it’s not the plugin’s job to deal with that.

I suspect it’s not easy to make it accurate. It’s not like you get a frequency bin for every note, especially at the bass end. I think there’s a way using the phase of the bins…but I never looked into it.

The FFT takes N samples and spits out the magnitude and phase information (as a complex number) into N “bins.” That means you have a frequency resolution of Fs/N. So for a full range audio tuner, you need to decide your resolution by picking the lowest note (say, A-1 which has a frequency of 27.5Hz), and 1 cent around there which is about 0.016Hz. If your sample rate is 44.1kHz, that means your minimum fft size (N) is 2,756,250 samples. Which is prohibitively large just from the computation, and that would be a latency of about 62.5 seconds (need to wait that long to collect that many samples). So obviously that’s a no go.

What you’re looking for is a real time pitch detection algorithm. There are a number of methods just a Google search away, many of which use the FFT or the autocorrelation of a signal, which can be computed with an FFT.