Kaynağa Gözat

Merge remote-tracking branch 'origin/parity190it' into parity190jh

# Conflicts:
#	docs/PARITY.md
#	src/core/Effects.cpp
#	tests/tests.cpp
Ka1-S 2 hafta önce
ebeveyn
işleme
dc67f6f9ec

+ 55 - 0
docs/PARITY.md

@@ -3742,3 +3742,58 @@ identical. CPU (48 kHz, 20 s, blocks of 512, best of 5; three voicings at Satura
 make-up is a block constant, the lag a 32-sample ring.
 Latency unchanged (0). Not done: EchoBoy's LowCut / HighCut law (unmeasured), Jr's own styles, PrimalTap's algorithms /
 VCO / feedback-path droop, the PrimalTap family's dry-path dip above 8 kHz.
+
+## Round 190it: the reverb stand-ins' 0.1.30 revision (refcap030's captures, LYNX's own translators)
+
+Round 190iq turned refcap030 (black-box captures of the third-party references, round 190hv) into a parity bank: every
+render whose setting has a saved state is rendered by LYNX through the same translator a project uses and scored with
+`scripts/fxparity.py` (0–10). This round measured what differs on the reverb rows and changed the DSP and the
+translators one measured step at a time (lab and evidence: `/mnt/e/lynx-work/parity190it/`).
+
+Every change sits behind a **hidden revision** (no control, no string, saved while non-zero, as Hush's timing in
+round 190iq): `verbs::epoch / atrium / foil / halo::revision` (one past the Law), `echosuite::lattice::revision`, and
+LuxeVerb's Space-engine Ducking (`luxeVerbSpaceDucking`, 0 unless the Pro-R 2 translator sets it). A new instance and a
+translated state run revision 1; a project or preset saved before loads 0 and renders bit for bit as the base commit
+(63 / 63 renders at 44.1 / 48 / 96 kHz, `gold/`; fingerprints in `tests/Parity190itTests.inc`). Live's Reverb → Atrium
+map (round 190cz, measured on the 0.1.27 law) keeps revision 0.
+
+| What was measured | What changed (revision 1) |
+|---|---|
+| Atrium / Epoch / Halo's tail is lumpy: the 40 Hz-smoothed spectrum of the tail varies ±3.3 dB (the references ±0.9 … 1.1). The build-up taps — one random-sign 40-tap FIR feeding every line — leave their ripple on the whole tail, so a steady 1 kHz tone (the staircase of the test signal) met a dip 6 … 11 dB deep where the reference meets its mean gain | Above 600 Hz the build-up taps reach the tank as four interleaved groups through a 4-point Hadamard (four independent FIRs: ripple ±1.9 … 2.1 dB); below, one sum as before (there the tank's few modes set the tone, and the long-decay music renders stayed where they were: 250 / 400 / 600 / 800 Hz tried). Atrium and Halo; Epoch measured no gain from it and keeps one FIR |
+| Halo's Dark colour: against Bright the reference keeps its RT at every octave (8.4 / 7.8 s at 4 / 8 kHz) and falls −3 / −6.6 / −11.7 dB at 4 / 8 / 16 kHz and −5 … −8 dB below 50 Hz; ours was a 5 kHz low-pass in the loop (RT 2.2 s at 4 … 8 kHz, −2 dB). Its colour turns Dark between 0.479 and 0.521 (the translator stepped at 0.525) | Dark = an output tone (high shelf −13 dB at 6.5 kHz, low shelf −6 dB at 70 Hz), the loop untouched; the translator's step at 0.5 |
+| Halo's level: music and test signal 2.6 dB over the reference at the capture's base, the impulse on it; at 20 / 50 % diffusion ours 2.5 dB over its own level at 80 % (the reference not); RT per reverb mode ×1.13 / ×0.75 / ×1.0 / ×2.85 the reference's (Mono / Small / Medium / Big stereo) | Half the low-diffusion lift, −0.5 dB overall (−1 dB scored higher here but cost tp172d's impulses a step), the RT per mode matched with the impulse's energy kept (gain × 1/√ratio) |
+| Atrium per type, Foil Plate per type, Epoch per mode at the sweep's base setting: wet level and octave balance against the reference's impulse | Trims (level + the tone corrector's eight bands, 3-point smoothed) for the types / modes only the sweep holds; the types every other capture uses (Atrium's Large and Bright Room, Foil's Silver and Pewter, Epoch's Concert Hall) keep their 0.1.27 voicing, since their sweep trim cost a step on refcap182 / tp172d. Epoch's (measured at Decay 0.51 s; its Room mode needs none at 1.41 s, refcap182 S2) fade out between those two decays |
+| Lattice Mod: from the type's 8th step the reference's low end was 20 … 30 dB under ours (8 / 16 taps summed into the loop: a loop gain of √N × the feedback below 200 Hz); past its tenth step (0.4375 …) the reference plays the dry signal alone, at unity (its impulse: the dry click, no wet) | The loop hears the longest tap at the feedback's own gain (through its own copy of the tap filters; the summed loop / √N was tried: 4.77 against 4.88); the values past the tenth step play the dry signal |
+| Pro-R 2's Ducking (state value 8, dB 0 … 48) was not translated: with it on, ours was 4 … 25 dB over | The Space engine dips its wet part by 0.71 × the setting (dB) while the input plays (detector 1 / 5 ms, keyed from −50 … −40 dBFS; the dip in 10 ms, back with τ = 115 ms in dB), measured on a −6 dB RMS noise burst at 0 / 25 / 50 / 75 / 100 % |
+
+**Scores** (refcap030 bank, files; before → after; files up / down):
+
+| Reference → stand-in | files | before → after | up / down | blocks |
+|---|---|---|---|---|
+| ValhallaUberMod → Lattice Mod | 172 | 3.20 → **4.88** | 42 / 1 | mode 2.80 → 5.62, pairs 3.47 → 3.97, sr48 / sr96 = |
+| ValhallaShimmer → Halo | 194 | 3.04 → **3.61** | 87 / 0 | mode 3.03 → 3.65, pairs 2.39 → 3.17, sr48 3.44 → 3.75, sr96 3.50 → 3.69 |
+| ValhallaRoom → Atrium | 116 | 3.28 → **3.63** | 27 / 0 | mode 2.50 → 3.31, pairs 4.22 =, sr48 3.44 =, sr96 3.38 → 3.44 |
+| ValhallaPlate → Foil Plate | 124 | 3.60 → **3.74** | 16 / 0 | mode 3.19 → 3.54, the rest = |
+| ValhallaVintageVerb → Epoch Verb | 154 | 2.49 → **2.67** | 21 / 3 | mode 1.86 → 2.16, the rest = |
+| FabFilter Pro-R 2 → LuxeVerb | 323 | 3.25 → **3.30** | 11 / 1 | grid2 2.70 → 2.81 (Ducking), the rest = |
+| Little Plate → Foil Plate | 90 | 3.57 → 3.57 | 0 / 0 | (the measured plate voicing: no change) |
+
+The other banks of these stand-ins (`lab/gate2.py`: tp172d matched settings, verb183b's captures, refcap182's programme,
+tp172b): equal or up everywhere except two files — Halo's tp172d S1 drums 3 → 2 (its spectrum was already 3.9 dB off:
+the block 3.50 → 3.42) and one of verb183b's −20 dB impulses (Halo 3.21 → 3.37 on that bank); Atrium's refcap182 S2 bass
+4 → 3 beside S1 guitar 3 → 4 (the block equal). Up: Halo's refcap182 programme 3.35 → 3.55, Atrium's verb183b captures
+3.82 → 3.88.
+
+**CPU** (thread time on one pinned core, 20 s at 48 kHz, blocks of 512, best of 2 × 5; base / revision 0 / revision 1,
+% of real time): Atrium Medium Room 1.72 / 1.83 / 1.94, Atrium default 2.18 / 1.96 / 2.20, Halo default 1.74 / 1.59 /
+1.96, Halo Big stereo Dark 1.80 / 1.63 / 1.98, Epoch Room 2.37 / 2.18 / 2.08, Foil Bismuth 1.33 / 1.17 / 1.31, Lattice
+default 0.73 / 0.66 / 0.71, Lattice 16 taps 6.68 / 6.74 / 6.65, LuxeVerb Space with Ducking 50 % 4.83 / 4.83 / 5.16.
+Revision 0 is the base (within the machine's ±10 %); revision 1 costs Halo ≈ +0.2 point of one core (the build groups'
+eight one-poles and the four-way injection), the Ducking +0.3 point when it is on. Latency unchanged (none).
+
+**Still off**: Epoch Verb's mode sweep (most algorithms 5 … 9 dB under the reference at Decay 0.51 s before the trims:
+one setting per mode, so the trims stay limited to that decay); Pro-R 2 at Space 0 (6 … 11 dB under) and with a
+left-only input (the Stereo Width grid: −2 … −12 dB), Pro-R 2 Brightness at its ends (+4 … +8 dB); Halo's Feedback 80 %
+(highs −3 dB, lows +5 … +9 dB on music); Little Plate at 44.1 kHz (the reference is ~1.5 dB quieter there than at 48 kHz:
+a reference quirk). The waveform score saturates near 4 on reverb rows (ESR cannot null a second reverb): the steps
+above are spectrum (≤ 2.5 dB) and level (≤ 1.5 dB) moving files from 1 … 3 to 4.

+ 1 - 0
src/core/AlsDevices.cpp

@@ -531,6 +531,7 @@ bool reverbToAtrium (const Element& device, EffectSlot& slot, Notes& notes)
         return false;
     slot = makeEffectSlot (EffectKind::atrium);
     auto& p = slot.params;
+    p[(std::size_t) verbs::atrium::revision] = 0.0f; // round 190it: this map was measured on the 0.1.27 law (round 190cz)
     p[0] = unit (manual (device, "MixDirect", 0.55));                      // Dry/Wet
     p[1] = linValue (manual (device, "PreDelay", 2.5), 0.0, 500.0);        // ms [DATA: 0.5 … 250]
     // Decay [DATA: 200 … 60000 ms; MEASURED 190cz r00–r04: Live's 1 kHz T30 ≈ 0.91 × the setting] → Atrium's decay

+ 39 - 5
src/core/EchoSuite.cpp

@@ -2851,6 +2851,16 @@ double tapLevel (const EffectParams& p, int tap, int taps) noexcept
 
 namespace
 {
+// round 190it: what feeds the loop in revision 1 (0 = the longest tap; the lab build can try 1 = the sum / √taps)
+int latticeFeedMode() noexcept
+{
+   #ifdef LYNX_VERB_FIT
+    static const int m = [] { const char* e = std::getenv ("LYNX_LAT"); return e != nullptr ? std::atoi (e) : 0; }();
+    return m;
+   #else
+    return 0;
+   #endif
+}
 
 class LatticeMod final : public Effect
 {
@@ -2883,7 +2893,10 @@ public:
             c.hi.reset();
             c.dark.reset();
             c.xover.reset();
-            c.fb = 0.0f;
+            c.fbLo.reset();
+            c.fbHi.reset();
+            c.fbDark.reset();
+            c.fb = c.longest = c.fbSrc = 0.0f;
         }
         vibPhase = 0.0;
         tapsLive = false;
@@ -2896,6 +2909,11 @@ public:
         float dryGain = 1.0f, wetGain = 0.0f;
         equalPowerMix (p[mix], dryGain, wetGain);
         const auto nTaps = tapCount (p[lattice::taps]);
+        // round 190it: revision 1 (see lattice::revision)
+        const auto rev1 = p[lattice::revision] >= 0.5f;
+        const auto longestFeeds = rev1 && latticeFeedMode() == 0;
+        if (rev1 && (int) std::floor (clamp01 (p[lattice::taps]) * 24.0f + 1e-4f) >= 10)
+            dryGain = 1.0f, wetGain = 0.0f;
         const auto half = on (p[halfSpeed]);
         const auto syncMs = syncedDelayMs (p, bpm); // round 144: the reference's DelaySync law, else the older one
         const auto delayScale = syncMs > 0.0 && delayMs (p[delay]) > 0.0 ? syncMs / delayMs (p[delay]) : 1.0;
@@ -2947,6 +2965,9 @@ public:
             else
                 c.dark.open();
             c.xover.set (10.0 + 1990.0 * (double) clamp01 (p[xover]), sr);
+            c.fbLo.a = c.lo.a; // (coefficients only: each keeps its own state)
+            c.fbHi.a = c.hi.a;
+            c.fbDark.a = c.dark.a;
         }
         const auto driveFn = [inGain, outGain] (float x) { return outGain * std::tanh (inGain * x); };
 
@@ -2985,17 +3006,29 @@ public:
                     const auto det = detuneAmp > 0.0 ? detK * detuneAmp * (double) s.detune[(std::size_t) k].next (detuneHz, sr) / 2.1 : 0.0;
                     const auto vib = vibAmp > 0.0 ? vibAmp * std::sin (twoPi * (vibPhase + (double) k / (double) nTaps)) : 0.0;
                     const auto d = tapNow[(std::size_t) c][(std::size_t) k] + std::abs (det) + vibAmp + sign * (det + vib) * 0.5;
-                    y += gains[(std::size_t) k] * (double) s.line.at (std::max (2.0, d));
+                    const auto at = (double) s.line.at (std::max (2.0, d));
+                    y += gains[(std::size_t) k] * at;
+                    if (k == 0)
+                        s.longest = (float) at;
                 }
                 auto v = (float) y;
                 v = s.dark.lp (s.hi.lp (s.lo.hp (v)));
+                if (longestFeeds) // round 190it: the loop hears the longest tap, through the same filters
+                    s.fbSrc = s.fbDark.lp (s.fbHi.lp (s.fbLo.hp (s.longest)));
+                else if (rev1)
+                    s.fbSrc = v * (float) (1.0 / std::sqrt ((double) std::max (1, nTaps)));
                 if (useDrive && post)
+                {
                     v = driveFn (v) + noiseLevel * s.noise.next();
+                    if (longestFeeds)
+                        s.fbSrc = driveFn (s.fbSrc); // (the drive after the taps is in the loop as before)
+                }
                 wet[c] = v;
             }
             // feedback, rotated between the channels
-            const auto fl = cr * wet[0] - sn * wet[1];
-            const auto fr = sn * wet[0] + cr * wet[1];
+            const float fw[2] = { rev1 ? ch[0].fbSrc : wet[0], rev1 ? ch[1].fbSrc : wet[1] };
+            const auto fl = cr * fw[0] - sn * fw[1];
+            const auto fr = sn * fw[0] + cr * fw[1];
             const float fbv[2] = { fl, fr };
             for (int c = 0; c < 2; ++c)
             {
@@ -3029,7 +3062,8 @@ private:
         RandomLfo diffLfo;
         Noise noise;
         OnePole lo, hi, dark, xover;
-        float fb = 0.0f;
+        OnePole fbLo, fbHi, fbDark; // round 190it: the longest tap's own filters (the loop's source in revision 1)
+        float fb = 0.0f, longest = 0.0f, fbSrc = 0.0f;
     };
     double sr = 48000.0;
     std::array<Channel, 2> ch;

+ 6 - 1
src/core/EchoSuite.h

@@ -290,7 +290,12 @@ enum Param
                // floor (17 v): 0–1 free, 2–7 1/16 … 2/1, 8–12 1/16. … 1/1., 13–17 1/16T … 1/1T; the synced delay is capped
                // at 2750 ms. Free (0, the default) leaves the older `sync` law in charge
     law, // round 190do (appended): 0 = the classic detune depth (projects saved before), 1 = the measured one
-    paramCount
+    paramCount,
+    // round 190it, hidden (not in the info: no control, no text; saved while non-zero): revision 1 of the tap network,
+    // measured on refcap030's type sweep of the reference: the loop is fed by the longest tap at the feedback's own gain
+    // (the sum of 8 / 16 taps fed back piled up 20 … 30 dB below 200 Hz), and the type values past the tenth step play
+    // the dry signal alone, at unity. A new Lattice Mod and a translated state get 1; projects saved before keep 0
+    revision = paramCount
 };
 int inputPanOf (float v) noexcept;  // 0 … 8
 int delaySyncIndex (float v) noexcept;      // 0 … 17 (round 144)

+ 22 - 0
src/core/Effects.cpp

@@ -4353,6 +4353,13 @@ EffectSlot makeEffectSlot (EffectKind kind)
         slot.params[(std::size_t) mixsuite::hush::timing] = 1.0f;
     if (kind == EffectKind::echoform) // round 190is: a new Echoform runs the echo voicings' revision 1 (hidden parameter)
         slot.params[(std::size_t) echosuite::echoform::revision] = 1.0f;
+    // round 190it: a new Epoch Verb / Atrium / Foil Plate / Halo runs the 0.1.30 revision of the Measured law (hidden)
+    if (kind == EffectKind::epochVerb) slot.params[(std::size_t) verbs::epoch::revision] = 1.0f;
+    if (kind == EffectKind::atrium) slot.params[(std::size_t) verbs::atrium::revision] = 1.0f;
+    if (kind == EffectKind::foilPlate) slot.params[(std::size_t) verbs::foil::revision] = 1.0f;
+    if (kind == EffectKind::halo) slot.params[(std::size_t) verbs::halo::revision] = 1.0f;
+    if (kind == EffectKind::latticeMod) // round 190it: … and a new Lattice Mod its tap network's revision 1 (hidden)
+        slot.params[(std::size_t) echosuite::lattice::revision] = 1.0f;
 
     return slot;
 }
@@ -4490,6 +4497,18 @@ void upgradeLoadedEffectParams (EffectSlot& slot, std::size_t savedCount) noexce
         }
         if (law >= 0 && savedCount <= (std::size_t) law)
             slot.params[(std::size_t) law] = 0.0f;
+        // round 190it: one saved before the 0.1.30 revision keeps the 0.1.27 Measured law, bit for bit
+        int rev = -1;
+        switch (slot.kind)
+        {
+            case EffectKind::epochVerb: rev = verbs::epoch::revision; break;
+            case EffectKind::atrium: rev = verbs::atrium::revision; break;
+            case EffectKind::foilPlate: rev = verbs::foil::revision; break;
+            case EffectKind::halo: rev = verbs::halo::revision; break;
+            default: break;
+        }
+        if (rev >= 0 && savedCount <= (std::size_t) rev)
+            slot.params[(std::size_t) rev] = 0.0f;
     }
     // round 152: a Compressor saved before the measured vintage curve keeps the round-150 curve
     if (slot.kind == EffectKind::compressor && savedCount <= 18 && slot.params.size() > 18)
@@ -4503,6 +4522,9 @@ void upgradeLoadedEffectParams (EffectSlot& slot, std::size_t savedCount) noexce
     // round 190do: a Lattice Mod saved before the measured detune depth keeps the classic one
     if (slot.kind == EffectKind::latticeMod && savedCount <= (std::size_t) echosuite::lattice::law)
         slot.params[(std::size_t) echosuite::lattice::law] = 0.0f;
+    // round 190it: … and one saved before the tap network's revision keeps the summed loop
+    if (slot.kind == EffectKind::latticeMod && savedCount <= (std::size_t) echosuite::lattice::revision)
+        slot.params[(std::size_t) echosuite::lattice::revision] = 0.0f;
     // round 190do: a Spiral Echo saved before the measured loop keeps the classic one
     if (slot.kind == EffectKind::spiralEcho && savedCount <= (std::size_t) echosuite::spiral::law)
         slot.params[(std::size_t) echosuite::spiral::law] = 0.0f;

+ 4 - 2
src/core/FabFilterStates.cpp

@@ -722,7 +722,7 @@ int fromProL2 (const State& s, EffectSlot& slot)
 // layout (FFBS v1, 136 values, observed black-box by saving the state after each control change): 0 space (the
 // knob's normalized value; 0.1286 / 0.25 / 0.5 / 0.7 / 0.8444 read 0.5 / 1 / 2.5 / 4 / 6 s), 1 decay rate
 // (log4: −0.5 = 50 %, 0.5 = 200 %), 2 distance, 3 brightness (0.5 = 0 %), 4 style (0 Modern, 1 Vintage, 2 Plate),
-// 5 character, 6 thickness (−1 … 1), 7 stereo width, 9 mix %, 16 pre-delay (normalized, 0.3333 = 20 ms: cubic over
+// 5 character, 6 thickness (−1 … 1), 7 stereo width, 8 ducking (dB, 0 … 48), 9 mix %, 16 pre-delay (normalized, 0.3333 = 20 ms: cubic over
 // 500 ms), 19 + 7b decay-rate EQ band b (used, enabled, log2 Hz, gain (log2 of the decay multiplier), Q, shape
 // (1 low shelf, 2 high shelf, others: bells), …)
 int fromProR2 (const State& s, EffectSlot& slot)
@@ -743,7 +743,9 @@ int fromProR2 (const State& s, EffectSlot& slot)
     set (width, s.at (7));
     set (mix, s.at (9) / 100.0);
     set (predelay, s.at (16));
-    int n = 11;
+    // round 190it: value 8 is Ducking in dB (0 … 48, read from states saved at 0 / 50 / 100 %: 0 / 24 / 48)
+    p[(std::size_t) luxeVerbSpaceDucking] = (float) std::clamp ((double) s.at (8) / 48.0, 0.0, 1.0);
+    int n = 12;
     for (int b = 0; b < 6; ++b)
     {
         const std::size_t o = 19 + 7 * (std::size_t) b;

+ 1 - 0
src/core/LuxeVerb.cpp

@@ -1542,6 +1542,7 @@ static spaceverb::Settings settingsOf (const EffectParams& p) noexcept
     s.lowHz = lowHz (at (lowFreq));
     s.highMult = multOf (at (highMult));
     s.highHz = highHz (at (highFreq));
+    s.ducking = p[(std::size_t) luxeVerbSpaceDucking]; // round 190it (hidden: the Pro-R 2 translator sets it)
     return s;
 }
 } // namespace luxeverb::sp

+ 3 - 0
src/core/LuxeVerb.h

@@ -26,6 +26,9 @@ constexpr int luxeVerbParamCount = luxeVerbControlCount + 4; // + sync of predel
 constexpr int luxeVerbSpaceFirst = luxeVerbParamCount;
 constexpr int luxeVerbSpaceCount = 15;
 constexpr int luxeVerbAllParamCount = luxeVerbSpaceFirst + luxeVerbSpaceCount;
+// round 190it, hidden (not in the info: no control, no text; saved while non-zero; 0 by default, so every project saved
+// before plays as it did): the Space engine's ducking, 0 … 1 = the reference's 0 … 48 dB, set by the Pro-R 2 translator
+constexpr int luxeVerbSpaceDucking = luxeVerbAllParamCount;
 
 std::unique_ptr<Effect> makeLuxeVerb();
 

+ 239 - 6
src/core/LynxVerbs.cpp

@@ -150,6 +150,18 @@ struct Shifter
 
 double clampPos (double v, double lo, double hi) noexcept { return std::isfinite (v) ? std::clamp (v, lo, hi) : lo; }
 
+// round 190it: where revision 1's build groups part (Hz; 250 / 400 / 600 / 800 tried on refcap030's room bank: 600 kept
+// the long-decay music renders where they were); the lab build reads LYNX_SPLITHZ
+double splitHz() noexcept
+{
+   #ifdef LYNX_VERB_FIT
+    static const double hz = [] { const char* e = std::getenv ("LYNX_SPLITHZ"); return e != nullptr ? std::atof (e) : 600.0; }();
+    return hz;
+   #else
+    return 600.0;
+   #endif
+}
+
 // ---- engine law 1 (0.1.27, round 190bz) ------------------------------------------------------------------------
 // Per-band decay (Jot & Chaigne 1991: one absorption filter per line whose attenuation in dB is proportional to the
 // line's length gives the same RT60 on every line; the filter here is a cascade of first-order shelves whose gains are
@@ -361,6 +373,7 @@ struct Engine::Impl
     double lfo[lineCount] {};
     Shifter shifters[4]; // inside lines 0, 2, 4, 6 (shimmer)
     float shiftHp[4][2] {}; // round tp172d: the shifted branch's two one-pole high-pass states (energy-keeping shimmer)
+    float splitLp[2][4] {};  // round 190it: the build groups' low band (one-pole states), which still reaches the lines as one sum
     Biquad outLow, outHigh, shelfLow, shelfHigh, toneHigh, toneMid, toneLow, band[maxBandSections];
     bool outLowOn = false, outHighOn = false, shelfLowOn = false, shelfHighOn = false, toneHighOn = false, toneMidOn = false, toneLowOn = false, bandOn = false;
     int bandSections = 0;
@@ -470,6 +483,9 @@ struct Engine::Impl
             sh.clear();
         for (auto& h : shiftHp)
             h[0] = h[1] = 0.0f;
+        for (auto& c : splitLp)
+            for (auto& z : c)
+                z = 0.0f;
         outLow.reset();
         outHigh.reset();
         shelfLow.reset();
@@ -822,6 +838,8 @@ struct Engine::Impl
         const auto norm = (float) (1.0 / std::sqrt ((double) lineCount));
         const auto early = (float) s.earlyLevel, late = (float) s.lateLevel, send = (float) s.earlySend;
         const auto gated = s.gateSec > 0.0, build = gated || s.buildSec > 0.0005;
+        const auto split = s.buildSplit && ! gated; // round 190it: the build-up taps in four groups (below)
+        const auto splitCoef = (float) (1.0 - std::exp (-2.0 * pi * splitHz() / sr));
         const auto crossAngle = 0.25 * pi * std::clamp (s.crossFeed, 0.0, 1.0);
         const auto crossCos0 = std::cos (crossAngle), crossSin0 = std::sin (crossAngle);
         const auto mixA = 0.25 * pi * std::clamp (s.mixAngle, 0.0, 1.0);
@@ -857,6 +875,7 @@ struct Engine::Impl
         {
             float x[2] = { L[t], R[t] };
             float e[2], d[2], pin[2];
+            float dg[2][4] {};
             for (int c = 0; c < 2; ++c)
             {
                 pre[c].write (x[c]);
@@ -884,7 +903,28 @@ struct Engine::Impl
                 for (int k = 0; k < 4; ++k)
                     if (inG[k] != 0.0f)
                         v = inAp[c][k].process (v, inG[k]);
-                if (build)
+                if (build && split)
+                {
+                    // revision 1 (round 190it): four interleaved groups of the build-up taps, each spanning the whole
+                    // build, reach the four lines of the half through a 4-point Hadamard (below) instead of one FIR
+                    // into every line: one fixed random-sign FIR left its ripple (±3 … 4 dB, 50 … 200 Hz wide) on the
+                    // whole tail; four independent ones average it out (a steady sine meets the tail's mean gain)
+                    dif[c].write (v);
+                    float g4[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
+                    for (int k = 0; k < buildTaps; ++k)
+                        g4[k & 3] += bW[c][k] * (bD[c][k] == 0 ? v : dif[c].read (bD[c][k]));
+                    // below ~600 Hz the groups go on as one sum (the build's low band as before: there the few modes
+                    // of the tank, not the taps, set the tone, and music read them as before); above, apart
+                    float low = 0.0f;
+                    for (int g = 0; g < 4; ++g)
+                    {
+                        splitLp[c][g] += splitCoef * (g4[g] - splitLp[c][g]);
+                        low += splitLp[c][g];
+                        dg[c][g] = g4[g] - splitLp[c][g];
+                    }
+                    v = low;
+                }
+                else if (build)
                 {
                     dif[c].write (v);
                     float b = 0.0f;
@@ -1034,8 +1074,19 @@ struct Engine::Impl
                     }
                 }
                 const auto alt = (i & 1) == 0 ? 0.5f : -0.5f;
-                lines[i].write (u + alt * in[0]);
-                lines[i + 4].write (w + alt * in[1]);
+                if (build && split)
+                {
+                    const auto hb = 0.5f * (1.0f - onsetFeed);
+                    const auto hl = dg[0][0] + (i & 1 ? -dg[0][1] : dg[0][1]) + (i & 2 ? -dg[0][2] : dg[0][2]) + ((i == 1 || i == 2) ? -dg[0][3] : dg[0][3]);
+                    const auto hr = dg[1][0] + (i & 1 ? -dg[1][1] : dg[1][1]) + (i & 2 ? -dg[1][2] : dg[1][2]) + ((i == 1 || i == 2) ? -dg[1][3] : dg[1][3]);
+                    lines[i].write (u + alt * in[0] + hb * hl);
+                    lines[i + 4].write (w + alt * in[1] + hb * hr);
+                }
+                else
+                {
+                    lines[i].write (u + alt * in[0]);
+                    lines[i + 4].write (w + alt * in[1]);
+                }
             }
             if ((++renorm & 8191u) == 0) // the rotating pairs drift by rounding: back onto the unit circle
             {
@@ -1463,6 +1514,21 @@ void fitOverride (Settings& s)
         else if (k == "width") s.width *= v;
         else if (k == "earlyms") s.earlySec = v / 1000.0;
         else if (k == "bl") s.bandLimit *= v;
+        else if (k == "rev") s.revision = (int) v;
+        else if (k == "split") s.buildSplit = v >= 0.5;
+        else if (k == "lbw") s.loopBandwidth = v;
+        else if (k == "hcut") s.outHighCut = v;
+        else if (k == "lcut") s.outLowCut = v;
+        else if (k == "lsdb") s.lowShelfDb = v;
+        else if (k == "lshz") s.lowShelfHz = v;
+        else if (k == "hsdb") s.highShelfDb = v;
+        else if (k == "hshz") s.highShelfHz = v;
+        else if (k == "tmdb") s.toneMidDb = v;
+        else if (k == "ebuild") s.buildRise = v;
+        else if (k == "shim") s.shimmerEnergy *= v;
+        else if (k == "shfb") s.shiftFeedback *= v;
+        else if (k == "lowmult") s.lowMult *= v;
+        else if (k == "highmult") s.highMult *= v;
         else if (k.size() == 3 && k[0] == 'b' && (k[1] == 'f' || k[1] == 'g' || k[1] == 'q') && k[2] >= '0' && k[2] <= '2')
             (k[1] == 'f' ? s.bellHz : k[1] == 'g' ? s.bellDb : s.bellQ)[k[2] - '0'] = v;
     }
@@ -1587,6 +1653,110 @@ struct EpochMode
 #else
 #define LYNX_FIT_TABLE const
 #endif
+
+// round 190it: revision 1's trims per type / mode, measured on refcap030's black-box captures (each type / mode at the
+// capture's base setting against the reference's impulse): the wet level (dB) and the tone corrector (dB added per octave
+// band, 63 Hz … 8 kHz). Neutral = the 0.1.27 Measured law
+struct Rev1Trim
+{
+    double gainDb = 0.0;
+    double db[engineBands] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
+};
+// Epoch Verb ← ValhallaVintageVerb's ReverbMode sweep (base Decay 0.51 s; two passes of the closed loop; Concert Hall, the
+// mode of every other capture, keeps the 0.1.27 voicing); faded out by Decay 1.41 s (the front-end)
+LYNX_FIT_TABLE Rev1Trim epochTrim[epoch::modeCount] = {
+    {}, // Concert Hall
+    { 9.61, { -4.69, -4.20, -0.99, -0.50, -0.90, 0.78, 5.83, 8.39 } }, // Plate
+    { 2.64, { 1.64, 1.89, -0.39, -1.30, 0.48, 0.52, -1.21, -1.82 } }, // Room
+    { 5.75, { -5.15, -3.53, 0.12, -0.79, -1.89, 0.86, 5.24, 8.18 } }, // Chamber
+    { 0.78, { -0.70, -0.01, -1.31, -2.10, -0.64, 1.80, 2.26, -1.39 } }, // Random Space
+    { 6.89, { -1.34, 0.87, -0.46, -1.63, -0.84, 1.22, 0.85, -4.69 } }, // Chorus Space
+    { 8.59, { -3.62, -4.93, -1.21, -0.82, -2.59, 2.12, 7.44, 9.41 } }, // Ambience
+    { 5.04, { -3.57, -2.60, -2.05, -1.92, -1.13, 0.71, 6.98, 12.96 } }, // Bright Hall
+    { 5.90, { 2.10, -2.48, -3.26, 0.65, 2.22, 3.39, -0.52, -14.57 } }, // Nave
+    { 2.98, { -1.90, -5.90, -1.84, 2.74, 2.75, 5.34, -3.07, -20.56 } }, // Grit Hall
+    { -0.75, { -0.85, -1.41, -1.33, -1.20, -0.41, 3.00, 1.35, -10.24 } }, // Grit Plate
+    { 5.73, { -2.66, -3.85, -0.89, 1.00, 0.17, 2.85, 0.72, -12.61 } }, // Smooth Plate
+    { 9.37, { 7.68, 7.33, 3.15, -4.53, -3.14, 1.07, -3.86, -17.78 } }, // Smooth Room
+    { 6.79, { 8.10, 6.32, 0.66, -3.45, -1.97, 1.36, -2.91, -16.40 } }, // Smooth Space
+    { -0.63, { 0.87, 1.07, 0.89, 0.50, 0.43, 2.94, -5.83, -17.37 } }, // Gated
+    { 6.21, { -3.32, -3.60, -0.98, -1.01, -1.09, 1.08, 5.59, 10.46 } }, // Drift Chamber
+    { 7.74, { -3.33, -6.49, -2.05, 2.00, 1.74, 3.35, 1.45, -11.92 } }, // Drift Hall
+    { -3.48, { 1.08, 1.38, 0.80, -0.64, 0.29, 4.17, -6.00, -14.52 } }, // Drift Space
+    { -4.48, { -0.55, -1.86, 0.11, 0.50, -0.27, 2.86, -1.36, -11.65 } }, // Cathedral
+    { -3.93, { 3.64, -2.34, -0.88, 2.28, 2.00, 4.49, -5.56, -14.07 } }, // Grand Hall
+    { -6.17, { 1.19, -1.22, -1.27, 0.88, 0.86, 2.55, -1.82, -11.16 } }, // Vintage Chamber
+    { -2.85, { 0.07, -5.03, -1.68, 1.48, 1.22, 4.32, -0.31, -12.19 } }, // Vintage Hall
+};
+// Atrium ← ValhallaRoom's type sweep (3-point smoothed over the bands, half the 63 Hz band's; Large Room, the type of
+// every other capture, keeps its 0.1.27 voicing; Medium Room's level a compromise between its impulse (+2 dB) and its
+// test signal (−3 dB))
+LYNX_FIT_TABLE Rev1Trim atriumTrim[atrium::typeCount] = {
+    {}, // Large Room
+    { -1.50, { 0.77, -1.36, -0.63, 0.39, 0.02, 0.45, 1.13, 1.24 } }, // Medium Room
+    {}, // Bright Room (its 0.1.27 law was fitted on tp172d's S2, which the sweep's trim cost a step)
+    { -0.75, { 0.04, 0.01, 0.26, 1.05, 0.45, -0.63, -1.14, -1.63 } }, // Large Chamber
+    { 0.40, { 0.01, 1.43, 0.90, 0.45, 0.00, -0.87, -1.90, -3.50 } }, // Dark Room
+    { -0.20, { 0.08, 0.20, 0.11, 0.92, 0.43, -0.85, -0.82, -0.22 } }, // Dark Chamber
+    { 2.30, { -1.15, -0.14, 0.89, 1.18, 0.04, -1.07, -0.91, -0.23 } }, // Dark Space
+    { 3.75, { -1.13, 0.74, 1.19, 0.98, -0.26, -1.38, -1.26, -0.93 } }, // Deep Space
+    { 2.42, { -0.56, 0.82, 0.80, 0.56, 0.07, -0.91, -1.35, -1.30 } }, // Mirror Space
+    { 3.05, { -0.86, 0.03, 1.16, 1.51, 0.16, -1.32, -1.54, -1.17 } }, // Vast Space
+    { 5.16, { -1.21, 1.24, 1.62, 1.05, -0.22, -1.62, -2.06, -2.00 } }, // Distant Space
+    {}, // Dense Room
+};
+// Foil Plate ← ValhallaPlate's type sweep (as Atrium's; Silver and Pewter, the types of the other captures, keep theirs:
+// Pewter's trim at the sweep's decay cost the 0.5 decay of refcap182's S2 a step); the last entry: the measured plate voicing
+LYNX_FIT_TABLE Rev1Trim foilTrim[foil::typeCount + 1] = {
+    {}, // Silver
+    {}, // Pewter
+    { 3.26, { -1.89, -0.54, 0.24, 0.47, 0.04, -0.13, -0.08, -0.79 } }, // Nickel
+    { 1.65, { -0.36, 0.27, 0.31, 0.61, 0.10, -0.82, -0.46, 0.09 } }, // Bronze
+    { 1.87, { -1.12, -0.78, 0.06, 1.34, 0.90, -0.35, -1.18, -2.21 } }, // Bismuth
+    { 0.39, { 1.63, 1.84, 0.02, -0.88, -0.69, -0.38, 0.09, 0.21 } }, // Tin
+    { 0.28, { -0.85, -0.82, -0.67, -0.31, -0.10, 0.50, 1.39, 1.48 } }, // Zinc
+    { 3.88, { 0.55, 1.93, 1.04, -0.30, -0.64, -1.11, -0.92, -0.18 } }, // Platinum
+    { 2.14, { 0.71, 0.58, -1.25, -1.52, -0.19, 1.17, 1.20, -0.70 } }, // Tungsten
+    { 3.74, { -0.55, 0.54, 0.41, 0.29, -0.02, -0.26, -0.96, -3.08 } }, // Iron
+    { 2.39, { -0.35, -0.03, -1.06, -0.94, -0.02, 0.97, 1.08, -0.80 } }, // Gold
+    { 0.68, { 0.93, 0.69, -0.59, -0.32, 0.30, 0.22, -0.31, -1.42 } }, // Lead
+    {}, // the measured plate voicing
+};
+LYNX_FIT_TABLE Rev1Trim haloTrim[7] = {};                   // per reverb mode
+#ifdef LYNX_VERB_FIT
+// the fitting harness: LYNX_VTRIM=<file>, lines "<epoch|atrium|foil|halo> <index> <gain dB> <8 × dB>"
+bool loadTrims()
+{
+    if (const char* f = std::getenv ("LYNX_VTRIM"))
+        if (auto* in = std::fopen (f, "r"))
+        {
+            char name[32];
+            int i;
+            Rev1Trim t;
+            while (std::fscanf (in, "%31s %d %lf %lf %lf %lf %lf %lf %lf %lf %lf", name, &i, &t.gainDb, &t.db[0], &t.db[1], &t.db[2],
+                                &t.db[3], &t.db[4], &t.db[5], &t.db[6], &t.db[7]) == 11)
+            {
+                const std::string n = name;
+                Rev1Trim* table = n == "epoch" ? epochTrim : n == "atrium" ? atriumTrim : n == "foil" ? foilTrim : n == "halo" ? haloTrim : nullptr;
+                const int count = n == "epoch" ? epoch::modeCount : n == "atrium" ? atrium::typeCount : n == "foil" ? foil::typeCount + 1 : 7;
+                if (table != nullptr && i >= 0 && i < count)
+                    table[i] = t;
+            }
+            std::fclose (in);
+        }
+    return true;
+}
+#endif
+void applyTrim (Settings& s, const Rev1Trim& t, double weight = 1.0) noexcept
+{
+   #ifdef LYNX_VERB_FIT
+    static const bool loaded = loadTrims();
+    (void) loaded;
+   #endif
+    s.gain *= std::pow (10.0, weight * t.gainDb / 20.0);
+    for (int b = 0; b < engineBands; ++b)
+        s.bandDb[b] += weight * t.db[b];
+}
 LYNX_FIT_TABLE EpochMode epochModes[epoch::modeCount] = {
     { "Concert Hall", 0, 0.9394, 1, 1.2, 1, 0.975, 0.4, 42.94, 0.0, 1, 1.031, 3.2, 0.0 },
     { "Plate", 2, 0.80, 0.90, 0.45, 1.0, 1.0, 0.10, 2.0, 60.0, 1.0, 0.70, 2.0, 0.0 },
@@ -1749,6 +1919,13 @@ protected:
         s.gain *= 0.92;
         if (p[epoch::engineLaw] >= 0.5f)
             applyLaw (s, epochLaw[modeIndex]);
+        if (p[epoch::engineLaw] >= 0.5f && p[epoch::revision] >= 0.5f)
+        {
+            s.revision = 1; // round 190it
+            // Epoch's trims were measured at the capture's base Decay (0.51 s); its Room mode needs none at 1.41 s
+            // (refcap182 S2): they fade out between the two on the decay's logarithm
+            applyTrim (s, epochTrim[modeIndex], std::clamp (std::log (1.41 / std::max (0.01, decay)) / std::log (1.41 / 0.51), 0.0, 1.0));
+        }
     }
 };
 
@@ -1849,6 +2026,12 @@ protected:
             s.outLowCut = 0.0;
         if (p[atrium::engineLaw] >= 0.5f)
             applyLaw (s, atriumLaw[choice (p[19], atrium::typeCount)]);
+        if (p[atrium::engineLaw] >= 0.5f && p[atrium::revision] >= 0.5f)
+        {
+            s.revision = 1; // round 190it
+            applyTrim (s, atriumTrim[choice (p[19], atrium::typeCount)]);
+            s.buildSplit = true;
+        }
     }
 };
 
@@ -2040,6 +2223,11 @@ protected:
             }
             else
                 applyLaw (s, foilLaw[choice (p[11], foil::typeCount)]);
+            if (p[foil::revision] >= 0.5f)
+            {
+                s.revision = 1; // round 190it
+                applyTrim (s, foilTrim[p[14] >= 0.5f ? foil::typeCount : choice (p[11], foil::typeCount)]);
+            }
         }
     }
 };
@@ -2308,6 +2496,25 @@ double haloShiftSemis (float v) { return -12.0 + 24.0 * v; }
 // fitted with the tail lab (round 190bz; the reference and the scores per row: docs/PARITY.md); a neutral entry is the classic voicing on the new loop
 LYNX_FIT_TABLE LawVoicing haloLaw = { { 1.108, 1.268, 1.316, 1.083, 1.164, 1.001, 1.182, 1.427 }, { 1.63, -1.12, -1.41, -0.40, -0.68, -1.46, -1.95, -0.59 }, 2.13, 0.000, 30, 0.00, 0.00, 1.00, 1.00, 0.00, 0.30, 6.00, 1.00, { 63, 159, 5000 }, { -2.29, -1.54, 0.00 }, { 2.0, 2.0, 1.4 } };
 
+// round 190it (revision 1): the RT per reverb mode against the reference's (refcap030's mode sweep, impulses: ours ran
+// ×1.13 / ×0.75 / ×1.0 / ×2.85 its RT in Mono / Small / Medium / Big stereo)
+LYNX_FIT_TABLE double haloRev1Rt[7] = { 1.0, 0.88, 1.33, 1.0, 1.0, 0.35, 1.0 };
+#ifdef LYNX_VERB_FIT
+const double* haloRtTable()
+{
+    static const bool once = []
+    {
+        if (const char* e = std::getenv ("LYNX_HALORT"))
+            std::sscanf (e, "%lf,%lf,%lf,%lf,%lf,%lf,%lf", &haloRev1Rt[0], &haloRev1Rt[1], &haloRev1Rt[2], &haloRev1Rt[3], &haloRev1Rt[4], &haloRev1Rt[5], &haloRev1Rt[6]);
+        return true;
+    }();
+    (void) once;
+    return haloRev1Rt;
+}
+#else
+const double* haloRtTable() { return haloRev1Rt; }
+#endif
+
 class HaloFx final : public VerbEffect
 {
 public:
@@ -2349,7 +2556,11 @@ protected:
             // with less diffusion the reference's tail is shorter (Diffusion 0 / 50 %: ~5.5 / 6 s against 9.8 s at 92 %)
             const auto dn = std::clamp ((double) p[3] / 0.92, 0.0, 1.0);
             s.rt60 = (1.5 + 12.5 * size) * m.rtScale * (mPlain + (mShift - mPlain) * f) * (0.55 + 0.45 * dn * dn * dn);
+            if (p[halo::engineLaw] >= 0.5f && p[halo::revision] >= 0.5f)
+                s.rt60 *= haloRtTable()[haloModeIndex (p[9])];
         }
+        // (the energy of its impulse matched before the RT did: a mode's RT moves with the energy kept, gain × 1 / √RT ratio)
+        const auto rtKeep = p[halo::engineLaw] >= 0.5f && p[halo::revision] >= 0.5f ? 1.0 / std::sqrt (haloRtTable()[haloModeIndex (p[9])]) : 1.0;
         // round tp172d: its first 0.3 s are 5–9 dB under ours at 0.45; with less diffusion they are empty (Diffusion 50 %:
         // −55 dB, 0 %: silent until the first arrival at 1.2 s)
         s.earlyLevel = 0.3 * std::pow (std::clamp ((double) p[3] / 0.92, 0.0, 1.0), 8.0);
@@ -2363,7 +2574,19 @@ protected:
         s.outHighOrder = 1;
         if (shiftMode == 2 || shiftMode == 3 || m.bright > 0.0)
             s.highShelfDb = 4.0, s.highShelfHz = 3000.0;
-        s.loopBandwidth = dark ? 5000.0 : 0.0;
+        // round 190it (revision 1): the reference's Dark colour is a tone on the output, not in the loop: against
+        // Bright its tail keeps the RT at every octave (8.4 / 7.8 s at 4 / 8 kHz against 8.8 / 8.7) and its spectrum
+        // falls −3 / −6.6 / −11.7 dB at 4 / 8 / 16 kHz and −4.7 … −7.9 dB below 50 Hz, the mids −0.5 dB (refcap030's
+        // colour sweep); the loop low-pass took the highs' RT down to 2.2 s and 2 dB of the level
+        const auto rev1 = p[halo::engineLaw] >= 0.5f && p[halo::revision] >= 0.5f;
+        s.loopBandwidth = dark && ! rev1 ? 5000.0 : 0.0;
+        if (dark && rev1)
+        {
+            s.toneHighHz = 6500.0;
+            s.toneHighDb = -13.0;
+            s.toneLowHz = 70.0;
+            s.toneLowDb = -6.0;
+        }
         s.modRateHz = 0.05 + 4.95 * p[7];
         s.modDepthMs = 1.2 * p[8] / std::sqrt (std::max (0.3, s.modRateHz));
         // round tp172d: the wet level measured on music and drums (refs/halo): −3 dB up to Feedback 75 %, rising to +1 dB
@@ -2372,8 +2595,12 @@ protected:
         {
             const auto fb = (double) p[2];
             const auto dn = std::clamp ((double) p[3] / 0.92, 0.0, 1.0); // less diffusion: louder (+4.5 / +5.4 dB measured at 0 / 50 %)
-            const auto trimDb = (fb <= 0.75 ? -3.0 : -3.0 + 16.0 * (fb - 0.75)) + 5.0 * (1.0 - dn * dn * dn);
-            s.gain = (dark ? 0.75 : 0.95) * std::pow (10.0, trimDb / 20.0);
+            // round 190it (revision 1, refcap030: Feedback × Diffusion pairs, music and impulse): half that lift (at 20 /
+            // 50 % diffusion ours ran 2.5 dB over its level at 80 %, where the reference's does not), and 0.5 dB less overall
+            // (its music and test signal sat 2.6 dB under ours at the capture's base setting, the impulse 0.1 dB: −1 dB
+            // scored higher on refcap030 but cost tp172d's impulses, −0.5 dB is the cut no bank loses a block to)
+            const auto trimDb = (fb <= 0.75 ? -3.0 : -3.0 + 16.0 * (fb - 0.75)) + (rev1 ? 2.5 : 5.0) * (1.0 - dn * dn * dn) - (rev1 ? 0.5 : 0.0);
+            s.gain = (dark ? (rev1 ? 0.95 * 0.94 : 0.75) : 0.95) * std::pow (10.0, trimDb / 20.0) * rtKeep;
         }
         s.shimmerEnergy = 0.2; // the shifted voice's share added per pass (× the shimmer amount)
         if (m.stereo == 2)
@@ -2389,6 +2616,12 @@ protected:
         }
         if (p[halo::engineLaw] >= 0.5f)
             applyLaw (s, haloLaw);
+        if (p[halo::engineLaw] >= 0.5f && p[halo::revision] >= 0.5f)
+        {
+            s.revision = 1; // round 190it
+            applyTrim (s, haloTrim[haloModeIndex (p[9])]);
+            s.buildSplit = true;
+        }
     }
 
     // the reference's Mono mode sums the input (mono in, a stereo tail)

+ 14 - 0
src/core/LynxVerbs.h

@@ -124,6 +124,12 @@ struct Settings
     double matrixModDepth = 0.0, matrixModRateHz = 0.3;
     // three bells after the tone corrector (a mode's own narrow colour, where an octave band is too wide)
     double bellHz[3] = { 100.0, 1000.0, 5000.0 }, bellDb[3] = { 0.0, 0.0, 0.0 }, bellQ[3] = { 1.4, 1.4, 1.4 };
+
+    // ---- revision (round 190it), law 1 only: 0 = the 0.1.27 law as it was (projects saved before keep it, bit for bit);
+    // 1 = the 0.1.30 revision (the front-ends' trims; see each effect)
+    int revision = 0;
+    bool buildSplit = false; // round 190it: above ~600 Hz the build-up taps reach the tank in four independent groups (a
+                             // tail without the one FIR's ripple: a steady tone meets the tail's mean gain); Atrium, Halo
 };
 constexpr int engineBands = 8;
 // the octave-band RT60 (s, 63 Hz … 8 kHz) the engine aims at for a line of lineMs under law 1 (tests, fitting)
@@ -150,6 +156,8 @@ namespace epoch
 {
 constexpr int paramCount = 18;
 constexpr int engineLaw = 17; // round 190bz: 0 = the classic engine (projects saved before), 1 = the 0.1.27 law
+constexpr int revision = paramCount; // round 190it, hidden (no control, saved while non-zero): 1 = the 0.1.30 revision of
+                                     //   the Measured law (new instances, translated states); 0 = projects saved before
 constexpr int modeCount = 22;
 constexpr int colourCount = 3;
 const char* modeName (int index) noexcept;
@@ -161,6 +169,8 @@ namespace atrium
 {
 constexpr int paramCount = 23;
 constexpr int engineLaw = 22; // round 190bz: 0 = the classic engine (projects saved before), 1 = the 0.1.27 law
+constexpr int revision = paramCount; // round 190it, hidden (no control, saved while non-zero): 1 = the 0.1.30 revision of
+                                     //   the Measured law (new instances, translated states); 0 = projects saved before
 constexpr int typeCount = 12;
 const char* typeName (int index) noexcept;
 double decaySec (float v) noexcept;
@@ -170,6 +180,8 @@ namespace foil
 {
 constexpr int paramCount = 17; // round 135: + Infinite, Low cut; round 150: + Voicing; 152: + View; 190bz: + Law
 constexpr int engineLaw = 16; // round 190bz: 0 = the classic engine (projects saved before), 1 = the 0.1.27 law
+constexpr int revision = paramCount; // round 190it, hidden (no control, saved while non-zero): 1 = the 0.1.30 revision of
+                                     //   the Measured law (new instances, translated states); 0 = projects saved before
 constexpr int typeCount = 12;
 const char* typeName (int index) noexcept;
 double decaySec (float v) noexcept;
@@ -188,6 +200,8 @@ namespace halo
 {
 constexpr int paramCount = 13;
 constexpr int engineLaw = 12; // round 190bz: 0 = the classic engine (projects saved before), 1 = the 0.1.27 law
+constexpr int revision = paramCount; // round 190it, hidden (no control, saved while non-zero): 1 = the 0.1.30 revision of
+                                     //   the Measured law (new instances, translated states); 0 = projects saved before
 }
 namespace horizon
 {

+ 2 - 1
src/core/PluginSubstitutes.cpp

@@ -148,7 +148,8 @@ map = xml:parameter8 -> Mod depth
 # round 135: its four reverb modes (Mono / three stereo sizes, steps at 0.25 / 0.5 / 0.75 [EXEC]) -> Halo's same four
 map = xml:parameter9 -> Reverb mode | steps 0:0.125 0.25:0.25 0.5:0.375 0.75:0.625
 map = xml:parameter10 -> Shift mode | steps 0:0 0.25:0.25 0.45:0.5 0.65:0.75 0.85:1
-map = xml:parameter11 -> Color | steps 0:0 0.525:1
+# round 190it: its colour turns Dark between 0.479 and 0.521 (refcap030's colour sweep), so at 0.5
+map = xml:parameter11 -> Color | steps 0:0 0.5:1
 
 [valhalla-futureverb]
 product = ValhallaFutureVerb

+ 23 - 1
src/core/SpaceVerb.h

@@ -36,6 +36,11 @@ struct Settings
     double mix = 0.3;         // dry/wet
     // decay-rate EQ: decay multipliers below / above two corner frequencies (1 = no change)
     double lowMult = 1.0, lowHz = 200.0, highMult = 1.0, highHz = 4000.0;
+    // round 190it: ducking, 0 … 1 (the reference's 0 … 48 dB): the wet part dips while the input plays. Measured on
+    // refcap030's Pro-R 2 captures (a −6 dB RMS noise burst, Ducking 0 / 25 / 50 / 75 / 100 %): the tail sits 8.5 / 17 /
+    // 25.5 / 34 dB down by the burst's end (0.71 × the setting in dB), down within the first 50 ms, and comes back over
+    // ~0.3 s once the input stops (−34 → −25 → −16 → −11 → −7 dB in 50 ms steps: τ ≈ 115 ms in dB)
+    double ducking = 0.0;
     bool operator== (const Settings&) const = default;
 };
 
@@ -194,6 +199,7 @@ public:
         for (auto& f : tone) f.clear();
         for (auto& f : toneLp) f.clear();
         phase = 0.0;
+        duckEnv = duckDb = 0.0;
     }
 
     void set (const Settings& s) noexcept
@@ -249,9 +255,24 @@ public:
     {
         using namespace detail;
         const auto& erTaps = cur.style == Style::modern ? erModern : cur.style == Style::vintage ? erVintage : erPlate;
+        const bool duck = cur.ducking > 0.0;
+        const double duckDepthDb = 0.71 * 48.0 * clamp01 (cur.ducking);
+        const double envA = std::exp (-1.0 / (0.001 * sr)), envR = std::exp (-1.0 / (0.005 * sr));
+        const double attA = std::exp (-1.0 / (0.01 * sr)), attR = std::exp (-1.0 / (0.115 * sr));
         for (int i = 0; i < n; ++i)
         {
             const double inL = left[i], inR = right[i];
+            double duckGain = 1.0;
+            if (duck)
+            {
+                // the input's envelope (peak, 1 / 5 ms) keys the dip in full from −40 dBFS up (fading in from −50)
+                const double a = std::max (std::abs (inL), std::abs (inR));
+                duckEnv = a > duckEnv ? a + envA * (duckEnv - a) : a + envR * (duckEnv - a);
+                const double key = clamp01 ((20.0 * std::log10 (duckEnv + 1e-12) + 50.0) / 10.0);
+                const double target = duckDepthDb * key;
+                duckDb = target > duckDb ? target + attA * (duckDb - target) : target + attR * (duckDb - target);
+                duckGain = std::pow (10.0, -duckDb / 20.0);
+            }
             pre.push (0.5 * (inL + inR));
             const double x = preS >= 1.0 ? pre.read (preS) : 0.5 * (inL + inR);
             er.push (x);
@@ -293,7 +314,7 @@ public:
             double wL = (oL * lateGain + eL * erGain) * norm, wR = (oR * lateGain + eR * erGain) * norm;
             wL = toneLp[0].run (tone[0].run (wL));
             wR = toneLp[1].run (tone[1].run (wR));
-            const double mid = 0.5 * (wL + wR), sd = 0.5 * (wL - wR) * side;
+            const double mid = 0.5 * (wL + wR) * duckGain, sd = 0.5 * (wL - wR) * side * duckGain;
             left[i] = (float) (inL * dryGain + (mid + sd) * wetGain);
             right[i] = (float) (inR * dryGain + (mid - sd) * wetGain);
         }
@@ -325,5 +346,6 @@ private:
     detail::Delay pre, er;
     double preS = 0.0, modDepth = 0.0, modInc = 0.0, phase = 0.0, erGain = 1.0, erSpread = 1.0, lateGain = 1.0;
     double side = 1.0, dryGain = 0.89, wetGain = 0.45, norm = 0.3;
+    double duckEnv = 0.0, duckDb = 0.0; // round 190it
 };
 } // namespace lynx::spaceverb

+ 3 - 2
tests/Mod190doTests.inc

@@ -83,8 +83,9 @@ TEST (mod190do_new_instances_run_the_measured_laws_and_saved_projects_keep_the_c
             auto again = makeEffectSlot (law.kind);
             again.params[law.index] = v;
             const auto count = savedEffectParamCount (again);
-            // (round 190fy: a Spiral Echo also saves its hidden loop revision, one past the Law)
-            CHECK (count == law.index + 1 + (law.kind == EffectKind::spiralEcho ? 1u : 0u));
+            // (round 190fy: a Spiral Echo also saves its hidden loop revision, one past the Law; round 190it: a Lattice Mod
+            // its hidden tap-network revision)
+            CHECK (count == law.index + 1 + (law.kind == EffectKind::spiralEcho || law.kind == EffectKind::latticeMod ? 1u : 0u));
             auto loaded = makeEffectSlot (law.kind);
             for (std::size_t i = 0; i < count; ++i)
                 loaded.params[i] = std::clamp ((float) savedEffectParamValue (again.params[i]), 0.0f, 1.0f);

+ 217 - 0
tests/Parity190itTests.inc

@@ -0,0 +1,217 @@
+// Round 190it: the reverb stand-ins' 0.1.30 revision, measured on refcap030's black-box captures through LYNX's own
+// state translators (/mnt/e/lynx-work/parity190it/HANDOFF.md, docs/PARITY.md "Round 190it"). Epoch Verb, Atrium, Foil Plate
+// and Halo get a hidden revision of the Measured law (trims per mode / type, Atrium's and Halo's build-up taps in four
+// groups above 600 Hz, Halo's Dark colour on the output and its level laws), Lattice Mod a revision of its tap network
+// (the longest tap feeds the loop; the type values past the tenth step play the dry signal), LuxeVerb's Space engine a
+// hidden Ducking that only the Pro-R 2 translator sets. New instances and translated states get the revisions; a
+// project saved before loads them as 0 and renders bit for bit as the base commit did (fingerprints below).
+#include <cmath>
+#include <cstdint>
+#include <cstring>
+
+#include "core/EchoSuite.h"
+#include "core/Effects.h"
+#include "core/FabFilterStates.h"
+#include "core/LuxeVerb.h"
+#include "core/LynxVerbs.h"
+
+namespace parity190it
+{
+// the gold input (as /mnt/e/lynx-work/parity190it/gold/gold.cpp): an impulse, a noise burst, 220 Hz + 1 kHz tones
+inline void signal (std::vector<float>& l, std::vector<float>& r, double sr)
+{
+    unsigned s = 777u;
+    const int n = (int) l.size();
+    for (int i = 0; i < n; ++i)
+    {
+        const double t = i / sr;
+        s = s * 1664525u + 1013904223u;
+        const double nz = (double) (s >> 8) / 8388608.0 - 1.0;
+        double v = i == (int) (0.05 * sr) ? 0.5 : 0.0;
+        if (t > 0.3 && t < 0.45) v += 0.25 * nz;
+        if (t > 0.6 && t < 1.2) v += 0.3 * std::sin (2.0 * M_PI * 220.0 * t) + 0.1 * std::sin (2.0 * M_PI * 1000.0 * t);
+        l[(std::size_t) i] = (float) v;
+        r[(std::size_t) i] = (float) (t > 0.3 && t < 0.45 ? 0.7 * v : v);
+    }
+}
+inline void render (const lynx::EffectSlot& slot, double sr, std::vector<float>& l, std::vector<float>& r)
+{
+    auto fx = lynx::makeEffect (slot);
+    fx->prepare (sr);
+    const int n = (int) l.size();
+    for (int off = 0; off < n; off += 512)
+        fx->process (l.data() + off, r.data() + off, std::min (512, n - off), slot.params, 120.0);
+}
+struct Case { lynx::EffectKind kind; int rev, idx; float val; int idx2; float val2; };
+inline std::vector<Case> cases()
+{
+    using lynx::EffectKind;
+    const int lat = (int) lynx::echosuite::lattice::revision, duck = lynx::luxeVerbSpaceDucking;
+    return { { EffectKind::epochVerb, 18, -1, 0, -1, 0 }, { EffectKind::epochVerb, 18, 16, 0.0476f, 2, 0.1f },
+             { EffectKind::epochVerb, 18, 16, 0.2857f, 4, 0.8f }, { EffectKind::epochVerb, 18, 16, 0.6667f, 15, 0.0f },
+             { EffectKind::atrium, 23, -1, 0, -1, 0 }, { EffectKind::atrium, 23, 19, 0.0909f, 20, 0.6f },
+             { EffectKind::atrium, 23, 19, 0.6364f, 2, 0.3f }, { EffectKind::atrium, 23, 19, 0.9091f, 5, 0.9f },
+             { EffectKind::foilPlate, 17, -1, 0, -1, 0 }, { EffectKind::foilPlate, 17, 11, 0.3636f, -1, 0 },
+             { EffectKind::foilPlate, 17, 14, 1.0f, -1, 0 }, { EffectKind::foilPlate, 17, 11, 0.9091f, 16, 0.0f },
+             { EffectKind::halo, 13, -1, 0, -1, 0 }, { EffectKind::halo, 13, 11, 1.0f, 9, 0.625f },
+             { EffectKind::halo, 13, 9, 0.25f, 3, 0.2f }, { EffectKind::halo, 13, 12, 0.0f, 11, 1.0f },
+             { EffectKind::latticeMod, lat, -1, 0, -1, 0 }, { EffectKind::latticeMod, lat, 29, 0.35f, 4, 0.5f },
+             { EffectKind::latticeMod, lat, 29, 0.6f, 9, 0.8f },
+             { EffectKind::luxeVerb, duck, lynx::luxeVerbSpaceFirst, 1.0f, -1, 0 },
+             { EffectKind::luxeVerb, duck, lynx::luxeVerbSpaceFirst, 1.0f, lynx::luxeVerbSpaceFirst + 2, 0.2f } };
+}
+inline double energy (const std::vector<float>& l, const std::vector<float>& r, std::uint64_t* hash = nullptr)
+{
+    std::uint64_t h = 1469598103934665603ull;
+    double e = 0.0;
+    for (std::size_t i = 0; i < l.size(); ++i)
+        for (const float v : { l[i], r[i] })
+        {
+            std::uint32_t u;
+            std::memcpy (&u, &v, 4);
+            for (int b = 0; b < 4; ++b) { h ^= (u >> (8 * b)) & 0xffu; h *= 1099511628211ull; }
+            e += (double) v * v;
+        }
+    if (hash != nullptr) *hash = h;
+    return e;
+}
+} // namespace parity190it
+
+TEST (parity190it_revisions_are_hidden_new_instances_run_them_old_projects_do_not)
+{
+    using namespace lynx;
+    const std::pair<EffectKind, int> revs[] = { { EffectKind::epochVerb, verbs::epoch::revision }, { EffectKind::atrium, verbs::atrium::revision },
+                                                { EffectKind::foilPlate, verbs::foil::revision }, { EffectKind::halo, verbs::halo::revision },
+                                                { EffectKind::latticeMod, (int) echosuite::lattice::revision } };
+    for (const auto& [kind, rev] : revs)
+    {
+        CHECK (effectInfo (kind).params.size() == (std::size_t) rev); // hidden: no new control, no new string
+        auto s = makeEffectSlot (kind);
+        CHECK (s.params[(std::size_t) rev] == 1.0f);
+        CHECK (savedEffectParamCount (s) == (std::size_t) rev + 1); // saved, since it is not zero
+        auto now = s;
+        upgradeLoadedEffectParams (now, (std::size_t) rev + 1);
+        CHECK (now.params[(std::size_t) rev] == 1.0f);
+        auto old = s; // saved before this round: the 0.1.27 law, and saved again it stays that way
+        upgradeLoadedEffectParams (old, (std::size_t) rev);
+        CHECK (old.params[(std::size_t) rev] == 0.0f);
+        CHECK (savedEffectParamCount (old) == (std::size_t) rev);
+    }
+    CHECK (effectInfo (EffectKind::luxeVerb).params.size() == (std::size_t) luxeVerbSpaceDucking);
+    CHECK (makeEffectSlot (EffectKind::luxeVerb).params[(std::size_t) luxeVerbSpaceDucking] == 0.0f);
+}
+
+TEST (parity190it_revision0_renders_as_the_base_commit_did)
+{
+    using namespace lynx;
+    // 1.6 s of the gold input at 48 kHz in blocks of 512: FNV-1a of the float bits and the energy. From the base commit's
+    // objects (/mnt/e/lynx-work/parity190it/gold: gold_base.txt, 63 renders at 44.1 / 48 / 96 kHz; the round's objects
+    // with every revision / Ducking forced to 0 print the same lines, gold_new.txt)
+    struct Gold { int k; std::uint64_t hash; double energy; };
+    const Gold gold[] = {
+        { 0, 0xb6c7e4134cae1bbcull, 6517.55975 },
+        { 1, 0x591b61a5c3bb686aull, 355.891712 },
+        { 2, 0x74116650d21cde5full, 11192.4753 },
+        { 3, 0x3bf139392d87891full, 742.622831 },
+        { 4, 0x173f6572968912a1ull, 1199.47338 },
+        { 5, 0x0b32b6bf4d3a3c8aull, 5082.16125 },
+        { 6, 0xb1635f09bc96f496ull, 772.247104 },
+        { 7, 0xd4e489ae0bbe8a93ull, 2035.55809 },
+        { 8, 0xb8d80cc82b8d7851ull, 2952.56788 },
+        { 9, 0xa43c38a01af9f866ull, 2675.826 },
+        { 10, 0x6584841fd046f7d2ull, 10610.4059 },
+        { 11, 0x0f2aab07e6b82380ull, 2120.051 },
+        { 12, 0xbc7cd2071453d014ull, 1921.89742 },
+        { 13, 0x01a506e63b3b0882ull, 2050.69175 },
+        { 14, 0x17b2b0b8960aab69ull, 1572.79412 },
+        { 15, 0xf8ba8283709e79e6ull, 1359.16207 },
+        { 16, 0xe2b921f4a44ed867ull, 2125.82548 },
+        { 17, 0x3245731dee6b0558ull, 69221.7243 },
+        { 18, 0x46f99f19c681a77bull, 3151.16293 },
+        { 19, 0x8739eae59cc1e050ull, 2629.43206 },
+        { 20, 0x1c0af975acf851dfull, 2589.13447 },
+    };
+    const auto cs = parity190it::cases();
+    for (const auto& g : gold)
+    {
+        const auto& c = cs[(std::size_t) g.k];
+        auto slot = makeEffectSlot (c.kind);
+        slot.params[(std::size_t) c.rev] = 0.0f;
+        if (c.idx >= 0) slot.params[(std::size_t) c.idx] = c.val;
+        if (c.idx2 >= 0) slot.params[(std::size_t) c.idx2] = c.val2;
+        const int n = (int) (1.6 * 48000.0);
+        std::vector<float> l ((std::size_t) n), r ((std::size_t) n);
+        parity190it::signal (l, r, 48000.0);
+        parity190it::render (slot, 48000.0, l, r);
+        std::uint64_t h = 0;
+        const double e = parity190it::energy (l, r, &h);
+       #if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 43))
+        CHECK (h == g.hash); // the libm the fingerprints were taken with (sin / pow / exp may differ elsewhere)
+       #endif
+        CHECK (std::abs (e - g.energy) < 1e-6 * g.energy + 1e-9);
+    }
+}
+
+TEST (parity190it_lattice_revision1_longest_tap_loop_and_dry_types)
+{
+    using namespace lynx;
+    namespace la = echosuite::lattice;
+    const double sr = 48000.0;
+    const int n = (int) (1.6 * sr);
+    const auto run = [&] (float taps, float rev, std::vector<float>& l, std::vector<float>& r) {
+        auto slot = makeEffectSlot (EffectKind::latticeMod);
+        slot.params[(std::size_t) la::taps] = taps;
+        slot.params[(std::size_t) la::feedback] = 0.5f;
+        slot.params[(std::size_t) la::revision] = rev;
+        l.assign ((std::size_t) n, 0.0f); r.assign ((std::size_t) n, 0.0f);
+        parity190it::signal (l, r, sr);
+        parity190it::render (slot, sr, l, r);
+    };
+    std::vector<float> l0, r0, l1, r1, in (n), inR (n);
+    parity190it::signal (in, inR, sr);
+    // 8 taps (the reference's 0.35): the summed loop piled the low end up (its loop gain there is √8 × the feedback)
+    run (0.35f, 0.0f, l0, r0);
+    run (0.35f, 1.0f, l1, r1);
+    const double e0 = parity190it::energy (l0, r0), e1 = parity190it::energy (l1, r1), ein = parity190it::energy (in, inR);
+    std::printf ("  lattice 8 taps, feedback 50 %%: energy %.0f -> %.0f (input %.0f)\n", e0, e1, ein);
+    CHECK (e1 < 0.25 * e0 && e1 < 3.0 * ein);
+    // past the tenth step (0.4375 …): the dry signal alone, at unity
+    run (0.6f, 1.0f, l1, r1);
+    bool same = true;
+    for (int i = 0; i < n; ++i) same = same && l1[(std::size_t) i] == in[(std::size_t) i] && r1[(std::size_t) i] == inR[(std::size_t) i];
+    CHECK (same);
+}
+
+TEST (parity190it_pro_r2_ducking_is_translated_and_dips_the_tail)
+{
+    using namespace lynx;
+    std::vector<float> v (136, 0.0f);
+    v[0] = 0.5f; v[2] = 0.5f; v[3] = 0.5f; v[5] = 0.3f; v[7] = 0.7f; v[9] = 100.0f; v[16] = 0.0f;
+    v[8] = 24.0f; // Ducking 50 % (24 dB)
+    const auto st = fabfilter::parseState (p172b::ffbs (v));
+    CHECK (st.has_value());
+    auto slot = makeEffectSlot (EffectKind::luxeVerb);
+    if (st) fabfilter::fromProR2 (*st, slot);
+    CHECK (std::abs (slot.params[(std::size_t) luxeVerbSpaceDucking] - 0.5f) < 1e-6);
+    // a 0.3 s noise burst: during it the wet part sits ~17 dB (0.71 × 24) under the same setting without ducking
+    const double sr = 48000.0;
+    const int n = (int) (1.0 * sr);
+    const auto run = [&] (float d) {
+        auto s = slot;
+        s.params[(std::size_t) luxeVerbSpaceDucking] = d;
+        std::vector<float> l ((std::size_t) n, 0.0f), r ((std::size_t) n, 0.0f);
+        unsigned q = 5u;
+        for (int i = (int) (0.1 * sr); i < (int) (0.4 * sr); ++i)
+        {
+            q = q * 1664525u + 1013904223u;
+            l[(std::size_t) i] = r[(std::size_t) i] = 0.5f * ((float) (q >> 8) / 8388608.0f - 1.0f);
+        }
+        parity190it::render (s, sr, l, r);
+        double e = 0.0;
+        for (int i = (int) (0.3 * sr); i < (int) (0.4 * sr); ++i) e += (double) l[(std::size_t) i] * l[(std::size_t) i];
+        return 10.0 * std::log10 (e + 1e-30);
+    };
+    const double dip = run (0.0f) - run (0.5f);
+    std::printf ("  pro-r2 ducking 50 %%: the tail %.1f dB down during the burst\n", dip);
+    CHECK (dip > 14.0 && dip < 20.0);
+}

+ 2 - 0
tests/Reverb190bzTests.inc

@@ -497,6 +497,8 @@ TEST (reverb190bz_fitted_voicings_wet_level_and_the_plate_decay_blend)
     {
         auto slot = makeEffectSlot (kind);
         slot.params[0] = 1.0f;
+        // (round 190it: the 0.1.27 law's own fit, so its revision 0; revision 1 is checked by tests/Parity190itTests.inc)
+        slot.params[(std::size_t) (kind == EffectKind::halo ? verbs::halo::revision : verbs::epoch::revision)] = 0.0f;
         const auto law = (std::size_t) lawIndex (kind);
         const auto measured = impulse (slot, 8.0);
         slot.params[law] = 0.0f;

+ 1 - 0
tests/tests.cpp

@@ -17772,6 +17772,7 @@ TEST (fl_low_lifter_matches_fl_engine)
 #include "Mod190doTests.inc"
 #include "Parity190fyTests.inc"
 #include "Parity190iqTests.inc"
+#include "Parity190itTests.inc"
 #include "Sampler190dhTests.inc"
 #include "Fix190eaTests.inc"
 #include "Iss158Tests.inc"