Hello fellow Jucers!
i am very new to all this…
i manged to build my first VST with Juce
(something like a 4 way crossover - with HighPass and LowPass filters setting the limits for each band-)
I have used the tick method of biquad so i guess i am using a sample by sample approach (correct?) and i end up with 98% CPU when the .dll is loaded in cubase
Don’t know, if that solves the issue, but some notes:
1.) You may rely that the host will call prepareToPlay() when the sampleRate changes, hence you may move that code into prepareToPlay.
// I think because you are not setting fs = getSampleRate(), when all filters are updated, you update them at each call.
EDIT: forget that, it is at the top, sorry…
2.) You iterate the samples and process both channels inside. That makes the processor jumping between the two buffers. The caching can work much better, when you process all samples of one channel and afterwards all samples of the other channel.
You only copied the contents from one file in gist (Biquad.cpp, Biquad.h, Filter.h).
That massive if statement is unnecessary. Sample rate changes will cause a call to prepareForPlay().
I feel like this is partly a case of running before walking. Have you tested a single 8th-order filter and verified it has the correct output? After that, you can test two 8th-order filters in a 2-way crossover and verify they have a flat combined frequency response. Then you can combine your two 8th-order filters into one “band” object and test it, etc.