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

Gravy: unpleasant popping when changing modes #70

Closed
cosinekitty opened this issue Sep 11, 2024 · 1 comment
Closed

Gravy: unpleasant popping when changing modes #70

cosinekitty opened this issue Sep 11, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@cosinekitty
Copy link
Owner

When cycling filter modes through LP/BP/HP, there is a harsh popping sound as the filter adjusts to a new state.

Ideas:

  1. Consider a fast ramp down/up every time the filter mode is changed. When the mode is changed, delay the actual mode change for a brief time period, during which we fade out the input. This might be on the order of 0.01 seconds. Reset the filter to zero, then change the filter mode, then start fading in the input audio again for another brief time period. I believe the brief dip in audio level will be much more pleasant than the current popping sound.
  2. Because the filter calculations themselves are so lightweight, it may even make sense to have two simultaneous filters operating during a brief cross-fade period. This would briefly double the CPU usage, but the CPU usage should be tiny anyway. The cross-fade period may need to be a good fraction of a second in order to sound smooth enough, but only experimentation will tell.

Put this in class GravyEngine, to unify behavior across future platforms.

@cosinekitty cosinekitty added the bug Something isn't working label Sep 11, 2024
@cosinekitty cosinekitty self-assigned this Sep 11, 2024
@cosinekitty
Copy link
Owner Author

cosinekitty commented Sep 11, 2024

Turns out I didn't need any cross-fading. Maintain separate values of y1 and y2 (the previous two outputs) for LP, BP, and HP. Calculate all 3 filters simultaneously because the overhead is negligible. No more popping sound!

Resolved in b8434e2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant