From a603dd55ffb9ea3e863ae3f15b1346e06035438f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 8 Nov 2013 16:54:45 -0800 Subject: Rename lfo_coeff to lfo_scale --- Alc/effects/chorus.c | 16 ++++++++-------- Alc/effects/flanger.c | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'Alc/effects') diff --git a/Alc/effects/chorus.c b/Alc/effects/chorus.c index a1c0ccf3..cced4c23 100644 --- a/Alc/effects/chorus.c +++ b/Alc/effects/chorus.c @@ -38,7 +38,7 @@ typedef struct ALchorusState { ALuint BufferLength; ALuint offset; ALuint lfo_range; - ALfloat lfo_coeff; + ALfloat lfo_scale; ALint lfo_disp; /* Gains for left and right sides */ @@ -111,7 +111,7 @@ static ALvoid ALchorusState_update(ALchorusState *state, ALCdevice *Device, cons rate = Slot->EffectProps.Chorus.Rate; if(!(rate > 0.0f)) { - state->lfo_coeff = 0.0f; + state->lfo_scale = 0.0f; state->lfo_range = 1; state->lfo_disp = 0; } @@ -122,10 +122,10 @@ static ALvoid ALchorusState_update(ALchorusState *state, ALCdevice *Device, cons switch(state->waveform) { case AL_CHORUS_WAVEFORM_TRIANGLE: - state->lfo_coeff = 1.0f / state->lfo_range; + state->lfo_scale = 4.0f / state->lfo_range; break; case AL_CHORUS_WAVEFORM_SINUSOID: - state->lfo_coeff = F_2PI / state->lfo_range; + state->lfo_scale = F_2PI / state->lfo_range; break; } @@ -138,12 +138,12 @@ static inline void Triangle(ALint *delay_left, ALint *delay_right, ALuint offset { ALfloat lfo_value; - lfo_value = 2.0f - fabsf(2.0f - state->lfo_coeff*(offset%state->lfo_range)*4.0f); + lfo_value = 2.0f - fabsf(2.0f - state->lfo_scale*(offset%state->lfo_range)); lfo_value *= state->depth * state->delay; *delay_left = fastf2i(lfo_value) + state->delay; offset += state->lfo_disp; - lfo_value = 2.0f - fabsf(2.0f - state->lfo_coeff*(offset%state->lfo_range)*4.0f); + lfo_value = 2.0f - fabsf(2.0f - state->lfo_scale*(offset%state->lfo_range)); lfo_value *= state->depth * state->delay; *delay_right = fastf2i(lfo_value) + state->delay; } @@ -152,12 +152,12 @@ static inline void Sinusoid(ALint *delay_left, ALint *delay_right, ALuint offset { ALfloat lfo_value; - lfo_value = 1.0f + sinf(state->lfo_coeff*(offset%state->lfo_range)); + lfo_value = 1.0f + sinf(state->lfo_scale*(offset%state->lfo_range)); lfo_value *= state->depth * state->delay; *delay_left = fastf2i(lfo_value) + state->delay; offset += state->lfo_disp; - lfo_value = 1.0f + sinf(state->lfo_coeff*(offset%state->lfo_range)); + lfo_value = 1.0f + sinf(state->lfo_scale*(offset%state->lfo_range)); lfo_value *= state->depth * state->delay; *delay_right = fastf2i(lfo_value) + state->delay; } diff --git a/Alc/effects/flanger.c b/Alc/effects/flanger.c index 472a91a7..c5df76de 100644 --- a/Alc/effects/flanger.c +++ b/Alc/effects/flanger.c @@ -38,7 +38,7 @@ typedef struct ALflangerState { ALuint BufferLength; ALuint offset; ALuint lfo_range; - ALfloat lfo_coeff; + ALfloat lfo_scale; ALint lfo_disp; /* Gains for left and right sides */ @@ -111,7 +111,7 @@ static ALvoid ALflangerState_update(ALflangerState *state, ALCdevice *Device, co rate = Slot->EffectProps.Flanger.Rate; if(!(rate > 0.0f)) { - state->lfo_coeff = 0.0f; + state->lfo_scale = 0.0f; state->lfo_range = 1; state->lfo_disp = 0; } @@ -122,10 +122,10 @@ static ALvoid ALflangerState_update(ALflangerState *state, ALCdevice *Device, co switch(state->waveform) { case AL_FLANGER_WAVEFORM_TRIANGLE: - state->lfo_coeff = 1.0f / state->lfo_range; + state->lfo_scale = 4.0f / state->lfo_range; break; case AL_FLANGER_WAVEFORM_SINUSOID: - state->lfo_coeff = F_2PI / state->lfo_range; + state->lfo_scale = F_2PI / state->lfo_range; break; } @@ -138,12 +138,12 @@ static inline void Triangle(ALint *delay_left, ALint *delay_right, ALuint offset { ALfloat lfo_value; - lfo_value = 2.0f - fabsf(2.0f - state->lfo_coeff*(offset%state->lfo_range)*4.0f); + lfo_value = 2.0f - fabsf(2.0f - state->lfo_scale*(offset%state->lfo_range)); lfo_value *= state->depth * state->delay; *delay_left = fastf2i(lfo_value) + state->delay; offset += state->lfo_disp; - lfo_value = 2.0f - fabsf(2.0f - state->lfo_coeff*(offset%state->lfo_range)*4.0f); + lfo_value = 2.0f - fabsf(2.0f - state->lfo_scale*(offset%state->lfo_range)); lfo_value *= state->depth * state->delay; *delay_right = fastf2i(lfo_value) + state->delay; } @@ -152,12 +152,12 @@ static inline void Sinusoid(ALint *delay_left, ALint *delay_right, ALuint offset { ALfloat lfo_value; - lfo_value = 1.0f + sinf(state->lfo_coeff*(offset%state->lfo_range)); + lfo_value = 1.0f + sinf(state->lfo_scale*(offset%state->lfo_range)); lfo_value *= state->depth * state->delay; *delay_left = fastf2i(lfo_value) + state->delay; offset += state->lfo_disp; - lfo_value = 1.0f + sinf(state->lfo_coeff*(offset%state->lfo_range)); + lfo_value = 1.0f + sinf(state->lfo_scale*(offset%state->lfo_range)); lfo_value *= state->depth * state->delay; *delay_right = fastf2i(lfo_value) + state->delay; } -- cgit v1.2.3