BTW, implementing something like analog-style analyzer mode would require a different way of using get_chunk_absolute() from ones used by both FFT and current Goertzel-based CQT/VQT mode; the previous time is used as time offset and the requested chunk length is equals to a difference between current and previous time
Something like this:
// can also be used in Peak/RMS meters for accuracy (to not miss peaks especially with very low framerate like 10FPS) and consistency with VST analyzer plugins especially the RMS/VU meter
if (_VisualisationStream->get_chunk_absolute(Chunk, PrevPlaybackTime, PlaybackTime - PrevPlaybackTime)) {
ProcessAudioChunk(Chunk);
}
PrevPlaybackTime = PlaybackTime; // where PrevPlaybackTime variable is initialized to 0 upon starting up the instance of it, starts the song, or upon seek, which all coefficients of sDFT and analog-style spectrum analyzer are reset to zero every time either of these happens
instead of:
if (_VisualisationStream->get_chunk_absolute(Chunk, PlaybackTime - WindowSize * (ReactionAlignment/2.0+0.5), WindowSize)) {
ProcessAudioChunk(Chunk)
}
which is used for all other audio analysis algorithms and it continues to use that sample acquisition method when a new method that requires a contiguous stream of data is added
And also for @pqyt (the dev), I think that if the sliding DFT-based CQT/VQT is added, the Goertzel-based direct calculation of constant-Q transform method shouldn't be removed and instead, mark them as something like "legacy" or more accurately "slow" since Goertzel algorithm is really inefficient performance-wise with large number of bands
BTW, the FFT library that this visualization component using is this one optimized for clarity not performance, so to improve performance (especially with non-power of two sizes, which I think it is needed to switch to faster FFT libraries if the default FFT size is a non-power of two value, especially when the window size is in milliseconds rather than samples), you're need to switch the FFT library from Project Nayuki to PFFFT (the very same library used by Web Audio API AnalyserNode implementation in Chromium-based browsers, albeit modified to support double-precision floats for the sake of consistency with original JS implementation on CodePen) right?