From 08948079e93cbb7321be5715df36f54c5e6be3b7 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 23 Feb 2017 00:23:16 -0800 Subject: Alter how panpot/pair-wise panning works This change allows pair-wise panning to mostly go through the normal ambisonic panning methods, with one special-case. First, a term is added to the stereo decoder matrix's X coefficient so that a centered sound is reduced by -3dB on each output channel. Panning in front creates a similar gain response to the typical L = sqrt(1-pan) R = sqrt(pan) for pan = [0,1]. Panning behind the listener can reduce (up to) an additional -10dB, creating a audible difference between front and back sounds as if simulating head obstruction. Secondly, as a special-case, the source positions are warped when calculating the ambisonic coefficients so that full left panning is reached at -30 degrees and full right at +30 degrees. This is to retain the expected 60-degree stereo width. This warping does not apply to B-Format buffer input, although it otherwise has the same gain responses. --- OpenAL32/Include/alu.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenAL32/Include/alu.h') diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index c9f8760e..402c3181 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -296,6 +296,16 @@ inline void CalcXYZCoeffs(ALfloat x, ALfloat y, ALfloat z, ALfloat spread, ALflo */ void CalcAngleCoeffs(ALfloat azimuth, ALfloat elevation, ALfloat spread, ALfloat coeffs[MAX_AMBI_COEFFS]); +/** + * CalcAnglePairwiseCoeffs + * + * Calculates ambisonic coefficients based on azimuth and elevation. The + * azimuth and elevation parameters are in radians, going right and up + * respectively. This pairwise variant warps the result such that +30 azimuth + * is full right, and -30 azimuth is full left. + */ +void CalcAnglePairwiseCoeffs(ALfloat azimuth, ALfloat elevation, ALfloat spread, ALfloat coeffs[MAX_AMBI_COEFFS]); + /** * ComputeAmbientGains * -- cgit v1.2.3