I'm attempting to make a music visualizer in Python. For math on the audio signal I'm using a modified version of the FFT called the Constant Q Transform (CQT). My issue is finding a way to plot the result of the CQT in real time AND play back the music in real time.
Currently I'm taking 1024 samples of the music, transforming them, plotting them with matplotlib, then sending the samples to an audiostream to be played. The delay is the plotting with matplotlib. My goal is to do something like this or this. It appears in the second video the transform is generated beforehand then played back.
How would you recommend generating such a visualization? Is it possible to compute the transform, visualize it, and play back the audio in real time with no/minimal stuttering?