3436 Commits

Author SHA1 Message Date
Chris Robinson
70973035de Use a separate function to get the cubic value 2018-01-07 17:24:29 -08:00
Chris Robinson
c423b6c8b7 Remove the sinc4 table 2018-01-07 05:58:52 -08:00
Chris Robinson
4cc1c64646 Replace the sinc4 resampler with cubic
Turns out the C version of the cubic resampler is just slightly faster than
even the SSE3 version of the FIR4 resampler. This is likely due to not using a
64KB random-access lookup table along with unaligned loads, both offseting the
gains from SSE.
2018-01-07 05:32:07 -08:00
Chris Robinson
ecd327e5e1 Test the correct offset for the loop start range 2018-01-04 21:21:48 -08:00
Chris Robinson
510bccb6ac Use the correct start point when looping 2018-01-04 20:21:46 -08:00
Chris Robinson
32330c5eef Use separate outputs for the vector reverse and scatter functions 2018-01-04 20:04:39 -08:00
Chris Robinson
e00ef16893 Avoid the modulated output tap for late reverb
And fix the output filtering. The modulation code is still there since it's
(probably) technically correct, but the interaction with the feedback loop and
filtering on the output caused improper behavior which needs to be sorted out.
2018-01-04 19:17:16 -08:00
Chris Robinson
08a4840298 Don't offset the reverb modulation sinus 2018-01-02 19:52:57 -08:00
Chris Robinson
a16f933e3a Use a float literal for float math 2018-01-02 19:44:31 -08:00
Chris Robinson
b8de63d608 Reset CompLen when loading loop repeats in the mixer 2018-01-02 19:29:58 -08:00
Chris Robinson
6dd1643a70 Avoid dereferencing a NULL pointer
Even though it's taking the address of a member, it's still technically a
derefernce and thus undefined behavior. sizeof doesn't "execute" the
expression, so derefering in it instead is fine.
2017-12-31 23:19:41 -08:00
Chris Robinson
98731bb574 Update resampler padding checks 2017-12-29 16:28:49 -08:00
Chris Robinson
27dfb7fd11 Fix up a comment 2017-12-24 20:41:20 -08:00
Chris Robinson
6457df54bb Don't make a pass-through macro for FadedDelayLineOut 2017-12-24 20:41:20 -08:00
Chris Robinson
07f3ed0419 Use linear interpolation for reverb modulation
The core LateReverb_* functions are explicitly written out now, since the
tapping and blending done by the Faded version is a bit more complex and it's
not so easy to ensure proper optimizing on the Unfaded version.
2017-12-24 20:40:53 -08:00
Chris Robinson
dabb99de8d Don't offset the chorus/flanger delay and LFO
The delay being added to the scaled LFO will ensure a proper positive result
regardless.
2017-12-24 20:40:33 -08:00
Chris Robinson
254ebe5f96 Fade between depths in the reverb modulator 2017-12-24 16:23:30 -08:00
Chris Robinson
b32a366137 Use a separate unmodulated feedback tap for reverb 2017-12-24 14:21:13 -08:00
Chris Robinson
ce74098b40 Clarify some reverb values 2017-12-23 21:13:57 -08:00
Chris Robinson
5769efe48e Reorder some global variables 2017-12-23 18:50:38 -08:00
Chris Robinson
02051ab51a Cleanup reverb modulation scaling 2017-12-23 14:18:14 -08:00
Chris Robinson
02c0620141 Add missing integer queries 2017-12-21 11:46:01 -08:00
Chris Robinson
d7895db166 Fix the lfo_offset for a 0-rate flanger 2017-12-19 19:15:34 -08:00
Chris Robinson
0f84e32520 Use MixSamples for the echo output 2017-12-19 15:13:11 -08:00
Chris Robinson
1a911be617 Update the chorus and flanger state struct less often 2017-12-19 15:12:06 -08:00
Chris Robinson
a0565dc9bb Make the echo effect only apply feedback to repeated samples 2017-12-19 14:11:37 -08:00
Chris Robinson
52569ef562 Fade gains in the chorus and flanger output 2017-12-19 13:52:05 -08:00
Chris Robinson
661bd054aa Use a single delay line for chorus feedback on a fixed tap
The outputs themselves use a variale-delay tap, but using a separate fixed-
delay tap on the feedback helps improve the perceived "wobble" with sustained
notes. This also applies to the flanger effect.
2017-12-18 13:41:12 -08:00
Chris Robinson
eee4aca40b Apply chorus and flanger feedback on the tapped re-feed 2017-12-17 22:14:20 -08:00
Chris Robinson
04cf832fe6 Use the selected mixer for chorus and flanger output 2017-12-17 22:10:58 -08:00
Chris Robinson
2346426b6e Make MixSamples non-static global 2017-12-17 21:48:07 -08:00
Chris Robinson
8253014fe9 Fix some types to make MSVC happy 2017-12-17 15:56:30 -08:00
Chris Robinson
ebd42ab619 Mix multiple buffers in each buffer list item
Basically now this just relies on being able to specify composited buffers.
2017-12-16 11:34:52 -08:00
Chris Robinson
b10780f119 Pre-clear the source temp buffer and accumulate into it 2017-12-16 09:41:27 -08:00
Chris Robinson
d657c51be8 Rename SrcDataSize to be less confusing 2017-12-16 08:58:46 -08:00
Chris Robinson
30007263e5 Allow storing multiple buffers in a ALbufferlistitem
This will be to allow buffer layering, multiple buffers of the same format and
sample rate that are mixed together prior to resampling, filtering, and
panning. This will allow composing sounds from individual components that can
be swapped around on different invocations (e.g. layer SoundA and SoundB on one
instance and SoundA and SoundC on a different instance for a slightly different
sound, then just SoundA for a third instance, and so on). The longest buffer
within the list item determines the length of the list item.

More work needs to be done to fully support it, namely the ability to specity
multiple buffers to layer for static and streaming sources. Also the behavior
of loop points for layered static sources should be worked out. Should also
consider allowing each layer to have a sample offset.
2017-12-15 22:59:51 -08:00
Chris Robinson
ff3d31e17f Update flanger with the same changes as chorus 2017-12-15 17:35:46 -08:00
Chris Robinson
d281b25723 Use a separate LFO offset in the chorus effect
Given that the LFO range is not a power-of-two, it won't correctly wrap on
overflow.
2017-12-15 17:26:03 -08:00
Chris Robinson
2a3b5ab9e9 Use linear interpolation for the chorus delay output 2017-12-15 16:50:06 -08:00
Chris Robinson
5993ef0baa It's getFactory that may be NULL, not its return value... 2017-11-26 09:59:55 -08:00
Chris Robinson
d96be76875 Don't probe a NULL backend factory 2017-11-26 09:53:26 -08:00
Chris Robinson
7c88e4a16b Properly initialize with the default distance model 2017-10-29 18:25:04 -07:00
Chris Robinson
eac0539ea0 Enable NFC filters for HRTF
Only applies to the Ambisonic mix (basic HRTF rendering, or B-Format buffers).
2017-10-23 13:30:01 -07:00
Chris Robinson
b82d2cf055 Store the HRTF distance in the Hrtf handle 2017-10-23 13:26:35 -07:00
Chris Robinson
0349bcc500 Update mhr format for 24-bit, multi-field, stereo measurements
Currently only single field HRTFs are supported, but the format now allows up
to 16.
2017-10-22 15:36:42 -07:00
Chris Robinson
5ec11a017c Add casts for assigning the SSE bsinc filter pointers 2017-10-07 15:28:35 -07:00
Chris Robinson
296abf03de Avoid a separate function to query ambisonic mode support
Now FuMa and ACN channel orders are required, as are FuMa, SN3D, and N3D
normalization schemes. An integer query (alcGetIntegerv) is added for the
maximum ambisonic order.
2017-09-27 11:58:36 -07:00
Chris Robinson
1ab8902621 Re-update effect slots when context properties change
Also keep all free property update structs together in the context instead of
per-object.
2017-09-27 11:13:18 -07:00
Chris Robinson
fd70b0bca6 Don't update context and listener props unnecessarily 2017-09-27 09:36:34 -07:00
Chris Robinson
101d284a18 Update the context state properties separately
The context state properties are less likely to change compared to the listener
state, and future changes may prefer more infrequent updates to the context
state.

Note that this puts the MetersPerUnit in as a context state, even though it's
handled through the listener functions. Considering the infrequency that it's
updated at (generally set just once for the context's lifetime), it makes more
sense to put it there than with the more frequently updated listener
properties. The aforementioned future changes would also prefer MetersPerUnit
to not be updated unnecessarily.
2017-09-27 08:55:42 -07:00