Commit Graph

204 Commits

Author SHA1 Message Date
Chris Robinson
dd2e6b7902 Properly process all samples with a bandpass filter 2014-05-21 14:59:21 -07:00
Chris Robinson
e650db98f7 Use the correct input for HRTF mixing 2014-05-21 14:48:46 -07:00
Chris Robinson
4a8d38c19a Update the active source's direct and send properties after each mix 2014-05-21 14:47:25 -07:00
Chris Robinson
cd983245f1 Return a sample pointer from resamplers
Both resampling and filtering now avoid copying samples when they no-op.
2014-05-19 05:46:01 -07:00
Chris Robinson
8e04a8a022 Put per-channel filter properties together 2014-05-19 02:24:31 -07:00
Chris Robinson
7b782f6afa Return a sample pointer from DoFilters
This allows us to avoid copying samples when no filtering is needed. Doing the
same for resampling would require another temporary buffer in the device.
2014-05-19 01:54:52 -07:00
Chris Robinson
ef9dfe3772 Move an HRTF mixer parameter and shorten a couple variable names 2014-05-18 11:05:38 -07:00
Chris Robinson
9317ec59b9 Don't pass the SendParams to the wet-path mixer 2014-05-18 10:35:11 -07:00
Chris Robinson
c9083d04fa Don't pass the DirectParams to the dry-path mixer 2014-05-18 10:24:07 -07:00
Chris Robinson
5a1abf6918 Use different parameters for HRTF mixers 2014-05-18 09:31:08 -07:00
Chris Robinson
29b5dae6aa Pass some DirectParams as function parameters 2014-05-18 08:59:10 -07:00
Chris Robinson
a5631e05cc Add a ALfilterState method to process multiple samples at once 2014-05-18 06:23:20 -07:00
Chris Robinson
82dd2d875e Apply high-pass source filters as needed 2014-05-17 07:54:25 -07:00
Chris Robinson
0b5b39d5e6 Add a flag to specify when the low-pass filter needs to apply 2014-05-17 07:17:48 -07:00
Chris Robinson
a11e1c0858 Ensure that LoopEnd > LoopStart
For the benefit of Clang's static analysis, which doesn't know that a
static source will always have a valid buffer and a buffer must have a
non-0 loop range.
2014-05-15 01:44:29 -07:00
Chris Robinson
c4383b65e2 Store the current buffer queue item, rather than played buffer count 2014-05-10 03:21:40 -07:00
Chris Robinson
eea46f268d Avoid checking the previous buffer multiple times 2014-05-10 02:01:38 -07:00
Chris Robinson
cbb82647fb Remove an unnecessary conditional 2014-03-23 17:44:26 -07:00
Chris Robinson
e2cb41dc61 Remove the last bits of the predictive sample processing 2014-03-23 17:33:57 -07:00
Chris Robinson
72986882f5 Remove the click removal buffers for auxiliary effect slots 2014-03-23 16:28:55 -07:00
Chris Robinson
55f851093f Remove the now-unneeded click removal buffers for the device
They are still there for auxiliary sends. However, they should go away soon
enough too, and then we won't have to mess around with calculating extra
"predictive" samples in the mixer.
2014-03-23 07:31:33 -07:00
Chris Robinson
81e049bd47 Step mixing gains per-sample for non-HRTF mixing
This fades the dry mixing gains using a logarithmic curve, which should produce
a smoother transition than a linear one. It functions similarly to a linear
fade except that

step = (target - current) / numsteps;
...
gain += step;

becomes

step = powf(target / current, 1.0f / numsteps);
...
gain *= step;

where 'target' and 'current' are clamped to a lower bound that is greater than
0 (which makes no sense on a logarithmic scale).

Consequently, the non-HRTF direct mixers do not do not feed into the click
removal and pending click buffers, as this per-sample fading would do an
adequate job of stopping clicks and pops caused by extreme gain changes. These
buffers should be removed shortly.
2014-03-23 06:57:00 -07:00
Chris Robinson
0ce0a88fd6 Move the step counter and moving flag to DirectParams 2014-03-23 03:03:03 -07:00
Chris Robinson
b0d511a860 Store the HrtfState directly in the DirectParams 2014-03-23 02:45:50 -07:00
Chris Robinson
6ee54fb1f3 Store some source mixing parameters in the active source struct 2014-03-19 13:14:11 -07:00
Chris Robinson
54b8690781 Fix a comment 2013-10-26 08:49:37 -07:00
Chris Robinson
6425480d40 Don't store the effect slot in SendParams
This makes it much more like DirectParams.
2013-10-06 10:11:01 -07:00
Chris Robinson
8448b94c0b Rename Filter param member to LpFilter 2013-10-06 09:33:02 -07:00
Chris Robinson
e96cc656e9 Use C99's inline instead of __inline 2013-05-28 22:27:07 -07:00
Chris Robinson
feeec34333 Use ALfilterState for the source direct and send filters 2013-05-27 19:14:02 -07:00
Chris Robinson
52efb8d7f4 Use restrict instead of RESTRICT 2013-05-22 15:11:39 -07:00
Chris Robinson
e4186f4903 Use a properly-defined history for the FILTER struct 2013-05-21 07:10:24 -07:00
Chris Robinson
f0d27e5f91 Remove the unused Device parameter 2012-10-14 11:29:28 -07:00
Chris Robinson
3240894cd5 Remove the now-unused Source parameter from the DryMix methods 2012-10-14 11:04:36 -07:00
Chris Robinson
a4f21aaa64 Set Hrtf.Moving after setting the source params instead of after mixing 2012-10-09 06:54:21 -07:00
Chris Robinson
fa8d374613 Rename a couple functions
Since they don't use the stack anymore.
2012-10-05 06:44:55 -07:00
Chris Robinson
0d26b0dcc2 Put temporary storage in the device instead of on the stack 2012-10-05 06:42:26 -07:00
Chris Robinson
a6287fd407 Add a special resampler for matching sample rates 2012-10-05 06:03:19 -07:00
Chris Robinson
0b47844606 Fix potential buffer overflow with temp sample space 2012-10-05 00:27:29 -07:00
Chris Robinson
41b2c2f3bb Remove an unneeded parameter from the resampler 2012-09-27 02:46:15 -07:00
Chris Robinson
ed82194260 Deinterlace audio when loading it into the stack.
It may be better to deinterlace it on load into the buffer, though I don't
imagine this will affect much. It could be nice for consistency's sake, though
it would also complicate things if we ever want to support direct access to
buffer data.
2012-09-26 17:16:25 -07:00
Chris Robinson
a20341ac2a Ensure the ResampledBuffer is aligned 2012-09-14 04:16:49 -07:00
Chris Robinson
7635afcb52 Use a source param for the resampler and move them to the mixer source 2012-09-14 04:13:18 -07:00
Chris Robinson
ff809f2271 Move a couple methods to where they're used 2012-09-12 07:57:50 -07:00
Chris Robinson
98ff6f990a Do the filtering separately from the mixing 2012-09-11 05:56:19 -07:00
Chris Robinson
af3b5c23c8 Try to ensure mixing samples in multiples of 4 2012-09-09 04:27:47 -07:00
Chris Robinson
2bf1979d4a Move the target effect slot to the SendParams struct 2012-09-08 22:32:30 -07:00
Chris Robinson
89cab3cd39 Remove STACK_DATA_SIZE in favor of BUFFERSIZE 2012-09-08 22:09:34 -07:00
Chris Robinson
1c03025090 Separate the resampling and mixing steps 2012-09-08 21:34:36 -07:00
Chris Robinson
c9e87a19a9 Add cmake options to disable or require support for CPU extensions 2012-08-15 01:24:50 -07:00