Commit Graph

1441 Commits

Author SHA1 Message Date
Chris Robinson
ecdc93f3ca Calculate HRTF stepping params right before mixing
This means we track the current params and the target params, rather than the
target params and the stepping. This closer matches the non-HRTF mixers.
2016-02-14 03:23:06 -08:00
Chris Robinson
25732d0895 Calculate channel gain stepping just before mixing 2016-02-14 01:22:01 -08:00
Chris Robinson
7f908d90af Rename ComputeBFormatGains to ComputeFirstOrderGains 2016-01-31 09:00:23 -08:00
Chris Robinson
d69dd6dc7a Make the source's buffer queue a singly-linked list 2016-01-31 00:42:58 -08:00
Chris Robinson
c1f87414c5 Mix to multichannel for effects
This mixes to a 4-channel first-order ambisonics buffer. With ACN ordering and
N3D scaling, this makes it easy to remain compatible with effects that only
care about mono input since channel 0 is an unattenuated mono signal.
2016-01-28 00:02:46 -08:00
Chris Robinson
2fa3ae85c9 Pass a pointer to the input samples array for effect processing 2016-01-27 08:16:47 -08:00
Chris Robinson
f547ef6d39 Separate calculating ambisonic coefficients from the panning gains 2016-01-25 06:11:51 -08:00
Chris Robinson
5d552980a4 Move a couple extern inline declarations to the others 2016-01-23 18:19:19 -08:00
Chris Robinson
94816d0073 Reorder filterstate properties 2016-01-23 03:38:15 -08:00
Chris Robinson
352d9afd64 Inline a couple filterstate methods 2016-01-23 01:22:08 -08:00
Chris Robinson
5d039309b3 Use doubles for the constructed listener matrix
This helps the stability of transforms to local space for sources that are at
or near the listener. With a single-precision matrix, even FLT_EPSILON might
not be enough to detect matching positions.
2015-11-11 08:19:33 -08:00
Chris Robinson
b9e192b78a Implement a band-limited sinc resampler
This is essentially a 12-point sinc resampler, unless it's resampling to a rate
higher than the output, at which point it will vary between 12 and 24 points
and do anti-aliasing to avoid/reduce frequencies going over nyquist.

Code provided by Christopher Fitzgerald.
2015-11-05 09:42:08 -08:00
Chris Robinson
c57f571920 Pass in the Q parameter for setting the filter parameters
Also better handle the peaking filter gain.
2015-11-01 05:41:06 -08:00
Chris Robinson
f094d94608 Remove an unused struct field 2015-11-01 01:01:27 -07:00
Chris Robinson
3121c30396 Fix a comment 2015-11-01 00:13:02 -07:00
Chris Robinson
35c4aae3d6 Finalize ALC_SOFT_HRTF 2015-10-28 13:38:30 -07:00
Chris Robinson
9ce2b8f9a7 Always update all reverb properties
The EAX-only effect properties will be set to compatible defaults when standard
reverb is set, and the EAX-only effects will be skipped during sample
processing.
2015-10-28 02:36:48 -07:00
Chris Robinson
e472cfcc53 Rename ALC_NUM_HRTF_SPECIFIER_SOFT to ALC_NUM_HRTF_SPECIFIERS_SOFT 2015-10-26 22:34:02 -07:00
Chris Robinson
a57fe89050 Lock the source queue for writing when updating the playback offset 2015-10-24 16:31:28 -07:00
Chris Robinson
298fdb220d Fix usage of modf 2015-10-24 15:13:56 -07:00
Chris Robinson
2a62b38530 Update filter histories even when they're not used
If the filter properties are continually updated, and the HF or LF gain goes
from <1, to 1, and later back to <1, the history shouldn't hold stale values
from before it was at 1.
2015-10-24 00:47:58 -07:00
Chris Robinson
bca854baac Use one send gain per buffer channel 2015-10-23 15:11:34 -07:00
Chris Robinson
6fc8cd3b29 Convert the PortAudio backend to the new backend API 2015-10-22 10:46:36 -07:00
Chris Robinson
6689c61ff4 Remove the MIDI code
The extension's not going anywhere, and it can't do anything fluidsynth can't.
The code maintenance and bloat is not worth keeping around, and ideally the AL
API would be able to facilitate MIDI-like behavior anyway (envelopes, start-at-
time, etc).
2015-10-20 18:01:27 -07:00
Chris Robinson
fa32093906 Remove unused channel labels 2015-10-18 10:25:56 -07:00
Chris Robinson
d9e9a7b05f Include the fractional part with the source sample/sec offset 2015-10-16 10:52:10 -07:00
Chris Robinson
2ff3bf5ab0 Use a constant value for the post-position padding 2015-10-15 15:13:19 -07:00
Chris Robinson
97f53d941c Store the source's previous samples with the voice
This helps avoid different results when looping is toggled within a couple
samples of the loop point, or when a processed buffer is removed while the
source is only a couple samples into the next buffer.
2015-10-15 07:29:25 -07:00
Chris Robinson
98eda6b35b Properly limit the calculated source offset components 2015-10-14 03:23:19 -07:00
Chris Robinson
d7ec9d355f Shut GCC up 2015-10-13 11:38:53 -07:00
Chris Robinson
2fba5c1f5e Properly apply fractional source offsets when a user offset is set 2015-10-13 03:01:34 -07:00
Chris Robinson
b859f1bdc3 Avoid multiple sin, cos, and sqrt calls for filter calculations 2015-10-11 10:21:37 -07:00
Chris Robinson
00e419e948 Replace the sinc6 resampler with sinc8, and make SSE versions 2015-10-11 07:37:22 -07:00
Chris Robinson
0211831858 Move the FIR4 from SSE2 to SSE3
SSE3 can avoid the slow _MM_TRANSPOSE_PS4 call thanks to the inclusion of
horizontal adds.
2015-10-11 06:38:00 -07:00
Chris Robinson
4f4cadd756 Allow apps to request a specific HRTF 2015-10-07 03:29:53 -07:00
Chris Robinson
0eef6d9d51 Use the enumerated HRTF list for selecting an HRTF
Also report the proper specifier of the one currently in use.
2015-10-06 06:48:53 -07:00
Chris Robinson
a4c378dd00 Enumerate and list HRTFs per-device 2015-10-06 00:23:11 -07:00
Chris Robinson
70fbc2b1ff Add a function to get a list of data files
The method takes a marked-up filename (e.g. may include %r for a sample rate,
%% for %, etc), and returns a vector of strings of found filenames that match.
It will search the CWD, the local, and global data directories, in that order.
2015-10-03 20:41:18 -07:00
Chris Robinson
aa10068ca2 Add methods to enumerate and query device HRTFs
Currently just returns a dummy entry.
2015-10-03 19:59:21 -07:00
Chris Robinson
07f80eb4e1 Move the resampler stuff to mixer.c where it's used 2015-10-01 00:34:13 -07:00
Chris Robinson
dc10e56bab Implement a 6-point sinc-lanczos filter 2015-09-29 20:39:12 -07:00
Chris Robinson
ab6622a8d6 Replace the cubic resampler with a 4-point sinc/lanczos filter 2015-09-27 23:57:25 -07:00
Chris Robinson
3e60b18989 Don't keep selecting the mixer to use 2015-09-27 20:55:39 -07:00
Chris Robinson
86ff35bf71 Increase the max pitch to 255
Note that this is the multiple above the device sample rate, rather than the
source property limit. It could theoretically be increased to 511 by testing
against UINT_MAX instead of INT_MAX, since the increment and positions are
using unsigned integers. I'm just being paranoid about overflows.
2015-09-26 11:18:30 -07:00
Chris Robinson
ba43582278 Use a single enum list for source properties 2015-09-22 08:48:26 -07:00
Chris Robinson
07d0bddb4f Avoid a potential race condition with NewThunkEntry
It's possible for another invocation to increase the array size in between the
ReadUnlock and WriteLock calls, causing the 'i' index to refer to a taken
entry.
2015-09-21 13:51:56 -07:00
Chris Robinson
33ac3095dd Handle up to 6 values with alSourcedvSOFT and alGetSourcefv 2015-09-21 09:43:51 -07:00
Chris Robinson
a774408753 Get rid of ALCdevice_GetLatency 2015-09-21 05:52:01 -07:00
Chris Robinson
db0f29f6d8 Fix updating listener params when forcing updates 2015-09-18 00:48:43 -07:00
Chris Robinson
3c72865775 Use sizeof T for the size of the object type 2015-09-15 19:23:32 -07:00