[Draft] Add a Super Stereo music option

Like feature suggestions, but you've actually written code to make it happen. More likely to make it into the game than some random request in feature suggestions.

Moderator: GZDoom Developers

Forum rules
Please see Code submission guidelines

GZDoom Status:

Legacy Status:
Image Image

QZDoom Status:
User avatar
Posts: 2938
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

[Draft] Add a Super Stereo music option

Post by Chris »


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

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.
User avatar
Posts: 17429
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: [Draft] Add a Super Stereo music option

Post by Nash »

Ah, a music stereo widener in GZDoom? :D I'll be interested to test this out for sure.

Return to “Code Submissions”