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

parity137: Echoform Rhythm mode (measured on EchoBoy) with tap bars, Era, measured ducking; Lattice input pan; Voice Shift MIDI; Crest host-sync / MIDI trigger

Ka1-S 1 месяц назад
Родитель
Сommit
aa25eff260

+ 11 - 11
docs/PARITY.md

@@ -1237,7 +1237,7 @@ Sources: REA_rodada100.md §5/§7b; product page with mode descriptions (valhall
 | reverb mode | **4: Mono / Small Stereo / Medium Stereo / Big Stereo**, default mono (mono-in for Mono) | round 135: Mono (mono in), Small / Medium / Big stereo (two separate sides) first, LYNX's Wide / Dense / Bright after them; menu with ◀ ▶ | ✅ | [EXEC] the trial with a left-only impulse: below 0.25 the input is summed and the tail leaves both sides, from 0.25 up the left input stays left; steps at 0.25 / 0.5 / 0.75; translated 1:1. The default stays Wide (older projects unchanged). |
 | pitch mode | **Single (up or down by Shift) / Dual / SingleReverse / DualReverse / Bypass**, default single | round 135: caption "Pitch mode", Single / Dual / Single, bright / Dual, bright / No shift | ⚠️ | The reverse-grain modes are still approximated by a +4 dB shelf (engine). |
 | color mode | Bright / Dark (Dark = steep loss above ~10 kHz) | Bright / Dark (5 kHz loop band limit) | ✅/⚠️ | Dark is darker than described. |
-| Programs | 8 host programs (Program param, `currentProgram`) | none | ❌ | |
+| Programs | 8 host programs (Program param, `currentProgram`) | LYNX's own factory presets in the preset bar | — | round 137: deliberately left out — the programs are the vendor's presets (the third-party rule: never copy their presets); Halo's own factory presets play that role |
 | Description line | none visible in 1.2.2's UI (the page says tooltips) | hint bar | ✅ | |
 | Resizable | not in 1.2.2 (fixed small UI) | resizable | ➕ | |
 | Gestures | not documented | full set | ➕ | |
@@ -1314,7 +1314,7 @@ Sources: [VintageVerb](https://valhalladsp.com/shop/reverb/valhalla-vintage-verb
 | Style | Single / Dual / Ratio / PingPong / Quad knob under Mix, default Single | Style knob with 5 steps, same place; order Single / Ratio / Quad / Dual / Ping-pong; the substitute reorders | ✅ | The knob order is different, so turning it gives a different sequence than the original |
 | Style changes which controls are shown | Spread / Ratio / Spacing / Delay R swap in place | Same swaps (`when` items) | ✅ | |
 | Delay time | 0–20 000 ms, piecewise law, default 300 ms, big knob | Same law and default | ✅ | |
-| Delay label L / R in Dual and PingPong | Captions read "DELAY L" and "DELAY R" | Captions read "Delay" and "Delay R" | ⚠️ | Left caption doesn't change |
+| Delay label L / R in Dual and PingPong | Captions read "DELAY L" and "DELAY R" | Captions read "Delay L" and "Delay R" in Dual / Ping-pong | ✅ | round 129 (row re-checked in round 137) |
 | Sync combo under the time knob | Msec / Note / Dotted / Triplet; "DELAY Sync" becomes L and R in Dual / PingPong | Same 4 choices, same place, R menu only in Dual / Ping-pong | ✅ | |
 | Note value | 1/64 … 8/1 (10 values); the knob turns into a note knob | Same 10 values; note knob replaces the time knob | ✅ | |
 | Spread (Single) | ±20 ms, 0 ms | Same, ±¼ applied per side as measured | ✅ | |
@@ -1330,23 +1330,23 @@ Sources: [VintageVerb](https://valhalladsp.com/shop/reverb/valhalla-vintage-verb
 | Diff Size | 0–100 %, 100 % | Same | ✅ | |
 | Mod: Wow / Flutter (tape modes) | 0–100 %, 50 / 50 | Same, shown in Tape only | ✅ | Original also shows them in DuckTape and ChromeTape; LYNX maps both to Tape |
 | Mod: Rate / Depth (HiFi / BBD / Digital) | 0.01–10 Hz, 0.50 Hz; 0–100 %, 50 % | Same values, shown for Lo-Fi … Phaser | ✅ | |
-| Section title changes to FREQ (Ghost) / PITCH (Pitch) | The section header is renamed | Header always reads "Mod" | ⚠️ | UI only |
+| Section title changes to FREQ (Ghost) / PITCH (Pitch) | The section header is renamed | Mod / Freq / Pitch by mode | ✅ | round 129 (row re-checked in round 137) |
 | Freq Shift / Detune (Ghost) | ±1000 Hz (\|x\|^5), 0 Hz; ±10 Hz, 0.10 Hz | Same laws and defaults (Shifter mode) | ✅ | |
 | Pitch Shift / Detune (Pitch / RevPitch) | ±24 st, 0; ±100 c, 0 | Same (Pitch, Reverse) | ✅ | |
 | EQ High / Low | 200–20 000 Hz, 20 kHz; 10–2000 Hz, 10 Hz; in the feedback path | Same, High above Low | ✅ | |
-| Ducking | 0–100 % one-knob ducking (feedback + output); comes with the duck modes | Ducking knob in an "Output" section, active in every mode, simple envelope curve | ⚠️ | Placement and behaviour not confirmed against the original; curve not measured |
+| Ducking | 0–100 % one-knob ducking (feedback + output); comes with the duck modes | Ducking knob in an "Output" section, active in every mode; round 137: the original's curve | ✅ | round 137 [EXEC] measured on the demo (1 kHz tone at −29 / −15 / −9 dBFS rms, ducking 25–100 %): a gain reduction on the echoes keyed by the input = input rms − T, T = −51 dB × ducking^1.28, released at ≈ 85 dB/s; LYNX uses that law (REA_rodada137 §5) |
 | Mode list | 17 modes: Tape, HiFi, BBD, Digital, Ghost, Pitch, RevPitch, BBDuck, Clarity, DuckTape, PitchDuck, LoFi, Quartz, PhaserDDL, RichPitch, ChromeTape, Analog | 12 characters | ⚠️ | BBDuck → bucket (loses brightness that follows the delay time), Clarity / Quartz → Clean (loses Clarity's limiter and Era waveforms), DuckTape / ChromeTape → Tape, PitchDuck → Pitch; built-in ducking lost |
 | Mode selector with ◀ ▶ | Bottom left, "MODE: Tape ◀▶" | Bottom left menu with ◀ ▶ | ✅ | |
-| Era | Past / Present / Future, ◀ ▶, bottom middle; changes filters, saturation, diffusion and Clarity's waveforms | — | ❌ | Needs a new parameter and per-mode voicing |
+| Era | Past / Present / Future, ◀ ▶, bottom middle; changes filters, saturation, diffusion and Clarity's waveforms | round 137: Past / Present / Future tabs, bottom right; default Past (the old sound) | ✅ | [EXEC] the demo's default is Past (value 1/3; Present from 2/3, Future at 1); the first repeat's top end opens with the era (Tape 8 kHz −10.1 / −7.1 / −6.5 dB, Digital 12 kHz −45 / −6.6 / −6.3, LoFi 8 kHz −10 / −5.3 / −1.8, BBD 4 kHz −27 / −17 / −8; HiFi and Clarity unchanged): LYNX scales each character's loop low-pass by the fitted factor; the era's saturation / diffusion differences are not modelled |
 | Colour theme follows the mode | The whole panel recolours per mode family (green tape, blue digital, grey Ghost, navy Pitch) | Fixed theme | ⚠️ | Design cue only; a LYNX accent per mode family would do, without copying the original's colours |
 | Preset browser | "PRESET: Default ◀▶" bottom right, large factory library | Header box shows "(no preset)" | ✅ | Applies to all LYNX engines; round 129's preset bar (LYNX factory presets for Echoform) |
-| Description line | Bottom strip describes the current Style / Mode, and the hovered control | Hint only in the main window's hint bar | ❌ | UI only |
+| Description line | Bottom strip describes the current Style / Mode, and the hovered control | bottom strip (hovered control, else the mode) | ✅ | round 135 (row re-checked in round 137) |
 | Text entry / reset gestures | Not confirmed in our refs | Right-click value entry, double-click / Alt-click default, Ctrl fine drag, wheel | ✅ | |
 | Resizable window | Resize corner; uiWidth / uiHeight saved in the state | Resizable, fixed aspect ratio | ✅ | uiWidth / uiHeight not translated (harmless) |
 | Output level | — | Level ±18 dB | ➕ | |
 | Ping-pong "Pairs" toggle | — | Pairs / alternate | ➕ | |
 | Echo-train display | — | Echoes on a time axis | ➕ | |
-| Saved-state translation | — | Translates everything except Era, TapA–D, RepeatSwell; 17 modes → 12 characters; duck variants lose built-in ducking | ⚠️ | `PluginSubstitutes.cpp [valhalla-delay]` |
+| Saved-state translation | — | Translates everything (round 137: + Era, TapA–D, RepeatSwell); 17 modes → 12 characters; duck variants lose built-in ducking | ⚠️ | `PluginSubstitutes.cpp [valhalla-delay]` |
 
 **Scores:** configuration 6/10, design 6/10.
 
@@ -1432,14 +1432,14 @@ Sources: [VintageVerb](https://valhalladsp.com/shop/reverb/valhalla-vintage-verb
 | EQ page | Mode Bright / Dark, Low Cut 10 Hz, High Cut 20 kHz, SpatialEQ 300 Hz | Same | ✅ | |
 | DRIVE page | On/Off, InGain 9 dB, OutGain −6 dB, NoiseGain −90 dB, Pre/Post (POST) | Same | ✅ | |
 | WARP page: Speed, fbMix, Smoothing | 1X / ½X, 50 %, 100 ms | Same | ✅ | |
-| WARP page: InputPan | 0–8 steps, shows "Stereo" | — | ❌ | Not in the engine; substitute drops it |
+| WARP page: InputPan | 0–8 steps, shows "Stereo" | round 137: Input pan menu on the WARP page (Stereo / Swapped / Mono / Mono left / Mono right) | ✅ | [EXEC] left- and right-only impulses through the demo: index 0–1 stereo (default 1), 2 swapped, 3 (L + R) / 2 to both, 4 to the left only, 5 to the right only, 6–8 like stereo; translated one to one |
 | 16-tap alternating polarity / type ≥ 10 | Measured | Not modelled | ⚠️ | |
 | Preset browser | "PRESET: Default ◀▶" next to the page area | header preset bar + the original's preset name | ✅ | rounds 129 / 135 |
 | Description / tooltip line | Bottom strip shows hover help (e.g. the OverMod warning) | bottom strip: every control described ("Over-mod — pushes the modulation past its normal range (can sound unstable)") | ✅ | round 135 |
 | Tap display | — | Tap graph under the pages | ➕ | |
 | Resizable | Fixed size | Resizable | ➕ | |
 | Gestures / text entry | Not confirmed | Full LYNX set | ✅ | |
-| Saved-state translation | — | Everything except DelaySync and InputPan | ⚠️ | `PluginSubstitutes.cpp [valhalla-ubermod]` |
+| Saved-state translation | — | Everything except DelaySync (round 137: InputPan translated) | ⚠️ | `PluginSubstitutes.cpp [valhalla-ubermod]` |
 
 **Scores:** configuration 6/10, design 7/10. **After round 135**: configuration 7/10, design 9/10 (left: per-mode LFO designs, InputPan, Sync translation).
 
@@ -1503,7 +1503,7 @@ Sources: docs/specs/echoboy.md (Pro Tools-era guide pp. 22–54, store page); `[
 | Echo Mode: Single | per-channel echo | Delay model Mono/Stereo | Style "Single" (+ Spread) | ✅ (Echoform) | |
 | Echo Mode: Dual | two independent times, FB mix / balance | Offset only | Style "Dual" (Time L/R, sync L/R) | ⚠️ | no FB cross-mix or FB balance |
 | Echo Mode: Ping-Pong | mono in, L then R | Ping pong | Style "Ping-pong" (+ Pairs) | ✅ | |
-| Echo Mode: Rhythm (≤16 taps, 1–8 beats, grid ½…1/64, Shape) | Rhythm editor | — | — (Ratio/Quad are not a pattern) | ❌ | biggest structural gap |
+| Echo Mode: Rhythm (≤16 taps, 1–8 beats, grid ½…1/64, Shape) | Rhythm editor | — | round 137: RHYTHM switch (third row): evenly spaced taps (ms / note / dotted / triplet), Repeats 1–16, Decay 0–40 dB, Length 1–8 beats; the echo train shows the pattern | ⚠️ (Echoform) | [EXEC] measured on the trial (impulses at 60 / 120 BPM; its host parameters RhythmMode / Note / Time / Repeats / Decay): Repeats = slots incl. the input, so repeats − 1 taps are heard, each 1 / √slots (equal power, with the decay spread from the first slot to the last); the pattern spans 2 beats (taps past it are dropped) and the feedback replays it every 2 beats — LYNX's Length defaults to 2 beats. Left: the Pattern presets and the Custom (drawn) taps of the rhythm editor (not host parameters, not measured) |
 | Echo Style menu (~30 voicings) | main panel menu | — | Mode menu: 12 (Tape, Lo-Fi, Hi-Fi tape, Bucket brigade, Analog, Digital, Clean, Phaser, Shifter, Pitch, Reverse, Detune) | ⚠️ | covers families: tape/BBD/digital/lo-fi; no radio/telephone, chorus/vibrato, "Diffused/Verbed" variants |
 | Echo Time ms | ms, pitch-bends when moved | Time + Keep pitch | Time L/R 0–20 s, default 300 ms | ✅ | |
 | Note / Dotted / Triplet | Note/Dot/Trip buttons | Tempo sync | Sync menu ms/Note/Dotted/Triplet, 1/64…8/1 | ✅ | |
@@ -1612,7 +1612,7 @@ TD-PSOLA from core/VocalPitch.h), for this role: 696 slots in 399 of her project
 | DRIVE | 0.0…10.0 | Drive 0–10 (tube stage on the shifted voice, ≈ 1.75 dB / step, make-down above 6) | ✅ | curve fitted roughly on the trial's level / harmonics (round 136 may refine) |
 | MIX | 0–100 %, default 100, linear | Mix (linear, dry delayed by the latency) | ✅ | measured linear on the trial |
 | Latency | 2417 samples at 48 kHz (reported) | two periods of 70 Hz (≈ 1376 at 48 kHz), reported | ⚠️ | different (both compensated by PDC) |
-| MIDI → pitch | host MIDI | — | ❌ | |
+| MIDI → pitch | host MIDI | round 137: MIDI channel stepper under the modes: the highest note held on that Channel Rack channel replaces Pitch (relative to C4) in Transpose / Quantize and is the note Robot sings | ✅ | [MANUAL] the original's MIDI mode; the trial's MIDI response was not measured (our measurement host sends no notes) |
 | One-screen panel | Pitch / Formant · Mode · Drive / Mix | the same three sections | ✅ | |
 | Presets | Soundtoys strip | LYNX preset bar with 7 factory presets | ✅ | |
 | Substitute entry | — | `[soundtoys-littlealterboy]` (VST2 `StLa`, names) | ✅ | round 135 |

+ 12 - 0
resources/i18n/pt-BR.txt

@@ -3617,3 +3617,15 @@ countries: br
 "Voice Shift" = "Voice Shift"
 "Voicing" = "Timbre"
 "Holds the plate's tail for ever (the decay at its top): play into it to layer, switch off to let it fade" = "Segura a cauda da placa para sempre (o decaimento no máximo): toque por cima para sobrepor, desligue para deixar sumir"
+
+# --- Round 137: Echoform Rhythm mode and Era
+"Rhythm echo: a pattern of evenly spaced taps that the feedback repeats every Length" = "Eco rítmico: um padrão de taps igualmente espaçados que o feedback repete a cada Duração"
+"Slots in the rhythm pattern (the first one is the input itself)" = "Posições no padrão rítmico (a primeira é a própria entrada)"
+"How much quieter the last tap of the pattern is than the first" = "Quanto o último tap do padrão é mais baixo que o primeiro"
+"Length of the rhythm pattern in beats; the feedback replays it" = "Duração do padrão rítmico em tempos; o feedback o repete"
+"Repeats" = "Repetições"
+"Past|Present|Future" = "Passado|Presente|Futuro"
+"Input pan" = "Pan de entrada"
+"Stereo|Swapped|Mono|Mono left|Mono right" = "Estéreo|Invertido|Mono|Mono esquerda|Mono direita"
+"Trigger" = "Gatilho"
+"Off|Host sync|MIDI" = "Desl.|Sinc. do host|MIDI"

+ 63 - 2
src/core/DynamicsSuite.cpp

@@ -196,6 +196,27 @@ int oversamplingOf (float v) noexcept { return 1 << pick (v, 4); }
 double panOf (float v) noexcept { return std::clamp ((double) v * 2.0 - 1.0, -1.0, 1.0); }
 double trimDb (float v) noexcept { return lin (v, -36.0, 36.0); }
 LinkMode linkModeOf (float v) noexcept { return (LinkMode) pick (v, linkModes); }
+Trigger triggerOf (float v) noexcept { return (Trigger) pick (v, 3); }
+double triggerBeats (float v) noexcept { return 4.0 / (double) (1 << pick (v, 5)); }
+double triggerRateOf (float v) noexcept { return std::pow (2.0, 2.0 * (double) std::clamp (v, 0.0f, 1.0f) - 1.0); }
+double triggerLengthOf (float v) noexcept { return (double) std::clamp (v, 0.0f, 1.0f); }
+int triggerChannelOf (float v) noexcept
+{
+    const auto k = (int) std::lround (std::clamp (v, 0.0f, 1.0f) * 128.0f);
+    return k <= 0 ? -1 : k - 1;
+}
+// [EXEC] Pro-C 3 hosted at 120 BPM, a steady sine under the threshold: with Host Sync the gain reduction starts on
+// every note × rate (1/4 at 100 % = every 500 ms, 50 % = 250 ms, 200 % = 1 s; 1/8 at 100 % = 250 ms) and holds for
+// Length of that period (10 % = 50 ms, 50 % = 250 ms); its depth follows a 0 dBFS key (threshold −18 / −40 / 0 dB,
+// ratio 4:1, knee 18 dB: 14 / 32 / 2 dB of reduction)
+float hostTrigger (const EffectParams& p, double beats) noexcept
+{
+    const auto period = triggerBeats (p[triggerSync]) * triggerRateOf (p[triggerRate]);
+    if (period <= 0.0 || beats < 0.0)
+        return 0.0f;
+    const auto phase = beats / period - std::floor (beats / period);
+    return phase < triggerLengthOf (p[triggerLength]) ? 1.0f : 0.0f;
+}
 float linkModeValue (LinkMode m) noexcept { return (float) (int) m / (float) (linkModes - 1); }
 double dryDb (float v) noexcept
 {
@@ -439,12 +460,21 @@ public:
         scL = l;
         scR = r;
     }
+    // round 137: the trigger's clock and notes
+    void setSongPosition (double ticks) noexcept override { songBeats = ticks / (double) ppq; }
+    void setPlaying (bool playing) noexcept override { transportPlaying = playing; }
+    void setHeldNotes (const NoteMask* channels, int count) noexcept override
+    {
+        held = channels;
+        heldCount = count;
+    }
 
-    void process (float* l, float* r, int n, const EffectParams& p, double) noexcept override
+    void process (float* l, float* r, int n, const EffectParams& p, double bpm) noexcept override
     {
         lastParams = p;
         configure (p);
         designScEq (p);
+        blockBpm = bpm > 1.0 ? bpm : 120.0;
         for (int off = 0; off < n; off += maxBlock)
             chunk (l + off, r + off, std::min (maxBlock, n - off), p, off);
         scL = scR = nullptr;
@@ -610,6 +640,13 @@ private:
         const auto drv = (float) dbToGain (driveDb (p[drive]));
         const auto scGain = (float) dbToGain (scLevelDb (p[scLevel]));
         const bool external = on (p[scExternal]) && scL != nullptr && scR != nullptr;
+        // round 137: the trigger replaces the detector's signal (a 0 dBFS key × the side-chain level)
+        const auto trig = triggerOf (p[trigger]);
+        float midiKey = 0.0f;
+        if (trig == Trigger::midi)
+            if (const auto c = triggerChannelOf (p[triggerChannel]); c >= 0 && held != nullptr && c < heldCount)
+                midiKey = (held[c][0] | held[c][1]) != 0 ? 1.0f : 0.0f;
+        const auto beat0 = songBeats + (double) offset * blockBpm / 60.0 / sr, beatStep = blockBpm / 60.0 / sr;
         const auto link = (double) std::clamp (p[stereoLink], 0.0f, 1.0f);
         const auto inGain = (float) dbToGain (trimDb (p[input]));
         const auto outGain = (float) dbToGain (trimDb (p[output]));
@@ -665,6 +702,8 @@ private:
                         sa = f.process (sa, 0);
                         sb = f.process (sb, 1);
                     }
+            if (trig != Trigger::off)
+                sa = sb = scGain * (trig == Trigger::midi ? midiKey : (transportPlaying ? hostTrigger (p, beat0 + beatStep * (double) i) : 0.0f));
             sideL[(std::size_t) i] = sa;
             sideR[(std::size_t) i] = sb;
             if (autoThr)
@@ -835,6 +874,11 @@ private:
     DcBlock dc;
     const float* scL = nullptr;
     const float* scR = nullptr;
+    // round 137: the trigger's clock (quarter notes at the block start) and the held notes
+    double songBeats = 0.0, blockBpm = 120.0;
+    bool transportPlaying = false;
+    const NoteMask* held = nullptr;
+    int heldCount = 0;
     std::array<float, maxBlock> wl {}, wr {}, gl {}, gr {}, dl {}, dr {}, sideL {}, sideR {};
     std::array<float, maxBlock * maxFactor> upL {}, upR {}, upGl {}, upGr {};
     LiveMeters meters;
@@ -1504,7 +1548,10 @@ const EffectInfo& crestInfo()
                                      { "Oversampling", 0.0f }, { "Auto gain", 1.0f }, { "Mix", 1.0f }, { "Input", 0.5f }, { "Output", 0.5f },
                                      { "Dry", 0.0f }, { "Auto threshold", 0.0f }, { "Link mode", 0.0f }, { "Meter scale", 0.75f },
                                      { "Input meter", 1.0f },
-                                     { "Wet pan", 0.5f }, { "Dry pan", 0.5f } } }; // round 135
+                                     { "Wet pan", 0.5f }, { "Dry pan", 0.5f }, // round 135
+                                     // round 137: the side-chain trigger (off), 1/4 note, rate 100 %, length 10 %, no channel
+                                     { "Trigger", 0.0f }, { "Trigger sync", 0.5f }, { "Trigger rate", 0.5f }, { "Trigger length", 0.1f },
+                                     { "Trigger channel", 0.0f } } };
     return info;
 }
 
@@ -1643,6 +1690,20 @@ std::string paramText (EffectKind kind, int param, float v)
                 const auto x = panOf (v);
                 return std::abs (x) < 0.005 ? std::string ("C") : fmt (x < 0 ? "%.0f%% L" : "%.0f%% R", std::abs (x) * 100.0);
             }
+            case trigger:
+            {
+                static const char* names[3] { "Off", "Host sync", "MIDI" };
+                return names[(int) triggerOf (v)];
+            }
+            case triggerSync:
+            {
+                static const char* names[5] { "1/1", "1/2", "1/4", "1/8", "1/16" };
+                return names[pick (v, 5)];
+            }
+            case triggerRate: return fmt ("%.0f%%", 100.0 * triggerRateOf (v));
+            case triggerLength: return fmt ("%.0f%%", 100.0 * triggerLengthOf (v));
+            case triggerChannel:
+                return triggerChannelOf (v) < 0 ? std::string ("Off") : fmt ("Channel %d", triggerChannelOf (v) + 1);
             default: return on (v) ? "on" : "off";
         }
     }

+ 13 - 0
src/core/DynamicsSuite.h

@@ -51,8 +51,21 @@ enum Param
     dryGain, autoThreshold, linkMode, meterScale, inputMeter,
     // round 135 (Pro-C 3 parity): the wet (compressed) and dry paths' stereo balance
     wetPan, dryPan,
+    // round 137 (Pro-C 3 parity, appended; off by default): the side-chain trigger — the detector hears a 0 dBFS
+    // pulse (× the side-chain level) instead of the audio: Host sync = a pulse every note × rate, Length of that
+    // period long, on the song position; MIDI = while a note is held on the chosen Channel Rack channel.
+    // [EXEC] measured on the trial (REA_rodada137 §6)
+    trigger, triggerSync, triggerRate, triggerLength, triggerChannel,
     count
 };
+enum class Trigger { off, hostSync, midi };
+Trigger triggerOf (float v) noexcept;
+double triggerBeats (float v) noexcept;     // whole, 1/2, 1/4, 1/8, 1/16 note (quarter notes: 4 … 0.25)
+double triggerRateOf (float v) noexcept;    // 0.5 … 2 (the trial's "offset" 50 … 200 %, log)
+double triggerLengthOf (float v) noexcept;  // 0 … 1 of the period
+int triggerChannelOf (float v) noexcept;    // −1 = off, else 0 … 127
+// the host-sync pulse at a song position (quarter notes): 1 inside the pulse, else 0
+float hostTrigger (const EffectParams& p, double beats) noexcept;
 constexpr int scBands = 3;
 // stereo-link modes: L/R (the classic linked or split stereo detection), mid only, side only, mid triggers the side,
 // side triggers the mid (the last four process in mid / side)

+ 156 - 18
src/core/EchoSuite.cpp

@@ -390,6 +390,79 @@ double sideMs (const EffectParams& p, bool right, double bpm) noexcept
 
 double bpmOf (float v) noexcept { return 30.0 + 270.0 * (double) clamp01 (v); }
 float bpmValue (double bpm) noexcept { return (float) std::clamp ((bpm - 30.0) / 270.0, 0.0, 1.0); }
+
+// round 137: Rhythm mode. Measured black-box on EchoBoy (REA_rodada137 §2, impulses at 60 and 120 BPM): `repeats`
+// evenly spaced slots (slot 0 = the input itself, not heard on the first pass), levels falling by `decay` dB from the
+// first slot to the last one that fits, equal-power normalised over those slots (1 / √slots with no decay); the
+// pattern spans 2 beats whatever the spacing (taps past it are dropped) and the feedback replays it every 2 beats.
+int eraOf (float v) noexcept { return std::clamp ((int) std::lround (clamp01 (v) * 2.0f), 0, 2); }
+
+// round 137 [EXEC] ValhallaDelay demo, first repeat of an impulse (300 ms, no feedback / modulation), Past → Present
+// → Future: Tape 8 kHz −10.1 / −7.1 / −6.5 dB, Digital 12 kHz −44.9 / −6.6 / −6.3, LoFi 8 kHz −10.0 / −5.3 / −1.8,
+// BBD 4 kHz −27 / −17 / −8, Analog 8 kHz rises by 13 / 24 dB; HiFi and Clarity unchanged. Fitted as cut-off factors
+// on the mode's loop low-pass (the 2-pole tape roll-off, the steep BBD / analog / digital filters).
+double eraBandwidth (Mode m, int e) noexcept
+{
+    e = std::clamp (e, 0, 2);
+    if (e == 0)
+        return 1.0;
+    switch (m)
+    {
+        case Mode::tape: return e == 1 ? 1.13 : 1.27;
+        case Mode::lofi: return e == 1 ? 1.45 : 2.2;
+        case Mode::bucket: return e == 1 ? 1.25 : 1.6;
+        case Mode::analog: return e == 1 ? 1.45 : 2.0;
+        case Mode::digital: return e == 1 ? 1.65 : 1.8;
+        default: return 1.0;
+    }
+}
+
+int rhythmRepeatsOf (float v) noexcept { return std::clamp ((int) std::lround (clamp01 (v) * 15.0f), 0, 15) + 1; }
+double rhythmDecayDb (float v) noexcept { return 40.0 * (double) clamp01 (v); }
+int rhythmBeatsOf (float v) noexcept { return std::clamp ((int) std::lround (clamp01 (v) * 7.0f), 0, 7) + 1; }
+
+double rhythmSpacingMs (const EffectParams& p, double bpm) noexcept
+{
+    const auto kind = syncKind (p[rhythmSync]);
+    if (kind == 0)
+        return std::max (1.0, timeMs (p[rhythmTime]));
+    return std::max (1.0, noteBeats (noteIndex (p[rhythmNote]), kind) * 60000.0 / tempoFor (p, bpm));
+}
+
+double rhythmLengthMs (const EffectParams& p, double bpm) noexcept
+{
+    return std::min (19000.0, (double) rhythmBeatsOf (p[rhythmLength]) * 60000.0 / tempoFor (p, bpm));
+}
+
+// the pattern without allocating (the audio thread): up to 15 heard taps, returns their count
+int rhythmPattern (const EffectParams& p, double bpm, std::array<RhythmTap, 16>& taps, double& slot0) noexcept
+{
+    const auto spacing = rhythmSpacingMs (p, bpm), length = rhythmLengthMs (p, bpm);
+    const auto slots = std::clamp (std::min (rhythmRepeatsOf (p[rhythmRepeats]), (int) std::floor (length / spacing + 1e-6) + 1), 1, 16);
+    const auto decay = rhythmDecayDb (p[rhythmDecay]);
+    std::array<double, 16> g {};
+    double power = 0.0;
+    for (int k = 0; k < slots; ++k)
+    {
+        g[(std::size_t) k] = slots > 1 ? std::pow (10.0, -decay * (double) k / (double) (slots - 1) / 20.0) : 1.0;
+        power += g[(std::size_t) k] * g[(std::size_t) k];
+    }
+    const auto norm = 1.0 / std::sqrt (power);
+    slot0 = g[0] * norm;
+    for (int k = 1; k < slots; ++k)
+        taps[(std::size_t) (k - 1)] = { spacing * (double) k, g[(std::size_t) k] * norm * (double) clamp01 (p[rhythmTap1 + k - 1]) };
+    return slots - 1;
+}
+
+std::vector<RhythmTap> rhythmTaps (const EffectParams& p, double bpm, double* slot0)
+{
+    std::array<RhythmTap, 16> taps {};
+    double first = 0.0;
+    const auto n = rhythmPattern (p, bpm, taps, first);
+    if (slot0 != nullptr)
+        *slot0 = first;
+    return { taps.begin(), taps.begin() + n };
+}
 double tempoFor (const EffectParams& p, double projectBpm) noexcept
 {
     if (p[tempoSource] >= 0.5f)
@@ -502,6 +575,7 @@ public:
         steep.reset();
         lfoPhase = 0.0;
         envelope = 0.0f;
+        duckGr = 0.0;
         hyb.dirty = true;
     }
 
@@ -539,7 +613,8 @@ private:
     {
 
         const auto md = modeOf (p[mode]);
-        const auto st = styleOf (p[style]);
+        const bool rhythmOn = p[rhythm] >= 0.5f; // round 137: Rhythm mode overrides the style
+        const auto st = rhythmOn ? Style::single : styleOf (p[style]);
         float dryGain = 1.0f, wetGain = 0.0f;
         equalPowerMix (p[mix], dryGain, wetGain);
 
@@ -553,6 +628,14 @@ private:
         const auto spreadMs = 20.0 * bipolar (p[spread]);
         tL = std::max (0.0, tL + spreadMs * 0.25);
         tR = std::max (0.0, tR - spreadMs * 0.25);
+        std::array<RhythmTap, 16> rTaps {};
+        double rSlot0 = 0.0;
+        int rCount = 0;
+        if (rhythmOn) // the loop is the pattern length; the taps are read inside it
+        {
+            tL = tR = rhythmLengthMs (p, bpm);
+            rCount = rhythmPattern (p, bpm, rTaps, rSlot0);
+        }
 
         const auto g = feedbackGain (p[feedback]);
         const bool pairsOn = p[pairs] >= 0.5f;
@@ -573,7 +656,7 @@ private:
         const auto cents = 100.0 * bipolar (p[pitchDetune]);
 
         // character: the write-path filter / shaper and the modulation source
-        configure (md, tL, ageV);
+        configure (md, tL, ageV, eraOf (p[era]));
         for (auto& c : ch)
         {
             c.lowCut.set (lowCutHz (p[lowCut]), sr);
@@ -589,7 +672,8 @@ private:
         const auto quadEl = std::pow (2.0, -0.4 * bipolar (p[spacing]));
         const auto quadEr = std::pow (2.0, 0.4 * bipolar (p[spacing]));
         const auto envAttack = (float) (1.0 - std::exp (-1.0 / (0.01 * sr)));
-        const auto envRelease = (float) (1.0 - std::exp (-1.0 / (0.25 * sr)));
+        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 };
 
         // round 135w: quad taps / swell, groove / feel / accent, prime numbers, cross feedback, balance, freeze, start side
@@ -603,7 +687,7 @@ private:
         const int first = (st == Style::pingPong && p[startSide] >= 0.5f) ? 1 : 0, second = 1 - first;
         // the plain read path (no shifter / pitch / reverse / phaser on the echoes) can read the echoes from their own
         // taps: Feel moves the heard taps, Groove / Accent use a loop of two echo times (odd and even repeats apart)
-        const bool plainRead = (int) md < (int) Mode::phaser && st != Style::quad;
+        const bool plainRead = (int) md < (int) Mode::phaser && st != Style::quad && ! rhythmOn;
         const auto longest = std::max (tL, tR) * 0.001 * sr * (1.0 + std::abs (feelV) + std::abs (grooveV)) + 0.02 * sr;
         const bool twoTap = plainRead && st != Style::pingPong && (std::abs (grooveV) > 1e-6 || std::abs (accentV) > 1e-6)
                             && 2.0 * longest < ch[0].line.maxDelay();
@@ -657,7 +741,16 @@ private:
             {
                 auto& s = ch[(std::size_t) c];
                 float y = 0.0f;
-                if (st == Style::quad)
+                if (rhythmOn)
+                {
+                    // slot 0 comes back through the loop (the input of the last pass), the taps scale with the glide
+                    const auto scale = target[c] > 1.0 ? d[c] / target[c] : 1.0;
+                    fbSig[c] = s.line.at (std::min (maxRead, d[c]));
+                    y = (float) (rSlot0 * loopG) * fbSig[c];
+                    for (int k = 0; k < rCount; ++k)
+                        y += (float) rTaps[(std::size_t) k].level * s.line.at (std::clamp (rTaps[(std::size_t) k].ms * 0.001 * sr * scale, 2.0, maxRead));
+                }
+                else if (st == Style::quad)
                 {
                     const auto e = c == 0 ? quadEl : quadEr;
                     float last = 0.0f, heard = 0.0f;
@@ -729,7 +822,7 @@ private:
                     }
                     default: break;
                 }
-                if (st != Style::quad && ! twoTap && ! feelTap) // the quad style feeds back its last tap as read
+                if (st != Style::quad && ! twoTap && ! feelTap && ! rhythmOn) // the quad style feeds back its last tap as read
                     fbSig[c] = y;
                 echo[c] = y;
             }
@@ -775,14 +868,22 @@ private:
                 s.line.push (softLimit (u));
             }
 
-            // ducking (not measured: a plain envelope-driven gain on the echoes)
+            // ducking, round 137 [EXEC] measured on the ValhallaDelay demo (REA_rodada137 §5): a gain reduction on the
+            // echoes keyed by the input's level: GR = input rms − T, T = −51 dB × ducking^1.28 (a 6 dB soft knee),
+            // fast attack (10 ms), released at ≈ 85 dB / s
             auto duckGain = 1.0f;
             if (duck > 0.0f)
             {
-                const auto e = std::abs (mono);
-                envelope += (e - envelope) * (e > envelope ? envAttack : envRelease);
-                duckGain = 1.0f / (1.0f + 8.0f * duck * envelope);
+                const auto e = mono * mono;
+                envelope += (e - envelope) * envAttack;
+                const auto keyDb = 10.0 * std::log10 (std::max (1e-12, (double) envelope));
+                const auto x = keyDb - duckThresholdDb;
+                const auto target = x <= -3.0 ? 0.0 : x >= 3.0 ? x : (x + 3.0) * (x + 3.0) / 12.0;
+                duckGr = target > duckGr ? duckGr + (target - duckGr) * (double) envAttack : std::max (target, duckGr - duckReleaseStep);
+                duckGain = (float) std::pow (10.0, -duckGr / 20.0);
             }
+            else
+                duckGr = 0.0;
 
             // balance of the echoes, width (M / S of the echoes) and the equal-power mix
             echo[0] *= 1.0f - std::max (0.0f, balanceV);
@@ -826,9 +927,10 @@ private:
         return y;
     }
 
-    void configure (Mode m, double timeMsL, float ageV) noexcept
+    void configure (Mode m, double timeMsL, float ageV, int eraIndex = 0) noexcept
     {
         modAmountMs = 6.1;
+        const auto bw = eraBandwidth (m, eraIndex); // round 137: Era (1 = Past)
         switch (m)
         {
             case Mode::tape:
@@ -837,7 +939,7 @@ private:
             {
                 // tape: the head bump / low-end loss (low shelf −5 dB), and a two-pole roll-off that falls with the
                 // delay time (tape speed): ≈ 9 kHz at 100 ms, 5 kHz at 300 ms, 2.7 kHz at 1 s
-                const auto fc = m == Mode::tape ? std::clamp (9000.0 * std::pow (std::max (1.0, timeMsL) / 100.0, -0.5), 1500.0, 10000.0) : 9000.0;
+                const auto fc = std::min (0.45 * sr, bw * (m == Mode::tape ? std::clamp (9000.0 * std::pow (std::max (1.0, timeMsL) / 100.0, -0.5), 1500.0, 10000.0) : 9000.0));
                 for (auto& c : ch)
                 {
                     c.shelf.set (350.0, sr);
@@ -859,12 +961,12 @@ private:
                 modulation = m == Mode::hifi ? ModSource::random : ModSource::none;
                 break;
             case Mode::bucket:
-                steep.set (1650.0, sr);
+                steep.set (1650.0 * bw, sr);
                 shaper.set (0.6f, 0.05f);
                 modulation = ModSource::sine;
                 break;
             case Mode::analog:
-                steep.set (3450.0, sr);
+                steep.set (3450.0 * bw, sr);
                 shaper.set (1.525f, 0.0f);
                 modulation = ModSource::sine;
                 break;
@@ -872,7 +974,7 @@ private:
             case Mode::pitch:
             case Mode::reverse:
             case Mode::detune:
-                steep.set (8000.0, sr);
+                steep.set (std::min (0.45 * sr, 8000.0 * bw), sr);
                 shaper.set (0.375f, 0.0f);
                 modulation = m == Mode::digital ? ModSource::sine : ModSource::none;
                 break;
@@ -1040,6 +1142,7 @@ private:
     double wowAmountMs = 1.15, flutterAmountMs = 0.2;
     double lfoPhase = 0.0;
     float envelope = 0.0f;
+    double duckGr = 0.0; // round 137: the ducking's gain reduction (dB)
 };
 } // namespace
 } // namespace echoform
@@ -1327,6 +1430,8 @@ private:
 // =====================================================================================================================
 namespace lattice
 {
+int inputPanOf (float v) noexcept { return std::clamp ((int) std::lround (clamp01 (v) * 8.0f), 0, 8); }
+
 int tapCount (float v) noexcept
 {
     static constexpr int counts[10] = { 1, 1, 2, 3, 3, 3, 4, 8, 8, 16 };
@@ -1452,6 +1557,7 @@ public:
         const auto noiseLevel = (float) std::pow (10.0, (-120.0 + 90.0 * clamp01 (p[noise])) / 20.0);
         const auto smoothS = (1.0 + 999.0 * (double) clamp01 (p[smoothing])) * 0.001;
         const auto isDark = on (p[colour]);
+        const auto panMode = inputPanOf (p[inputPan]);
         static constexpr double diffRatios[4] = { 0.131, 0.217, 0.293, 0.359 };
         for (auto& c : ch)
         {
@@ -1475,6 +1581,10 @@ public:
             vibPhase -= std::floor (vibPhase);
             float wet[2];
             const float in[2] = { l[i], r[i] };
+            // round 137: Input pan (the reference's InputPan, measured [EXEC]): what enters the taps
+            const auto monoIn = 0.5f * (in[0] + in[1]);
+            const float src[2] = { panMode == 2 ? in[1] : panMode == 3 || panMode == 4 ? monoIn : panMode == 5 ? 0.0f : in[0],
+                                   panMode == 2 ? in[0] : panMode == 3 || panMode == 5 ? monoIn : panMode == 4 ? 0.0f : in[1] };
             for (int c = 0; c < 2; ++c)
             {
                 auto& s = ch[(std::size_t) c];
@@ -1500,7 +1610,7 @@ public:
             for (int c = 0; c < 2; ++c)
             {
                 auto& s = ch[(std::size_t) c];
-                auto x = in[c];
+                auto x = src[c];
                 if (useDrive && ! post)
                     x = driveFn (x) + noiseLevel * s.noise.next();
                 if (useDiff && diffG > 0.0f)
@@ -1558,7 +1668,14 @@ const EffectInfo& echoformInfo()
                                      { "Tempo source", 0.0f }, { "BPM", 1.0f / 3.0f }, { "Start side", 0.0f }, { "Filter link", 0.0f },
                                      { "Tap A", 1.0f }, { "Tap B", 1.0f }, { "Tap C", 1.0f }, { "Tap D", 1.0f }, { "Swell", 0.0f },
                                      { "Groove", 0.5f }, { "Feel", 0.5f }, { "Accent", 0.5f }, { "Prime numbers", 0.0f },
-                                     { "Cross feedback", 0.0f }, { "Balance", 0.5f }, { "Freeze", 0.0f } } };
+                                     { "Cross feedback", 0.0f }, { "Balance", 0.5f }, { "Freeze", 0.0f },
+                                     // round 137: Rhythm mode (appended; off = the old sound); 1/8 note, 8 repeats, 2 beats
+                                     { "Rhythm", 0.0f }, { "Rhythm sync", 0.5f }, { "Rhythm note", 0.35f }, { "Rhythm time", 0.3f },
+                                     { "Repeats", 7.0f / 15.0f }, { "Decay", 0.0f }, { "Length", 1.0f / 7.0f },
+                                     { "Era", 0.0f },
+                                     { "Tap 1", 1.0f }, { "Tap 2", 1.0f }, { "Tap 3", 1.0f }, { "Tap 4", 1.0f }, { "Tap 5", 1.0f },
+                                     { "Tap 6", 1.0f }, { "Tap 7", 1.0f }, { "Tap 8", 1.0f }, { "Tap 9", 1.0f }, { "Tap 10", 1.0f },
+                                     { "Tap 11", 1.0f }, { "Tap 12", 1.0f }, { "Tap 13", 1.0f }, { "Tap 14", 1.0f }, { "Tap 15", 1.0f } } };
     return info;
 }
 
@@ -1588,7 +1705,8 @@ const EffectInfo& latticeInfo()
                                      { "Vibrato depth", 0.0f }, { "Over-mod", 0.0f }, { "Drive in", 0.375f }, { "Drive out", 0.75f },
                                      { "Noise", 0.3333333f }, { "Rotate", 0.5f }, { "Smoothing", 0.0990991f }, { "Colour", 0.0f },
                                      { "Sync", 0.0f }, { "Taps", 1.5f / 24.0f } /* round 129: two taps (one a side), the reference default */, { "Diffusion on", 0.0f }, { "Drive on", 0.0f },
-                                     { "Drive post", 1.0f }, { "Half speed", 0.0f } } };
+                                     { "Drive post", 1.0f }, { "Half speed", 0.0f },
+                                     { "Input pan", 0.125f } /* round 137: index 1 = stereo, the reference default */ } };
     return info;
 }
 
@@ -1652,6 +1770,21 @@ std::string paramText (EffectKind kind, int param, float v)
             case groove: case feel: return fmt ("%+.1f%%", 25.0 * bipolar (v));
             case accent: case balance: return fmt ("%+.0f%%", 100.0 * bipolar (v));
             case crossFeedback: return pct (v * 100.0);
+            case rhythm: return v >= 0.5f ? "on" : "off";
+            case rhythmSync:
+            {
+                static const char* const kinds[4] = { "ms", "note", "dotted", "triplet" };
+                return kinds[syncKind (v)];
+            }
+            case rhythmNote: return noteNames[noteIndex (v)];
+            case rhythmTime: return msText (timeMs (v));
+            case rhythmRepeats: return fmt ("%d", rhythmRepeatsOf (v));
+            case rhythmDecay: return fmt ("%.1f dB", rhythmDecayDb (v));
+            case rhythmTap1: case rhythmTap1 + 1: case rhythmTap1 + 2: case rhythmTap1 + 3: case rhythmTap1 + 4: case rhythmTap1 + 5:
+            case rhythmTap1 + 6: case rhythmTap1 + 7: case rhythmTap1 + 8: case rhythmTap1 + 9: case rhythmTap1 + 10: case rhythmTap1 + 11:
+            case rhythmTap1 + 12: case rhythmTap1 + 13: case rhythmTapLast: return pct (v * 100.0);
+            case era: return eraOf (v) == 0 ? "past" : eraOf (v) == 1 ? "present" : "future";
+            case rhythmLength: return rhythmBeatsOf (v) == 1 ? std::string ("1 beat") : fmt ("%d beats", rhythmBeatsOf (v));
             default: return fmt ("%.2f", v);
         }
     }
@@ -1724,6 +1857,11 @@ std::string paramText (EffectKind kind, int param, float v)
             case diffOn: case driveOn: return on (v) ? "on" : "off";
             case drivePost: return on (v) ? "post" : "pre";
             case halfSpeed: return on (v) ? "1/2x" : "1x";
+            case inputPan:
+            {
+                static const char* const names[9] = { "stereo", "stereo", "swapped", "mono", "mono left", "mono right", "stereo", "stereo", "stereo" };
+                return names[inputPanOf (v)];
+            }
             default: return fmt ("%.2f", v);
         }
     }

+ 34 - 1
src/core/EchoSuite.h

@@ -19,6 +19,7 @@
 // All parameters are 0..1 in the model (EffectParams). Every effect reports zero latency; the delay lines are
 // allocated in prepare() (off the audio thread), process() never allocates.
 
+#include <array>
 #include <memory>
 #include <string>
 #include <utility>
@@ -72,6 +73,19 @@ enum Param
     crossFeedback, // 0 … 100 %: each side's feedback taken from the other side (EchoBoy's Dual "FB Mix")
     balance,     // ±100 %: the echoes' left / right level
     freeze,      // the loop holds what it has (no input, unity feedback, no colouring) (PrimalTap's Freeze)
+    // ---- round 137 (docs/PARITY.md: EchoBoy "Echo Mode: Rhythm"), appended; off by default (the old sound)
+    rhythm,        // Rhythm echo mode: a pattern of evenly spaced taps that the feedback replays (overrides the style)
+    rhythmSync,    // the tap spacing in ms (0) or as a note / dotted / triplet value (the Sync L law)
+    rhythmNote,    // that note (the Note L law, default 1/8)
+    rhythmTime,    // that time in ms (the Time L law)
+    rhythmRepeats, // 1 … 16 slots in the pattern (the first slot is the input itself: repeats − 1 taps are heard)
+    rhythmDecay,   // 0 … 40 dB from the first slot to the last
+    rhythmLength,  // the pattern length, 1 … 8 beats (measured default: 2 beats); taps past it are dropped
+    era,           // round 137: ValhallaDelay's Era: Past (0, the old sound) / Present (0.5) / Future (1): the loop's
+                   // bandwidth per mode, measured black-box on the demo (REA_rodada137 §3)
+    rhythmTap1,    // round 137: the level of each heard rhythm tap (1 … 15), 0 … 100 % (EchoBoy's rhythm editor bars);
+                   // 100 % by default, applied after the pattern's normalisation
+    rhythmTapLast = rhythmTap1 + 14,
     paramCount
 };
 enum class Style { single, ratio, quad, dual, pingPong }; // the two-time styles last (the panel shows the right time for both)
@@ -105,6 +119,20 @@ int nearestPrime (int samples) noexcept;
 // round 135w: an edit of `param` with Filter link on: the low and high cut move together (the same frequency ratio);
 // returns the edits to apply (just the one when the link is off or the parameter is not a cut)
 std::vector<std::pair<int, float>> linkedEdit (const EffectParams& p, int param, float value);
+// round 137: Rhythm mode (EchoBoy's, measured black-box [EXEC], REA_rodada137 §2)
+struct RhythmTap { double ms; double level; };
+int rhythmRepeatsOf (float v) noexcept;  // 1 … 16
+double rhythmDecayDb (float v) noexcept; // 0 … 40
+int rhythmBeatsOf (float v) noexcept;    // 1 … 8
+double rhythmSpacingMs (const EffectParams& p, double bpm) noexcept;
+double rhythmLengthMs (const EffectParams& p, double bpm) noexcept;
+// the heard taps of one pass (slot 0 = the input is not heard; it comes back through the feedback after the length)
+// and the level of slot 0 in `slot0`; levels are equal-power normalised over the slots that fit in the length
+std::vector<RhythmTap> rhythmTaps (const EffectParams& p, double bpm, double* slot0 = nullptr);
+int rhythmPattern (const EffectParams& p, double bpm, std::array<RhythmTap, 16>& taps, double& slot0) noexcept; // no allocation
+int eraOf (float v) noexcept;           // 0 past, 1 present, 2 future (round 137)
+// the factor on the character's low-pass cut-off for the mode and era (1 for Past)
+double eraBandwidth (Mode m, int era) noexcept;
 int hybridOf (float v) noexcept;         // 0 off, 1 clean, 2 analog (round 124)
 float hybridValue (int h) noexcept;
 Mode modeOf (float v) noexcept;
@@ -147,8 +175,13 @@ enum Param
 {
     mix, depth, width, delay, feedback, spread, slope, skew, random, tapGain, diffusion, diffSize, diffModRate,
     diffModDepth, lowCut, highCut, xover, detuneRate, detuneDepth, vibratoRate, vibratoDepth, overMod, driveIn,
-    driveOut, noise, rotate, smoothing, colour, sync, taps, diffOn, driveOn, drivePost, halfSpeed, paramCount
+    driveOut, noise, rotate, smoothing, colour, sync, taps, diffOn, driveOn, drivePost, halfSpeed,
+    inputPan, // round 137 (appended): what enters the taps, 9 steps (index round (8 v)), measured on the reference
+              // [EXEC]: 0 / 1 stereo (default 1), 2 swapped, 3 mono to both, 4 mono to the left, 5 mono to the right,
+              // 6–8 stereo (no difference measured with an impulse)
+    paramCount
 };
+int inputPanOf (float v) noexcept;  // 0 … 8
 int tapCount (float v) noexcept;     // 1, 1, 2, 3, 3, 3, 4, 8, 8, 16 (index floor(24 v))
 double delayMs (float v) noexcept;   // 0 .. 1000 ms
 double tapMs (const EffectParams& p, int tap, int taps, bool right) noexcept; // tap position (without modulation)

+ 4 - 0
src/core/ParamHelp.cpp

@@ -224,6 +224,10 @@ const std::map<std::pair<K, std::string>, const char*>& own()
         { { K::echoform, "style" }, TR_NOOP ("Echo layout: single, ratio, four taps, dual or ping-pong") },
         { { K::echoform, "ratio" }, TR_NOOP ("Time of the second echo as a share of the first") },
         { { K::echoform, "output" }, TR_NOOP ("Level of the echoes") },
+        { { K::echoform, "rhythm" }, TR_NOOP ("Rhythm echo: a pattern of evenly spaced taps that the feedback repeats every Length") },
+        { { K::echoform, "repeats" }, TR_NOOP ("Slots in the rhythm pattern (the first one is the input itself)") },
+        { { K::echoform, "decay" }, TR_NOOP ("How much quieter the last tap of the pattern is than the first") },
+        { { K::echoform, "length" }, TR_NOOP ("Length of the rhythm pattern in beats; the feedback replays it") },
         // Ridge Strip
         { { K::ridgeStrip, "input" }, TR_NOOP ("Level into the channel strip") },
         { { K::ridgeStrip, "hpf" }, TR_NOOP ("High-pass filter: removes rumble below this frequency") },

+ 33 - 2
src/core/PluginLayout.cpp

@@ -2199,6 +2199,9 @@ Layout voiceShiftLayout()
     v.push_back (value (192, 176, 72, 24, "Formant", boxed));
     v.push_back (section (310, 4, 130, 222, TR_NOOP ("Mode")));
     v.push_back (radio (322, 50, 110, 120, "Mode", TR_NOOP ("Transpose|Quantize|Robot")));
+    // round 137: MIDI control (the notes held on a Channel Rack channel set the pitch / the robot's note)
+    v.push_back (label (322, 172, 110, 16, TR_NOOP ("MIDI")));
+    v.push_back (stepper (318, 190, 118, 22, "MIDI", TR_NOOP ("MIDI channel"), 129));
     v.push_back (section (446, 4, 190, 222, nullptr, boxed));
     v.push_back (dial (494, 100, 60, "Drive", TR_NOOP ("Drive"), big));
     v.push_back (dial (588, 100, 60, "Mix", TR_NOOP ("Mix"), big));
@@ -2489,7 +2492,7 @@ Layout echoformLayout()
 {
     Layout l;
     l.width = 950;  // round 135w: + the TWEAK section and the output meter (was 780)
-    l.height = 330; // round 135w: + a second row of switches (was 300)
+    l.height = 352; // round 135w: + a second row of switches (was 300); round 137: + the Rhythm row (was 330)
     auto& v = l.items;
     const auto top = 4.0f, h = 232.0f, k1 = 66.0f, k2 = 160.0f, d = 34.0f;
     // mix + style
@@ -2511,7 +2514,9 @@ Layout echoformLayout()
     const std::vector<float> syncValues { 0.25f, 0.5f, 0.75f, 1.0f };
     v.push_back (menuOf (100, 150, 76, 20, "Sync L", TR_NOOP ("Sync"), TR_NOOP ("ms|Note|Dotted|Triplet"), syncValues));
     v.push_back (when (menuOf (190, 150, 76, 20, "Sync R", TR_NOOP ("Sync"), TR_NOOP ("ms|Note|Dotted|Triplet"), syncValues), "Style", 0.6f, 1.0f));
-    v.push_back (display (96, 180, 172, 50, "echotrain"));
+    v.push_back (when (display (96, 180, 172, 50, "echotrain"), "Rhythm", 0.0f, 0.49f));
+    // round 137: in Rhythm mode the picture is the pattern itself: one bar per heard tap, drag to set its level
+    v.push_back (when (display (96, 180, 172, 50, "rhythmbars"), "Rhythm", 0.5f, 1.0f));
     // feedback + width
     v.push_back (section (280, top, 80, h, TR_NOOP ("Feedback")));
     v.push_back (dial (320, k1, d, "Feedback", TR_NOOP ("Feedback")));
@@ -2585,6 +2590,20 @@ Layout echoformLayout()
     v.push_back (when (stepper (346, 290, 96, 20, "BPM", TR_NOOP ("BPM"), 270), "Tempo source", 0.5f, 1.0f));
     v.push_back (toggle (452, 290, 110, 20, "Filter link", TR_NOOP ("Link EQ")));
     v.push_back (toggle (570, 290, 100, 20, "Freeze", TR_NOOP ("Freeze")));
+    // ---- round 137: EchoBoy's Rhythm echo mode (a pattern of evenly spaced taps the feedback replays every Length)
+    v.push_back (toggle (8, 320, 74, 20, "Rhythm", TR_NOOP ("Rhythm")));
+    v.push_back (when (menuOf (88, 320, 76, 20, "Rhythm sync", TR_NOOP ("Spacing"), TR_NOOP ("ms|Note|Dotted|Triplet"), syncValues), "Rhythm", 0.5f, 1.0f));
+    v.push_back (when (when (stepper (170, 320, 90, 20, "Rhythm note", TR_NOOP ("Note"), 9), "Rhythm sync", 0.5f, 1.0f), "Rhythm", 0.5f, 1.0f));
+    v.push_back (when (when (slider (Item::hslider, 170, 322, 90, 16, "Rhythm time", nullptr, noCaption), "Rhythm sync", 0.0f, 0.49f), "Rhythm", 0.5f, 1.0f));
+    v.push_back (when (label (268, 320, 54, 20, TR_NOOP ("Repeats")), "Rhythm", 0.5f, 1.0f));
+    v.push_back (when (stepper (324, 320, 70, 20, "Repeats", TR_NOOP ("Repeats"), 15), "Rhythm", 0.5f, 1.0f));
+    v.push_back (when (label (402, 320, 44, 20, TR_NOOP ("Decay")), "Rhythm", 0.5f, 1.0f));
+    v.push_back (when (slider (Item::hslider, 448, 322, 100, 16, "Decay", nullptr, noCaption), "Rhythm", 0.5f, 1.0f));
+    v.push_back (when (value (552, 320, 56, 20, "Decay"), "Rhythm", 0.5f, 1.0f));
+    v.push_back (when (label (614, 320, 50, 20, TR_NOOP ("Length")), "Rhythm", 0.5f, 1.0f));
+    v.push_back (when (stepper (666, 320, 96, 20, "Length", TR_NOOP ("Length"), 7), "Rhythm", 0.5f, 1.0f));
+    // round 137: ValhallaDelay's Era (the loop's bandwidth per mode), bottom right
+    v.push_back (tabs (770, 320, 176, 20, "Era", TR_NOOP ("Past|Present|Future"), { 0.0f, 0.5f, 1.0f }));
     return l;
 }
 
@@ -2702,6 +2721,18 @@ Layout latticeLayout()
     }
     row (5, { { "Rotate", TR_NOOP ("Feedback mix") }, { "Smoothing", TR_NOOP ("Smoothing") } },
          { tabs (322, 104, 56, 40, "Half speed", TR_NOOP ("1x|1/2x")) });
+    {
+        // round 137: the WARP page's input pan (what enters the taps), measured on the reference
+        auto caption = label (552, 82, 104, 16, TR_NOOP ("Input pan"));
+        caption.page = 5;
+        v.push_back (caption);
+        std::vector<float> panValues;
+        for (int k = 1; k <= 5; ++k)
+            panValues.push_back ((float) k / 8.0f);
+        auto pan = menuOf (552, 102, 104, 22, "Input pan", TR_NOOP ("Input pan"), TR_NOOP ("Stereo|Swapped|Mono|Mono left|Mono right"), panValues);
+        pan.page = 5;
+        v.push_back (pan);
+    }
     v.push_back (display (312, 230, 354, 62, "lattice"));
     return l;
 }

+ 11 - 1
src/core/PluginSubstitutes.cpp

@@ -268,6 +268,12 @@ map = xml:DelayR_Ms -> Time R
 map = xml:DelaySpread -> Spread
 map = xml:DelaySpacing -> Spacing
 map = xml:DelayRatio -> Ratio
+# round 137: the quad taps and Repeat / Swell (Echoform has them since round 135w; the same on / off values)
+map = xml:TapA -> Tap A
+map = xml:TapB -> Tap B
+map = xml:TapC -> Tap C
+map = xml:TapD -> Tap D
+map = xml:RepeatSwell -> Swell
 map = xml:Feedback -> Feedback
 map = xml:Width -> Width
 map = xml:DriveIn -> Drive
@@ -285,6 +291,8 @@ map = xml:FreqDetune -> Shift detune
 map = xml:PitchShift -> Pitch
 map = xml:PitchDetune -> Pitch detune
 map = xml:Ducking -> Ducking
+# round 137: Era (Past below 2/3, Present, Future at the top; measured on the demo's own value texts)
+map = xml:Era -> Era | steps 0:0 0.6662:0.5 0.9995:1
 # the 17 modes (index floor (24 v)) onto Echoform's 12 characters: Tape, HiFi, BBD, Digital, Ghost (shifter), Pitch,
 # RevPitch (reverse), BBDuck (bucket), Clarity (clean), DuckTape (tape), PitchDuck (pitch), LoFi, Quartz (clean),
 # PhaserDDL (phaser), RichPitch (detune), ChromeTape (tape), Analog; the "duck" variants' built-in ducking is not kept
@@ -360,7 +368,9 @@ map = xml:DiffEnable -> Diffusion on
 map = xml:Drive -> Drive on
 map = xml:DrivePrePost -> Drive post
 map = xml:Speed -> Half speed
-# not translated (meaning not confirmed): DelaySync (0-17: which note each step is), InputPan (0-8)
+# round 137: InputPan (0-8, the same value law; its routes measured black-box, REA_rodada137 §4)
+map = xml:InputPan -> Input pan
+# not translated (meaning not confirmed): DelaySync (0-17: which note each step is)
 
 [fabfilter-timeless]
 product = FabFilter Timeless

+ 39 - 6
src/core/VoiceShift.cpp

@@ -18,6 +18,13 @@ float semitoneValue (double st) noexcept { return (float) std::clamp ((st + 12.0
 Mode modeOf (float v) noexcept { return (Mode) std::clamp ((int) std::lround (std::clamp (v, 0.0f, 1.0f) * 2.0f), 0, 2); }
 double driveAmount (float v) noexcept { return 10.0 * (double) std::clamp (v, 0.0f, 1.0f); }
 
+int midiChannelIndex (float v) noexcept
+{
+    const auto k = (int) std::lround (std::clamp (v, 0.0f, 1.0f) * 128.0f);
+    return k <= 0 ? -1 : k - 1;
+}
+float midiChannelValue (int channel) noexcept { return channel < 0 ? 0.0f : (float) std::clamp (channel + 1, 0, 128) / 128.0f; }
+
 int latencyFor (double sampleRate) noexcept { return (int) std::ceil (2.0 * sampleRate / minHz) + 4; }
 
 // [EXEC trial, 1 kHz at −18 dBFS] the drive raises the level by ≈ 1.75 dB per step up to ~5, then saturates
@@ -38,7 +45,8 @@ float driveCurve (float x, double amount) noexcept
 const EffectInfo& info()
 {
     static const EffectInfo i { "Voice Shift",
-                                { { "Pitch", 0.5f }, { "Formant", 0.5f }, { "Link", 0.0f }, { "Mode", 0.0f }, { "Drive", 0.0f }, { "Mix", 1.0f } } };
+                                { { "Pitch", 0.5f }, { "Formant", 0.5f }, { "Link", 0.0f }, { "Mode", 0.0f }, { "Drive", 0.0f }, { "Mix", 1.0f },
+                                  { "MIDI", 0.0f } } };
     return i;
 }
 
@@ -57,6 +65,14 @@ std::string paramText (int param, float v)
         }
         case drive: std::snprintf (t, sizeof t, "%.1f", driveAmount (v)); return t;
         case mix: std::snprintf (t, sizeof t, "%.0f%%", 100.0 * std::clamp (v, 0.0f, 1.0f)); return t;
+        case midi:
+        {
+            const auto c = midiChannelIndex (v);
+            if (c < 0)
+                return "Off";
+            std::snprintf (t, sizeof t, "Channel %d", c + 1);
+            return t;
+        }
         default: std::snprintf (t, sizeof t, "%.2f", (double) v); return t;
     }
 }
@@ -94,9 +110,24 @@ public:
         dcX[0] = dcX[1] = dcY[0] = dcY[1] = 0.0f;
     }
 
+    void setHeldNotes (const NoteMask* channels, int count) noexcept override
+    {
+        held = channels;
+        heldCount = count;
+    }
+
     void process (float* l, float* r, int n, const EffectParams& p, double) noexcept override
     {
-        const auto pitchSt = pitchSemitones (p[pitch]);
+        // round 137: the highest note held on the MIDI channel replaces the Pitch knob (relative to C4) / the robot note
+        int midiNote = -1;
+        if (const auto ch = midiChannelIndex (p[midi]); ch >= 0 && held != nullptr && ch < heldCount)
+            for (int k = 127; k >= 0 && midiNote < 0; --k)
+                if ((held[ch][(std::size_t) (k >> 6)] >> (k & 63)) & 1u)
+                    midiNote = k;
+        meterMidi.store (midiNote < 0 ? 0.0f : (float) midiNote, std::memory_order_relaxed);
+        const auto robotAt = midiNote >= 0 ? (double) midiNote : robotNote;
+        const auto pitchSt = midiNote >= 0 ? (modeOf (p[mode]) == Mode::robot ? 0.0 : std::clamp ((double) midiNote - robotNote, -24.0, 24.0))
+                                           : pitchSemitones (p[pitch]);
         const auto formantSt = formantSemitones (p[formant]);
         const auto linked = p[link] >= 0.5f;
         const auto md = modeOf (p[mode]);
@@ -128,8 +159,8 @@ public:
                     }
                     else if (md == Mode::robot)
                     {
-                        target = (int) robotNote;
-                        wanted = robotNote - sung;
+                        target = (int) robotAt;
+                        wanted = robotAt - sung;
                     }
                     else
                     {
@@ -181,7 +212,7 @@ public:
 
     float controlOutput (int o) const noexcept override
     {
-        const auto v = (o == 0 ? meterSung : meterOut).load (std::memory_order_relaxed);
+        const auto v = (o == 0 ? meterSung : o == 2 ? meterMidi : meterOut).load (std::memory_order_relaxed);
         return std::clamp (v, 0.0f, 127.0f) / 127.0f;
     }
 
@@ -198,7 +229,9 @@ private:
     double sung = -1.0, wanted = 0.0, shift = 0.0, unvoicedFor = 1e9;
     int target = -1;
     float dcA = 0.999f, dcX[2] {}, dcY[2] {};
-    std::atomic<float> meterSung { -1.0f }, meterOut { -1.0f };
+    std::atomic<float> meterSung { -1.0f }, meterOut { -1.0f }, meterMidi { 0.0f };
+    const NoteMask* held = nullptr;
+    int heldCount = 0;
 };
 } // namespace
 

+ 11 - 2
src/core/VoiceShift.h

@@ -12,7 +12,8 @@
 //   Drive     0 … 10: a tube stage on the shifted voice           Mix      dry / wet (linear, measured)
 //
 // Latency: two periods of the lowest detected pitch (70 Hz), reported to PDC; the dry signal is delayed to match.
-// Meters (controlOutput): 0 = sung note / 127 (0 = unvoiced), 1 = the note sent out / 127.
+// Meters (controlOutput): 0 = sung note / 127 (0 = unvoiced), 1 = the note sent out / 127, 2 = the held MIDI note / 127
+// (0 = none; round 137).
 
 #include <memory>
 #include <string>
@@ -24,7 +25,13 @@ class Effect;
 
 namespace voiceshift
 {
-enum Param : int { pitch, formant, link, mode, drive, mix, count };
+enum Param : int
+{
+    pitch, formant, link, mode, drive, mix,
+    midi, // round 137 (appended, Off by default): the Channel Rack channel whose held notes set the pitch (the
+          // original's MIDI control): Transpose / Quantize shift by (highest held note − C4), Robot sings that note
+    count
+};
 enum class Mode { transpose, quantize, robot };
 
 double pitchSemitones (float v) noexcept;   // −12 … +12
@@ -37,6 +44,8 @@ constexpr double minHz = 70.0, maxHz = 1000.0;
 int latencyFor (double sampleRate) noexcept;
 // the drive stage's static curve (no state): input → output at a drive amount 0 … 10
 float driveCurve (float x, double amount) noexcept;
+int midiChannelIndex (float v) noexcept;    // −1 = off, else 0 … 127 (LYNX Tune's law)
+float midiChannelValue (int channel) noexcept;
 
 const EffectInfo& info();
 std::string paramText (int param, float v);

+ 39 - 1
src/ui/I18nData.h

@@ -10176,6 +10176,44 @@ inline constexpr unsigned char ptBR[] = {
 109, 112, 114, 101, 32, 40, 111, 32, 100, 101, 99, 97, 105, 109, 101, 110, 116, 111, 32, 110, 111, 32, 109, 195,
 161, 120, 105, 109, 111, 41, 58, 32, 116, 111, 113, 117, 101, 32, 112, 111, 114, 32, 99, 105, 109, 97, 32, 112,
 97, 114, 97, 32, 115, 111, 98, 114, 101, 112, 111, 114, 44, 32, 100, 101, 115, 108, 105, 103, 117, 101, 32, 112,
-97, 114, 97, 32, 100, 101, 105, 120, 97, 114, 32, 115, 117, 109, 105, 114, 34, 10,
+97, 114, 97, 32, 100, 101, 105, 120, 97, 114, 32, 115, 117, 109, 105, 114, 34, 10, 10, 35, 32, 45, 45, 45,
+32, 82, 111, 117, 110, 100, 32, 49, 51, 55, 58, 32, 69, 99, 104, 111, 102, 111, 114, 109, 32, 82, 104, 121,
+116, 104, 109, 32, 109, 111, 100, 101, 32, 97, 110, 100, 32, 69, 114, 97, 10, 34, 82, 104, 121, 116, 104, 109,
+32, 101, 99, 104, 111, 58, 32, 97, 32, 112, 97, 116, 116, 101, 114, 110, 32, 111, 102, 32, 101, 118, 101, 110,
+108, 121, 32, 115, 112, 97, 99, 101, 100, 32, 116, 97, 112, 115, 32, 116, 104, 97, 116, 32, 116, 104, 101, 32,
+102, 101, 101, 100, 98, 97, 99, 107, 32, 114, 101, 112, 101, 97, 116, 115, 32, 101, 118, 101, 114, 121, 32, 76,
+101, 110, 103, 116, 104, 34, 32, 61, 32, 34, 69, 99, 111, 32, 114, 195, 173, 116, 109, 105, 99, 111, 58, 32,
+117, 109, 32, 112, 97, 100, 114, 195, 163, 111, 32, 100, 101, 32, 116, 97, 112, 115, 32, 105, 103, 117, 97, 108,
+109, 101, 110, 116, 101, 32, 101, 115, 112, 97, 195, 167, 97, 100, 111, 115, 32, 113, 117, 101, 32, 111, 32, 102,
+101, 101, 100, 98, 97, 99, 107, 32, 114, 101, 112, 101, 116, 101, 32, 97, 32, 99, 97, 100, 97, 32, 68, 117,
+114, 97, 195, 167, 195, 163, 111, 34, 10, 34, 83, 108, 111, 116, 115, 32, 105, 110, 32, 116, 104, 101, 32, 114,
+104, 121, 116, 104, 109, 32, 112, 97, 116, 116, 101, 114, 110, 32, 40, 116, 104, 101, 32, 102, 105, 114, 115, 116,
+32, 111, 110, 101, 32, 105, 115, 32, 116, 104, 101, 32, 105, 110, 112, 117, 116, 32, 105, 116, 115, 101, 108, 102,
+41, 34, 32, 61, 32, 34, 80, 111, 115, 105, 195, 167, 195, 181, 101, 115, 32, 110, 111, 32, 112, 97, 100, 114,
+195, 163, 111, 32, 114, 195, 173, 116, 109, 105, 99, 111, 32, 40, 97, 32, 112, 114, 105, 109, 101, 105, 114, 97,
+32, 195, 169, 32, 97, 32, 112, 114, 195, 179, 112, 114, 105, 97, 32, 101, 110, 116, 114, 97, 100, 97, 41, 34,
+10, 34, 72, 111, 119, 32, 109, 117, 99, 104, 32, 113, 117, 105, 101, 116, 101, 114, 32, 116, 104, 101, 32, 108,
+97, 115, 116, 32, 116, 97, 112, 32, 111, 102, 32, 116, 104, 101, 32, 112, 97, 116, 116, 101, 114, 110, 32, 105,
+115, 32, 116, 104, 97, 110, 32, 116, 104, 101, 32, 102, 105, 114, 115, 116, 34, 32, 61, 32, 34, 81, 117, 97,
+110, 116, 111, 32, 111, 32, 195, 186, 108, 116, 105, 109, 111, 32, 116, 97, 112, 32, 100, 111, 32, 112, 97, 100,
+114, 195, 163, 111, 32, 195, 169, 32, 109, 97, 105, 115, 32, 98, 97, 105, 120, 111, 32, 113, 117, 101, 32, 111,
+32, 112, 114, 105, 109, 101, 105, 114, 111, 34, 10, 34, 76, 101, 110, 103, 116, 104, 32, 111, 102, 32, 116, 104,
+101, 32, 114, 104, 121, 116, 104, 109, 32, 112, 97, 116, 116, 101, 114, 110, 32, 105, 110, 32, 98, 101, 97, 116,
+115, 59, 32, 116, 104, 101, 32, 102, 101, 101, 100, 98, 97, 99, 107, 32, 114, 101, 112, 108, 97, 121, 115, 32,
+105, 116, 34, 32, 61, 32, 34, 68, 117, 114, 97, 195, 167, 195, 163, 111, 32, 100, 111, 32, 112, 97, 100, 114,
+195, 163, 111, 32, 114, 195, 173, 116, 109, 105, 99, 111, 32, 101, 109, 32, 116, 101, 109, 112, 111, 115, 59, 32,
+111, 32, 102, 101, 101, 100, 98, 97, 99, 107, 32, 111, 32, 114, 101, 112, 101, 116, 101, 34, 10, 34, 82, 101,
+112, 101, 97, 116, 115, 34, 32, 61, 32, 34, 82, 101, 112, 101, 116, 105, 195, 167, 195, 181, 101, 115, 34, 10,
+34, 80, 97, 115, 116, 124, 80, 114, 101, 115, 101, 110, 116, 124, 70, 117, 116, 117, 114, 101, 34, 32, 61, 32,
+34, 80, 97, 115, 115, 97, 100, 111, 124, 80, 114, 101, 115, 101, 110, 116, 101, 124, 70, 117, 116, 117, 114, 111,
+34, 10, 34, 73, 110, 112, 117, 116, 32, 112, 97, 110, 34, 32, 61, 32, 34, 80, 97, 110, 32, 100, 101, 32,
+101, 110, 116, 114, 97, 100, 97, 34, 10, 34, 83, 116, 101, 114, 101, 111, 124, 83, 119, 97, 112, 112, 101, 100,
+124, 77, 111, 110, 111, 124, 77, 111, 110, 111, 32, 108, 101, 102, 116, 124, 77, 111, 110, 111, 32, 114, 105, 103,
+104, 116, 34, 32, 61, 32, 34, 69, 115, 116, 195, 169, 114, 101, 111, 124, 73, 110, 118, 101, 114, 116, 105, 100,
+111, 124, 77, 111, 110, 111, 124, 77, 111, 110, 111, 32, 101, 115, 113, 117, 101, 114, 100, 97, 124, 77, 111, 110,
+111, 32, 100, 105, 114, 101, 105, 116, 97, 34, 10, 34, 84, 114, 105, 103, 103, 101, 114, 34, 32, 61, 32, 34,
+71, 97, 116, 105, 108, 104, 111, 34, 10, 34, 79, 102, 102, 124, 72, 111, 115, 116, 32, 115, 121, 110, 99, 124,
+77, 73, 68, 73, 34, 32, 61, 32, 34, 68, 101, 115, 108, 46, 124, 83, 105, 110, 99, 46, 32, 100, 111, 32,
+104, 111, 115, 116, 124, 77, 73, 68, 73, 34, 10,
 };
 } // namespace lynx::i18n::data

+ 17 - 1
src/ui/PluginEditors.cpp

@@ -2060,7 +2060,23 @@ public:
                     tR = tL * (0.01 + 0.99 * (double) params[ratio]);
                 const auto gain = juce::jlimit (0.0, 1.0, feedbackGain (params[feedback]));
                 window = juce::jmax (50.0, 4.5 * juce::jmax (tL, tR));
-                if (st == Style::pingPong)
+                if (params[rhythm] >= 0.5f) // round 137: the Rhythm pattern, three passes of it (left and right alike)
+                {
+                    double slot0 = 0.0;
+                    const auto taps = rhythmTaps (params, bpm, &slot0);
+                    const auto length = rhythmLengthMs (params, bpm);
+                    window = 3.0 * length * 1.02;
+                    auto level = 1.0;
+                    for (int pass = 0; pass < 3; ++pass, level *= gain)
+                        for (int c = 0; c < 2; ++c)
+                        {
+                            if (pass > 0)
+                                ticks.push_back ({ length * pass, slot0 * level, c == 1 });
+                            for (const auto& t : taps)
+                                ticks.push_back ({ length * pass + t.ms, t.level * level, c == 1 });
+                        }
+                }
+                else if (st == Style::pingPong)
                 {
                     auto t = tL, level = 1.0;
                     for (int k = 0; k < 24 && t <= window; ++k)

+ 25 - 2
src/ui/PluginEditorsFx.inc

@@ -8,6 +8,7 @@
         std::vector<int> params;           // the editor parameter of each bar (state controls)
         std::vector<juce::String> labels;  // under each bar
         bool bipolar = false;              // pan: drawn from the centre
+        bool plain = false;                // round 137: plain effect parameters (not state controls)
     };
 
     Bars barsFor (const juce::String& id) const
@@ -30,6 +31,18 @@
             }
             b.bipolar = target == 1;
         }
+        else if (id == "rhythmbars") // round 137: Echoform's rhythm taps (plain parameters), one bar per heard tap
+        {
+            namespace ef = echosuite::echoform;
+            const auto bpm = engine.getSong().bpm > 1.0 ? engine.getSong().bpm : 120.0;
+            const auto taps = ef::rhythmTaps (fx->params, bpm);
+            for (int k = 0; k < (int) taps.size(); ++k)
+            {
+                b.params.push_back (ef::rhythmTap1 + k);
+                b.labels.push_back (juce::String (k + 1));
+            }
+            b.plain = true;
+        }
         else if (id == "mbdbars")
         {
             const auto& table = stateTable();
@@ -51,7 +64,8 @@
     static bool isBars (const LayoutItem& item)
     {
         return item.type == Item::display && item.display != nullptr
-               && (std::strcmp (item.display, "equobars") == 0 || std::strcmp (item.display, "mbdbars") == 0);
+               && (std::strcmp (item.display, "equobars") == 0 || std::strcmp (item.display, "mbdbars") == 0
+                   || std::strcmp (item.display, "rhythmbars") == 0);
     }
 
     juce::Rectangle<float> barsArea (const LayoutItem& item) const
@@ -108,6 +122,15 @@
         const auto to = barAt (e.position.x);
         const auto from = start ? to : barAt (barsLastX);
         barsLastX = e.position.x;
+        if (b.plain)
+        {
+            std::vector<std::pair<int, float>> changes;
+            for (int i = juce::jmin (from, to); i <= juce::jmax (from, to); ++i)
+                changes.push_back ({ b.params[(std::size_t) i], v });
+            setParams (changes);
+            ui::showValueTip (*this, rectOf (item).toNearestInt(), valueText (b.params[(std::size_t) to], v));
+            return;
+        }
         auto bytes = fx->state;
         const auto& table = stateTable();
         for (int i = juce::jmin (from, to); i <= juce::jmax (from, to); ++i)
@@ -132,7 +155,7 @@
         const auto s = scale();
         const auto curveColour = fx.enabled ? colour::accent : colour::textDisabled;
 
-        if (id == "equobars" || id == "mbdbars")
+        if (id == "equobars" || id == "mbdbars" || id == "rhythmbars")
         {
             paintBars (g, item, fx);
             return true;

+ 13 - 1
src/ui/ProEditors.cpp

@@ -1014,6 +1014,18 @@ private:
             // round 135: the wet (compressed) and dry paths' stereo balance, at the panel's right end
             out.push_back (knob ({ s.getRight() - 136.0f, s.getY() + 14.0f, 62.0f, 82.0f }, wetPan, tr ("Wet pan"), 0, true));
             out.push_back (knob ({ s.getRight() - 70.0f, s.getY() + 14.0f, 62.0f, 82.0f }, dryPan, tr ("Dry pan"), 0, true));
+            // round 137: the trigger (the reference's side-chain Host Sync / MIDI inputs): the detector hears a pulse
+            const auto tx = s.getRight() - 268.0f;
+            out.push_back (menu ({ tx, s.getY() + 16.0f, 120.0f, 22.0f }, trigger, tr ("Trigger"), "Off|Host sync|MIDI"));
+            const auto trig = triggerOf (v (trigger));
+            if (trig == Trigger::hostSync)
+            {
+                out.push_back (menu ({ tx, s.getY() + 46.0f, 120.0f, 22.0f }, triggerSync, tr ("Note"), "1/1|1/2|1/4|1/8|1/16"));
+                out.push_back (knob ({ tx, s.getY() + 74.0f, 58.0f, 78.0f }, triggerRate, tr ("Rate"), 0));
+                out.push_back (knob ({ tx + 62.0f, s.getY() + 74.0f, 58.0f, 78.0f }, triggerLength, tr ("Length"), 0));
+            }
+            else if (trig == Trigger::midi)
+                out.push_back (knob ({ tx + 20.0f, s.getY() + 50.0f, 80.0f, 92.0f }, triggerChannel, tr ("Channel"), 0));
         }
         const auto b = barArea();
         const auto cy = b.getCentreY();
@@ -1028,7 +1040,7 @@ private:
     juce::Rectangle<float> scEqArea() const
     {
         const auto s = scPanel();
-        return { 320.0f, s.getY() + 10.0f, s.getWidth() - 334.0f - 140.0f, s.getHeight() - 20.0f };
+        return { 320.0f, s.getY() + 10.0f, s.getWidth() - 334.0f - 140.0f - 132.0f, s.getHeight() - 20.0f }; // round 137: − the trigger column
     }
     float scX (double hz) const
     {

+ 270 - 0
tests/Parity137Tests.inc

@@ -0,0 +1,270 @@
+// --- Round 137: parity items (docs/PARITY.md, REA_rodada137) -----------------------------------------------------
+
+namespace p137
+{
+// the largest |x| within ±`radius` samples of `at`
+inline float peakNear (const std::vector<float>& x, int at, int radius = 96)
+{
+    float m = 0.0f;
+    for (int i = std::max (0, at - radius); i < std::min ((int) x.size(), at + radius); ++i)
+        m = std::max (m, std::abs (x[(std::size_t) i]));
+    return m;
+}
+
+inline lynx::EffectParams rhythmEcho (int repeats, int noteIdx, double decayDb, float feedback01)
+{
+    namespace e = lynx::echosuite::echoform;
+    auto p = p135w::cleanEcho (500.0, feedback01);
+    p[e::rhythm] = 1.0f;
+    p[e::rhythmSync] = 0.5f; // note
+    p[e::rhythmNote] = ((float) noteIdx + 0.5f) / 10.0f;
+    p[e::rhythmRepeats] = (float) (repeats - 1) / 15.0f;
+    p[e::rhythmDecay] = (float) (decayDb / 40.0);
+    p[e::rhythmLength] = 1.0f / 7.0f; // 2 beats
+    return p;
+}
+} // namespace p137
+
+TEST (echoform_rhythm_defaults_and_texts_round137)
+{
+    using namespace lynx;
+    namespace e = echosuite::echoform;
+    const auto& info = effectInfo (EffectKind::echoform);
+    CHECK ((int) info.params.size() == e::paramCount);
+    const auto p = makeEffectSlot (EffectKind::echoform).params;
+    CHECK (p[e::rhythm] == 0.0f);
+    CHECK (formatEffectParam (EffectKind::echoform, e::rhythmRepeats, p[e::rhythmRepeats], 120.0) == "8");
+    CHECK (formatEffectParam (EffectKind::echoform, e::rhythmLength, p[e::rhythmLength], 120.0) == "2 beats");
+    CHECK (formatEffectParam (EffectKind::echoform, e::rhythmNote, p[e::rhythmNote], 120.0) == "1/8");
+    CHECK (formatEffectParam (EffectKind::echoform, e::rhythmSync, p[e::rhythmSync], 120.0) == "note");
+    CHECK (formatEffectParam (EffectKind::echoform, e::rhythmDecay, 0.5f, 120.0) == "20.0 dB");
+}
+
+TEST (echoform_rhythm_pattern_law_round137)
+{
+    using namespace lynx;
+    namespace e = echosuite::echoform;
+    // EchoBoy measured: 4 repeats of 1/8 at 120 BPM = taps at 250 / 500 / 750 ms, each 1/√4 (−6 dB)
+    auto p = p137::rhythmEcho (4, 3, 0.0, 0.0f);
+    double slot0 = 0.0;
+    auto taps = e::rhythmTaps (p, 120.0, &slot0);
+    CHECK (taps.size() == 3);
+    CHECK (std::abs (taps[0].ms - 250.0) < 1e-6 && std::abs (taps[2].ms - 750.0) < 1e-6);
+    CHECK (std::abs (taps[1].level - 0.5) < 1e-9 && std::abs (slot0 - 0.5) < 1e-9);
+    // 16 repeats of 1/16 do not fit in 2 beats: 8 taps up to 1000 ms, 1/√9 each (measured −9.3 dB incl. the style's +0.2)
+    taps = e::rhythmTaps (p137::rhythmEcho (16, 2, 0.0, 0.0f), 120.0);
+    CHECK (taps.size() == 8 && std::abs (taps.back().ms - 1000.0) < 1e-6 && std::abs (taps[0].level - 1.0 / 3.0) < 1e-9);
+    // decay: 20 dB over 8 slots = 2.86 dB a slot, equal-power normalised (measured −5.8 … −22.9 dB with +0.2)
+    taps = e::rhythmTaps (p137::rhythmEcho (8, 2, 20.0, 0.0f), 120.0, &slot0);
+    CHECK (taps.size() == 7);
+    CHECK (std::abs (20.0 * std::log10 (taps[0].level) - -6.0) < 0.15);
+    CHECK (std::abs (20.0 * std::log10 (taps[6].level) - -23.1) < 0.15);
+    // the rhythm editor's bars: each heard tap's level, after the normalisation (the others stay as they are)
+    p[e::rhythmTap1 + 1] = 0.5f;
+    taps = e::rhythmTaps (p, 120.0);
+    CHECK (std::abs (taps[1].level - 0.25) < 1e-9 && std::abs (taps[0].level - 0.5) < 1e-9);
+    p[e::rhythmTap1 + 1] = 1.0f;
+    // the length follows the tempo: 2 beats at 60 BPM = 2 s
+    CHECK (std::abs (e::rhythmLengthMs (p, 60.0) - 2000.0) < 1e-6);
+}
+
+TEST (echoform_rhythm_impulse_round137)
+{
+    using namespace lynx;
+    std::vector<float> l, r;
+    // no feedback: three taps at −6 dB of the impulse (0.5), nothing after the pattern
+    p135w::echoImpulse (p137::rhythmEcho (4, 3, 0.0, 0.0f), l, r, 2);
+    for (const int at : { 12000, 24000, 36000 })
+        CHECK (std::abs (p137::peakNear (l, at) - 0.25f) < 0.03f && std::abs (p137::peakNear (r, at) - 0.25f) < 0.03f);
+    CHECK (p137::peakNear (l, 48000, 2000) < 0.01f);
+    // feedback 50 %: the pattern comes back after 2 beats (slot 0 included), 6 dB down
+    p135w::echoImpulse (p137::rhythmEcho (4, 3, 0.0, 0.25f), l, r, 3);
+    for (const int at : { 48000, 60000, 72000, 84000 })
+        CHECK (std::abs (p137::peakNear (l, at) - 0.125f) < 0.02f);
+    CHECK (std::abs (p137::peakNear (l, 96000) - 0.0625f) < 0.015f);
+    // off: the plain echo as before (500 ms single)
+    auto p = p137::rhythmEcho (4, 3, 0.0, 0.0f);
+    p[echosuite::echoform::rhythm] = 0.0f;
+    p135w::echoImpulse (p, l, r, 2);
+    CHECK (p137::peakNear (l, 12000) < 0.01f && p137::peakNear (l, 24000) > 0.2f);
+}
+
+TEST (echoform_era_round137)
+{
+    using namespace lynx;
+    namespace e = echosuite::echoform;
+    const auto p0 = makeEffectSlot (EffectKind::echoform).params;
+    CHECK (p0[e::era] == 0.0f && formatEffectParam (EffectKind::echoform, e::era, 0.0f, 120.0) == "past");
+    CHECK (formatEffectParam (EffectKind::echoform, e::era, 0.5f, 120.0) == "present");
+    CHECK (formatEffectParam (EffectKind::echoform, e::era, 1.0f, 120.0) == "future");
+    CHECK (e::eraBandwidth (e::Mode::tape, 0) == 1.0 && e::eraBandwidth (e::Mode::clean, 2) == 1.0 && e::eraBandwidth (e::Mode::hifi, 2) == 1.0);
+    // Future opens the digital echo's top end (measured on the demo: 12 kHz −45 dB in Past, −6 dB in Future)
+    auto energyAbove = [] (const std::vector<float>& x, int from, int n) {
+        // the high-passed energy (first difference) of one repeat
+        double hi = 0.0;
+        for (int i = from + 1; i < from + n; ++i)
+            hi += (double) (x[(std::size_t) i] - x[(std::size_t) i - 1]) * (x[(std::size_t) i] - x[(std::size_t) i - 1]);
+        return hi;
+    };
+    auto p = p135w::cleanEcho (300.0, 0.0f);
+    p[e::mode] = e::modeValue (e::Mode::digital);
+    std::vector<float> l, r;
+    p135w::echoImpulse (p, l, r, 1);
+    const auto past = energyAbove (l, 14000, 2000);
+    p[e::era] = 1.0f;
+    p135w::echoImpulse (p, l, r, 1);
+    const auto future = energyAbove (l, 14000, 2000);
+    CHECK (future > past * 1.3);
+}
+
+TEST (voiceshift_midi_control_round137)
+{
+    using namespace lynx;
+    namespace vs = voiceshift;
+    auto p = makeEffectSlot (EffectKind::voiceShift).params;
+    CHECK (effectInfo (EffectKind::voiceShift).params.size() == (std::size_t) vs::count);
+    CHECK (p[vs::midi] == 0.0f && formatEffectParam (EffectKind::voiceShift, vs::midi, 0.0f, 120.0) == "Off");
+    CHECK (formatEffectParam (EffectKind::voiceShift, vs::midi, vs::midiChannelValue (2), 120.0) == "Channel 3");
+    // E4 (64) held on channel 3
+    std::array<NoteMask, 4> held {};
+    held[2][1] = 1ull; // note 64 → word 1, bit 0
+    auto runHeld = [&held] (const EffectParams& params, double f0) {
+        auto l = p135s::voice (f0, 1.0), r = l;
+        auto fx = makeEffect (EffectKind::voiceShift);
+        fx->prepare (p135s::sr);
+        fx->reset();
+        for (std::size_t off = 0; off < l.size(); off += 256)
+        {
+            fx->setHeldNotes (held.data(), (int) held.size());
+            const auto m = (int) std::min<std::size_t> (256, l.size() - off);
+            fx->process (l.data() + off, r.data() + off, m, params, 120.0);
+        }
+        return p135s::peakHz (l, 36000, 9600, 150.0, 400.0);
+    };
+    p[vs::midi] = vs::midiChannelValue (2);
+    p[vs::mode] = 1.0f; // Robot sings the held note: E4 = 329.6 Hz
+    CHECK (std::abs (runHeld (p, 200.0) - 329.63) < 5.0);
+    p[vs::mode] = 0.0f; // Transpose by 64 − 60 = +4 st: 200 → 252 Hz (the Pitch knob is replaced)
+    p[vs::pitch] = vs::semitoneValue (-7.0);
+    CHECK (std::abs (runHeld (p, 200.0) - 200.0 * std::exp2 (4.0 / 12.0)) < 4.0);
+    p[vs::midi] = 0.0f; // MIDI off: the Pitch knob again
+    CHECK (std::abs (runHeld (p, 300.0) - 300.0 * std::exp2 (-7.0 / 12.0)) < 4.0);
+}
+
+TEST (lattice_input_pan_round137)
+{
+    using namespace lynx;
+    namespace lt = echosuite::lattice;
+    auto p = makeEffectSlot (EffectKind::latticeMod).params;
+    CHECK (lt::inputPanOf (p[lt::inputPan]) == 1);
+    CHECK (formatEffectParam (EffectKind::latticeMod, lt::inputPan, 0.25f, 120.0) == "swapped");
+    p[lt::mix] = 1.0f;
+    p[lt::depth] = 0.0f;
+    auto energy = [&p] (float pan, bool rightOut) {
+        auto q = p;
+        q[lt::inputPan] = pan;
+        auto fx = makeEffect (EffectKind::latticeMod);
+        fx->prepare (48000.0);
+        std::vector<float> l (48000, 0.0f), r (48000, 0.0f);
+        l[100] = 0.5f; // a left-only impulse
+        for (int at = 0; at < 48000; at += 512)
+            fx->process (l.data() + at, r.data() + at, std::min (512, 48000 - at), q, 120.0);
+        double e = 0.0;
+        for (const auto v : rightOut ? r : l)
+            e += (double) v * v;
+        return e;
+    };
+    // [EXEC] the reference: stereo keeps the sides, 2 swaps them, 3 sends (L + R) / 2 to both (−6 dB), 4 / 5 to one side
+    CHECK (energy (0.125f, false) > 100.0 * energy (0.125f, true));
+    CHECK (energy (0.25f, true) > 100.0 * energy (0.25f, false));
+    CHECK (std::abs (10.0 * std::log10 (energy (0.375f, false) / energy (0.375f, true))) < 0.5);
+    CHECK (std::abs (10.0 * std::log10 (energy (0.375f, false) / energy (0.125f, false)) - -6.0) < 0.7);
+    CHECK (energy (0.625f, true) > 100.0 * energy (0.625f, false));
+}
+
+TEST (echoform_ducking_measured_round137)
+{
+    using namespace lynx;
+    namespace e = echosuite::echoform;
+    // [EXEC] ValhallaDelay demo, a 1 kHz tone into the echo (300 ms, 70 % feedback): the echoes during the tone are
+    // reduced by 41.5 dB (amplitude 0.5, ducking 100 %), 20.1 dB (0.25, 75 %), 7.1 dB (0.25, 50 %), none at 0.05 / 50 %
+    auto run = [] (float amp, float duck) {
+        auto p = p135w::cleanEcho (300.0, 0.35f);
+        p[e::ducking] = duck;
+        auto fx = makeEffect (EffectKind::echoform);
+        fx->prepare (48000.0);
+        std::vector<float> l (48000 * 2, 0.0f), r;
+        for (int i = 0; i < 48000; ++i)
+            l[(std::size_t) i] = amp * (float) std::sin (2.0 * 3.14159265358979 * 1000.0 * i / 48000.0);
+        r = l;
+        const auto in = l;
+        for (int at = 0; at < (int) l.size(); at += 512)
+            fx->process (l.data() + at, r.data() + at, std::min (512, (int) l.size() - at), p, 120.0);
+        double sum = 0.0;
+        for (int i = 28800; i < 45600; ++i)
+            sum += (double) l[(std::size_t) i] * l[(std::size_t) i];
+        return 10.0 * std::log10 (sum / 16800.0 + 1e-20);
+    };
+    CHECK (std::abs (run (0.5f, 1.0f) - run (0.5f, 0.0f) - -41.5) < 3.0);
+    CHECK (std::abs (run (0.25f, 0.75f) - run (0.25f, 0.0f) - -20.1) < 3.0);
+    CHECK (std::abs (run (0.25f, 0.5f) - run (0.25f, 0.0f) - -7.1) < 2.5);
+    CHECK (std::abs (run (0.05f, 0.5f) - run (0.05f, 0.0f)) < 1.5);
+}
+
+TEST (crest_trigger_host_sync_and_midi_round137)
+{
+    using namespace lynx;
+    namespace cr = dyn::crest;
+    auto p = makeEffectSlot (EffectKind::crestCompressor).params;
+    CHECK (cr::triggerOf (p[cr::trigger]) == cr::Trigger::off);
+    CHECK (formatEffectParam (EffectKind::crestCompressor, cr::triggerSync, p[cr::triggerSync], 120.0) == "1/4");
+    CHECK (formatEffectParam (EffectKind::crestCompressor, cr::triggerRate, 0.0f, 120.0) == "50%");
+    CHECK (formatEffectParam (EffectKind::crestCompressor, cr::triggerRate, 1.0f, 120.0) == "200%");
+    // the pulse: 1/4 at 100 % = every beat, 10 % of it; 1/4 at 50 % = every half beat
+    CHECK (cr::hostTrigger (p, 0.05) == 1.0f && cr::hostTrigger (p, 0.2) == 0.0f && cr::hostTrigger (p, 1.02) == 1.0f);
+    auto q = p;
+    q[cr::triggerRate] = 0.0f;
+    CHECK (cr::hostTrigger (q, 0.52) == 1.0f && cr::hostTrigger (q, 0.3) == 0.0f);
+    p[cr::autoGain] = 0.0f;
+    // a steady sine under the threshold: no reduction by itself; the trigger pulls it down at every beat
+    auto run = [] (EffectParams params, bool playing, const NoteMask* held, int heldCount, std::vector<float>& out) {
+        auto fx = makeEffect (EffectKind::crestCompressor);
+        fx->prepare (48000.0);
+        out.assign (48000, 0.0f);
+        for (int i = 0; i < 48000; ++i)
+            out[(std::size_t) i] = 0.05f * (float) std::sin (2.0 * 3.14159265358979 * 1000.0 * i / 48000.0);
+        auto r = out;
+        for (int at = 0; at < 48000; at += 480)
+        {
+            fx->setSongPosition ((double) at / 48000.0 * 2.0 * (double) ppq);
+            fx->setPlaying (playing);
+            fx->setHeldNotes (held, heldCount);
+            fx->process (out.data() + at, r.data() + at, 480, params, 120.0);
+        }
+    };
+    auto levelDb = [] (const std::vector<float>& x, int from, int to) {
+        double sum = 0.0;
+        for (int i = from; i < to; ++i)
+            sum += (double) x[(std::size_t) i] * x[(std::size_t) i];
+        return 10.0 * std::log10 (sum / (to - from) + 1e-20) - 20.0 * std::log10 (0.05 / std::sqrt (2.0));
+    };
+    std::vector<float> y;
+    run (p, true, nullptr, 0, y);
+    CHECK (std::abs (levelDb (y, 24000 + 960, 24000 + 2400)) < 0.5); // off: untouched
+    p[cr::trigger] = 0.5f; // host sync
+    run (p, true, nullptr, 0, y);
+    const auto during = levelDb (y, 24000 + 960, 24000 + 2400), between = levelDb (y, 24000 + 20000, 24000 + 23500);
+    CHECK (during < -8.0);
+    CHECK (between > during + 4.0);
+    run (p, false, nullptr, 0, y); // stopped: no pulses
+    CHECK (std::abs (levelDb (y, 24000 + 960, 24000 + 2400)) < 0.5);
+    // MIDI: reduction while a note is held on the chosen channel, none without notes
+    p[cr::trigger] = 1.0f;
+    p[cr::triggerChannel] = 2.0f / 128.0f; // channel 2 (index 1)
+    std::array<NoteMask, 3> held {};
+    run (p, true, held.data(), 3, y);
+    CHECK (std::abs (levelDb (y, 24000, 30000)) < 0.5);
+    held[1][0] = 1ull << 60;
+    run (p, true, held.data(), 3, y);
+    CHECK (levelDb (y, 24000, 30000) < -8.0);
+}

+ 1 - 0
tests/tests.cpp

@@ -15781,3 +15781,4 @@ TEST (plugin_layout_options_match_the_engine_values)
 #include "Parity135fTests.inc"
 #include "Feat132Tests.inc"
 #include "Parity135sTests.inc"
+#include "Parity137Tests.inc"