163 Commits

Author SHA1 Message Date
Chris Robinson
4cd04f192d Alter tha curve of the density-related delay scale
The delay scale is roughly linear with respect to room size, however the
density is not linear with room size. The density is calculated by taking the
room size cubed, then normalized by some factor. Unnormalizing the density and
taking the cube root restores the original room size to use as a delay scale.

The patch also alters the delay and all-pass line lengths to be based on a 1
meter room size, so the the room size recovered from the density acts as a
direct multiple for the desired target length.

Note that the room scale range is unchanged (5m to 50m), so the minimum and
maximum delays are the same. It should also be noted that 50m may not be the
correct room size for a density value of 1. A density value of 1 corresponds to
an environment size of roughly 2.52m when converted from EAX (DENSITY_SCALE
should be 16 rather than 125000), but sizes that low result in undesirable
resonance in the feedback, indicating other changes are necessary for that to
work.
2018-02-08 00:05:29 -08:00
Chris Robinson
da1ee3baba Revert "Don't fade the all-pass delay changes"
This reverts commit 799dfb732b4f49198d72649e86955ea82f45f229.
2018-02-04 19:57:22 -08:00
Chris Robinson
99f0377ae3 Construct error messages using parameterized values 2018-01-25 15:59:59 -08:00
Chris Robinson
2ded5547ba Provide messages for the remaining AL errors 2018-01-24 17:07:01 -08:00
Chris Robinson
e80b016cbe Use a global RowMixerFunc 2018-01-16 12:18:59 -08:00
Chris Robinson
799dfb732b Don't fade the all-pass delay changes 2018-01-15 18:02:11 -08:00
Chris Robinson
813b06a3a4 Fix a comment regarding the T60 filter coefficients 2018-01-15 09:22:28 -08:00
Chris Robinson
47c9b0a17e Simplify preparing the T60 filters 2018-01-15 09:17:15 -08:00
Chris Robinson
7441311e3d Use separate input and outputs for the T60 and allpass processing 2018-01-15 05:37:00 -08:00
Chris Robinson
6f48dac4cc Use a proper type for the T60 decay filter 2018-01-15 05:23:35 -08:00
Chris Robinson
bc078e5158 Separate some anonymous structs into defined structs 2018-01-14 15:42:25 -08:00
Chris Robinson
7e491ef2b2 Remove a redundant lower value clamp 2018-01-14 08:25:36 -08:00
Chris Robinson
6f532fa0e5 Don't check the modulation depth for changes multiple times 2018-01-14 07:33:53 -08:00
Chris Robinson
25b3ed3532 Use separate arrays for the T60 filter states 2018-01-14 07:29:18 -08:00
Chris Robinson
7a77a20a67 Use a macro for the number of reverb lines 2018-01-14 07:25:02 -08:00
Chris Robinson
2957d85924 Only pass the needed parameters to LateT60Filter 2018-01-14 05:24:23 -08:00
Chris Robinson
2b968766b9 Pre-apply the T60 filter midgain to the HF filter coeffs 2018-01-13 09:58:47 -08:00
Chris Robinson
78cb70a5f9 Replace some freq_mult variable names with f0norm
The latter is a bit more descriptive as f0 is often used to denote the
reference frequency of a filter, so f0norm indicates the normalized reference
frequency (ref_freq / sample_rate).
2018-01-13 09:14:46 -08:00
Chris Robinson
15f9d15ba0 Avoid using macros to access anonymous structures 2018-01-11 03:45:23 -08:00
Chris Robinson
5d1207104a Remove standard reverb specific processing functions 2018-01-07 22:48:03 -08:00
Chris Robinson
d547f52d8f Move the UNEXPECTED macro to the main header and rename it 2018-01-07 22:20:08 -08:00
Chris Robinson
32330c5eef Use separate outputs for the vector reverse and scatter functions 2018-01-04 20:04:39 -08:00
Chris Robinson
e00ef16893 Avoid the modulated output tap for late reverb
And fix the output filtering. The modulation code is still there since it's
(probably) technically correct, but the interaction with the feedback loop and
filtering on the output caused improper behavior which needs to be sorted out.
2018-01-04 19:17:16 -08:00
Chris Robinson
08a4840298 Don't offset the reverb modulation sinus 2018-01-02 19:52:57 -08:00
Chris Robinson
a16f933e3a Use a float literal for float math 2018-01-02 19:44:31 -08:00
Chris Robinson
27dfb7fd11 Fix up a comment 2017-12-24 20:41:20 -08:00
Chris Robinson
6457df54bb Don't make a pass-through macro for FadedDelayLineOut 2017-12-24 20:41:20 -08:00
Chris Robinson
07f3ed0419 Use linear interpolation for reverb modulation
The core LateReverb_* functions are explicitly written out now, since the
tapping and blending done by the Faded version is a bit more complex and it's
not so easy to ensure proper optimizing on the Unfaded version.
2017-12-24 20:40:53 -08:00
Chris Robinson
254ebe5f96 Fade between depths in the reverb modulator 2017-12-24 16:23:30 -08:00
Chris Robinson
b32a366137 Use a separate unmodulated feedback tap for reverb 2017-12-24 14:21:13 -08:00
Chris Robinson
ce74098b40 Clarify some reverb values 2017-12-23 21:13:57 -08:00
Chris Robinson
5769efe48e Reorder some global variables 2017-12-23 18:50:38 -08:00
Chris Robinson
02051ab51a Cleanup reverb modulation scaling 2017-12-23 14:18:14 -08:00
Chris Robinson
2346426b6e Make MixSamples non-static global 2017-12-17 21:48:07 -08:00
Chris Robinson
369f52a0d7 Add an option to ignore the app's speed of sound for reverb decay 2017-09-22 05:42:04 -07:00
Chris Robinson
fc9cb2fbd8 Use the app-specified speed of sound for reverb decay
Specifically, the initial reverb decay as determined by the source distance,
and the reverb decayhf limit from air absorption.
2017-09-21 10:20:59 -07:00
Chris Robinson
90cedbea49 Pass the context to the auxiliary effect update method 2017-09-21 05:42:35 -07:00
Chris Robinson
e8ce8924d1 Use sqrtf for single-precision square roots 2017-06-29 10:28:37 -07:00
Chris Robinson
e9a7218a06 Remove the fastf2u conversion function 2017-06-27 07:25:08 -07:00
Chris Robinson
10ff6cba9c Make the late lines' delay the delay average for modulation
Similar to the recent chorus and flanger changes, the modulation delay now
swings between -n to +n, where n is less than the delay length. This brings up
a slight issue with the linear interpolation, as modff doesn't produce the
correct fraction value for interpolation (it's inverted, with 0 being closer to
the next sample and 1 being closer to the base). So it's using nearest
interpolation for now.
2017-06-07 10:39:19 -07:00
Chris Robinson
5691dceb38 Add a method to copy a filter's coefficients 2017-05-21 03:31:44 -07:00
Chris Robinson
edcdc1dae8 Avoid unnecessary doubles 2017-05-21 02:42:44 -07:00
Chris Robinson
0b2467ed54 Use a macro to specify the decay target gain 2017-05-21 00:01:39 -07:00
Chris Robinson
154e53b911 Reduce the main reverb filter gain limit to match the rest 2017-05-16 13:23:16 -07:00
Chris Robinson
2aa620e58f Make reverb delay line structs use interleaved floats 2017-05-15 00:30:47 -07:00
Chris Robinson
b2760baa64 Make the reverb's early and late feedback lines interleaved 2017-05-14 23:28:22 -07:00
Chris Robinson
7cbce6806b Update a couple comments about the reverb modulation 2017-05-13 16:08:45 -07:00
Chris Robinson
0b66b2bbe7 Replace 4 separate all-passes with one vector all-pass
Each 4 related all-passes now share a structure with one delay line, which uses
an interleaved sample history. Also fixes some potential rounding problems for
delay lines with interleaved samples.
2017-05-13 15:45:05 -07:00
Chris Robinson
87d4710bc4 Apply reverb modulation to the late feedback lines
This seems to be more in-line with the intended behavior, to allow build-up and
overlap within the reverb decay, rather than a pitch-shift on input.
Unfortunately there's no readily available implementation of this reverb model
that includes modulation to compare with, so a low depth coefficient is used to
keep it very subtle.
2017-05-12 20:53:14 -07:00
Chris Robinson
d456c799fd Remove the 0.5 gain on the reverb output
Turns out to be unnecessary, as it reduced the volume below what other reverb
implementations provide with the same presets.
2017-05-11 23:26:29 -07:00