diff options
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/bformatdec.c | 8 | ||||
-rw-r--r-- | Alc/bformatdec.h | 4 | ||||
-rw-r--r-- | Alc/effects/equalizer.c | 22 | ||||
-rw-r--r-- | Alc/effects/reverb.c | 12 |
4 files changed, 23 insertions, 23 deletions
diff --git a/Alc/bformatdec.c b/Alc/bformatdec.c index 6503ac65..2c5326d4 100644 --- a/Alc/bformatdec.c +++ b/Alc/bformatdec.c @@ -11,9 +11,9 @@ #include "almalloc.h" -void bandsplit_init(BandSplitter *splitter, ALfloat freq_mult) +void bandsplit_init(BandSplitter *splitter, ALfloat f0norm) { - ALfloat w = freq_mult * F_TAU; + ALfloat w = f0norm * F_TAU; ALfloat cw = cosf(w); if(cw > FLT_EPSILON) splitter->coeff = (sinf(w) - 1.0f) / cw; @@ -75,9 +75,9 @@ void bandsplit_process(BandSplitter *splitter, ALfloat *restrict hpout, ALfloat } -void splitterap_init(SplitterAllpass *splitter, ALfloat freq_mult) +void splitterap_init(SplitterAllpass *splitter, ALfloat f0norm) { - ALfloat w = freq_mult * F_TAU; + ALfloat w = f0norm * F_TAU; ALfloat cw = cosf(w); if(cw > FLT_EPSILON) splitter->coeff = (sinf(w) - 1.0f) / cw; diff --git a/Alc/bformatdec.h b/Alc/bformatdec.h index baaecf40..b017cfd3 100644 --- a/Alc/bformatdec.h +++ b/Alc/bformatdec.h @@ -55,7 +55,7 @@ typedef struct BandSplitter { ALfloat hp_z1; } BandSplitter; -void bandsplit_init(BandSplitter *splitter, ALfloat freq_mult); +void bandsplit_init(BandSplitter *splitter, ALfloat f0norm); void bandsplit_clear(BandSplitter *splitter); void bandsplit_process(BandSplitter *splitter, ALfloat *restrict hpout, ALfloat *restrict lpout, const ALfloat *input, ALsizei count); @@ -68,7 +68,7 @@ typedef struct SplitterAllpass { ALfloat z1; } SplitterAllpass; -void splitterap_init(SplitterAllpass *splitter, ALfloat freq_mult); +void splitterap_init(SplitterAllpass *splitter, ALfloat f0norm); void splitterap_clear(SplitterAllpass *splitter); void splitterap_process(SplitterAllpass *splitter, ALfloat *restrict samples, ALsizei count); diff --git a/Alc/effects/equalizer.c b/Alc/effects/equalizer.c index 7df15380..bc84f87f 100644 --- a/Alc/effects/equalizer.c +++ b/Alc/effects/equalizer.c @@ -125,7 +125,7 @@ static ALvoid ALequalizerState_update(ALequalizerState *state, const ALCcontext { const ALCdevice *device = context->Device; ALfloat frequency = (ALfloat)device->Frequency; - ALfloat gain, freq_mult; + ALfloat gain, f0norm; ALuint i; STATIC_CAST(ALeffectState,state)->OutBuffer = device->FOAOut.Buffer; @@ -139,31 +139,31 @@ static ALvoid ALequalizerState_update(ALequalizerState *state, const ALCcontext * of the transition band. */ gain = maxf(sqrtf(props->Equalizer.LowGain), 0.0625f); /* Limit -24dB */ - freq_mult = props->Equalizer.LowCutoff/frequency; + f0norm = props->Equalizer.LowCutoff/frequency; ALfilterState_setParams(&state->Chans[0].filter[0], ALfilterType_LowShelf, - gain, freq_mult, calc_rcpQ_from_slope(gain, 0.75f) + gain, f0norm, calc_rcpQ_from_slope(gain, 0.75f) ); gain = maxf(props->Equalizer.Mid1Gain, 0.0625f); - freq_mult = props->Equalizer.Mid1Center/frequency; + f0norm = props->Equalizer.Mid1Center/frequency; ALfilterState_setParams(&state->Chans[0].filter[1], ALfilterType_Peaking, - gain, freq_mult, calc_rcpQ_from_bandwidth( - freq_mult, props->Equalizer.Mid1Width + gain, f0norm, calc_rcpQ_from_bandwidth( + f0norm, props->Equalizer.Mid1Width ) ); gain = maxf(props->Equalizer.Mid2Gain, 0.0625f); - freq_mult = props->Equalizer.Mid2Center/frequency; + f0norm = props->Equalizer.Mid2Center/frequency; ALfilterState_setParams(&state->Chans[0].filter[2], ALfilterType_Peaking, - gain, freq_mult, calc_rcpQ_from_bandwidth( - freq_mult, props->Equalizer.Mid2Width + gain, f0norm, calc_rcpQ_from_bandwidth( + f0norm, props->Equalizer.Mid2Width ) ); gain = maxf(sqrtf(props->Equalizer.HighGain), 0.0625f); - freq_mult = props->Equalizer.HighCutoff/frequency; + f0norm = props->Equalizer.HighCutoff/frequency; ALfilterState_setParams(&state->Chans[0].filter[3], ALfilterType_HighShelf, - gain, freq_mult, calc_rcpQ_from_slope(gain, 0.75f) + gain, f0norm, calc_rcpQ_from_slope(gain, 0.75f) ); /* Copy the filter coefficients for the other input channels. */ diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index f6cd2b04..49362e2a 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -1281,23 +1281,23 @@ static ALvoid ALreverbState_update(ALreverbState *State, const ALCcontext *Conte const ALCdevice *Device = Context->Device; const ALlistener *Listener = Context->Listener; ALuint frequency = Device->Frequency; - ALfloat lfScale, hfScale, hfRatio; + ALfloat lf0norm, hf0norm, hfRatio; ALfloat lfDecayTime, hfDecayTime; ALfloat gain, gainlf, gainhf; ALsizei i; /* Calculate the master filters */ - hfScale = props->Reverb.HFReference / frequency; + hf0norm = props->Reverb.HFReference / frequency; /* Restrict the filter gains from going below -60dB to keep the filter from * killing most of the signal. */ gainhf = maxf(props->Reverb.GainHF, 0.001f); ALfilterState_setParams(&State->Filter[0].Lp, ALfilterType_HighShelf, - gainhf, hfScale, calc_rcpQ_from_slope(gainhf, 1.0f)); - lfScale = props->Reverb.LFReference / frequency; + gainhf, hf0norm, calc_rcpQ_from_slope(gainhf, 1.0f)); + lf0norm = props->Reverb.LFReference / frequency; gainlf = maxf(props->Reverb.GainLF, 0.001f); ALfilterState_setParams(&State->Filter[0].Hp, ALfilterType_LowShelf, - gainlf, lfScale, calc_rcpQ_from_slope(gainlf, 1.0f)); + gainlf, lf0norm, calc_rcpQ_from_slope(gainlf, 1.0f)); for(i = 1;i < 4;i++) { ALfilterState_copyParams(&State->Filter[i].Lp, &State->Filter[0].Lp); @@ -1341,7 +1341,7 @@ static ALvoid ALreverbState_update(ALreverbState *State, const ALCcontext *Conte /* Update the late lines. */ UpdateLateLines(props->Reverb.Density, props->Reverb.Diffusion, lfDecayTime, props->Reverb.DecayTime, hfDecayTime, - F_TAU * lfScale, F_TAU * hfScale, + F_TAU * lf0norm, F_TAU * hf0norm, props->Reverb.EchoTime, props->Reverb.EchoDepth, frequency, State); |