Use modff to split the modulation delay components

This commit is contained in:
Chris Robinson
2015-10-31 01:35:01 -07:00
parent 19c437de6d
commit 0644ebbaa2
+3 -4
View File
@@ -242,7 +242,7 @@ static inline ALvoid DelayLineIn(DelayLine *Delay, ALuint offset, ALfloat in)
// reverb.
static inline ALfloat EAXModulation(ALreverbState *State, ALuint offset, ALfloat in)
{
ALfloat sinus, frac;
ALfloat sinus, frac, fdelay;
ALfloat out0, out1;
ALuint delay;
@@ -261,9 +261,8 @@ static inline ALfloat EAXModulation(ALreverbState *State, ALuint offset, ALfloat
State->Mod.Coeff);
// Calculate the read offset and fraction between it and the next sample.
frac = (1.0f + (State->Mod.Filter * sinus));
delay = fastf2u(frac);
frac -= delay;
frac = modff(State->Mod.Filter*sinus + 1.0f, &fdelay);
delay = fastf2u(fdelay);
// Get the two samples crossed by the offset, and feed the delay line
// with the next input sample.