https://github.com/coelckers/gzdoom/pull/1652
I hope I'm doing this right.
This adds an option to play music using a Super Stereo algorithm, which can be set under the OpenAL options menu (or via the
snd_musicmode and
snd_superstereowidth cvars). This is primarily for surround sound (or HRTF) output, as it takes the stereo signal and creates a continuous left to right soundfield around the listener, instead of simply being two points that produce phantom sounds in between. This allows making the music wider or narrower as desired, while maintaining a stable center.
This relies on the
AL_SOFT_UHJ extension added in OpenAL Soft 1.22.0.
This is currently a draft as there also needs to be text additions, which I'm not sure how to do. The needed text strings for the menu are:
Code: Select all
OPTVAL_SUPERSTEREO = "Super Stereo"
OPENALMNU_MUSICMODE = "Music Mode"
OPENALMNU_SUPERSTEREOWIDTH = "Super Stereo Width"
I'm also looking for feedback if there's anything else to add or change. Currently changing the music mode (
snd_musicmode) takes effect on the next music track, while changing the width (
snd_superstereowidth) takes effect immediately. It also only affects music; since it's not the cheapest of algorithms, applying it to all stereo sounds with mods that (ab)use many stereo sounds even for things that are placed in 3D could needlessly burden and overwhelm the CPU. I also opted to make
snd_musicmode an integer cvar since that makes it easier and more efficient to check at runtime, though it makes it less intuitive to change manually if you don't know what the values mean.