aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects/reverb.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't scale the early reflection outputUPSTREAMChris Robinson2024-01-041-1/+1
| | | | | The secondary reflections are spatially reflected and scaled by time already, so an average of the primary and secondary doesn't make sense.
* Avoid a union for storing a temporary valueChris Robinson2024-01-031-33/+37
|
* Don't apply the T60 filter on the initial late reverb inputChris Robinson2023-12-301-37/+46
|
* Rework effect property handlingChris Robinson2023-12-241-46/+41
| | | | To nake EffectProps a variant instead of a union, and avoid manual vtables.
* Use a bool for a 0/1 valueChris Robinson2023-12-211-4/+4
|
* Ensure struct members are initializedChris Robinson2023-12-201-3/+3
|
* Remove DEF_NEWDELChris Robinson2023-12-161-2/+0
| | | | | C++17 provides alignment-aware allocators for us, so we don't need to use our own to make sure classes/structs are properly aligned.
* Finish cleanup for effectsChris Robinson2023-12-111-47/+51
|
* Fix some clang-tidy warningsChris Robinson2023-12-081-5/+0
|
* Adjust the secondary early reflectionsChris Robinson2023-12-021-6/+7
| | | | | | | | | | | | | | This reduces the delay to provide a direct (no delay) line from the early reflections to the late reverb delay buffer. This also reduces the early reflection output gain by half. The reasoning here is that EFX seems to expect only one set of initial reflections, while we use two. And being close enough in time, nearly doubles the amount of output energy. This does seem to improve the "harshness" of certain reverbs, smoothing the difference between reverbs, and makes it more like other implementations (still some work to do on late reverb, though).
* Avoid extra multipliesChris Robinson2023-12-011-3/+3
|
* Fix some commentsChris Robinson2023-11-251-3/+2
|
* Do proper spatial reflection in reverbChris Robinson2023-11-221-16/+55
| | | | | | Instead of "bouncing" the lines by indexing backwards for a not-quite-spatial- opposite, do a proper mix that moves each line response to its true spatial opposite position.
* Compensate the late delay tap by the early delay bufferChris Robinson2023-11-221-1/+5
|
* Don't combine both early reflection taps for the late reverbChris Robinson2023-11-211-2/+3
| | | | | | | | | | | | | | | | | | | It doesn't make much sense to include both early reflections to feed the late reverb, since it increases the total energy in the reverb decay. This better fits with the design described in papers for this type of reverb, and seems to better match volume levels of hardware EAX/EFX reverb (though there are still some apparent differences). Note that this adds a bit more delay to the late reverb, specifically EARLY_LINE_LENGTHS[0] * density_mult. This can be compensated for somewhat by reducing the late reverb delay by that amount (clamping to a minimum of 0). Alternatively, adjust the delay lines for the second early tap to have a zero- delay pass-through line with 3 delay lines (as opposed to the current 4 delay lines), as suggested by the paper "ADAPTING ARTIFICIAL REVERBERATION ARCHITECTURES FOR B-FORMAT SIGNAL PROCESSING". Although doing so may require additional adjustments to the delay lengths and gains to avoid the 0-length lines accumulating unattenuated copies of the signal for the early reflection output.
* Remove an outdated commentChris Robinson2023-10-201-3/+0
|
* Use a span for a known array length instead of a raw pointerChris Robinson2023-10-151-4/+4
|
* Approximate sin for the reverb modulator LFOChris Robinson2023-09-111-2/+7
| | | | | | | Reverb needs to prioritize efficiency since it's expected that an app may use multiple reverb effects simultaneously, and each individual effect may process twice during a pipeline transition. Approximating sin helps by replacing a per- sample libc call that we don't need to be perfectly accurate.
* Combine multiple divisions into oneChris Robinson2023-09-101-8/+11
|
* Include the early and late reverb gain for the decay fade timerChris Robinson2023-09-051-3/+30
|
* Fix some typos (#872)Dirk Stolle2023-07-041-2/+2
|
* Simplify effect state buffer handling someChris Robinson2023-04-041-2/+2
|
* Make a table constexprChris Robinson2023-02-071-6/+5
|
* Improve performance calculating reverb panningChris Robinson2023-02-051-10/+11
|
* Use a cubic resampler for the reverb modulator offsetChris Robinson2023-02-051-17/+61
|
* Rename some members for clarityChris Robinson2023-01-121-22/+22
|
* Avoid duplicate code to update the reverb delay linesChris Robinson2022-12-221-14/+7
|
* Include the reverb delay times in the fade sample countChris Robinson2022-12-201-24/+15
|
* Make sure to update the input filters with partial updatesChris Robinson2022-12-201-1/+11
|
* Clean up some reverb mixing loopsChris Robinson2022-12-191-21/+18
|
* Turn a static member function into a lambda where it's usedChris Robinson2022-12-191-31/+29
| | | | And clean up some parameters
* Remove a redundant commentChris Robinson2022-12-181-4/+1
|
* Use a size_t for the reverb decay fade countChris Robinson2022-12-181-2/+2
|
* Clear the old reverb pipeline buffer when it's doneChris Robinson2022-12-171-9/+46
|
* Rework reverb fading to toggle between pipelinesChris Robinson2022-12-171-475/+360
| | | | | | | | | | | | When non-simple properties are changed, the active reverb pipeline is switched and the new parameters set on that one. The main process function will then be set to fade out input on the old pipeline, fade in input on the new pipeline, then process and mix both pipelines. After some number of samples (calculated from its decay time), the old pipeline will stop processing. This should improve the transition from a highly reverberant environment by not harshly interpolating to the new environment, as well as better handle changes to the all-pass and T60 filters.
* Avoid using a macro to wrap standard attributesChris Robinson2022-12-061-1/+1
|
* Avoid some uses of the LIKELY/UNLIKELY macrosChris Robinson2022-12-051-1/+1
|
* Track if doing 2D mixing onlyChris Robinson2022-09-041-1/+1
| | | | And use it to select the proper HF scales
* Allow different HF scales for 2D mixing/outputChris Robinson2022-09-041-1/+1
| | | | | Not actually used yet, the device needs to track whether it's using 2D or 3D mixing.
* Use the difference in HF scale for upsampling ambisonicsChris Robinson2022-09-031-1/+1
|
* Revert "Don't apply the HF scaling for "upsampling" ambisonics"Chris Robinson2022-09-021-4/+29
| | | | This reverts commit bf3f63fb4c5faa45784d7433d68b7013e29ee2c1.
* Don't apply the HF scaling for "upsampling" ambisonicsChris Robinson2022-08-311-29/+4
| | | | | | | | | | | | Not sure if this is best, but it fixes the issue of upsampling lower orders to higher orders multiple times (mixing lower order to higher order, cutting back to lower order by dropping the extra channels, then upsampling again, applying the HF scale multiple times and messing up the high frequencies/energy vector), as well as having too-strong high frequencies of upsampled content in general. As it is, with the new upsampling method, the lower order signal contributes to some higher order channels, which helps offset the high frequency scaling difference (except first- to second-order, which adds nothing).
* Do a simplified update for reverb when not fadingChris Robinson2022-08-291-49/+48
|
* Always fade the main early and late delay tapsChris Robinson2022-08-291-8/+33
| | | | | | | | | These were actually missing from the current check for fading. But the EFX documentation suggests these (along with the early/late gain and panning) can be adjusted often without invoking a full change, as dynamically modeling an environment would continually change these properties as the listener moves around (changing the direction and distance to the reflective surfaces). So ensuring they're kept up-to-date would be the way to go.
* Update reverb processingChris Robinson2022-08-291-285/+290
| | | | | | | | | | | | | Separate the core delay line into early and late input delay lines. This will be necessary to allow a second late reverb processing loop to decay after a change. Also ensure the early reflection delay line is long enough to write in MAX_UPDATE_SAMPLES first without interfering with the subsequent read. And ensure the modulation delay doesn't cause an underflow on the feedback offset. Finally, move the loop inside the processing functions to minimize loop iterations.
* Upsample the reverb output as neededChris Robinson2022-08-271-35/+94
|
* Create and use 2D upsampling matricesChris Robinson2022-08-251-1/+1
|
* Inline a function and remove an unnecessary parameterChris Robinson2022-08-161-1/+1
|
* Use proper array sizes for more gainsChris Robinson2022-08-151-4/+4
|
* Use a boolean check instead of a function pointerChris Robinson2022-05-241-7/+14
|