Просмотр исходного кода

Merge parity190is (432aa0bc4) into wip/rollup030

# Conflicts:
#	docs/PARITY.md
#	src/core/Effects.cpp
#	tests/tests.cpp
Ka1-S 2 недель назад
Родитель
Сommit
45ef35acdd

+ 61 - 0
docs/PARITY.md

@@ -3790,3 +3790,64 @@ learn:comp, Apex ← pure:limit / learn:limit, Facet ← smart:EQ 4 / pure:EQ /
 Foil Plate ← smart:reverb 2 / pure:verb / learn:reverb): their states are not translated (LYNX plays the role's preset)
 and this round's sonible captures (`refcap030/sonible`, started with the trial running; /mnt/e/lynx-work/parity190iq/HANDOFF.md) are
 the first usable ones (refcap0124's pure:verb renders are all bypass).
+
+## Round 190is: Echoform ← the Soundtoys delays (EchoBoy voicings revision 1, Little PrimalTap's own default)
+Black-box on refcap030's captures (round 190hv) and round 190iq's bank (`/mnt/e/lynx-work/parity190iq/lab/rc030.py`:
+each render with a saved state, rendered as LYNX loads it; EchoBoy through tp172d's value map, the other three through
+the substitute's fallback, since their states are encoded). Lab: `/mnt/e/lynx-work/parity190is` (HANDOFF.md).
+
+**The states stay undecoded.** The Soundtoys component state carries `PRESET =` + an encoded payload; on two states that
+differ in one control the payload changes from that control's position to its end (858 of 1859 bytes for one PrimalTap
+Algorithm step), i.e. a chained encoding. Black-box rules out decoding it, so the translators keep the round-136 hash
+table (her real projects' states) and a fallback per plug-in for any other state.
+
+**What differed (EchoBoy styles × Saturation 4.8 / 12 / 19.2 dB, impulses at 0 / −20 / −40 dBFS, noise bursts):**
+- *Saturation in the loop.* The reference's repeats fall by the same dB per pass at every Saturation (−40 dBFS impulse,
+  feedback 0.50: 8.4 / 8.4 / 8.4 dB per pass on Master Tape, 7.6 / 7.6 / 7.5 on Space Echo), while its first echo rises
+  by the curve's small-signal gain. Echoform applied that gain on every pass: at 19.2 dB most voicings ran away (rms
+  +20 … +50 dB, 45 files at score 1).
+- *Diffusion.* A Schroeder allpass of small gain passes its input mostly delayed by its length, so a voicing's loop
+  diffusion (EchoPlex-, TelRay-, Fat-, Ambient-like styles) made every pass ~33 ms (× size) longer than the echo time
+  (EchoPlex: 16 dB "loss" per pass in the reference's windows; its repeats keep the time).
+- *Timing.* The reference's echoes sit 8 / 7.7 / 5 samples behind n · T + the L/R offset at 44.1 / 48 / 96 kHz (against
+  its dry, every style alike); Echoform's were on the grid. (tp172d's map also set 249.95 ms for 250: the closest text.)
+- *Little PrimalTap:* a clean line band-limited by a steep low-pass at 12.3 kHz with a droop (−1.9 dB at 4 kHz, −4.6 at
+  8 kHz), the echo 6 samples late, mix on a **linear** law (50 %: dry and echo −6 dB), the dry slightly dipped above
+  8 kHz; its feedback path adds a stronger droop and ~40 samples per pass. PrimalTap: the same family (13.2 kHz), its
+  mix equal-power, the two taps hard-panned, BEATS 0.5 → 254.65 ms on the trial. EchoBoy Jr: its Studio Tape is darker
+  and ~+3 dB louder at low frequencies than EchoBoy's.
+
+**Built (Echoform, hidden revision 1):** the saturation curve runs at unity small-signal gain inside the loop and its
+make-up is applied once on the echoes; the voicing's loop diffusion reads that much earlier (the period stays T); the
+echoes 8 / 5 samples late (≤ 64 kHz / 96 kHz). Only with an echo voicing. `echoform::revision` = paramCount (no control,
+no string): a new Echoform and every translated / substituted one run it, a project or preset saved before keeps rounds
+147 / 150 bit for bit (8 / 8 renders hash-identical to the base commit with revision 0, `tests/Parity190isTests.inc`).
+**Substitutes:** Little PrimalTap gets its own entry playing its measured default (Clean character, Age 0.221 = the steep
+12.3 kHz low-pass, High cut 0.45, 113.125 ms, Mix 2/3 + Output −4.8 dB = the linear law). EchoBoy Jr gets its own entry
+with EchoBoy's fallback in revision 0 (`#108=0`: the preset grammar now names a hidden parameter by index): revision 1's
+8-sample lag is EchoBoy's, EchoBoy Jr's is ~3, and on its steady tones the lag moved the echo's phase against the dry
+(5 mode / sr96 files a step lower). PrimalTap's and EchoBoy Jr's own defaults were tried as their fallbacks and **not**
+shipped: refcap030's blocks, mostly 95 / 120 ms or mix 25 … 30 %, scored lower with them (PrimalTap mode 3.67 → 3.04,
+pairs 3.37 → 3.00; EchoBoy Jr lower in every block).
+
+| refcap030 row (as LYNX loads it) | files | before | after | per block (before → after) |
+|---|---|---|---|---|
+| Little PrimalTap | 108 | 2.59 | **3.53** | mode 2.58 → 3.58, pairs 2.50 → 2.81, sr44 2.65 → 3.95, sr48 2.70 → 4.00, sr96 2.60 → 3.90 |
+| PrimalTap | 165 | 3.39 | 3.39 | unchanged (its fallback is not a voicing; sr48 re-run identical) |
+| EchoBoy (tp172d's map) | 375 | 3.62 | **4.13** | mode 4.83 → 5.26, pairs 3.30 → 3.37, sr44 4.65 → 5.20, sr48 4.60 → 5.15, sr96 4.80 → 4.90, styles 2.94 → 3.65 |
+| EchoBoy Jr | 186 | 3.82 | 3.82 | unchanged (its fallback runs revision 0) |
+
+Per file: EchoBoy 106 up / 259 same / 10 down (styles: TelRay / FM-radio / Queeked noise bursts 1–2 dB louder now that
+the loop no longer loses the curve's sub-unity gain each pass, and four 19.2 dB impulse files whose first-echo spectrum
+moved), Little PrimalTap 77 up / 18 same / 13 down (pairs: its feedback path's droop and extra delay are not modelled).
+**Value-map lab** (the plug-ins' own parameter values mapped onto Echoform — what a decodable state would give;
+`/mnt/e/lynx-work/parity190is/lab/vmap.py`, not a product path): EchoBoy 4.47 (the exact time, Dual / Note / Rhythm modes,
+Input / Output, Groove / Feel / Prime numbers), PrimalTap 3.76, Little PrimalTap 3.66, EchoBoy Jr 4.26 (its styles block
+lower: Jr's styles are not EchoBoy's).
+**Other banks** (`/mnt/e/lynx-work/echo190dl/lab/bank_echo.py`, the 10 Echoform rows): EchoBoy (tp172d) wave 5.15 → 5.40,
+tail 6.34 → 6.56; the other nine rows (H-Delay, ValhallaDelay, the prog182 Soundtoys rows on their fitted maps, tp172c)
+identical. CPU (48 kHz, 20 s, blocks of 512, best of 5; three voicings at Saturation 12 dB, feedback 50 %): revision 1 2.2 / 3.7 /
+5.2 % of one core, revision 0 2.4 / 4.1 / 4.6 %, base objects 3.4 / 3.8 / 5.0 % — within the run-to-run noise (±10 %): the
+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.

+ 32 - 3
src/core/EchoSuite.cpp

@@ -1030,11 +1030,17 @@ public:
             for (auto& a : b.diff)
                 a.line.allocate (sr * 0.05);
         }
+        // round 190is [EXEC] refcap030 EchoBoy (S1 impulse, every style alike): the reference's echoes arrive 8 / 7.7 / 5
+        // samples after n · T (+ the L/R offset) at 44.1 / 48 / 96 kHz, against the dry; revision 1 plays them that late
+        wetLag = sr < 64000.0 ? 8 : (int) std::lround (5.0 * sr / 96000.0);
         reset();
     }
 
     void reset() noexcept override
     {
+        for (auto& w : wetBuf) // round 190is
+            w.fill (0.0f);
+        wetPos = 0;
         std::uint32_t seed = 0x1234567u;
         for (auto& c : ch)
         {
@@ -1151,6 +1157,11 @@ private:
         const VoicingData* vd = vk > 0 ? &voicingData (vk) : nullptr;
         const int stk = satTypeOf (p[satType]);
         prepareSaturation (stk > 0 ? &satTypeData (stk) : vd, 24.0 * (double) clamp01 (p[drive]));
+        // round 190is (revision 1, hidden): refcap030's EchoBoy captures — at Saturation 4.8 / 12 / 19.2 dB the reference's
+        // repeats fall by the same dB per pass (−40 dBFS impulses, every style), while its first echo rises by the curve's
+        // small-signal gain: the make-up is heard once. Revision 0 put it on every pass (at 19.2 dB most voicings ran away)
+        const bool rev1 = vd != nullptr && p[revision] >= 0.5f;
+        satLoopUnity = rev1;
         if (vd != nullptr && (vk != toneVoicing || sr != toneSr))
         {
             toneVoicing = vk;
@@ -1254,6 +1265,7 @@ private:
         const auto duckThresholdDb = -51.0 * std::pow ((double) std::max (1e-6f, duck), 1.28);
         const auto duckReleaseStep = 85.0 / sr;
         static constexpr double diffMs[4] = { 4.3, 6.7, 9.1, 12.7 };
+        static constexpr double diffDelay = diffMs[0] + diffMs[1] + diffMs[2] + diffMs[3];
 
         // round 135w: quad taps / swell, groove / feel / accent, prime numbers, cross feedback, balance, freeze, start side
         const bool tapOn[4] = { p[tapA] >= 0.5f, p[tapB] >= 0.5f, p[tapC] >= 0.5f, p[tapD] >= 0.5f };
@@ -1321,6 +1333,7 @@ private:
         for (int i = 0; i < n; ++i)
         {
             const float in[2] = { l[i], r[i] };
+            wetPos = (wetPos + 1) & 31;
 
             // modulation (ms): wow / flutter in the tape characters, an LFO in the others
             lfoPhase += rate / sr;
@@ -1399,6 +1412,11 @@ private:
             {
                 auto& s = ch[(std::size_t) c];
                 d[c] = std::max (2.0, s.time.next (target[c], 0.12, sr) + modMs[c] * 0.001 * sr);
+                // round 190is (revision 1): a Schroeder allpass of small gain passes its input mostly delayed by its
+                // length, so the voicing's loop diffusion made every pass 33 ms (× size) longer than the echo time —
+                // the reference's diffused styles keep the time (refcap030 EchoBoy, irlv): read that much earlier
+                if (rev1 && diffAmount > 0.0f && ! postDiff)
+                    d[c] = std::max (2.0, d[c] - diffDelay * diffScale * 0.001 * sr * (c == 1 ? 1.07 : 1.0));
                 if (clockMod) // round 190dl: a swing of up to 1.5 x the time stays inside the line
                     d[c] = std::min (d[c], maxRead);
             }
@@ -1503,10 +1521,15 @@ private:
                     fbSig[c] = y;
                 if (vd != nullptr) // round 147: the voicing's output tone (once, on the way out)
                 {
-                    y *= outLin;
+                    y *= rev1 ? outLin * satSmall : outLin; // round 190is: the saturation's make-up, once
                     for (int k = 0; k < outN; ++k)
                         y = outQ[(std::size_t) k].process (y, c);
                 }
+                if (rev1) // round 190is: the echoes a few samples behind (wetLag)
+                {
+                    wetBuf[(std::size_t) c][(std::size_t) wetPos] = y;
+                    y = wetBuf[(std::size_t) c][(std::size_t) ((wetPos - wetLag) & 31)];
+                }
                 echo[c] = y;
             }
 
@@ -2230,6 +2253,7 @@ private:
         {
             satThreshold = satStep (v->thresholdDb, driveDb);
             satMakeup = satStep (v->makeupDb, driveDb);
+            satSmall = std::pow (10.0, satMakeup / 20.0);
             compAttack = 1.0 - std::exp (-1.0 / (0.004 * sr));
             compRelease = 1.0 - std::exp (-1.0 / (0.120 * sr));
         }
@@ -2237,6 +2261,7 @@ private:
         {
             satDrive = std::pow (10.0, satStep (v->driveDb, driveDb) / 20.0);
             satGain = std::pow (10.0, satStep (v->gainDb, driveDb) / 20.0);
+            satSmall = satGain;
             satSlope = std::pow (1.0 + std::pow (std::abs ((double) v->b), (double) v->p), -1.0 / v->p - 1.0);
             satKb = kneeShape ((double) v->b, (double) v->p);
         }
@@ -2251,15 +2276,19 @@ private:
             const auto a = (double) std::abs (x);
             e += (a - e) * (a > e ? compAttack : compRelease);
             const auto lvl = 20.0 * std::log10 (std::max (1e-9, e));
-            const auto gdb = satMakeup - compressCurve (lvl - satThreshold, v.ratio);
+            const auto gdb = (satLoopUnity ? 0.0 : satMakeup) - compressCurve (lvl - satThreshold, v.ratio);
             return (float) (x * std::exp (gdb * 0.11512925464970228)); // 10^(dB / 20)
         }
         const auto u = satDrive * (double) x + (double) v.b;
         const auto y = (kneeShape (u, (double) v.p) - satKb) / satSlope;
-        return (float) (satGain * y / satDrive);
+        return (float) ((satLoopUnity ? 1.0 : satGain) * y / satDrive);
     }
 
     const VoicingData* satCurve = nullptr;
+    std::array<std::array<float, 32>, 2> wetBuf {};
+    int wetPos = 0, wetLag = 8;
+    bool satLoopUnity = false; // round 190is: the voicing's loop saturates at unity small-signal gain (revision 1)
+    double satSmall = 1.0;     // the curve's small-signal gain (its make-up), heard once on the echoes in revision 1
     double satDrive = 1.0, satGain = 1.0, satSlope = 1.0, satKb = 0.0, satThreshold = 0.0, satMakeup = 0.0;
     double compAttack = 0.0, compRelease = 0.0, compEnv[2] {};
     std::array<Biquad, 9> outQ {};

+ 7 - 1
src/core/EchoSuite.h

@@ -121,7 +121,13 @@ enum Param
                    // the tape characters' measured tape stage (output and loop tone apart, hiss, the wow's mean lag)
     modClock,      // Clock: the LFO swings the echo time by a fraction of itself (0 … 50 % at Depth 100 %, linear), both
                    // sides in step — a clocked line's modulation (H-Delay's, measured); off (default) = the ms law
-    paramCount
+    paramCount,
+    // round 190is, hidden (not in the info: no control, no string; saved while non-zero): the echo voicings' revision.
+    // 1 = the loop measured on refcap030's EchoBoy captures (new instances, makeEffectSlot): the saturation's make-up
+    // heard once on the echoes instead of on every pass, the voicing's diffusion inside the echo time, the echoes'
+    // measured 1/6 ms behind the dry. 0 = rounds 147 / 150 (a project or preset saved before loads without it, so it
+    // keeps that sound bit for bit). Read only with an echo voicing
+    revision = paramCount
 };
 enum class Style { single, ratio, quad, dual, pingPong }; // the two-time styles last (the panel shows the right time for both)
 // in the panel's order: the modulation section shows wow / flutter (tape), rate / depth (lo-fi … phaser), shift / detune

+ 5 - 0
src/core/Effects.cpp

@@ -4449,6 +4449,8 @@ EffectSlot makeEffectSlot (EffectKind kind)
         slot.params[(std::size_t) voiceshift::revision] = 1.0f;
     if (kind == EffectKind::hushDeEsser) // round 190iq: a new Hush runs the measured Allround timing (hidden)
         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;
 
     return slot;
 }
@@ -4611,6 +4613,9 @@ void upgradeLoadedEffectParams (EffectSlot& slot, std::size_t savedCount) noexce
     // round 190iq: a Hush saved before the measured Allround timing keeps tp172b's (bit for bit)
     if (slot.kind == EffectKind::hushDeEsser && savedCount <= (std::size_t) mixsuite::hush::timing)
         slot.params[(std::size_t) mixsuite::hush::timing] = 0.0f;
+    // round 190is: an Echoform saved before the voicings' revision keeps rounds 147 / 150's voicings
+    if (slot.kind == EffectKind::echoform && savedCount <= (std::size_t) echosuite::echoform::revision)
+        slot.params[(std::size_t) echosuite::echoform::revision] = 0.0f;
     // round 190ca: a Nebula saved before the cloud law keeps the classic engine in every mode
     if (slot.kind == EffectKind::nebula && savedCount <= (std::size_t) verbs::nebula::law)
         slot.params[(std::size_t) verbs::nebula::law] = 0.0f;

+ 37 - 4
src/core/PluginSubstitutes.cpp

@@ -242,16 +242,41 @@ lynx = Echoform
 preset = Mode=0.0415; Sync L=0.6248; Note L=0.4498; Feedback=0.125; Mix=0.25; Echo voicing=0.064516
 # [DATA] VST2 unique ID from real projects
 vst2 = StEB
-names = EchoBoy; EchoBoyJr; EchoBoy Jr
+names = EchoBoy
+translate = soundtoys-echoboy
+
+[soundtoys-echoboy-jr]
+product = EchoBoy Jr
+vendor = Soundtoys
+# round 190is: its own entry (it shared EchoBoy's): EchoBoy's fallback in the voicings' revision 0 (#108). Revision 1's echo
+# lag is EchoBoy's (8 samples at 48 kHz), EchoBoy Jr's ~3, and on its steady tones the lag moved the echo's phase against
+# the dry (refcap030: 5 mode / sr96 files a step lower). Its own measured default (Studio Tape, Wide, 100 ms, feedback
+# 0.30, mix 40 %) was tried as the fallback and kept out: its blocks (mostly mix 25 … 30 %) scored lower
+lynx = Echoform
+preset = Mode=0.0415; Sync L=0.6248; Note L=0.4498; Feedback=0.125; Mix=0.25; Echo voicing=0.064516; #108=0
+names = EchoBoyJr; EchoBoy Jr
 translate = soundtoys-echoboy
 
 [soundtoys-primaltap]
 product = PrimalTap
 vendor = Soundtoys
-# round 129: Echoform (as EchoBoy), a darker lo-fi tape echo
+# round 129: Echoform (as EchoBoy), a darker lo-fi tape echo. Round 190is: Little PrimalTap has its own entry now; the state
+# stays encoded (not decoded: a change of one control rewrites the payload from that point to its end). PrimalTap's own
+# measured default (two taps at 0.5 beat, no feedback, mix 50 %, band-limited) was tried as the fallback and kept out:
+# refcap030's mode / pairs blocks (95 / 120 ms, mix 30 %) scored lower with it (3.67 -> 3.04, 3.37 -> 3.00)
 lynx = Echoform
 preset = Mode=0.125; Sync L=0.6248; Note L=0.4498; Feedback=0.125; Mix=0.25
-names = PrimalTap; Little PrimalTap; LittlePrimalTap
+names = PrimalTap
+
+[soundtoys-little-primaltap]
+product = Little PrimalTap
+vendor = Soundtoys
+# round 190is: its own entry (it shared PrimalTap's). Any state plays Little PrimalTap's default as measured on refcap030:
+# 113 ms (the echo 6 samples later), no feedback, mix 50 % on a linear law (dry and echo −6 dB: Echoform's equal-power Mix
+# at 2/3 with the Output at −4.8 dB), a steep low-pass at 12.3 kHz (Age) and its droop (High cut), no LFO
+lynx = Echoform
+preset = Mix=0.666667; Output=0.367466; Time L=0.113125; Mode=0.541667; Mod depth=0; Age=0.221; High cut=0.45; Feedback=0
+names = Little PrimalTap; LittlePrimalTap
 
 # Valhalla delay / modulation plugins -> LYNX's delay / modulation suite (round 101). Their saved state is a JUCE
 # XML block holding every parameter as its normalised value [DATA, EXEC]; the LYNX effects use the same value laws,
@@ -3266,7 +3291,15 @@ std::vector<SubstituteEntry> parseSubstituteTable (std::string_view text, int* e
         {
             const auto eq = item.rfind ('=');
             float v = 0;
-            const auto index = eq == std::string::npos ? -1 : paramNamed (*kind, item.substr (0, eq));
+            auto index = eq == std::string::npos ? -1 : paramNamed (*kind, item.substr (0, eq));
+            // round 190is: "#<index>" names a hidden parameter (past the effect's info, e.g. Echoform's revision)
+            if (index < 0 && eq != std::string::npos && eq > 1 && item[0] == '#')
+            {
+                float at = -1.0f;
+                if (parseFloat (trim (item.substr (1, eq - 1)), at) && at == std::floor (at)
+                    && at >= (float) effectInfo (*kind).params.size() && at < (float) maxEffectParams)
+                    index = (int) at;
+            }
             if (index < 0 || ! parseFloat (trim (item.substr (eq + 1)), v))
             {
                 ++bad;

+ 1 - 0
tests/Echo190dlTests.inc

@@ -130,6 +130,7 @@ TEST (echo190dl_classic_law_renders_as_the_base_commit_did)
     {
         auto slot = makeEffectSlot (EffectKind::echoform);
         slot.params[e::engineLaw] = 0.0f;
+        slot.params[(std::size_t) e::revision] = 0.0f; // round 190is: a project saved before also keeps the voicings' revision 0
         for (int k = 0; k < 3; ++k)
             if (c.idx[k] >= 0)
                 slot.params[(std::size_t) c.idx[k]] = c.val[k];

+ 209 - 0
tests/Parity190isTests.inc

@@ -0,0 +1,209 @@
+// Round 190is: Echoform's echo voicings (EchoBoy's style role) get revision 1, measured black-box on refcap030's EchoBoy
+// captures (styles × Saturation 4.8 / 12 / 19.2 dB, impulses at 0 / −20 / −40 dBFS and noise bursts; the parity bank of
+// round 190iq; /mnt/e/lynx-work/parity190is/HANDOFF.md): the saturation's make-up is heard once on the echoes (the
+// reference's repeats fall by the same dB per pass at every Saturation), the voicing's loop diffusion stays inside the
+// echo time, and the echoes sit 8 / 7.7 / 5 samples behind the dry at 44.1 / 48 / 96 kHz. The revision is a hidden
+// parameter: a new Echoform and a translated state run it, a project or preset saved before keeps rounds 147 / 150's
+// voicings bit for bit. Also: Little PrimalTap gets its own substitute entry playing its measured default (its state is
+// encoded, so every state plays it); EchoBoy Jr its own entry with EchoBoy's fallback in revision 0; PrimalTap keeps its
+// fallback (its default and EchoBoy Jr's scored lower).
+#include <cmath>
+#include <cstdint>
+#include <cstring>
+
+#include "core/Effects.h"
+#include "core/EchoSuite.h"
+#include "core/PluginSubstitutes.h"
+
+namespace parity190is
+{
+namespace ef = lynx::echosuite::echoform;
+// the gold input (as /mnt/e/lynx-work/parity190is/gold/gold.cpp): 0.3 s of noise, a click every second, a 440 Hz tone
+inline void signal (std::vector<float>& l, std::vector<float>& r, double sr)
+{
+    unsigned s = 4242u;
+    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;
+        const double v = (t < 0.3 ? 0.5 * nz : 0.0) + (std::fmod (t, 1.0) < 1e-3 ? 0.9 : 0.0) + 0.1 * std::sin (2.0 * M_PI * 440.0 * t) * (t > 1.5 && t < 2.0);
+        l[(std::size_t) i] = (float) v;
+        r[(std::size_t) i] = (float) (0.8 * v);
+    }
+}
+inline lynx::EffectSlot slot (int voicing, float drive, float fb, float style, float mix, bool diffusion)
+{
+    auto s = lynx::makeEffectSlot (lynx::EffectKind::echoform);
+    s.params[ef::voicing] = ef::voicingValue (voicing);
+    s.params[ef::drive] = drive;
+    s.params[ef::feedback] = fb;
+    s.params[ef::style] = style;
+    s.params[ef::mix] = mix;
+    s.params[ef::syncL] = s.params[ef::syncR] = 0.25f;
+    s.params[ef::timeL] = 0.25f;
+    s.params[ef::timeR] = 0.18f;
+    if (diffusion)
+        s.params[ef::diffusion] = 0.4f;
+    return s;
+}
+inline void render (const lynx::EffectSlot& s, double sr, std::vector<float>& l, std::vector<float>& r)
+{
+    auto fx = lynx::makeEffect (s);
+    fx->prepare (sr);
+    const int n = (int) l.size();
+    for (int at = 0; at < n; at += 512)
+        fx->process (l.data() + at, r.data() + at, std::min (512, n - at), s.params, 120.0);
+}
+inline std::uint64_t fnv (const std::vector<float>& l, const std::vector<float>& r, double& e)
+{
+    std::uint64_t h = 1469598103934665603ull;
+    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;
+        }
+    return h;
+}
+} // namespace parity190is
+
+TEST (parity190is_echoform_revision_is_hidden_new_instances_run_it_old_projects_do_not)
+{
+    using namespace lynx;
+    namespace ef = echosuite::echoform;
+    CHECK (effectInfo (EffectKind::echoform).params.size() == (std::size_t) ef::revision); // hidden: no control, no string
+    auto s = makeEffectSlot (EffectKind::echoform);
+    CHECK (s.params[(std::size_t) ef::revision] == 1.0f);
+    CHECK (savedEffectParamCount (s) == (std::size_t) ef::revision + 1);
+    auto now = s;
+    upgradeLoadedEffectParams (now, (std::size_t) ef::revision + 1);
+    CHECK (now.params[(std::size_t) ef::revision] == 1.0f);
+    auto old = s; // saved before this round (the named values only): rounds 147 / 150's voicings, and they stay
+    upgradeLoadedEffectParams (old, (std::size_t) ef::revision);
+    CHECK (old.params[(std::size_t) ef::revision] == 0.0f);
+    CHECK (savedEffectParamCount (old) == (std::size_t) ef::revision);
+}
+
+TEST (parity190is_revision0_renders_as_the_base_commit_did)
+{
+    using namespace lynx;
+    namespace ef = echosuite::echoform;
+    struct Case
+    {
+        int voicing;
+        float drive, fb, style, mix;
+        double sr;
+        int diffusion;
+        std::uint64_t hash;
+        double energy;
+    };
+    // 3 s of the gold input in blocks of 512: FNV-1a of the float bits and the energy, from the base commit's objects
+    // (/mnt/e/lynx-work/parity190is/gold: gold_base.txt; the round's objects with the revision forced to 0 print the same
+    // lines, gold_new.txt)
+    const Case cases[] = {
+        { 2, 0.00, 0.25, 0.10, 0.50, 48000, 0, 0xf51e09c3f25ef4a8ull, 1573.76017 },
+        { 4, 0.80, 0.25, 0.10, 1.00, 48000, 0, 0x680363df5af3ef90ull, 11828.3339 },
+        { 3, 0.50, 0.30, 0.90, 0.50, 44100, 0, 0x687d79e48ec22913ull, 1576.2982 },
+        { 9, 0.20, 0.25, 0.70, 0.60, 96000, 0, 0x6d193e97ea525883ull, 1984.42005 },
+        { 13, 0.80, 0.40, 0.10, 1.00, 48000, 0, 0x0a05e73882f14433ull, 6013.07573 },
+        { 16, 0.30, 0.25, 0.10, 0.50, 48000, 0, 0x5d5cce3968041192ull, 1849.03832 },
+        { 28, 0.50, 0.30, 0.10, 0.50, 48000, 0, 0x01e7c58d3fcf7fabull, 1434.29197 },
+        { 0, 0.50, 0.30, 0.10, 0.50, 48000, 1, 0x2ad021b6bca9ad68ull, 1283.99852 },
+    };
+    for (const auto& c : cases)
+    {
+        auto s = parity190is::slot (c.voicing, c.drive, c.fb, c.style, c.mix, c.diffusion != 0);
+        s.params[(std::size_t) ef::revision] = 0.0f;
+        const int n = (int) (3.0 * c.sr);
+        std::vector<float> l ((std::size_t) n), r ((std::size_t) n);
+        parity190is::signal (l, r, c.sr);
+        parity190is::render (s, c.sr, l, r);
+        double e = 0.0;
+        const auto h = parity190is::fnv (l, r, e);
+       #if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 43))
+        CHECK (h == c.hash); // the libm the fingerprints were taken with (sin / pow / log10 / exp may differ elsewhere)
+       #endif
+        CHECK (std::abs (e - c.energy) < 1e-6 * c.energy + 1e-9);
+    }
+}
+
+TEST (parity190is_revision1_keeps_the_loop_gain_and_the_echo_time)
+{
+    using namespace lynx;
+    namespace ef = echosuite::echoform;
+    // a −40 dBFS impulse into a voicing at Saturation 19.2 dB, feedback 50 %, 250 ms, mix 100 %: the energy of each repeat
+    const double sr = 48000.0;
+    const int n = (int) (2.0 * sr), T = (int) (0.25 * sr);
+    const auto repeats = [&] (int voicing, float rev, std::vector<double>& e, std::vector<int>& at) {
+        auto s = parity190is::slot (voicing, 0.8f, 0.25f, 0.1f, 1.0f, false);
+        s.params[(std::size_t) ef::revision] = rev;
+        std::vector<float> l ((std::size_t) n), r ((std::size_t) n);
+        l[100] = r[100] = 0.01f;
+        parity190is::render (s, sr, l, r);
+        e.clear();
+        at.clear();
+        for (int k = 1; k <= 4; ++k)
+        {
+            double sum = 0.0, peak = 0.0;
+            int where = 0;
+            for (int i = 100 + k * T - T / 3; i < 100 + k * T + T / 3; ++i)
+            {
+                sum += (double) l[(std::size_t) i] * l[(std::size_t) i];
+                if (std::abs (l[(std::size_t) i]) > peak) { peak = std::abs (l[(std::size_t) i]); where = i - 100 - k * T; }
+            }
+            e.push_back (10.0 * std::log10 (sum + 1e-30));
+            at.push_back (where);
+        }
+    };
+    std::vector<double> e0, e1;
+    std::vector<int> a0, a1;
+    // the multi-head tape voicing (EchoBoy's style 3): its curve's small-signal gain at 19.2 dB is ~ +10 dB; on every pass
+    // (revision 0) the loop ran away, once (revision 1) every repeat falls (the reference: 7.5 dB per pass)
+    repeats (4, 0.0f, e0, a0);
+    repeats (4, 1.0f, e1, a1);
+    CHECK (e0[3] > e0[1]);
+    for (int k = 1; k < 4; ++k)
+        CHECK (e1[(std::size_t) k] < e1[(std::size_t) k - 1] - 5.0 && e1[(std::size_t) k] > e1[(std::size_t) k - 1] - 10.0);
+    CHECK (std::abs (e1[0] - e0[0]) < 0.5); // the first echo as before (the make-up once)
+    // the cartridge-echo voicing (diffusion 0.18): revision 0's repeats drifted ~33 ms per pass, revision 1 keeps the
+    // echo time (the L/R offset: −4 ms on the odd repeats, +6 ms on the even ones, plus the measured 8 samples)
+    repeats (3, 0.0f, e0, a0);
+    repeats (3, 1.0f, e1, a1);
+    CHECK (a0[1] > 0.05 * sr);
+    CHECK (std::abs (a1[0] - (-192 + 8)) < 40 && std::abs (a1[1] - (288 + 8)) < 40 && std::abs (a1[2] - (-192 + 8)) < 40); // ± its tones' delay
+}
+
+TEST (parity190is_soundtoys_echoes_play_their_own_defaults)
+{
+    using namespace lynx;
+    namespace ef = echosuite::echoform;
+    const auto slotFor = [] (const char* name) {
+        PluginIdentity id;
+        id.format = ForeignPlugin::Format::vst3;
+        id.name = name;
+        const auto* e = findPluginSubstitute (id, false);
+        return std::make_pair (e != nullptr ? std::string (e->key) : std::string(), e != nullptr ? makeSubstituteSlot (*e) : EffectSlot {});
+    };
+    const auto text = [] (const EffectSlot& s, int p) { return formatEffectParam (s.kind, p, s.params[(std::size_t) p], 120.0); };
+    // EchoBoy Jr: EchoBoy's fallback in revision 0 (its own echo lag differs; "#108=0" in the entry: a hidden parameter)
+    const auto [jrKey, jr] = slotFor ("EchoBoy Jr");
+    CHECK (jrKey == "soundtoys-echoboy-jr" && jr.params[(std::size_t) ef::revision] == 0.0f);
+    CHECK (ef::voicingOf (jr.params[ef::voicing]) == ef::voicingForEchoBoyStyle (1) && text (jr, ef::noteL) == "1/4");
+    CHECK (slotFor ("EchoBoy").second.params[(std::size_t) ef::revision] == 1.0f);
+    const auto [ptKey, pt] = slotFor ("PrimalTap");
+    CHECK (ptKey == "soundtoys-primaltap" && pt.kind == EffectKind::echoform); // its round-129 fallback (see the entry)
+    const auto [lptKey, lpt] = slotFor ("Little PrimalTap");
+    CHECK (lptKey == "soundtoys-little-primaltap" && text (lpt, ef::timeL) == "113.1 ms" && text (lpt, ef::mode) == "Clean");
+    // the linear mix law at 50 %: dry and echo both −6 dB (Echoform's equal-power Mix at 2/3, the Output −4.8 dB)
+    float dry = 0.0f, wet = 0.0f;
+    echosuite::equalPowerMix (lpt.params[ef::mix], dry, wet);
+    const auto echoDb = 20.0 * std::log10 (wet) + ef::outputDb (lpt.params[ef::output]);
+    CHECK (std::abs (20.0 * std::log10 (dry) + 6.02) < 0.05 && std::abs (echoDb + 6.02) < 0.05);
+    CHECK (slotFor ("LittlePrimalTap").first == "soundtoys-little-primaltap" && slotFor ("EchoBoyJr").first == "soundtoys-echoboy-jr");
+    CHECK (slotFor ("EchoBoy").first == "soundtoys-echoboy");
+}

+ 1 - 0
tests/tests.cpp

@@ -17837,3 +17837,4 @@ TEST (fl_low_lifter_matches_fl_engine)
 #include "Details190ihTests.inc" // round 190ih: DETAILS slices R2, R3, R4, R7, R9, R12, R14
 #include "Rackmix190ioTests.inc" // round 190io: FL rack + Mixer landmarks, Mixer details, issue #154 part 2
 #include "Bugs190irTests.inc" // round 190ir: issue #189 text size, takes on the tracks FL picks (Discord report)
+#include "Parity190isTests.inc" // round 190is: Echoform voicings revision 1, the Soundtoys echoes' own defaults