diff options
author | Chris Robinson <[email protected]> | 2018-08-01 02:48:31 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-08-01 02:48:31 -0700 |
commit | aa58a5d20864283cf0cd9dfbcca5c02d5c54e00e (patch) | |
tree | 07c974fab5edecd58bbdbdb519775a57eb0f5294 /Alc/effects/reverb.c | |
parent | 3894c580bf0059e93bb6171b661e2f96dc1ab27f (diff) |
Fix late reverb density gain blend weights
Now it only accounts for the representable frequency range (0.5 normalized, or
0...pi radians instead of tau). Previously, the bulk of the weighting factors
was given to the HF decay (nearly 90%, given a 44.1khz sample rate and the
default 5khz reference), with low- and mid-frequency decays splitting the
remaining 10%. Now it's closer to 75%, matching the range of representable
frequencies above the reference.
This could probably be improved further due to human hearing being less
sensitive to higher frequencies, but that is much more complicated.
Diffstat (limited to 'Alc/effects/reverb.c')
-rw-r--r-- | Alc/effects/reverb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index 12e78bdf..a4381389 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -1014,10 +1014,10 @@ static ALvoid UpdateLateLines(const ALfloat density, const ALfloat diffusion, co */ bandWeights[0] = lfW; bandWeights[1] = hfW - lfW; - bandWeights[2] = F_TAU - hfW; + bandWeights[2] = F_PI - hfW; Late->DensityGain = CalcDensityGain( CalcDecayCoeff(length, (bandWeights[0]*lfDecayTime + bandWeights[1]*mfDecayTime + - bandWeights[2]*hfDecayTime) / F_TAU) + bandWeights[2]*hfDecayTime) / F_PI) ); for(i = 0;i < NUM_LINES;i++) @@ -1151,14 +1151,14 @@ static ALvoid ALreverbState_update(ALreverbState *State, const ALCcontext *Conte ALsizei i; /* Calculate the master filters */ - hf0norm = props->Reverb.HFReference / frequency; + hf0norm = minf(props->Reverb.HFReference / frequency, 0.49f); /* Restrict the filter gains from going below -60dB to keep the filter from * killing most of the signal. */ gainhf = maxf(props->Reverb.GainHF, 0.001f); BiquadFilter_setParams(&State->Filter[0].Lp, BiquadType_HighShelf, gainhf, hf0norm, calc_rcpQ_from_slope(gainhf, 1.0f)); - lf0norm = props->Reverb.LFReference / frequency; + lf0norm = minf(props->Reverb.LFReference / frequency, 0.49f); gainlf = maxf(props->Reverb.GainLF, 0.001f); BiquadFilter_setParams(&State->Filter[0].Hp, BiquadType_LowShelf, gainlf, lf0norm, calc_rcpQ_from_slope(gainlf, 1.0f)); |