aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/panning.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename ComputeBFormatGains to ComputeFirstOrderGainsChris Robinson2016-01-311-1/+1
|
* Mix to multichannel for effectsChris Robinson2016-01-281-2/+20
| | | | | | 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.
* Avoid passing the device to SetChannelMapChris Robinson2016-01-271-24/+31
|
* Separate calculating ambisonic coefficients from the panning gainsChris Robinson2016-01-251-33/+40
|
* Use more accurate floating point literalsChris Robinson2015-11-061-34/+34
|
* Use ALuint instead of size_t for a loop iteratorChris Robinson2015-11-061-2/+3
|
* Remove unused channel labelsChris Robinson2015-10-181-9/+0
|
* Loop over the gain values only onceChris Robinson2015-09-241-8/+9
|
* Fix B-Format HRTF decodingChris Robinson2015-09-231-1/+1
|
* Use N3D scaling instead of FuMaChris Robinson2015-09-231-88/+96
|
* Allow for device-specific config valuesChris Robinson2015-08-281-2/+2
|
* Use ACN ordering for ambisonics coefficients arraysChris Robinson2015-08-281-82/+154
| | | | | | Note that it still uses FuMa scalings internally. Coefficients loaded from config files specify if they're FuMa (in both ordering and scaling) or N3D, and will get reordered or rescaled as needed.
* Minor reformatingChris Robinson2015-08-221-31/+32
|
* Don't explicitly store first-order coefficientsChris Robinson2015-08-181-60/+114
| | | | | | | It seems a simple scaling on the coefficients will allow first-order content to work with second- and third-order coefficients, although obviously not with any improved locality. That may be something to look into for the future, but this is good enough for now.
* Cheange some more unnecessarily small coefficients to 0Chris Robinson2015-02-111-6/+6
|
* Calculate HRTF coefficients for all B-Format channels at onceChris Robinson2015-02-101-4/+10
| | | | | | It's possible to calculate HRTF coefficients for full third-order ambisonics now, but it's still not possible to use them here without upmixing first-order content.
* Pass the (FuMa) channel number to GetBFormatHrtfCoeffsChris Robinson2015-02-101-3/+2
|
* Use B-Format for HRTF's virtual output formatChris Robinson2015-02-091-28/+9
| | | | | | | | This adds the ability to directly decode B-Format with HRTF, though only first- order (WXYZ) for now. Second- and third-order would be easilly doable, however we'd need to be able to up-mix first-order content (from the BFORMAT2D and BFORMAT3D buffer formats) since it would be inappropriate to decode lower-order content with a higher-order decoder.
* Improve ambient gain calculationsChris Robinson2014-11-251-1/+1
|
* Support B-Format output with the wave file writerChris Robinson2014-11-251-1/+18
|
* Halve the gain of the Cube8 coefficientsChris Robinson2014-11-251-8/+8
|
* Remove unused channel enumsChris Robinson2014-11-231-2/+0
|
* Remove the cube+diamond virtual layoutChris Robinson2014-11-231-51/+7
|
* Add an option for a simpler virtual channel setupChris Robinson2014-11-231-21/+53
| | | | | | With HRTF mixing, certain things are mixed to virtual channels to be filtered with HRTF later. This allows for using an 8-channel cube instead of a 14- channel cube+diamond.
* Partially revert "Use a different method for HRTF mixing"Chris Robinson2014-11-231-2/+4
| | | | | | | | | | | | The sound localization with virtual channel mixing was just too poor, so while it's more costly to do per-source HRTF mixing, it's unavoidable if you want good localization. This is only partially reverted because having the virtual channel is still beneficial, particularly with B-Format rendering and effect mixing which otherwise skip HRTF processing. As before, the number of virtual channels can potentially be customized, specifying more or less channels depending on the system's needs.
* Use a different method for HRTF mixingChris Robinson2014-11-221-0/+64
| | | | | | | | | | | | | | | | | | | | | | | This new method mixes sources normally into a 14-channel buffer with the channels placed all around the listener. HRTF is then applied to the channels given their positions and written to a 2-channel buffer, which gets written out to the device. This method has the benefit that HRTF processing becomes more scalable. The costly HRTF filters are applied to the 14-channel buffer after the mix is done, turning it into a post-process with a fixed overhead. Mixing sources is done with normal non-HRTF methods, so increasing the number of playing sources only incurs normal mixing costs. Another benefit is that it improves B-Format playback since the soundfield gets mixed into speakers covering all three dimensions, which then get filtered based on their locations. The main downside to this is that the spatial resolution of the HRTF dataset does not play a big role anymore. However, the hope is that with ambisonics- based panning, the perceptual position of panned sounds will still be good. It is also an option to increase the number of virtual channels for systems that can handle it, or maybe even decrease it for weaker systems.
* Balance the left and right channels for quad outputChris Robinson2014-11-211-2/+2
|
* Mark a function as constChris Robinson2014-11-151-1/+1
|
* Remove the unused angle and elevation from the device channel configChris Robinson2014-11-151-52/+33
|
* Slightly increase the ambient gain volumeChris Robinson2014-11-151-1/+8
|
* Add a method to convert channel enums to a label stringChris Robinson2014-11-151-62/+64
|
* Don't bother with LFE in the channel setup, set the values explicitlyChris Robinson2014-11-121-90/+75
|
* Add the ability to use custom output channel coefficientsChris Robinson2014-11-101-0/+186
| | | | | I'm not sure exactly how I want to do this yet, but this is a good starting point.
* Rename speakers to channels, and remove an old incorrect commentChris Robinson2014-11-071-10/+10
|
* Use a separate macro for the max output channel countChris Robinson2014-11-071-8/+8
|
* Fix 5.1 surround soundChris Robinson2014-11-071-13/+13
| | | | | | | | | | | | | Apparently, 5.1 surround sound is supposed to use the "side" channels, not the back channels, and we've been wrong this whole time. That means the "5.1 Side" is actually the correct 5.1 setup, and using the back channels is anomalous. Additionally, this means the 5.1 buffer format should also use the the side channels instead of the back channels. A final note: the 5.1 mixing coefficients are changed so both use the original 5.1 surround sound set (with the surround channels at +/-110 degrees). So the only difference now between 5.1 "side" and 5.1 "back" is the channel labels.
* Initialize a couple variables mingw complains aboutChris Robinson2014-11-061-2/+2
|
* Remove the channel name from ChannelConfigChris Robinson2014-11-051-46/+50
|
* Fix panning of multi-channel sourcesChris Robinson2014-11-051-1/+1
|
* Set gains using the device channel indexChris Robinson2014-11-051-20/+29
|
* Add LFE to the speaker arraysChris Robinson2014-11-041-8/+12
|
* Use a method to set omni-directional channel gainsChris Robinson2014-11-041-2/+13
|
* Use COUNTOF to set the number of speakersChris Robinson2014-11-041-7/+7
|
* Minor update for ambisonics coefficientsChris Robinson2014-11-021-11/+11
| | | | | Small tweaks to balance the left and right speakers, and change unreasonably small values to 0.
* Support B-Format source rotation with AL_ORIENTATIONChris Robinson2014-10-311-3/+5
|
* Add preliminary AL_EXT_BFORMAT supportChris Robinson2014-10-311-31/+44
| | | | | Currently missing the AL_ORIENTATION source property. Gain stepping also does not work.
* Fix stereo device configurationChris Robinson2014-10-111-2/+2
|
* Store default speaker configurations in a structChris Robinson2014-10-021-183/+69
|
* Make ComputeAngleGains use ComputeDirectionalGainsChris Robinson2014-10-021-193/+37
|
* Use an ambisonics-based panning methodChris Robinson2014-09-301-115/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For mono sources, third-order ambisonics is utilized to generate panning gains. The general idea is that a panned mono sound can be encoded into b-format ambisonics as: w[i] = sample[i] * 0.7071; x[i] = sample[i] * dir[0]; y[i] = sample[i] * dir[1]; ... and subsequently rendered using: output[chan][i] = w[i] * w_coeffs[chan] + x[i] * x_coeffs[chan] + y[i] * y_coeffs[chan] + ...; By reordering the math, channel gains can be generated by doing: gain[chan] = 0.7071 * w_coeffs[chan] + dir[0] * x_coeffs[chan] + dir[1] * y_coeffs[chan] + ...; which then get applied as normal: output[chan][i] = sample[i] * gain[chan]; One of the reasons to use ambisonics for panning is that it provides arguably better reproduction for sounds emanating from between two speakers. As well, this makes it easier to pan in all 3 dimensions, with for instance a "3D7.1" or 8-channel cube speaker configuration by simply providing the necessary coefficients (this will need some work since some methods still use angle-based panpot, particularly multi-channel sources). Unfortunately, the math to reliably generate the coefficients for a given speaker configuration is too costly to do at run-time. They have to be pre- generated based on a pre-specified speaker arangement, which means the config options for tweaking speaker angles are no longer supportable. Eventually I hope to provide config options for custom coefficients, which can either be generated and written in manually, or via alsoft-config from user-specified speaker positions. The current default set of coefficients were generated using the MATLAB scripts (compatible with GNU Octave) from the excellent Ambisonic Decoder Toolbox, at https://bitbucket.org/ambidecodertoolbox/adt/