kcat / openal-soft

OpenAL Soft is a software implementation of the OpenAL 3D audio API.
Other
2.16k stars 522 forks source link

[REQUEST] add 4th order (or more) ambisonics #1031

Open TheBestKmanEver opened 4 weeks ago

TheBestKmanEver commented 4 weeks ago

for both HRTF and speaker layout

kcat commented 4 weeks ago

Higher orders is something that could be nice to support. For fourth order, the main issue is being able to take advantage of it; speaker layouts aren't typically dense enough to utilize higher orders, for instance a 7.1 surround sound setup doesn't really benefit from even third order since there's not enough speakers to resolve the spatial detail, without succumbing to problems ambisonic panning attempts to address (sounds sticking to speakers, or having holes in between, as it pans around). HRTF may have more room to benefit with denser datasets, though less dense datasets will have the same problem if the virtual speakers don't line up well with the responses' locations. If there are ways to improve the output with higher orders despite having a low density of speakers, I'm not aware of it. The main use would be with outputting it directly to some external processor that can make use of the spatial resolution, and/or saving for future-proofing.

Orders above 4th may need more work to support, as there are places in the library that expect to use bits of an integer in relation to ambisonic channels. 32-bit integers allow up to 32 channels, which is fine for 4th order at 25 channels, while 5th order is 36, 6th order is 49, and 7th order is 64, which would need 64-bit integers. The panning coefficients for the higher order channels will also be needed, which I currently only have up to 4th order noted down. The NFC coefficients will also need expanding for higher orders, presuming the NFC filters will even still work at such higher orders.