aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/flanger.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-10-08 16:31:23 -0700
committerChris Robinson <[email protected]>2013-10-08 16:31:23 -0700
commita421e515befd1916d57e7668ee98c1a5dfe63dab (patch)
tree68d69e41030ccfec34ac89175edec66e99b7660b /Alc/effects/flanger.c
parent11365b42c7fedaef61d7123c390c429260eae52f (diff)
Use a helper macro for pi*2
Diffstat (limited to 'Alc/effects/flanger.c')
-rw-r--r--Alc/effects/flanger.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Alc/effects/flanger.c b/Alc/effects/flanger.c
index d3cdd250..78be5e42 100644
--- a/Alc/effects/flanger.c
+++ b/Alc/effects/flanger.c
@@ -122,7 +122,7 @@ static ALvoid ALflangerState_update(ALflangerState *state, ALCdevice *Device, co
if(rate == 0.0f)
state->lfo_coeff = 0.0f;
else
- state->lfo_coeff = F_PI * 2.0f / (frequency / rate);
+ state->lfo_coeff = F_2PI / (frequency / rate);
break;
}
@@ -152,12 +152,11 @@ static inline void Sinusoid(ALint *delay_left, ALint *delay_right, ALint offset,
{
ALfloat lfo_value;
- lfo_value = 1.0f + sinf(fmodf(state->lfo_coeff * offset, 2.0f*F_PI));
+ lfo_value = 1.0f + sinf(fmodf(state->lfo_coeff * offset, F_2PI));
lfo_value *= state->depth * state->delay;
*delay_left = fastf2i(lfo_value) + state->delay;
- lfo_value = 1.0f + sinf(fmodf(state->lfo_coeff * (offset+state->lfo_disp),
- 2.0f*F_PI));
+ lfo_value = 1.0f + sinf(fmodf(state->lfo_coeff * (offset+state->lfo_disp), F_2PI));
lfo_value *= state->depth * state->delay;
*delay_right = fastf2i(lfo_value) + state->delay;
}