aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-08-06 14:14:31 -0700
committerChris Robinson <[email protected]>2018-08-06 14:14:31 -0700
commit32edc7f33fd1a03ad1eaefada1aac3160d9c319a (patch)
tree42c080a355df77c3a29c3e5329ae007704ab5eba
parent4f92bd59387bd2478487ebd312a045f54747e4a2 (diff)
Prevent the autowah filter frequency from reaching nyquist
-rw-r--r--Alc/effects/autowah.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Alc/effects/autowah.c b/Alc/effects/autowah.c
index 5bdd5dda..5f45c43a 100644
--- a/Alc/effects/autowah.c
+++ b/Alc/effects/autowah.c
@@ -153,7 +153,7 @@ static ALvoid ALautowahState_process(ALautowahState *state, ALsizei SamplesToDo,
env_delay = lerp(sample, env_delay, a);
/* Calculate the cos and alpha components for this sample's filter. */
- w0 = (bandwidth*env_delay + freq_min) * F_TAU;
+ w0 = minf((bandwidth*env_delay + freq_min), 0.49f) * F_TAU;
state->CosW0[i] = cosf(w0);
state->Alpha[i] = sinf(w0)/(2.0f * Q_FACTOR);
}