223 Commits

Author SHA1 Message Date
Chris Robinson
903d878460 Replace restrict with RESTRICT 2018-10-29 11:32:50 -07:00
Filip Gawin
08226bc6b0 Simplify some statements 2018-10-29 13:38:58 +01:00
Chris Robinson
5c6b8eda4f Remove another duplicate function 2018-09-19 22:18:46 -07:00
Chris Robinson
ea95a8adef Combine nearly-duplicate structures 2018-09-19 21:31:46 -07:00
Chris Robinson
6eb980d1b2 Remove a couple duplicate functions 2018-09-19 21:09:19 -07:00
Chris Robinson
48b7745a49 Add macros for commonly used square roots 2018-09-19 19:53:25 -07:00
Chris Robinson
529f387695 Use a separate method to warp the azimuth for plain stereo output 2018-08-29 01:45:27 -07:00
Chris Robinson
57b860d8ca Trace the NFC reference distance when set 2018-08-03 00:07:08 -07:00
Chris Robinson
ec84a107a4 Don't hardcode the max channels for HRTF B-Format decoding 2018-05-26 00:26:11 -07:00
Chris Robinson
0cd375f03c Add a function to calculate coefficients from X, Y, Z components 2018-05-17 03:52:40 -07:00
Chris Robinson
df9faba689 Use more accurate elevations for virtual HRTF speaker positions 2018-05-14 05:28:06 -07:00
Chris Robinson
22413b82ca Pass in the number of channels per order to InitNearFieldCtrl 2018-05-01 20:21:24 -07:00
Chris Robinson
9575eebac4 Move the bnad-splitter filters to a separate source 2018-04-21 23:23:46 -07:00
Chris Robinson
400ab8766c Adjust the stereo panning front gain
This gives it a (more) precise -4.5dB gain drop for front-center panned sounds.
2018-04-19 21:55:20 -07:00
Chris Robinson
e619b64175 Don't minimize the HRTF per-response delay
The reverts both fa9ab9af7cb559ff9ecc1846f2996265bfbea1ec and
79604c3c0e0f3f71832a09348cc273a38882cc3e. As helpful as it was for the high
frequencies, the overall response's gain suffered.
2018-04-16 18:54:41 -07:00
Chris Robinson
334bc4f551 Limit the near-field control distance to 10m. 2018-03-31 23:11:48 -07:00
Chris Robinson
e288c3b44a Fix HRTF HOA coefficients
ACN8 was accidentally put on ACN7. However, rather than adding the missing
channel of silence, set up the coefficient map to only use the ambisonic
channels that can contribute to output.
2018-03-31 20:44:14 -07:00
Chris Robinson
79eb2ea26e Reduce the gain of front-panned sounds with plain stereo
Now front-center sounds are attenuated by roughly -4.5dB instead of -3dB. This
will help keep rear-panned sounds from attenuating too much while not making
front-panned also attenuate too much.
2018-03-25 12:24:43 -07:00
Chris Robinson
bf886444d2 Avoid multiple GetChannelIdxByName calls 2018-02-21 19:53:18 -08:00
Chris Robinson
6ff50558a0 Use a proper struct for specifying angular points 2018-02-18 23:56:51 -08:00
Chris Robinson
b5aa0c0759 Remove the unnecessary ComputeAmbientGains 2018-02-18 23:56:51 -08:00
Chris Robinson
79604c3c0e Preserve RMS for the high-frequency HRTF ambisonic coefficients 2018-02-18 23:56:51 -08:00
Chris Robinson
7f3d69fdbc Remove an unnecessary comment about if meters_per_unit is > 0 2018-02-18 23:56:51 -08:00
Chris Robinson
7dafac0c34 Avoid duplicating some scale tables 2018-02-18 23:56:51 -08:00
Chris Robinson
59768674f1 Use an alternate ambisonic HRTF decode layout
Similar to the previous, but includes the top and bottom HRTF responses. The
higher-order decode (for the "basic" HRTF output) also now uses 2H1P mixed-
order instead of 2H1V, which seems more stable.
2018-02-13 03:03:26 -08:00
Chris Robinson
4d417f3dd4 Make bformatdec_free and ambiup_free clear the freed pointer 2018-02-12 20:48:28 -08:00
Chris Robinson
ee3d53a673 Use an alternate virtual layout for Ambisonic HRTF decoding
This uses 16 channels, an 8-channel octagon + 8-channel cube, which should
improve horizontal resolution without affecting vertical too much.
2018-02-10 05:16:28 -08:00
Chris Robinson
c346baff5b Clarify some macro names using ambisonic mixed-mode notation 2018-02-09 18:43:34 -08:00
Chris Robinson
2873abcbc0 Fix up some types for MSVC 2018-01-11 10:55:35 -08:00
Chris Robinson
8aa9e35f8c Move the config function declarations to their own header
And rename alcConfig.c to alconfig.c for consistency.
2018-01-11 07:56:54 -08:00
Chris Robinson
15f9d15ba0 Avoid using macros to access anonymous structures 2018-01-11 03:45:23 -08: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
8a735d0ba9 Add a front-stablizer config option for surround sound modes
This improves a stereo (front-left + front-right) sound "image" by generating a
front-center channel signal. Done correctly, it helps reduce the comb effects
and phase errors associated with using only two speakers to simulate center
sounds.

Note that it shouldn't be used if the front-center channel is already included
in the positional audio mix (the dialog effect is okay). In general, it may
actually be better to exclude the front-center channel from the positional
audio mix and use this to generate front-center output.
2017-07-31 23:49:48 -07:00
Chris Robinson
88c0d22e7c Don't bother returning the IR length for B-Format decoding 2017-07-31 01:20:42 -07:00
Chris Robinson
e5431bbef7 Print an error if the input channel isn't in the device
Rather than the other way around, if a device channel isn't in the channel map.
2017-07-31 01:11:36 -07:00
Chris Robinson
de51ba088e Update default 5.1 and 6.1 coefficients to exclude front-center
Not all speaker kits have a front-center speaker capable of outputing full-
range content. It's best to err on the side of caution and not include front-
center for normal positional sound by default, leaving it instead for the
dedicated dialog effect.
2017-07-30 23:39:06 -07:00
Chris Robinson
0135ddc2e5 Scale the source volume by +3dB for a full spread
This effectively turns a full spread source into an ambient response,
preventing such sources from being unexpectedly quiet.
2017-07-18 22:15:32 -07:00
Chris Robinson
879b79740f Round the B-Format HRTF response where the multiple is defined 2017-06-16 19:00:00 -07:00
Chris Robinson
cc1b774837 Don't enable NFC for a 0 reference delay 2017-05-14 18:50:22 -07:00
Chris Robinson
44f026220f Correctly enable the ambisonic upsampler for HOA output 2017-04-21 13:26:29 -07:00
Chris Robinson
f1be335486 Check for the upsampler to determine if HRTF uses HOA 2017-04-18 17:39:10 -07:00
Chris Robinson
55011d4bfd Use a different way to get the size of structs with flexible array members 2017-04-18 14:11:15 -07:00
Chris Robinson
901804d724 Store the ambisonic order separate from the channel enum 2017-04-12 18:26:07 -07:00
Chris Robinson
e267f6b88e Don't explicitly restore the old HRTF when initializing panning
Otherwise it won't store the name in the device.
2017-04-07 08:02:13 -07:00
Chris Robinson
70a097bf59 Clean up a comment 2017-04-07 03:21:40 -07:00
Chris Robinson
338d61f907 Reference count HRTFs and unload them when unused 2017-04-06 13:00:29 -07:00
Chris Robinson
2eaa10fc21 Load HRTF files as needed
Currently only applies to external files, rather than embedded datasets. Also,
HRTFs aren't unloaded after being loaded, until library shutdown.
2017-04-05 12:27:30 -07:00
Chris Robinson
f76dea0c03 Store the loaded hrtf entry container in the enumerated hrtf entry 2017-04-05 11:29:58 -07:00
Chris Robinson
26144ca9df Rename al_string_* functions to alstr_* 2017-04-04 06:58:53 -07:00
Chris Robinson
98e8f941b7 Allocate as many channels for DirectHrtfState as needed 2017-03-11 06:20:04 -08:00