diff options
author | Chris Robinson <[email protected]> | 2018-08-06 23:45:32 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-08-06 23:45:32 -0700 |
commit | 04921dd7275326148fb20dac7ae599c91e8f96b9 (patch) | |
tree | 8e6726f628b6ceda111ecf7fc0365b77565688ab /Alc/effects/reverb.c | |
parent | 06da60c5551313a08078aae4bf5cd8f662469307 (diff) |
Properly set early reflection all-pass coefficient
Diffstat (limited to 'Alc/effects/reverb.c')
-rw-r--r-- | Alc/effects/reverb.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index c2616331..dd8167ef 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -366,6 +366,7 @@ static void ALreverbState_Construct(ALreverbState *state) state->Early.VecAp.Delay.Mask = 0; state->Early.VecAp.Delay.Line = NULL; + state->Early.VecAp.Coeff = 0.0f; state->Early.Delay.Mask = 0; state->Early.Delay.Line = NULL; for(i = 0;i < NUM_LINES;i++) @@ -950,13 +951,16 @@ static ALvoid UpdateDelayLine(const ALfloat earlyDelay, const ALfloat lateDelay, } /* Update the early reflection line lengths and gain coefficients. */ -static ALvoid UpdateEarlyLines(const ALfloat density, const ALfloat decayTime, const ALuint frequency, EarlyReflections *Early) +static ALvoid UpdateEarlyLines(const ALfloat density, const ALfloat diffusion, const ALfloat decayTime, const ALuint frequency, EarlyReflections *Early) { ALfloat multiplier, length; ALsizei i; multiplier = CalcDelayLengthMult(density); + /* Calculate the all-pass feed-back/forward coefficient. */ + Early->VecAp.Coeff = sqrtf(0.5f) * powf(diffusion, 2.0f); + for(i = 0;i < NUM_LINES;i++) { /* Calculate the length (in seconds) of each all-pass line. */ @@ -1179,8 +1183,8 @@ static ALvoid ALreverbState_update(ALreverbState *State, const ALCcontext *Conte State); /* Update the early lines. */ - UpdateEarlyLines(props->Reverb.Density, props->Reverb.DecayTime, - frequency, &State->Early); + UpdateEarlyLines(props->Reverb.Density, props->Reverb.Diffusion, + props->Reverb.DecayTime, frequency, &State->Early); /* Get the mixing matrix coefficients. */ CalcMatrixCoeffs(props->Reverb.Diffusion, &State->MixX, &State->MixY); |