Explorar el Código

Merge valhalla190ls (3084a5121) into wip/rollup030

# Conflicts:
#	tests/Parity190itTests.inc
Ka1-S hace 2 semanas
padre
commit
23357cbbf8

+ 37 - 0
docs/PARITY.md

@@ -4834,6 +4834,43 @@ low-pass plus a first-order shelf on four inner paths. Atrium's level over Decay
 flat within ±1 dB over ±4 Hz, ours ±4 … 12 dB). More modulation moved it 1 … 1.5 dB only — a denser late tank is its own
 project. Room scores unchanged (mode 3.31, pairs 4.22, sr48 3.44, sr96 3.38).
 
+## Round 190ls (Valhalla): Atrium on a dense late tank for the ValhallaRoom role
+
+Static analysis of the official ValhallaRoom binary by the owner's leave (clean-room: the structure understood, LYNX's own
+code written; no code, table or preset copied). Evidence: docs/analise/REA_rodada190ls.md, lab `/mnt/e/lynx-work/valhalla190ls/`.
+Score: `scripts/fxparity.py` with round 190lg's alignment window in time (~85 ms), the same scorer before and after.
+
+**Atrium ← ValhallaRoom (hidden `verbs::atrium::reaLaw`, index 24, one past round 190it's revision).** Read with the engine
+law and revision 1. A new instance and a translated ValhallaRoom state get 1; a project saved before loads 0 and renders bit
+for bit as before (42 / 42 renders of revisions 0 and 1 at 44.1 / 48 / 96 kHz against the base commit's objects, 81 / 81
+fxrender renders of translated states, Atrium's own settings and every other LYNX reverb / delay; fingerprints in
+`tests/Parity190lsTests.inc`).
+- The reference's late network has 32 lines in two halves; in every group of four, two lines move (one modulator, one each
+  way) and two stay. Atrium's engine gets a dense tank of that size (`Settings::dense`): 32 lines of LYNX's own lengths, a
+  16-point Hadamard per half, Late cross between the halves, law 1's per-line loop filters, the reference's modulation layout.
+- Late modulation × 4 on the moving lines: the reference's steady 1 kHz tone swings like that (sd of 10 ms levels 2.03 dB;
+  the 8-line tank's 1.19 dB, the dense tank's 2.26 dB).
+- Trims per type (`roomTrim`) on the type sweep's impulses; Large Room at half the sweep's lift at 63 / 125 Hz (music and bass
+  renders of the other banks).
+
+| Bank (ValhallaRoom captures → Atrium) | files | before → after | up / same / down |
+|---|---|---|---|
+| refcap030 mode (type sweep) | 48 | 3.31 → 3.58 | 14 / 30 / 4 |
+| refcap030 pairs | 36 | 4.22 → 4.25 | 1 / 34 / 1 |
+| refcap030 sr48 | 16 | 3.44 → 3.56 | 2 / 14 / 0 |
+| refcap030 sr96 | 16 | 3.38 → 3.69 | 3 / 13 / 0 |
+| **refcap030 all** | 116 | **3.62 → 3.80** | 20 / 91 / 5 |
+| tp172d | 12 | 3.58 → 3.67 | 1 / 11 / 0 |
+| verb183b captures | 17 | 3.88 → 3.88 | 0 / 17 / 0 |
+| refcap182 programme | 20 | 3.70 → 3.80 | 2 / 18 / 0 |
+
+The five files a step lower: four are the test signal's 1 kHz staircase (a steady tone through a time-varying tank: its level
+is the draw of the modulation at that frequency; the spectrum error fell on three of them, 2.35 / 2.37 / 2.25 → 2.28 / 1.91 /
+1.86 dB), one a music render whose level moved onto the reference (+0.69 → −0.05 dB) while its spectrum error crossed the
+2.5 dB step (2.14 → 2.52 dB).
+CPU (Atrium, 48 kHz, instructions of 20 s × 4 settings × 5 runs, one core): 80.0 G → 80.2 G with the law off (+0.3 %),
+118.7 G with the dense tank (+48 %; cycles +45 … 50 %, ~3.3 → ~4.8 % of a core in thread time) — the 32-line tank itself.
+
 ## Round 190ln (Slate / Eiosis): AirEQ and Infinity EQ translated onto Facet EQ in physical units
 
 Static REA of the third-party binaries by the owner's leave (2026-11-17), clean-room (docs/analise/REA_rodada190ln.md §1 … §5;

+ 136 - 0
docs/analise/REA_rodada190ls.md

@@ -0,0 +1,136 @@
+# REA round 190ls (0.1.30): Valhalla → LYNX stand-ins (ValhallaRoom → Atrium's dense late tank)
+
+Owner's permission of 2026-11-17: REA on third-party plug-in binaries for parity, clean-room only. Static reads of the
+official binaries (no decryption, no dumps, no hooks, nothing near licence code); nothing of the references is copied — no
+code, no tables, no presets. LYNX's code is its own; every number in it is LYNX's fit on the references' renders.
+Lab: /mnt/e/lynx-work/valhalla190ls (lab/, runs/, gold/, cpu/, mini/). Decompiler working files of round 190ln
+(/mnt/e/lynx-work/rea3_190ln/vr/rea, Ghidra project `Room`) were re-read; no new Ghidra session was needed for Room.
+Score: round 190lg's time-based alignment window (/mnt/e/lynx-work/rea3_190ln/scorer = origin/rea2_190lg's fxparity /
+flref_compare), the same copy for every before and after. Bank runner: lab/bank.sh → lab/rc030q.py (rea3_190ln's rc030.py
+with the quiet-window wait per item).
+
+## 1. ValhallaRoom: the late network [STATIC]
+
+Round 190ln found the late network's size (2 × 16 lines) and the RT60 law of its line gains. Read again this round
+(`lr_proc.c`, the per-type process function at 0x1802888f0, and the gain update at 0x180266220):
+
+- **Blocks of 64 samples.** Every line is read and written 64 samples at a time; the modulators are evaluated once per block
+  (eight sines, each stored with its negation — sixteen offsets — and two more whose (½ ± v) pairs crossfade two inner taps).
+- **Eight groups of four lines.** In each group two lines are read at a modulated fractional delay (base + one modulator,
+  + v for one and − v for the other) and two at a fixed whole-sample delay: half the 32 lines move, in opposite pairs.
+- **Per line, two one-pole crossovers** (corners at RTXover and RTHighXover): the line's output is split into low / mid /
+  high and each part scaled by its RT60 gain 10^(−3 L / (fs·T)) for T = RTBassMultiply × Decay, Decay, RTHighMultiply ×
+  Decay (190ln).
+- An input chain of seven delay-and-mix stages per channel before the network (block-delay + a 4-point mixing step each).
+
+What is LYNX's own: the line lengths (a near-geometric set of 32 ratios, 0.55 … 1.6 × the type's mean length), the
+mixing (a 16-point Hadamard inside each half, the halves rotated into each other by Late cross × 45°), the loop filters
+(LYNX's six-shelf per-band design, law 1). The modulation layout (two of every four lines moving, in opposite directions) is
+the reference's structure, written as LYNX's own code on the 8-line tank's modulators.
+
+## 2. Atrium's dense late tank (`Settings::dense`, `verbs::atrium::reaLaw`) [built]
+
+Engine (core/LynxVerbs.cpp, law 1 only; an engine made with `dense = true` — Atrium's — allocates it):
+- 32 lines in one frame-major buffer (`DenseBank`: one write position; the 32 writes of a sample are one contiguous store),
+  lengths `denseRatio[j]` × the geometric mean of the type's 8-line set × Late size, whole samples, gliding 0.25 sample per
+  sample when Late size moves; lines alternate between the two halves.
+- Loop filter per line: law 1's six first-order shelves designed from the per-band loss of that line's length (the same
+  `designLine` the 8-line tank uses, refactored out of `designLoop`, bit-identical), then the loop's band-limit / low-cut
+  one-poles. No loop all-passes (the 8-line tank needs them for density; 32 lines don't).
+- Mixing: a 16-point Hadamard per half (four butterfly stages, × ¼ folded into the cross rotation), the halves rotated into
+  each other by Late cross × 45° (the matrix modulator swings it). Input: ±¼ of each channel on every line of its half;
+  revision 1's four build groups on lines j & 3 (±½).
+- Modulation: the reference's layout — in each group of four lines two move (modulator j / 4 of the 8-line tank's eight,
+  one each way), two are read at whole samples.
+- Output: two Walsh rows (22, 13) over all 32 lines, read at 1 / √8: the tank's stored energy does not depend on its size,
+  so 1 / √32 left the late field 6 dB under the 8-line tank's (measured: −2.5 dB on the whole impulse with the early part);
+  at 1 / √8 every front-end level holds.
+
+Front-end (Atrium, `applyRoomLaw`, read with the engine law and revision 1 and `reaLaw` 1):
+- `s.dense = 1`; the late lines' modulation depth × 4 (`roomModScale`): the reference's steady 1 kHz tone (refcap030's
+  staircase, 28 stim renders of the type sweep and sr48 settings, `lab/tv.py`) swings by 2.03 dB (sd of 10 ms levels inside a
+  step) and 1.86 dB from step to step; revision 1's 8-line tank swung 1.19 / 1.57 dB and sat 2.0 dB further under the input
+  on average. The dense tank at × 4 (half its lines moving): 2.26 / 1.39 dB. (Every line moving at × 3 … 4 gave 2.04 … 2.09 dB
+  and 0.6 dB more level on the tone for 4 % more instructions; the reference's layout was kept.)
+- `roomTrim` per type (level + tone corrector per octave band) on top of revision 1's `atriumTrim`: two closed-loop passes of
+  `lab/roomtrim.py` on the type sweep's impulses (third octaves around each band, 3-point smoothed; the residue after pass 2
+  within ±1 dB). Large Room — the type of the pairs, sr and every gate bank's capture — 0.65 dB under the sweep's level and
+  half the sweep's 63 Hz lift (+2 dB → +1 dB): at the full lift the music / bass renders of tp172d, refcap182 and verb183b ran
+  0.5 … 1.7 dB over the reference (four files a step lower), at no lift the type sweep lost 0.1 (see §3). Dense Room (no
+  capture) neutral.
+
+Not built: the reference's block processing (64-sample blocks; LYNX's tank runs per sample), its input chain of seven
+delay-and-mix stages (Atrium keeps its input all-passes, build-up taps and onset network), its per-line two-crossover
+three-band gains (law 1's six shelves meet the same three-band law and the per-octave voicing).
+
+## 3. Scores, gates [EXEC]
+
+Base: origin/rea3_190ln (fxrender `bin/fxr_base` = rea3_190ln's merged build); after: this branch (`bin/fxr_n2`). JSON:
+runs/b0 (base), runs/n2 (product), runs2/b0 / runs2/n2 (gate banks); the fit variants in runs/h* (lab/trim_*.txt).
+
+| reference → LYNX | files | before → after | up / same / down |
+|---|---|---|---|
+| refcap030 ValhallaRoom mode (type sweep) | 48 | 3.31 → 3.58 | 14 / 30 / 4 |
+| refcap030 ValhallaRoom pairs | 36 | 4.22 → 4.25 | 1 / 34 / 1 |
+| refcap030 ValhallaRoom sr48 | 16 | 3.44 → 3.56 | 2 / 14 / 0 |
+| refcap030 ValhallaRoom sr96 | 16 | 3.38 → 3.69 | 3 / 13 / 0 |
+| **refcap030 ValhallaRoom** | 116 | **3.62 → 3.80** | 20 / 91 / 5 |
+| tp172d (Room) | 12 | 3.58 → 3.67 | 1 / 11 / 0 |
+| verb183b captures (Room) | 17 | 3.88 → 3.88 | 0 / 17 / 0 |
+| refcap182 programme (Room) | 20 | 3.70 → 3.80 | 2 / 18 / 0 |
+
+Downs, with evidence (one step each):
+- mode M_type_0.354 / 0.521 / 0.562 / 0.729, `stim`: the file's level is the 1 kHz staircase, a steady tone through a
+  time-varying tank — its level is the draw of the modulation at that frequency (the reference's own swings by 1.9 dB from
+  step to step at one setting). Spectrum error 2.35 / 2.37 / 2.25 / 2.40 → 2.28 / 1.91 / 1.86 / 2.80 dB; rms −0.58 / −2.75 /
+  −2.21 / −0.35 → −2.50 / −3.62 / −3.08 / −0.22 dB. Across the 32 staircase files the mean moved up (2.75 → 3.17 on the mode
+  block's 24, 2.0 → 2.5 / 2.25 → 3.5 on sr48 / sr96).
+- pairs PT_predelay0.2_decay0.8 `mix`: level onto the reference (rms +0.69 → −0.05 dB), the spectrum error over the 2.5 dB
+  step by 0.02 (2.14 → 2.52 dB).
+
+Fit variants (all on the dense tank, refcap030 Room 116 files / gate banks 49 files, base 3.62 / tp172d 3.58, cap 3.88,
+prog182 3.70):
+
+| variant | refcap030 | tp172d / cap / prog182 | note |
+|---|---|---|---|
+| 8-line tank, modulation × 8 | 3.81 (100 files, no sr96) | — | the staircase only |
+| every line moving × 4, sweep trims (A) | 3.79 | 3.42 / 3.88 / 3.75 | music 0.7 … 1.5 dB loud |
+| reference layout × 4, A | 3.82 | 3.67 / 3.76 / 3.75 | 4 gate files down (music / bass) |
+| … Large Room 63 Hz half (H) | 3.78 | 3.75 / 3.88 / 3.75 | D_bass down |
+| **… Large Room 63 / 125 Hz half (I, shipped)** | **3.80** | **3.67 / 3.88 / 3.80** | no gate file down |
+| … Large Room −1.1 dB (G) | pairs 4.08 | — | dropped |
+| … no 63 Hz lift anywhere (F) | 3.75 | 3.75 / 3.88 / 3.75 | the type sweep lost 0.08 |
+
+Gates:
+- Gold: gold/gold.sh — 81 / 81 fxrender renders byte-identical (base binary vs the round's with `--set 24=0`: ValhallaRoom
+  states through the translator, Atrium's own settings with law 0 / revision 0 / 1, every other LYNX reverb and the delay /
+  modulation stand-ins at 44.1 / 48 / 96 kHz). gold/gold_base.txt == gold/gold_new.txt (42 fingerprints of revisions 0 and
+  1 from the base commit's LynxVerbs / Effects objects and the round's; in tests/Parity190lsTests.inc).
+- CPU (cpu/bench.cpp, cpu/instr.log; Atrium at 48 kHz, 4 settings × 5 runs × 20 s, perf instruction counts): base 79.97 G,
+  the round with the law off 80.21 G (+0.3 %: the dense branch test), dense tank 118.7 G (+48 %). The first version (one
+  buffer per line, every line Hermite-read, loop-indexed Hadamard) was 170.6 G; the reference's half-moving layout, whole-
+  sample reads for the still lines, one frame-major buffer and a vectorisable Hadamard brought it to 118.7 G.
+- Mini runner (mini/all.inc = rea3_190ln's 82 test files + Parity190lsTests): 545 439 checks, 0 failures.
+
+## 4. The other Valhalla stand-ins: base scores and findings (not built this round)
+
+refcap030 means (base, round 190lg's scorer): Supermassive mode 3.23 / pairs 5.39 / sr48 5.60 / sr96 5.70; Shimmer 3.65 /
+3.17 / 3.75 / 3.69; Delay 3.95 / 3.94 / 4.00 / 4.06; FreqEcho sr48 4.06 / sr96 3.31; SpaceModulator 2.85 / 4.33 / 4.40 /
+4.40; UberMod 5.62 / 3.97 / 3.90 / 3.85; VintageVerb 2.16 / 3.44 / 3.50 / 3.60 (runs/b0).
+
+- **ValhallaDelay → Echoform, Feedback 100 %** (pairs PT_Feedback0.5_Diffusion0.2 / 0.5 / 0.8, score 1, rms +10 … +12 dB):
+  the reference's Tape echoes at 100 % (value 0.5 = 200 % × v) still fall by ~1.4 dB per 300 ms pass, Echoform's measured
+  tape stage (fitted at 70 %: +0.67 dB in its feedback path) grows by ~0.2 dB per pass. At 160 % both grow at the same
+  2.3 dB per pass and at 40 % both fall alike — a level law of the loop between 70 and 160 % (a record-level limit) is
+  missing. Needs a few probe renders at 80 … 120 % (Valhalla runs) before a law; not built.
+- **ValhallaFreqEcho at 96 kHz** (3.31 vs 4.06 at 48 kHz): the impulse's echoes and levels match at both rates; the loss is
+  on steady tones through the shifted loop (the 1 kHz tone of the nburst signal: +3.5 dB at 48 kHz, −3.8 dB at 96 kHz against
+  the reference, which reads the same at both rates). The tone's level is the phase of the loop at that frequency; the
+  reference's own loop delay at the shortest Delay differs with the rate (12.28 ms at 48 kHz, 10.71 ms at 96 kHz after the
+  dry impulse; ours 11.18 / 11.64). Not built.
+- **ValhallaVintageVerb → Epoch Verb, Concert Hall at Decay 0.51 s** (the ColorMode sweep, 48 files at 3 / 1): the impulse is
+  2.0 dB under the reference (2.7 dB in the first 80 ms), the 1 kHz staircase 6.9 dB under. Revision 1's trims leave Concert
+  Hall on its 0.1.27 voicing (other banks); a short-decay trim needs its own hidden step. More modulation does not move the
+  staircase here (× 3 / × 6: the tone 6.7 / 5.4 dB under). Not built.
+- Supermassive's low files are the sixteen networks on Nebula's classic engine (the cloud law covers six); Shimmer's pairs at
+  Feedback 80 % run 4 … 4.6 dB of spectrum error (Halo's shimmer loop). Not reached.

+ 5 - 0
src/core/Effects.cpp

@@ -4841,6 +4841,8 @@ EffectSlot makeEffectSlot (EffectKind kind)
     if (kind == EffectKind::foilPlate) slot.params[(std::size_t) verbs::foil::revision] = 1.0f;
     if (kind == EffectKind::foilPlate) // round 190ln: … and Foil Plate the reference's EQ / bass-decay laws (hidden)
         slot.params[(std::size_t) verbs::foil::reaLaw] = 1.0f;
+    if (kind == EffectKind::atrium) // round 190ls: … and Atrium the ValhallaRoom role on the dense late tank (hidden)
+        slot.params[(std::size_t) verbs::atrium::reaLaw] = 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;
@@ -5049,6 +5051,9 @@ void upgradeLoadedEffectParams (EffectSlot& slot, std::size_t savedCount) noexce
         // round 190ln: a Foil Plate saved before the reference's EQ / bass-decay laws keeps revision 1 as it was, bit for bit
         if (slot.kind == EffectKind::foilPlate && savedCount <= (std::size_t) verbs::foil::reaLaw)
             slot.params[(std::size_t) verbs::foil::reaLaw] = 0.0f;
+        // round 190ls: an Atrium saved before the dense tank keeps revision 1 as it was, bit for bit
+        if (slot.kind == EffectKind::atrium && savedCount <= (std::size_t) verbs::atrium::reaLaw)
+            slot.params[(std::size_t) verbs::atrium::reaLaw] = 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)

+ 422 - 110
src/core/LynxVerbs.cpp

@@ -6,6 +6,7 @@
 #include <cstdio>
 #include <cstdlib>
 #include <string>
+#include <type_traits>
 
 #include "core/Biquad.h"
 #include "core/Effects.h"
@@ -35,6 +36,24 @@ constexpr double inApCoef[4] = { 0.75, 0.75, 0.625, 0.625 };
 constexpr double loopApFraction = 0.16;
 constexpr double earlyApMs[2][2] = { { 7.13, 2.31 }, { 6.47, 2.83 } };
 
+// round 190ls: the dense late tank (Settings::dense): 32 lines, lengths as multiples of the geometric mean of the shape's
+// set (× lineScale), spread over 0.55 … 1.6 of it on a near-geometric grid with jitter, alternately in the two halves
+// (LYNX's own set: no common factors, every half spanning the whole range)
+constexpr int denseCount = 32, denseHalf = 16;
+// the outputs read every line through two Walsh rows (22 and 13): sign of line j = (−1)^popcount (j & row)
+constexpr float walshSign (int j, unsigned row) noexcept { return (__builtin_popcount ((unsigned) j & row) & 1) != 0 ? -1.0f : 1.0f; }
+constexpr std::array<float, 32> walshRow (unsigned row) noexcept
+{
+    std::array<float, 32> a {};
+    for (int j = 0; j < 32; ++j)
+        a[(std::size_t) j] = walshSign (j, row);
+    return a;
+}
+constexpr auto denseOutL = walshRow (22u), denseOutR = walshRow (13u);
+constexpr double denseRatio[denseCount] = {
+    0.553, 0.571, 0.588, 0.611, 0.629, 0.652, 0.673, 0.697, 0.719, 0.743, 0.769, 0.793, 0.821, 0.847, 0.877, 0.905,
+    0.937, 0.967, 1.001, 1.033, 1.069, 1.103, 1.142, 1.179, 1.219, 1.259, 1.303, 1.345, 1.391, 1.437, 1.487, 1.597 };
+
 constexpr int earlyTaps = 14;
 constexpr int buildTaps = 40;
 constexpr int maxBandSections = 16;
@@ -95,6 +114,47 @@ struct Line
     }
 };
 
+// round 190ls: the dense tank's 32 lines in one buffer, frame-major (frame f holds every line's sample at f × 32 … f × 32 + 31):
+// every line has the same capacity and moves on one write position, so a sample's 32 writes are one contiguous store (measured
+// against one buffer per line and line after line in one buffer: the fewest cycles)
+struct DenseBank
+{
+    static constexpr int lines = 32;
+    std::vector<float> buf;
+    int mask = 0, pos = 0;
+
+    void allocate (int samples)
+    {
+        const auto n = nextPow2 (std::max (4, samples + 4));
+        buf.assign ((std::size_t) n * lines, 0.0f);
+        mask = n - 1;
+        pos = 0;
+    }
+    void clear() noexcept
+    {
+        std::fill (buf.begin(), buf.end(), 0.0f);
+        pos = 0;
+    }
+    // line j's sample written d writes ago (d ≥ 1)
+    float read (int j, int d) const noexcept { return buf[(std::size_t) ((((pos - d) & mask) * lines) + j)]; }
+    // fractional delay (≥ 2), 4-point Hermite (as Line::readFrac)
+    float readFrac (int j, double d) const noexcept
+    {
+        const auto i = (int) d;
+        const auto f = (float) (d - i);
+        const auto xm1 = read (j, i - 1), x0 = read (j, i), x1 = read (j, i + 1), x2 = read (j, i + 2);
+        const auto c1 = 0.5f * (x1 - xm1);
+        const auto c2 = xm1 - 2.5f * x0 + 2.0f * x1 - 0.5f * x2;
+        const auto c3 = 0.5f * (x2 - xm1) + 1.5f * (x0 - x1);
+        return ((c3 * f + c2) * f + c1) * f + x0;
+    }
+    void write (const float* x) noexcept
+    {
+        std::copy (x, x + lines, buf.begin() + (std::ptrdiff_t) pos * lines);
+        pos = (pos + 1) & mask;
+    }
+};
+
 struct Allpass
 {
     Line line;
@@ -408,7 +468,15 @@ struct Engine::Impl
     bool bellOn[3] {};
     int onsetD[onsetSteps][onsetChans] {};
 
-    Impl (double maxLine, double maxPre) : maxLineSec (maxLine), maxPreSec (maxPre)
+    // ---- the dense late tank (round 190ls; allocated only for an engine made with dense = true) ----
+    bool denseAlloc = false;
+    DenseBank dLine;
+    double dCur[denseCount] {}, dKey[14 + denseCount] {};
+    bool dDesigned = false;
+    float dB0[loopShelves][denseCount] {}, dB1[loopShelves][denseCount] {}, dA1[loopShelves][denseCount] {}, dZ[loopShelves][denseCount] {};
+    float dBw[denseCount] {}, dLc[denseCount] {};
+
+    Impl (double maxLine, double maxPre, bool dense) : maxLineSec (maxLine), maxPreSec (maxPre), denseAlloc (dense)
     {
         Lcg r { 0x2545F491u };
         for (int c = 0; c < 2; ++c)
@@ -452,6 +520,8 @@ struct Engine::Impl
             lines[i].allocate (maxLine + (int) (0.05 * sr));
             loopAp[i].line.allocate ((int) (0.2 * maxLineSec * sr) + 8);
         }
+        if (denseAlloc)
+            dLine.allocate (maxLine + (int) (0.05 * sr));
         for (auto& sh : shifters)
             sh.prepare (sr, 0.06);
         for (int k = 0; k < onsetSteps; ++k)
@@ -518,6 +588,16 @@ struct Engine::Impl
         mmInc = -1.0;
         renorm = 0;
         loopDesigned = toneDesigned = false;
+        if (denseAlloc)
+        {
+            dLine.clear();
+            for (auto& row : dZ)
+                for (auto& z : row)
+                    z = 0.0f;
+            for (int j = 0; j < denseCount; ++j)
+                dBw[j] = dLc[j] = 0.0f;
+            dDesigned = false;
+        }
     }
 
     double targetLen (const Settings& s, int i) const noexcept
@@ -705,9 +785,65 @@ struct Engine::Impl
         for (int b = 0; b < engineBands; ++b)
             tb[b] = std::tan (pi * std::min (bandHz[b], 0.45 * sr) / sr);
         for (int i = 0; i < lineCount; ++i)
+        {
+            float b0[loopShelves], b1[loopShelves], a1[loopShelves];
+            designLine (s, sr, key[14 + i], tc, tb, b0, b1, a1);
+            for (int k = 0; k < loopShelves; ++k)
+            {
+                shB0[k][i] = b0[k];
+                shB1[k][i] = b1[k];
+                shA1[k][i] = a1[k];
+            }
+        }
+    }
+
+    // round 190ls: the dense tank's line j (samples) for the shape and lineScale, whole samples
+    double denseTarget (const Settings& s, int j) const noexcept
+    {
+        const auto shape = std::clamp (s.shape, 0, 2);
+        double mean = 0.0;
+        for (int i = 0; i < lineCount; ++i)
+            mean += std::log (shapes[shape][i]);
+        const auto ms = std::exp (mean / lineCount) * denseRatio[j] * std::max (0.0, s.lineScale);
+        return std::floor (clampPos (ms * sr / 1000.0, 8.0, maxLineSec * sr));
+    }
+    // the dense tank's loop filters (as designLoop's, per line, redone only when a setting or a length moves)
+    void designDense (const Settings& s) noexcept
+    {
+        double key[14 + denseCount] = { s.rt60, s.lowMult, s.lowXover, s.highMult, s.highXover, s.gateSec };
+        for (int b = 0; b < engineBands; ++b)
+            key[6 + b] = s.bandRtMult[b];
+        for (int j = 0; j < denseCount; ++j)
+            key[14 + j] = dCur[j];
+        if (dDesigned && std::equal (std::begin (key), std::end (key), std::begin (dKey)))
+            return;
+        std::copy (std::begin (key), std::end (key), std::begin (dKey));
+        dDesigned = true;
+        double tc[loopShelves], tb[engineBands];
+        for (int k = 0; k < loopShelves; ++k)
+            tc[k] = std::tan (pi * std::min (loopShelfHz[k], 0.45 * sr) / sr);
+        for (int b = 0; b < engineBands; ++b)
+            tb[b] = std::tan (pi * std::min (bandHz[b], 0.45 * sr) / sr);
+        for (int j = 0; j < denseCount; ++j)
+        {
+            float b0[loopShelves], b1[loopShelves], a1[loopShelves];
+            designLine (s, sr, key[14 + j], tc, tb, b0, b1, a1);
+            for (int k = 0; k < loopShelves; ++k)
+            {
+                dB0[k][j] = b0[k];
+                dB1[k][j] = b1[k];
+                dA1[k][j] = a1[k];
+            }
+        }
+    }
+
+    // one line's loop filter (law 1): a gain folded into six first-order shelves meeting the per-band loss of a line of
+    // len samples (designLoop; round 190ls: also the dense tank's lines)
+    static void designLine (const Settings& s, double sr, double len, const double* tc, const double* tb, float* b0, float* b1, float* a1) noexcept
+    {
         {
             double target[engineBands], shelf[loopShelves], gainDb = 0.0;
-            bandLossDb (s, sr, key[14 + i], target);
+            bandLossDb (s, sr, len, target);
             fitShelves (tc, loopShelves, tb, target, 1e-3, gainDb, shelf);
             // never above unity at any frequency: the highest point of the response on a grid of 40 frequencies from
             // 0 Hz to the top (the cascade of first-order shelves is smooth: between two grid points it cannot rise by
@@ -731,9 +867,9 @@ struct Engine::Impl
             for (int k = 0; k < loopShelves; ++k)
             {
                 const auto r = std::pow (10.0, shelf[k] / 40.0), den = 1.0 + tc[k] / r, fold = k == 0 ? g : 1.0;
-                shB0[k][i] = (float) (fold * (1.0 + tc[k] * r) / den);
-                shB1[k][i] = (float) (fold * (tc[k] * r - 1.0) / den);
-                shA1[k][i] = (float) ((tc[k] / r - 1.0) / den);
+                b0[k] = (float) (fold * (1.0 + tc[k] * r) / den);
+                b1[k] = (float) (fold * (tc[k] * r - 1.0) / den);
+                a1[k] = (float) ((tc[k] / r - 1.0) / den);
             }
         }
     }
@@ -828,6 +964,28 @@ struct Engine::Impl
                 curLen[i] = target[i];
             loopAp[i].len = std::clamp ((int) (target[i] * loopApFraction), 1, loopAp[i].line.mask - 2);
         }
+        // round 190ls: the dense tank (Atrium's ValhallaRoom role; not with a gate, a shimmer or split sides)
+        const auto dense = denseAlloc && s.dense == 1 && s.gateSec <= 0.0 && s.splitSides == false
+                           && s.shiftFeedback * s.shiftMix <= 0.0;
+        double dTarget[denseCount] {};
+        if (dense)
+        {
+            for (int j = 0; j < denseCount; ++j)
+            {
+                dTarget[j] = denseTarget (s, j);
+                if (first || dCur[j] < 8.0)
+                    dCur[j] = dTarget[j];
+            }
+            designDense (s);
+        }
+        bool dGlide = false; // (a length gliding: every line read through the interpolator, the glide run per sample)
+        int dInt[denseCount] {};
+        if (dense)
+            for (int j = 0; j < denseCount; ++j)
+            {
+                dGlide = dGlide || dCur[j] != dTarget[j];
+                dInt[j] = (int) dTarget[j];
+            }
         first = false;
         double step[lineCount]; // round 190ie: the glide per sample (fixed, or a tempo change spread over the block)
         for (int i = 0; i < lineCount; ++i)
@@ -886,6 +1044,10 @@ struct Engine::Impl
                     onsetD[k][j] = std::clamp ((int) (std::clamp (s.onsetSec, 0.001, maxOnsetSec) * onsetSpan[k] * onsetFrac[k][j] * sr), 1,
                                                onsetLine[k][j].mask - 2);
         const auto bwOn = absorb[0].bw.a != 0.0f, lcOn = absorb[0].lc.a != 1.0f;
+        const auto bwA = absorb[0].bw.a, lcA = absorb[0].lc.a;
+        // (the tank's stored energy does not depend on its size, so 32 lines read at 1 / √32 would be 6 dB under the
+        // 8-line tank: read at its 1 / √8, the levels of the front-ends hold)
+        const auto denseNorm = (float) (1.0 / std::sqrt ((double) lineCount));
         constexpr float r2 = 0.70710678f; // (two inputs spread over four channels)
         constexpr float tiny = 1.0e-18f; // keeps the recirculating states out of the denormal range
 
@@ -1017,121 +1179,235 @@ struct Engine::Impl
             }
 
             // late tank
-            float sOut[lineCount];
-            for (int i = 0; i < lineCount; ++i)
+            float lateL, lateR;
+            if (dense)
             {
-                curLen[i] += std::clamp (target[i] - curLen[i], -step[i], step[i]);
-                if (s.lengthSpread > 0) // (round 190ie: the loop all-pass follows its gliding line)
-                    loopAp[i].len = std::clamp ((int) (curLen[i] * loopApFraction), 1, loopAp[i].line.mask - 2);
-                const auto c = lfoC[i] * lfoRc[i] - lfoS[i] * lfoRs[i];
-                lfoS[i] = lfoS[i] * lfoRc[i] + lfoC[i] * lfoRs[i];
-                lfoC[i] = c;
-                const auto dl = std::max (2.0, curLen[i] - modDepth * 0.5 * (1.0 + lfoS[i]));
-                auto y = lines[i].readFrac (dl);
-                if (apG[i] != 0.0f)
-                    y = loopAp[i].process (y, apG[i]);
-                sOut[i] = y;
-            }
-            for (int k = 0; k < loopShelves; ++k)
-                for (int i = 0; i < lineCount; ++i)
+                // round 190ls: the dense tank (32 lines, two halves of 16)
+                float y[denseCount];
+                // the reference's layout: in each group of four lines two move — modulator j / 4 of the 8-line tank's
+                // eight, one line each way — and two stay (read at whole samples unless their length glides)
+                if (dGlide)
+                    for (int j = 0; j < denseCount; ++j)
+                        dCur[j] += std::clamp (dTarget[j] - dCur[j], -0.25, 0.25);
+                const auto half = 0.5 * modDepth;
+                for (int g = 0; g < denseCount; g += 4)
                 {
-                    const auto y = shB0[k][i] * sOut[i] + shZ[k][i];
-                    shZ[k][i] = shB1[k][i] * sOut[i] - shA1[k][i] * y;
-                    sOut[i] = y;
+                    const auto m = half * lfoS[g >> 2];
+                    y[g] = dLine.readFrac (g, std::max (2.0, dCur[g] - half - m));
+                    y[g + 1] = dLine.readFrac (g + 1, std::max (2.0, dCur[g + 1] - half + m));
+                    if (dGlide)
+                    {
+                        y[g + 2] = dLine.readFrac (g + 2, dCur[g + 2]);
+                        y[g + 3] = dLine.readFrac (g + 3, dCur[g + 3]);
+                    }
+                    else
+                    {
+                        y[g + 2] = dLine.read (g + 2, dInt[g + 2]);
+                        y[g + 3] = dLine.read (g + 3, dInt[g + 3]);
+                    }
                 }
-            if (bwOn)
                 for (int i = 0; i < lineCount; ++i)
-                    sOut[i] = absorb[i].bw.lp (sOut[i]);
-            if (lcOn)
-                for (int i = 0; i < lineCount; ++i)
-                    sOut[i] -= absorb[i].lc.lp (sOut[i]);
-
-            float lateL = (sOut[0] + sOut[1] + sOut[2] - sOut[3] + sOut[4] + sOut[5] - sOut[6] + sOut[7]) * norm;
-            float lateR = (sOut[0] - sOut[1] + sOut[2] + sOut[3] + sOut[4] - sOut[5] + sOut[6] + sOut[7]) * norm;
-            if (s.splitSides)
-            {
-                lateL = (sOut[0] + sOut[1] + sOut[2] - sOut[3]) * norm * 1.41421356f;
-                lateR = (sOut[4] - sOut[5] + sOut[6] + sOut[7]) * norm * 1.41421356f;
+                {
+                    const auto c = lfoC[i] * lfoRc[i] - lfoS[i] * lfoRs[i];
+                    lfoS[i] = lfoS[i] * lfoRc[i] + lfoC[i] * lfoRs[i];
+                    lfoC[i] = c;
+                }
+                for (int k = 0; k < loopShelves; ++k)
+                    for (int j = 0; j < denseCount; ++j)
+                    {
+                        const auto v = dB0[k][j] * y[j] + dZ[k][j];
+                        dZ[k][j] = dB1[k][j] * y[j] - dA1[k][j] * v;
+                        y[j] = v;
+                    }
+                if (bwOn)
+                    for (int j = 0; j < denseCount; ++j)
+                        y[j] = dBw[j] = y[j] + bwA * (dBw[j] - y[j]);
+                if (lcOn)
+                    for (int j = 0; j < denseCount; ++j)
+                    {
+                        dLc[j] = y[j] + lcA * (dLc[j] - y[j]);
+                        y[j] -= dLc[j];
+                    }
+                // outputs: two Walsh rows (22 and 13) over all 32 lines
+                float oL = 0.0f, oR = 0.0f;
+                for (int j = 0; j < denseCount; ++j)
+                {
+                    oL += denseOutL[j] * y[j];
+                    oR += denseOutR[j] * y[j];
+                }
+                lateL = oL * denseNorm;
+                lateR = oR * denseNorm;
+                const float in[2] = { (1.0f - onsetFeed) * (d[0] + send * e[0]) + onsetFeed * on[0] + tiny,
+                                      (1.0f - onsetFeed) * (d[1] + send * e[1]) + onsetFeed * on[1] + tiny };
+                // mixing: a 16-point Hadamard inside each half (four butterfly stages, × 1/4), then the halves rotated
+                // into each other by crossFeed × 45° (swinging by the matrix modulator)
+                {
+                    // (stage by stage over both halves at once; a stage of span len pairs k and k + len in every block of
+                    // 2 · len: the inner loops run over contiguous lines, so the wide stages are vector operations)
+                    const auto stage = [&y] (auto span) noexcept
+                    {
+                        constexpr int len = decltype (span)::value;
+                        for (int b = 0; b < denseCount; b += 2 * len)
+                            for (int k = b; k < b + len; ++k)
+                            {
+                                const auto u = y[k], w = y[k + len];
+                                y[k] = u + w;
+                                y[k + len] = u - w;
+                            }
+                    };
+                    stage (std::integral_constant<int, 1> {});
+                    stage (std::integral_constant<int, 2> {});
+                    stage (std::integral_constant<int, 4> {});
+                    stage (std::integral_constant<int, 8> {});
+                }
+                auto crossCos = (float) crossCos0, crossSin = (float) crossSin0;
+                if (mmDepth > 0.0)
+                {
+                    const auto c = mmC * mmRc - mmS * mmRs;
+                    mmS = mmS * mmRc + mmC * mmRs;
+                    mmC = c;
+                    const auto dlt = mmDepth * mmS;
+                    crossCos = (float) std::cos (crossAngle + dlt);
+                    crossSin = (float) std::sin (crossAngle + dlt);
+                }
+                crossCos *= 0.25f;
+                crossSin *= 0.25f;
+                float w[denseCount];
+                for (int j = 0; j < denseHalf; ++j)
+                {
+                    const auto a = y[j], bb = y[j + denseHalf];
+                    // the input: ±1/4 on every line of its half; revision 1's four build groups on lines j & 3, ±1/2
+                    const auto sgIn = (j & 1) == 0 ? 0.25f : -0.25f;
+                    auto inL = sgIn * in[0], inR = sgIn * in[1];
+                    if (build && split)
+                    {
+                        const auto sg = (j & 4) == 0 ? 0.5f : -0.5f;
+                        inL += sg * splitIn[0][j & 3];
+                        inR += sg * splitIn[1][j & 3];
+                    }
+                    w[j] = crossCos * a + crossSin * bb + inL;
+                    w[j + denseHalf] = -crossSin * a + crossCos * bb + inR;
+                }
+                dLine.write (w);
             }
-            const float in[2] = { (1.0f - onsetFeed) * (d[0] + send * e[0]) + onsetFeed * on[0] + tiny,
-                                  (1.0f - onsetFeed) * (d[1] + send * e[1]) + onsetFeed * on[1] + tiny };
-            if (gated)
+            else
             {
-                lateL = 0.3f * lateL + d[0];
-                lateR = 0.3f * lateR + d[1];
-            }
+                float sOut[lineCount];
+                for (int i = 0; i < lineCount; ++i)
+                {
+                    curLen[i] += std::clamp (target[i] - curLen[i], -step[i], step[i]);
+                    if (s.lengthSpread > 0) // (round 190ie: the loop all-pass follows its gliding line)
+                        loopAp[i].len = std::clamp ((int) (curLen[i] * loopApFraction), 1, loopAp[i].line.mask - 2);
+                    const auto c = lfoC[i] * lfoRc[i] - lfoS[i] * lfoRs[i];
+                    lfoS[i] = lfoS[i] * lfoRc[i] + lfoC[i] * lfoRs[i];
+                    lfoC[i] = c;
+                    const auto dl = std::max (2.0, curLen[i] - modDepth * 0.5 * (1.0 + lfoS[i]));
+                    auto y = lines[i].readFrac (dl);
+                    if (apG[i] != 0.0f)
+                        y = loopAp[i].process (y, apG[i]);
+                    sOut[i] = y;
+                }
+                for (int k = 0; k < loopShelves; ++k)
+                    for (int i = 0; i < lineCount; ++i)
+                    {
+                        const auto y = shB0[k][i] * sOut[i] + shZ[k][i];
+                        shZ[k][i] = shB1[k][i] * sOut[i] - shA1[k][i] * y;
+                        sOut[i] = y;
+                    }
+                if (bwOn)
+                    for (int i = 0; i < lineCount; ++i)
+                        sOut[i] = absorb[i].bw.lp (sOut[i]);
+                if (lcOn)
+                    for (int i = 0; i < lineCount; ++i)
+                        sOut[i] -= absorb[i].lc.lp (sOut[i]);
+
+                lateL = (sOut[0] + sOut[1] + sOut[2] - sOut[3] + sOut[4] + sOut[5] - sOut[6] + sOut[7]) * norm;
+                lateR = (sOut[0] - sOut[1] + sOut[2] + sOut[3] + sOut[4] - sOut[5] + sOut[6] + sOut[7]) * norm;
+                if (s.splitSides)
+                {
+                    lateL = (sOut[0] + sOut[1] + sOut[2] - sOut[3]) * norm * 1.41421356f;
+                    lateR = (sOut[4] - sOut[5] + sOut[6] + sOut[7]) * norm * 1.41421356f;
+                }
+                const float in[2] = { (1.0f - onsetFeed) * (d[0] + send * e[0]) + onsetFeed * on[0] + tiny,
+                                      (1.0f - onsetFeed) * (d[1] + send * e[1]) + onsetFeed * on[1] + tiny };
+                if (gated)
+                {
+                    lateL = 0.3f * lateL + d[0];
+                    lateR = 0.3f * lateR + d[1];
+                }
 
-            // mixing: each half through two layers of rotations by mixAngle × 45° (at 45° a normalised 4-point
-            // Hadamard up to signs), then the halves rotated into each other by crossFeed × 45°, swinging by the
-            // matrix modulator (orthogonal for any amount)
-            auto crossCos = (float) crossCos0, crossSin = (float) crossSin0;
-            float hc[2] = { mc, mc }, hs[2] = { msn, msn };
-            if (mmDepth > 0.0)
-            {
-                const auto c = mmC * mmRc - mmS * mmRs;
-                mmS = mmS * mmRc + mmC * mmRs;
-                mmC = c;
-                const auto dlt = mmDepth * mmS, d2 = dlt * dlt;
-                const auto cd = 1.0 - d2 * (0.5 - d2 * (1.0 / 24.0 - d2 * (1.0 / 720.0)));
-                const auto sd = dlt * (1.0 - d2 * (1.0 / 6.0 - d2 * (1.0 / 120.0 - d2 * (1.0 / 5040.0))));
-                crossCos = (float) (crossCos0 * cd - crossSin0 * sd);
-                crossSin = (float) (crossSin0 * cd + crossCos0 * sd);
-                // the rotations inside the halves swing too, the two halves in opposite ways
-                hc[0] = (float) (mc * cd - msn * sd);
-                hs[0] = (float) (msn * cd + mc * sd);
-                hc[1] = (float) (mc * cd + msn * sd);
-                hs[1] = (float) (msn * cd - mc * sd);
-            }
-            float h[lineCount];
-            for (int half = 0; half < lineCount; half += 4)
-            {
-                const auto qc = hc[half / 4], qs = hs[half / 4];
-                const auto a0 = qc * sOut[half] + qs * sOut[half + 1], a1 = qc * sOut[half + 1] - qs * sOut[half];
-                const auto a2 = qc * sOut[half + 2] + qs * sOut[half + 3], a3 = qc * sOut[half + 3] - qs * sOut[half + 2];
-                h[half] = qc * a0 + qs * a2;
-                h[half + 2] = qc * a2 - qs * a0;
-                h[half + 1] = qc * a1 + qs * a3;
-                h[half + 3] = qc * a3 - qs * a1;
-            }
-            for (int i = 0; i < 4; ++i)
-            {
-                const auto a = h[i], b = h[i + 4];
-                auto u = crossCos * a + crossSin * b, w = -crossSin * a + crossCos * b;
-                if (shimmer > 0.0f && (i & 1) == 0)
+                // mixing: each half through two layers of rotations by mixAngle × 45° (at 45° a normalised 4-point
+                // Hadamard up to signs), then the halves rotated into each other by crossFeed × 45°, swinging by the
+                // matrix modulator (orthogonal for any amount)
+                auto crossCos = (float) crossCos0, crossSin = (float) crossSin0;
+                float hc[2] = { mc, mc }, hs[2] = { msn, msn };
+                if (mmDepth > 0.0)
                 {
-                    const auto second = i == 2 && voice2 > 0.0f;
-                    const auto r = second ? ratio2 : ratio;
-                    const auto amount = second ? shimmer * voice2 : shimmer;
-                    if (s.shimmerEnergy > 0.0)
+                    const auto c = mmC * mmRc - mmS * mmRs;
+                    mmS = mmS * mmRc + mmC * mmRs;
+                    mmC = c;
+                    const auto dlt = mmDepth * mmS, d2 = dlt * dlt;
+                    const auto cd = 1.0 - d2 * (0.5 - d2 * (1.0 / 24.0 - d2 * (1.0 / 720.0)));
+                    const auto sd = dlt * (1.0 - d2 * (1.0 / 6.0 - d2 * (1.0 / 120.0 - d2 * (1.0 / 5040.0))));
+                    crossCos = (float) (crossCos0 * cd - crossSin0 * sd);
+                    crossSin = (float) (crossSin0 * cd + crossCos0 * sd);
+                    // the rotations inside the halves swing too, the two halves in opposite ways
+                    hc[0] = (float) (mc * cd - msn * sd);
+                    hs[0] = (float) (msn * cd + mc * sd);
+                    hc[1] = (float) (mc * cd + msn * sd);
+                    hs[1] = (float) (msn * cd - mc * sd);
+                }
+                float h[lineCount];
+                for (int half = 0; half < lineCount; half += 4)
+                {
+                    const auto qc = hc[half / 4], qs = hs[half / 4];
+                    const auto a0 = qc * sOut[half] + qs * sOut[half + 1], a1 = qc * sOut[half + 1] - qs * sOut[half];
+                    const auto a2 = qc * sOut[half + 2] + qs * sOut[half + 3], a3 = qc * sOut[half + 3] - qs * sOut[half + 2];
+                    h[half] = qc * a0 + qs * a2;
+                    h[half + 2] = qc * a2 - qs * a0;
+                    h[half + 1] = qc * a1 + qs * a3;
+                    h[half + 3] = qc * a3 - qs * a1;
+                }
+                for (int i = 0; i < 4; ++i)
+                {
+                    const auto a = h[i], b = h[i + 4];
+                    auto u = crossCos * a + crossSin * b, w = -crossSin * a + crossCos * b;
+                    if (shimmer > 0.0f && (i & 1) == 0)
                     {
-                        const auto bb = shimmerB[second ? 1 : 0], keep = shimmerKeep[second ? 1 : 0];
-                        auto hp = [&] (int k, float v)
+                        const auto second = i == 2 && voice2 > 0.0f;
+                        const auto r = second ? ratio2 : ratio;
+                        const auto amount = second ? shimmer * voice2 : shimmer;
+                        if (s.shimmerEnergy > 0.0)
                         {
-                            shiftHp[k][0] += hpC * (v - shiftHp[k][0]);
-                            v -= shiftHp[k][0];
-                            shiftHp[k][1] += hpC * (v - shiftHp[k][1]);
-                            return v - shiftHp[k][1];
-                        };
-                        u = keep * u + bb * hp (i / 2, shifters[i / 2].process (u, r));
-                        w = keep * w + bb * hp (2 + i / 2, shifters[2 + i / 2].process (w, r));
+                            const auto bb = shimmerB[second ? 1 : 0], keep = shimmerKeep[second ? 1 : 0];
+                            auto hp = [&] (int k, float v)
+                            {
+                                shiftHp[k][0] += hpC * (v - shiftHp[k][0]);
+                                v -= shiftHp[k][0];
+                                shiftHp[k][1] += hpC * (v - shiftHp[k][1]);
+                                return v - shiftHp[k][1];
+                            };
+                            u = keep * u + bb * hp (i / 2, shifters[i / 2].process (u, r));
+                            w = keep * w + bb * hp (2 + i / 2, shifters[2 + i / 2].process (w, r));
+                        }
+                        else
+                        {
+                            u = (1.0f - amount) * u + amount * shifters[i / 2].process (u, r);
+                            w = (1.0f - amount) * w + amount * shifters[2 + i / 2].process (w, r);
+                        }
+                    }
+                    const auto alt = (i & 1) == 0 ? 0.5f : -0.5f;
+                    if (build && split)
+                    {
+                        lines[i].write (u + alt * in[0] + splitIn[0][i]);
+                        lines[i + 4].write (w + alt * in[1] + splitIn[1][i]);
                     }
                     else
                     {
-                        u = (1.0f - amount) * u + amount * shifters[i / 2].process (u, r);
-                        w = (1.0f - amount) * w + amount * shifters[2 + i / 2].process (w, r);
+                        lines[i].write (u + alt * in[0]);
+                        lines[i + 4].write (w + alt * in[1]);
                     }
                 }
-                const auto alt = (i & 1) == 0 ? 0.5f : -0.5f;
-                if (build && split)
-                {
-                    lines[i].write (u + alt * in[0] + splitIn[0][i]);
-                    lines[i + 4].write (w + alt * in[1] + splitIn[1][i]);
-                }
-                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
             {
@@ -1412,7 +1688,7 @@ struct Engine::Impl
     }
 };
 
-Engine::Engine (double maxLineSec, double maxPredelaySec) : impl (std::make_unique<Impl> (maxLineSec, maxPredelaySec)) {}
+Engine::Engine (double maxLineSec, double maxPredelaySec, bool dense) : impl (std::make_unique<Impl> (maxLineSec, maxPredelaySec, dense)) {}
 Engine::~Engine() = default;
 void Engine::prepare (double sampleRate) { impl->prepare (sampleRate); }
 void Engine::reset() noexcept { impl->reset(); }
@@ -1566,6 +1842,8 @@ void fitOverride (Settings& s)
         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 == "dense") s.dense = (int) v;
+        else if (k == "mrate") s.modRateHz *= v;
         else if (k == "split") s.buildSplit = v >= 0.5;
         else if (k == "lbw") s.loopBandwidth = v;
         else if (k == "hcut") s.outHighCut = v;
@@ -1589,7 +1867,7 @@ void fitOverride (Settings& s)
 class VerbEffect : public Effect
 {
 public:
-    VerbEffect (EffectKind k, double maxLineSec, double maxPreSec) : kind (k), engine (maxLineSec, maxPreSec) {}
+    VerbEffect (EffectKind k, double maxLineSec, double maxPreSec, bool dense = false) : kind (k), engine (maxLineSec, maxPreSec, dense) {}
 
     void prepare (double sampleRate) noexcept override
     {
@@ -1845,6 +2123,25 @@ LYNX_FIT_TABLE Rev1Trim foilTrim[foil::typeCount + 1] = {
     {}, // the measured plate voicing
 };
 LYNX_FIT_TABLE Rev1Trim haloTrim[7] = {};                   // per reverb mode
+// round 190ls: Atrium's ValhallaRoom role on the dense tank (atrium::reaLaw), per type on top of revision 1's trims: the
+// dense tank's level and tone against the reference's impulses (refcap030's type sweep, two closed-loop passes, 3-point
+// smoothed over the bands; Large Room, the type of every other capture, 0.65 dB under the sweep's level and half its lift at
+// 63 / 125 Hz: at the sweep's trim the music, bass and test signals of the pairs / sr blocks and of tp172d / refcap182 /
+// verb183b sat 0.5 … 2 dB over the reference)
+LYNX_FIT_TABLE Rev1Trim roomTrim[atrium::typeCount] = {
+    { -0.60, { 1.03, 0.50, -0.10, 0.05, -0.27, -0.79, 0.09, 0.54 } }, // Large Room
+    { -2.19, { 4.15, -0.45, -0.07, 0.99, -0.27, -0.42, 0.23, 0.60 } }, // Medium Room
+    { -0.50, { 1.74, -0.45, -0.11, 0.45, -0.00, -0.30, 0.42, 1.86 } }, // Bright Room
+    { -0.90, { 5.12, 1.05, -0.79, -0.20, -0.22, -0.17, 0.33, 0.91 } }, // Large Chamber
+    { -0.22, { 2.35, -0.07, -0.42, 0.41, -0.23, -0.19, 0.50, 0.02 } }, // Dark Room
+    { -0.14, { 3.70, 1.76, 0.92, 0.09, -0.98, -1.17, -0.62, 0.23 } }, // Dark Chamber
+    { -0.90, { 5.38, 0.64, -0.91, 0.26, -0.09, -0.27, 0.36, 0.77 } }, // Dark Space
+    { -0.55, { 4.95, 0.34, -0.59, 0.62, -0.06, -0.37, 0.06, 0.44 } }, // Deep Space
+    { -0.57, { 4.55, 0.62, -0.71, 0.55, 0.20, -0.52, -0.15, 0.46 } }, // Mirror Space
+    { -0.40, { 4.47, 0.77, 0.41, 0.10, -0.67, -0.45, -0.16, 0.43 } }, // Vast Space
+    { -0.38, { 5.46, 0.52, -0.40, 0.80, -0.20, -0.65, -0.08, 0.34 } }, // Distant Space
+    {}, // Dense Room (no capture)
+};
 #ifdef LYNX_VERB_FIT
 // the fitting harness: LYNX_VTRIM=<file>, lines "<epoch|atrium|foil|halo> <index> <gain dB> <8 × dB>"
 bool loadTrims()
@@ -1859,8 +2156,8 @@ bool loadTrims()
                                 &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;
+                Rev1Trim* table = n == "epoch" ? epochTrim : n == "atrium" ? atriumTrim : n == "foil" ? foilTrim : n == "halo" ? haloTrim : n == "room" ? roomTrim : nullptr;
+                const int count = n == "epoch" ? epoch::modeCount : n == "atrium" || n == "room" ? atrium::typeCount : n == "foil" ? foil::typeCount + 1 : 7;
                 if (table != nullptr && i >= 0 && i < count)
                     table[i] = t;
             }
@@ -2101,10 +2398,23 @@ LYNX_FIT_TABLE LawVoicing atriumLaw[atrium::typeCount] = {
 
 double atriumDecaySec (float v) { return skewLaw (v, 0.1, 100.0, 5.717); }
 
+// round 190ls (atrium::reaLaw): the ValhallaRoom role on the dense late tank, after revision 1. The reference's late network
+// is 32 lines whose eight modulators move half of them (static REA); its steady 1 kHz tone (refcap030's staircase) then
+// swings by 2.0 dB (sd of 10 ms levels) where the 8-line tank's swung 1.2 dB and sat 2 dB under it on average. The dense tank,
+// its moving lines at four times revision 1's depth, meets it (2.3 dB; Late mod depth 50 %, 0.5 Hz: ±1.1 ms), and the trims
+// per type (roomTrim) take its tone back onto the reference's impulses (docs/analise/REA_rodada190ls.md)
+LYNX_FIT_TABLE double roomModScale = 4.0;
+void applyRoomLaw (const EffectParams& p, Settings& s) noexcept
+{
+    s.dense = 1;
+    s.modDepthMs *= roomModScale;
+    applyTrim (s, roomTrim[choice (p[19], atrium::typeCount)]);
+}
+
 class AtriumFx final : public VerbEffect
 {
 public:
-    AtriumFx() : VerbEffect (EffectKind::atrium, 0.25, 1.05) {}
+    AtriumFx() : VerbEffect (EffectKind::atrium, 0.25, 1.05, true) {} // (round 190ls: with the dense tank)
 
 protected:
     int structure (const EffectParams& p) const noexcept override { return choice (p[19], atrium::typeCount) + (p[atrium::engineLaw] >= 0.5f ? 1000 : 0); }
@@ -2168,6 +2478,8 @@ protected:
             s.revision = 1; // round 190it
             applyTrim (s, atriumTrim[choice (p[19], atrium::typeCount)]);
             s.buildSplit = true;
+            if (p[atrium::reaLaw] >= 0.5f)
+                applyRoomLaw (p, s);
         }
     }
 };

+ 9 - 1
src/core/LynxVerbs.h

@@ -139,6 +139,10 @@ struct Settings
     // (gLow + gHigh·s/ω0) / (1 + s/ω0), ω0 = 2π·hz (not pre-warped), gLow or gHigh the shelf's gain (Foil Plate's ValhallaPlate
     // role, read by static REA); 2 = the second-order shelves every front-end had (projects saved before, every other effect)
     int shelfOrder = 2;
+    // round 190ls, law 1 only: 1 = the late tank is the dense network (32 lines in two halves of 16, a 16-point Hadamard
+    // inside each half, the halves rotated into each other by crossFeed; no loop all-passes): Atrium's ValhallaRoom role,
+    // whose late network has 32 lines (static REA). Needs an engine made with dense = true; 0 = the 8-line tank
+    int dense = 0;
 };
 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)
@@ -148,7 +152,8 @@ class Engine
 {
 public:
     // maxLineSec: longest tank line the effect may ask for (sets the memory)
-    explicit Engine (double maxLineSec = 0.5, double maxPredelaySec = 0.6);
+    // dense: also allocates the dense late tank (Settings::dense; round 190ls)
+    explicit Engine (double maxLineSec = 0.5, double maxPredelaySec = 0.6, bool dense = false);
     ~Engine();
     void prepare (double sampleRate);
     void reset() noexcept;
@@ -183,6 +188,9 @@ 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 reaLaw = paramCount + 1; // round 190ls, hidden (read only with the engine law and revision 1): 1 = the
+                                       //   ValhallaRoom role on the dense late tank (32 lines, the reference's count, static REA)
+                                       //   with its laws refitted (new instances, translated states); 0 = revision 1 as before
 constexpr int typeCount = 12;
 const char* typeName (int index) noexcept;
 double decaySec (float v) noexcept;

+ 3 - 2
tests/Parity190itTests.inc

@@ -88,8 +88,9 @@ TEST (parity190it_revisions_are_hidden_new_instances_run_them_old_projects_do_no
         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);
-        // saved, since it is not zero (round 190kw: Epoch's loop law, round 190ln: Foil Plate's REA law, one further, is saved with it)
-        CHECK (savedEffectParamCount (s) == (std::size_t) rev + (kind == EffectKind::epochVerb || kind == EffectKind::foilPlate ? 2 : 1));
+        // saved, since it is not zero (round 190kw: Epoch's loop law, round 190ln: Foil Plate's REA law, round 190ls: Atrium's
+        // dense law, one further, is saved with it)
+        CHECK (savedEffectParamCount (s) == (std::size_t) rev + (kind == EffectKind::epochVerb || kind == EffectKind::foilPlate || kind == EffectKind::atrium ? 2 : 1));
         auto now = s;
         upgradeLoadedEffectParams (now, (std::size_t) rev + 1);
         CHECK (now.params[(std::size_t) rev] == 1.0f);

+ 122 - 0
tests/Parity190lsTests.inc

@@ -0,0 +1,122 @@
+// Round 190ls (ValhallaRoom → Atrium): the ValhallaRoom role on a dense late tank. Static REA of ValhallaRoom (round 190ln,
+// docs/analise/REA_rodada190ls.md) shows a late network of 32 lines (two halves of 16, eight modulators each moving two lines
+// in opposite directions) where Atrium had 8. A hidden step past round 190it's revision, `verbs::atrium::reaLaw` (no
+// control, no string, saved while non-zero): a new instance and a translated state run the engine's dense tank
+// (Settings::dense) with its laws refitted on refcap030; a project saved before loads 0 and renders as the base commit did
+// (fingerprints below). Included after Parity190itTests.inc (its gold helpers).
+#include <cmath>
+#include <cstdint>
+#include <cstring>
+
+#include "core/Effects.h"
+#include "core/LynxVerbs.h"
+
+namespace parity190ls
+{
+// energy (dB) of the left + right output in [a, b) seconds of an impulse at 0.05 s through the slot at 48 kHz, blocks of 512
+inline double windowDb (const lynx::EffectSlot& slot, double a, double b, double total = 3.0)
+{
+    const double sr = 48000.0;
+    const int n = (int) (total * sr);
+    std::vector<float> l ((std::size_t) n), r ((std::size_t) n);
+    l[(std::size_t) (0.05 * sr)] = r[(std::size_t) (0.05 * sr)] = 0.5f;
+    auto fx = lynx::makeEffect (slot);
+    fx->prepare (sr);
+    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);
+    double e = 0.0;
+    for (int i = (int) (a * sr); i < std::min (n, (int) (b * sr)); ++i)
+    {
+        if (! std::isfinite (l[(std::size_t) i]) || ! std::isfinite (r[(std::size_t) i]))
+            return 1000.0;
+        e += (double) l[(std::size_t) i] * l[(std::size_t) i] + (double) r[(std::size_t) i] * r[(std::size_t) i];
+    }
+    return 10.0 * std::log10 (e + 1e-30);
+}
+} // namespace parity190ls
+
+TEST (parity190ls_atrium_dense_law_is_hidden_new_instances_run_it_old_projects_do_not)
+{
+    using namespace lynx;
+    namespace at = verbs::atrium;
+    CHECK (effectInfo (EffectKind::atrium).params.size() == (std::size_t) at::revision); // hidden: no control, no string
+    CHECK (at::reaLaw == at::revision + 1);
+    auto s = makeEffectSlot (EffectKind::atrium);
+    CHECK (s.params[(std::size_t) at::revision] == 1.0f);
+    CHECK (s.params[(std::size_t) at::reaLaw] == 1.0f);
+    CHECK (savedEffectParamCount (s) == (std::size_t) at::reaLaw + 1);
+    auto now = s; // saved with it: kept
+    upgradeLoadedEffectParams (now, (std::size_t) at::reaLaw + 1);
+    CHECK (now.params[(std::size_t) at::reaLaw] == 1.0f && now.params[(std::size_t) at::revision] == 1.0f);
+    auto rev1 = s; // saved by 0.1.30 before this round: revision 1 as round 190it left it
+    upgradeLoadedEffectParams (rev1, (std::size_t) at::revision + 1);
+    CHECK (rev1.params[(std::size_t) at::revision] == 1.0f && rev1.params[(std::size_t) at::reaLaw] == 0.0f);
+    CHECK (savedEffectParamCount (rev1) == (std::size_t) at::revision + 1);
+    auto rev0 = s; // saved before round 190it
+    upgradeLoadedEffectParams (rev0, (std::size_t) at::revision);
+    CHECK (rev0.params[(std::size_t) at::revision] == 0.0f && rev0.params[(std::size_t) at::reaLaw] == 0.0f);
+}
+
+TEST (parity190ls_atrium_without_the_dense_law_renders_as_the_base_commit_did)
+{
+    using namespace lynx;
+    // parity190it's gold input (1.6 s at 48 kHz in blocks of 512), revisions 0 and 1 with the dense law off: FNV-1a of the
+    // float bits and the energy, from the base commit's objects (/mnt/e/lynx-work/valhalla190ls/gold: gold_base.txt, 42
+    // renders at 44.1 / 48 / 96 kHz; the round's objects print the same lines, gold_new.txt)
+    struct Gold { int rev; float type, decay, mod, earlyLate; std::uint64_t hash; double energy; };
+    const Gold gold[] = {
+        { 0, 0.0f, 0.5f, 0.5f, 0.5f, 0x173f6572968912a1ull, 1199.47338 },
+        { 0, 0.0f, 0.3f, 0.9f, 0.8f, 0x0e308e738b38d8eeull, 2038.9714 },
+        { 0, 0.0909f, 0.6f, 0.2f, 0.3f, 0xa6c8d38e65f2769dull, 1501.31279 },
+        { 0, 0.2727f, 0.45f, 0.5f, 0.5f, 0x5549dc24ae60c3a0ull, 4291.82891 },
+        { 0, 0.5455f, 0.7f, 0.5f, 0.9f, 0xe562f273d03c62f1ull, 3899.31406 },
+        { 0, 0.8182f, 0.55f, 0.7f, 0.6f, 0xa70df14e2891dd0cull, 1969.79882 },
+        { 0, 1.0f, 0.5f, 0.5f, 0.5f, 0xd48eb650fbcd2a61ull, 1027.42102 },
+        { 1, 0.0f, 0.5f, 0.5f, 0.5f, 0xadf6053f819584e1ull, 1586.0641 },
+        { 1, 0.0f, 0.3f, 0.9f, 0.8f, 0x8d150b510eb41026ull, 2684.46644 },
+        { 1, 0.0909f, 0.6f, 0.2f, 0.3f, 0xfada21ea78653693ull, 1111.02279 },
+        { 1, 0.2727f, 0.45f, 0.5f, 0.5f, 0x25c88e7c85ccd116ull, 2658.18603 },
+        { 1, 0.5455f, 0.7f, 0.5f, 0.9f, 0x04f672c8dd52b7e2ull, 8411.05274 },
+        { 1, 0.8182f, 0.55f, 0.7f, 0.6f, 0x360a8ead27575c11ull, 8844.68399 },
+        { 1, 1.0f, 0.5f, 0.5f, 0.5f, 0x508cf5e39a25f372ull, 1248.59437 },
+    };
+    for (const auto& g : gold)
+    {
+        auto slot = makeEffectSlot (EffectKind::atrium);
+        slot.params[(std::size_t) verbs::atrium::revision] = (float) g.rev;
+        slot.params[(std::size_t) verbs::atrium::reaLaw] = 0.0f;
+        slot.params[19] = g.type; slot.params[2] = g.decay; slot.params[8] = g.mod; slot.params[4] = g.earlyLate;
+        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
+       #endif
+        CHECK (std::abs (e - g.energy) < 1e-6 * g.energy + 1e-9);
+    }
+}
+
+TEST (parity190ls_atrium_dense_tank_decays_and_keeps_the_level)
+{
+    using namespace lynx;
+    namespace at = verbs::atrium;
+    // every type, a short and a long decay: the dense tank is stable (finite, falling) and its tail sits within a few dB of
+    // the 8-line tank's (the front-ends' levels hold: the tank is read at the 8-line tank's 1 / √8)
+    for (int type = 0; type < at::typeCount; ++type)
+        for (const float decay : { 0.35f, 0.75f })
+        {
+            auto a = makeEffectSlot (EffectKind::atrium);
+            a.params[19] = (float) type / (float) (at::typeCount - 1);
+            a.params[2] = decay;
+            auto b = a;
+            b.params[(std::size_t) at::reaLaw] = 0.0f;
+            const auto early = parity190ls::windowDb (a, 0.3, 0.8), late = parity190ls::windowDb (a, 2.0, 3.0);
+            const auto ref = parity190ls::windowDb (b, 0.3, 0.8);
+            CHECK (early < 100.0 && late < 100.0);
+            CHECK (late < early);
+            CHECK (std::abs (early - ref) < 4.0);
+        }
+}

+ 1 - 0
tests/tests.cpp

@@ -17828,6 +17828,7 @@ TEST (fl_low_lifter_matches_fl_engine)
 #include "Parity190iqTests.inc"
 #include "Parity190itTests.inc"
 #include "Parity190lnVrTests.inc" // round 190ln: Foil Plate on ValhallaPlate's own EQ / bass-decay laws (after Parity190it: its gold helpers)
+#include "Parity190lsTests.inc" // round 190ls: Atrium on a dense late tank for the ValhallaRoom role (after Parity190it: its gold helpers)
 #include "Parity190jhTests.inc" // round 190jh: Facet's automatic threshold, Pro-Q 4 dynamic bands, Waves L2 / SuperTap / SSLComp / CLA-76
 #include "Parity190jsTests.inc" // round 190js: the Waves reverbs on Reeverb 2, Hush's Single Vocal revision, Facet's auto-threshold refit
 #include "Parity190ktTests.inc" // round 190kt: REA of the Waves SSLComp DSP, Crest's console law, SSLComp on Crest