21 Commits

Author SHA1 Message Date
Chris Robinson
c7e49c9f57 Implement yet another low-pass filter
This one using the Butterworth IIR filter design
2008-07-25 19:31:12 -07:00
Chris Robinson
93c0f61050 Clarify implicit destruction warnings 2008-07-22 14:29:27 -07:00
Chris Robinson
847b3e8b61 Preserve data and position when reallocating the reverb effect
Still not perfect, but better for when the size doesn't change
2008-02-18 21:58:58 -08:00
Chris Robinson
b5a2baafe5 Remove effect slot thunk entry when deallocated forcefully 2008-01-21 15:34:38 -08:00
Chris Robinson
db80f682c9 Clean a couple debug messages 2008-01-19 21:41:09 -08:00
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
Chris Robinson
6735fc7911 Add missing config.h includes 2008-01-16 14:09:04 -08:00
Chris Robinson
70102e7cd3 Fix debug comments 2008-01-16 13:58:10 -08:00
Chris Robinson
bb7b18d4e1 Keep track of references to effect slots, so they aren't deleted while in use 2008-01-16 13:20:09 -08:00
Chris Robinson
a6213ebfc7 Fix allocation of multiple effect slots, effects, and filters 2008-01-15 16:24:12 -08:00
Chris Robinson
b95fcf5da1 Store effect slots in the context 2008-01-15 16:22:39 -08:00
Chris Robinson
5678041b92 Remove errant line 2008-01-15 15:53:58 -08:00
Chris Robinson
7f850d8fb0 Make sure a valid context is set for effect slots 2008-01-15 15:53:06 -08:00
Chris Robinson
7edc576e9c Fix some copy/paste errors 2008-01-15 15:37:54 -08:00
Chris Robinson
3d78d93b40 Merge branch 'master' into efx-experiment 2007-12-31 19:34:52 -08:00
Chris Robinson
a433ae0ff4 Use the AuxSendAuto property of the effect slot 2007-12-18 19:43:54 -08:00
Chris Robinson
17c8881444 Add AL_EFFECTSLOT_AUXILIARY_SEND_AUTO property (still unimplemented) 2007-12-18 17:41:44 -08:00
Chris Robinson
9adc20e4e7 Implement AL_EFFECTSLOT_GAIN property 2007-12-18 15:47:24 -08:00
Chris Robinson
cf03bfa156 Implement AL_EFFECTSLOT_EFFECT property 2007-12-18 14:22:59 -08:00
Chris Robinson
d4f556836a Only allow one auxiliary effect slot 2007-12-18 13:42:13 -08:00
Chris Robinson
7458273634 Add auxiliary effect slot function skeletons 2007-12-17 17:43:19 -08:00