Commit Graph

22 Commits

Author SHA1 Message Date
Chris Robinson
7fb4c4ce4f Move extension function declarations to alext.h/efx.h 2010-03-23 18:21:55 -07:00
Chris Robinson
3e9934e810 Mark extension functions with AL_API/ALC_API 2010-03-23 17:44:01 -07:00
Chris Robinson
98f4f5a4f0 Add EFX types and enums to alext.h
The types and enums are in efx.h, which is included by alext.h. It's done this
way because EFX has a lot if definitions which would polute alext.h
2010-03-09 09:28:22 -08:00
Chris Robinson
c1b161b44b Handle NULL effect objects as AL_EFFECT_NULL effects 2009-11-05 20:50:56 -08:00
Chris Robinson
f14cf8289e Add a method to update device-dependant effect parameters.
The effect state's update method will be called afterwards
2009-10-20 08:31:44 -07:00
Chris Robinson
6d1d61026d Be context-agnostic in the effect Create functions
This allows the effect Update functions to handle the playback frequency being
changed. By default the effects assume a maximum frequency of 192khz, however,
it can go higher at the cost of the sample buffers being cleared and the risk
of an abort() if reallocation fails
2009-10-19 07:46:53 -07:00
Chris Robinson
2c20f26784 Apply slot gain on slot output, not input 2009-05-29 16:51:00 -07:00
Chris Robinson
74dc7090fd Don't expose effect-specific structures 2009-05-29 13:30:50 -07:00
Chris Robinson
55c790c9ff Add the Echo effect 2009-04-12 16:01:10 -07:00
Chris Robinson
1c54018111 Move the WetBuffer into the effect slot object
This should make it easier to support multiple slots
2009-04-11 17:04:55 -07:00
Chris Robinson
c0ccd31a3e Implement a new reverb effect
Code created and graciously provided by Christopher Fitzgerald
2008-11-16 00:29:49 -08:00
Chris Robinson
5f3329b2c9 Don't export extension function symbols from the lib 2008-09-06 13:45:27 -07:00
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
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
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
b95fcf5da1 Store effect slots in the context 2008-01-15 16:22:39 -08:00
Chris Robinson
707e596811 Don't append _struct to the effect slot struct name 2008-01-15 16:01:27 -08:00
Chris Robinson
72ce653bcf Remove unneeded struct member 2007-12-18 17:46:49 -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
7458273634 Add auxiliary effect slot function skeletons 2007-12-17 17:43:19 -08:00