I am making a plugin that displays a spectrogram of the audio in real time. I have a version that seems to be working well with Audacity. I am posting this to share my approach and get your comments.
I used the JUCE FFT tutorial as a starting point, even copying some of the code. One fundamental consideration was how to divide the work between the PI processor and the PI editor. I wound up doing most of the work, up to and including creating the spectrogram image, in the processor, mainly in the processBlock method. I pass a reference to the image to the editor in the create editor function and the editor uses a timer callback to display the current image.
Some other differences:
I calculate the FFT using both the current and previous audio blocks. So I have 2x sized blocks with 50% overlap.
I apply a Hann window before calculating the FFT.
I convert the FFT magnitude to dB.
I determine the FFT level for a given pixel using interpolation. This makes a big difference at the low end of the logarithmic scale, where integer mapping from pixel index to FFT index gets very coarse.
As stated, it seems to work quite well with Audacity (Win32). Unfortunately, unlike my previous two plugins, it crashes Ableton on start-up. Not sure how to fix this.