Commit Graph

112 Commits

Author SHA1 Message Date
Chris Robinson
b838d123f8 Multiply the history offset in the filtering funcitons 2011-05-18 18:52:47 -07:00
Chris Robinson
c00b2f9254 Avoid looking in the buffer queue to find the frame size 2011-05-18 17:02:18 -07:00
Chris Robinson
06f5f0b7c8 Make mixers channel-count agnostic
As a result, this combines/removes a bunch of mixers
2011-05-17 13:25:15 -07:00
Chris Robinson
9f91ff4734 Move the channel loop to the outside of the sample mixing loop 2011-05-17 12:49:26 -07:00
Chris Robinson
2972de1047 Use function pointers to call the source mixer 2011-05-06 00:20:40 -07:00
Chris Robinson
0e824914b2 Use signed samples for 8-bit storage 2011-05-05 18:54:10 -07:00
Chris Robinson
db7ca2c7ca Combine the mono and multi-channel mixer templates 2011-05-03 16:34:28 -07:00
Chris Robinson
e2850df07e Use the same filters for mono sources and multi-channel 2011-05-03 16:18:46 -07:00
Chris Robinson
8c705cc4ea Mark some mixer pointers as restricted 2011-05-02 17:14:57 -07:00
Chris Robinson
fd795a7eeb Add casts to silence some warnings 2011-05-02 15:04:35 -07:00
Chris Robinson
abdc254e55 Use a pointer-to-arrays for the local HRTF coefficients 2011-05-02 13:35:13 -07:00
Chris Robinson
f843b7e2e3 Implement HRTF mixers for multi-channel sources 2011-05-02 02:22:30 -07:00
Chris Robinson
eea86ab891 Use flags instead of separate bools 2011-05-01 18:18:37 -07:00
Chris Robinson
56d9418119 Add an HRTF filter for mono sources
The data is based on the KEMAR HRTF data provided by MIT, which can be found at
<http://sound.media.mit.edu/resources/KEMAR.html>. The compact measurements
were used. See hrtf_tables.inc for more information.

The filter is only available for stereo output, using a 44100hz playback rate.
Note also that it currently only applies to mono sounds, and the cf_level and
head_dampen config options are ignored while it is active.
2011-05-01 13:59:44 -07:00
Chris Robinson
6713a47d38 Fix looping on loop points 2011-02-06 01:07:37 -08:00
Chris Robinson
2b7324c06e Avoid using a variable for array sizes and const variable initialization 2011-01-23 22:30:18 -08:00
Chris Robinson
c95bd6cadf Fix loop handling when traversing the buffer queue backwards 2011-01-23 15:04:42 -08:00
Chris Robinson
031111014b Be consistent with variable name use 2010-12-09 18:09:47 -08:00
Chris Robinson
3deaa2fad3 Combine stereo and multi-channel templates 2010-12-09 17:14:12 -08:00
Chris Robinson
c3cd4c80b2 Use a matrix when rendering to the dry buffer 2010-12-09 16:37:23 -08:00
Chris Robinson
d1ca8b4470 Use simple loops instead of several explicit lines for the mono mixer 2010-12-09 05:05:42 -08:00
Chris Robinson
72e3386c6a Be a bit more generic with the multi-channel mixer loops 2010-12-09 04:41:52 -08:00
Chris Robinson
9e8fb89a52 Rename OUTPUTCHANNELS to something more descriptive 2010-12-01 18:33:17 -08:00
Chris Robinson
0cf32e2946 Reorder some parameters for consistency 2010-11-29 19:48:18 -08:00
Chris Robinson
eb489ac886 Store double formats as float
The mixer will cut it down to float anyway, so it's unnecessary and needlessly
creates more mixer functions
2010-11-28 23:07:57 -08:00
Chris Robinson
0e748d98d5 Rename some stuff for consistency 2010-11-28 13:08:51 -08:00
Chris Robinson
c41e893361 Don't store the internal format in the buffer
The type and channel config are good enough
2010-11-28 12:53:35 -08:00
Chris Robinson
2fd8d6916b Support rear formats directly in the mixer 2010-11-27 22:55:20 -08:00
Chris Robinson
2a123a4760 Support 64-bit double buffers directly 2010-11-27 00:32:53 -08:00
Chris Robinson
6abb9d151e Use enums when selecting the mixer 2010-11-26 23:42:30 -08:00
Chris Robinson
16c05d2c05 Avoid some more code duplication 2010-11-26 20:22:14 -08:00
Chris Robinson
facb922f3e Properly clamp high pitch values 2010-11-26 17:47:43 -08:00
Chris Robinson
d7987677ac Subtract the fractional position separately 2010-11-26 15:51:13 -08:00
Chris Robinson
5fbbfa482f Rename some variables to be clearer 2010-11-26 12:59:45 -08:00
Chris Robinson
7287b5cd3c Make the buffer padding size dependent on the resampler 2010-11-26 02:53:15 -08:00
Chris Robinson
d647ed60e8 Convert a few divisions to multiplications 2010-11-26 01:35:40 -08:00
Chris Robinson
1cb29ece08 Make a FRACTIONONE macro, and use it 2010-11-26 01:21:46 -08:00
Chris Robinson
de8b7fbc5f Share the interpolation functions and use them in the reverb effect 2010-11-26 01:07:54 -08:00
Chris Robinson
3d1eb7dcad Add a missing break statement 2010-11-25 23:13:50 -08:00
Chris Robinson
30820c1bde Add a cubic resampler 2010-11-25 23:05:44 -08:00
Chris Robinson
46b9802902 Force the point resampler when the source plays at normal speed 2010-11-25 22:15:38 -08:00
Chris Robinson
b6fb28de1a Pass a pointer to the samplers so they can read just the samples they need 2010-11-25 22:04:17 -08:00
Chris Robinson
17fc4ba5e3 Add "pre-padding" to the temp buffer
This will help to implement resamplers that want previous samples
2010-11-25 21:42:15 -08:00
Chris Robinson
f72c735f9e Make sure the target buffer size is frame aligned 2010-11-25 14:23:03 -08:00
Chris Robinson
9b23fc5db8 Minor rework of the template macros 2010-11-25 14:07:52 -08:00
Chris Robinson
aaff188b3b Remove the cosine resampler
It's too slow when auxiliary sends are being used.
2010-11-25 13:49:51 -08:00
Chris Robinson
2595d85cca Double-up the interpolation functions (and make them use doubles) 2010-11-25 13:45:35 -08:00
Chris Robinson
2c96c29938 Rename some "template" functions 2010-11-25 13:22:54 -08:00
Chris Robinson
65919b7037 Always make sure there's a sample available to mix, for pending click removal 2010-11-25 13:17:51 -08:00
Chris Robinson
f4e0c6a348 Use a temporary stack buffer to store the source buffer data to be mixed
This makes it much easier to pack the playable buffer data so that it's a
continuous data stream. This could normally be broken up otherwise, such as
when using loop points or small queued buffers.
Currently it defaults to a 16KB stack buffer, but this can be overridden at
compile time.
2010-11-25 11:16:19 -08:00