diff options
author | Chris Robinson <[email protected]> | 2018-09-30 16:34:00 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-09-30 16:34:00 -0700 |
commit | ed8f44d102b6434535683a7e2d32fbac5f775b23 (patch) | |
tree | 76aa77941bec3a6977d754a1714bba8daeb293b5 /Alc | |
parent | 1d1acc0c34228f68ccfed25ec61fb6982233ab2e (diff) |
Don't scale the reverb fade counter so much
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/effects/reverb.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index cfce5623..8ebc089e 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -1195,6 +1195,7 @@ static void VectorAllpass_Faded(ALfloat (*restrict samples)[MAX_UPDATE_SAMPLES], ASSUME(todo > 0); + fade *= 1.0f/FADE_SAMPLES; for(j = 0;j < NUM_LINES;j++) { vap_offset[j][0] = offset-Vap->Offset[j][0]; @@ -1301,7 +1302,6 @@ static void EarlyReflection_Faded(ReverbState *State, ALsizei offset, const ALsi const ALfloat mixX = State->MixX; const ALfloat mixY = State->MixY; ALsizei late_feed_tap; - ALfloat fadeCount; ALsizei i, j; ASSUME(todo > 0); @@ -1313,8 +1313,8 @@ static void EarlyReflection_Faded(ReverbState *State, ALsizei offset, const ALsi ALfloat oldCoeff = State->EarlyDelayCoeff[j][0]; ALfloat oldCoeffStep = -oldCoeff / FADE_SAMPLES; ALfloat newCoeffStep = State->EarlyDelayCoeff[j][1] / FADE_SAMPLES; + ALfloat fadeCount = fade; - fadeCount = fade * FADE_SAMPLES; for(i = 0;i < todo;i++) { const ALfloat fade0 = oldCoeff + oldCoeffStep*fadeCount; @@ -1335,8 +1335,8 @@ static void EarlyReflection_Faded(ReverbState *State, ALsizei offset, const ALsi ALfloat feedb_oldCoeff = State->Early.Coeff[j][0]; ALfloat feedb_oldCoeffStep = -feedb_oldCoeff / FADE_SAMPLES; ALfloat feedb_newCoeffStep = State->Early.Coeff[j][1] / FADE_SAMPLES; + ALfloat fadeCount = fade; - fadeCount = fade * FADE_SAMPLES; for(i = 0;i < todo;i++) { const ALfloat fade0 = feedb_oldCoeff + feedb_oldCoeffStep*fadeCount; @@ -1440,7 +1440,8 @@ static void LateReverb_Faded(ReverbState *State, ALsizei offset, const ALsizei t ALsizei late_delay_tap1 = offset - State->LateDelayTap[j][1]; ALsizei late_feedb_tap0 = offset - State->Late.Offset[j][0]; ALsizei late_feedb_tap1 = offset - State->Late.Offset[j][1]; - ALfloat fadeCount = fade * FADE_SAMPLES; + ALfloat fadeCount = fade; + for(i = 0;i < todo;i++) { const ALfloat fade0 = oldDensityGain + oldDensityStep*fadeCount; @@ -1510,7 +1511,7 @@ static ALvoid ReverbState_process(ReverbState *State, ALsizei SamplesToDo, const if(UNLIKELY(fadeCount < FADE_SAMPLES)) { - ALfloat fade = (ALfloat)fadeCount / FADE_SAMPLES; + ALfloat fade = (ALfloat)fadeCount; /* Generate early reflections. */ EarlyReflection_Faded(State, offset, todo, fade, samples); |