diff options
author | Chris Robinson <[email protected]> | 2015-11-01 04:43:55 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2015-11-01 05:41:06 -0800 |
commit | c57f57192067e2d68cfe4ab0fc9479d2453bfbda (patch) | |
tree | fb9dabd6296c87ff72f4271774ae9951898d9227 /Alc/effects/distortion.c | |
parent | f094d94608e00b1b08bd8c607d16651072323bb5 (diff) |
Pass in the Q parameter for setting the filter parameters
Also better handle the peaking filter gain.
Diffstat (limited to 'Alc/effects/distortion.c')
-rw-r--r-- | Alc/effects/distortion.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Alc/effects/distortion.c b/Alc/effects/distortion.c index 22e05c70..221cec39 100644 --- a/Alc/effects/distortion.c +++ b/Alc/effects/distortion.c @@ -72,14 +72,16 @@ static ALvoid ALdistortionState_update(ALdistortionState *state, ALCdevice *Devi /* Bandwidth value is constant in octaves */ bandwidth = (cutoff / 2.0f) / (cutoff * 0.67f); ALfilterState_setParams(&state->lowpass, ALfilterType_LowPass, 1.0f, - cutoff / (frequency*4.0f), bandwidth); + cutoff / (frequency*4.0f), calc_rcpQ_from_bandwidth(cutoff / (frequency*4.0f), bandwidth) + ); /* Bandpass filter */ cutoff = Slot->EffectProps.Distortion.EQCenter; /* Convert bandwidth in Hz to octaves */ bandwidth = Slot->EffectProps.Distortion.EQBandwidth / (cutoff * 0.67f); ALfilterState_setParams(&state->bandpass, ALfilterType_BandPass, 1.0f, - cutoff / (frequency*4.0f), bandwidth); + cutoff / (frequency*4.0f), calc_rcpQ_from_bandwidth(cutoff / (frequency*4.0f), bandwidth) + ); ComputeAmbientGains(Device, Slot->Gain, state->Gain); } |