First of all: I really like the dsp
classes
However, when it comes to the IIR::Coefficient
class, I feel like I’m missing something obvious. To calculate filter coefficients, there are a lot of nice make...
functions. After having calculated the coefficients, these functions internally allocate a new coefficient struct to return and populate it with the calculated coefficients. While I like the ref-counted approach of this, it makes these functions unsafe for all situations, where the calculation would happen on the audio thread. This is especially the case, if coefficient recalculation happen on parameter changes, which are invoked from the audio thread in case of VST3 plugins.
As this seems to be such a normal use-case and the solution to this seems so easy to implement, I wonder if I’m really missing something obvious here? Is there any functionality I didn’t find to recalculate the coefficients and place them into an already existing, pre-alloated IIR::Coefficient
struct, besides of implementing my own free function with basically a copy of the coefficient calculation code found inside the IIR::Coefficient
class? Maybe @IvanC as the designer of the class could share some insight?