diff options
-rw-r--r-- | Alc/effects/autowah.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Alc/effects/autowah.c b/Alc/effects/autowah.c index 9857c722..c8317c8b 100644 --- a/Alc/effects/autowah.c +++ b/Alc/effects/autowah.c @@ -71,8 +71,8 @@ static ALvoid ALautowahState_update(ALautowahState *state, ALCdevice *device, co attackTime = slot->EffectProps.Autowah.AttackTime * state->Frequency; releaseTime = slot->EffectProps.Autowah.ReleaseTime * state->Frequency; - state->AttackRate = 1.0f / attackTime; - state->ReleaseRate = 1.0f / releaseTime; + state->AttackRate = powf(1.0f/GAIN_SILENCE_THRESHOLD, 1.0f/attackTime); + state->ReleaseRate = powf(GAIN_SILENCE_THRESHOLD/1.0f, 1.0f/releaseTime); state->PeakGain = slot->EffectProps.Autowah.PeakGain; state->Resonance = slot->EffectProps.Autowah.Resonance; @@ -102,9 +102,9 @@ static ALvoid ALautowahState_process(ALautowahState *state, ALuint SamplesToDo, * incoming signal, and attack or release to reach it. */ amplitude = fabsf(smp); if(amplitude > gain) - gain = minf(gain+state->AttackRate, amplitude); + gain = minf(gain*state->AttackRate, amplitude); else if(amplitude < gain) - gain = maxf(gain-state->ReleaseRate, amplitude); + gain = maxf(gain*state->ReleaseRate, amplitude); gain = maxf(gain, GAIN_SILENCE_THRESHOLD); /* FIXME: What range does the filter cover? */ @@ -168,9 +168,9 @@ static ALeffectState *ALautowahStateFactory_create(ALautowahStateFactory *UNUSED if(!state) return NULL; SET_VTABLE2(ALautowahState, ALeffectState, state); - state->AttackRate = 0.0f; - state->ReleaseRate = 0.0f; - state->Resonance = 0.0f; + state->AttackRate = 1.0f; + state->ReleaseRate = 1.0f; + state->Resonance = 2.0f; state->PeakGain = 1.0f; state->GainCtrl = 1.0f; |