Updated OpenAL Soft to 1.17.2.

This commit is contained in:
Alex Szpakowski
2016-10-29 16:12:27 -03:00
parent 8bdcc87460
commit 3dd3f1074b
30 changed files with 721 additions and 296 deletions
+12 -12
View File
@@ -92,6 +92,7 @@ static ALvoid ALautowahState_process(ALautowahState *state, ALuint SamplesToDo,
for(it = 0;it < td;it++)
{
ALfloat smp = SamplesIn[it+base];
ALfloat a[3], b[3];
ALfloat alpha, w0;
ALfloat amplitude;
ALfloat cutoff;
@@ -117,19 +118,18 @@ static ALvoid ALautowahState_process(ALautowahState *state, ALuint SamplesToDo,
/* FIXME: Resonance controls the resonant peak, or Q. How? Not sure
* that Q = resonance*0.1. */
alpha = sinf(w0) / (2.0f * state->Resonance*0.1f);
state->LowPass.b[0] = (1.0f - cosf(w0)) / 2.0f;
state->LowPass.b[1] = 1.0f - cosf(w0);
state->LowPass.b[2] = (1.0f - cosf(w0)) / 2.0f;
state->LowPass.a[0] = 1.0f + alpha;
state->LowPass.a[1] = -2.0f * cosf(w0);
state->LowPass.a[2] = 1.0f - alpha;
b[0] = (1.0f - cosf(w0)) / 2.0f;
b[1] = 1.0f - cosf(w0);
b[2] = (1.0f - cosf(w0)) / 2.0f;
a[0] = 1.0f + alpha;
a[1] = -2.0f * cosf(w0);
a[2] = 1.0f - alpha;
state->LowPass.b[2] /= state->LowPass.a[0];
state->LowPass.b[1] /= state->LowPass.a[0];
state->LowPass.b[0] /= state->LowPass.a[0];
state->LowPass.a[2] /= state->LowPass.a[0];
state->LowPass.a[1] /= state->LowPass.a[0];
state->LowPass.a[0] /= state->LowPass.a[0];
state->LowPass.a1 = a[1] / a[0];
state->LowPass.a2 = a[2] / a[0];
state->LowPass.b1 = b[1] / a[0];
state->LowPass.b2 = b[2] / a[0];
state->LowPass.input_gain = b[0] / a[0];
temps[it] = ALfilterState_processSingle(&state->LowPass, smp);
}
+1 -1
View File
@@ -86,7 +86,7 @@ static ALvoid ALdedicatedState_process(ALdedicatedState *state, ALuint SamplesTo
continue;
for(i = 0;i < SamplesToDo;i++)
SamplesOut[c][i] = SamplesIn[i] * gains[c];
SamplesOut[c][i] += SamplesIn[i] * gains[c];
}
}
+5 -6
View File
@@ -142,12 +142,11 @@ static ALvoid ALmodulatorState_update(ALmodulatorState *state, ALCdevice *Device
cw = cosf(F_TAU * Slot->EffectProps.Modulator.HighPassCutoff / Device->Frequency);
a = (2.0f-cw) - sqrtf(powf(2.0f-cw, 2.0f) - 1.0f);
state->Filter.b[0] = a;
state->Filter.b[1] = -a;
state->Filter.b[2] = 0.0f;
state->Filter.a[0] = 1.0f;
state->Filter.a[1] = -a;
state->Filter.a[2] = 0.0f;
state->Filter.a1 = -a;
state->Filter.a2 = 0.0f;
state->Filter.b1 = -a;
state->Filter.b2 = 0.0f;
state->Filter.input_gain = a;
ComputeAmbientGains(Device, Slot->Gain, state->Gain);
}