AuroraOpenALSoft/OpenAL32/Include
Chris Robinson 4caf2c7edd Implement AL_EFFECT_REVERB
Here is a quick description of how the reverb effect works:

 +--->---+*(4)
 |       V       new sample
 +-----+---+---+    |
 |extra|ltr|ref| <- +*(1)
 +-----+---+---+
   (3,5)*|   |*(2)
         +-->|
             V
         out sample

 1) Apply master reverb gain to incoming sample and place it at the head of the
    buffer. The master reverb gainhf was already applied when the source was
    initially mixed.
 2) Copy the delayed reflection sample to an output sample and apply the
    reflection gain.
 3) Apply the late reverb gain to the late reverb sample
 4) Copy the end of the buffer, applying a decay gain and the decay hf ratio,
    and add to the late reverb.
 5) Copy the late reverb sample, adding to the output sample.

 Then the head and sampling points are shifted forward, and done again for each
 new sample. The extra buffer length is determined by the Reverb Density
 property. A value of 0 gives a length of 0.1 seconds (long, with fairly
 distinct echos) , and 1 gives 0.075 seconds (short, indistinct echos).
 The decay gain is calculated such that after a number of loops to satisfy the
 Decay Time, a sample will be 1/32768th as powerful (virtually insignificant to
 the resulting output, and only getting further reduced). It is calculated as:

 DecayGain = pow(1.0f/32768.0f, 1.0/(DecayTime/ExtraLength));

 Things to note: Reverb Diffusion is not currently handled, nor is Decay HF
 Limit. Decay HF Ratios above 1 probably give incorrect results. Also, this
 method likely sucks, but it's the best I can come up with before release. :)
2008-01-18 21:25:40 -08:00
..
alAuxEffectSlot.h Implement AL_EFFECT_REVERB 2008-01-18 21:25:40 -08:00
alBuffer.h Initial import 2007-11-13 18:02:18 -08:00
alEffect.h Allow getting and setting reverb parameters, as well as setting reverb effects 2008-01-15 23:32:28 -08:00
alError.h Initial import 2007-11-13 18:02:18 -08:00
alExtension.h Initial import 2007-11-13 18:02:18 -08:00
alFilter.h Add AL_FILTER_LOWPASS support 2007-12-17 22:42:38 -08:00
alListener.h Add AL_METERS_PER_UNIT listener property 2007-12-17 19:40:43 -08:00
alMain.h Store effect slots in the context 2008-01-15 16:22:39 -08:00
alSource.h Don't include alAuxEffectSlot.h in alSource.h 2008-01-16 14:01:24 -08:00
alState.h Initial import 2007-11-13 18:02:18 -08:00
alThunk.h Move function declarations outside of the if-block 2007-12-06 22:15:16 -08:00
alu.h Make some defines local to ALu.c 2007-12-31 01:16:13 -08:00
bs2b.h Add the Bauer stereophonic-to-binaural DSP (bs2b) code and hooks 2008-01-03 05:36:51 -08:00