aboutsummaryrefslogtreecommitdiffstats
path: root/alc/alu.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename lerp to avoid conflicts with C++20's std::lerpChris Robinson2022-04-061-8/+8
|
* Limit the super stereo width factor to 0.7Chris Robinson2022-04-041-1/+1
|
* Avoid some redundant variable assignmentsChris Robinson2022-03-301-12/+6
|
* Add options to reverse local X and Y coordinatesChris Robinson2022-03-101-2/+6
| | | | | To go along with reverse-z on the other axii. This is only for games that have position/orientation errors causing top-bottom (or left-right) inversion.
* Add a config option for reverse-zChris Robinson2022-03-101-18/+8
| | | | | | The same as the __ALSOFT_REVERSE_Z env var, but in the config file. Should only be used for per-game config files (either along side the executable, or setting the ALSOFT_CONF env var when launching the app).
* Fix applying air absorptionChris Robinson2022-03-021-20/+20
|
* Move some temp variables closer to where they're usedChris Robinson2022-03-021-69/+67
|
* Rework source send distance attenuation handlingChris Robinson2022-03-021-61/+77
| | | | | | | | Specifically, AL_[EAX]REVERB_ROOM_ROLLOFF_FACTOR always applies to an inverse distance rolloff model, where the source's AL_ROOM_ROLLOFF_FACTOR applies to the selected distance model. Consequently, the normal distance and cone attenuation only needs to be calculated once for all sends, with the effect's room rolloff calculated and applied separately.
* Rework the initial reverb decayChris Robinson2022-03-011-41/+32
| | | | | | | | | | | | | | | | | | The idea here is that the initial reverb decay can't become less than the dry path distance attenuation, as the dry attenuation represents the audio that has not yet had a chance to start reflecting in the environment. As well, the reference distance indicates where there is no distance attenuation, with any initial attenuation set by the environment itself. So what we do is use the dry path attenuation as the baseline for what's mixed to the reverb, with the decay rate indicating how much of the remaining room (non-direct) energy attenuates with distance. This may be over-complicating it. Other sources hint at a more typical XdB per doubling of distance, with X varying depending on environment properties (room size, absorbancy, etc). This could be handled by applying a normal inverse distance attenuation model, with a rolloff factor generated from the reverb properties (density, decay rate, etc). Will need more testing and research.
* Make some local constexpr variables staticChris Robinson2022-02-231-5/+5
|
* Handle AirAbsorptionGainHF as a native context propertyChris Robinson2022-02-081-1/+3
|
* Combine listener and context updatesChris Robinson2022-02-081-18/+7
|
* Avoid a magic numberChris Robinson2022-02-011-1/+1
|
* Remove math_defs.hChris Robinson2022-01-271-2/+4
|
* Get rid of MathDefsChris Robinson2022-01-271-9/+12
|
* Use a bitset instead of a plain uint for flagsChris Robinson2021-12-231-5/+5
|
* Don't do direct channels with UHJ outputChris Robinson2021-12-211-1/+3
| | | | | | | | | | Directly mixing a non-UHJ stereo signal into a UHJ stereo signal results in a non-UHJ stereo signal. Such a mix can't be properly decoded anymore. An option can probably be added for users that intend to listen to UHJ output undecoded and let a stereo sound come through as-is on their speakers, but it probably shouldn't be the default for cases where the output may be decoded back.
* Move the effects base and effectslot to coreChris Robinson2021-12-171-2/+2
|
* Add source properties for Super StereoChris Robinson2021-12-151-0/+3
| | | | | When playing a stereo format, enabling Super Stereo causes the source to behave as a B-Format source, with a variable width control.
* Make an inline function to check for 2D ambisonic formatsChris Robinson2021-12-121-7/+3
|
* Add an internal Super Stereo formatChris Robinson2021-12-111-7/+7
| | | | | | | It's not available as an AL buffer format (yet) since I'm not sure how to expose it. Internally it seems fine as a separate channel configuration, but because OpenAL combines the channel configuration and sample type, a flag may work better there.
* Don't clamp the distance with distance attenuation disabledChris Robinson2021-11-301-1/+0
|
* Avoid passing spans unnecessarilyChris Robinson2021-11-251-2/+2
|
* Fix cone angle calculation (#605)Devin Braune2021-10-141-1/+1
|
* Avoid manually prefixing EventType_ enumsChris Robinson2021-10-101-5/+5
| | | | And use a better fitting type that matches how it's used
* Make a construct_at method amd use itChris Robinson2021-10-081-3/+5
|
* Ensure unused output channels are cleared when renderingChris Robinson2021-07-241-1/+12
|
* Add a UHJ-specific coefficient scaling arrayChris Robinson2021-07-131-2/+7
|
* Don't attenuate spatialized multichannel sourcesChris Robinson2021-06-241-34/+9
| | | | | | | | It's inconsistent behavior with spatialized B-Format sources, and causes a very apparent gain disparity between such a source on the listener compared to just barely off-origin. It's also not something an app can easy correct for if it doesn't want that behavior, since the source gain clamps to 1 by default. In contrast, an app can attenuate sources as they want with little issue.
* Add an option to mix directly in the JACK callbackChris Robinson2021-06-081-38/+64
|
* Handle the listener position separate from the rotation matrixChris Robinson2021-05-251-12/+9
| | | | | | It's too unstable with larger vectors. Even when the source and listener positions are the same, floating point precision can cause noticeable rounding errors.
* Move BufferStorage and Voice to coreChris Robinson2021-04-271-2/+2
|
* Move ContextBase and VoiceChange to coreChris Robinson2021-04-271-2/+2
|
* Partially implement an extension to hold sources on disconnectChris Robinson2021-04-261-0/+6
| | | | | | | | Rather than stopping voices/sources when the device becomes disconnected, the context can be set to leave them alone. As a consequence, their state will remain as playing and they'll keep their last known sample offset indefinately. For applications mindful of this behavior, it will allow resetting or reopening the device to reconnect and automatically resume where it left off.
* Move GetChannelIdxByName and clean up some more includesChris Robinson2021-04-261-11/+11
|
* Move bformatdec to coreChris Robinson2021-04-251-2/+2
|
* Move async_event.h to coreChris Robinson2021-04-251-2/+19
|
* Move some functions to coreChris Robinson2021-04-251-0/+1
| | | | And clean up more includes
* Create a base the ALCdevice and ALCcontext structsChris Robinson2021-04-241-23/+23
| | | | | A base that contains the API-agnostic data, with ALCdevice and ALCcontext being for AL-specific data.
* Move hrtf.cpp/h to coreChris Robinson2021-04-221-1/+1
|
* Rename Uhj2Encoder to UhjEncoderChris Robinson2021-04-011-1/+1
|
* Add support for 4-channel UHJChris Robinson2021-03-311-2/+5
| | | | Also add the SOFT moniker to the new macros
* Handle 3-channel UHJ audio buffersChris Robinson2021-03-311-3/+5
|
* Decode UHJ buffers to B-Format for mixingChris Robinson2021-03-311-10/+7
| | | | | This should also have an adjustment for the shelf filter. Although it's not clear what the appropriate adjustments should be.
* Start an interface for providing UHJ audioChris Robinson2021-03-311-0/+7
| | | | Currently only 2-channel UHJ, which gets treated as stereo.
* Avoid making BSincPointsMax publicChris Robinson2021-03-011-1/+0
|
* Avoiding cutting all bsinc resampler output at scale 0Chris Robinson2021-02-241-2/+2
| | | | | | | | | | | | This is mostly for the SampleConverter, used by some capture backends. When recording at really low rates, like 5512hz, with a device capturing at a higher rate like 44100hz or 48000hz, it hits the filter's downscaling limit and produces pure silence. In such cases, it's better to just accept some aliasing noise so that the app will still get some recognizable audio. The alternative would be to scale the desired rate by 2x, 3x, etc until it's above the bsinc limit, then take every 2nd, 3rd, etc sample of the result as if by an extra simpler resampler pass.
* Use spans instead of references to arraysChris Robinson2021-02-061-3/+3
|
* Add a panning "deadzone" for spatialized sourcesChris Robinson2021-01-281-1/+1
| | | | It is now the greater of 'epsilon' (1 / 2**23) or ref_distance/1024.
* Avoid global constexpr arraysChris Robinson2021-01-211-12/+12
|