summaryrefslogtreecommitdiffstats
path: root/Alc/panning.c
Commit message (Collapse)AuthorAgeFilesLines
* 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/
* Combine some fields into a structChris Robinson2014-09-101-119/+114
|
* Update COPYING to the latest ↵François Cami2014-08-181-2/+2
| | | | https://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt to fix the FSF' address Fix the FSF' address in the source
* Use C99 inline in more placesChris Robinson2013-11-041-0/+2
|
* Use a helper macro for pi*2Chris Robinson2013-10-081-13/+13
|
* Use helper macros to convert between degrees and radiansChris Robinson2013-10-081-31/+31
|
* Use helpers to set channel gain arraysChris Robinson2013-10-031-7/+5
| | | | Also avoid unnecessary clearing.
* Silence some clang warningsChris Robinson2013-06-051-3/+3
|
* Use a more efficient method to offset the speaker angles when computing gainsChris Robinson2012-08-091-29/+35
|
* Use wrappers for float-typed math functionsChris Robinson2012-06-291-6/+6
|
* Don't use all caps for enum value namesChris Robinson2012-06-281-43/+43
|
* Use ComputeAngleGains for multi-channel sources and remove the unused lookup ↵Chris Robinson2012-04-291-69/+1
| | | | table stuff
* Fix a couple comment typos, and a minor cleanupChris Robinson2012-04-291-12/+6
|
* Fix ComputeAngleGainsChris Robinson2012-04-281-61/+99
| | | | | | The old code would improperly handle speakers just inside or outside the coverage area if it had to be inverted. It also didn't properly handle when only one speaker was outside of the covered area.
* Add a method to calculate gains given a sound point and its half-width, and ↵Chris Robinson2012-04-281-0/+161
| | | | | | | | | use it for reverb The half-width ranges from 0 to pi, and essentially specifies the coverage area around the listener. At 0, it's an infinitely small point sound and behaves like a usual panning sound. At pi/2 it covers half the area, and at pi it covers the whole area.
* Flip the parameters to aluCart2LUTpos, so it behaves a bit more like atan2Chris Robinson2012-04-281-2/+2
|
* Store the speaker angles in the deviceChris Robinson2012-04-271-1/+2
|
* Revert the default stereo layout back to -90 and +90 degreesChris Robinson2012-03-121-2/+2
| | | | | For the time being, until better stereo spatialization can be implemented and headphones can be better detected.
* Update the layout config option namesChris Robinson2012-03-011-6/+6
|
* Use an enum for the device typeChris Robinson2012-02-231-1/+1
|
* Always use the default speaker layout for loopback devicesChris Robinson2012-02-071-6/+10
|
* Change the default stereo speaker positions to match the stereo channel ↵Chris Robinson2012-02-041-2/+2
| | | | | | | | | positions A separate "headphones" configuration may be nice to add for -90,+90, however not many audio APIs can detect this. Ideally HRTF would be used with headphones too, which largely ignores the speaker positions, however there could be situations where this is unfeasible or unwanted.
* Use the square root to build the panning table instead of sin/cosChris Robinson2011-10-101-8/+8
|
* Use macros for float-typed PI values, to avoid manual casts everywhereChris Robinson2011-09-221-39/+39
|
* More MSVC precision castsChris Robinson2011-09-221-40/+40
|
* Use cosf and sinf when availableChris Robinson2011-09-221-4/+4
| | | | Also clear away a few more MSVC precision warnings
* Add a ConfigValueStr function, to return the string through a parameterChris Robinson2011-09-191-8/+6
|
* Print an error for invalid speaker layout keysChris Robinson2011-08-281-0/+3
|
* Rename the ERROR macro to ERRChris Robinson2011-07-131-2/+2
|
* Replace some AL_PRINT calls with proper loggingChris Robinson2011-07-101-2/+2
|
* Get rid of a couple typedefsChris Robinson2011-07-021-4/+4
|
* Add a 5.1 device format that uses side channels instead of backChris Robinson2011-05-281-0/+15
|
* Use a multi-dimensional array for the panning LUTChris Robinson2011-05-211-10/+9
|
* Remove the device channel matrixChris Robinson2011-05-061-71/+1
|