Skip to content

Filter cutoff frequencies #164

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

Open
CawawaC opened this issue Jan 8, 2018 · 3 comments
Open

Filter cutoff frequencies #164

CawawaC opened this issue Jan 8, 2018 · 3 comments

Comments

@CawawaC
Copy link

CawawaC commented Jan 8, 2018

Hi!

Is there a reason why we can't modify the cut-off frequencies in the filters? I mean I see the little #define lines in alFilter.h, but I believe a filter needs to allow this, it's basic stuff.

@kcat
Copy link
Owner

kcat commented Jan 13, 2018

OpenAL doesn't really deal with a typical cutoff filter, as someone might be used to. Rather than specifying a cutoff frequency for where the frequency response starts to rolloff, you instead specify a gain for the response at a predefined reference. It's actually more akin to a shelf filter where you specify the gain at the center of the slope. Altering the gainhf/lf value has the effect of altering the cutoff frequency, but in a manner that produces somewhat more consistent results regardless of the filter strength (a filter with a -24dB/oct rolloff would have rather different output compared to a filter with a -12dB/oct rolloff, for the same cutoff frequency).

It would make sense to expose the reference frequencies, much like the EAXREVERB effect does, although it's different than the cutoff frequencies and can't be used as such. The actual cutoff frequency is determined by the reference frequency (currently hard-coded), the gainhf/lf (app-specified), and slope/strength (implementation-defined).

@CawawaC
Copy link
Author

CawawaC commented Jan 13, 2018

Thank your for the clarification! I thought that was how the filter worked, but took me some time to figure it out. I think it should definitely go into the documentation. Can we edit it? If it's community managed I'd be glad to take care of inserting this info into it :)

Do you know if the hard-coded reference frequency can be "de-hard-coded"? Well, it's probably possible, but I know some filter implementations don't handle real-time cutoff frequency changes well... If you don't know how well it would work, I'll try and test it.

@kcat
Copy link
Owner

kcat commented Jan 13, 2018

I thought that was how the filter worked, but took me some time to figure it out. I think it should definitely go into the documentation. Can we edit it? If it's community managed I'd be glad to take care of inserting this info into it :)

Unfortunately the documentation is currently the PDFs from Creative, which aren't open to easy editing. Someone had offered to redo them, rewriting or converting them to some other format where they could be more easily edited (and could be put into the repo), but I haven't heard from them in a while.

Do you know if the hard-coded reference frequency can be "de-hard-coded"? Well, it's probably possible, but I know some filter implementations don't handle real-time cutoff frequency changes well... If you don't know how well it would work, I'll try and test it.

I don't imagine there would be any problems doing that. The filter structures themselves already store the reference frequencies as variable, it's just a matter of writing up an extension that provides additional lowpass, highpass, and bandpass properties for modifying them.

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

No branches or pull requests

2 participants