diff options
author | Chris Robinson <[email protected]> | 2018-01-11 04:34:51 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-01-11 04:34:51 -0800 |
commit | f55583330baa5e0ce40aba22629b08dc608e6d84 (patch) | |
tree | 0a81636bd6fcdee5d9d667b94664e6e446d0365b /Alc | |
parent | 2c8e4467c3671aa0e5d77bbada1296ad1c44e624 (diff) |
Apply the distortion gain to the mixing gains
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/effects/distortion.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Alc/effects/distortion.c b/Alc/effects/distortion.c index 56931646..837e4d3b 100644 --- a/Alc/effects/distortion.c +++ b/Alc/effects/distortion.c @@ -79,9 +79,6 @@ static ALvoid ALdistortionState_update(ALdistortionState *state, const ALCcontex ALfloat cutoff; ALfloat edge; - /* Store distorted signal attenuation settings. */ - state->attenuation = props->Distortion.Gain; - /* Store waveshaper edge settings. */ edge = sinf(props->Distortion.Edge * (F_PI_2)); edge = minf(edge, 0.99f); @@ -104,7 +101,7 @@ static ALvoid ALdistortionState_update(ALdistortionState *state, const ALCcontex cutoff / (frequency*4.0f), calc_rcpQ_from_bandwidth(cutoff / (frequency*4.0f), bandwidth) ); - ComputeAmbientGains(&device->Dry, slot->Params.Gain, state->Gain); + ComputeAmbientGains(&device->Dry, slot->Params.Gain * props->Distortion.Gain, state->Gain); } static ALvoid ALdistortionState_process(ALdistortionState *state, ALsizei SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALsizei NumChannels) @@ -165,9 +162,9 @@ static ALvoid ALdistortionState_process(ALdistortionState *state, ALsizei Sample for(kt = 0;kt < NumChannels;kt++) { /* Fourth step, final, do attenuation and perform decimation, - * store only one sample out of 4. + * storing only one sample out of four. */ - ALfloat gain = state->Gain[kt] * state->attenuation; + ALfloat gain = state->Gain[kt]; if(!(fabsf(gain) > GAIN_SILENCE_THRESHOLD)) continue; |