Discussion:
stereo panning change in 1.15
Alan Witkowski
2013-07-13 18:24:50 UTC
Permalink
Hello all,

So I noticed the panning in Openal Soft changed drastically between 1.15
and 1.14. A few other folks have noticed the same:

http://www.java-gaming.org/index.php?topic=26858.0
http://stackoverflow.com/questions/12854967/openal-3d-positioning-and-panning-center

Basically what happens is the panning snaps to the left and right without
much of a center dead zone. It's quite noticeable in top-down shooters.

I narrowed the change down to this commit:
http://repo.or.cz/w/openal-soft.git/commit/febc2a50cb1a860d11b6b740bd05a555fce5a8d2

My question is: was this drastic change intentional? Is there an easy way
replicate the old behavior without doing the calculations manually?

Thanks
Chris Robinson
2013-07-14 18:40:26 UTC
Permalink
Post by Alan Witkowski
My question is: was this drastic change intentional? Is there an easy way
replicate the old behavior without doing the calculations manually?
It was intentional, yes. The problem is that you'll not have that
behavior with any other implementation, and you won't have it with
OpenAL Soft if HRTF is enabled. Since it was the original expected
behavior to not pan like that, and you're not guaranteed to be able to
depending on the output mode, to me it seems best to be consistent.

You can replicate the old behavior by moving the source in an arc above
the listener. For instance:

alSourcef(mSource, AL_REFERENCE_DISTANCE, 1.0f);
alSourcei(mSource, AL_SOURCE_RELATIVE, AL_TRUE);

ALfloat pan[3];
pan[0] = x_pan; // from -1 (left) to +1 (right)
pan[1] = sqrt(1.0f - x_pan*x_pan);
pan[2] = 0.0f;
alSourcefv(mSource, AL_POSITION, pan);

This will be compatible with HRTF and other implementations.

Loading...