306 Commits

Author SHA1 Message Date
Chris Robinson
778b74cae1 Reimplement panning using lookup tables, based on a patch by Christian Borss
This allows speaker positions to be specified by discrete angles around the
listener, providing more flexibility and configurability in placement.
Additional patches to take advantage of this are forthcoming.
2009-01-24 10:38:04 -08:00
Chris Robinson
3056f91ec5 Apply the dry filter to multi-channel sources
Unlike mono sources, they use 2 chained one-pole filters instead of 4
2008-12-10 11:54:13 -08:00
Chris Robinson
55b9ccc2de Implement AL_EXTX_source_distance_model
As with other EXTX extensions, this is subject to change and removal as the
spec gets worked on
2008-11-25 18:56:10 -08:00
Chris Robinson
181eb95b13 Use a better dB-to-linear gain convertion 2008-11-16 00:57:35 -08: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
010f7d12f4 Don't ramp gains when starting a sound from the beginning 2008-11-13 05:48:38 -08:00
Chris Robinson
b91c2e4a99 Include float.h if it exists, for _RC_CHOP and _MCW_RC 2008-10-14 09:47:32 -07:00
Chris Robinson
59a71b1454 Remove another unused source member 2008-10-10 01:31:31 -07:00
Chris Robinson
36f133a5ae Use a modulo to keep the buffer position in range for looping sources
A high pitch and low buffer size can cause a lot of unnecessary iterations
otherwise, that just decrement the position
2008-10-10 01:13:32 -07:00
Chris Robinson
74a58c0d09 Clamp source position to the buffer size when it stops 2008-10-09 23:54:31 -07:00
Chris Robinson
bfa1107781 Remove unneeded source member variable 2008-10-09 23:44:48 -07:00
Chris Robinson
6e9e8239ef Only send one channel through the wet path 2008-10-09 04:02:34 -07:00
Chris Robinson
af9932d28b Increase max pitch to 65536
This should be safe now
2008-10-09 02:50:00 -07:00
Chris Robinson
87ff8a65e9 Simplify the lerp function 2008-10-09 02:32:47 -07:00
Chris Robinson
7b6f207790 Don't apply the wet path for multi-channel buffers 2008-10-09 02:28:52 -07:00
Chris Robinson
8672008e43 Skip mixing if the read position is beyond the end of the buffer 2008-10-09 01:17:39 -07:00
Chris Robinson
c8cd193346 The wet path should be silent if no effect is set on the slot 2008-10-09 01:07:02 -07:00
Chris Robinson
be292e5f0b Don't hold the whole-number position in the fractional value
This will help prevent overflows when the max pitch is increased
2008-10-02 23:53:46 -07:00
Chris Robinson
3863dcc9cb Use a new low-pass filter, based on the I3DL2 spec
Many thanks to Christopher Fitzgerald, for helping with it
2008-10-02 22:20:42 -07:00
Chris Robinson
6567cdd7b5 Air absorption factor is applied to the dB value, not linear gain 2008-09-22 17:01:47 -07:00
Chris Robinson
4a530e2146 Fixup some source parameter calculations 2008-09-16 07:36:48 -07:00
Chris Robinson
6bfdb57a5b Use a 12dB/oct rolloff instead of 24 for the lowpass filter 2008-09-13 02:46:14 -07:00
Chris Robinson
fa76168683 Clear the end of the buffer when at the end of the queue and not looping 2008-09-06 14:08:53 -07:00
Chris Robinson
db541f3cfa Remove unneeded source struct member 2008-08-15 17:43:07 -07:00
Chris Robinson
ac8c082b89 Overwrite the input wet sample with the output 2008-08-14 20:44:55 -07:00
Chris Robinson
22557070ec Ramp channel gains to remove pops and clicks from abrupt changes
Thanks to Christopher Fitzgerald for helping me work on it
2008-08-14 05:43:52 -07:00
Chris Robinson
ef59901e7c Set FPU mode to round toward zero for mixing 2008-08-08 07:32:21 -07:00
Chris Robinson
cfe620ccb5 Remove unnecessary casting 2008-08-08 00:21:25 -07:00
Chris Robinson
453b015225 Prevent a 0 or negative increment for the buffer position
Thanks to Christopher Fitzgerald for pointing these last two problems out
2008-08-05 20:51:30 -07:00
Chris Robinson
d3e5fcd13e Fix some calculations for the reverb buffer 2008-07-26 01:57:04 -07:00
Chris Robinson
3e0f9cc716 Make the filter processing function inline 2008-07-26 00:58:54 -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
559c786d0c Specify padding per buffer, and make sure it's large enough for the filter step 2008-07-24 00:41:25 -07:00
Chris Robinson
c3a7480961 Don't advertise extra samples for mixing 2008-07-23 23:27:38 -07:00
Chris Robinson
a75e75aef5 Implement an alternative low-pass filter
This method samples from the buffer so that it gets a time-correct 5khz stream,
which is subtracted from the original sample and has the high-frequency gain
applied, then added back.
A better method may be to average all the samples from the current one to the
one freq/5000 away, instead of bilinear filtering the two nearest freq/5000
apart. Processing cost will need to determine its viability
2008-07-23 22:29:53 -07:00
Chris Robinson
0042b1f80d Implement doppler factor source property 2008-07-15 02:33:05 -07:00
Chris Robinson
6d416ee734 Add the reverb room rolloff to the source room rolloff, not override 2008-07-15 02:23:53 -07:00
Chris Robinson
f369be148f Reduce the mix buffer sizes by half
Nearly 3MB is a bit much. Could reduce it further, but this is good enough for now.
2008-07-08 19:37:14 -07:00
Chris Robinson
3a09e446b3 Leave SourceToListener untransformed for use with untransformed velocities
Distance is also left untransformed so cone calculations with SoundToListener
are correct
2008-07-03 03:13:43 -07:00
Chris Robinson
fed346c285 Fix source calculations for AL_SOURCE_RELATIVE mode
Make sure the source position and direction are properly put into listener-
space before working with them, and don't calculate the listener velocity for
relative coordinates
2008-05-18 16:52:38 -07:00
Chris Robinson
49d9695ad9 Check the right struct member for the filter type 2008-04-12 07:25:18 -07:00
Chris Robinson
ec7f20644d Fast float-to-int function is no longer needed 2008-02-08 21:03:48 -08:00
Chris Robinson
3d5fa91703 Remove unnecessary casting 2008-02-08 21:01:05 -08:00
Chris Robinson
b4ffdfab81 Add an option for duplicating stereo sources on the back speakers 2008-02-06 22:18:50 -08:00
Chris Robinson
e8b576bc25 Use the correct channel ordering for Windows 2008-01-27 07:04:13 -08:00
Chris Robinson
01404ed7af Fix output channel order for 6.1 and 7.1 2008-01-27 06:49:48 -08:00
Chris Robinson
781e4e5be4 Remove an unneceesary pointer check and decrease indentation 2008-01-21 14:54:15 -08:00
Chris Robinson
f3dddb5e99 Remove unnecessary duplicate thunk lookups 2008-01-21 14:33:42 -08:00
Chris Robinson
9a5e892cad Small formatting updates 2008-01-20 22:16:28 -08:00
Chris Robinson
0317362662 Remove duplicate function 2008-01-20 19:22:39 -08:00