aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/autowah.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/effects/autowah.c')
-rw-r--r--Alc/effects/autowah.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/Alc/effects/autowah.c b/Alc/effects/autowah.c
index cc207858..e0556cf3 100644
--- a/Alc/effects/autowah.c
+++ b/Alc/effects/autowah.c
@@ -80,16 +80,12 @@ static ALboolean ALautowahState_deviceUpdate(ALautowahState *state, ALCdevice *d
static ALvoid ALautowahState_update(ALautowahState *state, ALCdevice *Device, const ALeffectslot *Slot)
{
- ALuint i;
- ALfloat gain = sqrtf(1.0f / Device->NumChan) * Slot->Gain;
-
- /* computing high-pass cutoff and bandwidth */
const ALfloat cutoff = LOWPASSFREQREF / (Device->Frequency * 4.0f);
const ALfloat bandwidth = (cutoff / 2.0f) / (cutoff * 0.67f);
+ ALfloat gain;
/* computing high-pass filter coefficients */
- ALfilterState_setParams(&state->high_pass,
- ALfilterType_HighPass, 1.0f,
+ ALfilterState_setParams(&state->high_pass, ALfilterType_HighPass, 1.0f,
cutoff, bandwidth);
state->AttackTime = Slot->EffectProps.Autowah.AttackTime;
@@ -102,13 +98,8 @@ static ALvoid ALautowahState_update(ALautowahState *state, ALCdevice *Device, co
ALfilterState_clear(&state->low_pass);
- for(i = 0;i < MaxChannels;i++)
- state->Gain[i] = 0.0f;
- for(i = 0;i < Device->NumChan;i++)
- {
- enum Channel chan = Device->Speaker2Chan[i];
- state->Gain[chan] = gain;
- }
+ gain = sqrtf(1.0f / Device->NumChan) * Slot->Gain;
+ SetGains(Device, gain, state->Gain);
}
static ALvoid ALautowahState_process(ALautowahState *state, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[BUFFERSIZE])