β‘ Optimize EQEffect filter design caching #25
+123
β8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π‘ What:
Optimized the
EQEffectclass insrc/intuitive_daw/audio/processor.pyby implementing a caching mechanism for filter design. Specifically, thesignal.buttercall and gain calculations are now performed only when the relevant parameters (low_freq,sample_rate,low_gain) change, rather than for everyprocess()call.π― Why:
Filter design (calculating coefficients) is a computationally expensive operation involving trigonometric and polynomial calculations. Doing this per audio block (which happens very frequently in real-time audio processing) is inefficient and consumes unnecessary CPU cycles, especially when parameters remain static most of the time.
π Measured Improvement:
This change reduces the CPU overhead of the EQ effect significantly, allowing for more instances to be used or leaving more headroom for other processing tasks. Correctness was verified via new unit tests ensuring that parameter changes still trigger updates and output remains correct.
PR created automatically by Jules for task 5322564243082139395 started by @lightmyfireadmin