# Non-allocating alternatives for the IIR::Coefficients::make... functions

**URL:** <https://forum.juce.com/t/non-allocating-alternatives-for-the-iir-make-functions/38335>\
**Category:** General JUCE discussion\
**Created:** [March 29, 2020, 3:56pm UTC](https://forum.juce.com/t/non-allocating-alternatives-for-the-iir-make-functions/38335 "2020-03-29T15:56:28Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [June 12, 2021, 4:10pm UTC](https://forum.juce.com/t/non-allocating-alternatives-for-the-iir-make-functions/38335/7 "2021-06-12T16:10:47Z")

</div>

Please fix this, many threads about it:

> [@IIR::Filter. Is per sample modulation possible?](https://forum.juce.com/t/iir-filter-is-per-sample-modulation-possible/27598):
>
> I do not get how to use the new IIR::Filter in a plugin which is able to modulate it with an LFO or envelope. If I want to change the filter cutoff each, let’s say, 20 samples, using dsp::IIR::Coefficients::makeLowPass(), it seems pretty expensive. And they do a new and I cannot do it in the audio thread, I would have to create my own function to modify the coefficients coping it from the original makeLowPass(), which points me to think that I’m doing it in the wrong way. The problem increases…

> [@The two IIR filters in juce](https://forum.juce.com/t/the-two-iir-filters-in-juce/38475):
>
> Juce has two IIR filters. IIRFilter and dsp::IIR::Filter. Any reason to use one over the other? dsp::IIR::Filter has getMagnitudeForFrequency which is nice. But it appears that every time you want to adjust the parameters you need to allocate a new set and replace them. This doesn’t seem usable inside a processing loop. So is there no way to smoothing adjust the freq and q?

> [@FR: Make IIR Filters Less CPU Intensive / Safety Focused](https://forum.juce.com/t/fr-make-iir-filters-less-cpu-intensive-safety-focused/40132):
>
> While I appreciate the approach to the shared coeff pointers etc in the IIR filter DSP, it’s not to the benefit of the user at the end of the day. Having coefficients call new every time they’re generated, creates substantial overhead on the audio thread. It makes the filter almost unusable in the case of fast modulation, and to make it usable, you need to slow modulation down to the point of it not sounding accurate and nice. I know the SVF is there, but it’s not as flexible and usable as the…

---

_[View the full topic](https://forum.juce.com/t/non-allocating-alternatives-for-the-iir-make-functions/38335)._
