DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::AlgorithmicReverb< T > Class Template Reference

True-stereo 32-line FDN reverb with exact per-band decay and 6 presets. More...

#include <AlgorithmicReverb.h>

Collaboration diagram for dspark::AlgorithmicReverb< T >:

Classes

struct  CachedParams
 Block-cached copies of the atomics read in the sample loop. More...
 
struct  DecayBand
 One band of the decay equalizer. More...
 
struct  DelayBank
 Equal-size delay lines in one contiguous buffer sharing a write index (every line is written once per sample): at(i, k) is the sample line i received k samples ago. More...
 
struct  Line
 Power-of-two circular delay line: at(k) is the sample pushed k samples ago. More...
 
struct  PlateTank
 
struct  PresetValues
 
struct  PublishedDecayBand
 
struct  SecondSlope
 
struct  SegmentLfo
 Modulation by segments: a straight move toward the other side, a random share (0.3 to 0.95) of the way to its limit, at a random speed (each segment 0.5 to 1.5 cycles of the rate), then the next; the output follows the segments through a critically damped second-order filter (at twice the rate, 0.2 to 20 Hz), so the delay and its rate of change are continuous. More...
 
struct  SmoothRandomLFO
 
struct  Wall
 Hermite-interpolated random noise generator for organic modulation. More...
 

Public Types

enum class  Type {
  Room , Hall , Chamber , Plate ,
  Spring , Cathedral
}
 Reverb type presets. More...
 
enum class  Quality { Full , Eco }
 Engine quality / CPU cost trade-off (see setQuality()). More...
 
enum class  DecayShape { Off , Bell , LowShelf , HighShelf }
 Shape of a band of the decay equalizer (setDecayBand()). More...
 
enum class  NoteValue {
  Off , Whole , Half , Quarter ,
  Eighth , Sixteenth , ThirtySecond
}
 A note value for the tempo-synced times. More...
 
enum class  NoteFeel { Straight , Dotted , Triplet }
 The feel of a note value. More...
 
enum class  WidthLaw { Side , PowerKept }
 How the output width acts (setWidthLaw()). More...
 
enum class  ModulationStyle { Smooth , Segments }
 How the lines' lengths wander (setModulationStyle()). More...
 
enum class  SpaceLayout { Prime , Geometric }
 How the line lengths are laid out (setSpaceLayout()). More...
 

Public Member Functions

 ~AlgorithmicReverb ()=default
 
void prepare (const AudioSpec &spec)
 Prepares the reverberation engine and allocates required memory.
 
void processBlock (AudioBufferView< T > buffer) noexcept
 Processes an audio block in place with zero allocations.
 
std::pair< T, T > processSample (T input) noexcept
 Processes a single mono sample and returns the wet stereo pair.
 
void reset () noexcept
 Clears all delay lines and filter states and restarts the modulation, snapping any length glide to its target.
 
void setType (Type type) noexcept
 Loads the selected preset baseline.
 
void setQuality (Quality q) noexcept
 Selects the engine quality / CPU cost trade-off.
 
void setDecay (T seconds) noexcept
 Mid-frequency reverberation time in seconds (0.1 - 30).
 
void setMix (T dryWet) noexcept
 Dry/wet mix (0 = dry, 1 = wet). The wet signal is calibrated to the dry one's level: on pink noise at full mix it sits within about a decibel of it at every type's preset, and within -1 to +3.5 dB as the decay goes from 12 s down to 0.3 s and the size changes (its energy grows with the decay; a gain from the decay and the mean round trip takes that back).
 
void setSize (T size) noexcept
 Room size (0.01 - 1). Scales the delay lines from 36% to 100% of their base lengths. A change cross-fades two read heads, the old lengths to the new, over a quarter of a second (no click and no glide of pitch; the next change waits for the fade), so the size can be automated.
 
void setDamping (T amount) noexcept
 Sets high-frequency damping (0 = bright, 1 = dark).
 
void setPreDelay (T ms) noexcept
 Pre-delay before the early reflections, in ms (0 - 500); a note value set by setPreDelayNote() takes its place.
 
void setDiffusion (T amount) noexcept
 Diffusion (0 - 1): the strength of the input, in-loop and output allpass diffusers, and how many of the first early reflections stay discrete (7 at 0, 1 at 1). High values give a smooth, dense onset; low values keep crisp, localisable early echoes. For Type::Spring it sets the strength of the chirp. The allpass coefficients glide over about 20 ms.
 
void setModulation (T amount) noexcept
 Modulation depth (0 - 1) of the delay-line wander. It smears the tail's resonances; 0 is fully static, 1 is a strong chorus. The depth is defined in time and scales with the room size.
 
void setWidth (T width) noexcept
 Sets stereo width of the late reverb tail.
 
void setErToLateDelay (T ms) noexcept
 Extra gap between the early reflections and the late tail, in ms (0 - 200).
 
void setHighDecayMultiplier (T mult) noexcept
 Sets HF decay as a multiplier of mid decay time.
 
void setBassDecayMultiplier (T mult) noexcept
 Sets bass decay as a multiplier of mid decay time.
 
void setHighCrossover (T hz) noexcept
 Frequency where the HF decay transition is centered.
 
void setAirAbsorption (T amount) noexcept
 The absorption of the air inside the tank, on top of the walls' (opt-in; the network types).
 
T getAirAbsorption () const noexcept
 
void setBassCrossover (T hz) noexcept
 Frequency where the bass decay transition is centered.
 
void setEarlyLevel (T dB) noexcept
 Early reflections level in dB (-60 to +6). 0 dB is the physical balance: the early field then carries the late field's energy density and decay, so the two join on one exponential at any size and decay time. Changes glide over about 20 ms.
 
void setLateLevel (T dB) noexcept
 Late tail level in dB (-60 to +6). Changes glide over about 20 ms.
 
void setModRate (T hz) noexcept
 Modulation rate in Hz (0.1 - 5); each line wanders at its own multiple.
 
void setToneLowCut (T hz) noexcept
 Sets a post-reverb low-cut filter on the wet signal (12 dB/oct).
 
void setToneHighCut (T hz) noexcept
 Sets a post-reverb high-cut filter on the wet signal (12 dB/oct).
 
void setDecayBand (int index, const DecayBand &band) noexcept
 One band of the decay equalizer: the decay time in a band of frequencies, as a multiple of what the other controls give there.
 
DecayBand getDecayBand (int index) const noexcept
 
void setTailHold (bool on) noexcept
 Holds the tail: the input to the tank and the early field fade out over about 20 ms while every loop's absorption and decay band fade to unity, so the tail holds with its highs. Off fades back.
 
bool isTailHeld () const noexcept
 
void setDryDip (T dB) noexcept
 Dips the wet signal under the dry one while it plays (see TailShaper): by up to dB (0 to 48; 0, the default, is off), in proportion to the dry level against its own recent peak.
 
void setGate (T thresholdDb) noexcept
 Gate on the wet signal (see TailShaper): it closes once the dry signal has stayed thresholdDb under its recent peak (-80 to 0; below -80, the default, the gate is off) for the hold time.
 
void setGateHold (T ms) noexcept
 Hold of the gate, 0 to 4000 ms (default 100); a note value set by setGateHoldNote() takes its place.
 
void setGateRelease (T ms) noexcept
 Release of the gate, 5 to 4000 ms (default 150).
 
void setSourceDepth (T amount) noexcept
 Depth of the source in the room, 0 to 1 (0, the default, is off): one control that moves the balance from the early reflections (down to half) to the tail (up by half), shortens the pre-delay (to a fifth at 1), adds input diffusion (with its square, up to 0.25) and darkens the wet signal with a one-pole low-pass from 18 kHz down (to 2.25 kHz at 1, further with a darker HF decay). Non-finite values are ignored.
 
void setTankLeveling (T amount) noexcept
 Leveling of the tank, 0 to 1 (0, the default, is off): a compressor on the tank's input (ratio 1 + 3 x amount over -30 dBFS with a 24 dB knee), its gain compensated at -18 dBFS: quiet passages feed the tail as much as loud ones. It reads the peak of each sample (as the power of a sine with that peak); its reduction deepens at once, holds 30 ms and comes back with a time constant of half a second, so it neither moves within a cycle of a low note nor lets the start of a hit through. Non-finite values are ignored.
 
void setTankSaturation (bool on) noexcept
 Soft saturation after the leveling compressor (off by default).
 
void setTempo (T bpm) noexcept
 Tempo for the note values, 20 to 400 BPM (default 120).
 
void setPreDelayNote (NoteValue note, NoteFeel feel=NoteFeel::Straight) noexcept
 Pre-delay as a note value at the tempo (Off, the default, uses setPreDelay()); up to 500 ms.
 
void setGateHoldNote (NoteValue note, NoteFeel feel=NoteFeel::Straight) noexcept
 Gate hold as a note value at the tempo (Off, the default, uses setGateHold()); up to 4 s.
 
void setInputWidth (T width) noexcept
 Width of the input, 0 to 1 (1, the default, is the input as it is): the side of the input is scaled before the tank, so a wide source excites the room from nearer the centre.
 
void setWidthLaw (WidthLaw law) noexcept
 How setWidth() acts on the tail: Side (the default) scales the side; PowerKept also raises the middle as the side falls (sqrt(2 - width^2)), so the tail's power stays the same from 0 to 1.41.
 
void setPostEqBand (int index, const typename KeyEqualizer< T, 2 >::Band &band) noexcept
 One band of the wet signal's equalizer (KeyEqualizer bands).
 
void setPostEqLoudness (bool on) noexcept
 Keeps the loudness of the wet signal through its equalizer (off by default; see KeyEqualizer::setLoudnessCompensation()). State key postloudness.
 
bool getPostEqLoudness () const noexcept
 
KeyEqualizer< T, 2 >::Band getPostEqBand (int index) const noexcept
 
void setModulationStyle (ModulationStyle style) noexcept
 How the line lengths wander: Smooth (the default) is the smooth random modulation of every line; Segments moves every other line in segments that alternate sides, toward random positions at random speeds (each segment 0.5 to 1.5 cycles of the line's rate), rounded by a critically damped follower so the pitch has no corners, with the depth held under 2 % of the line's length.
 
void setSpaceLayout (SpaceLayout layout) noexcept
 How the line lengths are laid out: Prime (the default) takes the tuned base lengths; Geometric spaces them evenly in log over the same range (about 6.6 per octave, the lines of the two sides interleaved half a step apart), then to the nearest prime. The read heads cross-fade to the new layout as on a change of size.
 
void setPlateTank (bool on) noexcept
 The plate's own tank (off by default; Type::Plate only): the figure-eight of Dattorro's plate instead of the delay network. Two branches feed each other, each an all-pass that the modulation moves, a delay, the damping and the decay, a second all-pass and a delay; each side of the output is read at seven points inside the other branch and its own. Decay, high decay and its crossover, modulation and its rate follow the controls; a plate has one size, so Size does not change it, and Bass Decay does not reach it. The wet level is that of the network within 0.25 dB; the decay is the one asked within 5 % from 2 s up (a branch takes a third of a second, so at 1.5 s it is 12 % short).
 
bool isPlateTank () const noexcept
 
void setDoubleSlope (T amount) noexcept
 A second slope, 0 to 1 (0, the default, is off): beside the tank, four lines of its own decay in 0.3 of its times, so the first decibels of the tail fall faster than the rest, as in a hall coupled to a smaller space. At 1 the early decay time falls to 0.87 (Hall) to 0.90 (Room) of what it was, the T30 moves under 3 % and the energy of the tail under 0.2 dB. Not for Spring. Non-finite values are ignored.
 
T getDoubleSlope () const noexcept
 
void setBandLimit (T hz) noexcept
 Limits the band of the wet signal, as early digital reverbs did: an elliptic wall (order 12, 0.05 dB of ripple, 100 dB down a fifth of an octave above the corner) on the output, outside the tank, so the decay does not change. 0, the default, is off; otherwise 1 kHz up to 0.4 of the rate. A move fades over 20 ms (one during a fade waits for it). Non-finite values are ignored.
 
T getBandLimit () const noexcept
 
void setShimmer (T amount) noexcept
 Octave-up shimmer, 0 to 1 (0, the default, is off): the tail is pitched up an octave by two read heads with windows of random length (30 to 60 ms) and a raised-cosine crossfade, and fed back into the tank. Non-finite values are ignored.
 
T getDryDip () const noexcept
 
T getGate () const noexcept
 
T getGateHold () const noexcept
 
T getGateRelease () const noexcept
 
T getSourceDepth () const noexcept
 
T getTankLeveling () const noexcept
 
bool isThicknessSaturated () const noexcept
 
T getTempo () const noexcept
 
NoteValue getPreDelayNote () const noexcept
 
NoteValue getGateHoldNote () const noexcept
 
T getInputWidth () const noexcept
 
WidthLaw getWidthLaw () const noexcept
 
ModulationStyle getModulationStyle () const noexcept
 
SpaceLayout getSpaceLayout () const noexcept
 
T getShimmer () const noexcept
 
T getEffectivePreDelay () const noexcept
 
Type getType () const noexcept
 
Quality getQuality () const noexcept
 
T getDecay () const noexcept
 
T getMix () const noexcept
 
T getSize () const noexcept
 
T getDamping () const noexcept
 
T getDiffusion () const noexcept
 
T getModulation () const noexcept
 
T getModRate () const noexcept
 
T getPreDelay () const noexcept
 
T getErToLateDelay () const noexcept
 
T getHighDecayMultiplier () const noexcept
 
T getBassDecayMultiplier () const noexcept
 
T getWidth () const noexcept
 
T getHighCrossover () const noexcept
 
T getEarlyLevel () const noexcept
 Early reflections level in dB (as set, or the preset's).
 
T getLateLevel () const noexcept
 Late tail level in dB (as set, or the preset's).
 
T getBassCrossover () const noexcept
 
std::vector< uint8_t > getState () const
 Serializes the parameter state (setup/UI threads; allocates).
 
bool setState (const uint8_t *data, size_t size)
 Restores parameters from a blob (tolerant; rejects foreign ids).
 

Static Public Attributes

static constexpr int kDecayBands = 6
 Bands of the decay equalizer.
 
static constexpr int kPostBands = KeyEqualizer<T, 2>::kBands
 Bands of the wet equalizer.
 

Protected Types

enum  : uint32_t {
  kUserDecay = 1u , kUserSize = 2u , kUserDamping = 4u , kUserDiffusion = 8u ,
  kUserBassDecay = 16u , kUserHighXover = 32u , kUserBassXover = 64u , kUserModDepth = 128u ,
  kUserModRate = 256u , kUserEarly = 512u , kUserLate = 1024u , kUserErToLate = 2048u
}
 
using AirTaps = std::array< std::array< T, kMaxLines >, kAirTaps >
 

Protected Member Functions

int msToSamples (T ms) const noexcept
 
void markUserParam (uint32_t bit) noexcept
 
void drainPendingChanges () noexcept
 Drains deferred parameter changes on the audio thread.
 
void snapGlides () noexcept
 Puts every gliding parameter (levels, width, diffusion, tone) at its target.
 
void drainTone () noexcept
 
void advanceTone (T amount, T &hp0, T &lp0) noexcept
 
void snapTone () noexcept
 Puts the tone filters at their targets at once (prepare, reset).
 
void refreshCachedParams () noexcept
 Pulls the atomic parameters into the block-local cache (audio thread).
 
void controlTick () noexcept
 Control-rate update: glides the line lengths toward their targets, draws the next modulation values and sets the per-sample read-position ramps for the next kCtrl samples.
 
void beginSizeFade () noexcept
 Opens the second read head of every line at the new lengths (with the wander the first one carries) and of every in-loop allpass at its new length; the two heads then cross-fade at constant power over kSizeFadeSeconds (far apart, what they read is uncorrelated).
 
void endSizeFade () noexcept
 The fade is over: the second heads become the first.
 
template<int N>
void runFdn (T &lateL, T &lateR, int injLag, T loopAPCoeff, T inGain, T extra) noexcept
 One sample of the N-line FDN (compile-time N so the per-line stages vectorize): allpass-interpolated modulated reads, the L/R output sums, Hadamard mix plus rotation, absorption shelves, in-loop allpass, safety limiter, injection, write.
 
void designPlate (double decay, double t60H, double crossoverHz) noexcept
 The plate tank's decay and damping. A branch takes its gain once a pass, from its own length; the damping is a one-pole low-pass whose loss at the high crossover makes the high decay asked for. Its tail sets the wet level as the network's does.
 
void runPlate (T &lateL, T &lateR, int injLag, T inGain, T extra) noexcept
 One sample of the plate tank: the late pair, from the diffused feed.
 
void designSecondSlope (double decay, double t60H, double Kh) noexcept
 The second slope's absorption and shares. Fed and summed as the tank is (unit energy in, every line out), a network's tail holds 1 / (e^(13.8 x its mean loop / T60) - 1) of energy; the share asked for sets its gain from the two, and the tank keeps the rest, so the sum has the tail's energy.
 
void runSecondSlope (T &lateL, T &lateR, int injLag) noexcept
 One sample of the second slope, added to the late pair.
 
void advanceSizeFade () noexcept
 One sample of a size fade; at its end the second heads become the first.
 
template<int N, int W, typename O >
void applyDecayBands (T *r) noexcept
 The decay bands in the loop, one TDF-II biquad per line and band (the per-line arithmetic runs across the lines in SIMD).
 
template<int Springs, int Stages>
void runSprings (T &lateL, T &lateR, const T(&raw)[2]) noexcept
 One sample of the spring tanks (Type::Spring): six springs per side (one in Eco), all of different lengths.
 
void refreshTopology () noexcept
 Line count of the active engine: the springs, or the FDN size.
 
void processChunk (const T *inL, const T *inR, T *outL, T *outR, int count) noexcept
 Core processing of up to kChunk samples: stereo in, wet stereo out.
 
T shimmerStep (T input) noexcept
 One sample of the octave-up shimmer: two read heads, half a window apart, sweep the recent input at twice its speed, each under a raised-cosine window; a head draws its next window length (30 to 60 ms) as it wraps.
 
double drawShimmerLength () noexcept
 
void applyHoldCoeffs () noexcept
 The absorption and decay bands in use: the designed ones moved toward unity by the tail hold.
 
void setAirTaps (std::size_t l) noexcept
 
void applyHoldShelves () noexcept
 The shelves and decay bands of applyHoldCoeffs().
 
void holdAbsorption () noexcept
 The loop gains as they stand, kept for the ramp of a chunk.
 
void rampAbsorption (T perSample) noexcept
 
void stepAbsorption () noexcept
 One sample of the loop gains' ramp.
 
std::pair< T, T > outputStage (T lateL, T lateR, T earlyL, T earlyR, T earlyLevel, T lateLevel, T width, T toneHPMix, T toneLPMix, T outAPCoeff) noexcept
 
void updateAll () noexcept
 
T sizeFactor () const noexcept
 Size factor: size 0 -> 0.35, size 1 -> 1.
 
void updateDelayLengths () noexcept
 
void updateDiffCoeffs () noexcept
 
void updateModulation () noexcept
 
void updateDecayParams () noexcept
 Per-line absorption: Jot mid/high shelf and bass shelf.
 
void snapAbsorption () noexcept
 The absorption at its design at once (no glide).
 
void glideAbsorption (T gc) noexcept
 
void refreshAirInUse () noexcept
 
double heardTailEnergy (double decay, double t60H, double t60B, double Kh, double Kb) const noexcept
 The energy of the tail for a unit of energy injected, as heard. At each frequency the first pass leaves each line attenuated by that line's own loop gain (the short lines first and louder), and what follows is the geometric series of the mean round trip: mean(g^2) / (1 - exp(-x)), x = 2 ln(1000) (mean round trip) / T60, which tends to T60 / (2 ln(1000) round trip) for a long decay. A spring is its own loop and its first pass is heard unattenuated: 1 + 1 / (exp(x) - 1). The loop gains are those just designed (the absorption, the bass shelf and the decay bands); the frequencies weigh as programme is heard (pink, through the loudness weighting: the low end out under about 40 Hz and 4 dB more over 2 kHz).
 
double earlyEnergy () const noexcept
 The energy of the early field in the tail's units: the tail's own energy flow over the early window (see generateERTaps()).
 
void designDecayBands (double decay, double t60H, double t60B, double Kh, double Kb) noexcept
 Designs the decay bands per line (audio thread at the drain, or prepare()): each band's gain from the line's own loop gain there, and the boosts scaled down together where they would lift the loop over kMaxDecayLoopGain.
 
double effectivePreDelayMs () const noexcept
 The pre-delay in ms: the note value's time at the tempo, or the one set.
 
void refreshPreDelay () noexcept
 
void refreshGateHold () noexcept
 
double noteMs (int note, int feel) const noexcept
 A note value's time at the tempo, in ms.
 
double calibratedMidDecay () const noexcept
 The loop's DC decay that puts the ISO 3382 mid-frequency reverberation time on the decay setting.
 
void generateERTapsForType (Type type) noexcept
 Regenerates the early-reflection taps for a reverb type (Eco caps the count).
 
void generateERTaps (double minMs, double maxMs, int numTaps) noexcept
 Velvet-noise early field (Valimaki et al.): numTaps sparse +-1 impulses per side between minMs and maxMs, one per slot at a random position, denser as time goes on (density ~ t^0.6, like the rising echo density of a room). The first four are positive discrete reflections. Each tap reads its own side (probability falling from 0.85 to 0.5 over the window, so the field starts lateralised and turns diffuse) or the other. Amplitudes follow a decaying envelope normalised by the local density, so the energy flows smoothly into the late field; later tap groups pass darker absorption low-passes. The taps read the pre-diffused signal, so each reflection is itself a short dense burst.
 
void commitPreset (const PresetValues &p) noexcept
 
void applyTopology (Type type) noexcept
 
void applyPreset (Type type) noexcept
 

Static Protected Member Functions

static T allpassCoeff (double d) noexcept
 
static double springBaseMs (int s) noexcept
 
static constexpr T lfoRateFactor (int i) noexcept
 
static constexpr uint32_t lfoSeed (int i) noexcept
 
static constexpr T rotRate () noexcept
 
static constexpr T rotRateFactor (int i) noexcept
 
static constexpr uint32_t rotSeed (int i) noexcept
 
static double hash01 (int k, int s) noexcept
 Deterministic hash in [0, 1) for the early-reflection layout.
 
static T levelDb (T gain) noexcept
 Linear gain to dB (a zero gain, a preset's muted early field, reads -120 dB).
 
static constexpr AirTaps identityAirTaps () noexcept
 
static T glideTo (T cur, T target, T amount) noexcept
 
static void glideHz (double &cur, double target, double amount) noexcept
 One glide step of a running cutoff toward its target (log domain).
 
template<int M>
static void hadamardSmall (T *x) noexcept
 
template<int N, int W, typename O >
static void fwht (T *x) noexcept
 
static void addTap (T *acc, const Line &l, int lag0, T gain, int count) noexcept
 
static void writeSpan (Line &l, const T *src, int count) noexcept
 Pushes count samples into a line, in pieces that stop at its end.
 
static void diffuseSpans (Line &ap, int len, T g0, T gDelta, const T *ramp, T *x, int count) noexcept
 One Schroeder allpass stage over a chunk: w = x + g d, out = d - g w, with g = g0 + gDelta ramp[n] at sample n of the chunk.
 
static double airAttenuationDbPerMetre (double hz) noexcept
 The air's attenuation in dB per metre at 20 degrees C, 50 % relative humidity and one atmosphere (ISO 9613-1: the classical and rotational loss and the oxygen and nitrogen relaxations).
 
static double airDepth (double amount, double loopSeconds, double sr) noexcept
 The b of a line: its loss in decibels, 8.686 b (1 - cos w), at kAirFitHz is the air's over a round trip of loopSeconds, amount times the standard's.
 
static double shelfGain (double a, double b, double w) noexcept
 
static constexpr std::array< double, 2 > earlyWindow (Type type) noexcept
 The early reflections' window of a type, in ms (none: both zero).
 
static double biquadGain (const BiquadCoeffs &q, double w) noexcept
 
static const std::vector< uint8_t > & getPrimeSieve () noexcept
 
static int nearestPrime (int n) noexcept
 Smallest prime >= n (lengths only grow by a few samples).
 
static PresetValues presetValues (Type type) noexcept
 The parameter values of each preset.
 

Protected Attributes

Wall wall_
 
std::atomic< T > bandLimit_ { T(0) }
 
PlateTank plate_
 
std::atomic< bool > plateTank_ { false }
 
SecondSlope slope2_
 
std::atomic< T > doubleSlope_ { T(0) }
 
AudioSpec spec_ {}
 
bool prepared_ = false
 
bool eco_ = false
 
int nLines_ = kMaxLines
 
int ctrlPhase_ = 0
 
std::array< Line, 2 > preDelay_
 
std::array< std::array< Line, kInStages >, 2 > inAP_
 
std::array< std::array< int, kInStages >, 2 > inAPLen_ {}
 
std::array< T, kInStages > inAPCoeff_ {}
 
std::array< T, kInStages > inAPCoeffTarget_ {}
 inAPCoeff_ glides here (setDiffusion)
 
std::array< Line, 2 > ring_
 allpass-diffused input, feeds the late field
 
std::array< std::array< Line, kOutStages >, 2 > outAP_
 late-field output diffusers
 
std::array< std::array< int, kOutStages >, 2 > outAPLen_ {}
 
T outAPCoeff_ = T(0.5)
 
T outAPCoeffTarget_ = T(0.5)
 
int numERTaps_ = 0
 reflections per output side
 
int numERSlots_ = 0
 tap slots per output side (see kMaxERSlots)
 
Type erType_ = Type::Room
 
std::array< std::array< int, kMaxERSlots >, 2 > erTap_ {}
 
std::array< std::array< int, kMaxERSlots >, 2 > erChan_ {}
 
std::array< std::array< int, kMaxERSlots >, 2 > erBin_ {}
 
std::array< std::array< T, kMaxERSlots >, 2 > erGain_ {}
 current (gliding) tap gains
 
std::array< std::array< T, kMaxERSlots >, 2 > erGainTarget_ {}
 gains for the current size/decay
 
std::array< T, kERGroups > erShelfGainTarget_ {}
 
T erGlidePerSample_ = T(0.001)
 glide rate of the two (1 / samples)
 
std::array< std::array< int, kERGroups+1 >, 2 > erGroupStart_ {}
 slot index per side
 
std::array< T, kERGroups > erShelfGain_ {}
 HF gain of each absorption group.
 
T erShelfCoeff_ = T(0.5)
 one-pole coefficient at the high crossover
 
std::array< std::array< T, kERGroups >, 2 > erLP_ {}
 
std::array< std::array< T, kERGroups >, 2 > erShadowLP_ {}
 
double meanLoopSec_ = 0.1
 mean FDN round trip (s), for the early/late energy match
 
T wetLevel_ = T(1)
 the wet signal's level against the decay (see updateDecayParams())
 
T shadowCoeff_ = T(0)
 
DelayBank lines_
 
std::array< int, kMaxLines > lenTarget_ {}
 prime line lengths (samples)
 
std::array< T, kMaxLines > lenCur_ {}
 gliding length
 
std::array< double, kMaxLines > pos_ {}
 current read position
 
std::array< double, kMaxLines > posInc_ {}
 per-sample ramp
 
std::array< double, kMaxLines > pos2_ {}
 
std::array< double, kMaxLines > posInc2_ {}
 
std::array< T, kMaxLines > apY2_ {}
 
std::array< T, kMaxLines > lenNew_ {}
 
std::array< int, kMaxLines > loopAPFrom_ {}
 
std::array< int, kMaxLines > loopAPTo_ {}
 
double fadeAt_ = 0.0
 
double fadeStep_ = 0.0
 the fade, 0 to 1, and its step per sample
 
bool sizeFade_ = false
 
std::array< T, kMaxLines > apY1_ {}
 allpass interpolator state
 
std::array< int, kMaxLines > injTap_ {}
 
std::array< T, kMaxLines > injGain_ {}
 sign / sqrt(lines)
 
std::array< T, kMaxLines > outSignL_ {}
 
std::array< T, kMaxLines > outSignR_ {}
 
std::array< SmoothRandomLFO, kMaxLines > lfo_
 
std::array< SmoothRandomLFO, kMaxLines/2 > rotLfo_
 
std::array< T, kMaxLines/2 > rotC_ {}
 
std::array< T, kMaxLines/2 > rotS_ {}
 
T rotDepth_ = T(0)
 
unsigned rotTick_ = 0
 
T modDepthSamples_ = T(0)
 
T glideCoeff_ = T(0)
 
T maxGlideStep_ = T(0)
 
T maxReadPos_ = T(8)
 
bool spring_ = false
 
std::vector< T > springHist_
 
int springP_ = 8
 
int springW_ = 0
 
int springK_ = 5
 
int springStages_ = kSpringStages
 
T springA_ = T(0.5)
 
std::array< std::array< T, 5 >, 2 > springLP_ {}
 b0 b1 b2 a1 a2, two sections
 
std::array< std::array< T, kSprings >, 4 > springLPState_ {}
 [section * 2 + state][spring]
 
DelayBank loopAP_
 
std::array< int, kMaxLines > loopAPLen_ {}
 in-loop allpass target lengths
 
std::array< T, kMaxLines > loopAPCur_ {}
 gliding lengths after a size change
 
bool loopAPGliding_ = false
 
T loopAPCoeff_ = T(0.4)
 
T loopAPCoeffTarget_ = T(0.4)
 
std::array< T, kMaxLines > jotB0_ {}
 
std::array< T, kMaxLines > jotB1_ {}
 
std::array< T, kMaxLines > jotA1_ {}
 
std::array< T, kMaxLines > jotX1_ {}
 
std::array< T, kMaxLines > jotY1_ {}
 
std::array< T, kMaxLines > bassB0_ {}
 
std::array< T, kMaxLines > bassB1_ {}
 
std::array< T, kMaxLines > bassA1_ {}
 
std::array< T, kMaxLines > bassX1_ {}
 
std::array< T, kMaxLines > bassY1_ {}
 
AirTaps airTap_ = identityAirTaps()
 
AirTaps airTapFrom_ {}
 
AirTaps airTapStep_ {}
 
AirTaps airHist_ {}
 
int airW_ = 0
 
int airTapCount_ = 1
 taps that carry more than 1e-7 of the largest b's sum
 
bool airInUse_ = false
 any line's b, designed, gliding or in use, above 0
 
std::array< T, kMaxLines > airGoal_ {}
 
std::array< T, kMaxLines > airBase_ {}
 
std::array< T, kMaxLines > airNow_ {}
 
Biquad< T, 1 > coherenceFilter_
 
Biquad< T, 2 > subsonicFilter_
 
Biquad< T, 2 > toneLPBiquad_
 
Biquad< T, 2 > toneHPBiquad_
 
bool toneLPActive_ = false
 filter running (on, or still fading out)
 
bool toneHPActive_ = false
 
double toneLPCurHz_ = 0.0
 
double toneLPTargetHz_ = 0.0
 
double toneHPCurHz_ = 0.0
 
double toneHPTargetHz_ = 0.0
 
bool toneLPOn_ = false
 
bool toneHPOn_ = false
 
T toneLPMix_ = T(0)
 
T toneHPMix_ = T(0)
 share of the filtered signal
 
T earlyCur_ = T(1)
 
T lateCur_ = T(1)
 
T widthCur_ = T(1)
 
bool fresh_ = true
 no sample processed since prepare()/reset()
 
DryWetMixer< T > mixer_
 
std::atomic< Type > type_ { Type::Room }
 
std::atomic< T > decayTime_ { T(1) }
 
std::atomic< T > size_ { T(0.5) }
 
std::atomic< T > damping_ { T(0.5) }
 
std::atomic< T > diffusion_ { T(0.7) }
 
std::atomic< T > modDepth_ { T(0.1) }
 
std::atomic< T > modRate_ { T(1) }
 
std::atomic< T > preDelayMs_ { T(0) }
 
std::atomic< T > erToLateMs_ { T(0) }
 
std::atomic< T > mix_ { T(0.3) }
 
std::atomic< T > earlyLevel_ { T(1) }
 
std::atomic< T > lateLevel_ { T(1) }
 
std::atomic< T > width_ { T(1) }
 
std::atomic< T > highDecayMult_ { T(0.5) }
 
std::atomic< T > bassDecayMult_ { T(1.2) }
 
std::atomic< T > highCrossover_ { T(5000) }
 
std::atomic< T > airAbsorption_ { T(0) }
 
std::atomic< T > bassCrossover_ { T(200) }
 
std::atomic< Quality > quality_ { Quality::Full }
 
std::atomic< int > preDelaySamples_ { 0 }
 
std::atomic< int > erToLateSamples_ { 0 }
 
std::atomic< bool > presetDirty_ { false }
 
std::atomic< bool > paramsDirty_ { false }
 
std::atomic< bool > qualityDirty_ { false }
 
std::atomic< bool > toneDirty_ { false }
 
std::atomic< T > toneLowCutHz_ { T(-1) }
 
std::atomic< T > toneHighCutHz_ { T(-1) }
 
std::atomic< uint32_t > userParamMask_ { 0u }
 
CachedParams cachedParams_ {}
 
std::array< PublishedDecayBand, kDecayBands > decayBands_
 
std::atomic< bool > tailHold_ { false }
 
std::atomic< bool > tankSat_ { false }
 
std::atomic< T > sourceDepth_ { T(0) }
 
std::atomic< T > tankLeveling_ { T(0) }
 
std::atomic< T > tempo_ { T(120) }
 
std::atomic< T > inputWidth_ { T(1) }
 
std::atomic< T > shimmer_ { T(0) }
 
std::atomic< T > gateHoldMs_ { T(100) }
 
std::atomic< int > preNote_ { 0 }
 
std::atomic< int > preFeel_ { 0 }
 
std::atomic< int > gateNote_ { 0 }
 
std::atomic< int > gateFeel_ { 0 }
 
std::atomic< int > widthLaw_ { 0 }
 
std::atomic< int > modStyle_ { 0 }
 
std::atomic< int > layout_ { 0 }
 
TailShaper< T > tail_
 
KeyEqualizer< T, 2 > postEq_
 
std::array< std::array< T, kMaxLines >, 3 > jotBase_ {}
 
std::array< std::array< T, kMaxLines >, 3 > bassBase_ {}
 
std::array< std::array< std::array< T, kMaxLines >, kDecayBands >, 5 > dqBase_ {}
 
std::array< std::array< T, kMaxLines >, 3 > jotGoal_ {}
 
std::array< std::array< T, kMaxLines >, 3 > bassGoal_ {}
 
std::array< std::array< std::array< T, kMaxLines >, kDecayBands >, 5 > dqGoal_ {}
 
bool absorbGlide_ = false
 
std::array< std::array< T, kMaxLines >, 6 > absFrom_ {}
 The loop gains' ramp across a chunk: where they stood and their step per sample.
 
std::array< std::array< T, kMaxLines >, 6 > absStep_ {}
 
std::array< std::array< std::array< T, kMaxLines >, kDecayBands >, 5 > dqFrom_ {}
 
std::array< std::array< std::array< T, kMaxLines >, kDecayBands >, 5 > dqStep_ {}
 
double quietSamples_ = 1e300
 samples since input last entered the tank
 
double tankEmptyAfter_ = 0.0
 quiet samples after which the tank is under -120 dB
 
std::array< std::array< T, kMaxLines >, kDecayBands > dqB0_ {}
 
std::array< std::array< T, kMaxLines >, kDecayBands > dqB1_ {}
 
std::array< std::array< T, kMaxLines >, kDecayBands > dqB2_ {}
 
std::array< std::array< T, kMaxLines >, kDecayBands > dqA1_ {}
 
std::array< std::array< T, kMaxLines >, kDecayBands > dqA2_ {}
 
std::array< std::array< T, kMaxLines >, kDecayBands > dqZ1_ {}
 
std::array< std::array< T, kMaxLines >, kDecayBands > dqZ2_ {}
 
std::array< int, kDecayBands > dqList_ {}
 
int dqCount_ = 0
 
T holdNow_ = T(0)
 
double levelGr_ = 0.0
 
double levelRelease_ = 0.0
 Tank leveling: the reduction (dB) and its release.
 
int levelHold_ = 0
 
int levelHoldSamples_ = 0
 Tank leveling: hold left and its length.
 
std::array< T, 2 > distLp_ {}
 
T distCoeff_ = T(1)
 
T distMix_ = T(0)
 
std::array< SegmentLfo, kMaxLines > seg_ {}
 
std::vector< T > shimBuf_
 
int shimMask_ = 0
 
int shimW_ = 0
 
std::array< double, 2 > shimPhase_ { 0.0, 0.5 }
 
std::array< double, 2 > shimLen_ { 0.045, 0.045 }
 
uint32_t shimRng_ = 0x51ED27u
 
T lastLateMono_ = T(0)
 

Static Protected Attributes

static constexpr int kMaxLines = 32
 
static constexpr int kEcoLines = 16
 
static constexpr int kInStages = 4
 input diffusers per channel feeding the late field (Full)
 
static constexpr int kMaxERTaps = 128
 early taps per output side: 64 reflections per input (Full)
 
static constexpr int kEcoERTaps = 48
 
static constexpr int kShadowBins = 2
 head-shadow classes of the early taps (open, shadowed)
 
static constexpr int kMaxDiscreteER = 7
 
static constexpr int kMaxERSlots = kMaxERTaps + 2 * kMaxDiscreteER
 
static constexpr int kERGroups = 4
 absorption groups (early -> late)
 
static constexpr int kCtrl = 16
 modulation control period (samples)
 
static constexpr int kChunk = 64
 sparse-FIR processing chunk (samples)
 
static constexpr double kMaxPreDelayMs = 500.0
 
static constexpr double kShimmerMinMs = 30.0
 Shortest window of the shimmer's heads.
 
static constexpr double kShimmerMaxMs = 60.0
 Longest window of the shimmer's heads.
 
static constexpr T kShimmerFeed = T(0.08)
 Share of the shimmer fed back at full amount.
 
static constexpr double kMaxDecayLoopGain = 0.9995
 Highest loop gain the decay bands may reach.
 
static constexpr double kMaxErToLateMs = 200.0
 
static constexpr double kMaxErMs = 170.0
 
static constexpr double kMaxInjectMs = 8.0
 
static constexpr double kMaxInDiffMs = 2.0
 
static constexpr double kMaxLoopApMs = 5.5
 
static constexpr double kCoherenceHz = 355.0
 side high-pass of the late field (2nd order, Q 0.74)
 
static constexpr double kCoherenceQ = 0.74
 
static constexpr double kShadowHz = 1000.0
 head-shadow corner of the early taps
 
static constexpr double kShadowHF = 0.5
 high-frequency gain of a shadowed (far-ear) tap
 
static constexpr double kModMaxMs = 2.0
 
static constexpr double kRotMaxRad = 10.0
 peak rotation angle at modulation 1 (rad)
 
static constexpr double kRotRateHz = 0.35
 
static constexpr int kRotPairStride = 4
 
static constexpr double kGlideMs = 60.0
 size-change glide time constant
 
static constexpr double kMaxGlideSpeed = 0.04
 max length change per sample (4% Doppler)
 
static constexpr double kSizeFadeOver = 0.002
 a length change beyond this share cross-fades two read heads
 
static constexpr double kSizeFadeSeconds = 0.25
 the cross-fade of the two read heads
 
static constexpr double kSubsonicHz = 20.0
 wet-output high-pass (2nd order): no room rings below it
 
static constexpr T kMinReadPos = T(2)
 
static constexpr double kApLow = 0.1
 
static constexpr T kSoftLimit = T(2)
 in-loop safety limiter threshold
 
static constexpr T kOutGain = T(0.25)
 
static constexpr double kWetCalibration = 4.73
 
static constexpr double kWetCalibrationSpring = 2.85
 
static constexpr double kBaseDelaysMs_ [kMaxLines]
 
static constexpr double kLoopApMs_ [kMaxLines]
 
static constexpr double kInDiffMs_ [2][kInStages]
 
static constexpr double kInDiffCoeffs_ [kInStages] = { 0.75, 0.72, 0.68, 0.64 }
 
static constexpr int kOutStages = 2
 
static constexpr double kOutDiffMs_ [2][kOutStages]
 
static constexpr double kMeanInjectMs = 4.0
 mean of kInjectMs_
 
static constexpr double kInjectMs_ [kMaxLines]
 
static constexpr int kInjectSign_ [kMaxLines]
 
static constexpr int kOutSignL_ [kMaxLines]
 
static constexpr int kOutSignR_ [kMaxLines]
 
static constexpr int kSprings = 12
 
static constexpr int kEcoSprings = 2
 
static constexpr int kSpringStages = 72
 dispersion allpasses per spring (Full)
 
static constexpr int kEcoSpringStages = 40
 
static constexpr double kSpringJitterMs = 3.0
 
static constexpr double kSpringCutHz = 4400.0
 dispersion band edge (transition frequency)
 
static constexpr T kSpringOutGain = T(2)
 
static constexpr double kPlateEnergy = 0.50
 The plate's tail energy over the tail formula (measured, 1.5 to 8 s: within 0.25 dB).
 
static constexpr std::array< double, SecondSlope::kLines > kSecondMs { 23.3, 29.1, 37.9, 44.7 }
 
static constexpr double kSecondRatio = 0.3
 its decay times, as a share of the tank's
 
static constexpr double kSecondShare = 0.30
 its share of the tail's energy at 1
 
static constexpr int kAirTaps = 16
 
static constexpr double kSoundSpeed = 343.2
 
static constexpr double kAirFitHz = 12000.0
 
static constexpr double kAirMaxDepth = 5.0
 
static constexpr int kPrimeTableMax = 131072
 

Detailed Description

template<FloatType T>
class dspark::AlgorithmicReverb< T >

True-stereo 32-line FDN reverb with exact per-band decay and 6 presets.

Template Parameters
TSample type (float or double).

Definition at line 249 of file AlgorithmicReverb.h.

Member Typedef Documentation

◆ AirTaps

template<FloatType T>
using dspark::AlgorithmicReverb< T >::AirTaps = std::array<std::array<T, kMaxLines>, kAirTaps>
protected

Definition at line 2046 of file AlgorithmicReverb.h.

Member Enumeration Documentation

◆ anonymous enum

template<FloatType T>
anonymous enum : uint32_t
protected
Enumerator
kUserDecay 
kUserSize 
kUserDamping 
kUserDiffusion 
kUserBassDecay 
kUserHighXover 
kUserBassXover 
kUserModDepth 
kUserModRate 
kUserEarly 
kUserLate 
kUserErToLate 

Definition at line 2130 of file AlgorithmicReverb.h.

◆ DecayShape

template<FloatType T>
enum class dspark::AlgorithmicReverb::DecayShape
strong

Shape of a band of the decay equalizer (setDecayBand()).

Enumerator
Off 
Bell 
LowShelf 
HighShelf 

Definition at line 273 of file AlgorithmicReverb.h.

◆ ModulationStyle

template<FloatType T>
enum class dspark::AlgorithmicReverb::ModulationStyle
strong

How the lines' lengths wander (setModulationStyle()).

Enumerator
Smooth 
Segments 

Definition at line 294 of file AlgorithmicReverb.h.

◆ NoteFeel

template<FloatType T>
enum class dspark::AlgorithmicReverb::NoteFeel
strong

The feel of a note value.

Enumerator
Straight 
Dotted 
Triplet 

Definition at line 288 of file AlgorithmicReverb.h.

◆ NoteValue

template<FloatType T>
enum class dspark::AlgorithmicReverb::NoteValue
strong

A note value for the tempo-synced times.

Enumerator
Off 
Whole 
Half 
Quarter 
Eighth 
Sixteenth 
ThirtySecond 

Definition at line 285 of file AlgorithmicReverb.h.

◆ Quality

template<FloatType T>
enum class dspark::AlgorithmicReverb::Quality
strong

Engine quality / CPU cost trade-off (see setQuality()).

Enumerator
Full 

Complete 32-line engine. Default.

Eco 

Reduced 8-line engine, about 3x cheaper. For constrained targets.

Definition at line 266 of file AlgorithmicReverb.h.

◆ SpaceLayout

template<FloatType T>
enum class dspark::AlgorithmicReverb::SpaceLayout
strong

How the line lengths are laid out (setSpaceLayout()).

Enumerator
Prime 
Geometric 

Definition at line 297 of file AlgorithmicReverb.h.

◆ Type

template<FloatType T>
enum class dspark::AlgorithmicReverb::Type
strong

Reverb type presets.

Enumerator
Room 

Small room, short decay, dense close reflections.

Hall 

Concert hall, spacious, long smooth tail.

Chamber 

Recording studio chamber, warm, balanced.

Plate 

Metal plate, dense shimmer, no early reflections.

Spring 

Spring reverb, bouncy vintage character.

Cathedral 

Large cathedral, immense decay, vast space.

Definition at line 253 of file AlgorithmicReverb.h.

◆ WidthLaw

template<FloatType T>
enum class dspark::AlgorithmicReverb::WidthLaw
strong

How the output width acts (setWidthLaw()).

Enumerator
Side 
PowerKept 

Definition at line 291 of file AlgorithmicReverb.h.

Constructor & Destructor Documentation

◆ ~AlgorithmicReverb()

template<FloatType T>
dspark::AlgorithmicReverb< T >::~AlgorithmicReverb ( )
default

Member Function Documentation

◆ addTap()

template<FloatType T>
static void dspark::AlgorithmicReverb< T >::addTap ( T *  acc,
const Line &  l,
int  lag0,
T  gain,
int  count 
)
inlinestaticprotectednoexcept

Sum of gain * line.at(lag0 - n) over n in [0, count): a sparse-FIR tap applied to a whole chunk, reading contiguous ring memory.

Definition at line 3063 of file AlgorithmicReverb.h.

◆ advanceSizeFade()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::advanceSizeFade ( )
inlineprotectednoexcept

One sample of a size fade; at its end the second heads become the first.

Definition at line 2884 of file AlgorithmicReverb.h.

◆ advanceTone()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::advanceTone ( T  amount,
T &  hp0,
T &  lp0 
)
inlineprotectednoexcept

Moves the tone cutoffs and on/off crossfades by one chunk (audio thread); the crossfade values at the chunk's start are returned through hp0/lp0 for the per-sample ramp.

Definition at line 2321 of file AlgorithmicReverb.h.

◆ airAttenuationDbPerMetre()

template<FloatType T>
static double dspark::AlgorithmicReverb< T >::airAttenuationDbPerMetre ( double  hz)
inlinestaticprotectednoexcept

The air's attenuation in dB per metre at 20 degrees C, 50 % relative humidity and one atmosphere (ISO 9613-1: the classical and rotational loss and the oxygen and nitrogen relaxations).

Definition at line 3935 of file AlgorithmicReverb.h.

◆ airDepth()

template<FloatType T>
static double dspark::AlgorithmicReverb< T >::airDepth ( double  amount,
double  loopSeconds,
double  sr 
)
inlinestaticprotectednoexcept

The b of a line: its loss in decibels, 8.686 b (1 - cos w), at kAirFitHz is the air's over a round trip of loopSeconds, amount times the standard's.

Definition at line 3953 of file AlgorithmicReverb.h.

◆ allpassCoeff()

template<FloatType T>
static T dspark::AlgorithmicReverb< T >::allpassCoeff ( double  d)
inlinestaticprotectednoexcept

First-order allpass coefficient for a fractional delay d in [kApLow, kApLow + 1): (eta + z^-1) / (1 + eta z^-1) delays d at DC.

Definition at line 1524 of file AlgorithmicReverb.h.

◆ applyDecayBands()

template<FloatType T>
template<int N, int W, typename O >
void dspark::AlgorithmicReverb< T >::applyDecayBands ( T *  r)
inlineprotectednoexcept

The decay bands in the loop, one TDF-II biquad per line and band (the per-line arithmetic runs across the lines in SIMD).

Definition at line 2895 of file AlgorithmicReverb.h.

◆ applyHoldCoeffs()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::applyHoldCoeffs ( )
inlineprotectednoexcept

The absorption and decay bands in use: the designed ones moved toward unity by the tail hold.

Definition at line 3431 of file AlgorithmicReverb.h.

◆ applyHoldShelves()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::applyHoldShelves ( )
inlineprotectednoexcept

The shelves and decay bands of applyHoldCoeffs().

Definition at line 3471 of file AlgorithmicReverb.h.

◆ applyPreset()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::applyPreset ( Type  type)
inlineprotectednoexcept

Setup-thread preset load: values (keeping the user's overrides), then the engine.

Definition at line 4586 of file AlgorithmicReverb.h.

◆ applyTopology()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::applyTopology ( Type  type)
inlineprotectednoexcept

Engine structure of a preset: spring tanks or FDN, its early field, and the coefficients (audio thread at the drain, or prepare()).

Definition at line 4575 of file AlgorithmicReverb.h.

◆ beginSizeFade()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::beginSizeFade ( )
inlineprotectednoexcept

Opens the second read head of every line at the new lengths (with the wander the first one carries) and of every in-loop allpass at its new length; the two heads then cross-fade at constant power over kSizeFadeSeconds (far apart, what they read is uncorrelated).

Definition at line 2470 of file AlgorithmicReverb.h.

◆ biquadGain()

template<FloatType T>
static double dspark::AlgorithmicReverb< T >::biquadGain ( const BiquadCoeffs &  q,
double  w 
)
inlinestaticprotectednoexcept

|H(e^jw)| of a biquad.

Definition at line 4066 of file AlgorithmicReverb.h.

◆ calibratedMidDecay()

template<FloatType T>
double dspark::AlgorithmicReverb< T >::calibratedMidDecay ( ) const
inlineprotectednoexcept

The loop's DC decay that puts the ISO 3382 mid-frequency reverberation time on the decay setting.

setDecay() promises T_mid, the mean of the 500 Hz and 1 kHz octave T60s (ISO 3382-1, the number a room is quoted by). The absorption shelves are anchored at DC and at Nyquist, and a first-order shelf spans several octaves: the HF shelf already shortens 1 kHz and the bass shelf still lengthens 500 Hz. With the DC anchor at the setting, T_mid measured 11.7% short on Cathedral and 3 to 9% short elsewhere. So the DC anchor is solved for instead: the loop T60 at 500 Hz and 1 kHz is evaluated from the exact shelf responses at the mean loop length, and the DC decay is rescaled until their mean equals the setting (the HF and bass targets stay proportional to it, as the multipliers say). Four fixed-point steps converge to far below a percent.

Definition at line 4218 of file AlgorithmicReverb.h.

◆ commitPreset()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::commitPreset ( const PresetValues &  p)
inlineprotectednoexcept

Writes the preset's values into the parameter atomics, skipping every one whose user bit is set. Control or setup thread only: the audio thread never writes parameter atomics, so nothing it does can override a setter that follows setType().

Definition at line 4519 of file AlgorithmicReverb.h.

◆ controlTick()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::controlTick ( )
inlineprotectednoexcept

Control-rate update: glides the line lengths toward their targets, draws the next modulation values and sets the per-sample read-position ramps for the next kCtrl samples.

Definition at line 2396 of file AlgorithmicReverb.h.

◆ designDecayBands()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::designDecayBands ( double  decay,
double  t60H,
double  t60B,
double  Kh,
double  Kb 
)
inlineprotectednoexcept

Designs the decay bands per line (audio thread at the drain, or prepare()): each band's gain from the line's own loop gain there, and the boosts scaled down together where they would lift the loop over kMaxDecayLoopGain.

Definition at line 4080 of file AlgorithmicReverb.h.

◆ designPlate()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::designPlate ( double  decay,
double  t60H,
double  crossoverHz 
)
inlineprotectednoexcept

The plate tank's decay and damping. A branch takes its gain once a pass, from its own length; the damping is a one-pole low-pass whose loss at the high crossover makes the high decay asked for. Its tail sets the wet level as the network's does.

Definition at line 2736 of file AlgorithmicReverb.h.

◆ designSecondSlope()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::designSecondSlope ( double  decay,
double  t60H,
double  Kh 
)
inlineprotectednoexcept

The second slope's absorption and shares. Fed and summed as the tank is (unit energy in, every line out), a network's tail holds 1 / (e^(13.8 x its mean loop / T60) - 1) of energy; the share asked for sets its gain from the two, and the tank keeps the rest, so the sum has the tail's energy.

Definition at line 2817 of file AlgorithmicReverb.h.

◆ diffuseSpans()

template<FloatType T>
static void dspark::AlgorithmicReverb< T >::diffuseSpans ( Line &  ap,
int  len,
T  g0,
T  gDelta,
const T *  ramp,
T *  x,
int  count 
)
inlinestaticprotectednoexcept

One Schroeder allpass stage over a chunk: w = x + g d, out = d - g w, with g = g0 + gDelta ramp[n] at sample n of the chunk.

The stage runs in pieces that read only samples older than themselves (no longer than its delay), touch neither end of the ring, and read and write apart (no longer than the ring minus the delay), so each piece is plain array arithmetic on the line itself.

Definition at line 3097 of file AlgorithmicReverb.h.

◆ drainPendingChanges()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::drainPendingChanges ( )
inlineprotectednoexcept

Drains deferred parameter changes on the audio thread.

The acquire-ordered exchanges synchronize with the release stores in the setters. Each flag is pre-checked with a plain load so the per-sample path pays no read-modify-write when nothing is pending.

Definition at line 2216 of file AlgorithmicReverb.h.

◆ drainTone()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::drainTone ( )
inlineprotectednoexcept

Definition at line 2274 of file AlgorithmicReverb.h.

◆ drawShimmerLength()

template<FloatType T>
double dspark::AlgorithmicReverb< T >::drawShimmerLength ( )
inlineprotectednoexcept

Definition at line 3421 of file AlgorithmicReverb.h.

◆ earlyEnergy()

template<FloatType T>
double dspark::AlgorithmicReverb< T >::earlyEnergy ( ) const
inlineprotectednoexcept

The energy of the early field in the tail's units: the tail's own energy flow over the early window (see generateERTaps()).

Definition at line 4054 of file AlgorithmicReverb.h.

◆ earlyWindow()

template<FloatType T>
static constexpr std::array< double, 2 > dspark::AlgorithmicReverb< T >::earlyWindow ( Type  type)
inlinestaticconstexprprotectednoexcept

The early reflections' window of a type, in ms (none: both zero).

Definition at line 4036 of file AlgorithmicReverb.h.

◆ effectivePreDelayMs()

template<FloatType T>
double dspark::AlgorithmicReverb< T >::effectivePreDelayMs ( ) const
inlineprotectednoexcept

The pre-delay in ms: the note value's time at the tempo, or the one set.

Definition at line 4172 of file AlgorithmicReverb.h.

◆ endSizeFade()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::endSizeFade ( )
inlineprotectednoexcept

The fade is over: the second heads become the first.

Definition at line 2488 of file AlgorithmicReverb.h.

◆ fwht()

template<FloatType T>
template<int N, int W, typename O >
static void dspark::AlgorithmicReverb< T >::fwht ( T *  x)
inlinestaticprotectednoexcept

In-place unnormalised fast Walsh-Hadamard transform of N values (in-vector strides unrolled scalar, the rest in SIMD).

Definition at line 2527 of file AlgorithmicReverb.h.

◆ generateERTaps()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::generateERTaps ( double  minMs,
double  maxMs,
int  numTaps 
)
inlineprotectednoexcept

Velvet-noise early field (Valimaki et al.): numTaps sparse +-1 impulses per side between minMs and maxMs, one per slot at a random position, denser as time goes on (density ~ t^0.6, like the rising echo density of a room). The first four are positive discrete reflections. Each tap reads its own side (probability falling from 0.85 to 0.5 over the window, so the field starts lateralised and turns diffuse) or the other. Amplitudes follow a decaying envelope normalised by the local density, so the energy flows smoothly into the late field; later tap groups pass darker absorption low-passes. The taps read the pre-diffused signal, so each reflection is itself a short dense burst.

Definition at line 4311 of file AlgorithmicReverb.h.

◆ generateERTapsForType()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::generateERTapsForType ( Type  type)
inlineprotectednoexcept

Regenerates the early-reflection taps for a reverb type (Eco caps the count).

Definition at line 4279 of file AlgorithmicReverb.h.

◆ getAirAbsorption()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getAirAbsorption ( ) const
inlinenoexcept
Returns
The absorption of the air (0 off, 1 the standard's).

Definition at line 942 of file AlgorithmicReverb.h.

◆ getBandLimit()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getBandLimit ( ) const
inlinenoexcept
Returns
The corner of the band limit in hertz (0 when off).

Definition at line 1284 of file AlgorithmicReverb.h.

◆ getBassCrossover()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getBassCrossover ( ) const
inlinenoexcept

Definition at line 1339 of file AlgorithmicReverb.h.

◆ getBassDecayMultiplier()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getBassDecayMultiplier ( ) const
inlinenoexcept

Definition at line 1332 of file AlgorithmicReverb.h.

◆ getDamping()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getDamping ( ) const
inlinenoexcept

Definition at line 1325 of file AlgorithmicReverb.h.

◆ getDecay()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getDecay ( ) const
inlinenoexcept

Definition at line 1322 of file AlgorithmicReverb.h.

◆ getDecayBand()

template<FloatType T>
DecayBand dspark::AlgorithmicReverb< T >::getDecayBand ( int  index) const
inlinenoexcept
Returns
The settings of a band of the decay equalizer (an Off band out of range).

Definition at line 1055 of file AlgorithmicReverb.h.

◆ getDiffusion()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getDiffusion ( ) const
inlinenoexcept

Definition at line 1326 of file AlgorithmicReverb.h.

◆ getDoubleSlope()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getDoubleSlope ( ) const
inlinenoexcept
Returns
The second slope, 0 to 1.

Definition at line 1268 of file AlgorithmicReverb.h.

◆ getDryDip()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getDryDip ( ) const
inlinenoexcept

Definition at line 1297 of file AlgorithmicReverb.h.

◆ getEarlyLevel()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getEarlyLevel ( ) const
inlinenoexcept

Early reflections level in dB (as set, or the preset's).

Definition at line 1336 of file AlgorithmicReverb.h.

◆ getEffectivePreDelay()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getEffectivePreDelay ( ) const
inlinenoexcept
Returns
The pre-delay in use, in ms (the note value's time when one is set).

Definition at line 1314 of file AlgorithmicReverb.h.

◆ getErToLateDelay()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getErToLateDelay ( ) const
inlinenoexcept

Definition at line 1330 of file AlgorithmicReverb.h.

◆ getGate()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getGate ( ) const
inlinenoexcept

Definition at line 1298 of file AlgorithmicReverb.h.

◆ getGateHold()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getGateHold ( ) const
inlinenoexcept

Definition at line 1299 of file AlgorithmicReverb.h.

◆ getGateHoldNote()

template<FloatType T>
NoteValue dspark::AlgorithmicReverb< T >::getGateHoldNote ( ) const
inlinenoexcept

Definition at line 1306 of file AlgorithmicReverb.h.

◆ getGateRelease()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getGateRelease ( ) const
inlinenoexcept

Definition at line 1300 of file AlgorithmicReverb.h.

◆ getHighCrossover()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getHighCrossover ( ) const
inlinenoexcept

Definition at line 1334 of file AlgorithmicReverb.h.

◆ getHighDecayMultiplier()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getHighDecayMultiplier ( ) const
inlinenoexcept

Definition at line 1331 of file AlgorithmicReverb.h.

◆ getInputWidth()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getInputWidth ( ) const
inlinenoexcept

Definition at line 1307 of file AlgorithmicReverb.h.

◆ getLateLevel()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getLateLevel ( ) const
inlinenoexcept

Late tail level in dB (as set, or the preset's).

Definition at line 1338 of file AlgorithmicReverb.h.

◆ getMix()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getMix ( ) const
inlinenoexcept

Definition at line 1323 of file AlgorithmicReverb.h.

◆ getModRate()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getModRate ( ) const
inlinenoexcept

Definition at line 1328 of file AlgorithmicReverb.h.

◆ getModulation()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getModulation ( ) const
inlinenoexcept

Definition at line 1327 of file AlgorithmicReverb.h.

◆ getModulationStyle()

template<FloatType T>
ModulationStyle dspark::AlgorithmicReverb< T >::getModulationStyle ( ) const
inlinenoexcept

Definition at line 1309 of file AlgorithmicReverb.h.

◆ getPostEqBand()

template<FloatType T>
KeyEqualizer< T, 2 >::Band dspark::AlgorithmicReverb< T >::getPostEqBand ( int  index) const
inlinenoexcept
Returns
The settings of a band of the wet signal's equalizer.

Definition at line 1201 of file AlgorithmicReverb.h.

◆ getPostEqLoudness()

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::getPostEqLoudness ( ) const
inlinenoexcept
Returns
Whether the wet equalizer keeps the loudness.

Definition at line 1199 of file AlgorithmicReverb.h.

◆ getPreDelay()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getPreDelay ( ) const
inlinenoexcept

Definition at line 1329 of file AlgorithmicReverb.h.

◆ getPreDelayNote()

template<FloatType T>
NoteValue dspark::AlgorithmicReverb< T >::getPreDelayNote ( ) const
inlinenoexcept

Definition at line 1305 of file AlgorithmicReverb.h.

◆ getPrimeSieve()

template<FloatType T>
static const std::vector< uint8_t > & dspark::AlgorithmicReverb< T >::getPrimeSieve ( )
inlinestaticprotectednoexcept

Definition at line 4470 of file AlgorithmicReverb.h.

◆ getQuality()

template<FloatType T>
Quality dspark::AlgorithmicReverb< T >::getQuality ( ) const
inlinenoexcept

Definition at line 1321 of file AlgorithmicReverb.h.

◆ getShimmer()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getShimmer ( ) const
inlinenoexcept

Definition at line 1311 of file AlgorithmicReverb.h.

◆ getSize()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getSize ( ) const
inlinenoexcept

Definition at line 1324 of file AlgorithmicReverb.h.

◆ getSourceDepth()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getSourceDepth ( ) const
inlinenoexcept

Definition at line 1301 of file AlgorithmicReverb.h.

◆ getSpaceLayout()

template<FloatType T>
SpaceLayout dspark::AlgorithmicReverb< T >::getSpaceLayout ( ) const
inlinenoexcept

Definition at line 1310 of file AlgorithmicReverb.h.

◆ getState()

template<FloatType T>
std::vector< uint8_t > dspark::AlgorithmicReverb< T >::getState ( ) const
inline

Serializes the parameter state (setup/UI threads; allocates).

Definition at line 1342 of file AlgorithmicReverb.h.

◆ getTankLeveling()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getTankLeveling ( ) const
inlinenoexcept

Definition at line 1302 of file AlgorithmicReverb.h.

◆ getTempo()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getTempo ( ) const
inlinenoexcept

Definition at line 1304 of file AlgorithmicReverb.h.

◆ getType()

template<FloatType T>
Type dspark::AlgorithmicReverb< T >::getType ( ) const
inlinenoexcept

Definition at line 1320 of file AlgorithmicReverb.h.

◆ getWidth()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::getWidth ( ) const
inlinenoexcept

Definition at line 1333 of file AlgorithmicReverb.h.

◆ getWidthLaw()

template<FloatType T>
WidthLaw dspark::AlgorithmicReverb< T >::getWidthLaw ( ) const
inlinenoexcept

Definition at line 1308 of file AlgorithmicReverb.h.

◆ glideAbsorption()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::glideAbsorption ( T  gc)
inlineprotectednoexcept

One chunk of the absorption glide (the ~20 ms one of every parameter); a first-order shelf and a biquad stay stable along the way, since their stable coefficient sets are convex.

Definition at line 3868 of file AlgorithmicReverb.h.

◆ glideHz()

template<FloatType T>
static void dspark::AlgorithmicReverb< T >::glideHz ( double &  cur,
double  target,
double  amount 
)
inlinestaticprotectednoexcept

One glide step of a running cutoff toward its target (log domain).

Definition at line 2311 of file AlgorithmicReverb.h.

◆ glideTo()

template<FloatType T>
static T dspark::AlgorithmicReverb< T >::glideTo ( T  cur,
T  target,
T  amount 
)
inlinestaticprotectednoexcept

One chunk of the shared parameter glide (about 20 ms): returns the value at the end of the chunk, exactly the target once within 1e-6.

Definition at line 2268 of file AlgorithmicReverb.h.

◆ hadamardSmall()

template<FloatType T>
template<int M>
static void dspark::AlgorithmicReverb< T >::hadamardSmall ( T *  x)
inlinestaticprotectednoexcept

Unnormalised M-point Sylvester Hadamard transform in place, fully unrolled at compile time (the halves, then one butterfly stage).

Definition at line 2508 of file AlgorithmicReverb.h.

◆ hash01()

template<FloatType T>
static double dspark::AlgorithmicReverb< T >::hash01 ( int  k,
int  s 
)
inlinestaticprotectednoexcept

Deterministic hash in [0, 1) for the early-reflection layout.

Definition at line 1930 of file AlgorithmicReverb.h.

◆ heardTailEnergy()

template<FloatType T>
double dspark::AlgorithmicReverb< T >::heardTailEnergy ( double  decay,
double  t60H,
double  t60B,
double  Kh,
double  Kb 
) const
inlineprotectednoexcept

The energy of the tail for a unit of energy injected, as heard. At each frequency the first pass leaves each line attenuated by that line's own loop gain (the short lines first and louder), and what follows is the geometric series of the mean round trip: mean(g^2) / (1 - exp(-x)), x = 2 ln(1000) (mean round trip) / T60, which tends to T60 / (2 ln(1000) round trip) for a long decay. A spring is its own loop and its first pass is heard unattenuated: 1 + 1 / (exp(x) - 1). The loop gains are those just designed (the absorption, the bass shelf and the decay bands); the frequencies weigh as programme is heard (pink, through the loudness weighting: the low end out under about 40 Hz and 4 dB more over 2 kHz).

Definition at line 3985 of file AlgorithmicReverb.h.

◆ holdAbsorption()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::holdAbsorption ( )
inlineprotectednoexcept

The loop gains as they stand, kept for the ramp of a chunk.

Definition at line 3497 of file AlgorithmicReverb.h.

◆ identityAirTaps()

template<FloatType T>
static constexpr AirTaps dspark::AlgorithmicReverb< T >::identityAirTaps ( )
inlinestaticconstexprprotectednoexcept

Definition at line 2047 of file AlgorithmicReverb.h.

◆ isPlateTank()

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::isPlateTank ( ) const
inlinenoexcept
Returns
Whether a Plate runs its own tank.

Definition at line 1249 of file AlgorithmicReverb.h.

◆ isTailHeld()

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::isTailHeld ( ) const
inlinenoexcept
Returns
Whether the tail is held (as set).

Definition at line 1074 of file AlgorithmicReverb.h.

◆ isThicknessSaturated()

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::isThicknessSaturated ( ) const
inlinenoexcept

Definition at line 1303 of file AlgorithmicReverb.h.

◆ levelDb()

template<FloatType T>
static T dspark::AlgorithmicReverb< T >::levelDb ( T  gain)
inlinestaticprotectednoexcept

Linear gain to dB (a zero gain, a preset's muted early field, reads -120 dB).

Definition at line 1938 of file AlgorithmicReverb.h.

◆ lfoRateFactor()

template<FloatType T>
static constexpr T dspark::AlgorithmicReverb< T >::lfoRateFactor ( int  i)
inlinestaticconstexprprotectednoexcept

Definition at line 1911 of file AlgorithmicReverb.h.

◆ lfoSeed()

template<FloatType T>
static constexpr uint32_t dspark::AlgorithmicReverb< T >::lfoSeed ( int  i)
inlinestaticconstexprprotectednoexcept

Definition at line 1915 of file AlgorithmicReverb.h.

◆ markUserParam()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::markUserParam ( uint32_t  bit)
inlineprotectednoexcept

Definition at line 2137 of file AlgorithmicReverb.h.

◆ msToSamples()

template<FloatType T>
int dspark::AlgorithmicReverb< T >::msToSamples ( T  ms) const
inlineprotectednoexcept

Definition at line 1943 of file AlgorithmicReverb.h.

◆ nearestPrime()

template<FloatType T>
static int dspark::AlgorithmicReverb< T >::nearestPrime ( int  n)
inlinestaticprotectednoexcept

Smallest prime >= n (lengths only grow by a few samples).

Definition at line 4487 of file AlgorithmicReverb.h.

◆ noteMs()

template<FloatType T>
double dspark::AlgorithmicReverb< T >::noteMs ( int  note,
int  feel 
) const
inlineprotectednoexcept

A note value's time at the tempo, in ms.

Definition at line 4194 of file AlgorithmicReverb.h.

◆ outputStage()

template<FloatType T>
std::pair< T, T > dspark::AlgorithmicReverb< T >::outputStage ( T  lateL,
T  lateR,
T  earlyL,
T  earlyR,
T  earlyLevel,
T  lateLevel,
T  width,
T  toneHPMix,
T  toneLPMix,
T  outAPCoeff 
)
inlineprotectednoexcept

Per-sample output stage: coherent low band, width, early + late, DC block, tone EQ.

Definition at line 3555 of file AlgorithmicReverb.h.

◆ prepare()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::prepare ( const AudioSpec &  spec)
inline

Prepares the reverberation engine and allocates required memory.

Must be called before processing. An invalid spec (non-positive or non-finite fields) is a no-op that keeps the previous state.

Parameters
specAudio specification detailing sample rate and maximum block size.

Definition at line 314 of file AlgorithmicReverb.h.

◆ presetValues()

template<FloatType T>
static PresetValues dspark::AlgorithmicReverb< T >::presetValues ( Type  type)
inlinestaticprotectednoexcept

The parameter values of each preset.

Definition at line 4545 of file AlgorithmicReverb.h.

◆ processBlock()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::processBlock ( AudioBufferView< T >  buffer)
inlinenoexcept

Processes an audio block in place with zero allocations.

Stereo buffers are reverberated in true stereo; a mono buffer feeds both inputs and receives the average of the two outputs. Extra channels beyond two are left untouched. A block longer than the prepared maxBlockSize is processed as consecutive blocks of at most that size, with the same result.

Parameters
bufferView of the audio buffers (mono or stereo).

Definition at line 440 of file AlgorithmicReverb.h.

◆ processChunk()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::processChunk ( const T *  inL,
const T *  inR,
T *  outL,
T *  outR,
int  count 
)
inlineprotectednoexcept

Core processing of up to kChunk samples: stereo in, wet stereo out.

The sparse FIRs (velvet pre-diffuser and early field) run tap by tap over the whole chunk, on contiguous ring memory; the late field and the output stage run per sample.

Definition at line 3129 of file AlgorithmicReverb.h.

◆ processSample()

template<FloatType T>
std::pair< T, T > dspark::AlgorithmicReverb< T >::processSample ( T  input)
inlinenoexcept

Processes a single mono sample and returns the wet stereo pair.

The input feeds both reverb inputs; the result is the wet signal only (the mix is not applied). Pending parameter, preset and quality changes are drained here too.

Parameters
inputThe mono input sample to reverberate.
Returns
The {Left, Right} reverberated output.

Definition at line 535 of file AlgorithmicReverb.h.

◆ rampAbsorption()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::rampAbsorption ( T  perSample)
inlineprotectednoexcept

From the gains held to the ones just applied in a chunk: the step per sample, with the gains back where the chunk starts.

Definition at line 3512 of file AlgorithmicReverb.h.

◆ refreshAirInUse()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::refreshAirInUse ( )
inlineprotectednoexcept

Whether the air's filter runs: a line's b designed, gliding or in use above 0. Off, its taps are the identity; on again, its history starts clear.

Definition at line 3905 of file AlgorithmicReverb.h.

◆ refreshCachedParams()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::refreshCachedParams ( )
inlineprotectednoexcept

Pulls the atomic parameters into the block-local cache (audio thread).

Definition at line 2365 of file AlgorithmicReverb.h.

◆ refreshGateHold()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::refreshGateHold ( )
inlineprotectednoexcept

Definition at line 4185 of file AlgorithmicReverb.h.

◆ refreshPreDelay()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::refreshPreDelay ( )
inlineprotectednoexcept

Definition at line 4179 of file AlgorithmicReverb.h.

◆ refreshTopology()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::refreshTopology ( )
inlineprotectednoexcept

Line count of the active engine: the springs, or the FDN size.

Definition at line 3056 of file AlgorithmicReverb.h.

◆ reset()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::reset ( )
inlinenoexcept

Clears all delay lines and filter states and restarts the modulation, snapping any length glide to its target.

Definition at line 562 of file AlgorithmicReverb.h.

◆ rotRate()

template<FloatType T>
static constexpr T dspark::AlgorithmicReverb< T >::rotRate ( )
inlinestaticconstexprprotectednoexcept

Definition at line 1919 of file AlgorithmicReverb.h.

◆ rotRateFactor()

template<FloatType T>
static constexpr T dspark::AlgorithmicReverb< T >::rotRateFactor ( int  i)
inlinestaticconstexprprotectednoexcept

Definition at line 1920 of file AlgorithmicReverb.h.

◆ rotSeed()

template<FloatType T>
static constexpr uint32_t dspark::AlgorithmicReverb< T >::rotSeed ( int  i)
inlinestaticconstexprprotectednoexcept

Definition at line 1924 of file AlgorithmicReverb.h.

◆ runFdn()

template<FloatType T>
template<int N>
void dspark::AlgorithmicReverb< T >::runFdn ( T &  lateL,
T &  lateR,
int  injLag,
T  loopAPCoeff,
T  inGain,
T  extra 
)
inlineprotectednoexcept

One sample of the N-line FDN (compile-time N so the per-line stages vectorize): allpass-interpolated modulated reads, the L/R output sums, Hadamard mix plus rotation, absorption shelves, in-loop allpass, safety limiter, injection, write.

Definition at line 2549 of file AlgorithmicReverb.h.

◆ runPlate()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::runPlate ( T &  lateL,
T &  lateR,
int  injLag,
T  inGain,
T  extra 
)
inlineprotectednoexcept

One sample of the plate tank: the late pair, from the diffused feed.

Definition at line 2768 of file AlgorithmicReverb.h.

◆ runSecondSlope()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::runSecondSlope ( T &  lateL,
T &  lateR,
int  injLag 
)
inlineprotectednoexcept

One sample of the second slope, added to the late pair.

Definition at line 2854 of file AlgorithmicReverb.h.

◆ runSprings()

template<FloatType T>
template<int Springs, int Stages>
void dspark::AlgorithmicReverb< T >::runSprings ( T &  lateL,
T &  lateR,
const T(&)  raw[2] 
)
inlineprotectednoexcept

One sample of the spring tanks (Type::Spring): six springs per side (one in Eco), all of different lengths.

Each spring is a feedback loop after Valimaki, Parker & Abel (2010): the round-trip delay line (modulated, allpass-interpolated like the FDN lines), a cascade of stretched first-order allpasses (a + z^-K) / (1 + a z^-K) whose group delay rises from DC to the transition frequency fs / (2K) (the characteristic chirp, re-dispersed on every round trip), a 4th-order band limit just below fs / (2K), and the same exact-T60 absorption shelves as the FDN. Even springs feed the left output and hear mostly the left input, odd ones the right; six springs of different lengths per side, with a little round-trip jitter, keep the sparse modes of a single loop (the metallic ring of long decays) from dominating. Each spring's band-limited chirp train is its output. setDiffusion() sets the chirp strength here.

Definition at line 2937 of file AlgorithmicReverb.h.

◆ setAirAbsorption()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setAirAbsorption ( T  amount)
inlinenoexcept

The absorption of the air inside the tank, on top of the walls' (opt-in; the network types).

The walls' absorption is a shelf: above the high crossover every frequency decays in the HF time, so the top octave rings as long as 8 kHz. In a room the air takes more the higher the frequency, so the very top of a tail dies much sooner. Each line takes a filter whose loss in decibels is b (1 - cos w), the FIR e^-b (1 + b z^-1 + ... + (b z^-1)^n / n!) (minimum phase, 16 taps, unity at DC), with b set so that a round trip at 12 kHz loses what the air takes in that time (ISO 9613-1: 20 degrees C, 50 % relative humidity). That law follows the air's at 48 kHz from 4 to 16 kHz (12 % under it at 16 kHz), whatever a line's length. At 1, a Hall of 2.4 s with the HF decay at 0.4 of it from 5 kHz: 16 kHz 1.05 -> 0.40 s, 8 kHz 1.22 -> 0.83 s, 4 kHz 1.65 -> 1.38 s, 1 kHz 2.39 -> 2.31 s; the late tail's spectrum keeps falling over 8 kHz (-29 dB at 16 kHz against the 0.5-4 kHz band, where without it it holds at -13 from 10 kHz up), and pink noise comes out 0.14 dB quieter. The decay bands, the wet level and the tail hold take it in. Springs and the plate's own tank keep theirs. On, the tank costs 13 % more (Full) and 9 % (Eco).

Parameters
amount0 (off, the default) to 2; 1 is the air of the standard. Non-finite values are ignored.

Definition at line 934 of file AlgorithmicReverb.h.

◆ setAirTaps()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setAirTaps ( std::size_t  l)
inlineprotectednoexcept

The air's taps of a line from its b in use: b^n / n! over the taps in use, summed to one (unity at DC).

Definition at line 3456 of file AlgorithmicReverb.h.

◆ setBandLimit()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setBandLimit ( T  hz)
inlinenoexcept

Limits the band of the wet signal, as early digital reverbs did: an elliptic wall (order 12, 0.05 dB of ripple, 100 dB down a fifth of an octave above the corner) on the output, outside the tank, so the decay does not change. 0, the default, is off; otherwise 1 kHz up to 0.4 of the rate. A move fades over 20 ms (one during a fade waits for it). Non-finite values are ignored.

Definition at line 1278 of file AlgorithmicReverb.h.

◆ setBassCrossover()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setBassCrossover ( T  hz)
inlinenoexcept

Frequency where the bass decay transition is centered.

A first-order shelf per line gives the bass T60 exactly at DC and leaves the mid band untouched; its geometric midpoint lands here.

Parameters
hzCrossover in Hz (50 - 500). Default: 200.

Definition at line 952 of file AlgorithmicReverb.h.

◆ setBassDecayMultiplier()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setBassDecayMultiplier ( T  mult)
inlinenoexcept

Sets bass decay as a multiplier of mid decay time.

0.5 = bass decays 2x faster (tight). 1.0 = bass same as mid (neutral). 1.5 = bass lingers 1.5x longer (natural large room). 2.0 = bass lingers 2x longer (boomy).

Parameters
multMultiplier (0.3 - 3.0).

Definition at line 878 of file AlgorithmicReverb.h.

◆ setDamping()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setDamping ( T  amount)
inlinenoexcept

Sets high-frequency damping (0 = bright, 1 = dark).

Maps internally to highDecayMultiplier: 0->1.0 (HF=mid), 1->0.1 (HF 10x faster). For finer control, use setHighDecayMultiplier() directly.

Definition at line 769 of file AlgorithmicReverb.h.

◆ setDecay()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setDecay ( T  seconds)
inlinenoexcept

Mid-frequency reverberation time in seconds (0.1 - 30).

The ISO 3382-1 T_mid: the mean of the 500 Hz and 1 kHz octave-band T60s, the figure a hall is quoted by. The bass and high bands decay at the multiples setBassDecayMultiplier() and setHighDecayMultiplier() set, relative to the same calibration. Measured over the six types at their default damping, T_mid lands within 3% of this value.

Definition at line 721 of file AlgorithmicReverb.h.

◆ setDecayBand()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setDecayBand ( int  index,
const DecayBand &  band 
)
inlinenoexcept

One band of the decay equalizer: the decay time in a band of frequencies, as a multiple of what the other controls give there.

Each line carries the band as a filter in its loop, whose gain is -60 x (round trip / T60) x (1 / multiplier - 1) dB at the band (T60 is the decay there without the band): a bell at its centre, a low shelf at DC, a high shelf at Nyquist. Where bands that lengthen the decay would lift a loop's gain over 0.9995 at some frequency, their boosts are scaled down together until it does not. A multiplier of 1 or the shape Off takes the band out of the loop.

Parameters
indexBand, 0 to kDecayBands - 1 (others are ignored).
bandThe settings (non-finite fields are ignored).

Definition at line 1043 of file AlgorithmicReverb.h.

◆ setDiffusion()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setDiffusion ( T  amount)
inlinenoexcept

Diffusion (0 - 1): the strength of the input, in-loop and output allpass diffusers, and how many of the first early reflections stay discrete (7 at 0, 1 at 1). High values give a smooth, dense onset; low values keep crisp, localisable early echoes. For Type::Spring it sets the strength of the chirp. The allpass coefficients glide over about 20 ms.

Definition at line 797 of file AlgorithmicReverb.h.

◆ setDoubleSlope()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setDoubleSlope ( T  amount)
inlinenoexcept

A second slope, 0 to 1 (0, the default, is off): beside the tank, four lines of its own decay in 0.3 of its times, so the first decibels of the tail fall faster than the rest, as in a hall coupled to a smaller space. At 1 the early decay time falls to 0.87 (Hall) to 0.90 (Room) of what it was, the T30 moves under 3 % and the energy of the tail under 0.2 dB. Not for Spring. Non-finite values are ignored.

Definition at line 1260 of file AlgorithmicReverb.h.

◆ setDryDip()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setDryDip ( T  dB)
inlinenoexcept

Dips the wet signal under the dry one while it plays (see TailShaper): by up to dB (0 to 48; 0, the default, is off), in proportion to the dry level against its own recent peak.

Definition at line 1081 of file AlgorithmicReverb.h.

◆ setEarlyLevel()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setEarlyLevel ( T  dB)
inlinenoexcept

Early reflections level in dB (-60 to +6). 0 dB is the physical balance: the early field then carries the late field's energy density and decay, so the two join on one exponential at any size and decay time. Changes glide over about 20 ms.

Definition at line 972 of file AlgorithmicReverb.h.

◆ setErToLateDelay()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setErToLateDelay ( T  ms)
inlinenoexcept

Extra gap between the early reflections and the late tail, in ms (0 - 200).

Definition at line 834 of file AlgorithmicReverb.h.

◆ setGate()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setGate ( T  thresholdDb)
inlinenoexcept

Gate on the wet signal (see TailShaper): it closes once the dry signal has stayed thresholdDb under its recent peak (-80 to 0; below -80, the default, the gate is off) for the hold time.

Definition at line 1088 of file AlgorithmicReverb.h.

◆ setGateHold()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setGateHold ( T  ms)
inlinenoexcept

Hold of the gate, 0 to 4000 ms (default 100); a note value set by setGateHoldNote() takes its place.

Definition at line 1091 of file AlgorithmicReverb.h.

◆ setGateHoldNote()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setGateHoldNote ( NoteValue  note,
NoteFeel  feel = NoteFeel::Straight 
)
inlinenoexcept

Gate hold as a note value at the tempo (Off, the default, uses setGateHold()); up to 4 s.

Definition at line 1153 of file AlgorithmicReverb.h.

◆ setGateRelease()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setGateRelease ( T  ms)
inlinenoexcept

Release of the gate, 5 to 4000 ms (default 150).

Definition at line 1099 of file AlgorithmicReverb.h.

◆ setHighCrossover()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setHighCrossover ( T  hz)
inlinenoexcept

Frequency where the HF decay transition is centered.

The per-line absorption is a first-order pole-zero shelf pinned to the mid decay at DC and the HF decay at Nyquist (the T60 anchors stay exact for any crossover); this sets where the transition happens: the decay midpoint (geometric mean of the mid and HF loop gains) lands at this frequency. Lower values darken the tail earlier, higher values keep the damping in the top octaves only.

Parameters
hzCrossover in Hz (1000 - 16000). Default: 5000. Non-finite values are ignored.

Definition at line 900 of file AlgorithmicReverb.h.

◆ setHighDecayMultiplier()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setHighDecayMultiplier ( T  mult)
inlinenoexcept

Sets HF decay as a multiplier of mid decay time.

0.1 = HF decays 10x faster (very dark). 0.5 = HF decays 2x faster (natural room). 1.0 = HF same as mid (bright/metallic).

Parameters
multMultiplier (0.05 - 1.0).

Definition at line 857 of file AlgorithmicReverb.h.

◆ setInputWidth()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setInputWidth ( T  width)
inlinenoexcept

Width of the input, 0 to 1 (1, the default, is the input as it is): the side of the input is scaled before the tank, so a wide source excites the room from nearer the centre.

Definition at line 1165 of file AlgorithmicReverb.h.

◆ setLateLevel()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setLateLevel ( T  dB)
inlinenoexcept

Late tail level in dB (-60 to +6). Changes glide over about 20 ms.

Definition at line 980 of file AlgorithmicReverb.h.

◆ setMix()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setMix ( T  dryWet)
inlinenoexcept

Dry/wet mix (0 = dry, 1 = wet). The wet signal is calibrated to the dry one's level: on pink noise at full mix it sits within about a decibel of it at every type's preset, and within -1 to +3.5 dB as the decay goes from 12 s down to 0.3 s and the size changes (its energy grows with the decay; a gain from the decay and the mean round trip takes that back).

Definition at line 738 of file AlgorithmicReverb.h.

◆ setModRate()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setModRate ( T  hz)
inlinenoexcept

Modulation rate in Hz (0.1 - 5); each line wanders at its own multiple.

Definition at line 988 of file AlgorithmicReverb.h.

◆ setModulation()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setModulation ( T  amount)
inlinenoexcept

Modulation depth (0 - 1) of the delay-line wander. It smears the tail's resonances; 0 is fully static, 1 is a strong chorus. The depth is defined in time and scales with the room size.

Definition at line 810 of file AlgorithmicReverb.h.

◆ setModulationStyle()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setModulationStyle ( ModulationStyle  style)
inlinenoexcept

How the line lengths wander: Smooth (the default) is the smooth random modulation of every line; Segments moves every other line in segments that alternate sides, toward random positions at random speeds (each segment 0.5 to 1.5 cycles of the line's rate), rounded by a critically damped follower so the pitch has no corners, with the depth held under 2 % of the line's length.

Definition at line 1211 of file AlgorithmicReverb.h.

◆ setPlateTank()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setPlateTank ( bool  on)
inlinenoexcept

The plate's own tank (off by default; Type::Plate only): the figure-eight of Dattorro's plate instead of the delay network. Two branches feed each other, each an all-pass that the modulation moves, a delay, the damping and the decay, a second all-pass and a delay; each side of the output is read at seven points inside the other branch and its own. Decay, high decay and its crossover, modulation and its rate follow the controls; a plate has one size, so Size does not change it, and Bass Decay does not reach it. The wet level is that of the network within 0.25 dB; the decay is the one asked within 5 % from 2 s up (a branch takes a third of a second, so at 1.5 s it is 12 % short).

Definition at line 1242 of file AlgorithmicReverb.h.

◆ setPostEqBand()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setPostEqBand ( int  index,
const typename KeyEqualizer< T, 2 >::Band &  band 
)
inlinenoexcept

One band of the wet signal's equalizer (KeyEqualizer bands).

A band that keeps its form glides to a new setting over 20 ms, designed again on the way; a change of shape crosses to a second bank of filters over the same time. A band can sit on both channels of the wet pair, on its middle or on its sides (Band::placement).

Definition at line 1189 of file AlgorithmicReverb.h.

◆ setPostEqLoudness()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setPostEqLoudness ( bool  on)
inlinenoexcept

Keeps the loudness of the wet signal through its equalizer (off by default; see KeyEqualizer::setLoudnessCompensation()). State key postloudness.

Definition at line 1196 of file AlgorithmicReverb.h.

◆ setPreDelay()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setPreDelay ( T  ms)
inlinenoexcept

Pre-delay before the early reflections, in ms (0 - 500); a note value set by setPreDelayNote() takes its place.

Definition at line 781 of file AlgorithmicReverb.h.

◆ setPreDelayNote()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setPreDelayNote ( NoteValue  note,
NoteFeel  feel = NoteFeel::Straight 
)
inlinenoexcept

Pre-delay as a note value at the tempo (Off, the default, uses setPreDelay()); up to 500 ms.

Definition at line 1145 of file AlgorithmicReverb.h.

◆ setQuality()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setQuality ( Quality  q)
inlinenoexcept

Selects the engine quality / CPU cost trade-off.

Quality::Full (default) runs the complete engine. Quality::Eco runs at about 55% of its CPU for embedded and other constrained targets, with the same controls, decay calibration and loudness:

  • 16 FDN lines instead of 32 (every other base delay, so the lines still span the full range; per-line decay gains keep every T60 exact)
  • 24 early reflections per input instead of 64
  • one spring per side instead of six, with a 40-stage dispersion cascade instead of 72 (a stronger coefficient keeps the chirp)

Half the modal density is the audible difference: long, exposed tails (a slow decay on sparse material) ring a little more, and the build-up is slightly less dense; short and mid rooms sound almost the same.

Like setType(), this is an engine-mode switch, not an automation target: it is applied at the start of the next processBlock() and clears the reverb state (the running tail is dropped).

Parameters
qQuality::Full or Quality::Eco.

Definition at line 705 of file AlgorithmicReverb.h.

◆ setShimmer()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setShimmer ( T  amount)
inlinenoexcept

Octave-up shimmer, 0 to 1 (0, the default, is off): the tail is pitched up an octave by two read heads with windows of random length (30 to 60 ms) and a raised-cosine crossfade, and fed back into the tank. Non-finite values are ignored.

Definition at line 1292 of file AlgorithmicReverb.h.

◆ setSize()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setSize ( T  size)
inlinenoexcept

Room size (0.01 - 1). Scales the delay lines from 36% to 100% of their base lengths. A change cross-fades two read heads, the old lengths to the new, over a quarter of a second (no click and no glide of pitch; the next change waits for the fade), so the size can be automated.

Definition at line 755 of file AlgorithmicReverb.h.

◆ setSourceDepth()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setSourceDepth ( T  amount)
inlinenoexcept

Depth of the source in the room, 0 to 1 (0, the default, is off): one control that moves the balance from the early reflections (down to half) to the tail (up by half), shortens the pre-delay (to a fifth at 1), adds input diffusion (with its square, up to 0.25) and darkens the wet signal with a one-pole low-pass from 18 kHz down (to 2.25 kHz at 1, further with a darker HF decay). Non-finite values are ignored.

Definition at line 1110 of file AlgorithmicReverb.h.

◆ setSpaceLayout()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setSpaceLayout ( SpaceLayout  layout)
inlinenoexcept

How the line lengths are laid out: Prime (the default) takes the tuned base lengths; Geometric spaces them evenly in log over the same range (about 6.6 per octave, the lines of the two sides interleaved half a step apart), then to the nearest prime. The read heads cross-fade to the new layout as on a change of size.

Definition at line 1223 of file AlgorithmicReverb.h.

◆ setState()

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::setState ( const uint8_t *  data,
size_t  size 
)
inline

Restores parameters from a blob (tolerant; rejects foreign ids).

Definition at line 1401 of file AlgorithmicReverb.h.

◆ setTailHold()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setTailHold ( bool  on)
inlinenoexcept

Holds the tail: the input to the tank and the early field fade out over about 20 ms while every loop's absorption and decay band fade to unity, so the tail holds with its highs. Off fades back.

Definition at line 1072 of file AlgorithmicReverb.h.

◆ setTankLeveling()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setTankLeveling ( T  amount)
inlinenoexcept

Leveling of the tank, 0 to 1 (0, the default, is off): a compressor on the tank's input (ratio 1 + 3 x amount over -30 dBFS with a 24 dB knee), its gain compensated at -18 dBFS: quiet passages feed the tail as much as loud ones. It reads the peak of each sample (as the power of a sine with that peak); its reduction deepens at once, holds 30 ms and comes back with a time constant of half a second, so it neither moves within a cycle of a low note nor lets the start of a hit through. Non-finite values are ignored.

Definition at line 1127 of file AlgorithmicReverb.h.

◆ setTankSaturation()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setTankSaturation ( bool  on)
inlinenoexcept

Soft saturation after the leveling compressor (off by default).

Definition at line 1133 of file AlgorithmicReverb.h.

◆ setTempo()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setTempo ( T  bpm)
inlinenoexcept

Tempo for the note values, 20 to 400 BPM (default 120).

Definition at line 1136 of file AlgorithmicReverb.h.

◆ setToneHighCut()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setToneHighCut ( T  hz)
inlinenoexcept

Sets a post-reverb high-cut filter on the wet signal (12 dB/oct).

Cutoff changes glide over about 20 ms, and switching the filter on or off crossfades, so it can be automated.

Parameters
hzCutoff in Hz (0 = off, 2000-16000 typical).

Definition at line 1017 of file AlgorithmicReverb.h.

◆ setToneLowCut()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setToneLowCut ( T  hz)
inlinenoexcept

Sets a post-reverb low-cut filter on the wet signal (12 dB/oct).

Cutoff changes glide over about 20 ms, and switching the filter on or off crossfades, so it can be automated.

Parameters
hzCutoff in Hz (0 = off, 20-500 typical).

Definition at line 1003 of file AlgorithmicReverb.h.

◆ setType()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setType ( Type  type)
inlinenoexcept

Loads the selected preset baseline.

Call setDecay(), setSize() and other parameter setters after setType() when those values should override the selected preset. The preset's parameter values are written here, on the calling thread, so a setter called afterwards always overrides them. The engine change is applied at the start of the next processBlock(); the running tail is cleared.

Definition at line 667 of file AlgorithmicReverb.h.

◆ setWidth()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setWidth ( T  width)
inlinenoexcept

Sets stereo width of the late reverb tail.

Uses M/S processing: 0 = mono, 1 = natural stereo, 2 = extra wide. Applied to the late tail (its low band stays coherent), before the early reflections are added. Changes glide over about 20 ms.

Parameters
widthStereo width (0.0 - 2.0). Default: 1.0.

Definition at line 827 of file AlgorithmicReverb.h.

◆ setWidthLaw()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::setWidthLaw ( WidthLaw  law)
inlinenoexcept

How setWidth() acts on the tail: Side (the default) scales the side; PowerKept also raises the middle as the side falls (sqrt(2 - width^2)), so the tail's power stays the same from 0 to 1.41.

Definition at line 1176 of file AlgorithmicReverb.h.

◆ shelfGain()

template<FloatType T>
static double dspark::AlgorithmicReverb< T >::shelfGain ( double  a,
double  b,
double  w 
)
inlinestaticprotectednoexcept

|H(e^jw)| of ((1 + a) + (a - 1) z^-1) / ((1 + b) + (b - 1) z^-1).

Definition at line 3963 of file AlgorithmicReverb.h.

◆ shimmerStep()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::shimmerStep ( T  input)
inlineprotectednoexcept

One sample of the octave-up shimmer: two read heads, half a window apart, sweep the recent input at twice its speed, each under a raised-cosine window; a head draws its next window length (30 to 60 ms) as it wraps.

Definition at line 3388 of file AlgorithmicReverb.h.

◆ sizeFactor()

template<FloatType T>
T dspark::AlgorithmicReverb< T >::sizeFactor ( ) const
inlineprotectednoexcept

Size factor: size 0 -> 0.35, size 1 -> 1.

Definition at line 3643 of file AlgorithmicReverb.h.

◆ snapAbsorption()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::snapAbsorption ( )
inlineprotectednoexcept

The absorption at its design at once (no glide).

Definition at line 3850 of file AlgorithmicReverb.h.

◆ snapGlides()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::snapGlides ( )
inlineprotectednoexcept

Puts every gliding parameter (levels, width, diffusion, tone) at its target.

Definition at line 2254 of file AlgorithmicReverb.h.

◆ snapTone()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::snapTone ( )
inlineprotectednoexcept

Puts the tone filters at their targets at once (prepare, reset).

Definition at line 2349 of file AlgorithmicReverb.h.

◆ springBaseMs()

template<FloatType T>
static double dspark::AlgorithmicReverb< T >::springBaseMs ( int  s)
inlinestaticprotectednoexcept

Round-trip time of spring s at the reference size: spread over 33-60 ms with a little irregularity, interleaved between the sides.

Definition at line 1615 of file AlgorithmicReverb.h.

◆ stepAbsorption()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::stepAbsorption ( )
inlineprotectednoexcept

One sample of the loop gains' ramp.

Definition at line 3536 of file AlgorithmicReverb.h.

◆ updateAll()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::updateAll ( )
inlineprotectednoexcept

Definition at line 3630 of file AlgorithmicReverb.h.

◆ updateDecayParams()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::updateDecayParams ( )
inlineprotectednoexcept

Per-line absorption: Jot mid/high shelf and bass shelf.

Both are first-order sections from the bilinear transform of H(s) = (s + a) / (s + b) (prewarped at the crossover): H(z) = ((1 + a) + (a - 1) z^-1) / ((1 + b) + (b - 1) z^-1). Jot: gHigh * H with a = K sqrt(gMid/gHigh), b = K sqrt(gHigh/gMid), so |H(1)| = gMid and |H(-1)| = gHigh exactly. Bass: a = K sqrt(r), b = K / sqrt(r) with r = gBass / gMid, so the DC gain is r and the Nyquist gain 1. Each midpoint (geometric mean) lands on its crossover. The loop length includes the in-loop allpass (its mean group delay equals its length).

Definition at line 3749 of file AlgorithmicReverb.h.

◆ updateDelayLengths()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::updateDelayLengths ( )
inlineprotectednoexcept

Definition at line 3648 of file AlgorithmicReverb.h.

◆ updateDiffCoeffs()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::updateDiffCoeffs ( )
inlineprotectednoexcept

Definition at line 3690 of file AlgorithmicReverb.h.

◆ updateModulation()

template<FloatType T>
void dspark::AlgorithmicReverb< T >::updateModulation ( )
inlineprotectednoexcept

Definition at line 3715 of file AlgorithmicReverb.h.

◆ writeSpan()

template<FloatType T>
static void dspark::AlgorithmicReverb< T >::writeSpan ( Line &  l,
const T *  src,
int  count 
)
inlinestaticprotectednoexcept

Pushes count samples into a line, in pieces that stop at its end.

Definition at line 3076 of file AlgorithmicReverb.h.

Member Data Documentation

◆ absFrom_

template<FloatType T>
std::array<std::array<T, kMaxLines>, 6> dspark::AlgorithmicReverb< T >::absFrom_ {}
protected

The loop gains' ramp across a chunk: where they stood and their step per sample.

Definition at line 2184 of file AlgorithmicReverb.h.

◆ absorbGlide_

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::absorbGlide_ = false
protected

Definition at line 2182 of file AlgorithmicReverb.h.

◆ absStep_

template<FloatType T>
std::array<std::array<T, kMaxLines>, 6> dspark::AlgorithmicReverb< T >::absStep_ {}
protected

Definition at line 2184 of file AlgorithmicReverb.h.

◆ airAbsorption_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::airAbsorption_ { T(0) }
protected

Definition at line 2109 of file AlgorithmicReverb.h.

◆ airBase_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::airBase_ {}
protected

Definition at line 2057 of file AlgorithmicReverb.h.

◆ airGoal_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::airGoal_ {}
protected

Definition at line 2057 of file AlgorithmicReverb.h.

◆ airHist_

template<FloatType T>
AirTaps dspark::AlgorithmicReverb< T >::airHist_ {}
protected

Definition at line 2053 of file AlgorithmicReverb.h.

◆ airInUse_

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::airInUse_ = false
protected

any line's b, designed, gliding or in use, above 0

Definition at line 2056 of file AlgorithmicReverb.h.

◆ airNow_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::airNow_ {}
protected

Definition at line 2057 of file AlgorithmicReverb.h.

◆ airTap_

template<FloatType T>
AirTaps dspark::AlgorithmicReverb< T >::airTap_ = identityAirTaps()
protected

Definition at line 2053 of file AlgorithmicReverb.h.

◆ airTapCount_

template<FloatType T>
int dspark::AlgorithmicReverb< T >::airTapCount_ = 1
protected

taps that carry more than 1e-7 of the largest b's sum

Definition at line 2055 of file AlgorithmicReverb.h.

◆ airTapFrom_

template<FloatType T>
AirTaps dspark::AlgorithmicReverb< T >::airTapFrom_ {}
protected

Definition at line 2053 of file AlgorithmicReverb.h.

◆ airTapStep_

template<FloatType T>
AirTaps dspark::AlgorithmicReverb< T >::airTapStep_ {}
protected

Definition at line 2053 of file AlgorithmicReverb.h.

◆ airW_

template<FloatType T>
int dspark::AlgorithmicReverb< T >::airW_ = 0
protected

Definition at line 2054 of file AlgorithmicReverb.h.

◆ apY1_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::apY1_ {}
protected

allpass interpolator state

Definition at line 2001 of file AlgorithmicReverb.h.

◆ apY2_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::apY2_ {}
protected

Definition at line 1997 of file AlgorithmicReverb.h.

◆ bandLimit_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::bandLimit_ { T(0) }
protected

Definition at line 1764 of file AlgorithmicReverb.h.

◆ bassA1_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::bassA1_ {}
protected

Definition at line 2041 of file AlgorithmicReverb.h.

◆ bassB0_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::bassB0_ {}
protected

Definition at line 2041 of file AlgorithmicReverb.h.

◆ bassB1_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::bassB1_ {}
protected

Definition at line 2041 of file AlgorithmicReverb.h.

◆ bassBase_

template<FloatType T>
std::array<std::array<T, kMaxLines>, 3> dspark::AlgorithmicReverb< T >::bassBase_ {}
protected

Definition at line 2176 of file AlgorithmicReverb.h.

◆ bassCrossover_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::bassCrossover_ { T(200) }
protected

Definition at line 2110 of file AlgorithmicReverb.h.

◆ bassDecayMult_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::bassDecayMult_ { T(1.2) }
protected

Definition at line 2107 of file AlgorithmicReverb.h.

◆ bassGoal_

template<FloatType T>
std::array<std::array<T, kMaxLines>, 3> dspark::AlgorithmicReverb< T >::bassGoal_ {}
protected

Definition at line 2180 of file AlgorithmicReverb.h.

◆ bassX1_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::bassX1_ {}
protected

Definition at line 2041 of file AlgorithmicReverb.h.

◆ bassY1_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::bassY1_ {}
protected

Definition at line 2041 of file AlgorithmicReverb.h.

◆ cachedParams_

template<FloatType T>
CachedParams dspark::AlgorithmicReverb< T >::cachedParams_ {}
protected

Definition at line 2156 of file AlgorithmicReverb.h.

◆ coherenceFilter_

template<FloatType T>
Biquad<T, 1> dspark::AlgorithmicReverb< T >::coherenceFilter_
protected

Definition at line 2062 of file AlgorithmicReverb.h.

◆ ctrlPhase_

template<FloatType T>
int dspark::AlgorithmicReverb< T >::ctrlPhase_ = 0
protected

Definition at line 1954 of file AlgorithmicReverb.h.

◆ damping_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::damping_ { T(0.5) }
protected

Definition at line 2095 of file AlgorithmicReverb.h.

◆ decayBands_

template<FloatType T>
std::array<PublishedDecayBand, kDecayBands> dspark::AlgorithmicReverb< T >::decayBands_
protected

Definition at line 2166 of file AlgorithmicReverb.h.

◆ decayTime_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::decayTime_ { T(1) }
protected

Definition at line 2093 of file AlgorithmicReverb.h.

◆ diffusion_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::diffusion_ { T(0.7) }
protected

Definition at line 2096 of file AlgorithmicReverb.h.

◆ distCoeff_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::distCoeff_ = T(1)
protected

Definition at line 2196 of file AlgorithmicReverb.h.

◆ distLp_

template<FloatType T>
std::array<T, 2> dspark::AlgorithmicReverb< T >::distLp_ {}
protected

Definition at line 2195 of file AlgorithmicReverb.h.

◆ distMix_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::distMix_ = T(0)
protected

Definition at line 2196 of file AlgorithmicReverb.h.

◆ doubleSlope_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::doubleSlope_ { T(0) }
protected

Definition at line 1804 of file AlgorithmicReverb.h.

◆ dqA1_

template<FloatType T>
std::array<std::array<T, kMaxLines>, kDecayBands> dspark::AlgorithmicReverb< T >::dqA1_ {}
protected

Definition at line 2188 of file AlgorithmicReverb.h.

◆ dqA2_

template<FloatType T>
std::array<std::array<T, kMaxLines>, kDecayBands> dspark::AlgorithmicReverb< T >::dqA2_ {}
protected

Definition at line 2188 of file AlgorithmicReverb.h.

◆ dqB0_

template<FloatType T>
std::array<std::array<T, kMaxLines>, kDecayBands> dspark::AlgorithmicReverb< T >::dqB0_ {}
protected

Definition at line 2188 of file AlgorithmicReverb.h.

◆ dqB1_

template<FloatType T>
std::array<std::array<T, kMaxLines>, kDecayBands> dspark::AlgorithmicReverb< T >::dqB1_ {}
protected

Definition at line 2188 of file AlgorithmicReverb.h.

◆ dqB2_

template<FloatType T>
std::array<std::array<T, kMaxLines>, kDecayBands> dspark::AlgorithmicReverb< T >::dqB2_ {}
protected

Definition at line 2188 of file AlgorithmicReverb.h.

◆ dqBase_

template<FloatType T>
std::array<std::array<std::array<T, kMaxLines>, kDecayBands>, 5> dspark::AlgorithmicReverb< T >::dqBase_ {}
protected

Definition at line 2177 of file AlgorithmicReverb.h.

◆ dqCount_

template<FloatType T>
int dspark::AlgorithmicReverb< T >::dqCount_ = 0
protected

Definition at line 2191 of file AlgorithmicReverb.h.

◆ dqFrom_

template<FloatType T>
std::array<std::array<std::array<T, kMaxLines>, kDecayBands>, 5> dspark::AlgorithmicReverb< T >::dqFrom_ {}
protected

Definition at line 2185 of file AlgorithmicReverb.h.

◆ dqGoal_

template<FloatType T>
std::array<std::array<std::array<T, kMaxLines>, kDecayBands>, 5> dspark::AlgorithmicReverb< T >::dqGoal_ {}
protected

Definition at line 2181 of file AlgorithmicReverb.h.

◆ dqList_

template<FloatType T>
std::array<int, kDecayBands> dspark::AlgorithmicReverb< T >::dqList_ {}
protected

Definition at line 2190 of file AlgorithmicReverb.h.

◆ dqStep_

template<FloatType T>
std::array<std::array<std::array<T, kMaxLines>, kDecayBands>, 5> dspark::AlgorithmicReverb< T >::dqStep_ {}
protected

Definition at line 2185 of file AlgorithmicReverb.h.

◆ dqZ1_

template<FloatType T>
std::array<std::array<T, kMaxLines>, kDecayBands> dspark::AlgorithmicReverb< T >::dqZ1_ {}
protected

Definition at line 2189 of file AlgorithmicReverb.h.

◆ dqZ2_

template<FloatType T>
std::array<std::array<T, kMaxLines>, kDecayBands> dspark::AlgorithmicReverb< T >::dqZ2_ {}
protected

Definition at line 2189 of file AlgorithmicReverb.h.

◆ earlyCur_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::earlyCur_ = T(1)
protected

Definition at line 2078 of file AlgorithmicReverb.h.

◆ earlyLevel_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::earlyLevel_ { T(1) }
protected

Definition at line 2102 of file AlgorithmicReverb.h.

◆ eco_

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::eco_ = false
protected

Definition at line 1952 of file AlgorithmicReverb.h.

◆ erBin_

template<FloatType T>
std::array<std::array<int, kMaxERSlots>, 2> dspark::AlgorithmicReverb< T >::erBin_ {}
protected

Definition at line 1973 of file AlgorithmicReverb.h.

◆ erChan_

template<FloatType T>
std::array<std::array<int, kMaxERSlots>, 2> dspark::AlgorithmicReverb< T >::erChan_ {}
protected

Definition at line 1973 of file AlgorithmicReverb.h.

◆ erGain_

template<FloatType T>
std::array<std::array<T, kMaxERSlots>, 2> dspark::AlgorithmicReverb< T >::erGain_ {}
protected

current (gliding) tap gains

Definition at line 1974 of file AlgorithmicReverb.h.

◆ erGainTarget_

template<FloatType T>
std::array<std::array<T, kMaxERSlots>, 2> dspark::AlgorithmicReverb< T >::erGainTarget_ {}
protected

gains for the current size/decay

Definition at line 1975 of file AlgorithmicReverb.h.

◆ erGlidePerSample_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::erGlidePerSample_ = T(0.001)
protected

glide rate of the two (1 / samples)

Definition at line 1977 of file AlgorithmicReverb.h.

◆ erGroupStart_

template<FloatType T>
std::array<std::array<int, kERGroups + 1>, 2> dspark::AlgorithmicReverb< T >::erGroupStart_ {}
protected

slot index per side

Definition at line 1978 of file AlgorithmicReverb.h.

◆ erLP_

template<FloatType T>
std::array<std::array<T, kERGroups>, 2> dspark::AlgorithmicReverb< T >::erLP_ {}
protected

Definition at line 1981 of file AlgorithmicReverb.h.

◆ erShadowLP_

template<FloatType T>
std::array<std::array<T, kERGroups>, 2> dspark::AlgorithmicReverb< T >::erShadowLP_ {}
protected

Definition at line 1982 of file AlgorithmicReverb.h.

◆ erShelfCoeff_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::erShelfCoeff_ = T(0.5)
protected

one-pole coefficient at the high crossover

Definition at line 1980 of file AlgorithmicReverb.h.

◆ erShelfGain_

template<FloatType T>
std::array<T, kERGroups> dspark::AlgorithmicReverb< T >::erShelfGain_ {}
protected

HF gain of each absorption group.

Definition at line 1979 of file AlgorithmicReverb.h.

◆ erShelfGainTarget_

template<FloatType T>
std::array<T, kERGroups> dspark::AlgorithmicReverb< T >::erShelfGainTarget_ {}
protected

Definition at line 1976 of file AlgorithmicReverb.h.

◆ erTap_

template<FloatType T>
std::array<std::array<int, kMaxERSlots>, 2> dspark::AlgorithmicReverb< T >::erTap_ {}
protected

Definition at line 1973 of file AlgorithmicReverb.h.

◆ erToLateMs_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::erToLateMs_ { T(0) }
protected

Definition at line 2100 of file AlgorithmicReverb.h.

◆ erToLateSamples_

template<FloatType T>
std::atomic<int> dspark::AlgorithmicReverb< T >::erToLateSamples_ { 0 }
protected

Definition at line 2115 of file AlgorithmicReverb.h.

◆ erType_

template<FloatType T>
Type dspark::AlgorithmicReverb< T >::erType_ = Type::Room
protected

Definition at line 1972 of file AlgorithmicReverb.h.

◆ fadeAt_

template<FloatType T>
double dspark::AlgorithmicReverb< T >::fadeAt_ = 0.0
protected

Definition at line 1999 of file AlgorithmicReverb.h.

◆ fadeStep_

template<FloatType T>
double dspark::AlgorithmicReverb< T >::fadeStep_ = 0.0
protected

the fade, 0 to 1, and its step per sample

Definition at line 1999 of file AlgorithmicReverb.h.

◆ fresh_

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::fresh_ = true
protected

no sample processed since prepare()/reset()

Definition at line 2079 of file AlgorithmicReverb.h.

◆ gateFeel_

template<FloatType T>
std::atomic<int> dspark::AlgorithmicReverb< T >::gateFeel_ { 0 }
protected

Definition at line 2170 of file AlgorithmicReverb.h.

◆ gateHoldMs_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::gateHoldMs_ { T(100) }
protected

Definition at line 2169 of file AlgorithmicReverb.h.

◆ gateNote_

template<FloatType T>
std::atomic<int> dspark::AlgorithmicReverb< T >::gateNote_ { 0 }
protected

Definition at line 2170 of file AlgorithmicReverb.h.

◆ glideCoeff_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::glideCoeff_ = T(0)
protected

Definition at line 2014 of file AlgorithmicReverb.h.

◆ highCrossover_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::highCrossover_ { T(5000) }
protected

Definition at line 2108 of file AlgorithmicReverb.h.

◆ highDecayMult_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::highDecayMult_ { T(0.5) }
protected

Definition at line 2106 of file AlgorithmicReverb.h.

◆ holdNow_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::holdNow_ = T(0)
protected

Definition at line 2192 of file AlgorithmicReverb.h.

◆ inAP_

template<FloatType T>
std::array<std::array<Line, kInStages>, 2> dspark::AlgorithmicReverb< T >::inAP_
protected

Definition at line 1958 of file AlgorithmicReverb.h.

◆ inAPCoeff_

template<FloatType T>
std::array<T, kInStages> dspark::AlgorithmicReverb< T >::inAPCoeff_ {}
protected

Definition at line 1960 of file AlgorithmicReverb.h.

◆ inAPCoeffTarget_

template<FloatType T>
std::array<T, kInStages> dspark::AlgorithmicReverb< T >::inAPCoeffTarget_ {}
protected

inAPCoeff_ glides here (setDiffusion)

Definition at line 1961 of file AlgorithmicReverb.h.

◆ inAPLen_

template<FloatType T>
std::array<std::array<int, kInStages>, 2> dspark::AlgorithmicReverb< T >::inAPLen_ {}
protected

Definition at line 1959 of file AlgorithmicReverb.h.

◆ injGain_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::injGain_ {}
protected

sign / sqrt(lines)

Definition at line 2003 of file AlgorithmicReverb.h.

◆ injTap_

template<FloatType T>
std::array<int, kMaxLines> dspark::AlgorithmicReverb< T >::injTap_ {}
protected

Definition at line 2002 of file AlgorithmicReverb.h.

◆ inputWidth_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::inputWidth_ { T(1) }
protected

Definition at line 2168 of file AlgorithmicReverb.h.

◆ jotA1_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::jotA1_ {}
protected

Definition at line 2040 of file AlgorithmicReverb.h.

◆ jotB0_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::jotB0_ {}
protected

Definition at line 2040 of file AlgorithmicReverb.h.

◆ jotB1_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::jotB1_ {}
protected

Definition at line 2040 of file AlgorithmicReverb.h.

◆ jotBase_

template<FloatType T>
std::array<std::array<T, kMaxLines>, 3> dspark::AlgorithmicReverb< T >::jotBase_ {}
protected

Definition at line 2176 of file AlgorithmicReverb.h.

◆ jotGoal_

template<FloatType T>
std::array<std::array<T, kMaxLines>, 3> dspark::AlgorithmicReverb< T >::jotGoal_ {}
protected

Definition at line 2180 of file AlgorithmicReverb.h.

◆ jotX1_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::jotX1_ {}
protected

Definition at line 2040 of file AlgorithmicReverb.h.

◆ jotY1_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::jotY1_ {}
protected

Definition at line 2040 of file AlgorithmicReverb.h.

◆ kAirFitHz

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kAirFitHz = 12000.0
staticconstexprprotected

Definition at line 3927 of file AlgorithmicReverb.h.

◆ kAirMaxDepth

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kAirMaxDepth = 5.0
staticconstexprprotected

Definition at line 3928 of file AlgorithmicReverb.h.

◆ kAirTaps

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kAirTaps = 16
staticconstexprprotected

Definition at line 2045 of file AlgorithmicReverb.h.

◆ kApLow

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kApLow = 0.1
staticconstexprprotected

The modulated reads cover the fractional delay [kApLow, kApLow + 1). Where the read index steps, (M, kApLow + 1) hands over to (M + 1, kApLow). At kApLow = 0 those would be the same filter (a pure one-sample delay against an allpass with eta = 1, which cancels to unity), so near 0 the handover changes the phase delay very little at any frequency; with [0.5, 1.5) it changed by up to a sample near Nyquist and every step left high-frequency noise in the tail. At 0.1 the pole stays at |eta| <= 0.82 (at most 10 samples of group delay, at Nyquist only).

Definition at line 1521 of file AlgorithmicReverb.h.

◆ kBaseDelaysMs_

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kBaseDelaysMs_[kMaxLines]
staticconstexprprotected
Initial value:
= {
44.5, 46.5, 49.7, 52.3, 56.1, 58.9, 61.9, 65.2,
68.6, 73.7, 76.2, 79.8, 86.4, 89.8, 95.7, 101.2,
105.4, 112.5, 116.7, 126.4, 132.1, 140.6, 146.9, 154.1,
162.9, 175.8, 184.1, 192.8, 204.0, 218.5, 224.2, 240.1
}

Definition at line 1541 of file AlgorithmicReverb.h.

◆ kChunk

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kChunk = 64
staticconstexprprotected

sparse-FIR processing chunk (samples)

Definition at line 1479 of file AlgorithmicReverb.h.

◆ kCoherenceHz

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kCoherenceHz = 355.0
staticconstexprprotected

side high-pass of the late field (2nd order, Q 0.74)

Definition at line 1491 of file AlgorithmicReverb.h.

◆ kCoherenceQ

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kCoherenceQ = 0.74
staticconstexprprotected

Definition at line 1492 of file AlgorithmicReverb.h.

◆ kCtrl

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kCtrl = 16
staticconstexprprotected

modulation control period (samples)

Definition at line 1478 of file AlgorithmicReverb.h.

◆ kDecayBands

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kDecayBands = 6
staticconstexpr

Bands of the decay equalizer.

Definition at line 299 of file AlgorithmicReverb.h.

◆ kEcoERTaps

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kEcoERTaps = 48
staticconstexprprotected

Definition at line 1469 of file AlgorithmicReverb.h.

◆ kEcoLines

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kEcoLines = 16
staticconstexprprotected

Definition at line 1466 of file AlgorithmicReverb.h.

◆ kEcoSprings

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kEcoSprings = 2
staticconstexprprotected

Definition at line 1609 of file AlgorithmicReverb.h.

◆ kEcoSpringStages

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kEcoSpringStages = 40
staticconstexprprotected

Definition at line 1611 of file AlgorithmicReverb.h.

◆ kERGroups

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kERGroups = 4
staticconstexprprotected

absorption groups (early -> late)

Definition at line 1477 of file AlgorithmicReverb.h.

◆ kGlideMs

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kGlideMs = 60.0
staticconstexprprotected

size-change glide time constant

Definition at line 1506 of file AlgorithmicReverb.h.

◆ kInDiffCoeffs_

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kInDiffCoeffs_[kInStages] = { 0.75, 0.72, 0.68, 0.64 }
staticconstexprprotected

Definition at line 1565 of file AlgorithmicReverb.h.

◆ kInDiffMs_

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kInDiffMs_[2][kInStages]
staticconstexprprotected
Initial value:
= {
{ 0.36, 0.69, 1.10, 1.65 },
{ 0.43, 0.80, 1.20, 1.79 }
}

Definition at line 1561 of file AlgorithmicReverb.h.

◆ kInjectMs_

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kInjectMs_[kMaxLines]
staticconstexprprotected
Initial value:
= {
7.14, 3.31, 0.76, 0.25, 5.86, 2.04, 4.84, 5.35,
5.61, 6.88, 0.00, 7.65, 2.80, 1.02, 7.90, 1.53,
1.27, 4.33, 6.63, 2.55, 3.06, 6.12, 5.10, 6.37,
3.82, 1.78, 3.57, 7.39, 2.29, 0.51, 4.08, 4.59
}

Definition at line 1578 of file AlgorithmicReverb.h.

◆ kInjectSign_

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kInjectSign_[kMaxLines]
staticconstexprprotected
Initial value:
= {
1, 1, -1, 1, -1, 1, 1, -1,
-1, 1, 1, -1, 1, -1, 1, 1,
1, 1, 1, -1, 1, 1, 1, 1,
1, -1, 1, 1, -1, 1, -1, -1
}

Definition at line 1584 of file AlgorithmicReverb.h.

◆ kInStages

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kInStages = 4
staticconstexprprotected

input diffusers per channel feeding the late field (Full)

Definition at line 1467 of file AlgorithmicReverb.h.

◆ kLoopApMs_

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kLoopApMs_[kMaxLines]
staticconstexprprotected
Initial value:
= {
3.55, 1.47, 3.80, 1.96, 1.84, 2.33, 4.41, 4.90,
1.10, 1.35, 4.29, 3.43, 4.16, 4.53, 2.08, 3.06,
1.22, 2.94, 3.92, 3.18, 2.57, 4.04, 4.65, 2.45,
2.69, 4.78, 3.67, 1.71, 2.20, 1.59, 2.82, 3.31
}

Definition at line 1550 of file AlgorithmicReverb.h.

◆ kMaxDecayLoopGain

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kMaxDecayLoopGain = 0.9995
staticconstexprprotected

Highest loop gain the decay bands may reach.

Definition at line 1485 of file AlgorithmicReverb.h.

◆ kMaxDiscreteER

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kMaxDiscreteER = 7
staticconstexprprotected

raw (discrete) early taps at diffusion 0

Definition at line 1471 of file AlgorithmicReverb.h.

◆ kMaxErMs

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kMaxErMs = 170.0
staticconstexprprotected

Definition at line 1487 of file AlgorithmicReverb.h.

◆ kMaxERSlots

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kMaxERSlots = kMaxERTaps + 2 * kMaxDiscreteER
staticconstexprprotected

Early-tap slots per output side: every reflection, plus a second slot for each of the first kMaxDiscreteER per input, so the raw and the diffused reading of those both exist and setDiffusion() crossfades between them instead of switching the source.

Definition at line 1476 of file AlgorithmicReverb.h.

◆ kMaxERTaps

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kMaxERTaps = 128
staticconstexprprotected

early taps per output side: 64 reflections per input (Full)

Definition at line 1468 of file AlgorithmicReverb.h.

◆ kMaxErToLateMs

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kMaxErToLateMs = 200.0
staticconstexprprotected

Definition at line 1486 of file AlgorithmicReverb.h.

◆ kMaxGlideSpeed

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kMaxGlideSpeed = 0.04
staticconstexprprotected

max length change per sample (4% Doppler)

Definition at line 1507 of file AlgorithmicReverb.h.

◆ kMaxInDiffMs

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kMaxInDiffMs = 2.0
staticconstexprprotected

Definition at line 1489 of file AlgorithmicReverb.h.

◆ kMaxInjectMs

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kMaxInjectMs = 8.0
staticconstexprprotected

Definition at line 1488 of file AlgorithmicReverb.h.

◆ kMaxLines

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kMaxLines = 32
staticconstexprprotected

Definition at line 1465 of file AlgorithmicReverb.h.

◆ kMaxLoopApMs

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kMaxLoopApMs = 5.5
staticconstexprprotected

Definition at line 1490 of file AlgorithmicReverb.h.

◆ kMaxPreDelayMs

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kMaxPreDelayMs = 500.0
staticconstexprprotected

Definition at line 1481 of file AlgorithmicReverb.h.

◆ kMeanInjectMs

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kMeanInjectMs = 4.0
staticconstexprprotected

mean of kInjectMs_

Definition at line 1576 of file AlgorithmicReverb.h.

◆ kMinReadPos

template<FloatType T>
constexpr T dspark::AlgorithmicReverb< T >::kMinReadPos = T(2)
staticconstexprprotected

Definition at line 1511 of file AlgorithmicReverb.h.

◆ kModMaxMs

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kModMaxMs = 2.0
staticconstexprprotected

peak line wander at modulation 1, size 1

Definition at line 1495 of file AlgorithmicReverb.h.

◆ kOutDiffMs_

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kOutDiffMs_[2][kOutStages]
staticconstexprprotected
Initial value:
= {
{ 1.13, 2.41 },
{ 1.31, 2.67 }
}

Definition at line 1571 of file AlgorithmicReverb.h.

◆ kOutGain

template<FloatType T>
constexpr T dspark::AlgorithmicReverb< T >::kOutGain = T(0.25)
staticconstexprprotected

Wet output scale: calibrated so the steady-state level matches the previous engine's (and Full matches Eco within a fraction of a dB).

Definition at line 1529 of file AlgorithmicReverb.h.

◆ kOutSignL_

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kOutSignL_[kMaxLines]
staticconstexprprotected
Initial value:
= {
-1, -1, 1, -1, -1, 1, 1, 1,
-1, -1, 1, 1, -1, -1, -1, 1,
-1, -1, 1, -1, -1, 1, 1, -1,
1, 1, -1, -1, -1, -1, -1, 1
}

Definition at line 1593 of file AlgorithmicReverb.h.

◆ kOutSignR_

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kOutSignR_[kMaxLines]
staticconstexprprotected
Initial value:
= {
-1, 1, 1, 1, -1, -1, 1, -1,
-1, 1, 1, -1, -1, 1, -1, -1,
-1, 1, 1, 1, -1, -1, 1, 1,
1, -1, -1, 1, -1, 1, -1, -1
}

Definition at line 1599 of file AlgorithmicReverb.h.

◆ kOutStages

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kOutStages = 2
staticconstexprprotected

Definition at line 1570 of file AlgorithmicReverb.h.

◆ kPlateEnergy

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kPlateEnergy = 0.50
staticconstexprprotected

The plate's tail energy over the tail formula (measured, 1.5 to 8 s: within 0.25 dB).

Definition at line 1801 of file AlgorithmicReverb.h.

◆ kPostBands

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kPostBands = KeyEqualizer<T, 2>::kBands
staticconstexpr

Bands of the wet equalizer.

Definition at line 300 of file AlgorithmicReverb.h.

◆ kPrimeTableMax

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kPrimeTableMax = 131072
staticconstexprprotected

Definition at line 4468 of file AlgorithmicReverb.h.

◆ kRotMaxRad

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kRotMaxRad = 10.0
staticconstexprprotected

peak rotation angle at modulation 1 (rad)

Time-varying mixing matrix: Givens rotations of line pairs, their angle scaled by the modulation amount (the Hall's 0.10 gives 1 rad) at a fixed slow rate - a rotation spreads every frequency alike, so it stays slow whatever the line-wander rate.

Definition at line 1500 of file AlgorithmicReverb.h.

◆ kRotPairStride

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kRotPairStride = 4
staticconstexprprotected

Rotation partner of line i is i XOR 4: both carry the same L*R sign in the output sums and the same input side, so turning them never tilts the stereo image (checked in the test suite).

Definition at line 1505 of file AlgorithmicReverb.h.

◆ kRotRateHz

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kRotRateHz = 0.35
staticconstexprprotected

base rate of the pair rotations

Definition at line 1501 of file AlgorithmicReverb.h.

◆ kSecondMs

template<FloatType T>
constexpr std::array<double, SecondSlope::kLines> dspark::AlgorithmicReverb< T >::kSecondMs { 23.3, 29.1, 37.9, 44.7 }
staticconstexprprotected

Definition at line 1805 of file AlgorithmicReverb.h.

◆ kSecondRatio

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kSecondRatio = 0.3
staticconstexprprotected

its decay times, as a share of the tank's

Definition at line 1806 of file AlgorithmicReverb.h.

◆ kSecondShare

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kSecondShare = 0.30
staticconstexprprotected

its share of the tail's energy at 1

Definition at line 1807 of file AlgorithmicReverb.h.

◆ kShadowBins

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kShadowBins = 2
staticconstexprprotected

head-shadow classes of the early taps (open, shadowed)

Definition at line 1470 of file AlgorithmicReverb.h.

◆ kShadowHF

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kShadowHF = 0.5
staticconstexprprotected

high-frequency gain of a shadowed (far-ear) tap

Definition at line 1494 of file AlgorithmicReverb.h.

◆ kShadowHz

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kShadowHz = 1000.0
staticconstexprprotected

head-shadow corner of the early taps

Definition at line 1493 of file AlgorithmicReverb.h.

◆ kShimmerFeed

template<FloatType T>
constexpr T dspark::AlgorithmicReverb< T >::kShimmerFeed = T(0.08)
staticconstexprprotected

Share of the shimmer fed back at full amount.

Definition at line 1484 of file AlgorithmicReverb.h.

◆ kShimmerMaxMs

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kShimmerMaxMs = 60.0
staticconstexprprotected

Longest window of the shimmer's heads.

Definition at line 1483 of file AlgorithmicReverb.h.

◆ kShimmerMinMs

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kShimmerMinMs = 30.0
staticconstexprprotected

Shortest window of the shimmer's heads.

Definition at line 1482 of file AlgorithmicReverb.h.

◆ kSizeFadeOver

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kSizeFadeOver = 0.002
staticconstexprprotected

a length change beyond this share cross-fades two read heads

Definition at line 1508 of file AlgorithmicReverb.h.

◆ kSizeFadeSeconds

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kSizeFadeSeconds = 0.25
staticconstexprprotected

the cross-fade of the two read heads

Definition at line 1509 of file AlgorithmicReverb.h.

◆ kSoftLimit

template<FloatType T>
constexpr T dspark::AlgorithmicReverb< T >::kSoftLimit = T(2)
staticconstexprprotected

in-loop safety limiter threshold

Definition at line 1525 of file AlgorithmicReverb.h.

◆ kSoundSpeed

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kSoundSpeed = 343.2
staticconstexprprotected

Speed of sound at 20 degrees C (m/s), the frequency the air's loss is set at and the largest b the taps carry (its Poisson tail past the taps under 1e-4).

Definition at line 3926 of file AlgorithmicReverb.h.

◆ kSpringCutHz

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kSpringCutHz = 4400.0
staticconstexprprotected

dispersion band edge (transition frequency)

Definition at line 1619 of file AlgorithmicReverb.h.

◆ kSpringJitterMs

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kSpringJitterMs = 3.0
staticconstexprprotected

delay jitter at modulation 1

Definition at line 1612 of file AlgorithmicReverb.h.

◆ kSpringOutGain

template<FloatType T>
constexpr T dspark::AlgorithmicReverb< T >::kSpringOutGain = T(2)
staticconstexprprotected

Definition at line 1620 of file AlgorithmicReverb.h.

◆ kSprings

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kSprings = 12
staticconstexprprotected

Definition at line 1608 of file AlgorithmicReverb.h.

◆ kSpringStages

template<FloatType T>
constexpr int dspark::AlgorithmicReverb< T >::kSpringStages = 72
staticconstexprprotected

dispersion allpasses per spring (Full)

Definition at line 1610 of file AlgorithmicReverb.h.

◆ kSubsonicHz

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kSubsonicHz = 20.0
staticconstexprprotected

wet-output high-pass (2nd order): no room rings below it

Definition at line 1510 of file AlgorithmicReverb.h.

◆ kWetCalibration

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kWetCalibration = 4.73
staticconstexprprotected

The wet signal's level at full mix against the dry one (see updateDecayParams()): measured on pink noise, the types with a delay network land within 0.7 dB of the dry level at their presets, the spring with its own constant (its loops disperse).

Definition at line 1534 of file AlgorithmicReverb.h.

◆ kWetCalibrationSpring

template<FloatType T>
constexpr double dspark::AlgorithmicReverb< T >::kWetCalibrationSpring = 2.85
staticconstexprprotected

Definition at line 1535 of file AlgorithmicReverb.h.

◆ lastLateMono_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::lastLateMono_ = T(0)
protected

Definition at line 2203 of file AlgorithmicReverb.h.

◆ lateCur_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::lateCur_ = T(1)
protected

Definition at line 2078 of file AlgorithmicReverb.h.

◆ lateLevel_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::lateLevel_ { T(1) }
protected

Definition at line 2103 of file AlgorithmicReverb.h.

◆ layout_

template<FloatType T>
std::atomic<int> dspark::AlgorithmicReverb< T >::layout_ { 0 }
protected

Definition at line 2171 of file AlgorithmicReverb.h.

◆ lenCur_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::lenCur_ {}
protected

gliding length

Definition at line 1990 of file AlgorithmicReverb.h.

◆ lenNew_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::lenNew_ {}
protected

Definition at line 1997 of file AlgorithmicReverb.h.

◆ lenTarget_

template<FloatType T>
std::array<int, kMaxLines> dspark::AlgorithmicReverb< T >::lenTarget_ {}
protected

prime line lengths (samples)

Definition at line 1989 of file AlgorithmicReverb.h.

◆ levelGr_

template<FloatType T>
double dspark::AlgorithmicReverb< T >::levelGr_ = 0.0
protected

Definition at line 2193 of file AlgorithmicReverb.h.

◆ levelHold_

template<FloatType T>
int dspark::AlgorithmicReverb< T >::levelHold_ = 0
protected

Definition at line 2194 of file AlgorithmicReverb.h.

◆ levelHoldSamples_

template<FloatType T>
int dspark::AlgorithmicReverb< T >::levelHoldSamples_ = 0
protected

Tank leveling: hold left and its length.

Definition at line 2194 of file AlgorithmicReverb.h.

◆ levelRelease_

template<FloatType T>
double dspark::AlgorithmicReverb< T >::levelRelease_ = 0.0
protected

Tank leveling: the reduction (dB) and its release.

Definition at line 2193 of file AlgorithmicReverb.h.

◆ lfo_

template<FloatType T>
std::array<SmoothRandomLFO, kMaxLines> dspark::AlgorithmicReverb< T >::lfo_
protected

Definition at line 2005 of file AlgorithmicReverb.h.

◆ lines_

template<FloatType T>
DelayBank dspark::AlgorithmicReverb< T >::lines_
protected

Definition at line 1988 of file AlgorithmicReverb.h.

◆ loopAP_

template<FloatType T>
DelayBank dspark::AlgorithmicReverb< T >::loopAP_
protected

Definition at line 2032 of file AlgorithmicReverb.h.

◆ loopAPCoeff_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::loopAPCoeff_ = T(0.4)
protected

Definition at line 2036 of file AlgorithmicReverb.h.

◆ loopAPCoeffTarget_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::loopAPCoeffTarget_ = T(0.4)
protected

Definition at line 2037 of file AlgorithmicReverb.h.

◆ loopAPCur_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::loopAPCur_ {}
protected

gliding lengths after a size change

Definition at line 2034 of file AlgorithmicReverb.h.

◆ loopAPFrom_

template<FloatType T>
std::array<int, kMaxLines> dspark::AlgorithmicReverb< T >::loopAPFrom_ {}
protected

Definition at line 1998 of file AlgorithmicReverb.h.

◆ loopAPGliding_

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::loopAPGliding_ = false
protected

Definition at line 2035 of file AlgorithmicReverb.h.

◆ loopAPLen_

template<FloatType T>
std::array<int, kMaxLines> dspark::AlgorithmicReverb< T >::loopAPLen_ {}
protected

in-loop allpass target lengths

Definition at line 2033 of file AlgorithmicReverb.h.

◆ loopAPTo_

template<FloatType T>
std::array<int, kMaxLines> dspark::AlgorithmicReverb< T >::loopAPTo_ {}
protected

Definition at line 1998 of file AlgorithmicReverb.h.

◆ maxGlideStep_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::maxGlideStep_ = T(0)
protected

Definition at line 2015 of file AlgorithmicReverb.h.

◆ maxReadPos_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::maxReadPos_ = T(8)
protected

Definition at line 2016 of file AlgorithmicReverb.h.

◆ meanLoopSec_

template<FloatType T>
double dspark::AlgorithmicReverb< T >::meanLoopSec_ = 0.1
protected

mean FDN round trip (s), for the early/late energy match

Definition at line 1983 of file AlgorithmicReverb.h.

◆ mix_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::mix_ { T(0.3) }
protected

Definition at line 2101 of file AlgorithmicReverb.h.

◆ mixer_

template<FloatType T>
DryWetMixer<T> dspark::AlgorithmicReverb< T >::mixer_
protected

Definition at line 2081 of file AlgorithmicReverb.h.

◆ modDepth_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::modDepth_ { T(0.1) }
protected

Definition at line 2097 of file AlgorithmicReverb.h.

◆ modDepthSamples_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::modDepthSamples_ = T(0)
protected

Definition at line 2013 of file AlgorithmicReverb.h.

◆ modRate_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::modRate_ { T(1) }
protected

Definition at line 2098 of file AlgorithmicReverb.h.

◆ modStyle_

template<FloatType T>
std::atomic<int> dspark::AlgorithmicReverb< T >::modStyle_ { 0 }
protected

Definition at line 2171 of file AlgorithmicReverb.h.

◆ nLines_

template<FloatType T>
int dspark::AlgorithmicReverb< T >::nLines_ = kMaxLines
protected

Definition at line 1953 of file AlgorithmicReverb.h.

◆ numERSlots_

template<FloatType T>
int dspark::AlgorithmicReverb< T >::numERSlots_ = 0
protected

tap slots per output side (see kMaxERSlots)

Definition at line 1971 of file AlgorithmicReverb.h.

◆ numERTaps_

template<FloatType T>
int dspark::AlgorithmicReverb< T >::numERTaps_ = 0
protected

reflections per output side

Definition at line 1970 of file AlgorithmicReverb.h.

◆ outAP_

template<FloatType T>
std::array<std::array<Line, kOutStages>, 2> dspark::AlgorithmicReverb< T >::outAP_
protected

late-field output diffusers

Definition at line 1963 of file AlgorithmicReverb.h.

◆ outAPCoeff_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::outAPCoeff_ = T(0.5)
protected

Definition at line 1965 of file AlgorithmicReverb.h.

◆ outAPCoeffTarget_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::outAPCoeffTarget_ = T(0.5)
protected

Definition at line 1966 of file AlgorithmicReverb.h.

◆ outAPLen_

template<FloatType T>
std::array<std::array<int, kOutStages>, 2> dspark::AlgorithmicReverb< T >::outAPLen_ {}
protected

Definition at line 1964 of file AlgorithmicReverb.h.

◆ outSignL_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::outSignL_ {}
protected

Definition at line 2004 of file AlgorithmicReverb.h.

◆ outSignR_

template<FloatType T>
std::array<T, kMaxLines> dspark::AlgorithmicReverb< T >::outSignR_ {}
protected

Definition at line 2004 of file AlgorithmicReverb.h.

◆ paramsDirty_

template<FloatType T>
std::atomic<bool> dspark::AlgorithmicReverb< T >::paramsDirty_ { false }
protected

Definition at line 2118 of file AlgorithmicReverb.h.

◆ plate_

template<FloatType T>
PlateTank dspark::AlgorithmicReverb< T >::plate_
protected

Definition at line 1799 of file AlgorithmicReverb.h.

◆ plateTank_

template<FloatType T>
std::atomic<bool> dspark::AlgorithmicReverb< T >::plateTank_ { false }
protected

Definition at line 1800 of file AlgorithmicReverb.h.

◆ pos2_

template<FloatType T>
std::array<double, kMaxLines> dspark::AlgorithmicReverb< T >::pos2_ {}
protected

Definition at line 1996 of file AlgorithmicReverb.h.

◆ pos_

template<FloatType T>
std::array<double, kMaxLines> dspark::AlgorithmicReverb< T >::pos_ {}
protected

current read position

Definition at line 1993 of file AlgorithmicReverb.h.

◆ posInc2_

template<FloatType T>
std::array<double, kMaxLines> dspark::AlgorithmicReverb< T >::posInc2_ {}
protected

Definition at line 1996 of file AlgorithmicReverb.h.

◆ posInc_

template<FloatType T>
std::array<double, kMaxLines> dspark::AlgorithmicReverb< T >::posInc_ {}
protected

per-sample ramp

Definition at line 1994 of file AlgorithmicReverb.h.

◆ postEq_

template<FloatType T>
KeyEqualizer<T, 2> dspark::AlgorithmicReverb< T >::postEq_
protected

Definition at line 2173 of file AlgorithmicReverb.h.

◆ preDelay_

template<FloatType T>
std::array<Line, 2> dspark::AlgorithmicReverb< T >::preDelay_
protected

Definition at line 1957 of file AlgorithmicReverb.h.

◆ preDelayMs_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::preDelayMs_ { T(0) }
protected

Definition at line 2099 of file AlgorithmicReverb.h.

◆ preDelaySamples_

template<FloatType T>
std::atomic<int> dspark::AlgorithmicReverb< T >::preDelaySamples_ { 0 }
protected

Definition at line 2114 of file AlgorithmicReverb.h.

◆ preFeel_

template<FloatType T>
std::atomic<int> dspark::AlgorithmicReverb< T >::preFeel_ { 0 }
protected

Definition at line 2170 of file AlgorithmicReverb.h.

◆ preNote_

template<FloatType T>
std::atomic<int> dspark::AlgorithmicReverb< T >::preNote_ { 0 }
protected

Definition at line 2170 of file AlgorithmicReverb.h.

◆ prepared_

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::prepared_ = false
protected

Definition at line 1951 of file AlgorithmicReverb.h.

◆ presetDirty_

template<FloatType T>
std::atomic<bool> dspark::AlgorithmicReverb< T >::presetDirty_ { false }
protected

Definition at line 2117 of file AlgorithmicReverb.h.

◆ quality_

template<FloatType T>
std::atomic<Quality> dspark::AlgorithmicReverb< T >::quality_ { Quality::Full }
protected

Definition at line 2112 of file AlgorithmicReverb.h.

◆ qualityDirty_

template<FloatType T>
std::atomic<bool> dspark::AlgorithmicReverb< T >::qualityDirty_ { false }
protected

Definition at line 2119 of file AlgorithmicReverb.h.

◆ quietSamples_

template<FloatType T>
double dspark::AlgorithmicReverb< T >::quietSamples_ = 1e300
protected

samples since input last entered the tank

Definition at line 2186 of file AlgorithmicReverb.h.

◆ ring_

template<FloatType T>
std::array<Line, 2> dspark::AlgorithmicReverb< T >::ring_
protected

allpass-diffused input, feeds the late field

Definition at line 1962 of file AlgorithmicReverb.h.

◆ rotC_

template<FloatType T>
std::array<T, kMaxLines / 2> dspark::AlgorithmicReverb< T >::rotC_ {}
protected

Definition at line 2009 of file AlgorithmicReverb.h.

◆ rotDepth_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::rotDepth_ = T(0)
protected

Definition at line 2011 of file AlgorithmicReverb.h.

◆ rotLfo_

template<FloatType T>
std::array<SmoothRandomLFO, kMaxLines / 2> dspark::AlgorithmicReverb< T >::rotLfo_
protected

Definition at line 2008 of file AlgorithmicReverb.h.

◆ rotS_

template<FloatType T>
std::array<T, kMaxLines / 2> dspark::AlgorithmicReverb< T >::rotS_ {}
protected

Definition at line 2010 of file AlgorithmicReverb.h.

◆ rotTick_

template<FloatType T>
unsigned dspark::AlgorithmicReverb< T >::rotTick_ = 0
protected

Definition at line 2012 of file AlgorithmicReverb.h.

◆ seg_

template<FloatType T>
std::array<SegmentLfo, kMaxLines> dspark::AlgorithmicReverb< T >::seg_ {}
protected

Definition at line 2197 of file AlgorithmicReverb.h.

◆ shadowCoeff_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::shadowCoeff_ = T(0)
protected

Definition at line 1985 of file AlgorithmicReverb.h.

◆ shimBuf_

template<FloatType T>
std::vector<T> dspark::AlgorithmicReverb< T >::shimBuf_
protected

Definition at line 2198 of file AlgorithmicReverb.h.

◆ shimLen_

template<FloatType T>
std::array<double, 2> dspark::AlgorithmicReverb< T >::shimLen_ { 0.045, 0.045 }
protected

Definition at line 2201 of file AlgorithmicReverb.h.

◆ shimMask_

template<FloatType T>
int dspark::AlgorithmicReverb< T >::shimMask_ = 0
protected

Definition at line 2199 of file AlgorithmicReverb.h.

◆ shimmer_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::shimmer_ { T(0) }
protected

Definition at line 2169 of file AlgorithmicReverb.h.

◆ shimPhase_

template<FloatType T>
std::array<double, 2> dspark::AlgorithmicReverb< T >::shimPhase_ { 0.0, 0.5 }
protected

Definition at line 2200 of file AlgorithmicReverb.h.

◆ shimRng_

template<FloatType T>
uint32_t dspark::AlgorithmicReverb< T >::shimRng_ = 0x51ED27u
protected

Definition at line 2202 of file AlgorithmicReverb.h.

◆ shimW_

template<FloatType T>
int dspark::AlgorithmicReverb< T >::shimW_ = 0
protected

Definition at line 2199 of file AlgorithmicReverb.h.

◆ size_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::size_ { T(0.5) }
protected

Definition at line 2094 of file AlgorithmicReverb.h.

◆ sizeFade_

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::sizeFade_ = false
protected

Definition at line 2000 of file AlgorithmicReverb.h.

◆ slope2_

template<FloatType T>
SecondSlope dspark::AlgorithmicReverb< T >::slope2_
protected

Definition at line 1803 of file AlgorithmicReverb.h.

◆ sourceDepth_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::sourceDepth_ { T(0) }
protected

Definition at line 2168 of file AlgorithmicReverb.h.

◆ spec_

template<FloatType T>
AudioSpec dspark::AlgorithmicReverb< T >::spec_ {}
protected

Definition at line 1950 of file AlgorithmicReverb.h.

◆ spring_

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::spring_ = false
protected

Definition at line 2021 of file AlgorithmicReverb.h.

◆ springA_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::springA_ = T(0.5)
protected

Definition at line 2027 of file AlgorithmicReverb.h.

◆ springHist_

template<FloatType T>
std::vector<T> dspark::AlgorithmicReverb< T >::springHist_
protected

Definition at line 2022 of file AlgorithmicReverb.h.

◆ springK_

template<FloatType T>
int dspark::AlgorithmicReverb< T >::springK_ = 5
protected

Definition at line 2025 of file AlgorithmicReverb.h.

◆ springLP_

template<FloatType T>
std::array<std::array<T, 5>, 2> dspark::AlgorithmicReverb< T >::springLP_ {}
protected

b0 b1 b2 a1 a2, two sections

Definition at line 2028 of file AlgorithmicReverb.h.

◆ springLPState_

template<FloatType T>
std::array<std::array<T, kSprings>, 4> dspark::AlgorithmicReverb< T >::springLPState_ {}
protected

[section * 2 + state][spring]

Definition at line 2029 of file AlgorithmicReverb.h.

◆ springP_

template<FloatType T>
int dspark::AlgorithmicReverb< T >::springP_ = 8
protected

Definition at line 2023 of file AlgorithmicReverb.h.

◆ springStages_

template<FloatType T>
int dspark::AlgorithmicReverb< T >::springStages_ = kSpringStages
protected

Definition at line 2026 of file AlgorithmicReverb.h.

◆ springW_

template<FloatType T>
int dspark::AlgorithmicReverb< T >::springW_ = 0
protected

Definition at line 2024 of file AlgorithmicReverb.h.

◆ subsonicFilter_

template<FloatType T>
Biquad<T, 2> dspark::AlgorithmicReverb< T >::subsonicFilter_
protected

Definition at line 2063 of file AlgorithmicReverb.h.

◆ tail_

template<FloatType T>
TailShaper<T> dspark::AlgorithmicReverb< T >::tail_
protected

Definition at line 2172 of file AlgorithmicReverb.h.

◆ tailHold_

template<FloatType T>
std::atomic<bool> dspark::AlgorithmicReverb< T >::tailHold_ { false }
protected

Definition at line 2167 of file AlgorithmicReverb.h.

◆ tankEmptyAfter_

template<FloatType T>
double dspark::AlgorithmicReverb< T >::tankEmptyAfter_ = 0.0
protected

quiet samples after which the tank is under -120 dB

Definition at line 2187 of file AlgorithmicReverb.h.

◆ tankLeveling_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::tankLeveling_ { T(0) }
protected

Definition at line 2168 of file AlgorithmicReverb.h.

◆ tankSat_

template<FloatType T>
std::atomic<bool> dspark::AlgorithmicReverb< T >::tankSat_ { false }
protected

Definition at line 2167 of file AlgorithmicReverb.h.

◆ tempo_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::tempo_ { T(120) }
protected

Definition at line 2168 of file AlgorithmicReverb.h.

◆ toneDirty_

template<FloatType T>
std::atomic<bool> dspark::AlgorithmicReverb< T >::toneDirty_ { false }
protected

Definition at line 2120 of file AlgorithmicReverb.h.

◆ toneHighCutHz_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::toneHighCutHz_ { T(-1) }
protected

Definition at line 2122 of file AlgorithmicReverb.h.

◆ toneHPActive_

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::toneHPActive_ = false
protected

Definition at line 2069 of file AlgorithmicReverb.h.

◆ toneHPBiquad_

template<FloatType T>
Biquad<T, 2> dspark::AlgorithmicReverb< T >::toneHPBiquad_
protected

Definition at line 2067 of file AlgorithmicReverb.h.

◆ toneHPCurHz_

template<FloatType T>
double dspark::AlgorithmicReverb< T >::toneHPCurHz_ = 0.0
protected

Definition at line 2073 of file AlgorithmicReverb.h.

◆ toneHPMix_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::toneHPMix_ = T(0)
protected

share of the filtered signal

Definition at line 2075 of file AlgorithmicReverb.h.

◆ toneHPOn_

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::toneHPOn_ = false
protected

Definition at line 2074 of file AlgorithmicReverb.h.

◆ toneHPTargetHz_

template<FloatType T>
double dspark::AlgorithmicReverb< T >::toneHPTargetHz_ = 0.0
protected

Definition at line 2073 of file AlgorithmicReverb.h.

◆ toneLowCutHz_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::toneLowCutHz_ { T(-1) }
protected

Definition at line 2121 of file AlgorithmicReverb.h.

◆ toneLPActive_

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::toneLPActive_ = false
protected

filter running (on, or still fading out)

Definition at line 2068 of file AlgorithmicReverb.h.

◆ toneLPBiquad_

template<FloatType T>
Biquad<T, 2> dspark::AlgorithmicReverb< T >::toneLPBiquad_
protected

Definition at line 2066 of file AlgorithmicReverb.h.

◆ toneLPCurHz_

template<FloatType T>
double dspark::AlgorithmicReverb< T >::toneLPCurHz_ = 0.0
protected

Definition at line 2072 of file AlgorithmicReverb.h.

◆ toneLPMix_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::toneLPMix_ = T(0)
protected

Definition at line 2075 of file AlgorithmicReverb.h.

◆ toneLPOn_

template<FloatType T>
bool dspark::AlgorithmicReverb< T >::toneLPOn_ = false
protected

Definition at line 2074 of file AlgorithmicReverb.h.

◆ toneLPTargetHz_

template<FloatType T>
double dspark::AlgorithmicReverb< T >::toneLPTargetHz_ = 0.0
protected

Definition at line 2072 of file AlgorithmicReverb.h.

◆ type_

template<FloatType T>
std::atomic<Type> dspark::AlgorithmicReverb< T >::type_ { Type::Room }
protected

Definition at line 2092 of file AlgorithmicReverb.h.

◆ userParamMask_

template<FloatType T>
std::atomic<uint32_t> dspark::AlgorithmicReverb< T >::userParamMask_ { 0u }
protected

Definition at line 2136 of file AlgorithmicReverb.h.

◆ wall_

template<FloatType T>
Wall dspark::AlgorithmicReverb< T >::wall_
protected

Definition at line 1763 of file AlgorithmicReverb.h.

◆ wetLevel_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::wetLevel_ = T(1)
protected

the wet signal's level against the decay (see updateDecayParams())

Definition at line 1984 of file AlgorithmicReverb.h.

◆ width_

template<FloatType T>
std::atomic<T> dspark::AlgorithmicReverb< T >::width_ { T(1) }
protected

Definition at line 2104 of file AlgorithmicReverb.h.

◆ widthCur_

template<FloatType T>
T dspark::AlgorithmicReverb< T >::widthCur_ = T(1)
protected

Definition at line 2078 of file AlgorithmicReverb.h.

◆ widthLaw_

template<FloatType T>
std::atomic<int> dspark::AlgorithmicReverb< T >::widthLaw_ { 0 }
protected

Definition at line 2171 of file AlgorithmicReverb.h.


The documentation for this class was generated from the following file: