Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix interruptions of real-time playback #1494

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft

Fix interruptions of real-time playback #1494

wants to merge 19 commits into from

Conversation

derselbst
Copy link
Member

PR #1432 introduced an on-the-fly recalculation of the filter coefficients, whenever the filter parameters change. It turns out this consumes too much CPU for voices that heavily depend on e.g. modulating the IIR filter.

This PR addresses this problem by avoiding direct calls to sin() and cos() and instead using a lookup table for calculating the filter coefficients.

TODO:

  • Eliminate the dependency on the sample rate in fluid_iir_filter_init_table()

Fixes #1481

@derselbst derselbst added the bug label Mar 1, 2025
@derselbst derselbst added this to the 2.4 milestone Mar 1, 2025
Copy link

sonarqubecloud bot commented Mar 1, 2025

fres_diff = fres - iir_filter->last_fres;
if(iir_filter->filter_startup)
{
// The filer was just starting up, make sure to calculate initial coefficients for the initial Q value, even though the fres may not have changed
Copy link
Contributor

@spessasus spessasus Mar 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: it should be "filter" instead of "filer"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

High CPU usage may impair real-time playback
2 participants