Przeglądaj źródła

Merge remote-tracking branch 'origin/main' into feature/vox148

Ka1-S 1 miesiąc temu
rodzic
commit
f16823bbfb

+ 41 - 20
docs/PARITY.md

@@ -30,6 +30,19 @@ LYNX's style; the transfer-curve and GR-history displays are bars). Her Vocalstr
 model (−60 … −67 dB null on her takes). The other Complete Access plugins (Slate, SSL, LiquidSonics, sonible,
 Harrison) map to LYNX effects by role only.
 
+## Round 147: what changed (config / design, after 144 → after 147)
+
+Round 147 (`docs/analise/REA_rodada147.md`, sub-rounds `REA_rodada147a.md` / `REA_rodada147b.md`).
+
+| LYNX engine | Original | Config 144 → 147 | Design 144 → 147 | Round-147 changes |
+|---|---|---|---|---|
+| Prism Multiband | Pro-MB | 9 → 10 | 8 → 9 | Dynamic phase measured and rebuilt (minimum-phase bands in cascade; older projects keep the classic engine), expert panel: side-chain filtering band / free, stereo link + mid / side-only, each crossover its own slope; translated |
+| Echoform | EchoBoy / PrimalTap | 9 → 10 | 8 → 8 | 31 echo voicings measured from EchoBoy's styles (LYNX names), saturation type menu, PrimalTap's Multiply 1x–8x |
+| Ember Saturator | Saturn 2 | 6 → 7 | 7 → 7 | channel mode L/R \| M/S, each band's drive pan and pan (measured), translated |
+| LYNX Tune | Waves Tune Real-Time | 8 → 9 | 6 → 7 | keyboard strip: Bypass / Remove modes, note status with direction, range bar and presets, octaves, scroll, latch |
+| Ridge Strip | SSL E-Channel | 7 → 8 | 7 → 7 | ANALOG (measured noise floor), auto make-up for Ridge's own compressor, translated |
+| Hush De-esser | DeEsser | 9 → 9 | 7 → 8 | the energy-detector bar beside the threshold arrow |
+
 ## Round 144: what changed (config / design, after 137 → after 144)
 
 Round 144 (`docs/analise/REA_rodada144.md`, sub-rounds `REA_rodada144a.md` / `REA_rodada144b.md`).
@@ -273,10 +286,10 @@ lookahead on, expert mode, display range, analyser options.
 | S / M buttons per band | ✅ | |
 | Floating band panel: power, THRESHOLD, RANGE, ATTACK, RELEASE, OUTPUT, mode, RATIO, KNEE | ✅ | |
 | LOOKAHEAD per band | ✅ | round 128: LOOKAHEAD in the band panel (0–20 ms, capped by the global look-ahead, which sets the latency); translated from Pro-MB |
-| EXPERT (»): side-chain filtering, external side chain, stereo link per band | ⚠️ | round 135: external side chain (bottom bar Int / Ext: the detectors hear the side chain split by the same crossovers); no side-chain filtering or per-band stereo link |
+| EXPERT (»): side-chain filtering, external side chain, stereo link per band | ✅ | round 135: external side chain (Int / Ext: the detectors hear the side chain split by the same crossovers); round 147: **Expert >>** in the band panel — side-chain filtering Band / Free with Low / High (30 Hz – 30 kHz; the free filter measured: 4th-order sides, −24 dB an octave out; one octave and wider within 1 dB, narrower bands boost less than the reference), **stereo link** 0–100 % and 100 % + mid- / side-only with its Mid / Side mode (measured laws, within 0.25 dB of the trial); translated from Pro-MB states (only when its Expert mode is on, as the reference does); the side-chain input stays one switch for all bands |
 | Band output pan (mid / side) | ✅ | round 135: PAN in the band panel (left / right balance of the band); round 144: L/R \| M/S switch in the band panel (mid / side = the reference's law, measured: the far side's gain 1 − \|pan\|), translated from Pro-MB states |
-| Crossover slope per band 6–48 dB/oct | ⚠️ | one global slope 12 / 24 / 48 (round 144: in the band panel, where the reference has it) |
-| Processing mode Linear / Dynamic / Minimum phase | ✅ | round 144: Phase menu in the bottom bar; linear = FIR crossovers with the same magnitudes, 3072 samples at 48 kHz (measured); minimum = all-pass compensated sum; dynamic = the old engine (its crossover shape when a band works still differs: REA_rodada144b); translated |
+| Crossover slope per band 6–48 dB/oct | ✅ | round 144: the global slope in the band panel; round 147: **each crossover its own slope** (Global / 12 / 24 / 48: a band's Low / High slope in its expert part), in every processing mode (the measured Dynamic phase with different orders on the two sides of a band: exact to 1e-8 dB); translated from Pro-MB's band slopes; no 6 dB/oct and no continuous values (LYNX's crossovers are Linkwitz-Riley 12 / 24 / 48) |
+| Processing mode Linear / Dynamic / Minimum phase | ✅ | round 144: Phase menu in the bottom bar; linear = FIR crossovers with the same magnitudes, 3072 samples at 48 kHz (measured); minimum = all-pass compensated sum; translated. Round 147: **Dynamic phase measured and rebuilt** — each working band is a minimum-phase filter with the linear-phase magnitude, the bands in cascade (Pro-MB's −4.1 dB / +53° at the crossover, −8.15 dB for two adjacent −12 dB bands: matched within 0.05 dB / 1°); projects saved before round 147 keep the classic engine ("Classic dynamic" in the bottom bar updates them) |
 | Oversampling | ✅ | round 144: Off / 2x / 4x in the bottom bar: the gains applied at the high rate; latency + the oversampler's; translated |
 | Display range 3 / 6 / 12 / 30 dB | ✅ | round 128: 3 dB added |
 | Analyser off / pre / post / pre+post | ✅ | |
@@ -286,6 +299,8 @@ lookahead on, expert mode, display range, analyser options.
 
 **After round 144** (REA_rodada144b): configuration 7 → **9**/10, design 7 → **8**/10 — processing modes, oversampling, mid / side band pan, analyser resolution / tilt, the reference's bottom-bar order. Left: per-band slopes, side-chain filtering, per-band stereo link, the dynamic mode's crossover shape, free band placement.
 
+**After round 147** (REA_rodada147 §1–2): configuration 9 → **10**/10, design 8 → **9**/10 — the measured Dynamic phase (the reference's sound when bands work), the expert panel (side-chain filtering, stereo link, the band's own slopes). Left: free band placement with gaps (a band switched off is the gap), a side-chain input per band, slopes only 12 / 24 / 48 (no 6 or in-between values), the free side-chain filter's extra boost on bands narrower than an octave.
+
 ## Sentry Gate ← Pro-G
 
 Parameters of the original: Threshold, Ratio, Range, Style (Classic, Clean, Vocal, Guitar, Upward; Ducking as an
@@ -351,18 +366,20 @@ sources, 50 modulation slots).
 | 28 styles in 6 families | ⚠️ | 4 families (tube, tape, transistor, fuzz) |
 | Per-band tone: Bass / Mid / Treble / Presence | ✅ | round 128: ±18 dB (Saturn ±24) on the band's saturated signal — LYNX's own curves (shelf 120 Hz, bell 800 Hz, shelf 3.5 kHz, bell 6 kHz); the global tilt / cuts stay as LYNX extras in the bottom bar |
 | Per-band power, solo, mute | ✅ | round 128 (panel buttons, tags on the display) |
-| Drive pan (L / R), band pan | ❌ | |
+| Drive pan (L / R), band pan | ✅ | round 147b: per band DRIVE PAN (beside the drive) and PAN (under the level) [EXEC trial: the far channel's drive × (1 − \|pan\|) on the 0–100 % scale; the band pan's far side 1 − \|pan\|]; translated from Saturn 2 states |
 | Feedback amount / frequency | ✅ | round 128: a band-passed loop around the shaper (10 Hz – 1 kHz, loop gain up to 0.9) |
 | Dynamics (compress / expand the band) | ✅ | round 128: −1 … +1, the band's level follows its input level |
 | Modulation (+ Add Modulation: XLFO, EG, EF, MIDI, XY, slots) | ❌ | |
 | Crossover slope (bottom bar) | ✅ | global (original per band) |
 | Linear phase / minimum phase | ❌ | |
 | High Quality mode (oversampling) | ✅ | "Oversampling 2x / 4x / 8x" |
-| Channel mode M/S | ❌ | |
+| Channel mode M/S | ✅ | round 147b: "Channel L/R \| M/S" in the bottom bar [EXEC trial: M = (L + R) / 2, S = (R − L) / 2 through the bands' two channels; drive pan and band pan then balance mid / side]; translated (state slot 695) |
 | In / Out gain + mix | ✅ | round 128: In (±24 dB) in the bottom bar; Out; Dry / wet |
 | Auto gain | — | LYNX extra (Saturn has none; Decapitator has Auto) |
 | Decapitator: Drive, 5 styles (A, E, N, T, P), Low Cut, Tone, High Cut, Thump, Steep, Mix, Output, Auto, Punish | ⚠️ | trial not installed; Ember covers drive / tone / cuts / mix / auto gain, no Thump / Steep / Punish |
 
+**Round 147b:** configuration 6 → 7 (channel mode M/S, drive pan, band pan, measured on the trial and translated), design 7 → 7. Remaining: 6 bands, 28 styles, modulation, linear phase.
+
 ## Aether ← Fresh Air
 
 Parameters of the original: Mid Air 0–100 %, High Air 0–100 %, Bypass, Trim −12…0 dB.
@@ -608,7 +625,7 @@ Trial on this PC: yes (older capture used).
 | Comp THRESHOLD | +10…−20 dBu (= −8…−38 dBFS), default 0 dBu (−18 dBFS); clockwise = lower | −40…0 dBFS, default 0 dBFS; clockwise = higher | ⚠️ | different unit and reference, opposite direction, default 18 dB higher |
 | Comp RELEASE | 0.1–4 s, default 0.4 | 0.1–4 s, default 0.29 | ✅ | |
 | Comp F.ATK | fast 1 ms; off = auto, program dependent | "Fast attack" 1 ms; off = fixed 10 ms | ⚠️ | no program-dependent attack |
-| Auto make-up from ratio + threshold | always on (the manual) | none (the translator adds +0.9 dB output) | ❌ | engine |
+| Auto make-up from ratio + threshold | always on (the manual) | none (the translator adds +0.9 dB output) | ✅ | round 123: the E voicing has the console's measured make-up; round 147b: "Auto make-up" (Compressor section) gives Ridge's own engine the same law (threshold dBFS + 18 = the console's scale, ratio) |
 | Comp Mix | — | "Mix" 0–100 % | ➕ | |
 | Comp curve display | — | static transfer curve | ➕ | |
 | Expander THRESHOLD | −30…+10 dBu (−48…−8 dBFS), default −30 | −80…0 dBFS, default −60 | ⚠️ | |
@@ -618,7 +635,7 @@ Trial on this PC: yes (older capture used).
 | GATE switch (Exp default) | button + LED; expander is the default | "Gate \| Expand" tabs, default **Gate** | ⚠️ | default is the opposite |
 | Threshold hysteresis | variable (program dependent) | fixed 4 dB (gate) | ⚠️ | |
 | GR indicators | two LED ladders (comp, exp) 3/6/10/14/20 dB + gate LED | two horizontal bars "Comp" / "Gate" 0–30 dB | ✅ | different form, same information; no gate-open LED |
-| ANALOG on/off | switch, centre right; default (her state) Off | none | ❌ | engine (colour) |
+| ANALOG on/off | switch, centre right; default (her state) Off | none | ✅ | round 147b: "Analog" (Dynamics section) [EXEC trial: Analog on adds white noise of −110.7 dBFS RMS per channel at the output, uncorrelated L / R, whatever the input / output / compressor settings; harmonics unchanged]; both voicings; translated (RealWorld 31) |
 | INPUT trim | ±18 dB, knob in the Gain block | "Input" ±20 dB | ✅ | |
 | Phase Ø | button + LED | "Phase" toggle | ✅ | |
 | OUTPUT fader | fader −24…+12 dB beside the meter | "Output" knob ±20 dB | ⚠️ | knob, not a fader; different range |
@@ -628,6 +645,8 @@ Trial on this PC: yes (older capture used).
 | Vocalstrip 2 (SSL Native) role | de-esser, de-ploser, 3-band EQ, compander with knee/makeup/drive, process order | round 145: Ridge's **Vocal strip voicing** — every control of the reference (34 parameters, its own laws), its own panel (level, compander, de-esser / de-ploser, equaliser, order menu, GR meters), measured on the official trial; her state translated (−60 … −67 dB null on her takes) | ✅ | REA_rodada145 §2; the broadband de-esser / de-ploser on bursts is the least exact part (−13 … −25 dB) |
 | Saved-state translation | — | filters, 4 bands, comp (threshold, ratio, release, fast), output, dyn/EQ bypass translated; Split, Dyn S.C., Ch Out, expander, Analog, Input, Phase not translated (order forced to Dyn>EQ) | ⚠️ | round 113 §3c |
 
+**Round 147b:** configuration 7 → 8 (auto make-up, ANALOG measured and translated), design 7 → 7.
+
 **Scores:** configuration 6/10, design 6/10. An SSL user finds every knob in the expected column. What is missing
 or wrong: Split / Dyn S.C. semantics, Analog, auto make-up, the In/Out meter with the output fader, and
 threshold units and directions.
@@ -778,7 +797,7 @@ Trial on this PC: yes (no screenshot this round).
 | SideChain HighPass / BandPass | button, default HighPass | "Detection: High-pass \| Band" tabs (+ bottom-bar menu), default High-pass | ✅ | Hush BP Q 1.4; Waves "very sharp", Q unknown |
 | Audio Split / Wideband | button, default **Split** | "Processing: Wide band \| Split band" tabs, default Split | ✅ | Hush's split is 2nd order at the frequency; Waves' is 1st order at ≈ Freq/π (engine) |
 | Monitor Output / SideChain (+ yellow light) | button | "Audition" toggle under the frequency slider (plays the detection band) | ✅ | same function, different name |
-| Energy Detector meter (side-chain energy, dB below 0 dBFS, blue) aligned with the threshold | main meter | "IN" meter = **input** peak, with a threshold arrow | ⚠️ | threshold is compared with an unfiltered level; switch IN to side-chain energy (as Waves) or add it |
+| Energy Detector meter (side-chain energy, dB below 0 dBFS, blue) aligned with the threshold | main meter | "IN" meter = input peak with a threshold arrow, and **inside it a blue bar = the detector's energy** (what the threshold is compared with, in the threshold's scale; both engines) | ✅ | round 147 |
 | Attn meter (red, instantaneous GR) + **infinite peak hold, click to reset** | meter | "GR" bar with a held-peak line and number, click to reset | ✅ | round 144 |
 | Output meter −30…0 dBFS + peak readout (click to reset) | meter | none (bottom bar shows the Output **setting**) | ✅ | UI; round 135w: OUT meter −30…0 beside IN / GR, clip lamp and highest-peak read-out, click to reset |
 | Frequency-response display | **none in the classic DeEsser** (the manual lists no graph; Renaissance DeEsser has one) | small detector-band graph only in the generic `hushDeEsser()` layout; the display-first editor shows the scrolling waveform with the reduction in red | ➕ | nothing to add for parity |
@@ -790,7 +809,7 @@ Trial on this PC: yes (no screenshot this round).
 | Gestures | slider drag, value-window typing | drag, Ctrl fine, wheel, reset, right-click entry, line/arrow drags | ✅ | |
 | Saved-state translation | — | frequency (×0.81), threshold (+5 dB), Split/Wide, HP/BP, Monitor translated; range fixed at 12 dB | ✅ | round 113 §3c |
 
-**Scores:** configuration 7/10 (every Waves control exists, plus extras), design 5/10. **After round 144**: configuration 9/10, design 7/10 (round 135w: 9 / 6; round 144: the GR meter's held peak). The scrolling-waveform
+**Scores:** configuration 7/10 (every Waves control exists, plus extras), design 5/10. **After round 144**: configuration 9/10, design 7/10 (round 135w: 9 / 6; round 144: the GR meter's held peak). **After round 147**: design 7 → **8**/10 (the energy-detector bar beside the threshold arrow). The scrolling-waveform
 editor is Pro-DS-like. A DeEsser user finds Threshold, Freq, HP/BP, Split/Wide and Monitor (as "Audition")
 quickly. What they miss: the side-chain energy meter beside the threshold, the Attn peak hold, the output meter,
 presets, and the Waves defaults.
@@ -1030,12 +1049,12 @@ positions against wtune.png once it exists.
 | Reference pitch | ±100 c (415.3–466.16 Hz), 440 | "A4" knob 430–450 Hz | ⚠️ | range ±40 c only |
 | Root | 17 names (sharps and flats) | KEY menu, 12 names (sharps) | ✅ | |
 | Scale type | 44 (User, Chromatic, Major, Natural/Harmonic/Melodic minors, Justonic, modes, Blues, Whole tone, Diminished, Bebop, pentatonics, Pythagorean, Maqamat, Indian thaats …) | SCALE menu, 13 + Custom | ⚠️ | her states use Major / Natural Minor only (covered) |
-| Range | keyboard span with draggable boundary handles + presets Bass / Baritone / Tenor / Alto / Mezzo / Soprano / Generic; notes outside → **bypassed** | "Input type" menu (Soprano / Alto-Tenor / Low male / Instrument) = detector range | ⚠️ | 4 presets vs 7, no handles, outside notes not bypassed |
-| Keyboard | multi-octave piano at the bottom, per-note status area | one octave of on/off key toggles at the bottom ("TARGET NOTES") | ⚠️ | same place, less content |
-| Note status per key | Legal / Illegal / Illegal-Pitch-Up / Illegal-Pitch-Down / Bypass (click cycles) | on / off | ⚠️ | Up/Down/Bypass missing |
-| Group Octaves | switch (per-note edits apply to all octaves) | always grouped | ⚠️ | |
-| Reset Scale / Send Scale to All / Receive (key) | buttons | — (key comes from translation / project key) | ❌ | |
-| Keyboard view / navigation buttons | yes | — | ❌ | one octave only |
+| Range | keyboard span with draggable boundary handles + presets Bass / Baritone / Tenor / Alto / Mezzo / Soprano / Generic; notes outside → **bypassed** | "Input type" menu (Soprano / Alto-Tenor / Low male / Instrument) = detector range | ✅ | round 147b: the range bar over the keys (drag a boundary), seven presets in the keyboard strip (LYNX's spans [model]: classical voice ranges ± a third; they also pick the detector's input type), notes sung outside pass uncorrected |
+| Keyboard | multi-octave piano at the bottom, per-note status area | one octave of on/off key toggles at the bottom ("TARGET NOTES") | ✅ | round 128: four octaves; round 147b: 2–7 octaves shown, scrollable (see navigation) |
+| Note status per key | Legal / Illegal / Illegal-Pitch-Up / Illegal-Pitch-Down / Bypass (click cycles) | on / off | ✅ | round 128: Bypass mode; round 147b: REMOVE mode cycles legal → illegal → illegal up → illegal down (arrows on the key; an illegal note's direction picks the next legal note up / down) |
+| Group Octaves | switch (per-note edits apply to all octaves) | always grouped | ⚠️ | per-octave statuses would need 128 per-key values; LYNX keeps the grouped behaviour (the reference's default) |
+| Reset Scale / Send Scale to All / Receive (key) | buttons | — (key comes from translation / project key) | ⚠️ | round 147b: RESET SCALE in the keyboard strip; Send / Receive (instance-to-instance transmission) not done |
+| Keyboard view / navigation buttons | yes | — | ✅ | round 147b: − / + (more / fewer octaves, 2–7) and ◀ / ▶ (scroll by an octave) in the keyboard strip |
 | Central display | target note name + correction amount in cents | `pitchring`: note name, ±100 c ring, sung offset + octave | ✅ | |
 | Scrolling pitch graph | not in WTRT (guide lists none) | `pitchtrace` (input vs corrected, 8 s) | ➕ | Auto-Tune-style; useful |
 | Input / output meters | −28 … 0 dBFS | — | ✅ | round 135w: IN / OUT meters on the "Real-time" page |
@@ -1050,6 +1069,8 @@ positions against wtune.png once it exists.
 | MIDI learn, gestures | right-click; Alt-click etc. | yes | ✅ | |
 | Window | fixed | resizable 800×548 | ✅ | |
 
+**Round 147b:** configuration 8 → 9, design 6 → 7 (the keyboard: note statuses with directions, the range bar and presets, Reset scale, the view's navigation). Remaining: Group Octaves off, Send / Receive, MIDI reference tone.
+
 **Scores** — configuration: 4/10 (for a Waves Tune RT user: key/scale/formant/time are there, but Speed, Tolerance,
 Vibrato, Correction %, note statuses and range bypass are not), design: 5/10 (note display centre + keyboard at the
 bottom match; the knob row is Auto-Tune's).
@@ -1547,13 +1568,13 @@ Sources: docs/specs/echoboy.md (Pro Tools-era guide pp. 22–54, store page); `[
 | 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 | — | 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); **round 144**: the rhythm editor (a row under the panel): the taps on the pattern's time axis, drag = level / time, double-click = add / remove a tap; Even / Free / Grid edits (Grid ½ … 1/64 — EchoBoy's Custom Time / Custom Beats roles), Shape (Decay, Reverse, Swell, Fade, Nonlin — LYNX's own laws, [model]), and a Patterns menu of 12 LYNX-authored patterns (gallop, tresillo, clave, stutter, triplet roll …; none copied). [EXEC] round 144: on the trial the Pattern / Custom Time / Custom Beats modes give no echo when only its host parameters are set (their taps live in its editor), so those are 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 Style menu (~30 voicings) | main panel menu | — | **round 147**: Echo voicing menu (Style edit row): 31 voicings with LYNX names, one per factory style, each measured black-box on the trial (first-echo tone and per-pass loop tone from noise bursts, steady-sine gain / harmonics at Saturation 0 … 24 dB, pitch wobble, impulse spread) and modelled (fitted biquad tones ≤ 0.3 dB rms for most, a knee shaper or a compressor, sine / random wobble, diffusion) | ✅ (Echoform) | [EXEC] REA_rodada147a §2; EchoBoy's style names are not shown; the reference's L/R offset (−3.8 / +4.2 ms around the time) stays Echoform's Spread |
 | 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 | ✅ | |
 | Tempo source | host, tap, MIDI, 30–300 BPM | host | host only | ✅ | no tap tempo, no free BPM; round 129 tap pad + round 135w own BPM (30–300) |
 | Mix | Dry…Wet, 12 o'clock = 50/50 | Wet/Dry faders | Mix 0–100 % (default 50) | ✅ | |
 | Feedback | Min…Max, can run away | Level | 0–200 %, default 70 % | ✅ | |
-| Saturation | Less…More, style-dependent, centre default | Feedback distortion Sat/Limit | Drive 0–24 dB (Colour) | ⚠️ | not style-dependent; default 0, not centre |
+| Saturation | Less…More, style-dependent, centre default | Feedback distortion Sat/Limit | Drive 0–24 dB (Colour) | ✅ | **round 147**: with a voicing, Drive = EchoBoy's Saturation 0 … 24 dB with each style's own measured law (drive / make-up per 6 dB step; e.g. studio tape: −3.5 dB at low level up to 12 dB, then +2.3 dB at 24; the radio / limited styles compress) |
 | HighCut | style-dependent darkening | FB cutoff/res, LP/HP/BP | High cut 200 Hz–20 kHz + Low cut 10 Hz–2 kHz | ✅ | |
 | Prime Numbers | detunes repeat times | — | — | ✅ | trivial: snap times to primes in samples; round 135w (Echoform): "Primes" — the delay times snap to a prime number of samples |
 | Groove (shuffle…swing) | alternate repeats | — | — | ✅ | round 135w (Echoform): Groove ±25 % = odd repeats late / early by that share of the echo time ([EXEC] EchoBoy trial: +0.25 → +113…125 ms at 500 ms) |
@@ -1565,20 +1586,20 @@ Sources: docs/specs/echoboy.md (Pro Tools-era guide pp. 22–54, store page); `[
 | Tweak: L/R Offset | 0–25 ms, default 8 | Offset | Spread ±20 ms | ✅ | |
 | Tweak Dual: FB Mix / Balance / FB Balance | knobs | — | — | ✅ | round 135w (Echoform): X-feed (each side's feedback from the other) and Balance; no FB Balance; **round 144**: FB balance (±100 %, each side's feedback) |
 | Style Edit: 3-band EQ gain + per-repeat Decay, Mid Res | ±18 dB etc. | FB filter only | Low/High cut only | ⚠️ | the "EQ in the loop vs first repeat" idea is missing; **round 144**: loop EQ (bass 120 Hz shelf, mid 1.2 kHz bell, treble 5 kHz shelf, ±18 dB) inside the loop — every repeat is shaped again; no per-repeat decay / Mid Res |
-| Style Edit: saturation type (Clean, Tape, Warm, Pump, Dirt, Limit×4) | menu | Limit/Sat + knee/symmetry | via Mode only | ⚠️ | |
+| Style Edit: saturation type (Clean, Tape, Warm, Pump, Dirt, Limit×4) | menu | Limit/Sat + knee/symmetry | Saturation type menu | ✅ | **round 147**: Auto / Clean / Tape / Tube / Squash / Grit / Ceiling — the measured curves of six representative styles (digital, studio tape, valve tape, FM radio's compressor, distorted, limited); works with or without a voicing. [EXEC] the reference's own type menu lives in its editor (not a host parameter), so its types were not measured one by one [model] |
 | Style Edit: Diffusion + Size, Loop/Post | knobs + switch | Diffusion level/spread | Diffusion amount/size | ✅ | no Loop/Post choice; **round 144**: Diffusion Loop / Post |
 | Style Edit: Wobble, Rate, Shape (5), Sync | knobs/menu | Mod rate/time | Wow, Flutter (Tape) / Rate, Depth | ✅ | no shape menu, no LFO sync; **round 144**: Wobble shape (sine, triangle, square, saw, random) and LFO sync (free, 1/16 … 2 bars) for the LFO modes |
 | Ducking | — (not in EchoBoy) | — | Ducking | ➕ | |
 | Pitch / shifter / reverse modes | — | — | yes | ➕ | |
 | Echo display | Tweak "visualiser" of delay tails | — | "echotrain" display of repeats | ✅ (Echoform) | |
 | Freeze (PrimalTap) | holds the loop; ≤2048 ms at 8× | — | — | ✅ | round 135w (Echoform): Freeze holds the loop (no input, unity feedback, no colour) |
-| Multiply 2×/4×/8× (PrimalTap; halves the rate per step, max 2.5 s) | knob | Smp rate / Bits (lo-fi) | Lo-Fi mode | ⚠️ | no time-for-bandwidth trade |
+| Multiply 2×/4×/8× (PrimalTap; halves the rate per step) | knob | Smp rate / Bits (lo-fi) | Multiply 1x / 2x / 4x / 8x (Style edit row) | ✅ | **round 147** [EXEC] PrimalTap 5.5.5: the delay × 2 / 4 / 8 exactly, a brick-wall band of ≈ 6.2 / 3.1 / 1.55 kHz (−43 … −49 dB a third of an octave above), up to 8 s (16 s gave silence); LYNX: the same factor on the times (up to 20 s) and two 8th-order low-passes at 12.4 kHz / factor inside the loop |
 | VCO Rate/Depth per tap, phase flip (PrimalTap) | knobs | Mod rate | Rate/Depth (one LFO) | ⚠️ | |
 | Preset menu / user presets / A/B | Soundtoys strip | FL factory list only; no user save, no A/B | "(no preset)" | ✅ | round 129's preset bar (Echoform) |
 | Gestures, value entry, automation | standard | generic editor: full set | full set | ✅ | |
 | Translation of the saved state | encoded | none, FL defaults (ms delay, FB, etc. unrelated) | none | ❌ | state unreadable; default only |
 
-**Scores**: Fruity Delay 3 as the stand-in: configuration 2/10, design 2/10. Echoform: configuration 5/10, design 5/10. **After round 144** (Echoform): configuration 9/10, design 8/10 (round 137: 8 / 7) — the rhythm editor (patterns, free / grid taps, shapes) and the Style Edit role (input, loop EQ, FB balance, diffusion place, wobble shape / sync); left: the saturation types, the ~30 style voicings, PrimalTap's Multiply.
+**Scores**: Fruity Delay 3 as the stand-in: configuration 2/10, design 2/10. Echoform: configuration 5/10, design 5/10. **After round 144** (Echoform): configuration 9/10, design 8/10 (round 137: 8 / 7) — the rhythm editor (patterns, free / grid taps, shapes) and the Style Edit role (input, loop EQ, FB balance, diffusion place, wobble shape / sync); left: the saturation types, the ~30 style voicings, PrimalTap's Multiply. **After round 147a**: configuration 10/10, design 8/10 — the 31 measured voicings, the style-dependent Saturation, six saturation types, PrimalTap's Multiply; left: the reference's per-voicing Style Edit details (per-repeat decay, Mid Res), the chorus styles' multiple modulated voices (one wobble per side here), PrimalTap's per-tap VCO.
 
 **Verdict:** **Echoform is clearly the better EchoBoy (and PrimalTap) substitute.** It has the four-mode-like Style switch (Single/Dual/Ping-pong + Ratio/Quad), a character Mode menu standing in for EchoBoy's Style, Drive ≈ Saturation, Wow/Flutter ≈ Wobble, Diffusion, note/dotted/triplet sync and an echo display. Fruity Delay 3 is a clean FL delay with none of the "style" concept, played at FL defaults. The spec's own recommendation (§7.1) agrees. H-Delay already moved to Echoform in round 119.
 

+ 273 - 0
docs/analise/REA_rodada146.md

@@ -0,0 +1,273 @@
+# REA round 146 — FL Studio technologies (initialized controls, global links, Misc tab, mixer groups, track modes, wrapper page) + design fidelity, round 3
+
+Brief (2026-10-24): continue round 143 ("Where I stopped"): the moved control overriding its playing automation while
+recording; the "Clips" record filter; the parameter menu's Init song with this position / Delete initial value, Edit
+events in piano roll, Override global link; the MIDI import window's track / channel / controller selection,
+zero-velocity notes, Blend; the Misc tab's FL-only parameters; mixer groups and dock-to; Playlist track modes /
+consolidate; FL's plugin wrapper settings page. The round ran as three sub-rounds: main (parameter menu, recording,
+initialized controls, global links), r146a (mixer, Playlist tracks, wrapper page), r146b (Misc tab, MIDI import).
+
+- **Targets:** `FL Studio 2026/FLEngine_x64.dll` (build 5654; our own copies of the round-134 Ghidra project,
+  `~/ghproj/r146`, `r146a`, `r146b`), FL's own render test projects and the installation's Data folder.
+- **Tools:** Ghidra 12.1.4 headless with our helper scripts (`StrRefs.java`, `DecAt.java`, `Xr.java`, r146a's
+  `FindOps.java`); our Python readers (`dfm.py`, `meth.py` published-method table, new `va.py`: a VMT's class name);
+  `.flp` surveys over the 400-project corpus; r146b's FL renders (`FL64.exe /R /Ewav`) of one-record changes of FL's
+  `Render tests/Sampler.flp`, measured with our own analysers (tmp/flrea146/b, not in the repo).
+- **Evidence markers:** **[DECOMP]** Ghidra pseudocode, **[DATA]** form resources / strings / tables / saved files,
+  **[EXEC]** observed running FL, **[model]** our reading; "not confirmed" where unverified.
+- Clean-room: behaviour, names and formats only; LYNX's code is our own.
+
+---
+
+## Part B — technologies (main sub-round)
+
+### B1. The touched control wins over its playing automation while recording **[model: FL's behaviour, round 143 "not done"; LYNX design]**
+
+**LYNX before:** while recording, a parameter with automation was still driven by the playback between two writes
+(the knob jumped back until the next five-per-second commit). **Now:** every engine tick (30 Hz) the touched targets
+are turned into their automation slots (`RackState::slotsOfTarget`: the song's automations, then the pattern event
+lanes, numbered as `buildAutomationTables` numbers them) and handed to the renderer
+(`RackRenderer::setOverriddenSlots`, a 1024-bit atomic mask). An overridden slot is not driven by its clips / events
+(`clearOverriddenValues` before the plugin parameters are applied; the tempo automation too): the control's own value
+plays at once, until the gesture ends and its points are written. Test `rea146_touched_control_overrides_its_automation`.
+
+### B2. Initialized controls: Init song with this position / Delete initial value **[DATA DFM `Param_InitMenu` "&Init song with this position", `Param_DeleteInitMenu`, `MLParam_InitMenu` / `MLParam_InitPatMenu`; DECOMP `FUN_012009e0` (Param_InitMenuClick), `FUN_01052040`, `FUN_012448c0` → `FUN_010520d0`, `FUN_011e7470`, `FUN_010703d0`, `FUN_00ff98c0`]**
+
+- *Init song with this position* (`FUN_01052040 (control, −1)`): reads the control's current raw value
+  (`FUN_01046a70`) and adds an event at tick 0 for its control ID to the song's **init list** (`PTR_DAT_015dfc48`, the
+  same event list type as pattern events). With a pattern number (the multi-link menu's *Init pattern with these
+  positions*) the event goes into that pattern's own events instead **[DECOMP]**.
+- *Delete initial value* (`FUN_010520d0`): removes every event of that control ID from the init list (tick range
+  0x80000001 … 0x7fffffff) **[DECOMP]**.
+- The list is played whenever the song position is set in **song mode** (`FUN_011e7470`: when the mode global is 1 it
+  replays the init list, `FUN_01065af0 (…, 0x80000001)`, besides the pattern events up to the position), i.e. when
+  the song starts and on a jump **[DECOMP]**. The Browser lists them in *Current project › Initialized controls*, hint
+  "To be reset when the song starts" (`FUN_010703d0`) **[DATA]**. It is the .flp's 0xD8 record (round 85).
+
+**LYNX before:** 0xD8 was applied once at import as the targets' values. **Now:** `Song::initialValues` (target,
+value), kept by the import (0xD8), saved in .lynx (`initialValues`), renumbered / dropped with the channels / slots
+(`forEachTarget`); every parameter menu has *Init song with this position* (checked when set) and *Delete initial
+value*; `AudioEngine::resetToInitialValues` puts them back when playback starts in song mode (`play()`, so exports and
+renders too) and on a seek while playing; hosted plugins' parameters get them through `setParameterFromUi`. Test
+`rea146_initial_values_reset_the_song_like_fl`. The Browser's *Current project* has FL's **Initialized controls**
+section (each target with its value; right-click *Delete initial value*). Not done: *Init pattern with these
+positions* (LYNX has no multi-link selection).
+
+### B3. Edit events in piano roll **[DATA DFM `Param_EditPRMenu` Tag 2 → `Param_EditMenuClick` `FUN_01200970` → `FUN_00e34450 (…, tag)`]**
+
+**LYNX before:** only the Event editor window. **Now:** the parameter menu's *Edit events in piano roll* opens the
+Piano roll (selecting the channel when the parameter is a channel's) with the parameter's pattern events in the
+bottom lane: the lane box lists *Velocity / Pan / Fine pitch*, then a *Pattern events* section with the pattern's event
+lanes; drag draws one event per grid step (`eventedit::fill`), right-drag deletes (`eventedit::erase`), the events show
+as a held-value line with dots.
+
+### B4. Override global link **[DATA DFM `Param_GenLinkMenu` "&Override global link..."; DECOMP `FUN_012009a0` → `FUN_00f778e0` → `FUN_00f77920`, which opens the form class `TMIDIInputForm_Generic` (VMT read with our `va.py`), DFM caption "Global link settings"; strings `System\Config\Mapping\Generic`]**
+
+FL keeps *global* controller links in its user data (`Mapping\Generic`), for every project; *Link to controller*
+(`FUN_00f8a040` → `FUN_00f83a20`) makes the project's own link. **LYNX before:** project links only. **Now:**
+`prefs::MidiPrefs::globalLinks` (Settings file, `link=cc|channel|kind|index|slot|param`), *Override global link...*
+learns one (the next CC moved), *Remove global link (CC n)*; a project link of the same target or controller wins
+(`linksWithGlobal`); Settings › MIDI lists the project's links, then the global ones. Test
+`rea146_global_links_and_project_override`.
+
+### B5. The "Clips" recording filter — not done (performance mode only) **[DECOMP `FUN_0119f5b0`, `FUN_0126bd90`, `FUN_011fc7b0`, `FUN_00d274e0`, `FUN_00d0bde0`, `FUN_011c9ab0`]**
+
+The filter bit 8 is copied with the others into the active recording mask at record start (`FUN_0126bd90`); it is
+read only by the performance-mode clip scheduler (`FUN_00d0bde0` → `FUN_00d274e0`: a launched clip is written to the
+playlist track) and the periodic playlist refresh while recording (`FUN_011fc7b0` → `FUN_01221880`); the record
+button's hint lists "automation, score, audio, clips". Curiosity: the "start recording on input" test
+(`FUN_011c9ab0`) checks a clip event with `(mask & 1) == 8`, which is never true **[DECOMP]**. LYNX has no performance
+mode, so the filter would do nothing; left out.
+
+---
+
+## Part C — mixer groups and docks, Playlist track modes, wrapper settings page (sub-round r146a)
+
+
+Target: `FL Studio 2026/FLEngine_x64.dll` (build 5654), own Ghidra copy `~/ghproj/r146a` (from r134), helper scripts in
+`tmp/flrea146/a/gh/scripts` (StrRefs, DecAt, new FindOps = functions whose instructions contain all given operand
+substrings); published-method addresses read with tmp/flrea143/py/meth.py-style lookup; .flp surveys
+`tmp/flrea146/a/py/` (ins.py, ins2.py, ins3.py, trk.py, tm.py) over the 400-project corpus (tmp/flrea134/flps.txt) and the
+165 FL Data .flp files. No FL run this sub-round (FL was busy with r145) — everything is [DECOMP]/[DATA].
+
+### C1. Mixer: Group (Separator, Create group, Auto color group, Select › Group) and Layout › Dock to
+
+- Published handlers **[DATA method table]**: `SeparatorMenuClick` 0x012ab440, `CreateGroupMenuClick` 0x012aa200,
+  `AutoColorGroupMenuClick` 0x012ab2b0, `SelectGroupMenuClick` 0x0128f130, `DockToMenuClick` 0x0128f9b0 (+ the item
+  click `FUN_0128f800`, undo name "dock mixer track(s)").
+- Mixer track record = 0x1478 bytes per track (`PTR_DAT_015e06a0`); **+0x2c = separator**, **+0x2d = dock** (menu Tag
+  0 left / 1 middle / 2 right) **[DECOMP FUN_012ab440, FUN_0128f800]**.
+- Separator: sets +0x2c of every selected track to the item's checked state (undo "mixer track separator(s)") **[DECOMP]**.
+- Create group (`FUN_012aa200`, undo "group mixer tracks"): for each selected track, if its display neighbour on the
+  left (`FUN_0127c990(i,-1)`) is not selected it gets a separator; if its right neighbour is not selected, that neighbour
+  gets one; then the selected tracks without a colour take the current track's colour **[DECOMP]**. So FL's mixer
+  "group" = a run of tracks between separators.
+- Auto color group (`FUN_012ab2b0`): selects the current track's group (`FUN_0128efc0(cur,1)`) and gives it the
+  current track's colour **[DECOMP]**.
+- .flp: FL's insert writer `FUN_00f3d620` writes record 0xEC flags = `(dock & 3) << 6` | 1 phase | 2 swap | 4 effects
+  on | 8 enabled | 0x10 threaded off | **0x400 separator** | 0x800 | 0x1000 solo | 0x2000 | 0x4000 | 0x8000 **[DECOMP]**.
+  Survey **[DATA]**: 12 413 / 13 213 inserts have 0x40 (middle); the Master and the last insert (FL's "Current" track)
+  have dock 0 (left); 0x400 only in the FL demo NewStuff.flp (inserts 10, 12, 18, 20); 0x80 never.
+
+| # | FL | LYNX before | LYNX now |
+|---|---|---|---|
+| G1 | Group: Separator / Create group / Auto color group; Select › Group | none | `MixerTrack::separator`, `mixerops::setSeparator / createGroup / autoColorGroup / groupOf` (FL's neighbour rule in display order, inside a dock block); mixer track menu **Group** section; **Select › Group**; separators drawn as a gap + line on the left of the track |
+| G2 | Layout › Dock to › Left / Middle / Right | none | `MixerTrack::dock` (`MixerDock`), `mixerops::dockTracks / displayOrder`; the strips are laid out left block, middle (with the "+"), right block, a dark gap between blocks (`MixerStrips::layoutStrips`) |
+| G3 | .flp flags | dock / separator not read | imported (0x400, bits 6–7; FL's "Current" track — the last insert — stays in the middle); saved in .lynx (`separator`, `dock`) |
+
+Partial: FL's left/right docks stay pinned while the middle scrolls; LYNX's blocks scroll together. Not done: group
+names (FL copies something at +0xc of the current track to unnamed selected tracks in Create group — not confirmed what).
+
+### C2. Playlist track modes and Consolidate track
+
+- .flp record 0xEE (70 bytes) **[DATA survey of FL demos, e.g. "Astes - Bien Duro.flp"]**: **u32 mode at byte 49** (0
+  unassigned, 1 audio track, 3 instrument track), **i32 mixer track at 53** (audio: 1, 2, 3…; instrument: −1 or its
+  track), **i32 FL channel index at 57** (instrument tracks: a generator channel, e.g. 198 "4.6 Lead"); matches the
+  in-memory playlist track (0x114 bytes, mode at +0xb4, mixer at +0xb8; hint "(Instrument track)" /
+  "(Audio track, linked to mixer track %d)" **[DECOMP FUN_00eab1f0]**).
+- FL strings **[DATA]**: "Only generators can be used as instrument tracks.", "Can't create new audio or instrument
+  track| There are no available mixer tracks.", "Make clip unique?|The clip "%s" is also used on another audio
+  track. Do you want to make this instance unique and then route it to this audio track?", "Instrument tracks are not
+  for audio clips.". Consolidate: `EEPLTrackConsolidateMenuClick` 0x012238c0 → `FUN_012ea170(playlist, tag == 1)`
+  (TrackLength / SongLength items), test helper names the result "… (consolidated).wav" **[DECOMP FUN_011109e0]**.
+
+| # | FL | LYNX before | LYNX now |
+|---|---|---|---|
+| T1 | Track mode ▸ Unassigned / Audio track / Instrument track | none | **Track mode** submenu: Audio track links the track to the first free mixer track (named / coloured after the track); Instrument track ▸ (generator channels) links the channel and its mixer track (a free one when needed); `trackmodes::*` |
+| T2 | audio clips on an audio track go to its mixer track (making the clip unique when shared) | n/a | `trackmodes::followAudioTracks` after every clip edit (in `PlaylistComponent::sortClips`): the clip's channel is routed to the track's mixer track; a channel shared with clips elsewhere is copied first |
+| T3 | hint bar "(Instrument track)" / "(Audio track, linked to mixer track N)" | name only | same text after the track name |
+| T4 | Consolidate track(s) ▸ From track start / From song start | none | the track's unmuted clips rendered (32-bit float WAV in Music/LYNX/Renders, 2 s tail, through the mixer, Master without effects at unity) into one audio clip "<track> (consolidated)" on the same track, in place of those clips (one undo step; the new channel plays on the audio track's mixer track or the Master) |
+| T5 | .flp / .lynx | — | 0xEE mode / mixer / channel imported (channel through the import's channel map); .lynx `playlistTrackModes` |
+
+[model] FL's consolidate is assumed to render the clips' processed sound (not confirmed: rendering path not traced);
+LYNX renders with the mixer and routes the result past it (Master), so it sounds the same. Tempo automation clips of
+other tracks are not part of the render (a song with tempo changes renders at the playlist's tempo map shifted).
+Not done: instrument-track editing behaviour (FL draws the channel's notes on the track itself), refusing audio clips
+dropped on instrument tracks, track modes per arrangement.
+
+Tests (tests/Rea146aTests.inc): `rea146a_mixer_separators_groups_and_docks`, `rea146a_flp_insert_flags_dock_and_separator`,
+`rea146a_playlist_track_modes`, `rea146a_flp_playlist_track_modes`, `rea146a_consolidate_track`.
+
+### C3. FL's plugin wrapper settings page
+
+- FL's wrapper settings are built in code (no DFM form; `TPluginForm` only) **[DATA]**. Option names and hints from the
+  resource string pool **[DATA, no xrefs]**: "Use fixed size buffers", "Use maximum buffer size from host",
+  "Allow threaded processing" / "|Allow plugin to be multi-threaded by FL Studio", "Allow smart disable" / "|Allow smart
+  disable for plugin", "Make bridged" / "|Load plugin in separate process (bridged)", "|MIDI input port number",
+  "|MIDI output port number", "Notify about rendering mode" / "|Let the plugin know when rendering to audio file",
+  "Send loop position" / "|Let the plugin know about loop start and end points", "Reset on transport", "Use time
+  offset" / "|Adjust time information reported to a plugin", "Process inactive inputs and outputs", "Report latency",
+  "Send note release velocity", "Send pitch bend range", "|Keep plugin editor in bridge process", "|Increase idle rate",
+  the warning "While some plugins require processing buffers to always be the same size…".
+
+| # | FL | LYNX before | LYNX now |
+|---|---|---|---|
+| W1 | plugin window header: the plugin page and the wrapper settings (gear) page | the plugin's editor alone; options only in the rack / slot menu › Processing | hosted-plugin windows opened from the Channel rack or a mixer slot get a header with **Plugin** / **⚙ Wrapper settings** tabs (`WrappedEditor`); the page (`WrapperSettingsPage`) shows Name + version, Vendor, Format (instrument), File, Latency (samples / ms), Inputs / outputs, Parameters, then **Processing** (Use fixed size buffers, Process maximum size buffers, Use maximum buffer size from host, Allow threaded processing, Allow smart disable), **Bridging** (Make bridged), **MIDI** (Input port) — the options LYNX applies, from one table `wrapperOptions()` (core/FlWrapper) |
+
+Options that re-create the plugin (fixed buffers, bridged) keep its state and close the window, as the menu did. Not
+done (no LYNX behaviour behind them): MIDI output port, Notify about rendering mode, Send loop position, Reset on
+transport, Use time offset, Process inactive inputs and outputs, Report latency override, note-release velocity,
+pitch-bend range, editor-in-bridge, idle rate; FL's parameter browser tab. Patcher-hosted plugin windows keep the plain
+editor (no PluginRef path). Side-by-side capture not made (FL was held by r145 under the lock).
+
+Test: `rea146a_wrapper_settings_page_options`.
+
+---
+
+## Part D — the Misc tab's FL-only parameters, the MIDI import window (sub-round r146b)
+
+
+Method: FL Studio 2026 (build 5654) under `~/.cache/lynx-fl.lock`. (1) **[EXEC renders]** FL's own
+`Data/System/Render tests/Sampler.flp` with one channel record changed (our generator `tmp/flrea146/b/py/mk.py`,
+experiments `exp1…exp6.py`), rendered with `FL64.exe /R /Ewav` (`flr.sh`), measured with our analysers (`an.py`
+segments, `steps.py` per-2.5 ms pitch runs, `env.py`); test tones 441 Hz (`tone.wav` 3 s, `blip.wav` 60 ms). (2)
+**[EXEC saves]** FL's GUI (Misc tab of the Sampler channel): one control toggled, Ctrl+S, the saved events diffed
+(`py/evdiff.py`). (3) **[EXEC hints]** FL's hint bar over the knobs. (4) **[DATA]** FL's `System/Config/Chords.map`,
+FL's TMIDIImportForm (round 143 DFM), the online manual's "Channel settings - Miscellaneous" page (wording only).
+(5) Ghidra (own copy `~/ghproj/r146b`, StrRefs) only for the hint strings ("^b^aFine time shift", "Delay number of
+echoes", "|Process / leave first echo"…) **[DATA]**. Clean-room: behaviour and record layouts only.
+
+### Records (FL 2026 saves, one control changed each) [EXEC saves + renders]
+
+| Control | Record | Notes |
+|---|---|---|
+| Time › Shift | word event 0x59 | FL's time-knob value; 1024 = 1 step ("Fine time shift: 0:00") |
+| Time › Gate | 0xD7 u16 at 64 | time-knob value; ≥ 1446 = Off (default 1447) |
+| Time › Full porta | 0xD7 byte 62 | 1 = on (default) |
+| Arpeggiator direction / range / chord / time / gate | 0xD7 i32 at 40 / 44 / 48 / 52 / 56 | direction 1 up, 2 down, 3 bounce, 4 sticky, 5 random; chord −1 Auto (sustain), −2 Auto, 0 None, k = line k of Chords.map; time = time-knob (1024 = 1:00); gate /48 (48 = 100 %) |
+| Arpeggiator Slide | 0xD7 byte 60 | |
+| Arpeggiator Repeat | 0xD7 i32 at 92 | 1 = default |
+| Echo delay | 0xD1: i32 feedback, pan, pitch, echoes, time | feedback /12800 (12800 = as loud as the note), pan 6400 centre, pitch cents, time 1/192 beat (144 = 3:00) |
+| Echo Mod X / Y | dword event 0x8A: u16 X, u16 Y | 128 = none |
+| Ping pong / Fat mode | 0xD7 byte 10 bits 2 / 4 | |
+| Enable main pitch | 0xD7 byte 11 | |
+| Add to key | 0xD7 byte 63 | |
+| PITCH knob / RANGE | 0xDB +8 cents / 0xD7 i32 at 112 | range default 2; the pitch is not limited by the range in renders (1200 cents → +12 st) |
+| Vol / Key tracking | 0xE4 ×2 (velocity, key): i32 mid, pan, mod X, mod Y | defaults mid 100 / 60 |
+
+### Behaviour [EXEC renders]
+
+- **Time knobs**: beats = (27^(v/1024) − 1)·48/26 / 192 (the scale round 6 found for the porta slide); Shift 1000 →
+  22 ticks at 96 PPQ, 800 → 11, 512 → 4, 400 → 2, 200 → 1; arpeggiator time 640/768/896/1024/1152/1280 →
+  32/52/79/125/188/293 ms at 120 BPM; Gate 900 → 83 ms, 600 → 26 ms (rounded to the project's ticks).
+- **Shift** delays note on and off; **Gate** cuts notes longer than it (with a volume envelope; FL's sampler without
+  one plays the sample out).
+- **Echo**: echo k at k·time, volume feedback^k (exactly 0.5 per echo at 6400; independent of velocity: velocity 50
+  only scales all), pan k·step clamped (6400 → 3200: −0.5, −1, −1, −1), pitch k·step cents (100: +1, +2… st);
+  **ping pong** bounces the pan off the ends (−0.5, −1, −0.5, 0).
+- **Key tracking**: pan += (key − (120 − mid))/48 · pan/64 (mid 60: ±12 st → ±0.25 at pan 64; mid 72 → zero at 48).
+  **Velocity tracking**: pan += 0.275 · pan/64 · (v(vel) − v(mid)), v = FL's velocity → volume curve.
+- **Arpeggiator**: steps count from the chord's start (a chord at 52 ms arpeggiates at 52, 180, 307…), notes last
+  time·gate and past 100 % the next step waits (gate 64 → 167 ms steps); sticky = the ends twice; Repeat r = the
+  sequence r times per octave before the next octave (range 2, repeat 2: 69 73 76 69 73 76 81 85…); Repeat 0 plays
+  the chord at once each step (not done); chord k on one note (5 → 0 3 7, 27 → 0 4 7 11, 0 → the note only).
+
+### FL vs LYNX
+
+| # | Item | FL Studio 2026 | LYNX before | LYNX now |
+|---|---|---|---|---|
+| M1 | Time › Gate / Shift / Full porta | knobs on the time-knob scale; porta notes ignore the gate with Full porta | missing (only Swing) | `ChannelMisc::gateBeats / shiftBeats / fullPorta`, applied by the scheduler (pattern loop and Playlist; `ScheduleIndex::maxShift` widens the note window); Misc tab knobs with FL's steps:ticks text; imported from 0x59 / 0xD7 |
+| M2 | Echo delay / fat mode | Feed, Pan, Mod X, Mod Y, Pitch, Time, Echoes, Ping pong, Fat mode | missing | `channelmisc::NoteEcho` after the arpeggiator (echoes of every note, their offs with the same delay, volume factor through the new `Instrument::setNextNoteGain` — the sampler scales the voice, other engines the velocity); Misc tab section; imported from 0xD1 / 0x8A / 0xD7 byte 10. Mod X / Y and Fat mode stored only |
+| M3 | Vol / Key tracking | Pan, Mod X, Mod Y, Mid (Vol and Key tabs) | missing | `trackedPan` at note on; tabs Vol / Key with Pan and Mid; imported from 0xE4. Mod X / Y stored only |
+| M4 | Arpeggiator | directions incl. sticky, Time knob, Gate up to 267 %, Range, Repeat (per octave), Slide, Chord list | Off/Up/Down/Up-down/Random on the transport grid, gate ≤ 100 %, repeat = each note n times, no chord / slide; **not imported from .flp** | FL's timing (from the chord's start, gate past 100 %), sticky direction, Repeat per octave (`octaveRepeat`; LYNX's note repeat kept), Slide (slide events, no new attack), Chord (Auto / None / LYNX's chord list; FL's index read from the installation's Chords.map); the whole arpeggiator imported from 0xD7 |
+| M5 | Levels adjustment Mod X / Mod Y | assignable modulation | missing | the channel filter's cutoff / resonance for sampler and synth channels (disabled for others) |
+| M6 | Header PITCH + RANGE | pitch knob ± range semitones | missing | Pitch (the channel's pitch, ± range) and Range knobs in the header; range imported (0xD7 +112) |
+| M7 | Enable main pitch | per channel | the master pitch applied to every channel | `misc.mainPitch` (imported from 0xD7 byte 11) |
+| I1 | MIDI import: Which tracks / channels / controller | track list, 16 MIDI-channel toggles, controller −1…127 | all tracks and channels, no controllers | core `midiimport` (testable without JUCE): the selection, controller 7 / 11 → channel volume, 10 → pan, into the pattern's event lane; the window lists the file's tracks and the controllers LYNX applies |
+| I2 | Import zero velocity notes | off by default | always note off | option: a note on with velocity 0 is a note (a note on of its key ends the open ones) |
+| I3 | Blend with existing data (piano roll) | off: the channel's notes are deleted first | always pasted | the piano roll's Import .mid opens the window with Blend and the selection lists (`importIntoChannel`) |
+
+Check after the change **[EXEC]**: LYNX's `renderwav` of the same experiment files against FL's renders
+(`steps.py` / `an.py`): arpeggio up / up-down / chord 5 / range 2 repeat 2 / gate 64 / chord at tick 10 — the same
+notes at the same times (±5 ms, the analyser's window); echo ping pong (pan −0.5, −1, −0.5, 0, levels ×0.5 per echo)
+and echo pitch (+1…+4 st) the same. FL cuts an arpeggio note at its gate even on a one-shot sample: LYNX's
+arpeggiator "off" now chokes the channel (except with the echo delay on).
+
+Tests (tests/Rea146bTests.inc): `rea146b_fl_time_knob_scale`, `rea146b_shift_and_gate_schedule`,
+`rea146b_echo_delay_events`, `rea146b_tracking_pan`, `rea146b_arpeggiator_like_fl`, `rea146b_flp_misc_records`
+(FL's Sampler render test patched in memory, with the installation's Chords.map), `rea146b_midi_import_selection`.
+
+Not done: Fat mode's effect (FL: "subtler echoes with alternating panning" — our renders did not separate it);
+echo / tracking Mod X / Y (LYNX's notes route no mod X / Y); Repeat 0 (chord at once); "Auto" (no sustain) chord
+differences; Add to key and the root-note keyboard (LYNX folds the root note into the sampler pitch at import); the
+header Pitch acts on samplers and FL engines (LYNX's synth has no channel pitch); live-played notes skip the arp /
+echo / tracking (as before).
+
+---
+
+## Where I stopped
+
+- Done: the touched control wins over its automation while recording; FL's initialized controls (parameter menu
+  Init song with this position / Delete initial value, reset when the song starts in song mode, .flp 0xD8 kept, saved,
+  Browser › Current project › Initialized controls); Edit events in piano roll (the bottom lane draws pattern events);
+  Override global link (global links in the MIDI settings, the project's own link wins); the "Clips" filter studied
+  and left out (performance mode only). r146a: mixer separators / groups / docks, Playlist track modes and Consolidate
+  track, the wrapper settings page. r146b: the Misc tab's time / echo / tracking / arpeggiator / pitch parameters with
+  FL's measured behaviour, the MIDI import window's selections, zero-velocity notes and Blend.
+- Not done: *Init pattern with these positions* (multi-link selection), the Clips filter (no performance mode), pinned
+  left / right mixer docks while the middle scrolls, group names, instrument-track editing on the Playlist, the
+  wrapper options without LYNX behaviour (listed in C3), Fat mode's effect, echo / tracking Mod X / Y, arpeggiator
+  Repeat 0, Add to key, root-note keyboard; live-played notes skip the arpeggiator / echo / tracking.
+- Not confirmed: whether FL resets initialized controls when playing from a position inside the song in every case
+  (the decompiled position setter does it in song mode), what FL copies to unnamed tracks in Create group, FL's
+  Consolidate rendering path. Side-by-side captures of these screens were not made this round (FL was held by r145).

+ 144 - 0
docs/analise/REA_rodada147.md

@@ -0,0 +1,144 @@
+# REA round 147 (parity147): docs/PARITY.md, tier 3
+
+2026-10-24. Continues round 144 (`REA_rodada144.md` "Where I stopped"). This round: Prism Multiband's Dynamic phase
+rebuilt on measurements of the Pro-MB trial, Prism's expert panel (side-chain filtering, stereo link per band).
+Sub-rounds: 147a (Echoform ← EchoBoy / PrimalTap: saturation types, echo styles, Multiply — `REA_rodada147a.md`),
+147b (Ember M/S, LYNX Tune keyboard, Ridge auto make-up / ANALOG — `REA_rodada147b.md`); summary in §5.
+
+Evidence markers: [EXEC] run here on the official trial, hosted black-box in `tools/fxmeasure` (public VST3 API:
+parameters, value texts, audio in / out, the component state as a DAW stores it); [model] LYNX's own choice. Nothing
+was decompiled; no graphics, presets or names were copied. Raw data: `D:\lynx-work\parity147\mb\` (m1 = static band
+responses per mode, m2 = a compressing band on tone bursts, m3e = stereo link, m4 / m5 = the free side-chain filter,
+st = saved states); analysis scripts in the job's `tmp/parity147/py` (mb2.py, link.py, scf2.py, burst.py).
+
+## 1. Prism Multiband: Pro-MB's Dynamic phase, measured and rebuilt
+
+[EXEC] Pro-MB 1.3.3, 48 kHz, look-ahead on, static bands (range 0, level ±12 dB), impulse responses of 26 cases
+(band below 1 kHz, above 1 kHz, 300 Hz – 3 kHz, 800 – 1250 Hz; slopes 6 / 12 / 24 / 36 / 48 dB/oct; two adjacent
+bands −12 / −12 and −12 / +6; three bands) in Linear and Dynamic phase. Findings:
+
+- Per band, Dynamic phase is **exactly the minimum-phase version of the Linear-phase magnitude** (the cepstral
+  minimum phase of |H_linear| reproduces the measured phase within 0.2°: e.g. the band below 1 kHz at −12 dB, 24
+  dB/oct: −4.08 dB and +53.0° at 1 kHz; 12 dB/oct +36.8°, 48 dB/oct +70°; the middle band 300 Hz – 3 kHz: −46.3° at
+  300 Hz, +2.6° at 1 kHz, +46.3° at 3 kHz).
+- With several bands working, the bands are **in cascade**, not summed: two adjacent bands at −12 dB give −8.15 dB
+  at their shared 1 kHz crossover (the product of two −4.08 dB, while linear phase is a flat −12 dB); −12 / +6 dB
+  give −0.57 dB (−4.08 + 3.52). The three-band case matches the product to 0.1 dB.
+- The linear-phase magnitude of a band is 1 + (g − 1)·A, A = |low pass of its upper crossover| · |high pass of its
+  lower one|, Linkwitz-Riley shapes (−6 dB at the crossover, 1 / (1 + x^{2n})); Pro-MB's 6 dB/oct slope follows a
+  different law (LYNX has no 6 dB/oct slope).
+- At rest (level 0, no gain change) the output is the input exactly (round 144b).
+
+LYNX (`core/MinPhaseBand.h`, used by `prism::Multiband` in src/core/DynamicsSuite.cpp) [model, textbook]:
+each working band runs F = S², |S|² = |F|, built by closed-form spectral factorisation on the bilinear transform's
+prewarped axis (so the magnitudes are exactly those of LYNX's digital crossovers): S's poles are the two Butterworth
+sets of the band's crossovers, its zeros the left-half-plane roots of 1 + (g − 1)·A written as a quadratic in
+Ω^{2n} — each root gives the 2n solutions of s^{2n} = (−1)^n·u on a circle, so no general root finder is needed;
+the edge bands reduce to a Butterworth set scaled by g^{±1/2n}. The look-ahead delayed input passes the working
+bands' filters in cascade; the filters are redesigned every 8 samples from the detectors' gains (only when a gain
+moved), bands that cannot work are not run (exact transparency), the pan's / link's two gains get one filter each
+(left / right or mid / side), oversampling runs the cascade at the high rate. The editor's curve is the product of
+the bands' magnitudes. Results (tests/Parity147Tests.inc): every measured case within 0.02 dB and 0.1°, the tone
+gains −11.99 / −10.60 / −4.07 / −0.38 / 0.00 dB at 50 / 500 / 1k / 2k / 10 kHz (Pro-MB −12.0 / −10.6 / −4.1 / −0.4 /
+0.0), two bands −8.15 / −0.57 dB (Pro-MB −8.15 / −0.57).
+
+[EXEC] A compressing band on 200 Hz bursts (−6 / −30 dB, threshold −30, 4 : 1, range −12, attack / release 20 %):
+both reach −11.9 dB in the loud half; in the quiet half Pro-MB starts to recover at once (−11.3 dB after 20 ms,
+−6.9 after 100 ms) while LYNX holds about 50 ms and then recovers faster (−7.6 after 100 ms) — the detector's
+release law (round 108), not the new filters; the 3 kHz tone in the other band passes untouched in both.
+
+Compatibility: a new parameter **Dynamic engine** (appended; new instances and translated Pro-MB states = measured).
+A project saved before round 147 has a shorter parameter list: `upgradeLoadedEffectParams()` (core/Effects.h, called
+by engine/ProjectFile.cpp) sets the classic engine for it, so old projects sound the same. The editor's bottom bar
+shows **Classic dynamic** for such a slot; one click switches it to the measured engine.
+
+## 2. Prism Multiband: the expert panel (side-chain filtering, stereo link)
+
+[EXEC] Pro-MB applies its expert settings only while its Expert Mode is on (with it off, the measurements and the
+saved states' link / filter values are ignored). Saved state per band (base 22b): 15 side-chain filtering (0 band, 1
+free), 16 / 17 low / high (log2 Hz), 18 side-chain input, 19 stereo link (the parameter's own value), 20 link mode;
+slot 142 = Expert mode.
+
+Stereo link, one band over the whole spectrum, threshold −30 dB, 4 : 1, range −30, knee 0; 200 Hz at −6 dB left /
+−36 dB right (and a mostly-side signal):
+
+| Link | Pro-MB | LYNX |
+|---|---|---|
+| 0 % | L −17.74, R 0.00 | L −17.87, R 0.00 |
+| 50 % | L −17.74, R −13.47 | L −17.87, R −13.56 |
+| 100 % | both −17.74 | both −17.87 |
+| 100 %, 50 % mid-only | M −15.95, S −4.74 | M −16.06, S −4.98 |
+| 100 %, 100 % mid-only | M −13.47, S 0.00 | M −13.56, S 0.00 |
+| 100 %, 100 % side-only | M 0.00, S −13.06 | M 0.00, S −13.15 |
+
+Laws read from it [EXEC → model]: up to 100 % each channel's detector hears (1 − k)·|own| + k·max(|L|, |R|)
+(linear amplitude); above 100 % the mid's (side's) detector moves from the louder channel to the mid (side) itself
+and the other part's gain from the linked gain to unity; the gains then act on mid and side. (LYNX's 0.13 dB
+deeper reduction is its existing ratio / detector law, round 108.)
+
+Free side-chain filter (threshold −60, 2 : 1: the detector level of a −20 dB probe read from its gain): 4th-order
+sides, −23 … −24 dB one octave outside; 2 – 6 kHz: +0.8 dB inside, −1.9 / −2.3 dB at the edges; 1 – 8 kHz flat;
+narrow ranges boost: +5.7 dB at the centre of one octave, +10.6 for 2 – 3 kHz, +13.7 for 2 – 2.5 kHz. LYNX: a
+4th-order high pass and low pass, each section's Q 1.25 × Butterworth (the fit: 0.4 – 0.6 dB rms for one octave and
+wider; 2 – 4 kHz probe: −22.6 / +2.1 / +4.4 / −25.2 dB at 1k / 2k / 3k / 8k, Pro-MB −22.4 / +2.1 / +5.5 / −23.5).
+
+LYNX (appended, defaults = the old detector): per band **link** (the reference's value law), **link mode** (mid /
+side), **SC filter** (band / free), **SC low / high** (30 Hz – 30 kHz, 30 · 1000^v). Editor: **Expert >>** in the band
+panel opens its right part (Side chain: Band | Free, Low, High; Stereo link: Link, Mid | Side). Pro-MB states:
+translated when their Expert mode is on (an external side-chain input on any band turns LYNX's side-chain switch to
+external). Tests: tests/Parity147Tests.inc.
+
+### Per-crossover slopes
+
+Pro-MB gives every band its own low / high slope. LYNX's bands share their crossovers, so each crossover got its
+own slope (appended `Crossover 1 … 5 slope`: Global = the old Slope, 12, 24, 48 dB/oct), shown as the band's **Low
+slope / High slope** in the expert part of the band panel; Pro-MB states set each crossover from the band below's
+high slope (or the band above's low slope next to a gap). All processing modes follow it (the split, the
+all-pass copies, the FIR kernels, the editor's curve). The measured Dynamic phase with different orders on a band's
+two sides has no quadratic shortcut: its zeros come from P (z) = 1 + g·z^nl + ρ·z^nh + ρ·z^(nl+nh), z = (Ω / Ω_l)²,
+degree ≤ 8, by Aberth's iteration started on the two circles the edge factors give (checked on 1 500 cases: the
+designed magnitude equals 1 + (g − 1)·A within 1e-8 dB, all stable).
+
+## 3. Hush De-esser: DeEsser's Energy Detector meter
+
+DeEsser (Waves, demo here: its window as a user sees it, round 129) shows the side-chain energy beside its threshold
+slider, so a user sees how far the sibilance is above the threshold. Hush's IN meter showed the input peak. Now a
+blue bar inside the IN meter shows the detector's level against the same scale as the threshold arrow (the
+modern engine: the detector envelope; the classic one, round 123's measured DeEsser model: its RMS energy moved into
+the threshold dial's units, so reduction starts where the bar crosses the arrow). Engine: `Meters::setDetector`
+(second meter slot, unused by Hush before). Test: a 9 kHz tone at −6 / −26 dB reads −6.8 / −26.8 dB, a 200 Hz tone
+−54 dB.
+
+## 4. Measured, not implemented
+
+- [EXEC] PanMan 5.5.5 (Tweak page through its host parameters RateMod ±3, OffsetMod ±180°, WidthMod ±180°): with
+  a 1 kHz tone switching between −40 and −6 dB every 2 s (Rate 1 Hz, Width 180°), the loud halves are modulated and
+  the quiet ones are not: WidthMod −180 → width 0 (no motion), +180 → still full; OffsetMod +90 → the pan centre
+  moves to +0.65 (from centre to right); RateMod +3 → about 8 Hz (3 octaves up), −3 → about 1/8 Hz. So the Tweak
+  modulation follows an input envelope whose threshold / sensitivity live in PanMan's editor, not in host
+  parameters; a level sweep (−60 … 0 dB at Rate 0.01 Hz) did not give a clean law (`D:\lynx-work\parity147\pm\`).
+  ManualTrigger could not be observed through `process` (each run starts from the plug-in's reset). Auto-pan's
+  Tweak row stays ❌.
+- [EXEC] CLA-2A Stereo (Waves, demo) loads in the host from round 127's shell cache, but its VST3 parameter list
+  holds only the shell's generic controls (bypass, meter display, MIDI CC): ANALOG 50 / 60 Hz cannot be set black-box
+  without its window, so Glow's ANALOG row stays ❌.
+
+## 5. Sub-rounds
+
+- 147a (`REA_rodada147a.md`): Echoform ← EchoBoy / PrimalTap — the 31 factory styles measured (first-echo and
+  repeat tone, saturation curve, wobble, diffusion) and given as LYNX-named voicings; a saturation-type menu;
+  PrimalTap's Multiply (the delay ×1 … ×8, the band a brick wall near 12.4 kHz / factor).
+- 147b (`REA_rodada147b.md`): Ember ← Saturn 2 channel mode M/S, drive pan and band pan (measured); LYNX Tune ←
+  Waves Tune Real-Time keyboard (modes, note status, range, octaves, latch); Ridge ← SSL E-Channel ANALOG (white noise
+  at −110.7 dBFS RMS per channel, uncorrelated) and auto make-up.
+
+## Where I stopped
+
+- Prism: slopes only 12 / 24 / 48 (Pro-MB: 6 – 48 continuous), free band placement with gaps, one side-chain input
+  per band, the free side-chain filter's extra boost below one octave, the detector's release shape (§1).
+- Echoform (147a): the chorus / "fat" styles' several voices, Style Edit per voicing, Dual / Ping-Pong per style,
+  PrimalTap's per-tap VCO.
+- Ember (147b): Saturn's global input / output pan, six bands, 28 styles, modulation, linear phase. LYNX Tune: Group
+  Octaves off, Send / Receive, the MIDI reference tone. Ridge: Split / EQ-to-side-chain semantics.
+- Auto-pan ← PanMan Tweak and Glow ← CLA-2A ANALOG: measured / tried only (§4).
+

+ 97 - 0
docs/analise/REA_rodada147a.md

@@ -0,0 +1,97 @@
+# REA round 147a (parity147a): Echoform ← EchoBoy's styles and saturation, PrimalTap's Multiply
+
+2026-10-24. Sub-round of parity147 (docs/PARITY.md "Echoform ← EchoBoy / PrimalTap": left after round 144 were the
+saturation types, the ~30 style voicings and PrimalTap's Multiply). Evidence markers: [EXEC] measured here on the
+official Soundtoys trials (EchoBoy 5.5.5, PrimalTap 5.5.5), hosted black-box in `tools/fxmeasure` (public VST3
+parameters, value texts, audio in / out); [model] LYNX's own choice. Nothing was decompiled, no graphics, presets or
+names copied: the voicings carry LYNX's own names. Raw data and tables: `D:\lynx-work\parity147\a\` (scripts
+m1 … m8 / p1 … p2, renders v*/lp*/st*/pt*, analyses an3.txt, an7.txt, fitsat2.txt, fitcomp.txt, wob.txt,
+fittone.txt, pt.txt; the fitting scripts in tmp/parity147/py).
+
+## 0. Host notes [EXEC]
+
+- EchoBoy's `Style` host parameter has 32 steps: 31 factory styles and "Edited Style"; `Saturation` reads 0 … 24 dB.
+- A style change takes effect only after the plug-in has processed some audio with the new value: a render made right
+  after a style change (even after a 1 s silent settle and 1.5 s of message pumping) is silent. Every measurement
+  therefore runs two short dummy renders after the style is set, then sets Saturation again.
+- In Single mode both sides are echoed with the Tweak L/R offset: left T − 3.83 ms, right T + 4.17 ms (all styles).
+- Mix 100 % at Saturation ≈ 0 gives −2.8 dB on the digital style (the level is part of every style's tone below).
+- No style adds hiss: the silent stretch after the signals is digital silence in all 31 (the diffused / verbed
+  styles only ring out).
+
+## 1. What was measured per style [EXEC]
+
+Single, 250 ms (400 ms for the loop runs), feedback 0, mix 100 %, Saturation 0.25 / 6 / 12 / 18 / 24 dB:
+- **tone**: 200 ms white-noise bursts (−30 dBFS rms) with feedback 0.5 (shown 0.50, loop gain −6.02 dB): repeat 1 =
+  output tone × loop tone, repeat 2 / repeat 1 = feedback × loop tone, 28 third-octave bands (an7.txt). Most styles
+  put their colour on the first echo only (telephone: repeat 1 −14.7 dB at 100–200 Hz, repeat 2 / 1 only −5.5 dB);
+  a few colour every pass (multi-head tape −21 dB at 16 kHz per pass, valve tape and the "honky" style a −8 / −12 dB
+  low cut per pass);
+- **saturation**: a 1 kHz sine at −40 / −30 / −20 / −12 / −6 / 0 dBFS (0.5 s each): the echo's fundamental gain, 2nd
+  and 3rd harmonic (an3.txt). Two families: shapers (tape, BBD, radio-receiver, distorted styles: h3 up to −12 dB at
+  0 dBFS) and compressors (cheap tape, the drum, FM, shortwave, transmitter, analog chorus, vibrato, limited,
+  "queeked", splattered: the output level flattens while harmonics stay below −45 dB); a −30 → 0 dBFS step shows the
+  compressors' attack (settled in 10–20 ms) and release (≈ 100–200 ms back to the low-level gain, st*.wav);
+- **wobble**: a 6 s steady 1 kHz tone, the echo's instantaneous frequency (cents rms, its main rate, how peaked the
+  spectrum is, the left / right correlation) (wob.txt). E.g. vibrato 16.7 c rms at 5.5 Hz, multi-head tape 12.3 c at
+  5.7 Hz (random-like), the BBD pedal 5.8 c at 0.85 Hz (sine), digital and studio tape 0;
+- **spread**: the share of the impulse's energy within 6 ms of its peak (diffused 0.18, verbed 0.17, haze 0.45 …).
+
+## 2. LYNX (src/core/EchoSuite.{h,cpp} `echoform::`, data src/core/EchoVoicings.inc)
+
+Three parameters appended after round 144's `loopTreble` (Echoform: 105 parameters; defaults = the old sound):
+
+| Parameter | Values | Law |
+|---|---|---|
+| Echo voicing | Off, then 31 voicings (Mastering reel, Studio reel, Cartridge echo, Multi-head tape, Valve tape, Worn cassette, Pedal BBD, Compact BBD, Oil drum, Magnetic drum, Phone line, Medium wave, Broadcast FM, Distant station, Walkie-talkie, Pristine digital, Warm analog, Digital / Analog / Pedal ensemble, Seasick, Hot glow, Thick, Battered, Squashed, Fuzzed, Honky, Haze, Smeared, Scattered, Roomy) | voicing k = EchoBoy's factory style k − 1 (`voicingForEchoBoyStyle`). Replaces the Mode menu's character: write path = saturation → loop tone, read path = output tone; the voicing's wobble and diffusion; every other control (styles, feedback, rhythm, cuts, loop EQ, ducking …) keeps working |
+| Saturation type | Auto, Clean, Tape, Tube, Squash, Grit, Ceiling | Auto = the voicing's own curve (or the mode's shaper); the others = the measured curves of the digital, studio tape, valve tape, FM radio, distorted and limited styles, also without a voicing (in place of the mode's shaper) |
+| Multiply | 1x, 2x, 4x, 8x | PrimalTap's law (§3) |
+
+Models [model, fitted to the §1 data]:
+- tones: RBJ biquads — output: gain, 0–2 high passes, 0–4 low passes, 3 bells; loop: a low shelf, a bell, 0–2 low
+  passes (fittone.txt: output ≤ 0.3 dB rms for 24 of 31 styles, the worst 1.6 dB; loop ≤ 0.5 dB);
+- shaper: y = G · (f (d·x + b) − f (b)) / (f′(b) · d), f (u) = u / (1 + |u|^p)^(1/p), p and b per voicing, d and G per
+  Saturation step (0 / 6 / 12 / 18 / 24 dB), linear in dB in between (fitsat2.txt: gain within 0.0–1.5 dB rms);
+- compressor (the dynamic styles): a peak detector (attack 4 ms, release 120 ms), a 6 dB soft knee, ratio per voicing,
+  threshold and make-up per Saturation step (fitcomp.txt: ≤ 0.6 dB rms);
+- wobble: a delay swing of √2 · c / (1731 · 2π f) s (sine) or a smooth random swing at the measured depth / rate,
+  the right side in step, 90° or 180° from the left as measured;
+- diffusion: Echoform's diffusion at (1 − the measured peak share) / 0.85 (at least the user's amount).
+
+**Check, LYNX against the trial** (the same signals rendered through Echoform with each voicing, `cmp2.txt`): first-echo
+tone 0.05–2.8 dB rms over 60 Hz – 14 kHz (median 0.7), per-pass loop tone median 0.6 dB (worst 3.9 dB, the oil-drum
+voicing's top octave), steady-sine gain over −40 … 0 dBFS at Saturation 0 / 12 / 24 median 0.6 dB rms (worst 2.0),
+wobble depth within 0.2 cents of the measured one (the random wobbles calibrated once against the trial: the smooth
+random LFO's pitch / rms relation differs from the sine's), the 3rd harmonic only within ≈ 10 dB (median; the
+shaper reproduces the level curve, not every harmonic). The loop tones are fitted with low-pass Q ≤ 0.9 and at most
++0.5 dB anywhere up to 22 kHz, so no voicing's loop can ring above the measured band.
+
+The EchoBoy stand-in: her saved states keep round 136's fitted tape voicings (recognised by hash); any other EchoBoy
+state now plays the Studio reel voicing (EchoBoy's default style). LYNX does not decode EchoBoy's encoded preset, so a
+foreign state's style is not read (the mapping table `voicingForEchoBoyStyle` is ready for when it is known).
+
+## 3. PrimalTap's Multiply [EXEC]
+
+`Multiply` host parameter: 1x / 2x / 4x / 8x (4 steps). With Time A / B 100 / 500 / 1000 / 2000 ms (feedback 0, mix 100
+%): the delay is exactly Time × factor (2x at 1000 ms = 1999.94 ms); the band falls with the factor — 1x −6.4 dB at
+12 kHz / −55 dB at 16 kHz, 2x −2.2 dB at 6 kHz / −49 dB at 8 kHz, 4x −1.4 dB at 3 kHz / −45 dB at 4 kHz, 8x −0.9 dB at
+1 kHz / −43 dB at 2 kHz (pt.txt) — a brick wall at ≈ 12.4 kHz / factor; image / alias products of a 1 kHz tone stay
+50–56 dB down. 8 s total works (1000 ms × 8), 16 s (2000 ms × 8) gives silence. LYNX: the times × factor (up to the
+line's 20 s) and two 8th-order Butterworth low-passes at 12.4 kHz / factor inside the loop. PrimalTap states are not
+translated (no state data from her projects).
+
+## 4. Tests
+
+tests/Parity147aTests.inc: parameter block and texts; the voicings' tones against the measured first-echo tone (five
+styles × 125 Hz / 1 kHz / 4 kHz); the saturation curves (studio tape at 24 dB, the FM and limited compressors) as
+functions and through the engine; the vibrato voicing's wobble (cents rms of an echoed tone) and the digital one's
+steadiness; Multiply's delays and band; a saturation type without a voicing; the EchoBoy stand-in's default voicing.
+
+## Where I stopped
+
+- Done: §2, §3, PARITY rows (Echo Style menu, Saturation, saturation type, Multiply) and the score note. Editor: Voicing / Sat. menus and the Mult. tabs in the Style edit row (`D:\lynx-work\parity147\a\ui\Echoform.png`). build-local with the FL Data dir: 1 645 927 checks, 0 failures; Windows build OK.
+- Not done: the chorus / "fat" styles' several modulated voices (LYNX: one wobble per side; the measured tone and
+  level match, the comb-like movement of two voices does not); EchoBoy's Style Edit details per voicing (per-repeat
+  decay, Mid Res) and its own saturation-type menu (editor only, not a host parameter); the styles' behaviour in
+  Dual / Ping-Pong (measured in Single only); PrimalTap's per-tap VCO and its 1x anti-alias band (Echoform stays full
+  band at 1x, as before).

+ 119 - 0
docs/analise/REA_rodada147b.md

@@ -0,0 +1,119 @@
+# REA round 147b (parity147b): Ember's mid / side and pans, LYNX Tune's keyboard, Ridge
+
+2026-10-24. Sub-round of parity147 (docs/PARITY.md, tier 3): Ember Saturator ← Saturn 2's channel mode M/S, drive
+pan and band pan; LYNX Tune ← Waves Tune Real-Time's keyboard (note statuses, range, navigation); Ridge Strip ← SSL
+E-Channel's auto make-up and ANALOG. Evidence markers: [EXEC] measured here on the official trial, hosted black-box in
+our measurement host (`tools/fxmeasure`: public VST3 parameters, value texts, audio in / out, the component state as a
+DAW stores it); [MANUAL] vendor manual / spec dossier; [model] LYNX's own choice. Nothing was decompiled; no graphics,
+presets or names were copied. Raw data: `D:\lynx-work\parity147\b\` (params.txt = Saturn 2's parameter list, m1.txt /
+m1.log / o_*.wav = the runs, s2_*.bin = saved states).
+
+## 1. Ember Saturator: Saturn 2's channel mode, drive pan, band pan
+
+### What the trial does [EXEC]
+
+Host parameters (Saturn 2, 1089 parameters): `Channel Mode` (index 695, Left/Right | Mid/Side), per band `Drive Pan`
+(−1 … +1, band field 5) and `Pan` (band field 12, value texts "Left: 0 dB / Right: −6.02 dB" at −0.5), global Input /
+Output Pan. Saved state (FFBS, 951 values): the channel mode at 695, drive pan at 7 + 17b + 5, band pan at 7 + 17b + 12
+(−1 … +1); the parameter indices and the state slots coincide (s2_def / s2_ms / s2_dp.bin differ only there).
+
+One band, Warm Tube, drive 50 %, a 1 kHz sine at −12 dBFS (harmonics H2 / H3 / H5 per channel, `harm.py`):
+
+| Run | Result |
+|---|---|
+| L/R, drive pan −1 | left = the centred result (H2 −32.6, H3 −44.0 dB); right = exactly the drive-0 % run (−43.7 / −59.3 / −115.8) |
+| L/R, drive pan −0.5 | right between the 20 % and 30 % runs: the 25 % run, i.e. **the far channel's drive × (1 − \|pan\|)** on the 0–100 % scale |
+| M/S, L = R (pure mid) | identical to L/R (to the last digit): M = (L + R) / 2, decoded L = M ± S (no √2 scaling) |
+| M/S, drive pan −1 / +1 | the mid / the side keeps the full drive (−1 = mid, +1 = side) |
+| M/S, left-only tone, centred | L keeps only odd products, R only even ones: the side is (R − L) / 2 (a left-only tone gives S = −M) |
+| band pan, L/R | the far channel × (1 − \|pan\|) (pan +1: left silent) |
+| band pan, M/S | the same law on mid / side (pan −1: the side silent, +1: the mid silent) |
+
+### LYNX (src/core/MixSuite.{h,cpp} `ember::`, editor `EmberEditor` in src/ui/ProEditors.cpp)
+
+Appended after the Classic voicing (round 136): `Channel mode` (0 L/R, 1 M/S), `B1 … B4 drive pan`, `B1 … B4 pan`
+(Ember: 92 parameters). Defaults = the old sound (centred, L/R).
+
+- M/S: the whole engine runs on M = (L + R) / 2 (channel 0) and S = (R − L) / 2 (channel 1), decoded L = M − S,
+  R = M + S (the trial's sign).
+- Drive pan: channel 0 / 1's drive (dB, Ember's 0–36 dB = Saturn's % × 30 dB in the translation) × (1 − |pan|) on the
+  far side; with Auto gain each channel gets its own make-up.
+- Band pan: the band's output gains (1 − |pan| on the far side), single-band and multiband.
+- Editor: DRIVE PAN beside the drive knob, PAN under LEVEL in the band panel, "Channel L/R | M/S" in the bottom bar;
+  splitting / removing a band carries its pans. The generic layout has a "Stereo" section.
+- Saturn 2 states: the channel mode and every band's drive pan / pan translated.
+- Tests: tests/Parity147bTests.inc (laws, M/S identity for a mid signal, side removal with pan, multiband pan,
+  translation).
+
+## 2. LYNX Tune: the Waves Tune Real-Time role's keyboard
+
+[MANUAL] (docs/specs/waves-tune-real-time.md, the v16 guide): a multi-octave keyboard with per-note statuses (Legal,
+Illegal, Illegal-Pitch-Up, Illegal-Pitch-Down, Bypass; a click cycles), the range (boundary handles + presets Bass,
+Baritone, Tenor, Alto, Mezzo Soprano, Soprano, Generic; notes outside → bypassed), Group Octaves, Reset Scale,
+Send / Receive, view buttons (− / + and ◀ / ▶ under the keys, `parity129/ref/wtune.png`). [EXEC] the keyboard's statuses
+and range are not host parameters of the trial (§3), so they were not measured.
+
+LYNX (src/core/LynxTune.{h,cpp}, the `tunekeys` display in src/ui/PluginEditors.cpp; appended after `outputTrim`):
+
+| Parameter | Values | Law |
+|---|---|---|
+| C … B dir | Nearest / Up / Down (default Nearest) | an illegal note's direction: a sung pitch nearest to it goes to the next legal note up / down (`targetNote`), after the tolerance hysteresis |
+| Range low / high | MIDI notes 0 … 127 (default 0 / 127) | sung notes outside pass uncorrected (like a bypassed note) |
+
+Editor: the keyboard strip holds BYPASS / REMOVE, RESET SCALE, the seven range presets, − / + (2–7 octaves shown) and
+◀ / ▶ (scroll), LATCH; a range bar over the keys (lit between the boundaries; click / drag moves the nearer one); keys
+outside the range are dimmed; REMOVE cycles legal → illegal (cross) → illegal up (▲) → illegal down (▼) → legal; the
+octave names follow MIDI (C4 = 60). Range presets [model]: the classical voice ranges widened by a third (Bass C2–G#4,
+Baritone F2–C#5, Tenor G#2–E5, Alto C#3–A5, Mezzo F3–C#6, Soprano G#3–E6, Generic = everything); a preset also picks
+the detector's input type (low male / alto-tenor / soprano). Group Octaves stays on (per-octave statuses would need
+128 per-key values), Send / Receive not done. Tests: the direction law, the range bypass on a 450 Hz tone
+(corrected to 440 Hz in range, 450 Hz outside), the defaults.
+
+## 3. Ridge Strip: auto make-up and ANALOG
+
+Round 145 (vox145) landed first; Ridge's new parameters follow its Vocal-strip block: `Auto make-up`, `Analog`
+(defaults off = the old sound).
+
+[EXEC] SSL E-Channel trial (Waves, demo mode; the shell needs ~10 min to describe its 714 plug-ins the first time —
+round 144's "hang" — then loads from fxmeasure-cache.xml; loading DeEsser Mono first makes the shell give the
+requested plug-in, as in round 113). Host parameters: `Analog` (index 1, Off / On), `Gain`, `InputLevel`,
+`CompThresh`, `CompRatio` … (164 parameters). Silence, a 1 kHz / −20 dBFS and a 100 Hz / −6 dBFS sine, Analog off and
+on (blocks muted by the demo are masked out):
+
+| | Analog off | Analog on |
+|---|---|---|
+| silence | digital zero | white noise, −110.7 dBFS RMS per channel (≈ −154.5 dB/Hz from 20 Hz to 20 kHz), L / R correlation −0.001 |
+| 1 kHz / −20 dBFS: H2 / H3 | −134.1 / −122.1 dB | −134.0 / −121.6 dB |
+| 100 Hz / −6 dBFS: H2 / H3 | −106.1 / −80.0 dB | −106.1 / −80.1 dB |
+| output fader −12 dB / input −12 dB / compressor 4:1 at −20 | — | the noise stays at −110.9 / −110.8 / −110.2 dBFS |
+
+So ANALOG is the console emulation's noise floor, added at the very output. LYNX: Gaussian (Irwin–Hall) white noise
+at that level, one generator per channel, in both of Ridge's own voicings (classic and E console); translated from
+E-Channel states (RealWorld 31).
+
+Auto make-up: the reference's compressor always gives back level for its threshold and ratio; round 123 measured that
+law (`VoiceMatchDynamics.inc`, the E voicing has it). "Auto make-up" applies it to Ridge's own compressor
+(`ridge::autoMakeupDb`: the console's make-up for threshold dBFS + 18 on its dBu scale and the same ratio; 0 at 1:1 or
+with the dynamics off). Editor: "Auto make-up" in the Compressor section, "Analog" in the Dynamics section.
+
+WTRT note: Waves Tune Real-Time's host parameters (143) were listed this way too — Speed, Note Transition, Link,
+Correction (+ on / off), Reference, Tolerance time / cents, Vibrato depth / on, Scale type (44), Scale root (17); the
+keyboard statuses and the range are not host parameters (editor state only), so the range presets stay [model].
+
+## Scores (docs/PARITY.md)
+
+| LYNX engine | Original | Config | Design |
+|---|---|---|---|
+| Ember Saturator | Saturn 2 | 6 → 7 | 7 → 7 |
+| LYNX Tune | Waves Tune Real-Time | 8 → 9 | 6 → 7 |
+| Ridge Strip | SSL E-Channel | 7 → 8 | 7 → 7 |
+
+## Where I stopped
+
+- Ember: Saturn's global Input / Output pan (measured value texts, not implemented), 6 bands, 28 styles, modulation,
+  linear phase.
+- LYNX Tune: Group Octaves off (per-octave statuses), Send / Receive between instances, MIDI reference tone; the
+  range presets' spans are LYNX's own (the trial keeps them in its editor state, not in host parameters).
+- Ridge: Split / Dyn S.C. semantics, the threshold's units / direction in the classic engine (unchanged).
+- Waves in our host: the first load of the shell takes ~10 min (it describes all 714 plug-ins; cached afterwards in
+  the data folder's fxmeasure-cache.xml); load DeEsser Mono first to get the requested plug-in.

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

@@ -4021,6 +4021,47 @@ countries: br
 "Links (this project, then global)" = "Vínculos (deste projeto, depois os globais)"
 "global" = "global"
 "Pattern events" = "Eventos do pattern"
+
+# round 147 (parity147): Prism Multiband's measured Dynamic phase
+"Classic dynamic" = "Dinâmica clássica"
+"This project's Dynamic phase runs the engine it was saved with (before round 147). Click to use the measured one (Pro-MB's response)." = "A fase dinâmica deste projeto usa o motor com que foi salvo (antes da rodada 147). Clique para usar o medido (a resposta do Pro-MB)."
+"Expert >>" = "Avançado >>"
+"Expert <<" = "Avançado <<"
+"Show the band's expert settings: side-chain filtering (band or a free range) and the stereo link" = "Mostra os ajustes avançados da banda: filtro do side chain (a banda ou uma faixa livre) e o link estéreo"
+"Band|Free" = "Banda|Livre"
+"SC low" = "SC grave"
+"SC high" = "SC agudo"
+"Expert (selected band)" = "Avançado (banda selecionada)"
+"Classic|Measured" = "Clássico|Medido"
+"Echo voicing" = "Voz do eco"
+"Saturation type" = "Tipo de saturação"
+"Sat." = "Sat."
+"Mult." = "Mult."
+"1x|2x|4x|8x" = "1x|2x|4x|8x"
+"Off|Mastering reel|Studio reel|Cartridge echo|Multi-head tape|Valve tape|Worn cassette|Pedal BBD|Compact BBD|Oil drum|Magnetic drum|Phone line|Medium wave|Broadcast FM|Distant station|Walkie-talkie|Pristine digital|Warm analog|Digital ensemble|Analog ensemble|Pedal ensemble|Seasick|Hot glow|Thick|Battered|Squashed|Fuzzed|Honky|Haze|Smeared|Scattered|Roomy" = "Desligado|Rolo de masterização|Rolo de estúdio|Eco de cartucho|Fita multicabeça|Fita valvulada|Cassete gasto|BBD de pedal|BBD compacto|Tambor de óleo|Tambor magnético|Linha telefônica|Onda média|FM de rádio|Estação distante|Walkie-talkie|Digital puro|Analógico quente|Conjunto digital|Conjunto analógico|Conjunto de pedal|Mareado|Brilho quente|Encorpado|Surrado|Esmagado|Fuzz|Fanhoso|Névoa|Borrado|Espalhado|Ambiente"
+"Auto|Clean|Tape|Tube|Squash|Grit|Ceiling" = "Auto|Limpa|Fita|Válvula|Esmagada|Sujeira|Teto"
+"Drive pan" = "Pan do drive"
+"L/R|M/S" = "L/R|M/S"
+"Baritone" = "Barítono"
+"Tenor" = "Tenor"
+"Alto" = "Contralto"
+"Mezzo" = "Mezzo"
+"Soprano" = "Soprano"
+"Generic" = "Genérico"
+"Reset scale" = "Reiniciar escala"
+"Bypass mode: a key switches its note between corrected and passed as sung" = "Modo Bypass: uma tecla alterna a nota entre corrigida e passada como cantada"
+"Remove mode: a key cycles its note: legal, illegal (to the nearest note), illegal pitch up, illegal pitch down" = "Modo Remover: uma tecla percorre os estados da nota: válida, inválida (para a nota mais próxima), inválida para cima, inválida para baixo"
+"Reset scale: every note of the scale legal again, nothing bypassed" = "Reiniciar escala: todas as notas da escala válidas de novo, nada em bypass"
+"Range preset: notes sung outside the range pass uncorrected (Generic: the whole keyboard)" = "Predefinição de extensão: notas cantadas fora da extensão passam sem correção (Genérico: o teclado inteiro)"
+"Keyboard view: show more / fewer octaves" = "Vista do teclado: mostrar mais / menos oitavas"
+"Keyboard view: scroll down / up an octave" = "Vista do teclado: rolar uma oitava para baixo / para cima"
+"Latch: off = a key's edit lasts only while it is held" = "Trava: desligada = a edição de uma tecla dura só enquanto ela é segurada"
+"Range: drag a boundary; notes sung outside it pass uncorrected" = "Extensão: arraste um limite; notas cantadas fora dela passam sem correção"
+"Click a key: change that note's status in every octave" = "Clique numa tecla: muda o estado dessa nota em todas as oitavas"
+"Click a key: bypass / correct that note in every octave" = "Clique numa tecla: bypass / corrigir essa nota em todas as oitavas"
+"Initialized controls" = "Controles inicializados"
+"Initialized controls: to be reset when the song starts (a control's menu > Init song with this position)" = "Controles inicializados: voltam a este valor quando a música começa (menu de um controle > Iniciar a música com esta posição)"
+"reset to this value when the song starts  [RMB] delete the initial value" = "volta a este valor quando a música começa  [RMB] apagar o valor inicial"
 # --- Round 145: Ridge Strip's Vocal strip voicing
 "Compander" = "Compander"
 "Make-up" = "Ganho de compensação"
@@ -4054,3 +4095,12 @@ countries: br
 "A gradual start of the compression around the threshold" = "Início gradual da compressão em torno do limiar"
 "Soft clipping after the make-up gain: warmer, louder; stronger with more make-up" = "Saturação suave depois do ganho de compensação: mais quente e mais alto; mais forte com mais compensação"
 "Expander" = "Expansor"
+"Low slope" = "Inclinação grave"
+"High slope" = "Inclinação aguda"
+"Slope 1" = "Inclinação 1"
+"Slope 2" = "Inclinação 2"
+"Slope 3" = "Inclinação 3"
+"Slope 4" = "Inclinação 4"
+"Slope 5" = "Inclinação 5"
+"Auto make-up" = "Make-up automático"
+"Analog" = "Analógico"

+ 331 - 28
src/core/DynamicsSuite.cpp

@@ -11,6 +11,7 @@
 #include "core/Effects.h"
 #include "core/FacetEq.h"
 #include "core/LrCrossover.h"
+#include "core/MinPhaseBand.h"
 #include "core/MixSuite.h"
 #include "core/ParametricEqLinear.h"
 
@@ -917,6 +918,18 @@ Phase phaseOf (float v) noexcept
     const auto k = pick (v, 3);
     return k == 0 ? Phase::linear : (k == 1 ? Phase::dynamic : Phase::minimum);
 }
+bool measuredDynamic (const EffectParams& p) noexcept { return on (p[dynamicEngine]); }
+double linkAmount (float v) noexcept { return std::clamp (2.0 * (double) v, 0.0, 1.0); }
+double linkOnly (float v) noexcept { return std::clamp (2.0 * (double) v - 1.0, 0.0, 1.0); }
+double scFilterHz (float v) noexcept { return 30.0 * std::pow (1000.0, (double) std::clamp (v, 0.0f, 1.0f)); }
+int crossoverSlopeDbOct (const EffectParams& p, int k) noexcept
+{
+    static constexpr int own[4] { 0, 12, 24, 48 };
+    const auto s = own[pick (p[(std::size_t) (xoverSlope0 + std::clamp (k, 0, bands - 2))], 4)];
+    return s > 0 ? s : slopeDbOct (p[Global::slope]);
+}
+float crossoverSlopeValue (int dbOct) noexcept { return dbOct <= 0 ? 0.0f : (dbOct <= 12 ? 1.0f / 3.0f : (dbOct <= 24 ? 2.0f / 3.0f : 1.0f)); }
+float scFilterValue (double hz) noexcept { return (float) std::clamp (std::log (std::max (hz, 1.0) / 30.0) / std::log (1000.0), 0.0, 1.0); }
 int oversamplingOf (float v) noexcept { return 1 << pick (v, 3); }
 int linearFftSize (double sampleRate) noexcept
 {
@@ -982,7 +995,6 @@ double bandStaticDb (const EffectParams& p, int b, double inputDb)
 double responseDb (const EffectParams& p, const double* bandGainDb, double sampleRate, double hz)
 {
     const auto f = crossovers (p);
-    const auto slope = slopeDbOct (p[Global::slope]);
     const auto nb = bandCount (p);
     const auto w = 2.0 * pi * hz / sampleRate;
     // bands of the tree: B0 = L1, B1 = H1·L2, B2 = H1·H2·L3, …, the last = H1·…·H(n−1); out = x + Σ (g − 1)·Bk
@@ -991,7 +1003,7 @@ double responseDb (const EffectParams& p, const double* bandGainDb, double sampl
     for (int k = 0; k < nb - 1; ++k)
     {
         Split s;
-        s.design (sampleRate, f[(std::size_t) k], slope);
+        s.design (sampleRate, f[(std::size_t) k], crossoverSlopeDbOct (p, k));
         band[(std::size_t) k] = rest * s.response (false, w);
         rest *= s.response (true, w);
     }
@@ -1007,12 +1019,26 @@ double responseDb (const EffectParams& p, const double* bandGainDb, double sampl
             for (int j = k + 1; j < nb - 1; ++j)
             {
                 Split s;
-                s.design (sampleRate, f[(std::size_t) j], slope);
+                s.design (sampleRate, f[(std::size_t) j], crossoverSlopeDbOct (p, j));
                 band[(std::size_t) k] *= s.response (false, w) + s.response (true, w);
             }
     bool solo = false;
     for (int b = 0; b < nb; ++b)
         solo = solo || on (p[(std::size_t) param (b, fSolo)]);
+    if (mode == Phase::dynamic && measuredDynamic (p) && ! solo)
+    {
+        // round 147: the measured engine — the product of each band's 1 + (g − 1)·A (its own crossovers' magnitudes)
+        const auto om = minphase::warp (hz, sampleRate);
+        double m = 1.0;
+        for (int b = 0; b < nb; ++b)
+        {
+            const auto wl = b > 0 ? minphase::warp (f[(std::size_t) (b - 1)], sampleRate) : 0.0;
+            const auto wh = b < nb - 1 ? minphase::warp (f[(std::size_t) b], sampleRate) : 0.0;
+            const auto nl = b > 0 ? slopeOrder (crossoverSlopeDbOct (p, b - 1)) : 1, nh = b < nb - 1 ? slopeOrder (crossoverSlopeDbOct (p, b)) : 1;
+            m *= minphase::bandMagnitude (wl, wh, nl, nh, dbToGain (bandGainDb[b]), om);
+        }
+        return gainToDb (std::abs (m)) + trimDb (p[output]);
+    }
     std::complex<double> y = solo || mode == Phase::minimum ? std::complex<double> {} : std::complex<double> { 1.0, 0.0 };
     for (int b = 0; b < nb; ++b)
     {
@@ -1056,6 +1082,46 @@ struct LongDelay
     }
 };
 
+// round 147: Pro-MB's free side-chain filter, measured black-box (REA_rodada147 §2): a 4th-order high pass at the low
+// frequency and low pass at the high one (−24 dB one octave out), their sections' Q 1.25 × Butterworth (the fit to the
+// reference's band shapes of one octave and wider; narrower bands boost more in the reference)
+struct ScFilter
+{
+    std::array<Biquad, 4> s;
+    double lo = -1.0, hi = -1.0, rate = 0.0;
+    bool useHp = false, useLp = false;
+    void design (double sampleRate, double loHz, double hiHz) noexcept
+    {
+        if (loHz == lo && hiHz == hi && sampleRate == rate)
+            return;
+        lo = loHz;
+        hi = hiHz;
+        rate = sampleRate;
+        static constexpr double q[2] { 0.54119610 * 1.25, 1.30656296 * 1.25 };
+        useHp = loHz > 30.5;
+        useLp = hiHz < sampleRate * 0.45;
+        for (int k = 0; k < 2; ++k)
+        {
+            s[(std::size_t) k].filter (sampleRate, 1, loHz, q[k]);
+            s[(std::size_t) (2 + k)].filter (sampleRate, 0, hiHz, q[k]);
+        }
+    }
+    void reset() noexcept
+    {
+        for (auto& b : s)
+            b.reset();
+    }
+    void run (float& l, float& r) noexcept
+    {
+        for (int k = 0; k < 4; ++k)
+            if (k < 2 ? useHp : useLp)
+            {
+                l = s[(std::size_t) k].process (l, 0);
+                r = s[(std::size_t) k].process (r, 1);
+            }
+    }
+};
+
 class Multiband final : public Effect
 {
 public:
@@ -1103,13 +1169,22 @@ public:
             d.reset();
         for (auto& d : gainDelay)
             d.reset();
+        for (auto& d : gainDelayB)
+            d.reset();
+        for (auto& f2 : scFilter)
+            f2.reset();
         for (auto& c : lin)
             if (c.n > 0)
                 c.clear();
         linDry.reset();
         linSc.reset();
         resetOversamplers();
+        for (auto& row : dynBand)
+            for (auto& fl : row)
+                fl.reset();
+        dynWorks.fill (false);
         env.fill (-120.0);
+        env2.fill (-120.0);
         gains.fill (1.0f);
     }
 
@@ -1149,7 +1224,9 @@ private:
     void processChunk (float* l, float* r, const float* scl, const float* scr, int n, const EffectParams& p) noexcept
     {
         const auto f = crossovers (p);
-        const auto slope = slopeDbOct (p[Global::slope]);
+        std::array<int, bands - 1> slope {};
+        for (int k = 0; k < bands - 1; ++k)
+            slope[(std::size_t) k] = crossoverSlopeDbOct (p, k);
         const auto nb = bandCount (p);
         const auto md = (Phase) mode;
         const bool linear = md == Phase::linear, minimum = md == Phase::minimum;
@@ -1157,10 +1234,10 @@ private:
         {
             for (int k = 0; k < bands - 1; ++k)
             {
-                split[(std::size_t) k].design (sr, f[(std::size_t) k], slope);
-                scSplit[(std::size_t) k].design (sr, f[(std::size_t) k], slope);
+                split[(std::size_t) k].design (sr, f[(std::size_t) k], slope[(std::size_t) k]);
+                scSplit[(std::size_t) k].design (sr, f[(std::size_t) k], slope[(std::size_t) k]);
                 for (int j = 0; j < bands - 1; ++j)
-                    comp[(std::size_t) j][(std::size_t) k].design (sr, f[(std::size_t) k], slope);
+                    comp[(std::size_t) j][(std::size_t) k].design (sr, f[(std::size_t) k], slope[(std::size_t) k]);
             }
             lastF = f;
             lastSlope = slope;
@@ -1202,6 +1279,25 @@ private:
             // round 128: a band's own look-ahead (≤ the global one): its gain waits for the difference
             const auto bandLa = std::min (laMs, lookaheadMs (p[(std::size_t) bandLookaheadParam (b)]));
             gainDelay[(std::size_t) b].setLength (std::max (0, laSamples - (int) std::lround (bandLa * 0.001 * sr)));
+            gainDelayB[(std::size_t) b].setLength (gainDelay[(std::size_t) b].len);
+            // round 147: the stereo link and the free side-chain filter (the expert panel)
+            const auto lv = p[(std::size_t) (bandLink0 + b)];
+            linkA[(std::size_t) b] = linkAmount (lv);
+            linkM[(std::size_t) b] = linkOnly (lv);
+            linkSide[(std::size_t) b] = on (p[(std::size_t) (bandLinkMode0 + b)]);
+            fullLink[(std::size_t) b] = linkA[(std::size_t) b] >= 1.0 && linkM[(std::size_t) b] <= 0.0;
+            // the band's gains act on left / right, or on mid / side (the pan mode; a mid- / side-only link)
+            bandMs[(std::size_t) b] = linkM[(std::size_t) b] > 0.0 ? true : (linkA[(std::size_t) b] < 1.0 ? false : msPan);
+            if (bandMs[(std::size_t) b] == msPan)
+            {
+                panA[(std::size_t) b] = panL[(std::size_t) b];
+                panB[(std::size_t) b] = panR[(std::size_t) b];
+            }
+            else // the pan's two gains belong to the other pair: their mean (a rare combination)
+                panA[(std::size_t) b] = panB[(std::size_t) b] = 0.5f * (panL[(std::size_t) b] + panR[(std::size_t) b]);
+            scFree[(std::size_t) b] = on (p[(std::size_t) (bandScFree0 + b)]);
+            if (scFree[(std::size_t) b])
+                scFilter[(std::size_t) b].design (sr, scFilterHz (p[(std::size_t) (bandScLow0 + b)]), scFilterHz (p[(std::size_t) (bandScHigh0 + b)]));
         }
 
         // 1. the split, the detectors and the gains at the base rate; the dry signal, the bands and the gains are kept
@@ -1243,11 +1339,15 @@ private:
                 bl[nb - 1] = hl;
                 br[nb - 1] = hr;
             }
+            // round 147: what a free side-chain filter hears — the input (in time with the bands) or the side chain
+            float srcL = linear ? dl : xl, srcR = linear ? dr : xr;
             if (external)
             {
                 float el = scl[i] * inGain, er = scr[i] * inGain;
                 if (linear)
                     linSc.process (el, er); // the detectors stay in time with the delayed bands
+                srcL = el;
+                srcR = er;
                 for (int k = 0; k < nb - 1; ++k)
                 {
                     float nl, nr;
@@ -1265,20 +1365,58 @@ private:
             dry[1][(std::size_t) i] = dr;
             for (int b = 0; b < nb; ++b)
             {
-                float g = 1.0f;
+                float g = 1.0f, g2 = 1.0f;
                 if (enabled[(std::size_t) b])
                 {
-                    const auto m = external ? std::max (std::abs (sl0[b]), std::abs (sr0[b])) : std::max (std::abs (bl[b]), std::abs (br[b]));
-                    const auto x = std::max (-120.0, 20.0 * std::log10 ((double) m + 1e-12));
-                    auto& e = env[(std::size_t) b];
-                    e = x > e ? aA[(std::size_t) b] * e + (1.0 - aA[(std::size_t) b]) * x
-                              : aR[(std::size_t) b] * e + (1.0 - aR[(std::size_t) b]) * x;
-                    const auto gdb = bandCurve (p, b, e);
-                    if (std::abs (gdb) > std::abs (extreme[(std::size_t) b]))
-                        extreme[(std::size_t) b] = gdb;
-                    g = (float) dbToGain (gdb + level[(std::size_t) b]);
+                    // the detector's two channels: the band (split), or the free side-chain filter (round 147)
+                    float cl, cr;
+                    if (scFree[(std::size_t) b])
+                    {
+                        cl = srcL;
+                        cr = srcR;
+                        scFilter[(std::size_t) b].run (cl, cr);
+                    }
+                    else
+                    {
+                        cl = external ? sl0[b] : bl[b];
+                        cr = external ? sr0[b] : br[b];
+                    }
+                    const auto follow = [&] (double& e, double m) noexcept {
+                        const auto x = std::max (-120.0, 20.0 * std::log10 (m + 1e-12));
+                        e = x > e ? aA[(std::size_t) b] * e + (1.0 - aA[(std::size_t) b]) * x
+                                  : aR[(std::size_t) b] * e + (1.0 - aR[(std::size_t) b]) * x;
+                        const auto gdb = bandCurve (p, b, e);
+                        if (std::abs (gdb) > std::abs (extreme[(std::size_t) b]))
+                            extreme[(std::size_t) b] = gdb;
+                        return gdb;
+                    };
+                    const auto peak = (double) std::max (std::abs (cl), std::abs (cr));
+                    const auto lev = level[(std::size_t) b];
+                    if (fullLink[(std::size_t) b]) // 100 % linked: one detector on the louder channel (the old engine)
+                        g = g2 = (float) dbToGain (follow (env[(std::size_t) b], peak) + lev);
+                    else if (linkM[(std::size_t) b] <= 0.0)
+                    {
+                        // [EXEC] partly linked: each channel's detector hears its own level moved towards the louder one
+                        const auto k = linkA[(std::size_t) b];
+                        g = (float) dbToGain (follow (env[(std::size_t) b], (1.0 - k) * std::abs (cl) + k * peak) + lev);
+                        g2 = (float) dbToGain (follow (env2[(std::size_t) b], (1.0 - k) * std::abs (cr) + k * peak) + lev);
+                    }
+                    else
+                    {
+                        // [EXEC] 100 % + mid- (side-) only: the mid's (side's) detector moves from the louder channel to the mid
+                        // (side) itself, the other part's gain from the linked one to unity
+                        const auto u = linkM[(std::size_t) b];
+                        const auto one = std::abs (0.5 * ((double) cl + (linkSide[(std::size_t) b] ? -(double) cr : (double) cr)));
+                        const auto gOne = dbToGain (follow (env2[(std::size_t) b], (1.0 - u) * peak + u * one));
+                        const auto gLinked = dbToGain (follow (env[(std::size_t) b], peak));
+                        const auto gOther = (1.0 - u) * gLinked + u;
+                        const auto lg = dbToGain (lev);
+                        g = (float) ((linkSide[(std::size_t) b] ? gOther : gOne) * lg);  // mid
+                        g2 = (float) ((linkSide[(std::size_t) b] ? gOne : gOther) * lg); // side
+                    }
                 }
                 gain[(std::size_t) b][(std::size_t) i] = gainDelay[(std::size_t) b].process (g);
+                gainB[(std::size_t) b][(std::size_t) i] = gainDelayB[(std::size_t) b].process (g2);
                 float sl = bl[b], sr2 = br[b];
                 if (minimum) // round 144: the band passes the all-passes of the crossovers above it
                     for (int j = b + 1; j < nb - 1; ++j)
@@ -1292,16 +1430,132 @@ private:
             }
         }
 
+        // round 147: Dynamic phase's measured engine — the (look-ahead delayed) input through each working band's
+        // minimum-phase filter in cascade (core/MinPhaseBand.h); soloed bands are still listened to through the split
+        if (md == Phase::dynamic && measuredDynamic (p) && ! anySolo)
+        {
+            if (f != dynF || slope != dynSlope || nb != dynNb || osFactor != dynOs || bandMs != dynMs)
+            {
+                // a new crossover layout: every filter is designed again (their states are kept: no click)
+                dynF = f;
+                dynSlope = slope;
+                dynNb = nb;
+                dynOs = osFactor;
+                dynMs = bandMs;
+                for (auto& g2 : dynGain)
+                    g2.fill (-1.0);
+            }
+            std::array<bool, bands> works {};
+            for (int b = 0; b < nb; ++b)
+            {
+                const auto i0 = (std::size_t) param (b, 0);
+                const bool w = enabled[(std::size_t) b]
+                               && (std::abs (rangeDb (p[i0 + fRange])) >= 0.01 || level[(std::size_t) b] != 0.0
+                                   || panL[(std::size_t) b] != 1.0f || panR[(std::size_t) b] != 1.0f);
+                if (w && ! dynWorks[(std::size_t) b])
+                {
+                    for (auto& fl : dynBand[(std::size_t) b])
+                        fl.reset();
+                    dynGain[(std::size_t) b].fill (-1.0);
+                }
+                works[(std::size_t) b] = dynWorks[(std::size_t) b] = w;
+            }
+            for (int b = nb; b < bands; ++b)
+                dynWorks[(std::size_t) b] = false;
+            const auto run = [&] (int len, double rate, int every, const float* d0, const float* d1, auto&& gainAt, float* o0, float* o1) noexcept {
+                std::array<double, bands> wl {}, wh {};
+                for (int b = 0; b < nb; ++b)
+                {
+                    wl[(std::size_t) b] = b > 0 ? minphase::warp (std::min (f[(std::size_t) (b - 1)], sr * 0.45), rate) : 0.0;
+                    wh[(std::size_t) b] = b < nb - 1 ? minphase::warp (std::min (f[(std::size_t) b], sr * 0.45), rate) : 0.0;
+                }
+                for (int i = 0; i < len; ++i)
+                {
+                    if (i % every == 0)
+                        for (int b = 0; b < nb; ++b)
+                        {
+                            if (! works[(std::size_t) b])
+                                continue;
+                            const auto [ga, gb] = gainAt (b, i);
+                            const double gc[2] { (double) ga * panA[(std::size_t) b], (double) gb * panB[(std::size_t) b] };
+                            for (int c = 0; c < 2; ++c)
+                                if (std::abs (gc[c] - dynGain[(std::size_t) b][(std::size_t) c]) > 1e-7)
+                                {
+                                    dynGain[(std::size_t) b][(std::size_t) c] = gc[c];
+                                    dynBand[(std::size_t) b][(std::size_t) c].design (wl[(std::size_t) b], wh[(std::size_t) b],
+                                                                                      b > 0 ? slopeOrder (slope[(std::size_t) (b - 1)]) : 1,
+                                                                                      b < nb - 1 ? slopeOrder (slope[(std::size_t) b]) : 1, std::max (gc[c], 1e-6));
+                                }
+                        }
+                    const double xl = d0[i], xr = d1[i];
+                    // each band's two gains act on left / right, or on mid / side (the pan mode, a mid- / side-only link)
+                    double yl = xl, yr = xr;
+                    for (int b = 0; b < nb; ++b)
+                        if (works[(std::size_t) b])
+                        {
+                            if (bandMs[(std::size_t) b])
+                            {
+                                const auto a = dynBand[(std::size_t) b][0].process (0.5 * (yl + yr));
+                                const auto c = dynBand[(std::size_t) b][1].process (0.5 * (yl - yr));
+                                yl = a + c;
+                                yr = a - c;
+                            }
+                            else
+                            {
+                                yl = dynBand[(std::size_t) b][0].process (yl);
+                                yr = dynBand[(std::size_t) b][1].process (yr);
+                            }
+                        }
+                    o0[i] = (float) ((xl + (yl - xl) * mx) * outGain);
+                    o1[i] = (float) ((xr + (yr - xr) * mx) * outGain);
+                }
+            };
+            if (osFactor <= 1)
+            {
+                run (n, sr, 8, dry[0].data(), dry[1].data(),
+                     [&] (int b, int i) { return std::pair<float, float> { gain[(std::size_t) b][(std::size_t) i], gainB[(std::size_t) b][(std::size_t) i] }; }, l, r);
+                return;
+            }
+            // oversampled: the input and the gains interpolated (the same half-band filters), the filters designed at
+            // the high rate, the result decimated back
+            const int hi = n * osFactor;
+            const auto upsample = [&] (mixsuite::Oversampler& os, const float* src, float* dst) noexcept {
+                std::array<float, chunk> tmp {};
+                std::copy (src, src + n, tmp.begin());
+                int k = 0;
+                os.process (tmp.data(), n, [&] (float v) { dst[k++] = v; return 0.0f; });
+            };
+            for (int c = 0; c < 2; ++c)
+                upsample (upDry[(std::size_t) c], dry[(std::size_t) c].data(), hiDry[(std::size_t) c].data());
+            for (int b = 0; b < nb; ++b)
+            {
+                upsample (upGain[(std::size_t) b], gain[(std::size_t) b].data(), hiGain[(std::size_t) b].data());
+                upsample (upGainB[(std::size_t) b], gainB[(std::size_t) b].data(), hiGainB[(std::size_t) b].data());
+            }
+            run (hi, sr * osFactor, 8 * osFactor, hiDry[0].data(), hiDry[1].data(),
+                 [&] (int b, int k) { return std::pair<float, float> { hiGain[(std::size_t) b][(std::size_t) k], hiGainB[(std::size_t) b][(std::size_t) k] }; },
+                 hiDry[0].data(), hiDry[1].data());
+            for (int c = 0; c < 2; ++c)
+            {
+                auto* out = c == 0 ? l : r;
+                const auto* src = hiDry[(std::size_t) c].data();
+                std::fill (out, out + n, 0.0f);
+                int k = 0;
+                down[(std::size_t) c].process (out, n, [&] (float) { return src[k++]; });
+            }
+            return;
+        }
+
         // 2. the bands' gains applied and summed (at the oversampled rate when oversampling is on)
         const auto combine = [&] (float dl, float dr, auto&& bandAt, auto&& gainAt, float& outL, float& outR) noexcept {
             float yl = anySolo || minimum ? 0.0f : dl, yr = anySolo || minimum ? 0.0f : dr;
             for (int b = 0; b < nb; ++b)
             {
-                const auto g = gainAt (b);
+                const auto [ga, gb] = gainAt (b);
                 float sl, sr2;
                 bandAt (b, sl, sr2);
-                const auto gl = g * panL[(std::size_t) b], gr = g * panR[(std::size_t) b];
-                if (msPan) // round 144: the pan's two gains on the band's mid and side
+                const auto gl = ga * panA[(std::size_t) b], gr = gb * panB[(std::size_t) b];
+                if (bandMs[(std::size_t) b]) // round 144: the pan's two gains on the band's mid and side (round 147: or the link's)
                 {
                     const auto mid = 0.5f * (sl + sr2), side = 0.5f * (sl - sr2);
                     if (anySolo && ! soloed[(std::size_t) b])
@@ -1346,7 +1600,7 @@ private:
             for (int i = 0; i < n; ++i)
                 combine (dry[0][(std::size_t) i], dry[1][(std::size_t) i],
                          [&] (int b, float& a, float& c) { a = band[(std::size_t) b][0][(std::size_t) i]; c = band[(std::size_t) b][1][(std::size_t) i]; },
-                         [&] (int b) { return gain[(std::size_t) b][(std::size_t) i]; }, l[i], r[i]);
+                         [&] (int b) { return std::pair<float, float> { gain[(std::size_t) b][(std::size_t) i], gainB[(std::size_t) b][(std::size_t) i] }; }, l[i], r[i]);
             return;
         }
         // round 144: oversampling — every stream is interpolated by the same half-band filters (mixsuite::Oversampler:
@@ -1366,11 +1620,13 @@ private:
             for (int c = 0; c < 2; ++c)
                 upsample (upBand[(std::size_t) b][(std::size_t) c], band[(std::size_t) b][(std::size_t) c].data(), hiBand[(std::size_t) b][(std::size_t) c].data());
             upsample (upGain[(std::size_t) b], gain[(std::size_t) b].data(), hiGain[(std::size_t) b].data());
+            upsample (upGainB[(std::size_t) b], gainB[(std::size_t) b].data(), hiGainB[(std::size_t) b].data());
         }
         for (int k = 0; k < hi; ++k)
             combine (hiDry[0][(std::size_t) k], hiDry[1][(std::size_t) k],
                      [&] (int b, float& a, float& c) { a = hiBand[(std::size_t) b][0][(std::size_t) k]; c = hiBand[(std::size_t) b][1][(std::size_t) k]; },
-                     [&] (int b) { return hiGain[(std::size_t) b][(std::size_t) k]; }, hiDry[0][(std::size_t) k], hiDry[1][(std::size_t) k]);
+                     [&] (int b) { return std::pair<float, float> { hiGain[(std::size_t) b][(std::size_t) k], hiGainB[(std::size_t) b][(std::size_t) k] }; },
+                     hiDry[0][(std::size_t) k], hiDry[1][(std::size_t) k]);
         for (int c = 0; c < 2; ++c)
         {
             auto* out = c == 0 ? l : r;
@@ -1410,6 +1666,7 @@ private:
         for (auto& row : upBand)
             for (auto& o : row) o.reset();
         for (auto& o : upGain) o.reset();
+        for (auto& o : upGainB) o.reset();
         for (auto& o : down) o.reset();
     }
 
@@ -1441,6 +1698,7 @@ private:
             for (auto& row : upBand)
                 for (auto& o : row) set (o);
             for (auto& o : upGain) set (o);
+            for (auto& o : upGainB) set (o);
             for (auto& o : down) set (o);
         }
         if (la != laMs)
@@ -1471,7 +1729,7 @@ private:
     std::array<double, bands - 1> lastF {};
     const float* scL = nullptr;
     const float* scR = nullptr;
-    int lastSlope = 0;
+    std::array<int, bands - 1> lastSlope {};
     bool designed = false, kernelsDirty = true;
     int mode = -1, osFactor = 0, linSize = 0, lastNb = 0;
     std::array<peqfl::FftConvolver, bands - 1> lin;
@@ -1479,20 +1737,33 @@ private:
     LongDelay linDry, linSc;
     StereoDelay delay;
     std::array<StereoDelay, bands> bandDelay;
-    std::array<MonoDelay, bands> gainDelay;
+    std::array<MonoDelay, bands> gainDelay, gainDelayB;
+    // round 147: the stereo link (linked part, mid- / side-only part, side mode), the free side-chain filters
+    std::array<double, bands> linkA {}, linkM {};
+    std::array<bool, bands> linkSide {}, fullLink {}, bandMs {}, scFree {};
+    std::array<float, bands> panA {}, panB {};
+    std::array<ScFilter, bands> scFilter {};
     int laSamples = 0;
-    std::array<double, bands> env {}, extreme {};
+    std::array<double, bands> env {}, env2 {}, extreme {};
     std::array<float, bands> gains {};
     // one chunk of the base-rate streams, and the same at the oversampled rate
     std::array<std::array<float, chunk>, 2> dry {};
     std::array<std::array<std::array<float, chunk>, 2>, bands> band {};
-    std::array<std::array<float, chunk>, bands> gain {};
+    std::array<std::array<float, chunk>, bands> gain {}, gainB {}; // each band's two gains (left / right or mid / side)
     std::array<std::array<float, chunk * maxFactor>, 2> hiDry {};
     std::array<std::array<std::array<float, chunk * maxFactor>, 2>, bands> hiBand {};
-    std::array<std::array<float, chunk * maxFactor>, bands> hiGain {};
+    std::array<std::array<float, chunk * maxFactor>, bands> hiGain {}, hiGainB {};
     std::array<mixsuite::Oversampler, 2> upDry, down;
     std::array<std::array<mixsuite::Oversampler, 2>, bands> upBand;
-    std::array<mixsuite::Oversampler, bands> upGain;
+    std::array<mixsuite::Oversampler, bands> upGain, upGainB;
+    // round 147: the measured Dynamic phase — each band's two filters (left / right or mid / side), their last gains
+    std::array<std::array<minphase::Band, 2>, bands> dynBand {};
+    std::array<std::array<double, 2>, bands> dynGain {};
+    std::array<bool, bands> dynWorks {};
+    std::array<double, bands - 1> dynF {};
+    std::array<int, bands - 1> dynSlope {};
+    int dynNb = 0, dynOs = 0;
+    std::array<bool, bands> dynMs {};
     LiveMeters meters;
 };
 } // namespace
@@ -1890,6 +2161,23 @@ const EffectInfo& prismInfo()
         i.params.push_back ({ "Processing", 0.5f });
         i.params.push_back ({ "Oversampling", 0.0f });
         i.params.push_back ({ "Pan mode", 0.0f });
+        // round 147: the measured Dynamic phase engine for new instances; projects saved before it load the old one
+        // (engine/ProjectFile.cpp sets 0 when the saved parameter list ends before this index)
+        i.params.push_back ({ "Dynamic engine", 1.0f });
+        // round 147: the expert panel — stereo link (100 %), its mode (mid), side-chain filtering (band), free low / high
+        for (const auto* n : { "B1 link", "B2 link", "B3 link", "B4 link", "B5 link", "B6 link" })
+            i.params.push_back ({ n, 0.5f });
+        for (const auto* n : { "B1 link mode", "B2 link mode", "B3 link mode", "B4 link mode", "B5 link mode", "B6 link mode" })
+            i.params.push_back ({ n, 0.0f });
+        for (const auto* n : { "B1 SC filter", "B2 SC filter", "B3 SC filter", "B4 SC filter", "B5 SC filter", "B6 SC filter" })
+            i.params.push_back ({ n, 0.0f });
+        for (const auto* n : { "B1 SC low", "B2 SC low", "B3 SC low", "B4 SC low", "B5 SC low", "B6 SC low" })
+            i.params.push_back ({ n, 0.0f });
+        for (const auto* n : { "B1 SC high", "B2 SC high", "B3 SC high", "B4 SC high", "B5 SC high", "B6 SC high" })
+            i.params.push_back ({ n, 1.0f });
+        // round 147: each crossover's own slope (0 = the global Slope, the old sound)
+        for (const auto* n : { "Crossover 1 slope", "Crossover 2 slope", "Crossover 3 slope", "Crossover 4 slope", "Crossover 5 slope" })
+            i.params.push_back ({ n, 0.0f });
         return i;
     }();
     return info;
@@ -2032,6 +2320,21 @@ std::string paramText (EffectKind kind, int param, float v)
             }
             case oversampling: return oversamplingOf (v) == 1 ? "Off" : std::to_string (oversamplingOf (v)) + "x";
             case panMode: return on (v) ? "mid / side" : "left / right";
+            case dynamicEngine: return on (v) ? "measured" : "classic";
+            case bandLink0: case bandLink0 + 1: case bandLink0 + 2: case bandLink0 + 3: case bandLink0 + 4: case bandLink0 + 5:
+                return v <= 0.5f ? fmt ("%.0f%%", 100.0 * linkAmount (v)) : fmt ("100%%, %.0f%% only", 100.0 * linkOnly (v));
+            case bandLinkMode0: case bandLinkMode0 + 1: case bandLinkMode0 + 2: case bandLinkMode0 + 3: case bandLinkMode0 + 4: case bandLinkMode0 + 5:
+                return on (v) ? "side" : "mid";
+            case bandScFree0: case bandScFree0 + 1: case bandScFree0 + 2: case bandScFree0 + 3: case bandScFree0 + 4: case bandScFree0 + 5:
+                return on (v) ? "free" : "band";
+            case bandScLow0: case bandScLow0 + 1: case bandScLow0 + 2: case bandScLow0 + 3: case bandScLow0 + 4: case bandScLow0 + 5:
+            case bandScHigh0: case bandScHigh0 + 1: case bandScHigh0 + 2: case bandScHigh0 + 3: case bandScHigh0 + 4: case bandScHigh0 + 5:
+                return hzText (scFilterHz (v));
+            case xoverSlope0: case xoverSlope0 + 1: case xoverSlope0 + 2: case xoverSlope0 + 3: case xoverSlope0 + 4:
+            {
+                static const char* const names[4] { "global", "12 dB/oct", "24 dB/oct", "48 dB/oct" };
+                return names[pick (v, 4)];
+            }
             case slope: return std::to_string (slopeDbOct (v)) + " dB/oct";
             case lookahead: return v <= 0.0f ? "off" : msText (lookaheadMs (v));
             case mix: return fmt ("%.0f%%", v * 100.0);

+ 22 - 1
src/core/DynamicsSuite.h

@@ -139,7 +139,19 @@ enum Global { xover1 = legacyBands * fieldsPerBand, xover2, xover3, slope, looka
               // round 144: what each band's PAN balances — left / right (0, as before) or mid / side (1, the reference's
               // band pan: mid gain = 1 − pan right of centre, side gain = 1 + pan left of it)
               panMode,
-              count };
+              // round 147 (REA_rodada147 §1): Dynamic phase's engine — 1 = the measured one (each working band a
+              // minimum-phase filter with the linear-phase magnitude, the bands in cascade: core/MinPhaseBand.h), 0 = the
+              // round-108 construction (input + each band's gain change), kept for projects saved before round 147
+              dynamicEngine,
+              // round 147 (Pro-MB's expert panel, measured black-box): each band's stereo link (the reference's value
+              // law: 0 … 0.5 = 0 … 100 % linked, 0.5 … 1 = 100 % + 0 … 100 % mid- / side-only; default 100 % = the old
+              // detector), its mode (mid / side), the side-chain filtering (band / free) and the free filter's low /
+              // high frequency (30 Hz … 30 kHz)
+              bandLink0, bandLinkMode0 = bandLink0 + bands, bandScFree0 = bandLinkMode0 + bands,
+              bandScLow0 = bandScFree0 + bands, bandScHigh0 = bandScLow0 + bands,
+              // round 147: each crossover's own slope (Pro-MB's per-band slopes): 0 = the global Slope, then 12 / 24 / 48
+              xoverSlope0 = bandScHigh0 + bands,
+              count = xoverSlope0 + bands - 1 };
 inline int param (int band, int field) noexcept
 {
     return band < legacyBands ? band * fieldsPerBand + field : band5 + (band - legacyBands) * fieldsPerBand + field;
@@ -173,6 +185,15 @@ double trimDb (float v) noexcept;        // ±36 dB
 // classic crossover sum, all-pass compensated: the crossovers' phase is always there)
 enum class Phase { linear, dynamic, minimum };
 Phase phaseOf (float v) noexcept;
+bool measuredDynamic (const EffectParams& p) noexcept; // round 147: Dynamic phase runs the measured engine
+// round 147: the stereo link's two parts — linked (0 … 1) and mid- / side-only (0 … 1, only once fully linked)
+double linkAmount (float v) noexcept;
+double linkOnly (float v) noexcept;
+double scFilterHz (float v) noexcept;   // 30 Hz … 30 kHz (30 · 1000^v, the reference's law)
+float scFilterValue (double hz) noexcept;
+int crossoverSlopeDbOct (const EffectParams& p, int k) noexcept; // round 147: crossover k's slope (its own or the global)
+float crossoverSlopeValue (int dbOct) noexcept;                  // 12 / 24 / 48 → its own value (0 = global)
+inline int slopeOrder (int dbOct) noexcept { return dbOct <= 12 ? 1 : (dbOct <= 24 ? 2 : 4); } // n of LR(2n)
 int oversamplingOf (float v) noexcept;   // 1 (off), 2 or 4
 int linearFftSize (double sampleRate) noexcept; // 4096 up to 50 kHz, ×2 per doubling of the rate
 int linearLatency (double sampleRate) noexcept; // 3/4 of the FFT size (3072 samples at 48 kHz, as measured)

+ 289 - 7
src/core/EchoSuite.cpp

@@ -4,6 +4,7 @@
 #include <algorithm>
 #include <array>
 #include <cmath>
+#include <complex>
 #include <cstdint>
 #include <cstdio>
 #include <vector>
@@ -662,6 +663,166 @@ const char* tapeVoicingName (int k) noexcept
     return names[std::clamp (k, 0, tapeVoicingCount)];
 }
 float hybridValue (int h) noexcept { return h <= 0 ? 0.0f : (h == 1 ? 0.5f : 1.0f); }
+
+// ---- round 147: the echo voicings, the saturation curves and Multiply (REA_rodada147a) ---------------------------
+// [EXEC] each voicing is one of EchoBoy's 31 factory styles measured black-box on the official trial (Single, 250 ms,
+// mix 100 %, its Saturation at 0 / 6 / 12 / 18 / 24): the first echo's tone and the tone of every further pass (white
+// noise bursts, 1/3-octave power ratios: rep 1 = output tone × loop tone, rep 2 / rep 1 = feedback × loop tone),
+// the steady-sine gain / 2nd / 3rd harmonic over −40 … 0 dBFS, the pitch wobble of a steady 1 kHz echo and the
+// impulse's spread. LYNX's model (our own code): write path = saturation → loop tone, read path = output tone; the
+// tones are RBJ biquads fitted to the measured curves (≤ 0.3 dB rms), the saturation either a knee shaper
+// x / (1 + |x|^p)^(1/p) with a bias b (even harmonics) between a drive and a gain, or a compressor (the dynamic
+// styles: ratio, threshold, make-up per Saturation step; attack 4 ms, release 120 ms from level steps), linear
+// in dB between the measured Saturation steps; the wobble a sine (or smooth random) delay modulation of the measured
+// depth (cents rms) and rate.
+namespace
+{
+struct VoicingData
+{
+    const char* name;
+    float outGain;                 // dB
+    int outHp, outLp;              // cascaded 2nd-order high / low passes (0 … 2 / 0 … 4)
+    float hpHz, hpQ, lpHz, lpQ;
+    float pkHz[3], pkDb[3], pkQ[3];
+    float lsHz, lsDb, lpkHz, lpkDb, lpkQ; // the loop tone: a low shelf, a bell
+    int loopLp;                    // and 0 … 2 low passes
+    float loopLpHz, loopLpQ;
+    int comp;                      // 0 = the shaper, 1 = the compressor
+    float p, b, driveDb[5], gainDb[5];
+    float ratio, thresholdDb[5], makeupDb[5];
+    float wobbleCents, wobbleHz;
+    int wobbleRandom;
+    float wobblePhase;             // the right side's LFO phase offset (turns)
+    float diffusion;               // 0 … 1, Echoform's diffusion amount
+};
+const VoicingData voicingTable[voicingCount] {
+#include "core/EchoVoicings.inc"
+};
+// the saturation types: the measured curve of a representative style (clean digital, studio tape, valve tape,
+// broadcast FM's compressor, fuzzed, squashed) — LYNX names
+constexpr int satTypeSource[satTypeCount] { 15, 1, 4, 12, 25, 24 };
+
+const VoicingData& voicingData (int k) noexcept { return voicingTable[std::clamp (k - 1, 0, voicingCount - 1)]; }
+const VoicingData& satTypeData (int type) noexcept { return voicingTable[satTypeSource[std::clamp (type - 1, 0, satTypeCount - 1)]]; }
+
+// a value of the five-step table (Saturation 0, 6, 12, 18, 24 dB), linear in between
+double satStep (const float* table, double driveDb) noexcept
+{
+    const auto t = std::clamp (driveDb, 0.0, 24.0) / 6.0;
+    const auto i = std::min (3, (int) t);
+    return (double) table[i] + ((double) table[i + 1] - (double) table[i]) * (t - (double) i);
+}
+
+double kneeShape (double u, double p) noexcept { return u / std::pow (1.0 + std::pow (std::abs (u), p), 1.0 / p); }
+// the shaper with unity slope at 0: (f (u + b) − f (b)) / f′(b), f′(u) = (1 + |u|^p)^(−1/p − 1)
+double biasedShape (double u, double p, double b) noexcept
+{
+    const auto slope = std::pow (1.0 + std::pow (std::abs (b), p), -1.0 / p - 1.0);
+    return (kneeShape (u + b, p) - kneeShape (b, p)) / slope;
+}
+
+// the compressor's static curve (dB of gain reduction for `x` dB above the threshold; 6 dB soft knee)
+double compressCurve (double x, double ratio) noexcept
+{
+    const auto s = 1.0 - 1.0 / std::max (1.0, ratio);
+    if (x < -3.0) return 0.0;
+    if (x > 3.0) return s * x;
+    return s * (x + 3.0) * (x + 3.0) / 12.0;
+}
+
+// the RBJ magnitude (dB) of one biquad at w
+double biquadDb (const Biquad& q, double w) noexcept
+{
+    const std::complex<double> z1 = std::polar (1.0, -w), z2 = z1 * z1;
+    const auto num = q.b0 + q.b1 * z1 + q.b2 * z2, den = 1.0 + q.a1 * z1 + q.a2 * z2;
+    return 20.0 * std::log10 (std::max (1e-12, std::abs (num / den)));
+}
+
+// the voicing's tones as biquads (out: up to 2 HP + 4 LP + 3 bells; loop: shelf, bell, up to 2 LP)
+int designOutTone (const VoicingData& v, double sr, Biquad* q) noexcept
+{
+    int n = 0;
+    const auto lim = [sr] (double hz) { return std::clamp (hz, 10.0, 0.45 * sr); };
+    for (int i = 0; i < v.outHp; ++i)
+        q[n++].filter (sr, 1, lim (v.hpHz), v.hpQ);
+    if (v.lpHz < 0.45 * sr)
+        for (int i = 0; i < v.outLp; ++i)
+            q[n++].filter (sr, 0, lim (v.lpHz), v.lpQ);
+    for (int i = 0; i < 3; ++i)
+        if (std::abs (v.pkDb[i]) > 0.01f && v.pkHz[i] < 0.45 * sr)
+            q[n++].peaking (sr, lim (v.pkHz[i]), v.pkQ[i], v.pkDb[i]);
+    return n;
+}
+int designLoopTone (const VoicingData& v, double sr, Biquad* q) noexcept
+{
+    int n = 0;
+    const auto lim = [sr] (double hz) { return std::clamp (hz, 10.0, 0.45 * sr); };
+    if (std::abs (v.lsDb) > 0.01f)
+        q[n++].shelf (sr, lim (v.lsHz), v.lsDb, false);
+    if (std::abs (v.lpkDb) > 0.01f && v.lpkHz < 0.45 * sr)
+        q[n++].peaking (sr, lim (v.lpkHz), v.lpkQ, v.lpkDb);
+    if (v.loopLpHz < 0.45 * sr)
+        for (int i = 0; i < v.loopLp; ++i)
+            q[n++].filter (sr, 0, lim (v.loopLpHz), v.loopLpQ);
+    return n;
+}
+} // namespace
+
+int voicingOf (float v) noexcept { return std::clamp ((int) std::lround (clamp01 (v) * voicingCount), 0, voicingCount); }
+float voicingValue (int k) noexcept { return (float) std::clamp (k, 0, voicingCount) / (float) voicingCount; }
+const char* voicingName (int k) noexcept { return k <= 0 ? "off" : voicingData (k).name; }
+int voicingForEchoBoyStyle (int style) noexcept { return style >= 0 && style < voicingCount ? style + 1 : 0; }
+int satTypeOf (float v) noexcept { return std::clamp ((int) std::lround (clamp01 (v) * satTypeCount), 0, satTypeCount); }
+float satTypeValue (int k) noexcept { return (float) std::clamp (k, 0, satTypeCount) / (float) satTypeCount; }
+const char* satTypeName (int k) noexcept
+{
+    static const char* const names[satTypeCount + 1] { "auto", "clean", "tape", "tube", "squash", "grit", "ceiling" };
+    return names[std::clamp (k, 0, satTypeCount)];
+}
+int multiplyOf (float v) noexcept { return 1 << std::clamp ((int) std::lround (clamp01 (v) * 3.0f), 0, 3); }
+float multiplyValue (int factor) noexcept
+{
+    int k = 0;
+    while (k < 3 && (1 << k) < factor)
+        ++k;
+    return (float) k / 3.0f;
+}
+// [EXEC] PrimalTap 5.5.5: Multiply 2x / 4x / 8x doubles / quadruples / octuples the delay and leaves a brick-wall
+// band of ≈ 6.2 / 3.1 / 1.55 kHz (−1 … −2 dB just below, −43 … −49 dB a third of an octave above)
+double multiplyCutoffHz (int factor) noexcept { return factor <= 1 ? 0.0 : 12400.0 / (double) factor; }
+
+double voicingToneDb (int k, bool loop, double hz, double sampleRate)
+{
+    if (k <= 0)
+        return 0.0;
+    const auto& v = voicingData (k);
+    std::array<Biquad, 9> q {};
+    const int n = loop ? designLoopTone (v, sampleRate, q.data()) : designOutTone (v, sampleRate, q.data());
+    const auto w = twoPi * hz / sampleRate;
+    double db = loop ? 0.0 : (double) v.outGain;
+    for (int i = 0; i < n; ++i)
+        db += biquadDb (q[(std::size_t) i], w);
+    return db;
+}
+
+double satGainDb (int k, int type, double driveDb, double levelDb)
+{
+    const auto& v = type > 0 ? satTypeData (type) : voicingData (k);
+    if (v.comp != 0)
+        return satStep (v.makeupDb, driveDb) - compressCurve (levelDb - satStep (v.thresholdDb, driveDb), v.ratio);
+    // the fundamental of the shaped sine (64 points)
+    const auto d = std::pow (10.0, satStep (v.driveDb, driveDb) / 20.0), a = std::pow (10.0, levelDb / 20.0);
+    double re = 0.0, im = 0.0;
+    for (int i = 0; i < 64; ++i)
+    {
+        const auto ph = twoPi * i / 64.0;
+        const auto y = biasedShape (a * d * std::sin (ph), (double) v.p, (double) v.b);
+        re += y * std::sin (ph);
+        im += y * std::cos (ph);
+    }
+    const auto fund = 2.0 * std::sqrt (re * re + im * im) / 64.0;
+    return satStep (v.gainDb, driveDb) + 20.0 * std::log10 (std::max (1e-12, fund / (a * d)));
+}
 Mode modeOf (float v) noexcept { return (Mode) std::clamp ((int) std::floor (clamp01 (v) * (float) modeCount), 0, modeCount - 1); }
 float modeValue (Mode m) noexcept { return ((float) m + 0.5f) / (float) modeCount; }
 Style styleOf (float v) noexcept { return (Style) std::clamp ((int) std::floor (clamp01 (v) * (float) styleCount), 0, styleCount - 1); }
@@ -732,6 +893,12 @@ public:
         eqBass.reset();
         eqMid.reset();
         eqTreble.reset();
+        for (auto& q : outQ) q.reset();
+        for (auto& q : loopQ) q.reset();
+        multLp1.reset();
+        multLp2.reset();
+        compEnv[0] = compEnv[1] = 0.0;
+        voicePhase = 0.0;
         lfoPhase = 0.0;
         envelope = 0.0f;
         duckGr = 0.0;
@@ -777,8 +944,23 @@ private:
 
     void echoProcess (float* l, float* r, int n, const EffectParams& p, double bpm) noexcept
     {
-
-        const auto md = modeOf (p[mode]);
+        // round 147: a measured echo voicing replaces the mode's character (its read path is the clean one), and the
+        // saturation curve can be chosen apart from it
+        const int vk = voicingOf (p[voicing]);
+        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]));
+        if (vd != nullptr && (vk != toneVoicing || sr != toneSr))
+        {
+            toneVoicing = vk;
+            toneSr = sr;
+            for (auto& q : outQ) q = {};
+            for (auto& q : loopQ) q = {};
+            outN = designOutTone (*vd, sr, outQ.data());
+            loopN = designLoopTone (*vd, sr, loopQ.data());
+            outLin = (float) std::pow (10.0, vd->outGain / 20.0);
+        }
+        const auto md = vd != nullptr ? Mode::clean : modeOf (p[mode]);
         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;
@@ -794,6 +976,15 @@ 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);
+        // round 147: PrimalTap's Multiply — the times × 1 / 2 / 4 / 8 (up to the line's 20 s), the band ÷ the same
+        const int mult = multiplyOf (p[multiply]);
+        if (mult > 1)
+        {
+            tL = std::min (tL * mult, 20000.0);
+            tR = std::min (tR * mult, 20000.0);
+            multLp1.set (multiplyCutoffHz (mult), sr);
+            multLp2.set (multiplyCutoffHz (mult), sr);
+        }
         std::array<RhythmTap, 16> rTaps {};
         double rSlot0 = 0.0;
         int rCount = 0;
@@ -811,7 +1002,7 @@ private:
         const auto ageV = clamp01 (p[age]);
         const auto driveGain = (float) std::pow (10.0, 24.0 * (double) clamp01 (p[drive]) / 20.0);
         const auto widthV = (float) bipolar (p[width]);
-        const auto diffAmount = clamp01 (p[diffusion]);
+        const auto diffAmount = std::max (clamp01 (p[diffusion]), vd != nullptr ? vd->diffusion : 0.0f); // round 147: the voicing's own
         const auto diffScale = 0.25 + 0.75 * (double) clamp01 (p[diffSize]);
         const auto duck = clamp01 (p[ducking]);
         // round 144: the LFO locked to a note value of the tempo (Mod sync), else its free rate
@@ -879,6 +1070,11 @@ private:
         const auto maxRead = ch[0].line.maxDelay() - 2.0;
         const auto loopG = freezeOn ? 1.0 : (twoTap ? g * g : g);
 
+        // round 147: the voicing's wobble as a delay swing (ms): a sine of depth c cents rms at f Hz swings the delay by
+        // √2 · c / (1731.2 · 2π f) s (the smooth random LFO about its rms, so without the √2)
+        wobbleMs = vd != nullptr && vd->wobbleCents > 0.0f
+                       ? 1000.0 * (vd->wobbleRandom != 0 ? 1.0 : std::sqrt (2.0)) * vd->wobbleCents / (1731.234 * twoPi * std::max (0.05f, vd->wobbleHz))
+                       : 0.0;
         for (int i = 0; i < n; ++i)
         {
             const float in[2] = { l[i], r[i] };
@@ -887,7 +1083,23 @@ private:
             lfoPhase += rate / sr;
             lfoPhase -= std::floor (lfoPhase);
             double modMs[2] = { 0.0, 0.0 };
-            for (int c = 0; c < 2; ++c)
+            if (vd != nullptr && vd->wobbleCents > 0.0f) // round 147: the voicing's measured wobble
+            {
+                voicePhase += vd->wobbleHz / sr;
+                voicePhase -= std::floor (voicePhase);
+                for (int c = 0; c < 2; ++c)
+                {
+                    if (vd->wobbleRandom != 0) // both sides on one random swing when the reference's are in step
+                        modMs[c] = c == 1 && vd->wobblePhase == 0.0f ? modMs[0]
+                                                                     : wobbleMs * (double) ch[(std::size_t) c].drift.next (2.0 * vd->wobbleHz, sr); // ≈ unit rms
+                    else
+                    {
+                        auto ph = voicePhase + (c == 1 ? (double) vd->wobblePhase : 0.0);
+                        modMs[c] = wobbleMs * std::sin (twoPi * (ph - std::floor (ph)));
+                    }
+                }
+            }
+            for (int c = 0; c < 2 && vd == nullptr; ++c)
             {
                 auto& s = ch[(std::size_t) c];
                 switch (modulation)
@@ -1021,6 +1233,12 @@ private:
                 }
                 if (st != Style::quad && ! twoTap && ! feelTap && ! rhythmOn) // the quad style feeds back its last tap as read
                     fbSig[c] = y;
+                if (vd != nullptr) // round 147: the voicing's output tone (once, on the way out)
+                {
+                    y *= outLin;
+                    for (int k = 0; k < outN; ++k)
+                        y = outQ[(std::size_t) k].process (y, c);
+                }
                 echo[c] = y;
             }
 
@@ -1060,12 +1278,21 @@ private:
                 if (diffAmount > 0.0f && ! postDiff)
                     for (std::size_t k = 0; k < 4; ++k)
                         u = s.diff[k].process (u, diffMs[k] * diffScale * 0.001 * sr * (c == 1 ? 1.07 : 1.0), 0.65f * diffAmount);
-                u = character (s, c, u, md, ageV, driveGain);
+                if (vd != nullptr) // round 147: the voicing's saturation and loop tone (every pass)
+                {
+                    u = saturate (u, c);
+                    for (int k = 0; k < loopN; ++k)
+                        u = loopQ[(std::size_t) k].process (u, c);
+                }
+                else
+                    u = character (s, c, u, md, ageV, driveGain);
                 u = s.highCut.lp (s.lowCut.hp (u));
                 if (loopEq) // round 144: the loop EQ shapes every repeat again
                     u = eqTreble.process (eqMid.process (eqBass.process (u, c), c), c);
                 if (lofiOn)
                     u = lofiLp.process (u, c);
+                if (mult > 1) // round 147: Multiply's band
+                    u = multLp2.process (multLp1.process (u, c), c);
                 s.line.push (softLimit (u));
             }
 
@@ -1202,7 +1429,8 @@ private:
 
     float character (Channel& s, int c, float u, Mode m, float ageV, float driveGain) noexcept
     {
-        const auto drive = [this, driveGain] (float x) { return shaper (x * driveGain) / driveGain; };
+        // round 147: a chosen saturation type replaces the mode's own shaper
+        const auto drive = [this, driveGain, c] (float x) { return satCurve != nullptr ? saturate (x, c) : shaper (x * driveGain) / driveGain; };
         switch (m)
         {
             case Mode::tape:
@@ -1468,6 +1696,55 @@ private:
         }
     }
 
+    // ---- round 147: the saturation curve of the block (a voicing's own or a chosen type) -------------------------------
+    void prepareSaturation (const VoicingData* v, double driveDb) noexcept
+    {
+        satCurve = v;
+        if (v == nullptr)
+            return;
+        if (v->comp != 0)
+        {
+            satThreshold = satStep (v->thresholdDb, driveDb);
+            satMakeup = satStep (v->makeupDb, driveDb);
+            compAttack = 1.0 - std::exp (-1.0 / (0.004 * sr));
+            compRelease = 1.0 - std::exp (-1.0 / (0.120 * sr));
+        }
+        else
+        {
+            satDrive = std::pow (10.0, satStep (v->driveDb, driveDb) / 20.0);
+            satGain = std::pow (10.0, satStep (v->gainDb, driveDb) / 20.0);
+            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);
+        }
+    }
+
+    float saturate (float x, int c) noexcept
+    {
+        const auto& v = *satCurve;
+        if (v.comp != 0)
+        {
+            auto& e = compEnv[c];
+            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);
+            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);
+    }
+
+    const VoicingData* satCurve = nullptr;
+    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 {};
+    std::array<Biquad, 4> loopQ {};
+    int outN = 0, loopN = 0, toneVoicing = -1;
+    double toneSr = 0.0, voicePhase = 0.0, wobbleMs = 0.0;
+    float outLin = 1.0f;
+    Butter8 multLp1, multLp2;
+
     double sr = 48000.0;
     std::array<Channel, 2> ch;
     Butter8 steep;
@@ -2047,7 +2324,9 @@ const EffectInfo& echoformInfo()
                                      // round 144: the Style-Edit-role controls (appended; the defaults = the old sound)
                                      { "Input level", 0.5f }, { "FB balance", 0.5f }, { "Diffusion post", 0.0f },
                                      { "Mod shape", 0.0f }, { "Mod sync", 0.0f },
-                                     { "Loop bass", 0.5f }, { "Loop mid", 0.5f }, { "Loop treble", 0.5f } } };
+                                     { "Loop bass", 0.5f }, { "Loop mid", 0.5f }, { "Loop treble", 0.5f },
+                                     // round 147: the echo voicings, the saturation type, Multiply (appended; off = the old sound)
+                                     { "Echo voicing", 0.0f }, { "Saturation type", 0.0f }, { "Multiply", 0.0f } } };
     return info;
 }
 
@@ -2172,6 +2451,9 @@ std::string paramText (EffectKind kind, int param, float v)
                 return syncs[modSyncOf (v)];
             }
             case loopBass: case loopMid: case loopTreble: return fmt ("%+.1f dB", loopEqDb (v));
+            case voicing: return voicingName (voicingOf (v));
+            case satType: return satTypeName (satTypeOf (v));
+            case multiply: return std::to_string (multiplyOf (v)) + "x";
             case rhythmEdit: return rhythmEditOf (v) == RhythmEdit::even ? "even" : rhythmEditOf (v) == RhythmEdit::free ? "free" : "grid";
             case rhythmGrid:
             {

+ 24 - 0
src/core/EchoSuite.h

@@ -105,6 +105,11 @@ enum Param
     loopBass,      // ±18 dB shelves / bell inside the loop (EchoBoy's Style Edit EQ: each repeat is shaped again):
     loopMid,       //   bass 120 Hz, mid 1.2 kHz (Q 0.7), treble 5 kHz; 0 dB = off
     loopTreble,
+    // ---- round 147 (docs/PARITY.md: EchoBoy's styles / saturation, PrimalTap's Multiply), appended; 0 = the old sound
+    voicing,       // the echo voicing: 0 = off (the Mode menu's character), 1 … voicingCount = a measured echo character
+                   // (output tone, loop tone, saturation, wobble, diffusion; EchoBoy's styles measured black-box [EXEC])
+    satType,       // the saturation curve: 0 = auto (the voicing's own, or the mode's), 1 … satTypeCount = a measured family
+    multiply,      // 1x / 2x / 4x / 8x the echo time, the bandwidth divided by the same (PrimalTap's Multiply [EXEC])
     paramCount
 };
 enum class Style { single, ratio, quad, dual, pingPong }; // the two-time styles last (the panel shows the right time for both)
@@ -184,6 +189,25 @@ int tapeVoicingOf (float v) noexcept; // 0 = off, 1 … tapeVoicingCount
 float tapeVoicingValue (int k) noexcept;
 const char* tapeVoicingName (int k) noexcept;
 float hybridValue (int h) noexcept;
+// round 147: the echo voicings (EchoBoy's style role, each measured black-box on the official trial, REA_rodada147a)
+constexpr int voicingCount = 31;
+int voicingOf (float v) noexcept;        // 0 = off, 1 … voicingCount
+float voicingValue (int k) noexcept;
+const char* voicingName (int k) noexcept; // LYNX's own names ("off" for 0)
+// the voicing that plays EchoBoy's factory style `style` (0 … 30, the order of its Style parameter); 0 for its edited style
+int voicingForEchoBoyStyle (int style) noexcept;
+constexpr int satTypeCount = 6;
+int satTypeOf (float v) noexcept;        // 0 = auto, 1 … satTypeCount
+float satTypeValue (int k) noexcept;
+const char* satTypeName (int k) noexcept;
+int multiplyOf (float v) noexcept;       // 1, 2, 4 or 8
+float multiplyValue (int factor) noexcept;
+double multiplyCutoffHz (int factor) noexcept; // the bandwidth at that factor (0 for 1x: no filter)
+// the static magnitude (dB) of voicing k's output tone (loop = false) or loop tone (loop = true) at `hz`
+double voicingToneDb (int k, bool loop, double hz, double sampleRate);
+// the steady-sine fundamental gain (dB) of saturation curve `type` (1 … satTypeCount) or of voicing k's own curve
+// (type 0) at `driveDb` (0 … 24) for a sine of peak `levelDb` dBFS (the compressing curves after their attack)
+double satGainDb (int k, int type, double driveDb, double levelDb);
 Mode modeOf (float v) noexcept;
 float modeValue (Mode m) noexcept;
 Style styleOf (float v) noexcept;

+ 34 - 0
src/core/EchoVoicings.inc

@@ -0,0 +1,34 @@
+// GENERATED by tmp/parity147/py/geninc.py from the round-147a black-box measurements of the official EchoBoy trial
+// (docs/analise/REA_rodada147a.md; raw data D:\\lynx-work\\parity147\\a). One row per LYNX voicing, in the order of
+// EchoBoy's Style parameter (row k = its factory style k); names are LYNX's own. Fields: see VoicingData.
+    { "Mastering reel", -3.16758f, 2, 3, 36.1196f, 0.908016f, 19669.7f, 0.805878f, { 340.838f, 1004.75f, 6049.75f }, { 0.0943595f, 0.106435f, 0.17691f }, { 0.788572f, 0.645106f, 0.37684f }, 20.0f, -0.676618f, 10717.1f, -1.1169f, 0.2f, 1, 20000.0f, 0.634028f, 0, 2.5f, 0.0f, { -12.5f, -6.0f, 0.5f, 6.0f, 11.0f }, { -0.00129384f, 0.0839331f, 0.337002f, 1.51029f, 5.64452f }, 2.0f, { 1.5f, -0.5f, -3.5f, -9.0f, -16.5f }, { 0.000775171f, 0.0853415f, 0.203064f, 1.26257f, 5.68092f }, 0.0f, 0.3f, 1, 0.0f, 0.0f }, // 0
+    { "Studio reel", -3.02323f, 0, 2, 83.4956f, 0.667848f, 19423.1f, 0.821801f, { 23.4983f, 431.044f, 7619.57f }, { -2.65654f, 0.00383759f, 0.0617925f }, { 0.589611f, 0.656624f, 0.76885f }, 568.362f, 0.014488f, 8179.18f, -2.0057f, 0.200074f, 1, 19713.9f, 0.592252f, 0, 2.5f, 0.0f, { -12.5f, -6.5f, 0.0f, 5.5f, 11.0f }, { 0.00104774f, 0.0713765f, 0.279201f, 1.38163f, 5.60539f }, 2.0f, { 1.5f, -0.5f, -3.5f, -9.0f, -16.5f }, { 0.00311675f, 0.0834387f, 0.19091f, 1.2353f, 5.64179f }, 0.0f, 0.3f, 1, 0.5f, 0.0f }, // 1
+    { "Cartridge echo", -0.212081f, 1, 2, 20.0f, 0.456434f, 6492.48f, 0.61433f, { 391.349f, 1615.7f, 4546.12f }, { 2.26228f, 0.944499f, 3.22942f }, { 1.2584f, 0.316852f, 0.54022f }, 20.0f, 0.863381f, 3600.59f, 0.488706f, 0.2f, 2, 19797.9f, 0.757723f, 0, 2.0f, 0.1f, { 1.0f, 6.5f, 13.0f, 20.0f, 27.0f }, { -0.840655f, -0.970641f, -0.893899f, 2.13655f, 7.08402f }, 4.0f, { -8.0f, -11.0f, -16.5f, -24.0f, -32.5f }, { -0.220328f, -0.487896f, -0.446974f, 2.75495f, 8.13393f }, 2.93219f, 0.854492f, 0, 0.0f, 0.180461f }, // 2
+    { "Multi-head tape", -2.251f, 1, 2, 65.4884f, 0.469212f, 5392.24f, 0.742521f, { 318.479f, 838.249f, 2392.32f }, { 1.86902f, 2.63518f, 2.50163f }, { 0.850539f, 0.669165f, 0.851642f }, 44.922f, 0.516959f, 13836.6f, -14.4088f, 0.235048f, 2, 18038.4f, 0.5f, 0, 2.0f, 0.0f, { -2.5f, 4.5f, 10.0f, 17.5f, 23.5f }, { -0.0837695f, 0.748236f, 3.74017f, 9.7918f, 11.5231f }, 4.0f, { -2.0f, -6.0f, -12.0f, -19.0f, -26.0f }, { -0.166855f, 0.401518f, 3.5522f, 9.24598f, 11.1023f }, 19.4281f, 5.7373f, 1, 0.25f, 0.0f }, // 3
+    { "Valve tape", 5.51964f, 2, 2, 49.5164f, 0.435591f, 4011.83f, 0.722344f, { 456.145f, 140.679f, 1527.98f }, { 0.209992f, 4.94757f, 2.58513f }, { 0.52176f, 0.961317f, 0.576351f }, 394.3f, -8.22651f, 685.839f, -4.1565f, 0.722238f, 1, 18755.0f, 0.789793f, 0, 2.5f, 0.1f, { 12.0f, 17.5f, 23.0f, 28.5f, 32.0f }, { -1.88646f, 0.383507f, 3.57052f, 7.054f, 5.39857f }, 6.0f, { -16.0f, -21.5f, -26.5f, -34.0f, -37.0f }, { -0.65009f, 1.86353f, 4.8698f, 9.57177f, 7.49623f }, 4.20467f, 17.4561f, 1, 0.0f, 0.0f }, // 4
+    { "Worn cassette", -8.86604f, 1, 2, 20.0f, 0.69133f, 16880.5f, 1.11531f, { 237.081f, 1194.14f, 4851.78f }, { 1.08345f, 4.04332f, 7.11126f }, { 0.407426f, 0.34495f, 0.263085f }, 684.787f, 0.0535172f, 5100.56f, 0.465964f, 0.302413f, 2, 20000.0f, 0.786258f, 1, 10.0f, 0.0f, { -4.0f, -3.5f, -3.0f, 17.5f, 26.0f }, { -0.610646f, -0.711818f, 3.04358f, 8.28427f, 9.45528f }, 6.0f, { -4.0f, -9.0f, -16.0f, -24.0f, -29.5f }, { -0.044168f, 0.953694f, 7.20821f, 11.5297f, 10.9509f }, 9.88726f, 3.2959f, 1, 0.0f, 0.0f }, // 5
+    { "Pedal BBD", -2.81596f, 1, 4, 20.0f, 0.690276f, 5141.28f, 0.482991f, { 242.244f, 2589.36f, 5408.55f }, { -0.196252f, 9.06572f, -3.53383f }, { 0.489213f, 0.775448f, 1.19375f }, 20.0f, -2.70674f, 9129.84f, -9.28753f, 1.22182f, 2, 19013.7f, 0.9f, 0, 3.0f, 0.2f, { 0.0f, 5.5f, 12.5f, 21.0f, 27.0f }, { -0.175573f, 0.23276f, 3.28672f, 11.8467f, 11.8773f }, 10.0f, { -1.5f, -5.0f, -11.0f, -20.0f, -26.0f }, { -0.267354f, -0.026251f, 2.75091f, 11.3709f, 11.2476f }, 5.80116f, 0.854492f, 0, 0.0f, 0.0f }, // 6
+    { "Compact BBD", -3.12334f, 2, 3, 20.0f, 0.760976f, 2991.5f, 0.482356f, { 60.709f, 1598.95f, 3474.51f }, { -4.19484f, 11.3889f, -8.884f }, { 1.78578f, 0.643397f, 0.578905f }, 2051.19f, 0.0135183f, 8886.75f, -0.134129f, 2.412f, 1, 20000.0f, 0.560531f, 0, 1.5f, 0.0f, { 1.5f, 7.0f, 14.0f, 23.5f, 30.0f }, { 0.732635f, 1.40268f, 4.60754f, 13.6931f, 14.1506f }, 10.0f, { -1.5f, -5.5f, -12.0f, -21.0f, -27.0f }, { -0.128677f, 0.104115f, 2.96528f, 11.5069f, 11.3199f }, 0.0f, 0.3f, 1, 0.0f, 0.0f }, // 7
+    { "Oil drum", -1.38107f, 1, 3, 154.056f, 0.564493f, 7753.99f, 0.579555f, { 268.443f, 830.065f, 6057.17f }, { 3.51655f, 4.85009f, -4.40393f }, { 1.24334f, 0.726258f, 0.446899f }, 299.075f, 0.0186919f, 12897.8f, -21.2922f, 0.262143f, 2, 20000.0f, 0.9f, 0, 4.0f, 0.5f, { -3.5f, 2.0f, 9.0f, 16.5f, 26.0f }, { -0.358627f, -0.563966f, -0.500326f, 1.85692f, 10.8461f }, 10.0f, { -3.0f, -4.0f, -9.0f, -16.0f, -26.0f }, { -0.151738f, -0.553161f, -0.506919f, 1.93399f, 11.1829f }, 0.0f, 0.976562f, 0, 0.0f, 0.104361f }, // 8
+    { "Magnetic drum", -5.88568f, 1, 2, 66.054f, 0.548158f, 18401.6f, 0.7149f, { 686.524f, 757.765f, 1843.11f }, { 4.73138f, 3.12734f, -8.8001f }, { 0.231439f, 0.829465f, 0.535505f }, 640.014f, 0.156167f, 1782.34f, 0.50338f, 0.20909f, 1, 20000.0f, 0.594265f, 1, 10.0f, 0.05f, { -2.5f, 18.5f, 27.0f, 28.0f, 29.5f }, { -2.6094f, 6.8182f, 7.69722f, 3.77865f, -0.19702f }, 10.0f, { -17.5f, -25.0f, -29.5f, -34.5f, -37.5f }, { 2.5642f, 10.8213f, 9.43714f, 8.45828f, 5.72546f }, 17.7201f, 2.80762f, 1, 0.25f, 0.0f }, // 9
+    { "Phone line", -3.09838f, 1, 3, 114.552f, 0.320773f, 4205.33f, 0.436252f, { 199.292f, 308.364f, 3041.49f }, { -24.0f, 3.0844f, 20.8881f }, { 3.80068f, 0.323396f, 0.513323f }, 20.0f, -0.832421f, 10312.3f, -13.103f, 0.683657f, 2, 19252.8f, 0.9f, 0, 2.0f, 0.2f, { -5.0f, 0.0f, 8.5f, 16.0f, 24.0f }, { -0.674934f, -1.04938f, -0.561374f, 3.12826f, 9.00658f }, 4.0f, { -4.0f, -7.5f, -13.5f, -20.5f, -28.5f }, { -0.331327f, -0.370545f, 0.364539f, 4.19095f, 9.90962f }, 0.0f, 0.3f, 1, 0.5f, 0.0f }, // 10
+    { "Medium wave", -0.54103f, 1, 4, 106.456f, 2.03323f, 8964.16f, 0.472308f, { 79.9895f, 2580.98f, 4493.92f }, { -17.178f, 3.80314f, 7.35629f }, { 1.36712f, 0.648084f, 1.02991f }, 20.0f, -2.68064f, 12427.4f, -9.68802f, 0.633994f, 2, 20000.0f, 0.9f, 0, 3.0f, 0.35f, { -5.5f, 1.5f, 10.0f, 19.0f, 26.0f }, { -0.598124f, -1.04005f, -0.510148f, 6.62485f, 9.55967f }, 10.0f, { -2.5f, -6.5f, -12.5f, -20.5f, -27.5f }, { -0.353263f, -0.422713f, 0.390311f, 7.62352f, 10.693f }, 0.0f, 0.3f, 1, 0.0f, 0.0f }, // 11
+    { "Broadcast FM", -4.79825f, 1, 2, 29.6298f, 0.870914f, 20000.0f, 0.779688f, { 400.569f, 2187.93f, 4282.54f }, { -2.32962f, 2.80952f, 0.0792853f }, { 0.277098f, 0.298565f, 1.6032f }, 742.723f, -1.3204f, 1364.69f, -0.827934f, 0.616751f, 1, 20000.0f, 0.68477f, 1, 10.0f, 0.0f, { -4.0f, -3.5f, -3.0f, 16.5f, 18.5f }, { -0.769747f, -1.23283f, 1.10902f, 9.25515f, 6.78727f }, 6.0f, { -3.0f, -7.5f, -13.5f, -21.0f, -26.5f }, { -0.353731f, 0.0420548f, 4.25802f, 11.3522f, 10.9374f }, 0.0f, 0.3f, 1, 0.0f, 0.0f }, // 12
+    { "Distant station", -17.6637f, 1, 0, 72.947f, 0.353113f, 1208.24f, 1.692f, { 138.532f, 2437.81f, 2572.06f }, { -11.1883f, 6.05012f, 24.0f }, { 0.353727f, 1.19769f, 0.586143f }, 653.225f, 0.501476f, 17276.0f, -7.32192f, 0.2f, 0, 20.0f, 0.5f, 1, 10.0f, 0.0f, { -3.5f, 10.0f, 26.5f, 28.0f, 29.0f }, { -3.28235f, -0.739841f, 8.93695f, 5.4145f, 0.996431f }, 20.0f, { -11.5f, -19.0f, -27.5f, -34.0f, -38.0f }, { -0.509373f, 3.69944f, 10.3286f, 10.5709f, 8.66495f }, 3.95791f, 0.3f, 1, 0.25f, 0.928964f }, // 13
+    { "Walkie-talkie", 7.19458f, 1, 3, 1062.0f, 0.95743f, 20000.0f, 1.1701f, { 83.1402f, 1848.95f, 3158.2f }, { -5.8475f, 4.33502f, 1.17308f }, { 0.295697f, 1.06554f, 1.85187f }, 1770.02f, 0.213067f, 15113.7f, -4.99492f, 0.283753f, 2, 18871.3f, 0.781119f, 1, 10.0f, 0.0f, { -3.0f, 11.0f, 18.5f, 27.0f, 28.5f }, { -3.87236f, -4.51059f, -1.11215f, 5.50315f, 5.02987f }, 10.0f, { -14.0f, -19.0f, -25.0f, -31.5f, -36.0f }, { -0.261903f, -0.710867f, 2.89353f, 8.61919f, 10.5043f }, 0.0f, 0.3f, 1, 0.0f, 0.0f }, // 14
+    { "Pristine digital", -2.82462f, 2, 1, 20.0f, 0.813784f, 18039.7f, 0.664543f, { 20.0f, 20.0f, 20000.0f }, { -1.22568f, -1.65499f, 9.2214f }, { 0.446534f, 0.77598f, 1.31087f }, 6115.12f, 0.0216913f, 19636.9f, -0.313259f, 0.30125f, 0, 20.0f, 0.9f, 0, 3.0f, 0.05f, { -21.5f, -21.5f, -21.5f, -21.5f, -19.0f }, { -0.0292173f, -0.064032f, -0.138827f, -0.401965f, -0.874552f }, 1.5f, { 1.0f, 0.5f, -1.0f, -2.5f, -7.0f }, { -0.0113806f, -0.0357786f, -0.065435f, -0.2626f, -0.412828f }, 0.0f, 0.3f, 1, 0.0f, 0.0f }, // 15
+    { "Warm analog", -4.96606f, 2, 1, 20.0f, 0.830725f, 19137.1f, 0.652391f, { 103.409f, 359.719f, 4155.71f }, { 0.208062f, 1.85907f, 2.32147f }, { 1.33582f, 0.202622f, 0.504244f }, 3059.9f, 0.0258991f, 20000.0f, -12.2945f, 0.308027f, 0, 573.098f, 0.9f, 0, 1.5f, 0.2f, { -7.0f, -2.0f, 4.0f, 11.0f, 18.0f }, { -0.0501393f, 0.0229567f, 0.664699f, 4.69622f, 10.8144f }, 2.0f, { -1.0f, -3.0f, -9.0f, -16.5f, -25.5f }, { -0.0301637f, -0.0509662f, 0.650617f, 4.66633f, 10.8106f }, 2.70642f, 0.732422f, 0, 0.25f, 0.0f }, // 16
+    { "Digital ensemble", -2.97406f, 1, 2, 27.2916f, 0.780637f, 19625.3f, 0.619376f, { 20.0f, 612.317f, 13340.5f }, { -0.718267f, -2.15304f, -1.53021f }, { 1.14409f, 1.3341f, 0.479053f }, 20.0f, 0.806828f, 15367.8f, -4.34553f, 0.224882f, 1, 20000.0f, 0.655349f, 0, 2.0f, 0.0f, { -16.5f, -10.5f, -4.0f, 3.5f, 10.0f }, { -0.253335f, -0.235357f, -0.228224f, 0.549333f, 4.92135f }, 2.0f, { 1.0f, -1.0f, -4.5f, -10.5f, -18.0f }, { -0.24154f, -0.186458f, -0.0912086f, 0.798513f, 5.39657f }, 37.2017f, 0.3f, 1, 0.25f, 0.0f }, // 17
+    { "Analog ensemble", -2.37488f, 2, 3, 20.0f, 0.933516f, 20000.0f, 0.59245f, { 194.511f, 956.654f, 11081.1f }, { 2.12229f, 0.546288f, -7.14434f }, { 0.215882f, 0.672339f, 0.284326f }, 787.587f, 0.061451f, 7061.95f, -2.9939f, 0.215245f, 1, 20000.0f, 0.5f, 1, 10.0f, 0.0f, { -4.0f, -4.0f, -3.5f, -3.0f, 18.0f }, { -0.52367f, -1.05207f, -1.60823f, 2.17883f, 7.66004f }, 6.0f, { -2.0f, -4.5f, -9.5f, -17.0f, -25.0f }, { -0.234969f, -0.401676f, 0.199066f, 6.76012f, 11.2206f }, 4.75712f, 1.58691f, 0, 0.25f, 0.0f }, // 18
+    { "Pedal ensemble", -3.04966f, 1, 3, 28.1308f, 0.439726f, 19998.7f, 0.368103f, { 45.83f, 1305.15f, 13564.3f }, { -2.14406f, -0.0193255f, -6.4071f }, { 0.734277f, 0.587245f, 0.394059f }, 967.818f, 0.0254549f, 17942.5f, -13.1806f, 0.339663f, 2, 19997.7f, 0.712364f, 0, 1.5f, 0.2f, { -9.5f, -3.5f, 2.5f, 9.0f, 16.0f }, { 0.104774f, 0.177603f, 0.847061f, 4.82123f, 11.0061f }, 2.0f, { 0.0f, -2.5f, -7.5f, -14.5f, -23.0f }, { 0.12476f, 0.158336f, 0.825714f, 4.86623f, 11.041f }, 11.032f, 1.58691f, 0, 0.5f, 0.0f }, // 19
+    { "Seasick", -3.69211f, 1, 2, 50.7018f, 0.300011f, 20000.0f, 0.38013f, { 120.217f, 2532.47f, 7264.68f }, { -2.268f, 4.92563f, -7.17166f }, { 1.56456f, 0.366091f, 0.220485f }, 20.0f, -9.81978f, 12584.1f, -1.74428f, 0.456769f, 1, 20000.0f, 0.615931f, 1, 10.0f, 0.05f, { -4.5f, -3.5f, -3.0f, -2.5f, 18.0f }, { -0.397887f, -0.945412f, -1.575f, 2.89011f, 7.59077f }, 10.0f, { -1.5f, -4.5f, -9.5f, -16.5f, -24.0f }, { -0.145291f, -0.243837f, 0.375477f, 7.61058f, 11.2382f }, 16.6582f, 5.49316f, 0, 0.0f, 0.0f }, // 20
+    { "Hot glow", -5.50456f, 1, 2, 40.9793f, 1.12995f, 19207.1f, 0.723754f, { 150.332f, 1419.08f, 6095.49f }, { 2.1337f, 1.35987f, -3.48047f }, { 1.10959f, 0.431917f, 0.467747f }, 20.0f, 0.308836f, 4664.49f, 0.49711f, 0.946417f, 1, 20000.0f, 0.614534f, 0, 2.0f, 0.0f, { 3.5f, 9.5f, 16.5f, 22.5f, 28.0f }, { -0.130991f, 3.65213f, 9.29263f, 10.0834f, 9.912f }, 4.0f, { -7.0f, -13.0f, -19.5f, -26.0f, -32.5f }, { -0.105769f, 3.93709f, 9.42053f, 10.2467f, 10.2004f }, 7.66446f, 0.3f, 1, 0.0f, 0.0f }, // 21
+    { "Thick", -3.01752f, 1, 2, 32.7641f, 0.938427f, 4245.47f, 0.728752f, { 112.433f, 2089.32f, 3933.2f }, { 3.45901f, -0.102724f, -0.794375f }, { 0.442224f, 0.903194f, 0.828666f }, 20.0f, -0.594425f, 12608.3f, -2.83029f, 0.200075f, 1, 19901.2f, 0.658609f, 0, 3.0f, 0.35f, { -6.0f, 1.0f, 13.0f, 24.0f, 29.5f }, { -0.983887f, -1.68759f, 0.79866f, 10.2916f, 9.72625f }, 10.0f, { -4.0f, -9.0f, -15.5f, -25.0f, -31.5f }, { -0.491926f, -0.352279f, 1.99458f, 11.1616f, 11.1796f }, 5.47566f, 0.610352f, 0, 0.25f, 0.453141f }, // 22
+    { "Battered", -1.62534f, 2, 4, 20.0579f, 0.862959f, 20000.0f, 0.731266f, { 108.787f, 1371.57f, 5126.79f }, { 1.04964f, 0.681435f, 2.59303f }, { 0.798408f, 0.568001f, 0.319769f }, 1085.44f, 0.500517f, 12570.9f, -0.7305f, 0.207486f, 0, 4090.97f, 0.9f, 0, 2.5f, 0.0f, { 12.5f, 16.5f, 21.0f, 25.0f, 28.0f }, { -2.49727f, -2.87249f, -0.866957f, 1.74499f, 0.0278259f }, 3.0f, { -21.5f, -25.5f, -31.0f, -35.0f, -37.5f }, { -0.251575f, -0.512827f, 1.81951f, 4.26426f, 1.9846f }, 1.83958f, 0.488281f, 0, 0.0f, 0.0f }, // 23
+    { "Squashed", -3.12533f, 1, 2, 20.0f, 0.809808f, 20000.0f, 0.684896f, { 26.5613f, 20.0f, 12174.3f }, { -1.46464f, -0.760623f, -0.278672f }, { 0.686689f, 1.44068f, 0.909721f }, 2993.37f, 0.0349053f, 20000.0f, -12.7851f, 0.318699f, 0, 1338.71f, 0.9f, 1, 10.0f, 0.05f, { -4.0f, -3.5f, -3.0f, 16.5f, 18.5f }, { -0.611373f, -1.24185f, -0.835724f, 9.29469f, 6.6795f }, 10.0f, { -2.0f, -6.0f, -11.5f, -20.0f, -25.5f }, { -0.299778f, -0.230904f, 1.78975f, 11.3675f, 10.9826f }, 0.0f, 0.3f, 1, 0.0f, 0.0f }, // 24
+    { "Fuzzed", -1.01043f, 1, 4, 35.8879f, 0.911123f, 6106.26f, 0.350947f, { 309.205f, 1696.84f, 5150.89f }, { 2.33564f, 3.79048f, -2.86249f }, { 0.202029f, 0.677049f, 0.84248f }, 20.0f, 0.998933f, 11694.5f, -2.30545f, 7.47288f, 1, 20000.0f, 0.867189f, 0, 4.0f, 0.5f, { 18.5f, 25.5f, 34.5f, 40.0f, 40.0f }, { 0.21774f, 4.537f, 11.6382f, 11.2436f, 5.80887f }, 20.0f, { -16.0f, -23.5f, -32.0f, -37.0f, -45.5f }, { -0.390036f, 4.15838f, 10.6702f, 9.69831f, 11.8635f }, 1.95159f, 0.366211f, 0, 0.0f, 0.0f }, // 25
+    { "Honky", 2.61839f, 1, 0, 20.0f, 1.1272f, 2364.91f, 1.06431f, { 65.2435f, 876.264f, 1905.97f }, { 12.2431f, 9.55826f, 6.16364f }, { 0.200044f, 0.599271f, 1.2074f }, 663.842f, -11.7396f, 1183.74f, -5.17557f, 0.731942f, 1, 17990.4f, 0.869276f, 1, 10.0f, 0.0f, { 18.0f, 27.5f, 29.0f, 37.0f, 37.5f }, { -3.30823f, 4.78884f, 0.988916f, 1.86187f, -3.2683f }, 10.0f, { -24.0f, -33.5f, -37.5f, -40.0f, -48.0f }, { 0.34125f, 9.04953f, 7.2557f, 3.95791f, 5.5042f }, 0.0f, 0.3f, 1, 0.5f, 0.154533f }, // 26
+    { "Haze", -1.55786f, 0, 2, 42.2154f, 0.805707f, 4119.65f, 0.639709f, { 100.847f, 1091.31f, 4750.45f }, { 2.58247f, -1.16714f, 1.04341f }, { 0.568099f, 0.383122f, 0.946543f }, 20.0f, 1.00024f, 11259.0f, -2.61332f, 0.208812f, 2, 18012.1f, 0.681667f, 0, 2.0f, 0.35f, { -7.0f, -0.5f, 12.5f, 24.0f, 29.5f }, { -0.963757f, -1.7081f, 0.686371f, 10.2175f, 9.59345f }, 10.0f, { -3.5f, -8.5f, -15.0f, -24.5f, -30.5f }, { -0.496652f, -0.336635f, 2.05427f, 11.2696f, 10.9486f }, 5.77888f, 0.366211f, 0, 0.25f, 0.652189f }, // 27
+    { "Smeared", -8.94716f, 2, 4, 20.0f, 0.492013f, 20000.0f, 0.643251f, { 188.801f, 685.481f, 3103.23f }, { 6.35888f, -3.43986f, 6.13728f }, { 0.370948f, 0.84701f, 0.393673f }, 91.0192f, 0.0647214f, 18434.2f, -7.3336f, 0.200846f, 2, 20000.0f, 0.837152f, 0, 1.5f, 0.0f, { -35.5f, -35.5f, -35.5f, -35.5f, -35.5f }, { 0.305501f, 0.266415f, 0.177924f, -0.118099f, -0.647343f }, 1.5f, { 1.0f, 0.5f, -1.0f, -3.0f, -8.0f }, { 0.321487f, 0.292818f, 0.249465f, 0.0460353f, -0.08969f }, 6.92246f, 0.976562f, 0, 0.25f, 0.969375f }, // 28
+    { "Scattered", -1.21429f, 1, 4, 47.1641f, 0.74395f, 18047.9f, 0.911224f, { 51.8869f, 395.561f, 4576.43f }, { -3.8539f, -1.81624f, -2.30042f }, { 0.498787f, 1.56424f, 0.789751f }, 1763.85f, 0.496056f, 2477.54f, 0.357823f, 1.18817f, 1, 16570.1f, 0.5f, 1, 2.5f, 0.05f, { -29.0f, -26.0f, -20.0f, -18.5f, -17.0f }, { 1.10731f, 4.82487f, 4.18061f, 2.1756f, -0.222309f }, 2.0f, { -5.5f, -12.0f, -18.0f, -24.5f, -31.5f }, { 1.60869f, 6.38667f, 7.18484f, 7.17175f, 7.24617f }, 4.05908f, 0.3f, 1, 0.0f, 0.128957f }, // 29
+    { "Roomy", -1.89623f, 0, 4, 43.0339f, 1.07844f, 20000.0f, 0.463277f, { 298.265f, 449.106f, 11875.7f }, { 5.47649f, -9.11637f, -7.58166f }, { 1.12066f, 0.323882f, 0.46237f }, 1086.32f, 0.498981f, 1556.2f, 0.416795f, 1.68665f, 1, 17848.1f, 0.5f, 0, 3.0f, 0.05f, { -21.5f, -21.5f, -21.5f, -21.5f, -18.0f }, { 0.62065f, 0.41943f, 0.295318f, 0.0419905f, -0.671558f }, 1.5f, { -2.5f, -3.0f, -7.5f, -7.5f, -16.0f }, { 0.760015f, 0.585415f, 0.805053f, 0.551725f, 0.993523f }, 21.4322f, 0.3f, 1, 0.0f, 0.979426f }, // 30

+ 7 - 0
src/core/Effects.cpp

@@ -3301,6 +3301,13 @@ EffectSlot makeEffectSlot (EffectKind kind)
     return slot;
 }
 
+void upgradeLoadedEffectParams (EffectSlot& slot, std::size_t savedCount) noexcept
+{
+    // round 147: Prism Multiband saved before its measured Dynamic phase engine keeps the round-108 construction
+    if (slot.kind == EffectKind::prismMultiband && savedCount <= (std::size_t) dyn::prism::dynamicEngine)
+        slot.params[(std::size_t) dyn::prism::dynamicEngine] = 0.0f;
+}
+
 std::unique_ptr<Effect> makeParallelEffect (const EffectSlot& slot)
 {
     return std::make_unique<ParallelEffect> (slot);

+ 3 - 0
src/core/Effects.h

@@ -34,6 +34,9 @@ std::string formatEffectParam (EffectKind kind, int param, float value01, double
 std::string formatEffectParam (EffectKind kind, int param, float value01, double bpm, const EffectParams& context);
 
 EffectSlot makeEffectSlot (EffectKind kind);
+// A slot loaded from a project that stored `savedCount` parameters: parameters added later that switch an engine
+// to a newer construction get the value that keeps the old sound (round 147: Prism's measured Dynamic phase).
+void upgradeLoadedEffectParams (EffectSlot& slot, std::size_t savedCount) noexcept;
 
 // 7-band parametric EQ. Parameters: band b uses [4b .. 4b+3] = type, frequency, gain, Q;
 // [28] = output; [29 + b] = cut slope (1 to 4 biquads: 12/24/36/48 dB per octave).

+ 31 - 2
src/core/FabFilterStates.cpp

@@ -253,7 +253,7 @@ int fromProC3 (const State& s, EffectSlot& slot)
 // 134 input level, 136 output level, 139 processing mode, 140 oversampling, 141 look-ahead on
 int fromProMB (const State& s, EffectSlot& slot)
 {
-    if (slot.kind != EffectKind::prismMultiband || ! s.named || s.count != 151 || ! finiteAll (s, 142))
+    if (slot.kind != EffectKind::prismMultiband || ! s.named || s.count != 151 || ! finiteAll (s, 143))
         return 0;
     using namespace dyn::prism;
     auto& p = slot.params;
@@ -344,6 +344,19 @@ int fromProMB (const State& s, EffectSlot& slot)
         la = std::max (la, (double) s.at (base + 12));
         set (bandLookaheadParam (b), linValue (s.at (base + 12), 0.0, 20.0)); // round 128: the band's own
         set (bandPanParam (b), (float) ((std::clamp ((double) s.at (base + 14), -1.0, 1.0) + 1.0) * 0.5)); // round 144: mid / side
+        // round 147: the expert panel (read black-box from the trial's states; the reference ignores it while its
+        // Expert mode, slot 142, is off): 15 side-chain filtering (0 band, 1 free), 16 / 17 its low / high (log2 Hz),
+        // 18 side-chain input (0 plug-in, 1 external), 19 stereo link (the parameter's own value), 20 link mode
+        if (s.at (142) >= 0.5f)
+        {
+            set (bandLink0 + b, clamp01 (s.at (base + 19)));
+            set (bandLinkMode0 + b, s.at (base + 20) >= 0.5f ? 1.0f : 0.0f);
+            set (bandScFree0 + b, s.at (base + 15) >= 0.5f ? 1.0f : 0.0f);
+            set (bandScLow0 + b, scFilterValue (std::pow (2.0, (double) s.at (base + 16))));
+            set (bandScHigh0 + b, scFilterValue (std::pow (2.0, (double) s.at (base + 17))));
+            if (s.at (base + 18) >= 0.5f)
+                set (Global::scExternal, 1.0f);
+        }
         if (b == 0)
         {
             // the slope: the steeper of the band's sides, to our nearest
@@ -351,6 +364,17 @@ int fromProMB (const State& s, EffectSlot& slot)
             set (Global::slope, dbOct < 18.0 ? 0.0f : (dbOct < 36.0 ? 0.5f : 1.0f));
         }
     }
+    // round 147: each crossover's own slope — the band below's high slope, or the band above's low slope (gaps)
+    for (int k = 0; k + 1 < std::min (nb, nseg); ++k)
+    {
+        const auto& lo = segs[(std::size_t) k];
+        const auto& hi = segs[(std::size_t) (k + 1)];
+        const auto norm = lo.ref >= 0 ? s.at ((std::size_t) (22 * lo.ref + 4)) : (hi.ref >= 0 ? s.at ((std::size_t) (22 * hi.ref + 2)) : -1.0f);
+        if (norm < 0.0f)
+            continue;
+        const auto dbOct = 6.0 + 42.0 * std::clamp ((double) norm, 0.0, 1.0);
+        set (xoverSlope0 + k, crossoverSlopeValue (dbOct < 18.0 ? 12 : (dbOct < 36.0 ? 24 : 48)));
+    }
     set (Global::lookahead, s.at (141) >= 0.5f ? linValue (la, 0.0, 20.0) : 0.0f);
     set (Global::mix, clamp01 (s.at (133)));
     set (Global::input, linValue (levelDb (s.at (134)), -36.0, 36.0));
@@ -418,7 +442,8 @@ int fromProG (const State& s, EffectSlot& slot)
 // ---------------------------------------------------------------- Saturn 2 -> Ember Saturator
 // layout (FFBS v1, 951 values): 0 input gain dB, 2 output gain dB, 5 mix %, 6 band count, band b at 7 + 17b:
 // 2 dynamics, 3 style, 4 drive (norm), 6 … 9 bass / mid / treble / presence dB, 10 mix %, 11 level, 13 enabled,
-// 15 crossover (log2 Hz, the band's upper edge), 16 crossover slope (6, 12, 24, 36, 48)
+// 15 crossover (log2 Hz, the band's upper edge), 16 crossover slope (6, 12, 24, 36, 48); round 147: 5 drive pan,
+// 12 band pan (−1 … +1), 695 the channel mode (0 left / right, 1 mid / side)
 int fromSaturn2 (const State& s, EffectSlot& slot)
 {
     if (slot.kind != EffectKind::ember || s.named || s.count != 951 || ! finiteAll (s, 7 + 17 * 6))
@@ -466,6 +491,9 @@ int fromSaturn2 (const State& s, EffectSlot& slot)
             const auto st = roundIndex (s.at (base + 14));
             set (bandExtra (b, 1), st == 1 ? 0.5f : (st == 2 || st == 3) ? 1.0f : 0.0f);
         }
+        // round 147 (measured on the trial, REA_rodada147b): drive pan at 5 and band pan at 12, both −1 … +1
+        set (bandDrivePanParam (b), (float) (0.5 + 0.5 * std::clamp ((double) s.at (base + 5), -1.0, 1.0)));
+        set (bandPanParam (b), (float) (0.5 + 0.5 * std::clamp ((double) s.at (base + 12), -1.0, 1.0)));
         if (b == 0)
         {
             static constexpr int slopes[5] { 12, 12, 24, 24, 48 };
@@ -477,6 +505,7 @@ int fromSaturn2 (const State& s, EffectSlot& slot)
     set (inputGain, linValue (std::clamp ((double) s.at (0), -24.0, 24.0), -24.0, 24.0)); // round 128
     set (output, linValue (s.at (2), -18.0, 18.0));
     set (autoGain, 1.0f); // Saturn compensates its level as the drive rises (§4)
+    set (channelMode, s.at (695) >= 0.5f ? 1.0f : 0.0f); // round 147: the channel mode (0 left / right, 1 mid / side)
     return n;
 }
 

+ 69 - 1
src/core/LynxTune.cpp

@@ -137,11 +137,55 @@ const EffectInfo& info()
         e.params.push_back ({ "Drive", 0.0f });
         e.params.push_back ({ "Wide formant", 0.0f });
         e.params.push_back ({ "Output", 0.5f });
+        // round 147: an illegal note's direction (C … B) and the keyboard's range
+        static const char* const dirNames[12] { "C dir", "C# dir", "D dir", "D# dir", "E dir", "F dir", "F# dir", "G dir", "G# dir", "A dir", "A# dir", "B dir" };
+        for (const auto* nm : dirNames)
+            e.params.push_back ({ nm, 0.0f });
+        e.params.push_back ({ "Range low", 0.0f });
+        e.params.push_back ({ "Range high", 1.0f });
         return e;
     }();
     return i;
 }
 
+NoteDir noteDir (float v) noexcept { return (NoteDir) stepped (v, 3); }
+int rangeNote (float v) noexcept { return std::clamp ((int) std::lround (std::clamp (v, 0.0f, 1.0f) * 127.0f), 0, 127); }
+float rangeNoteValue (int note) noexcept { return (float) std::clamp (note, 0, 127) / 127.0f; }
+const char* rangePresetName (int k) noexcept
+{
+    static const char* const n[rangePresets] { "Bass", "Baritone", "Tenor", "Alto", "Mezzo", "Soprano", "Generic" };
+    return n[std::clamp (k, 0, rangePresets - 1)];
+}
+std::pair<int, int> rangePresetNotes (int k) noexcept
+{
+    // [model] the classical voice ranges (bass E2–E4, baritone A2–A4, tenor C3–C5, alto F3–F5, mezzo A3–A5, soprano
+    // C4–C6) widened by a third on each side; Generic = the whole keyboard (no note bypassed)
+    static constexpr std::pair<int, int> r[rangePresets] { { 36, 68 }, { 41, 73 }, { 44, 76 }, { 49, 81 }, { 53, 85 }, { 56, 88 }, { 0, 127 } };
+    return r[std::clamp (k, 0, rangePresets - 1)];
+}
+int targetNote (double sung, std::uint16_t legal, int previous, double hysteresis, const NoteDir* dirs) noexcept
+{
+    const auto t = vocal::nearestNote (sung, legal, previous, hysteresis);
+    legal &= 0xfff;
+    if (dirs == nullptr || legal == 0 || t == previous)
+        return t;
+    const auto base = (int) std::lround (sung);
+    const auto pc = ((base % 12) + 12) % 12;
+    if ((legal >> pc) & 1u)
+        return t;
+    const auto d = dirs[pc];
+    if (d == NoteDir::nearest)
+        return t;
+    const int step = d == NoteDir::up ? 1 : -1;
+    for (int k = 1; k <= 12; ++k)
+    {
+        const auto n = base + step * k;
+        if ((legal >> (((n % 12) + 12) % 12)) & 1u)
+            return n;
+    }
+    return t;
+}
+
 std::string paramText (int param, float v)
 {
     char t[48];
@@ -191,6 +235,17 @@ std::string paramText (int param, float v)
     }
     if ((param >= noteC && param < noteC + 12) || (param >= bypassC && param < bypassC + 12))
         return onOff();
+    if (param >= noteDirC && param < noteDirC + 12)
+    {
+        static const char* const n[3] { "Nearest", "Up", "Down" };
+        return n[(int) noteDir (v)];
+    }
+    if (param == rangeLow || param == rangeHigh)
+    {
+        static const char* const names[12] { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };
+        const auto k = rangeNote (v);
+        return std::string (names[k % 12]) + std::to_string (k / 12 - 1);
+    }
     std::snprintf (t, sizeof t, "%.2f", (double) v);
     return t;
 }
@@ -278,6 +333,16 @@ public:
         const auto vibDelay = vibratoOnsetMs (p[vibratoDelay]) * 0.001;
         const auto vibOnset = vibratoOnsetMs (p[vibratoOnset]) * 0.001;
         auto mask = (std::uint16_t) (vocal::scaleMask (sc, keyIndex (p[key]), notes) & notes);
+        // round 147: the illegal notes' directions and the keyboard range (outside it: uncorrected)
+        std::array<NoteDir, 12> dirs {};
+        bool anyDir = false;
+        for (int k = 0; k < 12; ++k)
+        {
+            dirs[(std::size_t) k] = noteDir (p[(std::size_t) (noteDirC + k)]);
+            anyDir = anyDir || dirs[(std::size_t) k] != NoteDir::nearest;
+        }
+        const auto lowNote = rangeNote (p[rangeLow]), highNote = rangeNote (p[rangeHigh]);
+        const bool ranged = lowNote > 0 || highNote < 127;
 
         // MIDI targets: the pitch classes held on the source channel (none held: the scale)
         const auto ch = midiChannelIndex (p[midiChannel]);
@@ -375,7 +440,8 @@ public:
                         // the first notes of the next one, by up to half a semitone the wrong way)
                         shift = 0.0;
                     }
-                    const auto t = vocal::nearestNote (ignoreVib ? center2 : sung, mask, target, hysteresis);
+                    const auto t = anyDir ? targetNote (ignoreVib ? center2 : sung, mask, target, hysteresis, dirs.data())
+                                          : vocal::nearestNote (ignoreVib ? center2 : sung, mask, target, hysteresis);
                     // round 135w: Tolerance time — a new note must last that long before the target moves to it
                     if (t != target && holdTime > 0.0 && target >= 0)
                     {
@@ -406,6 +472,8 @@ public:
                     wanted = (double) target - heard;
                     if (((bypass >> (((target % 12) + 12) % 12)) & 1u) != 0)
                         wanted = 0.0; // a bypassed note passes as sung
+                    if (ranged && (sung < (double) lowNote - 0.5 || sung > (double) highNote + 0.5))
+                        wanted = 0.0; // round 147: outside the keyboard's range: passes as sung
                     // flex-tune: a note far from its target is left as sung. [EXEC] Auto-Tune Pro (round 120 §5): the
                     // correction of a note d cents from its target is min (d, (1 − F) / F · (50 − d)) cents, d measured
                     // in hundredths of the gap to the next target on the sung side (a semitone in chromatic)

+ 18 - 0
src/core/LynxTune.h

@@ -18,6 +18,7 @@
 #include <array>
 #include <cstdint>
 #include <memory>
+#include <utility>
 #include <string>
 
 namespace lynx
@@ -73,8 +74,25 @@ enum Param : int
     drive,                   // 0 … 10
     wideFormant,             // on: Formant shift reaches ±12 semitones
     outputTrim,              // −24 … +24 dB
+    // round 147 (appended; the Waves Tune Real-Time role's keyboard, REA_rodada147b; defaults = the old behaviour):
+    // what an illegal (removed) note does — 0 the nearest legal note (as before), 0.5 the next legal note up, 1 the next
+    // one down — and the keyboard's range: sung notes outside [low, high] pass uncorrected
+    noteDirC,                // 12 values (C … B)
+    rangeLow = noteDirC + 12, // MIDI note = round (127 v); default 0
+    rangeHigh,               // default 127
     count
 };
+enum class NoteDir { nearest, up, down };
+NoteDir noteDir (float v) noexcept;
+int rangeNote (float v) noexcept;       // 0 … 127
+float rangeNoteValue (int note) noexcept;
+// the keyboard's range presets (LYNX's own spans, classical voice ranges with a margin): low / high MIDI notes
+constexpr int rangePresets = 7;          // Bass, Baritone, Tenor, Alto, Mezzo, Soprano, Generic (the whole keyboard)
+const char* rangePresetName (int k) noexcept;
+std::pair<int, int> rangePresetNotes (int k) noexcept;
+// The target note (a MIDI note number) for a sung pitch (notes): the nearest legal one with the hysteresis toward
+// `previous`, then an illegal note's direction (noteDirs: the 12 directions); −1 = none legal
+int targetNote (double sung, std::uint16_t legal, int previous, double hysteresis, const NoteDir* noteDirs) noexcept;
 
 constexpr int vibratoShapes = 4;
 

+ 279 - 0
src/core/MinPhaseBand.h

@@ -0,0 +1,279 @@
+#pragma once
+
+// Round 147 (Pro-MB parity, REA_rodada147 §1): Prism Multiband's measured Dynamic phase. Measured black-box on the
+// official Pro-MB trial: a band's gain g acts as a MINIMUM-PHASE filter whose magnitude is the linear-phase one,
+// |F| = 1 + (g − 1)·A(ω), A = the band's crossover magnitudes (|low-pass of its upper crossover| · |high-pass of its
+// lower one|), and the bands are in CASCADE (two adjacent bands at −12 dB give −8.2 dB at their shared crossover,
+// the product of the two bands' −4.1 dB, not a flat −12). So at rest (g = 1) the effect is exactly transparent,
+// and only a working band shifts the phase.
+//
+// Construction (LYNX's own, textbook spectral factorisation): with Linkwitz-Riley crossovers of order 2n,
+// |L| = 1 / (1 + x_h), |H| = x_l / (1 + x_l), x = (Ω / Ωc)^{2n}, Ω = tan (πf / fs) (the bilinear
+// transform's prewarped axis, so the digital magnitudes are exactly those of LYNX's digital crossovers). Then
+//   |F| = Num (u) / ((1 + x_l)(1 + x_h)),  u = Ω^{2n},  Num = (1 + x_l)(1 + x_h) + (g − 1)·x_l   (middle band)
+// and F = S², |S|² = |F|: S's poles are the two Butterworth sets of the crossovers, its zeros the left-half-plane
+// roots of Num (−s²): Num is a quadratic in u, so each of its roots t gives the 2n solutions of s^{2n} = (−1)^n u_t
+// on a circle — no general root finder. Low band: Num = g + x_h (a Butterworth set of radius g^{1/2n}·Ω_h); high
+// band: Num = 1 + g·x_l (radius Ω_l·g^{−1/2n}). The analog sections go through the bilinear transform, the DC gain
+// is set exactly (g for the low band, 1 for the others), and S is run twice.
+
+#include <algorithm>
+#include <array>
+#include <cmath>
+#include <complex>
+#include <vector>
+
+namespace lynx::minphase
+{
+inline constexpr double pi = 3.14159265358979323846;
+
+// the prewarped axis of a frequency at a sample rate (capped like LrSplit: 0.45·fs)
+inline double warp (double hz, double sampleRate) noexcept
+{
+    return std::tan (pi * std::min (hz, sampleRate * 0.45) / sampleRate);
+}
+
+// the band's crossover magnitude A at Ω (wl ≤ 0: no lower crossover, wh ≤ 0: no upper one), orders 2·nl / 2·nh
+inline double bandShare (double wl, double wh, int nl, int nh, double w) noexcept
+{
+    double a = 1.0;
+    if (wh > 0.0)
+        a /= 1.0 + std::pow (w / wh, 2.0 * nh);
+    if (wl > 0.0)
+    {
+        const auto x = std::pow (w / wl, 2.0 * nl);
+        a *= x / (1.0 + x);
+    }
+    return a;
+}
+inline double bandShare (double wl, double wh, int n, double w) noexcept { return bandShare (wl, wh, n, n, w); }
+
+// the magnitude of one band's filter at Ω: 1 + (g − 1)·A
+inline double bandMagnitude (double wl, double wh, int nl, int nh, double g, double w) noexcept
+{
+    return 1.0 + (g - 1.0) * bandShare (wl, wh, nl, nh, w);
+}
+inline double bandMagnitude (double wl, double wh, int n, double g, double w) noexcept { return bandMagnitude (wl, wh, n, n, g, w); }
+
+class Band
+{
+public:
+    static constexpr int maxSections = 8; // S: ≤ 2n = 8 roots → ≤ 4 sections, run twice
+
+    // design for gain g (linear) between Ω_l and Ω_h (≤ 0 = absent), crossovers of order 2n (n = 1, 2, 4)
+    void design (double wl, double wh, int n, double g) noexcept { design (wl, wh, n, n, g); }
+
+    // round 147: the band's two crossovers may have different orders 2·nl (lower) and 2·nh (upper)
+    void design (double wl, double wh, int nl, int nh, double g) noexcept
+    {
+        const int n = wl <= 0.0 ? nh : nl; // the edge bands have one crossover
+        gain = 1.0;
+        count = 0;
+        if (wl <= 0.0 && wh <= 0.0)
+        {
+            gain = g; // a single band: a plain gain
+            return;
+        }
+        std::array<std::complex<double>, 8> zeros {}, poles {};
+        int nz = 0, np = 0;
+        const auto butterworth = [&] (double radius, std::array<std::complex<double>, 8>& out, int& k0, int order) {
+            for (int k = 0; k < order; ++k)
+                out[(std::size_t) k0++] = std::polar (radius, pi * (2.0 * k + order + 1.0) / (2.0 * order));
+        };
+        if (wh > 0.0)
+            butterworth (wh, poles, np, nh);
+        if (wl > 0.0)
+            butterworth (wl, poles, np, nl);
+        if (wl > 0.0 && wh > 0.0 && nl != nh)
+            mixedZeros (wl, wh, nl, nh, g, zeros, nz);
+        else if (wl <= 0.0)
+            butterworth (wh * std::pow (g, 0.5 / n), zeros, nz, n);        // Num = g + x_h
+        else if (wh <= 0.0)
+            butterworth (wl * std::pow (g, -0.5 / n), zeros, nz, n);       // Num = 1 + g·x_l
+        else
+        {
+            // ρ t² + (g + ρ) t + 1 = 0, t = x_l, ρ = (Ω_l / Ω_h)^{2n}; the numerically stable quadratic roots
+            const auto rho = std::pow (wl / wh, 2.0 * n);
+            const std::complex<double> b { g + rho, 0.0 };
+            const auto sq = std::sqrt (std::complex<double> (b.real() * b.real() - 4.0 * rho, 0.0));
+            const auto q = -0.5 * (b + sq); // b > 0, so b + √D never cancels
+            const std::complex<double> t[2] { q / rho, 1.0 / q };
+            for (const auto& tr : t)
+            {
+                // s^{2n} = (−1)^n · t · Ω_l^{2n}: 2n solutions on a circle, the left-half-plane ones kept
+                const auto radius = wl * std::pow (std::abs (tr), 0.5 / n);
+                const auto phase = std::arg (tr) + (n % 2 != 0 ? pi : 0.0);
+                for (int k = 0; k < 2 * n && nz < 8; ++k)
+                {
+                    const auto s = std::polar (radius, (phase + 2.0 * pi * k) / (2.0 * n));
+                    if (s.real() < 0.0)
+                        zeros[(std::size_t) nz++] = s;
+                }
+            }
+        }
+        // sections: conjugate pairs, then the real roots two by two, a last real root alone
+        std::array<Analog, 4> num {}, den {};
+        const int sn = sections (zeros.data(), nz, num);
+        const int sd = sections (poles.data(), np, den);
+        const int m = std::max (sn, sd);
+        for (int k = 0; k < m; ++k)
+            c[(std::size_t) k] = bilinear (k < sn ? num[(std::size_t) k] : Analog {}, k < sd ? den[(std::size_t) k] : Analog {});
+        // the DC gain: g for the low band (no lower crossover), 1 otherwise; S carries its square root
+        double dc = 1.0;
+        for (int k = 0; k < m; ++k)
+        {
+            const auto& s = c[(std::size_t) k];
+            dc *= (s.b0 + s.b1 + s.b2) / (1.0 + s.a1 + s.a2);
+        }
+        const auto target = std::sqrt (wl <= 0.0 ? g : 1.0);
+        const auto k0 = target / dc;
+        c[0].b0 *= k0; c[0].b1 *= k0; c[0].b2 *= k0;
+        for (int k = 0; k < m; ++k)
+            c[(std::size_t) (m + k)] = c[(std::size_t) k]; // F = S²
+        count = 2 * m;
+    }
+
+    void reset() noexcept
+    {
+        for (auto& s : state)
+            s = {};
+    }
+
+    double process (double x) noexcept
+    {
+        for (int k = 0; k < count; ++k)
+        {
+            const auto& q = c[(std::size_t) k];
+            auto& z = state[(std::size_t) k];
+            const auto y = q.b0 * x + z[0];
+            z[0] = q.b1 * x - q.a1 * y + z[1];
+            z[1] = q.b2 * x - q.a2 * y;
+            x = y;
+        }
+        return x * gain;
+    }
+
+    // the designed digital response at ω (radians per sample)
+    std::complex<double> response (double w) const noexcept
+    {
+        std::complex<double> h { gain, 0.0 };
+        const std::complex<double> z1 = std::polar (1.0, -w), z2 = z1 * z1;
+        for (int k = 0; k < count; ++k)
+        {
+            const auto& q = c[(std::size_t) k];
+            h *= (q.b0 + q.b1 * z1 + q.b2 * z2) / (1.0 + q.a1 * z1 + q.a2 * z2);
+        }
+        return h;
+    }
+
+private:
+    struct Analog { double c2 = 0.0, c1 = 0.0, c0 = 1.0; }; // c2·s² + c1·s + c0 (the default: 1)
+
+    // a middle band whose crossovers have different orders: Num in z = (Ω / Ω_l)² is
+    // P (z) = 1 + g·z^nl + ρ·z^nh + ρ·z^(nl+nh), ρ = (Ω_l / Ω_h)^(2·nh), of degree ≤ 8: its roots by Aberth's method,
+    // started on the two circles the edge factors give (|z| = g^(−1/nl) and (g / ρ)^(1/nh)); each root z gives the
+    // left-half-plane zero s = −Ω_l·√(−z)
+    static void mixedZeros (double wl, double wh, int nl, int nh, double g, std::array<std::complex<double>, 8>& zeros, int& nz) noexcept
+    {
+        using C = std::complex<double>;
+        const int d = nl + nh;
+        const auto rho = std::pow (wl / wh, 2.0 * nh);
+        std::array<double, 9> a {}; // monic coefficients, a[k] for z^k
+        a[0] += 1.0;
+        a[(std::size_t) nl] += g;
+        a[(std::size_t) nh] += rho;
+        a[(std::size_t) d] += rho;
+        for (auto& x : a)
+            x /= rho;
+        std::array<C, 8> z {};
+        const auto r1 = std::pow (g, -1.0 / nl), r2 = std::pow (g / rho, 1.0 / nh);
+        for (int k = 0; k < nl; ++k)
+            z[(std::size_t) k] = std::polar (r1, pi * (2.0 * k + 1.0) / nl + 0.31);
+        for (int k = 0; k < nh; ++k)
+            z[(std::size_t) (nl + k)] = std::polar (r2, pi * (2.0 * k + 1.0) / nh + 0.17);
+        for (int it = 0; it < 80; ++it)
+        {
+            double worst = 0.0;
+            for (int i = 0; i < d; ++i)
+            {
+                C p = 1.0, dp = 0.0; // Horner (monic)
+                for (int k = d - 1; k >= 0; --k)
+                {
+                    dp = dp * z[(std::size_t) i] + p;
+                    p = p * z[(std::size_t) i] + a[(std::size_t) k];
+                }
+                if (std::abs (dp) == 0.0)
+                    continue;
+                const auto ratio = p / dp;
+                C sum = 0.0;
+                for (int j = 0; j < d; ++j)
+                    if (j != i)
+                        sum += 1.0 / (z[(std::size_t) i] - z[(std::size_t) j]);
+                const auto step = ratio / (1.0 - ratio * sum);
+                z[(std::size_t) i] -= step;
+                worst = std::max (worst, std::abs (step) / std::max (1e-300, std::abs (z[(std::size_t) i])));
+            }
+            if (worst < 1e-14)
+                break;
+        }
+        for (int i = 0; i < d && nz < 8; ++i)
+        {
+            auto s = -wl * std::sqrt (-z[(std::size_t) i]);
+            if (s.real() > 0.0)
+                s = -s;
+            zeros[(std::size_t) nz++] = s;
+        }
+    }
+    struct Digital { double b0 = 1.0, b1 = 0.0, b2 = 0.0, a1 = 0.0, a2 = 0.0; };
+
+    static int sections (const std::complex<double>* roots, int n, std::array<Analog, 4>& out) noexcept
+    {
+        int k = 0;
+        std::array<double, 8> reals {};
+        int nr = 0;
+        for (int i = 0; i < n; ++i)
+        {
+            const auto& r = roots[i];
+            if (std::abs (r.imag()) > 1e-9 * std::abs (r))
+            {
+                if (r.imag() > 0.0 && k < 4) // one of each conjugate pair
+                    out[(std::size_t) k++] = { 1.0, -2.0 * r.real(), std::norm (r) };
+            }
+            else
+                reals[(std::size_t) nr++] = r.real();
+        }
+        for (int i = 0; i + 1 < nr && k < 4; i += 2)
+            out[(std::size_t) k++] = { 1.0, -(reals[(std::size_t) i] + reals[(std::size_t) (i + 1)]), reals[(std::size_t) i] * reals[(std::size_t) (i + 1)] };
+        if (nr % 2 != 0 && k < 4)
+            out[(std::size_t) k++] = { 0.0, 1.0, -reals[(std::size_t) (nr - 1)] };
+        return k;
+    }
+
+    // s = (1 − z⁻¹) / (1 + z⁻¹) (the axis is already prewarped)
+    static Digital bilinear (const Analog& n, const Analog& d) noexcept
+    {
+        const bool second = n.c2 != 0.0 || d.c2 != 0.0;
+        const auto map = [second] (const Analog& a, double& c0, double& c1, double& c2) {
+            if (! second) // first order: c1·(1 − z⁻¹) + c0·(1 + z⁻¹)
+            {
+                c0 = a.c1 + a.c0;
+                c1 = a.c0 - a.c1;
+                c2 = 0.0;
+                return;
+            }
+            c0 = a.c2 + a.c1 + a.c0;
+            c1 = 2.0 * (a.c0 - a.c2);
+            c2 = a.c2 - a.c1 + a.c0;
+        };
+        double n0, n1, n2, d0, d1, d2;
+        map (n, n0, n1, n2);
+        map (d, d0, d1, d2);
+        return { n0 / d0, n1 / d0, n2 / d0, d1 / d0, d2 / d0 };
+    }
+
+    std::array<Digital, maxSections> c {};
+    std::array<std::array<double, 2>, maxSections> state {};
+    int count = 0;
+    double gain = 1.0;
+};
+} // namespace lynx::minphase

+ 128 - 12
src/core/MixSuite.cpp

@@ -3,6 +3,7 @@
 #include <algorithm>
 #include <atomic>
 #include <cmath>
+#include <cstdint>
 #include <cstdio>
 
 #include "core/Biquad.h"
@@ -132,6 +133,9 @@ struct Meters
         in.store (inPeak, std::memory_order_relaxed);
         out.store (outPeak, std::memory_order_relaxed);
     }
+    // round 147: a level for the second meter slot when an engine has no second reduction (Hush: the detector's
+    // energy, −60 … 0 dB as 0 … 1)
+    void setDetector (float db) noexcept { gr1.store (std::clamp ((db + 60.0f) / 60.0f, 0.0f, 1.0f), std::memory_order_relaxed); }
 };
 
 // ---- oversampler design ----
@@ -298,6 +302,15 @@ double eGateRangeDb (float v) noexcept { return lin (v, 0.0, 40.0); }
 double eGateThresholdDb (float v) noexcept { return lin (v, -30.0, 10.0); }
 bool eVoicing (const EffectParams& p) noexcept { return on (p[voicing]); }
 bool vocalVoicing (const EffectParams& p) noexcept { return on (p[vocal]); }
+double autoMakeupDb (const EffectParams& p) noexcept
+{
+    if (p[compRatio] <= 0.0005f || ! on (p[dynOn]))
+        return 0.0;
+    vmatch::echannel::Settings e;
+    e.compRatio = ratio (p[compRatio]);
+    e.compThreshold = std::clamp (compThresholdDb (p[compThreshold]) + 18.0, -20.0, 10.0);
+    return vmatch::echannel::compMakeupDb (e);
+}
 
 // round 145: the Vocal strip voicing's settings (the reference's own laws, core/VoxStrip.h)
 voxstrip::Settings vocalSettings (const EffectParams& p) noexcept
@@ -451,6 +464,8 @@ public:
         {
             const auto inPeak = Meters::peak (l, r, n);
             console.process (l, r, n, consoleSettings (p));
+            if (on (p[analog]))
+                addAnalogNoise (l, r, n);
             meters.set (console.compReductionDb(), console.gateReductionDb(), inPeak, Meters::peak (l, r, n));
             return;
         }
@@ -458,7 +473,8 @@ public:
         side.design (p, sr);
         const auto inPeak = Meters::peak (l, r, n);
         const auto inGain = (float) dbToGain (trimDb (p[input]));
-        const auto outGain = (float) (dbToGain (trimDb (p[output])) * (on (p[phase]) ? -1.0 : 1.0));
+        // round 147b: + the console's automatic make-up when switched on
+        const auto outGain = (float) (dbToGain (trimDb (p[output]) + (on (p[autoMakeup]) ? autoMakeupDb (p) : 0.0)) * (on (p[phase]) ? -1.0 : 1.0));
         const bool eq = on (p[eqOn]), dyn = on (p[dynOn]), eqFirst = ! on (p[order]), fts = on (p[filtersToSidechain]);
 
         // compressor
@@ -539,10 +555,36 @@ public:
             l[i] = a * outGain;
             r[i] = b * outGain;
         }
+        if (on (p[analog]))
+            addAnalogNoise (l, r, n);
         meters.set (maxComp, maxGate, inPeak, Meters::peak (l, r, n));
     }
 
 private:
+    // round 147b: ANALOG — [EXEC] the reference console with Analog on adds, at its very output (whatever the input,
+    // output or compressor settings), white noise of −110.7 dBFS RMS per channel, the two channels uncorrelated; its
+    // harmonics are unchanged (H2 … H5 of a 1 kHz / −20 dBFS and a 100 Hz / −6 dBFS sine within 0.4 dB). Gaussian
+    // (Irwin–Hall, four uniforms) from a small xorshift generator, one per channel.
+    void addAnalogNoise (float* l, float* r, int n) noexcept
+    {
+        constexpr float sigma = 2.91e-6f; // 10^(−110.73 / 20)
+        const auto gauss = [] (std::uint32_t& st) noexcept {
+            float sum = 0.0f;
+            for (int k = 0; k < 4; ++k)
+            {
+                st ^= st << 13; st ^= st >> 17; st ^= st << 5;
+                sum += (float) (st >> 8) * (1.0f / 16777216.0f);
+            }
+            return (sum - 2.0f) * 1.7320508f; // variance 4/12 → 1
+        };
+        for (int i = 0; i < n; ++i)
+        {
+            l[i] += sigma * gauss (noiseL);
+            r[i] += sigma * gauss (noiseR);
+        }
+    }
+    std::uint32_t noiseL = 0x9e3779b9u, noiseR = 0x85ebca6bu;
+
     // E voicing: Ridge's controls in the console's units (the shared ranges use Ridge's own laws)
     static vmatch::echannel::Settings consoleSettings (const EffectParams& p) noexcept
     {
@@ -851,6 +893,7 @@ private:
             for (int i = 0; i < n; ++i)
                 delay.process (l[i], r[i]);
             meters.set (classicEngine.reductionDb(), 0.0f, inPeak, Meters::peak (l, r, n));
+            meters.setDetector (classicEngine.detectorDb());
             return;
         }
         const auto f = std::min (hz (p[frequency]), sr * 0.45);
@@ -882,7 +925,7 @@ private:
         const auto attack = coef (ahead ? std::max (delayMs, 0.03) * 0.001 / 3.0 : 0.0005, sr);
         const auto out = (float) dbToGain (lin (p[output], -12.0, 12.0));
         constexpr double knee = 3.0;
-        double maxGr = 0.0;
+        double maxGr = 0.0, maxDet = 0.0;
 
         // gain reduction (dB) wanted for a detected level `s` (and the full-band level in allround mode)
         auto wanted = [&] (double s, double full) {
@@ -938,6 +981,7 @@ private:
             {
                 const auto s = std::max (sA, sB);
                 env = s > env ? s : release * env + (1.0 - release) * s;
+                maxDet = std::max (maxDet, env);
                 const auto want = wanted (env, full);
                 gr = want > gr ? attack * gr + (1.0 - attack) * want : release * gr + (1.0 - release) * want;
                 gA = gB = (float) dbToGain (-gr);
@@ -950,6 +994,7 @@ private:
                 for (int c = 0; c < 2; ++c)
                 {
                     envCh[c] = ss[c] > envCh[c] ? ss[c] : release * envCh[c] + (1.0 - release) * ss[c];
+                    maxDet = std::max (maxDet, envCh[c]);
                     const auto want = wanted (envCh[c], full);
                     grCh[c] = want > grCh[c] ? attack * grCh[c] + (1.0 - attack) * want : release * grCh[c] + (1.0 - release) * want;
                     maxGr = std::max (maxGr, grCh[c]);
@@ -1038,6 +1083,7 @@ private:
             }
         }
         meters.set ((float) maxGr, 0.0f, inPeak, Meters::peak (l, r, n));
+        meters.setDetector ((float) gainToDb (maxDet)); // round 147: the energy the threshold is compared with
         scL = scR = nullptr;
     }
 
@@ -1371,6 +1417,13 @@ double toneDb (float v) noexcept { return lin (v, -18.0, 18.0); }
 double feedbackAmount (float v) noexcept { return lin (v, 0.0, 1.0); }
 double feedbackHz (float v) noexcept { return logMap (v, 10.0, 1000.0); }
 double dynamicsAmount (float v) noexcept { return lin (v, -1.0, 1.0); }
+double panOf (float v) noexcept { return std::clamp ((double) v * 2.0 - 1.0, -1.0, 1.0); }
+std::pair<float, float> panScales (double pan) noexcept
+{
+    pan = std::clamp (pan, -1.0, 1.0);
+    return { (float) (pan > 0.0 ? 1.0 - pan : 1.0), (float) (pan < 0.0 ? 1.0 + pan : 1.0) };
+}
+bool midSide (const EffectParams& p) noexcept { return on (p[channelMode]); }
 int bandParam (int band, int field) noexcept
 {
     if (band <= 0)
@@ -1552,8 +1605,25 @@ public:
 
     void process (float* l, float* r, int n, const EffectParams& p, double) noexcept override
     {
+        // round 147: mid / side — M = (L + R) / 2 on channel 0, S = (R − L) / 2 on channel 1 (the trial's sign: a
+        // left-only tone's even harmonics land on the right), decoded L = M − S, R = M + S
+        const bool ms = midSide (p);
+        if (ms)
+            for (int i = 0; i < n; ++i)
+            {
+                const auto m = 0.5f * (l[i] + r[i]), sd = 0.5f * (r[i] - l[i]);
+                l[i] = m;
+                r[i] = sd;
+            }
         for (int off = 0; off < n; off += maxBlock)
             chunk (l + off, r + off, std::min (maxBlock, n - off), p);
+        if (ms)
+            for (int i = 0; i < n; ++i)
+            {
+                const auto m = l[i], sd = r[i];
+                l[i] = m - sd;
+                r[i] = m + sd;
+            }
     }
 
 private:
@@ -1583,6 +1653,12 @@ private:
         const auto vk = voiceIndex (p[voice]);
         const auto s = vk > 0 ? voiceStyle (vk) : styleOf (p[style]);
         const auto drv = (float) dbToGain (driveDb (p[drive]) + (on (p[punish]) ? punishDb : 0.0));
+        // round 147: the drive pan — the far channel's drive × (1 − |pan|) (in dB, the trial's 0 … 100 % scale)
+        const auto [dsA, dsB] = panScales (panOf (p[bandDrivePanParam (0)]));
+        const bool drivePanned = dsA != 1.0f || dsB != 1.0f;
+        const auto drvA = drivePanned ? (float) dbToGain (driveDb (p[drive]) * dsA + (on (p[punish]) ? punishDb : 0.0)) : drv;
+        const auto drvB = drivePanned ? (float) dbToGain (driveDb (p[drive]) * dsB + (on (p[punish]) ? punishDb : 0.0)) : drv;
+        const auto [panA, panB] = panScales (panOf (p[bandPanParam (0)]));
         const bool tape = s == Style::tape && vk == 0;
         const auto [lc, hc] = configureCuts (p);
         configureVoice (vk);
@@ -1601,6 +1677,8 @@ private:
             lastStyle = s;
         }
         const auto comp = on (p[autoGain]) ? makeup : 1.0f;
+        const auto compA = drivePanned && on (p[autoGain]) ? autoMakeup (s, drvA) : comp;
+        const auto compB = drivePanned && on (p[autoGain]) ? autoMakeup (s, drvB) : comp;
 
         for (int i = 0; i < n; ++i)
         {
@@ -1620,8 +1698,8 @@ private:
                 a = emphasis.process (a, 0);
                 b = emphasis.process (b, 1);
             }
-            wl[(std::size_t) i] = a * drv;
-            wr[(std::size_t) i] = b * drv;
+            wl[(std::size_t) i] = a * drvA;
+            wr[(std::size_t) i] = b * drvB;
         }
 
         // round 128: band 1's power, mute, feedback, dynamics and tone (single-band mode)
@@ -1646,7 +1724,7 @@ private:
 
         for (int i = 0; i < n; ++i)
         {
-            auto a = dc.process (wl[(std::size_t) i], 0) * comp, b = dc.process (wr[(std::size_t) i], 1) * comp;
+            auto a = dc.process (wl[(std::size_t) i], 0) * compA, b = dc.process (wr[(std::size_t) i], 1) * compB;
             if (tape)
             {
                 a = deemphasis.process (a, 0);
@@ -1669,6 +1747,8 @@ private:
             dry.process (da, db);
             if (! powered) { a = da; b = db; }  // switched off: the band passes clean
             if (muted) { a = 0.0f; b = 0.0f; }
+            a *= panA; // round 147: the band's pan
+            b *= panB;
             l[i] = (da + (a - da) * mx) * out;
             r[i] = (db + (b - db) * mx) * out;
         }
@@ -1716,6 +1796,7 @@ private:
 
         std::array<Style, maxBands> st {};
         std::array<float, maxBands> drv {}, bmix {}, lvl {}, comp {};
+        std::array<float, maxBands> drvB {}, compB {}, panA {}, panB {}; // round 147: channel 1's drive, the band pan
         bool anySolo = false;
         for (int b = 0; b < nb; ++b) anySolo = anySolo || bandState (p[(std::size_t) bandExtra (b, 1)]) == BandState::solo;
         for (int b = 0; b < nb; ++b)
@@ -1725,6 +1806,21 @@ private:
             bmix[(std::size_t) b] = std::clamp (p[(std::size_t) bandParam (b, 2)], 0.0f, 1.0f);
             lvl[(std::size_t) b] = (float) dbToGain (bandLevelDb (p[(std::size_t) bandParam (b, 3)]));
             comp[(std::size_t) b] = autoOn ? autoMakeup (st[(std::size_t) b], drv[(std::size_t) b]) : 1.0f;
+            // round 147: drive pan (channel 0's drive stays in drv) and band pan
+            const auto [dsA, dsB] = panScales (panOf (p[(std::size_t) bandDrivePanParam (b)]));
+            const auto dDb = driveDb (p[(std::size_t) bandParam (b, 1)]);
+            drvB[(std::size_t) b] = drv[(std::size_t) b];
+            compB[(std::size_t) b] = comp[(std::size_t) b];
+            if (dsA != 1.0f || dsB != 1.0f)
+            {
+                drv[(std::size_t) b] = (float) dbToGain (dDb * dsA) * punishGain;
+                drvB[(std::size_t) b] = (float) dbToGain (dDb * dsB) * punishGain;
+                comp[(std::size_t) b] = autoOn ? autoMakeup (st[(std::size_t) b], drv[(std::size_t) b]) : 1.0f;
+                compB[(std::size_t) b] = autoOn ? autoMakeup (st[(std::size_t) b], drvB[(std::size_t) b]) : 1.0f;
+            }
+            const auto [pa, pb] = panScales (panOf (p[(std::size_t) bandPanParam (b)]));
+            panA[(std::size_t) b] = pa;
+            panB[(std::size_t) b] = pb;
             bandOs[(std::size_t) b][0].setFactor (factor);
             bandOs[(std::size_t) b][1].setFactor (factor);
         }
@@ -1774,7 +1870,7 @@ private:
                 dryBand[0][(std::size_t) i] = da;
                 dryBand[1][(std::size_t) i] = db;
                 bl[i] *= drv[(std::size_t) b];
-                br[i] *= drv[(std::size_t) b];
+                br[i] *= drvB[(std::size_t) b];
             }
             const auto s = st[(std::size_t) b];
             // round 128: the band's feedback, dynamics, tone, power and solo / mute
@@ -1793,17 +1889,18 @@ private:
                 bandOs[(std::size_t) b][0].process (bl, n, curve);
                 bandOs[(std::size_t) b][1].process (br, n, curve);
             }
-            const auto m = bmix[(std::size_t) b], g = lvl[(std::size_t) b], k = comp[(std::size_t) b];
+            const auto m = bmix[(std::size_t) b], g = lvl[(std::size_t) b], k = comp[(std::size_t) b], kB = compB[(std::size_t) b];
+            const auto gA = g * panA[(std::size_t) b], gB = g * panB[(std::size_t) b];
             const bool post = ex.toneOn || ex.dyn != 0.0;
             const bool powered = on (p[(std::size_t) bandExtra (b, 0)]);
             const auto state = bandState (p[(std::size_t) bandExtra (b, 1)]);
             const bool silent = state == BandState::mute || (anySolo && state != BandState::solo);
             for (int i = 0; i < n; ++i)
             {
-                auto wa = bandDc[(std::size_t) b].process (bl[i], 0) * k, wb = bandDc[(std::size_t) b].process (br[i], 1) * k;
+                auto wa = bandDc[(std::size_t) b].process (bl[i], 0) * k, wb = bandDc[(std::size_t) b].process (br[i], 1) * kB;
                 if (post) ex.post (wa, wb, dryBand[0][(std::size_t) i], dryBand[1][(std::size_t) i]);
-                auto ya = (dryBand[0][(std::size_t) i] + (wa - dryBand[0][(std::size_t) i]) * m) * g;
-                auto yb = (dryBand[1][(std::size_t) i] + (wb - dryBand[1][(std::size_t) i]) * m) * g;
+                auto ya = (dryBand[0][(std::size_t) i] + (wa - dryBand[0][(std::size_t) i]) * m) * gA;
+                auto yb = (dryBand[1][(std::size_t) i] + (wb - dryBand[1][(std::size_t) i]) * m) * gB;
                 if (! powered) { ya = dryBand[0][(std::size_t) i]; yb = dryBand[1][(std::size_t) i]; }
                 if (silent) { ya = 0.0f; yb = 0.0f; }
                 if (b == 0)
@@ -1991,7 +2088,9 @@ const EffectInfo& ridgeInfo()
                                      { "High band", 1.0f }, { "High freq.", 0.0f }, { "High gain", 0.5f },
                                      { "Compander", 0.0f }, { "Expander threshold", 0.0f }, { "Compander threshold", 1.0f },
                                      { "Compander ratio", 0.504899f }, { "Compander attack", 0.0f }, { "Compander release", 0.049762f },
-                                     { "Make-up", 0.0f }, { "Soft knee", 0.0f }, { "Drive", 0.0f } } };
+                                     { "Make-up", 0.0f }, { "Soft knee", 0.0f }, { "Drive", 0.0f },
+                                     // round 147b
+                                     { "Auto make-up", 0.0f }, { "Analog", 0.0f } } };
     return info;
 }
 
@@ -2052,7 +2151,11 @@ const EffectInfo& emberInfo()
                                      // round 136: the Classic voicing (EmberClassic.h)
                                      { "Voicing", 0.0f }, { "Classic style", 0.0f }, { "Classic drive", 0.0f }, { "Classic punish", 0.0f },
                                      { "Classic low cut", 0.0f }, { "Classic thump", 0.0f }, { "Classic tone", 0.5f }, { "Classic high cut", 1.0f },
-                                     { "Classic steep", 0.0f }, { "Classic mix", 1.0f }, { "Classic output", 1.0f } } };
+                                     { "Classic steep", 0.0f }, { "Classic mix", 1.0f }, { "Classic output", 1.0f },
+                                     // round 147 (Saturn 2's channel mode, drive pan and band pan)
+                                     { "Channel mode", 0.0f },
+                                     { "B1 drive pan", 0.5f }, { "B2 drive pan", 0.5f }, { "B3 drive pan", 0.5f }, { "B4 drive pan", 0.5f },
+                                     { "B1 pan", 0.5f }, { "B2 pan", 0.5f }, { "B3 pan", 0.5f }, { "B4 pan", 0.5f } } };
     return info;
 }
 
@@ -2307,6 +2410,19 @@ std::string paramText (EffectKind kind, int param, float v)
             case classicHighCut: return hzText (emberclassic::highCutHz (v));
             case classicMix: return fmt ("%.0f%%", v * 100.0);
             case classicOutput: return fmt ("%+.1f dB", emberclassic::outputDb (v));
+            // round 147
+            case channelMode: return on (v) ? "Mid/Side" : "Left/Right";
+            case band1DrivePan: case band2DrivePan: case band3DrivePan: case band4DrivePan:
+            {
+                const auto pan = panOf (v);
+                return std::abs (pan) < 0.005 ? std::string ("centre") : fmt ("%.0f%% ", std::abs (pan) * 100.0) + (pan < 0.0 ? "L/M" : "R/S");
+            }
+            case band1Pan: case band2Pan: case band3Pan: case band4Pan:
+            {
+                const auto [a, b] = panScales (panOf (v));
+                const auto db = [] (float g) { return g <= 0.0f ? std::string ("-inf") : fmt ("%.1f", gainToDb (g)); };
+                return std::abs (panOf (v)) < 0.005 ? std::string ("centre") : db (a) + " / " + db (b) + " dB";
+            }
             default:
                 if (param >= band1On && param < band1On + maxBands * extraFields)
                     switch ((param - band1On) % extraFields)

+ 19 - 0
src/core/MixSuite.h

@@ -18,6 +18,7 @@
 
 #include <algorithm>
 #include <array>
+#include <utility>
 #include <memory>
 #include <string>
 
@@ -113,8 +114,15 @@ enum Param
     vDpOn, vDpFreq, vDpThreshold, vDpSplit, vDpLookahead, vDpListen,
     vEqOn, vHpfOn, vHpfFreq, vNotchOn, vNotchFreq, vNotchGain, vHighOn, vHighFreq, vHighGain,
     vCompOn, vExpThreshold, vCompThreshold, vRatio, vAttack, vRelease, vMakeup, vKnee, vDrive,
+    // round 147b (appended, off by default = the old sound): Ridge's own engine gets the reference console's automatic
+    // make-up (the level its compressor gives back for the threshold and ratio, measured in round 123 — the E voicing
+    // always has it) and the ANALOG switch (the console emulation's colour)
+    autoMakeup, analog,
     count
 };
+// round 147b: the auto make-up (dB) for Ridge's own compressor: the console's for the same threshold (dBFS + 18 = the
+// console's dBu scale) and ratio; 0 with the compressor off
+double autoMakeupDb (const EffectParams& p) noexcept;
 
 double hpfHz (float v) noexcept;      // 0 = off, else 16 .. 350 Hz (18 dB/oct)
 double lpfHz (float v) noexcept;      // 0 = off, else 22 kHz .. 3 kHz (12 dB/oct)
@@ -229,9 +237,20 @@ enum Param
     // its substitute role plays; its own controls with the original's laws. Voicing 0 = Ember's own engine (unchanged)
     voicing, classicStyle, classicDrive, classicPunish, classicLowCut, classicThump, classicTone, classicHighCut,
     classicSteep, classicMix, classicOutput,
+    // round 147 (Saturn 2 parity, measured black-box on the trial, REA_rodada147b; appended, defaults = the old sound):
+    // the channel mode (0 left / right, 1 mid / side: M = (L + R) / 2, S = (R − L) / 2 go through the bands' two
+    // channels), each band's drive pan (−1 … +1: the far channel's drive × (1 − |pan|)) and each band's pan (−1 … +1:
+    // the far channel's gain 1 − |pan|; in mid / side, left = mid)
+    channelMode, band1DrivePan, band2DrivePan, band3DrivePan, band4DrivePan, band1Pan, band2Pan, band3Pan, band4Pan,
     count
 };
 constexpr int maxBands = 4;
+inline int bandDrivePanParam (int band) noexcept { return band1DrivePan + std::clamp (band, 0, maxBands - 1); }
+inline int bandPanParam (int band) noexcept { return band1Pan + std::clamp (band, 0, maxBands - 1); }
+double panOf (float v) noexcept;        // −1 … +1 (0.5 = centre)
+// the two channels' scale for a pan of −1 … +1 (the far side's 1 − |pan|): first = channel 0 (left / mid)
+std::pair<float, float> panScales (double pan) noexcept;
+bool midSide (const EffectParams& p) noexcept;
 // a band's round-128 parameters: field 0 power, 1 state, 2 bass, 3 mid, 4 treble, 5 presence, 6 feedback,
 // 7 feedback frequency, 8 dynamics
 constexpr int extraFields = 9;

+ 72 - 3
src/core/PluginLayout.cpp

@@ -9,6 +9,7 @@
 #include <mutex>
 #include <string>
 
+#include "core/EchoSuite.h"
 #include "core/Effects.h"
 #include "core/MaximusFx.h"
 #include "core/MultibandDelayFx.h"
@@ -1025,7 +1026,7 @@ Layout lynxTune()
     // BYPASS / REMOVE modes and LATCH (round 128).
     Layout l;
     l.width = 800;
-    l.height = 610;
+    l.height = 622;
     l.pages = { TR_NOOP ("Pitch graph"), TR_NOOP ("Advanced"), TR_NOOP ("Real-time") }; // round 135w: + Real-time
     auto& v = l.items;
     auto menu = [&v] (float x, float y, float w, const char* param, const char* caption, const char* options, int steps = 0) {
@@ -1118,8 +1119,9 @@ Layout lynxTune()
         rt (io);
     }
     // --- the keyboard: BYPASS / REMOVE modes, LATCH, four octaves (a key edits its note name in every octave)
-    v.push_back (section (0, 482, 800, 128, TR_NOOP ("TARGET NOTES")));
-    v.push_back (display (8, 502, 784, 102, "tunekeys"));
+    // round 147: + the range bar, the range presets, Reset scale and the view's navigation (the real-time corrector's)
+    v.push_back (section (0, 482, 800, 140, TR_NOOP ("TARGET NOTES")));
+    v.push_back (display (8, 502, 784, 114, "tunekeys"));
     return l;
 }
 
@@ -1620,6 +1622,7 @@ Layout ridgeStrip()
     v.push_back (dial (410, 150, 32, "Comp. release", TR_NOOP ("Release")));
     v.push_back (dial (490, 150, 28, "Comp. mix", TR_NOOP ("Mix")));
     v.push_back (toggle (296, 206, 110, 20, "Fast attack", TR_NOOP ("Fast attack")));
+    v.push_back (toggle (414, 206, 136, 20, "Auto make-up", TR_NOOP ("Auto make-up"))); // round 147b: the console's
     v.push_back (section (284, 244, 272, 196, TR_NOOP ("Expander / gate")));
     v.push_back (dial (480, 296, 46, "Gate threshold", TR_NOOP ("Threshold"), big));
     v.push_back (dial (330, 290, 32, "Gate range", TR_NOOP ("Range")));
@@ -1631,6 +1634,7 @@ Layout ridgeStrip()
     v.push_back (meter (292, 484, 256, 12, 1, TR_NOOP ("Gate")));
     v.push_back (toggle (292, 508, 84, 20, "Dynamics on", TR_NOOP ("Dyn in")));
     v.push_back (tabs (384, 508, 164, 20, "Order", TR_NOOP ("EQ>Dyn|Dyn>EQ")));
+    v.push_back (toggle (292, 540, 84, 20, "Analog", TR_NOOP ("Analog"))); // round 147b: the console emulation's colour
     // the GAIN block (round 129, the reference's): input trim and phase, the output fader beside the input / output
     // level meter with its peak read-outs
     v.push_back (section (284, 580, 272, 132, TR_NOOP ("Gain")));
@@ -1896,6 +1900,27 @@ Layout emberLayout()
     v.push_back (toggle (12, 726, 110, 20, "Wide cuts", TR_NOOP ("Wide cuts")));
     v.push_back (dial (340, 712, 22, "Low cut (wide)", TR_NOOP ("Low cut")));
     v.push_back (dial (440, 712, 22, "High cut (wide)", TR_NOOP ("High cut")));
+    // round 147 (Saturn 2): the channel mode and each band's drive pan / pan
+    l.height = 870;
+    v.push_back (section (4, 760, 512, 106, TR_NOOP ("Stereo")));
+    v.push_back (tabs (12, 784, 140, 20, "Channel mode", TR_NOOP ("L/R|M/S"), { 0.0f, 1.0f }));
+    v.push_back (label (170, 778, 80, 14, TR_NOOP ("Drive pan")));
+    v.push_back (label (170, 818, 80, 14, TR_NOOP ("Pan")));
+    static const char* const drivePans[] { "B1 drive pan", "B2 drive pan", "B3 drive pan", "B4 drive pan" };
+    static const char* const pans[] { "B1 pan", "B2 pan", "B3 pan", "B4 pan" };
+    for (int b = 0; b < 4; ++b)
+        for (int r = 0; r < 2; ++r)
+        {
+            const auto cy = 792.0f + 40.0f * (float) r;
+            auto k = knob (280.0f + 60.0f * (float) b, cy, 16, r == 0 ? drivePans[b] : pans[b], nullptr, cy + 9.0f, noCaption | bipolar, 0);
+            k.colour = b;
+            if (b > 0)
+            {
+                k.whenParam = "Bands";
+                k.whenMin = 0.17f + 0.333f * (float) (b - 1);
+            }
+            v.push_back (k);
+        }
     return l;
 }
 
@@ -2056,6 +2081,29 @@ Layout prismMultiband()
     v.push_back (tabs (402, 566, 150, 20, "Oversampling", "Off|2x|4x", { 0.0f, 0.5f, 1.0f }));
     v.push_back (label (570, 566, 40, 20, TR_NOOP ("Pan")));
     v.push_back (tabs (612, 566, 110, 20, "Pan mode", "L/R|M/S"));
+    // round 147: Dynamic phase's engine (classic = projects saved before round 147) and each band's expert settings
+    v.push_back (tabs (736, 566, 156, 20, "Dynamic engine", TR_NOOP ("Classic|Measured")));
+    v.push_back (section (8, 596, 884, 64, TR_NOOP ("Expert (selected band)"), boxed));
+    static const char* links[6] { "B1 link", "B2 link", "B3 link", "B4 link", "B5 link", "B6 link" };
+    static const char* linkModes[6] { "B1 link mode", "B2 link mode", "B3 link mode", "B4 link mode", "B5 link mode", "B6 link mode" };
+    static const char* scFree[6] { "B1 SC filter", "B2 SC filter", "B3 SC filter", "B4 SC filter", "B5 SC filter", "B6 SC filter" };
+    static const char* scLow[6] { "B1 SC low", "B2 SC low", "B3 SC low", "B4 SC low", "B5 SC low", "B6 SC low" };
+    static const char* scHigh[6] { "B1 SC high", "B2 SC high", "B3 SC high", "B4 SC high", "B5 SC high", "B6 SC high" };
+    for (int b = 0; b < 6; ++b)
+    {
+        auto add = [&] (LayoutItem i) { i.colour = b; v.push_back (onPage (std::move (i), b)); };
+        add (tabs (16, 626, 150, 22, scFree[b], TR_NOOP ("Band|Free")));
+        add (dial (210, 630, 20, scLow[b], TR_NOOP ("SC low")));
+        add (dial (290, 630, 20, scHigh[b], TR_NOOP ("SC high")));
+        add (dial (420, 630, 20, links[b], TR_NOOP ("Stereo link")));
+        add (tabs (480, 626, 130, 22, linkModes[b], TR_NOOP ("Mid|Side")));
+    }
+    // round 147: each crossover's own slope (0 = the global one)
+    static const char* xs[5] { "Crossover 1 slope", "Crossover 2 slope", "Crossover 3 slope", "Crossover 4 slope", "Crossover 5 slope" };
+    static const char* xsCaption[5] { TR_NOOP ("Slope 1"), TR_NOOP ("Slope 2"), TR_NOOP ("Slope 3"), TR_NOOP ("Slope 4"), TR_NOOP ("Slope 5") };
+    for (int k = 0; k < 5; ++k)
+        v.push_back (dial (660.0f + 52.0f * (float) k, 630, 16, xs[k], xsCaption[k]));
+    l.height = 668;
     return l;
 }
 
@@ -2782,6 +2830,27 @@ Layout echoformLayout()
     v.push_back (off (menuOf (492, 402, 130, 20, "Mod shape", TR_NOOP ("Shape"), TR_NOOP ("Sine|Triangle|Square|Saw|Random"), stepCentres (5))));
     v.push_back (off (label (640, 404, 40, 20, TR_NOOP ("Sync"))));
     v.push_back (off (menuOf (682, 402, 110, 20, "Mod sync", TR_NOOP ("Sync"), TR_NOOP ("Free|1/16|1/8|1/4|1/2|1 bar|2 bars"), stepCentres (7))));
+    // ---- round 147: the measured echo voicings (EchoBoy's style role), the saturation curve and PrimalTap's Multiply
+    {
+        std::vector<float> voicings;
+        for (int k = 0; k <= echosuite::echoform::voicingCount; ++k)
+            voicings.push_back (echosuite::echoform::voicingValue (k));
+        v.push_back (off (label (640, 372, 52, 20, TR_NOOP ("Voicing"))));
+        v.push_back (off (menuOf (694, 372, 100, 20, "Echo voicing", TR_NOOP ("Echo voicing"),
+                                  TR_NOOP ("Off|Mastering reel|Studio reel|Cartridge echo|Multi-head tape|Valve tape|Worn cassette|Pedal BBD|"
+                                           "Compact BBD|Oil drum|Magnetic drum|Phone line|Medium wave|Broadcast FM|Distant station|"
+                                           "Walkie-talkie|Pristine digital|Warm analog|Digital ensemble|Analog ensemble|Pedal ensemble|"
+                                           "Seasick|Hot glow|Thick|Battered|Squashed|Fuzzed|Honky|Haze|Smeared|Scattered|Roomy"),
+                                  voicings)));
+        std::vector<float> types;
+        for (int k = 0; k <= echosuite::echoform::satTypeCount; ++k)
+            types.push_back (echosuite::echoform::satTypeValue (k));
+        v.push_back (off (label (800, 372, 38, 20, TR_NOOP ("Sat."))));
+        v.push_back (off (menuOf (840, 372, 100, 20, "Saturation type", TR_NOOP ("Saturation type"),
+                                  TR_NOOP ("Auto|Clean|Tape|Tube|Squash|Grit|Ceiling"), types)));
+        v.push_back (off (label (800, 402, 38, 20, TR_NOOP ("Mult."))));
+        v.push_back (off (tabs (840, 402, 100, 20, "Multiply", TR_NOOP ("1x|2x|4x|8x"), { 0.0f, 1.0f / 3.0f, 2.0f / 3.0f, 1.0f })));
+    }
     return l;
 }
 

+ 6 - 4
src/core/PluginSubstitutes.cpp

@@ -230,8 +230,9 @@ vendor = Soundtoys
 # round 129 (docs/PARITY.md): LYNX's multi-mode echo plays EchoBoy's role. Round 136: her states play Echoform's Tape
 # voicing (the loop structures measured on the official trial, REA_rodada136 §4), recognised by the hash of the encoded
 # preset (not decoded here); any other state: round 129's tape echo, 1/4 note at the project tempo, 25 % feedback, 25 % mix
+# (round 147: in the Studio reel voicing — EchoBoy's default style, measured black-box, REA_rodada147a)
 lynx = Echoform
-preset = Mode=0.0415; Sync L=0.6248; Note L=0.4498; Feedback=0.125; Mix=0.25
+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
@@ -1520,8 +1521,8 @@ int translateSslVocalstrip2 (const std::vector<std::uint8_t>& state, EffectSlot&
 // 30 output dB, 31 analog, 39 phase, 40 input dB). Round 123: Ridge Strip's "E" voicing (core/VoiceMatch.h) is the
 // console measured black-box on the official trial — every EQ band and filter from its impulse responses, the
 // feedback compressor and expander from sine stairs, tone bursts, noise and her takes — so the controls map one to
-// one in the console's own units (docs/analise/REA_rodada123.md). Not translated: analog (off in every state of her
-// corpus), EQ to the dynamics side chain.
+// one in the console's own units (docs/analise/REA_rodada123.md). Round 147b: analog translated (off in every state of
+// her corpus). Not translated: EQ to the dynamics side chain.
 int translateWavesSslChannel (const std::vector<std::uint8_t>& state, EffectSlot& slot)
 {
     namespace r = mixsuite::ridge;
@@ -1569,7 +1570,8 @@ int translateWavesSslChannel (const std::vector<std::uint8_t>& state, EffectSlot
     p[r::filterSplit] = at (29, 1.0) == 1.0 ? 1.0f : 0.0f;
     p[r::filtersToSidechain] = 0.0f;
     p[r::compMix] = 1.0f;
-    return 30;
+    p[r::analog] = at (31, 0.0) > 0.5 ? 1.0f : 0.0f; // round 147b: ANALOG (its noise floor, measured on the trial)
+    return 31;
 }
 
 // H-Delay (RealWorld list, round 119): 1 sync (0 BPM, 1 host, 2 ms), 2 BPM, 3 delay ms, 4 note (3 per length: triplet,

+ 8 - 1
src/core/VoiceMatch.cpp

@@ -262,6 +262,11 @@ double compStaticGainDb (const Settings& s, double sineDbfs)
     return law.makeup - gr;
 }
 
+double compMakeupDb (const Settings& s) noexcept
+{
+    return s.compRatio > 1.0 ? compLaw (s).makeup : 0.0;
+}
+
 void Channel::prepare (double sampleRate) noexcept
 {
     sr = sampleRate;
@@ -461,13 +466,14 @@ void DeEsser::process (float* l, float* r, int n, const Settings& s) noexcept
     const double T = std::clamp (s.thresholdDb, -80.0, 0.0);
     const double thr = T + thrOffset + thrSlope * (T + 24.2) + (s.bandPass ? bpOffset : 0.0);
     const double aA = coefMs (attackMs, sr), aR = coefMs (releaseMs, sr), out = dbToGain (s.outputDb);
-    double maxGr = 0.0;
+    double maxGr = 0.0, maxO = -200.0;
     for (int i = 0; i < n; ++i)
     {
         const double a = sc2.process (sc1.process (l[i], 0), 0), b = sc2.process (sc1.process (r[i], 1), 1);
         const double p = 0.5 * (a * a + b * b);
         env += (p > env ? aA : aR) * (p - env);
         const double o = 10.0 * std::log10 (std::max (env, 1e-24)) - thr;
+        maxO = std::max (maxO, o);
         gr = (1.0 - 1.0 / ratio) * (o > 30.0 * knee ? o : knee * std::log1p (std::exp (o / knee)));
         const double g = dbToGain (-gr);
         maxGr = std::max (maxGr, gr);
@@ -494,6 +500,7 @@ void DeEsser::process (float* l, float* r, int n, const Settings& s) noexcept
         r[i] = (float) (x[1] * out);
     }
     last = (float) maxGr;
+    lastDet = (float) (maxO + T); // where the energy sits against the threshold dial: reduction starts at T
 }
 } // namespace deesser
 

+ 5 - 0
src/core/VoiceMatch.h

@@ -54,6 +54,8 @@ bool lowPass (const Settings& s, double sampleRate, Biquad& out);
 double responseDb (const Settings& s, double sampleRate, double hz);
 // The compressor's static output level (dBFS peak of a sine) for a steady sine input level, from the model
 double compStaticGainDb (const Settings& s, double sineDbfs);
+// round 147b: the console's automatic make-up (dB) for its threshold and ratio (measured with the dynamics law; 0 at 1:1)
+double compMakeupDb (const Settings& s) noexcept;
 
 class Channel
 {
@@ -96,10 +98,13 @@ public:
     void reset() noexcept;
     void process (float* l, float* r, int n, const Settings& s) noexcept;
     float reductionDb() const noexcept { return last; }
+    // round 147: the block's highest detector energy in the threshold's own scale (DeEsser's Energy Detector meter)
+    float detectorDb() const noexcept { return lastDet; }
 
 private:
     void design (const Settings& s) noexcept;
     double sr = 48000.0, designedHz = -1.0;
+    float lastDet = -120.0f;
     bool designedBp = false;
     Biquad sc1, sc2;
     double lpB = 0.0, lpA = 0.0, lpX[2] {}, lpY[2] {};

+ 3 - 0
src/engine/ProjectFile.cpp

@@ -522,8 +522,11 @@ std::optional<EffectSlot> effectFromVar (const juce::var& e)
     slot.smartDisable = (bool) e.getProperty ("smartDisable", true);
 
     if (auto* params = e["params"].getArray())
+    {
         for (int i = 0; i < params->size() && i < maxEffectParams; ++i)
             slot.params[(std::size_t) i] = juce::jlimit (0.0f, 1.0f, (float) (double) (*params)[i]);
+        upgradeLoadedEffectParams (slot, (std::size_t) params->size()); // engines that changed since the file was saved
+    }
 
     slot.plugin = pluginFromVar (e["plugin"]);
     if (*kind != EffectKind::plugin && e.hasProperty ("substituteFor"))

+ 41 - 3
src/ui/BrowserComponent.cpp

@@ -18,6 +18,7 @@
 #include "ui/ValueControl.h"
 #include "ui/WaveformView.h"
 #include "ui/AudioEditor.h"
+#include "ui/AutomationUi.h"
 #include "ui/ChannelRackComponent.h"
 #include "ui/MixerComponent.h"
 
@@ -187,11 +188,12 @@ enum class Category
     effects,
     generators,
     automation,
+    initialized, // FL's "Initialized controls" (REA round 146)
     samples
 };
 
 constexpr Category categories[] = { Category::history, Category::patterns, Category::effects, Category::generators,
-                                     Category::automation, Category::samples };
+                                     Category::automation, Category::initialized, Category::samples };
 
 juce::String categoryName (Category c)
 {
@@ -202,6 +204,7 @@ juce::String categoryName (Category c)
         case Category::effects: return tr ("Effects");
         case Category::generators: return tr ("Generators");
         case Category::automation: return tr ("Automation");
+        case Category::initialized: return tr ("Initialized controls");
         case Category::samples: return tr ("Audio files");
     }
     return {};
@@ -216,6 +219,7 @@ juce::String categoryHint (Category c)
         case Category::effects: return tr ("Effects in use, with the insert they sit on");
         case Category::generators: return tr ("Generators in use (the Channel Rack's channels), with the insert they play into");
         case Category::automation: return tr ("Automation clips of this project");
+        case Category::initialized: return tr ("Initialized controls: to be reset when the song starts (a control's menu > Init song with this position)");
         case Category::samples: return tr ("Audio files used by this project (samples, audio clips), in the colour of the channel that plays them");
     }
     return {};
@@ -230,6 +234,7 @@ Icon categoryIcon (Category c)
         case Category::effects: return Icon::mixer;
         case Category::generators: return Icon::keyboard;
         case Category::automation: return Icon::automate;
+        case Category::initialized: return Icon::automate;
         case Category::samples: return Icon::audioFile;
     }
     return Icon::folder;
@@ -327,6 +332,7 @@ public:
         Category category = Category::samples;
         projectcontents::Item item; // kind == item (history: item.index = the step)
         bool history = false, missing = false, current = false;
+        bool initial = false; // an initialized control (item.index = into Song::initialValues)
         std::function<void()> activate; // kind == plugin: adds it
     };
 
@@ -928,7 +934,7 @@ public:
                     browser.onOpenEffect (item.index, item.slot);
                 break;
             case projectcontents::Kind::automation:
-                if (! n.history && browser.onOpenAutomation)
+                if (! n.history && ! n.initial && browser.onOpenAutomation)
                     browser.onOpenAutomation (item.index);
                 break;
         }
@@ -1082,7 +1088,7 @@ private:
                 listCategory (*child, browser.engine.getSong(), &browser.engine, true); // the counts show while closed
                 child->children.clear();
                 n.children.push_back (std::move (child));
-                if (c == Category::automation && browser.projectFile.existsAsFile()) // then the project's folder (FL's "Project data")
+                if (c == Category::initialized && browser.projectFile.existsAsFile()) // then the project's folder (FL's "Project data")
                 {
                     auto folder = makeFolder (browser.projectFile.getParentDirectory(), tr ("Project folder"), juce::Colour());
                     folder->icon = Icon::folder;
@@ -1207,6 +1213,18 @@ private:
                 for (auto& item : projectcontents::automations (song))
                     add (item, Icon::automate, item.colour != 0 ? juce::Colour (item.colour) : theme::colour::automation);
                 break;
+            case Category::initialized:
+                for (int i = 0; i < (int) song.initialValues.size(); ++i)
+                {
+                    const auto& v = song.initialValues[(std::size_t) i];
+                    projectcontents::Item item;
+                    item.kind = projectcontents::Kind::automation;
+                    item.index = i;
+                    item.name = (engine != nullptr ? describeAutomationTarget (*engine, v.target) : juce::String ("?")).toStdString();
+                    item.detail = std::to_string ((int) std::lround (v.value * 100.0f)) + "%";
+                    add (std::move (item), Icon::automate, theme::colour::automation).initial = true;
+                }
+                break;
             case Category::samples:
                 for (auto& item : projectcontents::samples (song))
                 {
@@ -1274,6 +1292,8 @@ private:
             engine.jumpToHistory (item.index);
             return;
         }
+        if (n.initial)
+            return;
 
         switch (item.kind)
         {
@@ -1298,6 +1318,12 @@ private:
         h.hasMenu = true;
         const auto& item = n.item;
 
+        if (n.initial)
+        {
+            h.text = n.label + ": " + tr ("reset to this value when the song starts  [RMB] delete the initial value");
+            h.value = n.detail;
+            return h;
+        }
         if (n.history)
         {
             h.text = tr ("Undo history: [LMB] go back to this step");
@@ -1385,6 +1411,18 @@ private:
         const auto item = n.item;
         if (n.history)
             return;
+        if (n.initial)
+        {
+            const auto& values = engine.getSong().initialValues;
+            if (! juce::isPositiveAndBelow (item.index, (int) values.size()))
+                return;
+            menu.addSectionHeader (n.label + ": " + n.detail);
+            menu.addItem (tr ("Delete initial value"), [&engine, target = values[(std::size_t) item.index].target] {
+                engine.editSong ([target] (Song& s) { s.removeInitialValue (target); });
+            });
+            menu.showMenuAsync (juce::PopupMenu::Options().withMousePosition());
+            return;
+        }
 
         switch (item.kind)
         {

+ 311 - 132
src/ui/I18nData.h

@@ -11369,141 +11369,320 @@ inline constexpr unsigned char ptBR[] = {
 106, 101, 116, 111, 44, 32, 100, 101, 112, 111, 105, 115, 32, 111, 115, 32, 103, 108, 111, 98, 97, 105, 115, 41,
 34, 10, 34, 103, 108, 111, 98, 97, 108, 34, 32, 61, 32, 34, 103, 108, 111, 98, 97, 108, 34, 10, 34, 80,
 97, 116, 116, 101, 114, 110, 32, 101, 118, 101, 110, 116, 115, 34, 32, 61, 32, 34, 69, 118, 101, 110, 116, 111,
-115, 32, 100, 111, 32, 112, 97, 116, 116, 101, 114, 110, 34, 10, 35, 32, 45, 45, 45, 32, 82, 111, 117, 110,
-100, 32, 49, 52, 53, 58, 32, 82, 105, 100, 103, 101, 32, 83, 116, 114, 105, 112, 39, 115, 32, 86, 111, 99,
-97, 108, 32, 115, 116, 114, 105, 112, 32, 118, 111, 105, 99, 105, 110, 103, 10, 34, 67, 111, 109, 112, 97, 110,
-100, 101, 114, 34, 32, 61, 32, 34, 67, 111, 109, 112, 97, 110, 100, 101, 114, 34, 10, 34, 77, 97, 107, 101,
-45, 117, 112, 34, 32, 61, 32, 34, 71, 97, 110, 104, 111, 32, 100, 101, 32, 99, 111, 109, 112, 101, 110, 115,
-97, 195, 167, 195, 163, 111, 34, 10, 34, 83, 111, 102, 116, 32, 107, 110, 101, 101, 34, 32, 61, 32, 34, 74,
-111, 101, 108, 104, 111, 32, 115, 117, 97, 118, 101, 34, 10, 34, 66, 114, 111, 97, 100, 98, 97, 110, 100, 124,
-83, 112, 108, 105, 116, 34, 32, 61, 32, 34, 66, 97, 110, 100, 97, 32, 108, 97, 114, 103, 97, 124, 68, 105,
-118, 105, 100, 105, 100, 111, 34, 10, 34, 76, 111, 111, 107, 34, 32, 61, 32, 34, 65, 110, 116, 101, 99, 105,
-112, 46, 34, 10, 34, 68, 101, 45, 112, 108, 111, 115, 101, 114, 34, 32, 61, 32, 34, 68, 101, 45, 112, 108,
-111, 115, 101, 114, 34, 10, 34, 69, 113, 117, 97, 108, 105, 115, 101, 114, 34, 32, 61, 32, 34, 69, 113, 117,
-97, 108, 105, 122, 97, 100, 111, 114, 34, 10, 34, 86, 111, 99, 97, 108, 32, 115, 116, 114, 105, 112, 32, 118,
-111, 105, 99, 105, 110, 103, 34, 32, 61, 32, 34, 86, 111, 122, 32, 100, 101, 32, 99, 97, 110, 97, 108, 32,
-118, 111, 99, 97, 108, 34, 10, 34, 84, 104, 101, 32, 118, 111, 99, 97, 108, 32, 99, 104, 97, 110, 110, 101,
-108, 32, 115, 116, 114, 105, 112, 58, 32, 100, 101, 45, 101, 115, 115, 101, 114, 44, 32, 100, 101, 45, 112, 108,
-111, 115, 101, 114, 44, 32, 116, 104, 114, 101, 101, 45, 98, 97, 110, 100, 32, 69, 81, 32, 97, 110, 100, 32,
-99, 111, 109, 112, 97, 110, 100, 101, 114, 32, 105, 110, 32, 97, 110, 121, 32, 111, 114, 100, 101, 114, 34, 32,
-61, 32, 34, 79, 32, 99, 97, 110, 97, 108, 32, 118, 111, 99, 97, 108, 58, 32, 100, 101, 45, 101, 115, 115,
-101, 114, 44, 32, 100, 101, 45, 112, 108, 111, 115, 101, 114, 44, 32, 69, 81, 32, 100, 101, 32, 116, 114, 195,
-170, 115, 32, 98, 97, 110, 100, 97, 115, 32, 101, 32, 99, 111, 109, 112, 97, 110, 100, 101, 114, 32, 101, 109,
-32, 113, 117, 97, 108, 113, 117, 101, 114, 32, 111, 114, 100, 101, 109, 34, 10, 34, 84, 104, 101, 32, 111, 114,
-100, 101, 114, 32, 111, 102, 32, 116, 104, 101, 32, 102, 111, 117, 114, 32, 118, 111, 99, 97, 108, 32, 109, 111,
-100, 117, 108, 101, 115, 34, 32, 61, 32, 34, 65, 32, 111, 114, 100, 101, 109, 32, 100, 111, 115, 32, 113, 117,
-97, 116, 114, 111, 32, 109, 195, 179, 100, 117, 108, 111, 115, 32, 118, 111, 99, 97, 105, 115, 34, 10, 34, 84,
-117, 114, 110, 115, 32, 100, 111, 119, 110, 32, 115, 105, 98, 105, 108, 97, 110, 99, 101, 58, 32, 116, 104, 101,
-32, 104, 105, 103, 104, 115, 32, 119, 104, 101, 110, 32, 116, 104, 101, 121, 32, 103, 101, 116, 32, 108, 111, 117,
-100, 32, 99, 111, 109, 112, 97, 114, 101, 100, 32, 119, 105, 116, 104, 32, 116, 104, 101, 32, 114, 101, 115, 116,
-32, 111, 102, 32, 116, 104, 101, 32, 118, 111, 105, 99, 101, 34, 32, 61, 32, 34, 82, 101, 100, 117, 122, 32,
-97, 32, 115, 105, 98, 105, 108, 195, 162, 110, 99, 105, 97, 58, 32, 111, 115, 32, 97, 103, 117, 100, 111, 115,
-32, 113, 117, 97, 110, 100, 111, 32, 102, 105, 99, 97, 109, 32, 102, 111, 114, 116, 101, 115, 32, 101, 109, 32,
-114, 101, 108, 97, 195, 167, 195, 163, 111, 32, 97, 111, 32, 114, 101, 115, 116, 111, 32, 100, 97, 32, 118, 111,
-122, 34, 10, 34, 72, 111, 119, 32, 115, 116, 114, 111, 110, 103, 32, 116, 104, 101, 32, 104, 105, 103, 104, 115,
-32, 109, 117, 115, 116, 32, 98, 101, 44, 32, 99, 111, 109, 112, 97, 114, 101, 100, 32, 119, 105, 116, 104, 32,
-116, 104, 101, 32, 119, 104, 111, 108, 101, 32, 118, 111, 105, 99, 101, 44, 32, 98, 101, 102, 111, 114, 101, 32,
-116, 104, 101, 32, 100, 101, 45, 101, 115, 115, 101, 114, 32, 119, 111, 114, 107, 115, 34, 32, 61, 32, 34, 81,
-117, 195, 163, 111, 32, 102, 111, 114, 116, 101, 115, 32, 111, 115, 32, 97, 103, 117, 100, 111, 115, 32, 112, 114,
-101, 99, 105, 115, 97, 109, 32, 101, 115, 116, 97, 114, 44, 32, 101, 109, 32, 114, 101, 108, 97, 195, 167, 195,
-163, 111, 32, 195, 160, 32, 118, 111, 122, 32, 105, 110, 116, 101, 105, 114, 97, 44, 32, 112, 97, 114, 97, 32,
-111, 32, 100, 101, 45, 101, 115, 115, 101, 114, 32, 97, 103, 105, 114, 34, 10, 34, 84, 104, 101, 32, 102, 114,
-101, 113, 117, 101, 110, 99, 121, 32, 97, 98, 111, 118, 101, 32, 119, 104, 105, 99, 104, 32, 116, 104, 101, 32,
-100, 101, 45, 101, 115, 115, 101, 114, 32, 108, 105, 115, 116, 101, 110, 115, 34, 32, 61, 32, 34, 65, 32, 102,
-114, 101, 113, 117, 195, 170, 110, 99, 105, 97, 32, 97, 99, 105, 109, 97, 32, 100, 97, 32, 113, 117, 97, 108,
-32, 111, 32, 100, 101, 45, 101, 115, 115, 101, 114, 32, 101, 115, 99, 117, 116, 97, 34, 10, 34, 83, 112, 108,
-105, 116, 58, 32, 111, 110, 108, 121, 32, 116, 104, 101, 32, 104, 105, 103, 104, 115, 32, 97, 114, 101, 32, 116,
+115, 32, 100, 111, 32, 112, 97, 116, 116, 101, 114, 110, 34, 10, 10, 35, 32, 114, 111, 117, 110, 100, 32, 49,
+52, 55, 32, 40, 112, 97, 114, 105, 116, 121, 49, 52, 55, 41, 58, 32, 80, 114, 105, 115, 109, 32, 77, 117,
+108, 116, 105, 98, 97, 110, 100, 39, 115, 32, 109, 101, 97, 115, 117, 114, 101, 100, 32, 68, 121, 110, 97, 109,
+105, 99, 32, 112, 104, 97, 115, 101, 10, 34, 67, 108, 97, 115, 115, 105, 99, 32, 100, 121, 110, 97, 109, 105,
+99, 34, 32, 61, 32, 34, 68, 105, 110, 195, 162, 109, 105, 99, 97, 32, 99, 108, 195, 161, 115, 115, 105, 99,
+97, 34, 10, 34, 84, 104, 105, 115, 32, 112, 114, 111, 106, 101, 99, 116, 39, 115, 32, 68, 121, 110, 97, 109,
+105, 99, 32, 112, 104, 97, 115, 101, 32, 114, 117, 110, 115, 32, 116, 104, 101, 32, 101, 110, 103, 105, 110, 101,
+32, 105, 116, 32, 119, 97, 115, 32, 115, 97, 118, 101, 100, 32, 119, 105, 116, 104, 32, 40, 98, 101, 102, 111,
+114, 101, 32, 114, 111, 117, 110, 100, 32, 49, 52, 55, 41, 46, 32, 67, 108, 105, 99, 107, 32, 116, 111, 32,
+117, 115, 101, 32, 116, 104, 101, 32, 109, 101, 97, 115, 117, 114, 101, 100, 32, 111, 110, 101, 32, 40, 80, 114,
+111, 45, 77, 66, 39, 115, 32, 114, 101, 115, 112, 111, 110, 115, 101, 41, 46, 34, 32, 61, 32, 34, 65, 32,
+102, 97, 115, 101, 32, 100, 105, 110, 195, 162, 109, 105, 99, 97, 32, 100, 101, 115, 116, 101, 32, 112, 114, 111,
+106, 101, 116, 111, 32, 117, 115, 97, 32, 111, 32, 109, 111, 116, 111, 114, 32, 99, 111, 109, 32, 113, 117, 101,
+32, 102, 111, 105, 32, 115, 97, 108, 118, 111, 32, 40, 97, 110, 116, 101, 115, 32, 100, 97, 32, 114, 111, 100,
+97, 100, 97, 32, 49, 52, 55, 41, 46, 32, 67, 108, 105, 113, 117, 101, 32, 112, 97, 114, 97, 32, 117, 115,
+97, 114, 32, 111, 32, 109, 101, 100, 105, 100, 111, 32, 40, 97, 32, 114, 101, 115, 112, 111, 115, 116, 97, 32,
+100, 111, 32, 80, 114, 111, 45, 77, 66, 41, 46, 34, 10, 34, 69, 120, 112, 101, 114, 116, 32, 62, 62, 34,
+32, 61, 32, 34, 65, 118, 97, 110, 195, 167, 97, 100, 111, 32, 62, 62, 34, 10, 34, 69, 120, 112, 101, 114,
+116, 32, 60, 60, 34, 32, 61, 32, 34, 65, 118, 97, 110, 195, 167, 97, 100, 111, 32, 60, 60, 34, 10, 34,
+83, 104, 111, 119, 32, 116, 104, 101, 32, 98, 97, 110, 100, 39, 115, 32, 101, 120, 112, 101, 114, 116, 32, 115,
+101, 116, 116, 105, 110, 103, 115, 58, 32, 115, 105, 100, 101, 45, 99, 104, 97, 105, 110, 32, 102, 105, 108, 116,
+101, 114, 105, 110, 103, 32, 40, 98, 97, 110, 100, 32, 111, 114, 32, 97, 32, 102, 114, 101, 101, 32, 114, 97,
+110, 103, 101, 41, 32, 97, 110, 100, 32, 116, 104, 101, 32, 115, 116, 101, 114, 101, 111, 32, 108, 105, 110, 107,
+34, 32, 61, 32, 34, 77, 111, 115, 116, 114, 97, 32, 111, 115, 32, 97, 106, 117, 115, 116, 101, 115, 32, 97,
+118, 97, 110, 195, 167, 97, 100, 111, 115, 32, 100, 97, 32, 98, 97, 110, 100, 97, 58, 32, 102, 105, 108, 116,
+114, 111, 32, 100, 111, 32, 115, 105, 100, 101, 32, 99, 104, 97, 105, 110, 32, 40, 97, 32, 98, 97, 110, 100,
+97, 32, 111, 117, 32, 117, 109, 97, 32, 102, 97, 105, 120, 97, 32, 108, 105, 118, 114, 101, 41, 32, 101, 32,
+111, 32, 108, 105, 110, 107, 32, 101, 115, 116, 195, 169, 114, 101, 111, 34, 10, 34, 66, 97, 110, 100, 124, 70,
+114, 101, 101, 34, 32, 61, 32, 34, 66, 97, 110, 100, 97, 124, 76, 105, 118, 114, 101, 34, 10, 34, 83, 67,
+32, 108, 111, 119, 34, 32, 61, 32, 34, 83, 67, 32, 103, 114, 97, 118, 101, 34, 10, 34, 83, 67, 32, 104,
+105, 103, 104, 34, 32, 61, 32, 34, 83, 67, 32, 97, 103, 117, 100, 111, 34, 10, 34, 69, 120, 112, 101, 114,
+116, 32, 40, 115, 101, 108, 101, 99, 116, 101, 100, 32, 98, 97, 110, 100, 41, 34, 32, 61, 32, 34, 65, 118,
+97, 110, 195, 167, 97, 100, 111, 32, 40, 98, 97, 110, 100, 97, 32, 115, 101, 108, 101, 99, 105, 111, 110, 97,
+100, 97, 41, 34, 10, 34, 67, 108, 97, 115, 115, 105, 99, 124, 77, 101, 97, 115, 117, 114, 101, 100, 34, 32,
+61, 32, 34, 67, 108, 195, 161, 115, 115, 105, 99, 111, 124, 77, 101, 100, 105, 100, 111, 34, 10, 34, 69, 99,
+104, 111, 32, 118, 111, 105, 99, 105, 110, 103, 34, 32, 61, 32, 34, 86, 111, 122, 32, 100, 111, 32, 101, 99,
+111, 34, 10, 34, 83, 97, 116, 117, 114, 97, 116, 105, 111, 110, 32, 116, 121, 112, 101, 34, 32, 61, 32, 34,
+84, 105, 112, 111, 32, 100, 101, 32, 115, 97, 116, 117, 114, 97, 195, 167, 195, 163, 111, 34, 10, 34, 83, 97,
+116, 46, 34, 32, 61, 32, 34, 83, 97, 116, 46, 34, 10, 34, 77, 117, 108, 116, 46, 34, 32, 61, 32, 34,
+77, 117, 108, 116, 46, 34, 10, 34, 49, 120, 124, 50, 120, 124, 52, 120, 124, 56, 120, 34, 32, 61, 32, 34,
+49, 120, 124, 50, 120, 124, 52, 120, 124, 56, 120, 34, 10, 34, 79, 102, 102, 124, 77, 97, 115, 116, 101, 114,
+105, 110, 103, 32, 114, 101, 101, 108, 124, 83, 116, 117, 100, 105, 111, 32, 114, 101, 101, 108, 124, 67, 97, 114,
+116, 114, 105, 100, 103, 101, 32, 101, 99, 104, 111, 124, 77, 117, 108, 116, 105, 45, 104, 101, 97, 100, 32, 116,
+97, 112, 101, 124, 86, 97, 108, 118, 101, 32, 116, 97, 112, 101, 124, 87, 111, 114, 110, 32, 99, 97, 115, 115,
+101, 116, 116, 101, 124, 80, 101, 100, 97, 108, 32, 66, 66, 68, 124, 67, 111, 109, 112, 97, 99, 116, 32, 66,
+66, 68, 124, 79, 105, 108, 32, 100, 114, 117, 109, 124, 77, 97, 103, 110, 101, 116, 105, 99, 32, 100, 114, 117,
+109, 124, 80, 104, 111, 110, 101, 32, 108, 105, 110, 101, 124, 77, 101, 100, 105, 117, 109, 32, 119, 97, 118, 101,
+124, 66, 114, 111, 97, 100, 99, 97, 115, 116, 32, 70, 77, 124, 68, 105, 115, 116, 97, 110, 116, 32, 115, 116,
+97, 116, 105, 111, 110, 124, 87, 97, 108, 107, 105, 101, 45, 116, 97, 108, 107, 105, 101, 124, 80, 114, 105, 115,
+116, 105, 110, 101, 32, 100, 105, 103, 105, 116, 97, 108, 124, 87, 97, 114, 109, 32, 97, 110, 97, 108, 111, 103,
+124, 68, 105, 103, 105, 116, 97, 108, 32, 101, 110, 115, 101, 109, 98, 108, 101, 124, 65, 110, 97, 108, 111, 103,
+32, 101, 110, 115, 101, 109, 98, 108, 101, 124, 80, 101, 100, 97, 108, 32, 101, 110, 115, 101, 109, 98, 108, 101,
+124, 83, 101, 97, 115, 105, 99, 107, 124, 72, 111, 116, 32, 103, 108, 111, 119, 124, 84, 104, 105, 99, 107, 124,
+66, 97, 116, 116, 101, 114, 101, 100, 124, 83, 113, 117, 97, 115, 104, 101, 100, 124, 70, 117, 122, 122, 101, 100,
+124, 72, 111, 110, 107, 121, 124, 72, 97, 122, 101, 124, 83, 109, 101, 97, 114, 101, 100, 124, 83, 99, 97, 116,
+116, 101, 114, 101, 100, 124, 82, 111, 111, 109, 121, 34, 32, 61, 32, 34, 68, 101, 115, 108, 105, 103, 97, 100,
+111, 124, 82, 111, 108, 111, 32, 100, 101, 32, 109, 97, 115, 116, 101, 114, 105, 122, 97, 195, 167, 195, 163, 111,
+124, 82, 111, 108, 111, 32, 100, 101, 32, 101, 115, 116, 195, 186, 100, 105, 111, 124, 69, 99, 111, 32, 100, 101,
+32, 99, 97, 114, 116, 117, 99, 104, 111, 124, 70, 105, 116, 97, 32, 109, 117, 108, 116, 105, 99, 97, 98, 101,
+195, 167, 97, 124, 70, 105, 116, 97, 32, 118, 97, 108, 118, 117, 108, 97, 100, 97, 124, 67, 97, 115, 115, 101,
+116, 101, 32, 103, 97, 115, 116, 111, 124, 66, 66, 68, 32, 100, 101, 32, 112, 101, 100, 97, 108, 124, 66, 66,
+68, 32, 99, 111, 109, 112, 97, 99, 116, 111, 124, 84, 97, 109, 98, 111, 114, 32, 100, 101, 32, 195, 179, 108,
+101, 111, 124, 84, 97, 109, 98, 111, 114, 32, 109, 97, 103, 110, 195, 169, 116, 105, 99, 111, 124, 76, 105, 110,
+104, 97, 32, 116, 101, 108, 101, 102, 195, 180, 110, 105, 99, 97, 124, 79, 110, 100, 97, 32, 109, 195, 169, 100,
+105, 97, 124, 70, 77, 32, 100, 101, 32, 114, 195, 161, 100, 105, 111, 124, 69, 115, 116, 97, 195, 167, 195, 163,
+111, 32, 100, 105, 115, 116, 97, 110, 116, 101, 124, 87, 97, 108, 107, 105, 101, 45, 116, 97, 108, 107, 105, 101,
+124, 68, 105, 103, 105, 116, 97, 108, 32, 112, 117, 114, 111, 124, 65, 110, 97, 108, 195, 179, 103, 105, 99, 111,
+32, 113, 117, 101, 110, 116, 101, 124, 67, 111, 110, 106, 117, 110, 116, 111, 32, 100, 105, 103, 105, 116, 97, 108,
+124, 67, 111, 110, 106, 117, 110, 116, 111, 32, 97, 110, 97, 108, 195, 179, 103, 105, 99, 111, 124, 67, 111, 110,
+106, 117, 110, 116, 111, 32, 100, 101, 32, 112, 101, 100, 97, 108, 124, 77, 97, 114, 101, 97, 100, 111, 124, 66,
+114, 105, 108, 104, 111, 32, 113, 117, 101, 110, 116, 101, 124, 69, 110, 99, 111, 114, 112, 97, 100, 111, 124, 83,
+117, 114, 114, 97, 100, 111, 124, 69, 115, 109, 97, 103, 97, 100, 111, 124, 70, 117, 122, 122, 124, 70, 97, 110,
+104, 111, 115, 111, 124, 78, 195, 169, 118, 111, 97, 124, 66, 111, 114, 114, 97, 100, 111, 124, 69, 115, 112, 97,
+108, 104, 97, 100, 111, 124, 65, 109, 98, 105, 101, 110, 116, 101, 34, 10, 34, 65, 117, 116, 111, 124, 67, 108,
+101, 97, 110, 124, 84, 97, 112, 101, 124, 84, 117, 98, 101, 124, 83, 113, 117, 97, 115, 104, 124, 71, 114, 105,
+116, 124, 67, 101, 105, 108, 105, 110, 103, 34, 32, 61, 32, 34, 65, 117, 116, 111, 124, 76, 105, 109, 112, 97,
+124, 70, 105, 116, 97, 124, 86, 195, 161, 108, 118, 117, 108, 97, 124, 69, 115, 109, 97, 103, 97, 100, 97, 124,
+83, 117, 106, 101, 105, 114, 97, 124, 84, 101, 116, 111, 34, 10, 34, 68, 114, 105, 118, 101, 32, 112, 97, 110,
+34, 32, 61, 32, 34, 80, 97, 110, 32, 100, 111, 32, 100, 114, 105, 118, 101, 34, 10, 34, 76, 47, 82, 124,
+77, 47, 83, 34, 32, 61, 32, 34, 76, 47, 82, 124, 77, 47, 83, 34, 10, 34, 66, 97, 114, 105, 116, 111,
+110, 101, 34, 32, 61, 32, 34, 66, 97, 114, 195, 173, 116, 111, 110, 111, 34, 10, 34, 84, 101, 110, 111, 114,
+34, 32, 61, 32, 34, 84, 101, 110, 111, 114, 34, 10, 34, 65, 108, 116, 111, 34, 32, 61, 32, 34, 67, 111,
+110, 116, 114, 97, 108, 116, 111, 34, 10, 34, 77, 101, 122, 122, 111, 34, 32, 61, 32, 34, 77, 101, 122, 122,
+111, 34, 10, 34, 83, 111, 112, 114, 97, 110, 111, 34, 32, 61, 32, 34, 83, 111, 112, 114, 97, 110, 111, 34,
+10, 34, 71, 101, 110, 101, 114, 105, 99, 34, 32, 61, 32, 34, 71, 101, 110, 195, 169, 114, 105, 99, 111, 34,
+10, 34, 82, 101, 115, 101, 116, 32, 115, 99, 97, 108, 101, 34, 32, 61, 32, 34, 82, 101, 105, 110, 105, 99,
+105, 97, 114, 32, 101, 115, 99, 97, 108, 97, 34, 10, 34, 66, 121, 112, 97, 115, 115, 32, 109, 111, 100, 101,
+58, 32, 97, 32, 107, 101, 121, 32, 115, 119, 105, 116, 99, 104, 101, 115, 32, 105, 116, 115, 32, 110, 111, 116,
+101, 32, 98, 101, 116, 119, 101, 101, 110, 32, 99, 111, 114, 114, 101, 99, 116, 101, 100, 32, 97, 110, 100, 32,
+112, 97, 115, 115, 101, 100, 32, 97, 115, 32, 115, 117, 110, 103, 34, 32, 61, 32, 34, 77, 111, 100, 111, 32,
+66, 121, 112, 97, 115, 115, 58, 32, 117, 109, 97, 32, 116, 101, 99, 108, 97, 32, 97, 108, 116, 101, 114, 110,
+97, 32, 97, 32, 110, 111, 116, 97, 32, 101, 110, 116, 114, 101, 32, 99, 111, 114, 114, 105, 103, 105, 100, 97,
+32, 101, 32, 112, 97, 115, 115, 97, 100, 97, 32, 99, 111, 109, 111, 32, 99, 97, 110, 116, 97, 100, 97, 34,
+10, 34, 82, 101, 109, 111, 118, 101, 32, 109, 111, 100, 101, 58, 32, 97, 32, 107, 101, 121, 32, 99, 121, 99,
+108, 101, 115, 32, 105, 116, 115, 32, 110, 111, 116, 101, 58, 32, 108, 101, 103, 97, 108, 44, 32, 105, 108, 108,
+101, 103, 97, 108, 32, 40, 116, 111, 32, 116, 104, 101, 32, 110, 101, 97, 114, 101, 115, 116, 32, 110, 111, 116,
+101, 41, 44, 32, 105, 108, 108, 101, 103, 97, 108, 32, 112, 105, 116, 99, 104, 32, 117, 112, 44, 32, 105, 108,
+108, 101, 103, 97, 108, 32, 112, 105, 116, 99, 104, 32, 100, 111, 119, 110, 34, 32, 61, 32, 34, 77, 111, 100,
+111, 32, 82, 101, 109, 111, 118, 101, 114, 58, 32, 117, 109, 97, 32, 116, 101, 99, 108, 97, 32, 112, 101, 114,
+99, 111, 114, 114, 101, 32, 111, 115, 32, 101, 115, 116, 97, 100, 111, 115, 32, 100, 97, 32, 110, 111, 116, 97,
+58, 32, 118, 195, 161, 108, 105, 100, 97, 44, 32, 105, 110, 118, 195, 161, 108, 105, 100, 97, 32, 40, 112, 97,
+114, 97, 32, 97, 32, 110, 111, 116, 97, 32, 109, 97, 105, 115, 32, 112, 114, 195, 179, 120, 105, 109, 97, 41,
+44, 32, 105, 110, 118, 195, 161, 108, 105, 100, 97, 32, 112, 97, 114, 97, 32, 99, 105, 109, 97, 44, 32, 105,
+110, 118, 195, 161, 108, 105, 100, 97, 32, 112, 97, 114, 97, 32, 98, 97, 105, 120, 111, 34, 10, 34, 82, 101,
+115, 101, 116, 32, 115, 99, 97, 108, 101, 58, 32, 101, 118, 101, 114, 121, 32, 110, 111, 116, 101, 32, 111, 102,
+32, 116, 104, 101, 32, 115, 99, 97, 108, 101, 32, 108, 101, 103, 97, 108, 32, 97, 103, 97, 105, 110, 44, 32,
+110, 111, 116, 104, 105, 110, 103, 32, 98, 121, 112, 97, 115, 115, 101, 100, 34, 32, 61, 32, 34, 82, 101, 105,
+110, 105, 99, 105, 97, 114, 32, 101, 115, 99, 97, 108, 97, 58, 32, 116, 111, 100, 97, 115, 32, 97, 115, 32,
+110, 111, 116, 97, 115, 32, 100, 97, 32, 101, 115, 99, 97, 108, 97, 32, 118, 195, 161, 108, 105, 100, 97, 115,
+32, 100, 101, 32, 110, 111, 118, 111, 44, 32, 110, 97, 100, 97, 32, 101, 109, 32, 98, 121, 112, 97, 115, 115,
+34, 10, 34, 82, 97, 110, 103, 101, 32, 112, 114, 101, 115, 101, 116, 58, 32, 110, 111, 116, 101, 115, 32, 115,
+117, 110, 103, 32, 111, 117, 116, 115, 105, 100, 101, 32, 116, 104, 101, 32, 114, 97, 110, 103, 101, 32, 112, 97,
+115, 115, 32, 117, 110, 99, 111, 114, 114, 101, 99, 116, 101, 100, 32, 40, 71, 101, 110, 101, 114, 105, 99, 58,
+32, 116, 104, 101, 32, 119, 104, 111, 108, 101, 32, 107, 101, 121, 98, 111, 97, 114, 100, 41, 34, 32, 61, 32,
+34, 80, 114, 101, 100, 101, 102, 105, 110, 105, 195, 167, 195, 163, 111, 32, 100, 101, 32, 101, 120, 116, 101, 110,
+115, 195, 163, 111, 58, 32, 110, 111, 116, 97, 115, 32, 99, 97, 110, 116, 97, 100, 97, 115, 32, 102, 111, 114,
+97, 32, 100, 97, 32, 101, 120, 116, 101, 110, 115, 195, 163, 111, 32, 112, 97, 115, 115, 97, 109, 32, 115, 101,
+109, 32, 99, 111, 114, 114, 101, 195, 167, 195, 163, 111, 32, 40, 71, 101, 110, 195, 169, 114, 105, 99, 111, 58,
+32, 111, 32, 116, 101, 99, 108, 97, 100, 111, 32, 105, 110, 116, 101, 105, 114, 111, 41, 34, 10, 34, 75, 101,
+121, 98, 111, 97, 114, 100, 32, 118, 105, 101, 119, 58, 32, 115, 104, 111, 119, 32, 109, 111, 114, 101, 32, 47,
+32, 102, 101, 119, 101, 114, 32, 111, 99, 116, 97, 118, 101, 115, 34, 32, 61, 32, 34, 86, 105, 115, 116, 97,
+32, 100, 111, 32, 116, 101, 99, 108, 97, 100, 111, 58, 32, 109, 111, 115, 116, 114, 97, 114, 32, 109, 97, 105,
+115, 32, 47, 32, 109, 101, 110, 111, 115, 32, 111, 105, 116, 97, 118, 97, 115, 34, 10, 34, 75, 101, 121, 98,
+111, 97, 114, 100, 32, 118, 105, 101, 119, 58, 32, 115, 99, 114, 111, 108, 108, 32, 100, 111, 119, 110, 32, 47,
+32, 117, 112, 32, 97, 110, 32, 111, 99, 116, 97, 118, 101, 34, 32, 61, 32, 34, 86, 105, 115, 116, 97, 32,
+100, 111, 32, 116, 101, 99, 108, 97, 100, 111, 58, 32, 114, 111, 108, 97, 114, 32, 117, 109, 97, 32, 111, 105,
+116, 97, 118, 97, 32, 112, 97, 114, 97, 32, 98, 97, 105, 120, 111, 32, 47, 32, 112, 97, 114, 97, 32, 99,
+105, 109, 97, 34, 10, 34, 76, 97, 116, 99, 104, 58, 32, 111, 102, 102, 32, 61, 32, 97, 32, 107, 101, 121,
+39, 115, 32, 101, 100, 105, 116, 32, 108, 97, 115, 116, 115, 32, 111, 110, 108, 121, 32, 119, 104, 105, 108, 101,
+32, 105, 116, 32, 105, 115, 32, 104, 101, 108, 100, 34, 32, 61, 32, 34, 84, 114, 97, 118, 97, 58, 32, 100,
+101, 115, 108, 105, 103, 97, 100, 97, 32, 61, 32, 97, 32, 101, 100, 105, 195, 167, 195, 163, 111, 32, 100, 101,
+32, 117, 109, 97, 32, 116, 101, 99, 108, 97, 32, 100, 117, 114, 97, 32, 115, 195, 179, 32, 101, 110, 113, 117,
+97, 110, 116, 111, 32, 101, 108, 97, 32, 195, 169, 32, 115, 101, 103, 117, 114, 97, 100, 97, 34, 10, 34, 82,
+97, 110, 103, 101, 58, 32, 100, 114, 97, 103, 32, 97, 32, 98, 111, 117, 110, 100, 97, 114, 121, 59, 32, 110,
+111, 116, 101, 115, 32, 115, 117, 110, 103, 32, 111, 117, 116, 115, 105, 100, 101, 32, 105, 116, 32, 112, 97, 115,
+115, 32, 117, 110, 99, 111, 114, 114, 101, 99, 116, 101, 100, 34, 32, 61, 32, 34, 69, 120, 116, 101, 110, 115,
+195, 163, 111, 58, 32, 97, 114, 114, 97, 115, 116, 101, 32, 117, 109, 32, 108, 105, 109, 105, 116, 101, 59, 32,
+110, 111, 116, 97, 115, 32, 99, 97, 110, 116, 97, 100, 97, 115, 32, 102, 111, 114, 97, 32, 100, 101, 108, 97,
+32, 112, 97, 115, 115, 97, 109, 32, 115, 101, 109, 32, 99, 111, 114, 114, 101, 195, 167, 195, 163, 111, 34, 10,
+34, 67, 108, 105, 99, 107, 32, 97, 32, 107, 101, 121, 58, 32, 99, 104, 97, 110, 103, 101, 32, 116, 104, 97,
+116, 32, 110, 111, 116, 101, 39, 115, 32, 115, 116, 97, 116, 117, 115, 32, 105, 110, 32, 101, 118, 101, 114, 121,
+32, 111, 99, 116, 97, 118, 101, 34, 32, 61, 32, 34, 67, 108, 105, 113, 117, 101, 32, 110, 117, 109, 97, 32,
+116, 101, 99, 108, 97, 58, 32, 109, 117, 100, 97, 32, 111, 32, 101, 115, 116, 97, 100, 111, 32, 100, 101, 115,
+115, 97, 32, 110, 111, 116, 97, 32, 101, 109, 32, 116, 111, 100, 97, 115, 32, 97, 115, 32, 111, 105, 116, 97,
+118, 97, 115, 34, 10, 34, 67, 108, 105, 99, 107, 32, 97, 32, 107, 101, 121, 58, 32, 98, 121, 112, 97, 115,
+115, 32, 47, 32, 99, 111, 114, 114, 101, 99, 116, 32, 116, 104, 97, 116, 32, 110, 111, 116, 101, 32, 105, 110,
+32, 101, 118, 101, 114, 121, 32, 111, 99, 116, 97, 118, 101, 34, 32, 61, 32, 34, 67, 108, 105, 113, 117, 101,
+32, 110, 117, 109, 97, 32, 116, 101, 99, 108, 97, 58, 32, 98, 121, 112, 97, 115, 115, 32, 47, 32, 99, 111,
+114, 114, 105, 103, 105, 114, 32, 101, 115, 115, 97, 32, 110, 111, 116, 97, 32, 101, 109, 32, 116, 111, 100, 97,
+115, 32, 97, 115, 32, 111, 105, 116, 97, 118, 97, 115, 34, 10, 34, 73, 110, 105, 116, 105, 97, 108, 105, 122,
+101, 100, 32, 99, 111, 110, 116, 114, 111, 108, 115, 34, 32, 61, 32, 34, 67, 111, 110, 116, 114, 111, 108, 101,
+115, 32, 105, 110, 105, 99, 105, 97, 108, 105, 122, 97, 100, 111, 115, 34, 10, 34, 73, 110, 105, 116, 105, 97,
+108, 105, 122, 101, 100, 32, 99, 111, 110, 116, 114, 111, 108, 115, 58, 32, 116, 111, 32, 98, 101, 32, 114, 101,
+115, 101, 116, 32, 119, 104, 101, 110, 32, 116, 104, 101, 32, 115, 111, 110, 103, 32, 115, 116, 97, 114, 116, 115,
+32, 40, 97, 32, 99, 111, 110, 116, 114, 111, 108, 39, 115, 32, 109, 101, 110, 117, 32, 62, 32, 73, 110, 105,
+116, 32, 115, 111, 110, 103, 32, 119, 105, 116, 104, 32, 116, 104, 105, 115, 32, 112, 111, 115, 105, 116, 105, 111,
+110, 41, 34, 32, 61, 32, 34, 67, 111, 110, 116, 114, 111, 108, 101, 115, 32, 105, 110, 105, 99, 105, 97, 108,
+105, 122, 97, 100, 111, 115, 58, 32, 118, 111, 108, 116, 97, 109, 32, 97, 32, 101, 115, 116, 101, 32, 118, 97,
+108, 111, 114, 32, 113, 117, 97, 110, 100, 111, 32, 97, 32, 109, 195, 186, 115, 105, 99, 97, 32, 99, 111, 109,
+101, 195, 167, 97, 32, 40, 109, 101, 110, 117, 32, 100, 101, 32, 117, 109, 32, 99, 111, 110, 116, 114, 111, 108,
+101, 32, 62, 32, 73, 110, 105, 99, 105, 97, 114, 32, 97, 32, 109, 195, 186, 115, 105, 99, 97, 32, 99, 111,
+109, 32, 101, 115, 116, 97, 32, 112, 111, 115, 105, 195, 167, 195, 163, 111, 41, 34, 10, 34, 114, 101, 115, 101,
+116, 32, 116, 111, 32, 116, 104, 105, 115, 32, 118, 97, 108, 117, 101, 32, 119, 104, 101, 110, 32, 116, 104, 101,
+32, 115, 111, 110, 103, 32, 115, 116, 97, 114, 116, 115, 32, 32, 91, 82, 77, 66, 93, 32, 100, 101, 108, 101,
+116, 101, 32, 116, 104, 101, 32, 105, 110, 105, 116, 105, 97, 108, 32, 118, 97, 108, 117, 101, 34, 32, 61, 32,
+34, 118, 111, 108, 116, 97, 32, 97, 32, 101, 115, 116, 101, 32, 118, 97, 108, 111, 114, 32, 113, 117, 97, 110,
+100, 111, 32, 97, 32, 109, 195, 186, 115, 105, 99, 97, 32, 99, 111, 109, 101, 195, 167, 97, 32, 32, 91, 82,
+77, 66, 93, 32, 97, 112, 97, 103, 97, 114, 32, 111, 32, 118, 97, 108, 111, 114, 32, 105, 110, 105, 99, 105,
+97, 108, 34, 10, 35, 32, 45, 45, 45, 32, 82, 111, 117, 110, 100, 32, 49, 52, 53, 58, 32, 82, 105, 100,
+103, 101, 32, 83, 116, 114, 105, 112, 39, 115, 32, 86, 111, 99, 97, 108, 32, 115, 116, 114, 105, 112, 32, 118,
+111, 105, 99, 105, 110, 103, 10, 34, 67, 111, 109, 112, 97, 110, 100, 101, 114, 34, 32, 61, 32, 34, 67, 111,
+109, 112, 97, 110, 100, 101, 114, 34, 10, 34, 77, 97, 107, 101, 45, 117, 112, 34, 32, 61, 32, 34, 71, 97,
+110, 104, 111, 32, 100, 101, 32, 99, 111, 109, 112, 101, 110, 115, 97, 195, 167, 195, 163, 111, 34, 10, 34, 83,
+111, 102, 116, 32, 107, 110, 101, 101, 34, 32, 61, 32, 34, 74, 111, 101, 108, 104, 111, 32, 115, 117, 97, 118,
+101, 34, 10, 34, 66, 114, 111, 97, 100, 98, 97, 110, 100, 124, 83, 112, 108, 105, 116, 34, 32, 61, 32, 34,
+66, 97, 110, 100, 97, 32, 108, 97, 114, 103, 97, 124, 68, 105, 118, 105, 100, 105, 100, 111, 34, 10, 34, 76,
+111, 111, 107, 34, 32, 61, 32, 34, 65, 110, 116, 101, 99, 105, 112, 46, 34, 10, 34, 68, 101, 45, 112, 108,
+111, 115, 101, 114, 34, 32, 61, 32, 34, 68, 101, 45, 112, 108, 111, 115, 101, 114, 34, 10, 34, 69, 113, 117,
+97, 108, 105, 115, 101, 114, 34, 32, 61, 32, 34, 69, 113, 117, 97, 108, 105, 122, 97, 100, 111, 114, 34, 10,
+34, 86, 111, 99, 97, 108, 32, 115, 116, 114, 105, 112, 32, 118, 111, 105, 99, 105, 110, 103, 34, 32, 61, 32,
+34, 86, 111, 122, 32, 100, 101, 32, 99, 97, 110, 97, 108, 32, 118, 111, 99, 97, 108, 34, 10, 34, 84, 104,
+101, 32, 118, 111, 99, 97, 108, 32, 99, 104, 97, 110, 110, 101, 108, 32, 115, 116, 114, 105, 112, 58, 32, 100,
+101, 45, 101, 115, 115, 101, 114, 44, 32, 100, 101, 45, 112, 108, 111, 115, 101, 114, 44, 32, 116, 104, 114, 101,
+101, 45, 98, 97, 110, 100, 32, 69, 81, 32, 97, 110, 100, 32, 99, 111, 109, 112, 97, 110, 100, 101, 114, 32,
+105, 110, 32, 97, 110, 121, 32, 111, 114, 100, 101, 114, 34, 32, 61, 32, 34, 79, 32, 99, 97, 110, 97, 108,
+32, 118, 111, 99, 97, 108, 58, 32, 100, 101, 45, 101, 115, 115, 101, 114, 44, 32, 100, 101, 45, 112, 108, 111,
+115, 101, 114, 44, 32, 69, 81, 32, 100, 101, 32, 116, 114, 195, 170, 115, 32, 98, 97, 110, 100, 97, 115, 32,
+101, 32, 99, 111, 109, 112, 97, 110, 100, 101, 114, 32, 101, 109, 32, 113, 117, 97, 108, 113, 117, 101, 114, 32,
+111, 114, 100, 101, 109, 34, 10, 34, 84, 104, 101, 32, 111, 114, 100, 101, 114, 32, 111, 102, 32, 116, 104, 101,
+32, 102, 111, 117, 114, 32, 118, 111, 99, 97, 108, 32, 109, 111, 100, 117, 108, 101, 115, 34, 32, 61, 32, 34,
+65, 32, 111, 114, 100, 101, 109, 32, 100, 111, 115, 32, 113, 117, 97, 116, 114, 111, 32, 109, 195, 179, 100, 117,
+108, 111, 115, 32, 118, 111, 99, 97, 105, 115, 34, 10, 34, 84, 117, 114, 110, 115, 32, 100, 111, 119, 110, 32,
+115, 105, 98, 105, 108, 97, 110, 99, 101, 58, 32, 116, 104, 101, 32, 104, 105, 103, 104, 115, 32, 119, 104, 101,
+110, 32, 116, 104, 101, 121, 32, 103, 101, 116, 32, 108, 111, 117, 100, 32, 99, 111, 109, 112, 97, 114, 101, 100,
+32, 119, 105, 116, 104, 32, 116, 104, 101, 32, 114, 101, 115, 116, 32, 111, 102, 32, 116, 104, 101, 32, 118, 111,
+105, 99, 101, 34, 32, 61, 32, 34, 82, 101, 100, 117, 122, 32, 97, 32, 115, 105, 98, 105, 108, 195, 162, 110,
+99, 105, 97, 58, 32, 111, 115, 32, 97, 103, 117, 100, 111, 115, 32, 113, 117, 97, 110, 100, 111, 32, 102, 105,
+99, 97, 109, 32, 102, 111, 114, 116, 101, 115, 32, 101, 109, 32, 114, 101, 108, 97, 195, 167, 195, 163, 111, 32,
+97, 111, 32, 114, 101, 115, 116, 111, 32, 100, 97, 32, 118, 111, 122, 34, 10, 34, 72, 111, 119, 32, 115, 116,
+114, 111, 110, 103, 32, 116, 104, 101, 32, 104, 105, 103, 104, 115, 32, 109, 117, 115, 116, 32, 98, 101, 44, 32,
+99, 111, 109, 112, 97, 114, 101, 100, 32, 119, 105, 116, 104, 32, 116, 104, 101, 32, 119, 104, 111, 108, 101, 32,
+118, 111, 105, 99, 101, 44, 32, 98, 101, 102, 111, 114, 101, 32, 116, 104, 101, 32, 100, 101, 45, 101, 115, 115,
+101, 114, 32, 119, 111, 114, 107, 115, 34, 32, 61, 32, 34, 81, 117, 195, 163, 111, 32, 102, 111, 114, 116, 101,
+115, 32, 111, 115, 32, 97, 103, 117, 100, 111, 115, 32, 112, 114, 101, 99, 105, 115, 97, 109, 32, 101, 115, 116,
+97, 114, 44, 32, 101, 109, 32, 114, 101, 108, 97, 195, 167, 195, 163, 111, 32, 195, 160, 32, 118, 111, 122, 32,
+105, 110, 116, 101, 105, 114, 97, 44, 32, 112, 97, 114, 97, 32, 111, 32, 100, 101, 45, 101, 115, 115, 101, 114,
+32, 97, 103, 105, 114, 34, 10, 34, 84, 104, 101, 32, 102, 114, 101, 113, 117, 101, 110, 99, 121, 32, 97, 98,
+111, 118, 101, 32, 119, 104, 105, 99, 104, 32, 116, 104, 101, 32, 100, 101, 45, 101, 115, 115, 101, 114, 32, 108,
+105, 115, 116, 101, 110, 115, 34, 32, 61, 32, 34, 65, 32, 102, 114, 101, 113, 117, 195, 170, 110, 99, 105, 97,
+32, 97, 99, 105, 109, 97, 32, 100, 97, 32, 113, 117, 97, 108, 32, 111, 32, 100, 101, 45, 101, 115, 115, 101,
+114, 32, 101, 115, 99, 117, 116, 97, 34, 10, 34, 83, 112, 108, 105, 116, 58, 32, 111, 110, 108, 121, 32, 116,
+104, 101, 32, 104, 105, 103, 104, 115, 32, 97, 114, 101, 32, 116, 117, 114, 110, 101, 100, 32, 100, 111, 119, 110,
+59, 32, 98, 114, 111, 97, 100, 98, 97, 110, 100, 58, 32, 116, 104, 101, 32, 119, 104, 111, 108, 101, 32, 118,
+111, 105, 99, 101, 34, 32, 61, 32, 34, 68, 105, 118, 105, 100, 105, 100, 111, 58, 32, 115, 195, 179, 32, 111,
+115, 32, 97, 103, 117, 100, 111, 115, 32, 115, 195, 163, 111, 32, 114, 101, 100, 117, 122, 105, 100, 111, 115, 59,
+32, 98, 97, 110, 100, 97, 32, 108, 97, 114, 103, 97, 58, 32, 97, 32, 118, 111, 122, 32, 105, 110, 116, 101,
+105, 114, 97, 34, 10, 34, 68, 101, 108, 97, 121, 115, 32, 116, 104, 101, 32, 97, 117, 100, 105, 111, 32, 49,
+32, 109, 115, 32, 115, 111, 32, 116, 104, 101, 32, 100, 101, 45, 101, 115, 115, 101, 114, 32, 97, 99, 116, 115,
+32, 98, 101, 102, 111, 114, 101, 32, 116, 104, 101, 32, 115, 105, 98, 105, 108, 97, 110, 116, 32, 115, 116, 97,
+114, 116, 115, 34, 32, 61, 32, 34, 65, 116, 114, 97, 115, 97, 32, 111, 32, 195, 161, 117, 100, 105, 111, 32,
+49, 32, 109, 115, 32, 112, 97, 114, 97, 32, 111, 32, 100, 101, 45, 101, 115, 115, 101, 114, 32, 97, 103, 105,
+114, 32, 97, 110, 116, 101, 115, 32, 100, 111, 32, 105, 110, 195, 173, 99, 105, 111, 32, 100, 97, 32, 115, 105,
+98, 105, 108, 97, 110, 116, 101, 34, 10, 34, 80, 108, 97, 121, 115, 32, 111, 110, 108, 121, 32, 116, 104, 101,
+32, 98, 97, 110, 100, 32, 116, 104, 101, 32, 100, 101, 45, 101, 115, 115, 101, 114, 32, 97, 99, 116, 115, 32,
+111, 110, 34, 32, 61, 32, 34, 84, 111, 99, 97, 32, 115, 195, 179, 32, 97, 32, 98, 97, 110, 100, 97, 32,
+101, 109, 32, 113, 117, 101, 32, 111, 32, 100, 101, 45, 101, 115, 115, 101, 114, 32, 97, 103, 101, 34, 10, 34,
+84, 117, 114, 110, 115, 32, 100, 111, 119, 110, 32, 112, 108, 111, 115, 105, 118, 101, 115, 58, 32, 116, 104, 101,
+32, 108, 111, 119, 115, 32, 119, 104, 101, 110, 32, 116, 104, 101, 121, 32, 103, 101, 116, 32, 108, 111, 117, 100,
+32, 99, 111, 109, 112, 97, 114, 101, 100, 32, 119, 105, 116, 104, 32, 116, 104, 101, 32, 114, 101, 115, 116, 32,
+111, 102, 32, 116, 104, 101, 32, 118, 111, 105, 99, 101, 34, 32, 61, 32, 34, 82, 101, 100, 117, 122, 32, 111,
+115, 32, 112, 108, 111, 115, 105, 118, 111, 115, 58, 32, 111, 115, 32, 103, 114, 97, 118, 101, 115, 32, 113, 117,
+97, 110, 100, 111, 32, 102, 105, 99, 97, 109, 32, 102, 111, 114, 116, 101, 115, 32, 101, 109, 32, 114, 101, 108,
+97, 195, 167, 195, 163, 111, 32, 97, 111, 32, 114, 101, 115, 116, 111, 32, 100, 97, 32, 118, 111, 122, 34, 10,
+34, 72, 111, 119, 32, 115, 116, 114, 111, 110, 103, 32, 116, 104, 101, 32, 108, 111, 119, 115, 32, 109, 117, 115,
+116, 32, 98, 101, 44, 32, 99, 111, 109, 112, 97, 114, 101, 100, 32, 119, 105, 116, 104, 32, 116, 104, 101, 32,
+119, 104, 111, 108, 101, 32, 118, 111, 105, 99, 101, 44, 32, 98, 101, 102, 111, 114, 101, 32, 116, 104, 101, 32,
+100, 101, 45, 112, 108, 111, 115, 101, 114, 32, 119, 111, 114, 107, 115, 34, 32, 61, 32, 34, 81, 117, 195, 163,
+111, 32, 102, 111, 114, 116, 101, 115, 32, 111, 115, 32, 103, 114, 97, 118, 101, 115, 32, 112, 114, 101, 99, 105,
+115, 97, 109, 32, 101, 115, 116, 97, 114, 44, 32, 101, 109, 32, 114, 101, 108, 97, 195, 167, 195, 163, 111, 32,
+195, 160, 32, 118, 111, 122, 32, 105, 110, 116, 101, 105, 114, 97, 44, 32, 112, 97, 114, 97, 32, 111, 32, 100,
+101, 45, 112, 108, 111, 115, 101, 114, 32, 97, 103, 105, 114, 34, 10, 34, 84, 104, 101, 32, 102, 114, 101, 113,
+117, 101, 110, 99, 121, 32, 98, 101, 108, 111, 119, 32, 119, 104, 105, 99, 104, 32, 116, 104, 101, 32, 100, 101,
+45, 112, 108, 111, 115, 101, 114, 32, 108, 105, 115, 116, 101, 110, 115, 34, 32, 61, 32, 34, 65, 32, 102, 114,
+101, 113, 117, 195, 170, 110, 99, 105, 97, 32, 97, 98, 97, 105, 120, 111, 32, 100, 97, 32, 113, 117, 97, 108,
+32, 111, 32, 100, 101, 45, 112, 108, 111, 115, 101, 114, 32, 101, 115, 99, 117, 116, 97, 34, 10, 34, 83, 112,
+108, 105, 116, 58, 32, 111, 110, 108, 121, 32, 116, 104, 101, 32, 108, 111, 119, 115, 32, 97, 114, 101, 32, 116,
 117, 114, 110, 101, 100, 32, 100, 111, 119, 110, 59, 32, 98, 114, 111, 97, 100, 98, 97, 110, 100, 58, 32, 116,
 104, 101, 32, 119, 104, 111, 108, 101, 32, 118, 111, 105, 99, 101, 34, 32, 61, 32, 34, 68, 105, 118, 105, 100,
-105, 100, 111, 58, 32, 115, 195, 179, 32, 111, 115, 32, 97, 103, 117, 100, 111, 115, 32, 115, 195, 163, 111, 32,
+105, 100, 111, 58, 32, 115, 195, 179, 32, 111, 115, 32, 103, 114, 97, 118, 101, 115, 32, 115, 195, 163, 111, 32,
 114, 101, 100, 117, 122, 105, 100, 111, 115, 59, 32, 98, 97, 110, 100, 97, 32, 108, 97, 114, 103, 97, 58, 32,
 97, 32, 118, 111, 122, 32, 105, 110, 116, 101, 105, 114, 97, 34, 10, 34, 68, 101, 108, 97, 121, 115, 32, 116,
-104, 101, 32, 97, 117, 100, 105, 111, 32, 49, 32, 109, 115, 32, 115, 111, 32, 116, 104, 101, 32, 100, 101, 45,
-101, 115, 115, 101, 114, 32, 97, 99, 116, 115, 32, 98, 101, 102, 111, 114, 101, 32, 116, 104, 101, 32, 115, 105,
-98, 105, 108, 97, 110, 116, 32, 115, 116, 97, 114, 116, 115, 34, 32, 61, 32, 34, 65, 116, 114, 97, 115, 97,
-32, 111, 32, 195, 161, 117, 100, 105, 111, 32, 49, 32, 109, 115, 32, 112, 97, 114, 97, 32, 111, 32, 100, 101,
-45, 101, 115, 115, 101, 114, 32, 97, 103, 105, 114, 32, 97, 110, 116, 101, 115, 32, 100, 111, 32, 105, 110, 195,
-173, 99, 105, 111, 32, 100, 97, 32, 115, 105, 98, 105, 108, 97, 110, 116, 101, 34, 10, 34, 80, 108, 97, 121,
-115, 32, 111, 110, 108, 121, 32, 116, 104, 101, 32, 98, 97, 110, 100, 32, 116, 104, 101, 32, 100, 101, 45, 101,
-115, 115, 101, 114, 32, 97, 99, 116, 115, 32, 111, 110, 34, 32, 61, 32, 34, 84, 111, 99, 97, 32, 115, 195,
-179, 32, 97, 32, 98, 97, 110, 100, 97, 32, 101, 109, 32, 113, 117, 101, 32, 111, 32, 100, 101, 45, 101, 115,
-115, 101, 114, 32, 97, 103, 101, 34, 10, 34, 84, 117, 114, 110, 115, 32, 100, 111, 119, 110, 32, 112, 108, 111,
-115, 105, 118, 101, 115, 58, 32, 116, 104, 101, 32, 108, 111, 119, 115, 32, 119, 104, 101, 110, 32, 116, 104, 101,
-121, 32, 103, 101, 116, 32, 108, 111, 117, 100, 32, 99, 111, 109, 112, 97, 114, 101, 100, 32, 119, 105, 116, 104,
-32, 116, 104, 101, 32, 114, 101, 115, 116, 32, 111, 102, 32, 116, 104, 101, 32, 118, 111, 105, 99, 101, 34, 32,
-61, 32, 34, 82, 101, 100, 117, 122, 32, 111, 115, 32, 112, 108, 111, 115, 105, 118, 111, 115, 58, 32, 111, 115,
-32, 103, 114, 97, 118, 101, 115, 32, 113, 117, 97, 110, 100, 111, 32, 102, 105, 99, 97, 109, 32, 102, 111, 114,
-116, 101, 115, 32, 101, 109, 32, 114, 101, 108, 97, 195, 167, 195, 163, 111, 32, 97, 111, 32, 114, 101, 115, 116,
-111, 32, 100, 97, 32, 118, 111, 122, 34, 10, 34, 72, 111, 119, 32, 115, 116, 114, 111, 110, 103, 32, 116, 104,
-101, 32, 108, 111, 119, 115, 32, 109, 117, 115, 116, 32, 98, 101, 44, 32, 99, 111, 109, 112, 97, 114, 101, 100,
-32, 119, 105, 116, 104, 32, 116, 104, 101, 32, 119, 104, 111, 108, 101, 32, 118, 111, 105, 99, 101, 44, 32, 98,
-101, 102, 111, 114, 101, 32, 116, 104, 101, 32, 100, 101, 45, 112, 108, 111, 115, 101, 114, 32, 119, 111, 114, 107,
-115, 34, 32, 61, 32, 34, 81, 117, 195, 163, 111, 32, 102, 111, 114, 116, 101, 115, 32, 111, 115, 32, 103, 114,
-97, 118, 101, 115, 32, 112, 114, 101, 99, 105, 115, 97, 109, 32, 101, 115, 116, 97, 114, 44, 32, 101, 109, 32,
-114, 101, 108, 97, 195, 167, 195, 163, 111, 32, 195, 160, 32, 118, 111, 122, 32, 105, 110, 116, 101, 105, 114, 97,
-44, 32, 112, 97, 114, 97, 32, 111, 32, 100, 101, 45, 112, 108, 111, 115, 101, 114, 32, 97, 103, 105, 114, 34,
-10, 34, 84, 104, 101, 32, 102, 114, 101, 113, 117, 101, 110, 99, 121, 32, 98, 101, 108, 111, 119, 32, 119, 104,
-105, 99, 104, 32, 116, 104, 101, 32, 100, 101, 45, 112, 108, 111, 115, 101, 114, 32, 108, 105, 115, 116, 101, 110,
-115, 34, 32, 61, 32, 34, 65, 32, 102, 114, 101, 113, 117, 195, 170, 110, 99, 105, 97, 32, 97, 98, 97, 105,
-120, 111, 32, 100, 97, 32, 113, 117, 97, 108, 32, 111, 32, 100, 101, 45, 112, 108, 111, 115, 101, 114, 32, 101,
-115, 99, 117, 116, 97, 34, 10, 34, 83, 112, 108, 105, 116, 58, 32, 111, 110, 108, 121, 32, 116, 104, 101, 32,
-108, 111, 119, 115, 32, 97, 114, 101, 32, 116, 117, 114, 110, 101, 100, 32, 100, 111, 119, 110, 59, 32, 98, 114,
-111, 97, 100, 98, 97, 110, 100, 58, 32, 116, 104, 101, 32, 119, 104, 111, 108, 101, 32, 118, 111, 105, 99, 101,
-34, 32, 61, 32, 34, 68, 105, 118, 105, 100, 105, 100, 111, 58, 32, 115, 195, 179, 32, 111, 115, 32, 103, 114,
-97, 118, 101, 115, 32, 115, 195, 163, 111, 32, 114, 101, 100, 117, 122, 105, 100, 111, 115, 59, 32, 98, 97, 110,
-100, 97, 32, 108, 97, 114, 103, 97, 58, 32, 97, 32, 118, 111, 122, 32, 105, 110, 116, 101, 105, 114, 97, 34,
-10, 34, 68, 101, 108, 97, 121, 115, 32, 116, 104, 101, 32, 97, 117, 100, 105, 111, 32, 49, 48, 32, 109, 115,
-32, 115, 111, 32, 116, 104, 101, 32, 100, 101, 45, 112, 108, 111, 115, 101, 114, 32, 97, 99, 116, 115, 32, 98,
-101, 102, 111, 114, 101, 32, 116, 104, 101, 32, 112, 111, 112, 32, 115, 116, 97, 114, 116, 115, 34, 32, 61, 32,
-34, 65, 116, 114, 97, 115, 97, 32, 111, 32, 195, 161, 117, 100, 105, 111, 32, 49, 48, 32, 109, 115, 32, 112,
-97, 114, 97, 32, 111, 32, 100, 101, 45, 112, 108, 111, 115, 101, 114, 32, 97, 103, 105, 114, 32, 97, 110, 116,
-101, 115, 32, 100, 111, 32, 101, 115, 116, 97, 108, 111, 34, 10, 34, 80, 108, 97, 121, 115, 32, 111, 110, 108,
-121, 32, 116, 104, 101, 32, 98, 97, 110, 100, 32, 116, 104, 101, 32, 100, 101, 45, 112, 108, 111, 115, 101, 114,
-32, 97, 99, 116, 115, 32, 111, 110, 34, 32, 61, 32, 34, 84, 111, 99, 97, 32, 115, 195, 179, 32, 97, 32,
-98, 97, 110, 100, 97, 32, 101, 109, 32, 113, 117, 101, 32, 111, 32, 100, 101, 45, 112, 108, 111, 115, 101, 114,
-32, 97, 103, 101, 34, 10, 34, 83, 119, 105, 116, 99, 104, 101, 115, 32, 116, 104, 101, 32, 118, 111, 99, 97,
-108, 32, 69, 81, 32, 111, 110, 34, 32, 61, 32, 34, 76, 105, 103, 97, 32, 111, 32, 69, 81, 32, 118, 111,
-99, 97, 108, 34, 10, 34, 72, 105, 103, 104, 45, 112, 97, 115, 115, 32, 102, 105, 108, 116, 101, 114, 32, 119,
-105, 116, 104, 32, 97, 32, 115, 109, 97, 108, 108, 32, 108, 105, 102, 116, 32, 97, 98, 111, 118, 101, 32, 105,
-116, 115, 32, 102, 114, 101, 113, 117, 101, 110, 99, 121, 34, 32, 61, 32, 34, 70, 105, 108, 116, 114, 111, 32,
-112, 97, 115, 115, 97, 45, 97, 108, 116, 97, 115, 32, 99, 111, 109, 32, 117, 109, 32, 108, 101, 118, 101, 32,
-114, 101, 102, 111, 114, 195, 167, 111, 32, 97, 99, 105, 109, 97, 32, 100, 97, 32, 115, 117, 97, 32, 102, 114,
-101, 113, 117, 195, 170, 110, 99, 105, 97, 34, 10, 34, 65, 32, 110, 97, 114, 114, 111, 119, 32, 99, 117, 116,
-32, 40, 111, 114, 32, 98, 111, 111, 115, 116, 41, 32, 102, 111, 114, 32, 111, 110, 101, 32, 114, 101, 115, 111,
-110, 97, 110, 99, 101, 34, 32, 61, 32, 34, 85, 109, 32, 99, 111, 114, 116, 101, 32, 40, 111, 117, 32, 114,
-101, 102, 111, 114, 195, 167, 111, 41, 32, 101, 115, 116, 114, 101, 105, 116, 111, 32, 112, 97, 114, 97, 32, 117,
-109, 97, 32, 114, 101, 115, 115, 111, 110, 195, 162, 110, 99, 105, 97, 34, 10, 34, 65, 32, 119, 105, 100, 101,
-32, 98, 111, 111, 115, 116, 32, 111, 114, 32, 99, 117, 116, 32, 102, 111, 114, 32, 112, 114, 101, 115, 101, 110,
-99, 101, 32, 97, 110, 100, 32, 97, 105, 114, 34, 32, 61, 32, 34, 85, 109, 32, 114, 101, 102, 111, 114, 195,
-167, 111, 32, 111, 117, 32, 99, 111, 114, 116, 101, 32, 108, 97, 114, 103, 111, 32, 112, 97, 114, 97, 32, 112,
-114, 101, 115, 101, 110, 195, 167, 97, 32, 101, 32, 97, 114, 34, 10, 34, 69, 120, 112, 97, 110, 100, 101, 114,
-44, 32, 116, 104, 101, 110, 32, 99, 111, 109, 112, 114, 101, 115, 115, 111, 114, 44, 32, 109, 97, 107, 101, 45,
-117, 112, 32, 97, 110, 100, 32, 100, 114, 105, 118, 101, 34, 32, 61, 32, 34, 69, 120, 112, 97, 110, 115, 111,
-114, 44, 32, 100, 101, 112, 111, 105, 115, 32, 99, 111, 109, 112, 114, 101, 115, 115, 111, 114, 44, 32, 103, 97,
-110, 104, 111, 32, 100, 101, 32, 99, 111, 109, 112, 101, 110, 115, 97, 195, 167, 195, 163, 111, 32, 101, 32, 100,
-114, 105, 118, 101, 34, 10, 34, 66, 101, 108, 111, 119, 32, 116, 104, 105, 115, 32, 108, 101, 118, 101, 108, 32,
-116, 104, 101, 32, 101, 120, 112, 97, 110, 100, 101, 114, 32, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 115,
-105, 103, 110, 97, 108, 32, 100, 111, 119, 110, 32, 40, 102, 117, 108, 108, 121, 32, 108, 101, 102, 116, 32, 61,
-32, 111, 102, 102, 41, 34, 32, 61, 32, 34, 65, 98, 97, 105, 120, 111, 32, 100, 101, 115, 116, 101, 32, 110,
-195, 173, 118, 101, 108, 32, 111, 32, 101, 120, 112, 97, 110, 115, 111, 114, 32, 97, 98, 97, 105, 120, 97, 32,
-111, 32, 115, 105, 110, 97, 108, 32, 40, 116, 111, 100, 111, 32, 195, 160, 32, 101, 115, 113, 117, 101, 114, 100,
-97, 32, 61, 32, 100, 101, 115, 108, 105, 103, 97, 100, 111, 41, 34, 10, 34, 71, 97, 105, 110, 32, 97, 102,
-116, 101, 114, 32, 116, 104, 101, 32, 99, 111, 109, 112, 114, 101, 115, 115, 111, 114, 34, 32, 61, 32, 34, 71,
-97, 110, 104, 111, 32, 100, 101, 112, 111, 105, 115, 32, 100, 111, 32, 99, 111, 109, 112, 114, 101, 115, 115, 111,
-114, 34, 10, 34, 65, 32, 103, 114, 97, 100, 117, 97, 108, 32, 115, 116, 97, 114, 116, 32, 111, 102, 32, 116,
-104, 101, 32, 99, 111, 109, 112, 114, 101, 115, 115, 105, 111, 110, 32, 97, 114, 111, 117, 110, 100, 32, 116, 104,
-101, 32, 116, 104, 114, 101, 115, 104, 111, 108, 100, 34, 32, 61, 32, 34, 73, 110, 195, 173, 99, 105, 111, 32,
-103, 114, 97, 100, 117, 97, 108, 32, 100, 97, 32, 99, 111, 109, 112, 114, 101, 115, 115, 195, 163, 111, 32, 101,
-109, 32, 116, 111, 114, 110, 111, 32, 100, 111, 32, 108, 105, 109, 105, 97, 114, 34, 10, 34, 83, 111, 102, 116,
-32, 99, 108, 105, 112, 112, 105, 110, 103, 32, 97, 102, 116, 101, 114, 32, 116, 104, 101, 32, 109, 97, 107, 101,
-45, 117, 112, 32, 103, 97, 105, 110, 58, 32, 119, 97, 114, 109, 101, 114, 44, 32, 108, 111, 117, 100, 101, 114,
-59, 32, 115, 116, 114, 111, 110, 103, 101, 114, 32, 119, 105, 116, 104, 32, 109, 111, 114, 101, 32, 109, 97, 107,
-101, 45, 117, 112, 34, 32, 61, 32, 34, 83, 97, 116, 117, 114, 97, 195, 167, 195, 163, 111, 32, 115, 117, 97,
-118, 101, 32, 100, 101, 112, 111, 105, 115, 32, 100, 111, 32, 103, 97, 110, 104, 111, 32, 100, 101, 32, 99, 111,
-109, 112, 101, 110, 115, 97, 195, 167, 195, 163, 111, 58, 32, 109, 97, 105, 115, 32, 113, 117, 101, 110, 116, 101,
-32, 101, 32, 109, 97, 105, 115, 32, 97, 108, 116, 111, 59, 32, 109, 97, 105, 115, 32, 102, 111, 114, 116, 101,
-32, 99, 111, 109, 32, 109, 97, 105, 115, 32, 99, 111, 109, 112, 101, 110, 115, 97, 195, 167, 195, 163, 111, 34,
-10, 34, 69, 120, 112, 97, 110, 100, 101, 114, 34, 32, 61, 32, 34, 69, 120, 112, 97, 110, 115, 111, 114, 34,
-10,
+104, 101, 32, 97, 117, 100, 105, 111, 32, 49, 48, 32, 109, 115, 32, 115, 111, 32, 116, 104, 101, 32, 100, 101,
+45, 112, 108, 111, 115, 101, 114, 32, 97, 99, 116, 115, 32, 98, 101, 102, 111, 114, 101, 32, 116, 104, 101, 32,
+112, 111, 112, 32, 115, 116, 97, 114, 116, 115, 34, 32, 61, 32, 34, 65, 116, 114, 97, 115, 97, 32, 111, 32,
+195, 161, 117, 100, 105, 111, 32, 49, 48, 32, 109, 115, 32, 112, 97, 114, 97, 32, 111, 32, 100, 101, 45, 112,
+108, 111, 115, 101, 114, 32, 97, 103, 105, 114, 32, 97, 110, 116, 101, 115, 32, 100, 111, 32, 101, 115, 116, 97,
+108, 111, 34, 10, 34, 80, 108, 97, 121, 115, 32, 111, 110, 108, 121, 32, 116, 104, 101, 32, 98, 97, 110, 100,
+32, 116, 104, 101, 32, 100, 101, 45, 112, 108, 111, 115, 101, 114, 32, 97, 99, 116, 115, 32, 111, 110, 34, 32,
+61, 32, 34, 84, 111, 99, 97, 32, 115, 195, 179, 32, 97, 32, 98, 97, 110, 100, 97, 32, 101, 109, 32, 113,
+117, 101, 32, 111, 32, 100, 101, 45, 112, 108, 111, 115, 101, 114, 32, 97, 103, 101, 34, 10, 34, 83, 119, 105,
+116, 99, 104, 101, 115, 32, 116, 104, 101, 32, 118, 111, 99, 97, 108, 32, 69, 81, 32, 111, 110, 34, 32, 61,
+32, 34, 76, 105, 103, 97, 32, 111, 32, 69, 81, 32, 118, 111, 99, 97, 108, 34, 10, 34, 72, 105, 103, 104,
+45, 112, 97, 115, 115, 32, 102, 105, 108, 116, 101, 114, 32, 119, 105, 116, 104, 32, 97, 32, 115, 109, 97, 108,
+108, 32, 108, 105, 102, 116, 32, 97, 98, 111, 118, 101, 32, 105, 116, 115, 32, 102, 114, 101, 113, 117, 101, 110,
+99, 121, 34, 32, 61, 32, 34, 70, 105, 108, 116, 114, 111, 32, 112, 97, 115, 115, 97, 45, 97, 108, 116, 97,
+115, 32, 99, 111, 109, 32, 117, 109, 32, 108, 101, 118, 101, 32, 114, 101, 102, 111, 114, 195, 167, 111, 32, 97,
+99, 105, 109, 97, 32, 100, 97, 32, 115, 117, 97, 32, 102, 114, 101, 113, 117, 195, 170, 110, 99, 105, 97, 34,
+10, 34, 65, 32, 110, 97, 114, 114, 111, 119, 32, 99, 117, 116, 32, 40, 111, 114, 32, 98, 111, 111, 115, 116,
+41, 32, 102, 111, 114, 32, 111, 110, 101, 32, 114, 101, 115, 111, 110, 97, 110, 99, 101, 34, 32, 61, 32, 34,
+85, 109, 32, 99, 111, 114, 116, 101, 32, 40, 111, 117, 32, 114, 101, 102, 111, 114, 195, 167, 111, 41, 32, 101,
+115, 116, 114, 101, 105, 116, 111, 32, 112, 97, 114, 97, 32, 117, 109, 97, 32, 114, 101, 115, 115, 111, 110, 195,
+162, 110, 99, 105, 97, 34, 10, 34, 65, 32, 119, 105, 100, 101, 32, 98, 111, 111, 115, 116, 32, 111, 114, 32,
+99, 117, 116, 32, 102, 111, 114, 32, 112, 114, 101, 115, 101, 110, 99, 101, 32, 97, 110, 100, 32, 97, 105, 114,
+34, 32, 61, 32, 34, 85, 109, 32, 114, 101, 102, 111, 114, 195, 167, 111, 32, 111, 117, 32, 99, 111, 114, 116,
+101, 32, 108, 97, 114, 103, 111, 32, 112, 97, 114, 97, 32, 112, 114, 101, 115, 101, 110, 195, 167, 97, 32, 101,
+32, 97, 114, 34, 10, 34, 69, 120, 112, 97, 110, 100, 101, 114, 44, 32, 116, 104, 101, 110, 32, 99, 111, 109,
+112, 114, 101, 115, 115, 111, 114, 44, 32, 109, 97, 107, 101, 45, 117, 112, 32, 97, 110, 100, 32, 100, 114, 105,
+118, 101, 34, 32, 61, 32, 34, 69, 120, 112, 97, 110, 115, 111, 114, 44, 32, 100, 101, 112, 111, 105, 115, 32,
+99, 111, 109, 112, 114, 101, 115, 115, 111, 114, 44, 32, 103, 97, 110, 104, 111, 32, 100, 101, 32, 99, 111, 109,
+112, 101, 110, 115, 97, 195, 167, 195, 163, 111, 32, 101, 32, 100, 114, 105, 118, 101, 34, 10, 34, 66, 101, 108,
+111, 119, 32, 116, 104, 105, 115, 32, 108, 101, 118, 101, 108, 32, 116, 104, 101, 32, 101, 120, 112, 97, 110, 100,
+101, 114, 32, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 115, 105, 103, 110, 97, 108, 32, 100, 111, 119, 110,
+32, 40, 102, 117, 108, 108, 121, 32, 108, 101, 102, 116, 32, 61, 32, 111, 102, 102, 41, 34, 32, 61, 32, 34,
+65, 98, 97, 105, 120, 111, 32, 100, 101, 115, 116, 101, 32, 110, 195, 173, 118, 101, 108, 32, 111, 32, 101, 120,
+112, 97, 110, 115, 111, 114, 32, 97, 98, 97, 105, 120, 97, 32, 111, 32, 115, 105, 110, 97, 108, 32, 40, 116,
+111, 100, 111, 32, 195, 160, 32, 101, 115, 113, 117, 101, 114, 100, 97, 32, 61, 32, 100, 101, 115, 108, 105, 103,
+97, 100, 111, 41, 34, 10, 34, 71, 97, 105, 110, 32, 97, 102, 116, 101, 114, 32, 116, 104, 101, 32, 99, 111,
+109, 112, 114, 101, 115, 115, 111, 114, 34, 32, 61, 32, 34, 71, 97, 110, 104, 111, 32, 100, 101, 112, 111, 105,
+115, 32, 100, 111, 32, 99, 111, 109, 112, 114, 101, 115, 115, 111, 114, 34, 10, 34, 65, 32, 103, 114, 97, 100,
+117, 97, 108, 32, 115, 116, 97, 114, 116, 32, 111, 102, 32, 116, 104, 101, 32, 99, 111, 109, 112, 114, 101, 115,
+115, 105, 111, 110, 32, 97, 114, 111, 117, 110, 100, 32, 116, 104, 101, 32, 116, 104, 114, 101, 115, 104, 111, 108,
+100, 34, 32, 61, 32, 34, 73, 110, 195, 173, 99, 105, 111, 32, 103, 114, 97, 100, 117, 97, 108, 32, 100, 97,
+32, 99, 111, 109, 112, 114, 101, 115, 115, 195, 163, 111, 32, 101, 109, 32, 116, 111, 114, 110, 111, 32, 100, 111,
+32, 108, 105, 109, 105, 97, 114, 34, 10, 34, 83, 111, 102, 116, 32, 99, 108, 105, 112, 112, 105, 110, 103, 32,
+97, 102, 116, 101, 114, 32, 116, 104, 101, 32, 109, 97, 107, 101, 45, 117, 112, 32, 103, 97, 105, 110, 58, 32,
+119, 97, 114, 109, 101, 114, 44, 32, 108, 111, 117, 100, 101, 114, 59, 32, 115, 116, 114, 111, 110, 103, 101, 114,
+32, 119, 105, 116, 104, 32, 109, 111, 114, 101, 32, 109, 97, 107, 101, 45, 117, 112, 34, 32, 61, 32, 34, 83,
+97, 116, 117, 114, 97, 195, 167, 195, 163, 111, 32, 115, 117, 97, 118, 101, 32, 100, 101, 112, 111, 105, 115, 32,
+100, 111, 32, 103, 97, 110, 104, 111, 32, 100, 101, 32, 99, 111, 109, 112, 101, 110, 115, 97, 195, 167, 195, 163,
+111, 58, 32, 109, 97, 105, 115, 32, 113, 117, 101, 110, 116, 101, 32, 101, 32, 109, 97, 105, 115, 32, 97, 108,
+116, 111, 59, 32, 109, 97, 105, 115, 32, 102, 111, 114, 116, 101, 32, 99, 111, 109, 32, 109, 97, 105, 115, 32,
+99, 111, 109, 112, 101, 110, 115, 97, 195, 167, 195, 163, 111, 34, 10, 34, 69, 120, 112, 97, 110, 100, 101, 114,
+34, 32, 61, 32, 34, 69, 120, 112, 97, 110, 115, 111, 114, 34, 10, 34, 76, 111, 119, 32, 115, 108, 111, 112,
+101, 34, 32, 61, 32, 34, 73, 110, 99, 108, 105, 110, 97, 195, 167, 195, 163, 111, 32, 103, 114, 97, 118, 101,
+34, 10, 34, 72, 105, 103, 104, 32, 115, 108, 111, 112, 101, 34, 32, 61, 32, 34, 73, 110, 99, 108, 105, 110,
+97, 195, 167, 195, 163, 111, 32, 97, 103, 117, 100, 97, 34, 10, 34, 83, 108, 111, 112, 101, 32, 49, 34, 32,
+61, 32, 34, 73, 110, 99, 108, 105, 110, 97, 195, 167, 195, 163, 111, 32, 49, 34, 10, 34, 83, 108, 111, 112,
+101, 32, 50, 34, 32, 61, 32, 34, 73, 110, 99, 108, 105, 110, 97, 195, 167, 195, 163, 111, 32, 50, 34, 10,
+34, 83, 108, 111, 112, 101, 32, 51, 34, 32, 61, 32, 34, 73, 110, 99, 108, 105, 110, 97, 195, 167, 195, 163,
+111, 32, 51, 34, 10, 34, 83, 108, 111, 112, 101, 32, 52, 34, 32, 61, 32, 34, 73, 110, 99, 108, 105, 110,
+97, 195, 167, 195, 163, 111, 32, 52, 34, 10, 34, 83, 108, 111, 112, 101, 32, 53, 34, 32, 61, 32, 34, 73,
+110, 99, 108, 105, 110, 97, 195, 167, 195, 163, 111, 32, 53, 34, 10, 34, 65, 117, 116, 111, 32, 109, 97, 107,
+101, 45, 117, 112, 34, 32, 61, 32, 34, 77, 97, 107, 101, 45, 117, 112, 32, 97, 117, 116, 111, 109, 195, 161,
+116, 105, 99, 111, 34, 10, 34, 65, 110, 97, 108, 111, 103, 34, 32, 61, 32, 34, 65, 110, 97, 108, 195, 179,
+103, 105, 99, 111, 34, 10,
 };
 } // namespace lynx::i18n::data

+ 235 - 57
src/ui/PluginEditors.cpp

@@ -1127,39 +1127,76 @@ public:
         g.drawText (tr ("HOLD"), juce::Rectangle<float> (inner, 12.0f * s).withCentre (c.translated (0.0f, inner * 0.78f)), juce::Justification::centred);
     }
 
-    // --- LYNX Tune's keyboard (round 128) --------------------------------------------------------------
-    // Four octaves (C2 … B5) as in the auto-mode correctors; a key edits its note name in every octave: in BYPASS mode
-    // it switches "pass uncorrected" (still a target, no correction), in REMOVE mode it removes the note from the
-    // targets. LATCH off = the edit lasts only while the key is held (live use).
-    static constexpr int tuneOctaves = 4;
+    // --- LYNX Tune's keyboard (round 128; round 147: the Waves Tune Real-Time role's keyboard) ----------------------
+    // A key edits its note name in every octave (the reference's Group Octaves, always on here): in BYPASS mode it
+    // switches "pass uncorrected" (still a target, no correction), in REMOVE mode a click cycles the note's status like
+    // the reference's — legal → illegal (to the nearest legal note) → illegal, pitch up → illegal, pitch down → legal.
+    // LATCH off = the edit lasts only while the key is held (live use). Round 147: the view's navigation (− / + = fewer
+    // / more octaves, ◀ / ▶ = scroll), the range bar over the keys (click or drag near a boundary: the notes outside
+    // the range pass uncorrected), the range presets and Reset scale.
+    int tuneFirstOctave = 2, tuneShownOctaves = 4; // the view: C2 … B5 by default (the editor's own, not saved)
+    int tuneRangeDrag = -1;                       // 0 = the low boundary, 1 = the high one
+    enum TuneButton { tbBypass, tbRemove, tbReset, tbRange0, tbZoomOut = tbRange0 + lynxtune::rangePresets, tbZoomIn, tbLeft, tbRight, tbLatch, tbCount };
     juce::Rectangle<float> tuneKeysStrip (juce::Rectangle<float> r) const { return r.withHeight (22.0f * scale()); }
-    juce::Rectangle<float> tuneKeysBed (juce::Rectangle<float> r) const { return r.withTrimmedTop (26.0f * scale()).reduced (2.0f * scale(), 2.0f * scale()); }
-    juce::Rectangle<float> tuneModeButton (juce::Rectangle<float> r, int which) const // 0 bypass, 1 remove, 2 latch
+    juce::Rectangle<float> tuneKeysBed (juce::Rectangle<float> r) const { return r.withTrimmedTop (36.0f * scale()).reduced (2.0f * scale(), 2.0f * scale()); }
+    juce::Rectangle<float> tuneRangeBar (juce::Rectangle<float> r) const
     {
         const auto s = scale();
-        const auto strip = tuneKeysStrip (r).reduced (2.0f * s, 2.0f * s);
-        return which == 2 ? strip.withLeft (strip.getRight() - 70.0f * s) : strip.withWidth (78.0f * s).translated ((float) which * 82.0f * s, 0.0f);
+        const auto bed = tuneKeysBed (r);
+        return { bed.getX(), bed.getY() - 10.0f * s, bed.getWidth(), 8.0f * s };
     }
-    // pitch class (0…11) and octave index of the key under p, −1 = none
+    juce::Rectangle<float> tuneModeButton (juce::Rectangle<float> r, int which) const
+    {
+        const auto s = scale();
+        const auto strip = tuneKeysStrip (r).reduced (2.0f * s, 2.0f * s);
+        auto at = [&] (float x, float w) { return juce::Rectangle<float> (strip.getX() + x * s, strip.getY(), w * s, strip.getHeight()); };
+        if (which == tbBypass) return at (0.0f, 66.0f);
+        if (which == tbRemove) return at (70.0f, 66.0f);
+        if (which == tbReset) return at (144.0f, 74.0f);
+        if (which >= tbRange0 && which < tbZoomOut) return at (230.0f + 54.0f * (float) (which - tbRange0), 52.0f);
+        if (which >= tbZoomOut && which <= tbRight) return at (618.0f + 24.0f * (float) (which - tbZoomOut), 22.0f);
+        return strip.withLeft (strip.getRight() - 62.0f * s); // LATCH
+    }
+    int tuneVisibleWhites() const { return 7 * tuneShownOctaves; }
+    int tuneFirstNote() const { return 12 * (tuneFirstOctave + 1); } // MIDI note of the first C shown (C4 = 60)
+    float tuneNoteX (juce::Rectangle<float> bed, int note) const     // the left edge of a note's white key column
+    {
+        static const int whiteOf[12] { 0, 0, 1, 1, 2, 3, 3, 4, 4, 5, 5, 6 };
+        const auto rel = note - tuneFirstNote();
+        const auto oct = (int) std::floor ((double) rel / 12.0);
+        const auto w = 7 * oct + whiteOf[((rel % 12) + 12) % 12];
+        return bed.getX() + bed.getWidth() * (float) w / (float) tuneVisibleWhites();
+    }
+    // the MIDI note of the key under p, −1 = none
     int tuneKeyAt (juce::Rectangle<float> r, juce::Point<float> p) const
     {
         const auto bed = tuneKeysBed (r);
         if (! bed.contains (p))
             return -1;
         static const int whitePc[7] { 0, 2, 4, 5, 7, 9, 11 };
-        const auto ww = bed.getWidth() / (float) (7 * tuneOctaves);
+        const auto n = tuneVisibleWhites();
+        const auto ww = bed.getWidth() / (float) n;
         if (p.y < bed.getY() + bed.getHeight() * 0.6f) // black keys first (on top)
-            for (int w = 0; w < 7 * tuneOctaves; ++w)
+            for (int w = 0; w < n; ++w)
             {
                 const auto pc = whitePc[w % 7];
                 if (pc == 4 || pc == 11)
                     continue;
                 const auto bx = bed.getX() + ww * (float) (w + 1) - ww * 0.3f;
                 if (p.x >= bx && p.x < bx + ww * 0.6f)
-                    return pc + 1;
+                    return tuneFirstNote() + 12 * (w / 7) + pc + 1;
             }
-        const auto w = juce::jlimit (0, 7 * tuneOctaves - 1, (int) ((p.x - bed.getX()) / ww));
-        return whitePc[w % 7];
+        const auto w = juce::jlimit (0, n - 1, (int) ((p.x - bed.getX()) / ww));
+        return tuneFirstNote() + 12 * (w / 7) + whitePc[w % 7];
+    }
+    // the note under x in the range bar (the nearest white-key column), clamped to the view
+    int tuneNoteAtX (juce::Rectangle<float> r, float x) const
+    {
+        const auto bed = tuneKeysBed (r);
+        static const int whitePc[7] { 0, 2, 4, 5, 7, 9, 11 };
+        const auto n = tuneVisibleWhites();
+        const auto w = juce::jlimit (0, n - 1, (int) ((x - bed.getX()) / (bed.getWidth() / (float) n)));
+        return tuneFirstNote() + 12 * (w / 7) + whitePc[w % 7];
     }
     void paintTuneKeys (juce::Graphics& g, juce::Rectangle<float> r, const EffectSlot& fx)
     {
@@ -1168,115 +1205,246 @@ public:
         const auto& p = fx.params;
         const auto sc = (vocal::Scale) lynxtune::effectiveScale (p[lynxtune::scale], p[lynxtune::moreScales]);
         const auto inScale = vocal::scaleMask (sc, lynxtune::keyIndex (p[lynxtune::key]), 0xfff);
-        // mode buttons, latch, legend
-        const char* const names[3] { TR_NOOP ("Bypass"), TR_NOOP ("Remove"), TR_NOOP ("Latch") };
-        for (int b = 0; b < 3; ++b)
+        const auto lowNote = lynxtune::rangeNote (p[lynxtune::rangeLow]), highNote = lynxtune::rangeNote (p[lynxtune::rangeHigh]);
+        // the strip: modes, Reset scale, the range presets, the view's navigation, latch
+        for (int b = 0; b < tbCount; ++b)
         {
             const auto br = tuneModeButton (r, b);
-            const auto lit = b == 2 ? tuneLatch : tuneRemove == (b == 1);
-            skin::button (g, br, lit, br.contains (mouseAt), b == 0 ? juce::Colour (0xffe0a040) : accent, radius::sm * s);
+            bool lit = false;
+            juce::String name;
+            if (b == tbBypass) { lit = ! tuneRemove; name = tr ("Bypass"); }
+            else if (b == tbRemove) { lit = tuneRemove; name = tr ("Remove"); }
+            else if (b == tbReset) name = tr ("Reset scale");
+            else if (b >= tbRange0 && b < tbZoomOut)
+            {
+                const auto [lo, hi] = lynxtune::rangePresetNotes (b - tbRange0);
+                lit = lo == lowNote && hi == highNote;
+                name = tr (lynxtune::rangePresetName (b - tbRange0));
+            }
+            else if (b == tbZoomOut) name = "-";
+            else if (b == tbZoomIn) name = "+";
+            else if (b == tbLeft) name = "<";
+            else if (b == tbRight) name = ">";
+            else { lit = tuneLatch; name = tr ("Latch"); }
+            skin::button (g, br, lit, br.contains (mouseAt), b == tbBypass ? juce::Colour (0xffe0a040) : accent, radius::sm * s);
             g.setColour (lit ? colour::textPrimary : colour::textSecondary);
             g.setFont (font (juce::jmax (8.0f, 10.0f * s), true));
-            g.drawText (tr (names[b]), br, juce::Justification::centred);
+            g.drawText (name, br, juce::Justification::centred);
         }
-        g.setColour (colour::textDisabled);
-        g.setFont (font (juce::jmax (7.0f, 9.0f * s)));
-        g.drawText (tr ("Click a key: {0} that note in every octave", { tuneRemove ? tr ("remove / restore") : tr ("bypass / correct") }),
-                    tuneKeysStrip (r).withTrimmedLeft (170.0f * s).withTrimmedRight (80.0f * s), juce::Justification::centred, true);
-        // keys
+        // the range bar: the notes inside the range lit, the two boundaries as handles
         const auto bed = tuneKeysBed (r);
-        const auto ww = bed.getWidth() / (float) (7 * tuneOctaves);
+        {
+            const auto rb = tuneRangeBar (r);
+            g.setColour (colour::bg0);
+            g.fillRoundedRectangle (rb, 2.0f * s);
+            const auto x0 = juce::jlimit (rb.getX(), rb.getRight(), tuneNoteX (bed, lowNote));
+            const auto x1 = juce::jlimit (rb.getX(), rb.getRight(), tuneNoteX (bed, highNote + 1));
+            if (x1 > x0)
+            {
+                g.setColour (accent.withAlpha (fx.enabled ? 0.55f : 0.25f));
+                g.fillRoundedRectangle (juce::Rectangle<float> (x0, rb.getY(), x1 - x0, rb.getHeight()), 2.0f * s);
+            }
+            g.setColour (colour::textPrimary);
+            for (const auto x : { x0, x1 })
+                if (x > rb.getX() && x < rb.getRight())
+                    g.fillRect (juce::Rectangle<float> (3.0f * s, rb.getHeight() + 4.0f * s).withCentre ({ x, rb.getCentreY() }));
+        }
+        // keys
+        const auto n = tuneVisibleWhites();
+        const auto ww = bed.getWidth() / (float) n;
         static const int whitePc[7] { 0, 2, 4, 5, 7, 9, 11 };
-        const auto sungPc = pitchHistory.empty() || pitchHistory.back().sung < 0.5f ? -1 : ((int) std::lround (pitchHistory.back().target) % 12 + 12) % 12;
-        auto keyColour = [&] (int pc, bool black) {
-            const auto on = p[(std::size_t) (lynxtune::noteC + pc)] >= 0.5f && ((inScale >> pc) & 1u) != 0;
+        const auto sungNote = pitchHistory.empty() || pitchHistory.back().sung < 0.5f ? -1 : (int) std::lround (pitchHistory.back().target);
+        auto legal = [&] (int pc) { return p[(std::size_t) (lynxtune::noteC + pc)] >= 0.5f && ((inScale >> pc) & 1u) != 0; };
+        auto keyColour = [&] (int note, bool black) {
+            const auto pc = note % 12;
             const auto bypassed = p[(std::size_t) (lynxtune::bypassC + pc)] >= 0.5f;
             auto c = black ? juce::Colour (0xff1c1e24) : juce::Colour (0xffd9dbe0);
-            if (! on)
+            if (! legal (pc))
                 c = black ? juce::Colour (0xff101114) : juce::Colour (0xff5a5d66); // removed / not in the scale
             else if (bypassed)
                 c = black ? juce::Colour (0xff6b4d16) : juce::Colour (0xffe6be6e);
+            if (note < lowNote || note > highNote) // outside the range: passes uncorrected
+                c = c.interpolatedWith (colour::bg0, 0.55f);
             return c;
         };
-        auto mark = [&] (juce::Rectangle<float> k, int pc) {
-            const auto on = p[(std::size_t) (lynxtune::noteC + pc)] >= 0.5f && ((inScale >> pc) & 1u) != 0;
-            if (on && fx.enabled) // a target: the accent line at the key's top
+        auto mark = [&] (juce::Rectangle<float> k, int note) {
+            const auto pc = note % 12;
+            const auto inRange = note >= lowNote && note <= highNote;
+            if (legal (pc) && fx.enabled && inRange) // a target: the accent line at the key's top
             {
                 g.setColour (p[(std::size_t) (lynxtune::bypassC + pc)] >= 0.5f ? juce::Colour (0xffe0a040) : accent);
                 g.fillRect (k.withHeight (3.0f * s));
             }
-            if (! on && ((inScale >> pc) & 1u) != 0) // removed by hand: a cross
+            if (! legal (pc))
             {
+                const auto dir = lynxtune::noteDir (p[(std::size_t) (lynxtune::noteDirC + pc)]);
                 const auto x = juce::Rectangle<float> (7.0f * s, 7.0f * s).withCentre ({ k.getCentreX(), k.getY() + 10.0f * s });
                 g.setColour (accent.withAlpha (0.9f));
-                g.drawLine (x.getX(), x.getY(), x.getRight(), x.getBottom(), 1.5f * s);
-                g.drawLine (x.getRight(), x.getY(), x.getX(), x.getBottom(), 1.5f * s);
+                if (dir != lynxtune::NoteDir::nearest) // illegal, pitch up / down: an arrow
+                {
+                    juce::Path a;
+                    const auto up = dir == lynxtune::NoteDir::up;
+                    a.addTriangle (x.getX(), up ? x.getBottom() : x.getY(), x.getRight(), up ? x.getBottom() : x.getY(), x.getCentreX(), up ? x.getY() : x.getBottom());
+                    g.fillPath (a);
+                }
+                else if (((inScale >> pc) & 1u) != 0) // removed by hand: a cross
+                {
+                    g.drawLine (x.getX(), x.getY(), x.getRight(), x.getBottom(), 1.5f * s);
+                    g.drawLine (x.getRight(), x.getY(), x.getX(), x.getBottom(), 1.5f * s);
+                }
             }
-            if (pc == sungPc && fx.enabled)
+            if (note == sungNote && fx.enabled)
             {
                 g.setColour (accent.withAlpha (0.55f));
                 g.fillEllipse (juce::Rectangle<float> (7.0f * s, 7.0f * s).withCentre ({ k.getCentreX(), k.getBottom() - 9.0f * s }));
             }
         };
-        for (int w = 0; w < 7 * tuneOctaves; ++w)
+        for (int w = 0; w < n; ++w)
         {
-            const auto pc = whitePc[w % 7];
+            const auto note = tuneFirstNote() + 12 * (w / 7) + whitePc[w % 7];
             const auto k = juce::Rectangle<float> (bed.getX() + ww * (float) w, bed.getY(), ww - 1.0f, bed.getHeight());
-            g.setColour (keyColour (pc, false));
+            g.setColour (keyColour (note, false));
             g.fillRoundedRectangle (k, 2.0f * s);
-            mark (k, pc);
-            if (pc == 0)
+            mark (k, note);
+            if (note % 12 == 0)
             {
                 g.setColour (juce::Colour (0xff3a3d45));
                 g.setFont (font (juce::jmax (7.0f, 9.0f * s)));
-                g.drawText ("C" + juce::String (2 + w / 7), k.withTrimmedBottom (2.0f * s).withTop (k.getBottom() - 14.0f * s), juce::Justification::centred);
+                g.drawText ("C" + juce::String (note / 12 - 1), k.withTrimmedBottom (2.0f * s).withTop (k.getBottom() - 14.0f * s), juce::Justification::centred);
             }
         }
-        for (int w = 0; w < 7 * tuneOctaves; ++w)
+        for (int w = 0; w < n; ++w)
         {
             const auto pc = whitePc[w % 7];
             if (pc == 4 || pc == 11)
                 continue;
+            const auto note = tuneFirstNote() + 12 * (w / 7) + pc + 1;
             const auto k = juce::Rectangle<float> (bed.getX() + ww * (float) (w + 1) - ww * 0.3f, bed.getY(), ww * 0.6f, bed.getHeight() * 0.6f);
-            g.setColour (keyColour (pc + 1, true));
+            g.setColour (keyColour (note, true));
             g.fillRoundedRectangle (k, 2.0f * s);
-            mark (k, pc + 1);
+            mark (k, note);
         }
     }
+    void tuneSetRangeAt (juce::Rectangle<float> r, float x, bool pickNearer)
+    {
+        const auto* fx = current();
+        if (fx == nullptr)
+            return;
+        const auto note = tuneNoteAtX (r, x);
+        const auto lo = lynxtune::rangeNote (fx->params[lynxtune::rangeLow]), hi = lynxtune::rangeNote (fx->params[lynxtune::rangeHigh]);
+        if (pickNearer)
+            tuneRangeDrag = std::abs (note - lo) <= std::abs (note - hi) ? 0 : 1;
+        if (tuneRangeDrag == 0)
+            setParams ({ { lynxtune::rangeLow, lynxtune::rangeNoteValue (juce::jmin (note, hi)) } });
+        else if (tuneRangeDrag == 1)
+            setParams ({ { lynxtune::rangeHigh, lynxtune::rangeNoteValue (juce::jmax (note, lo)) } });
+        const auto shown = tuneRangeDrag == 0 ? lynxtune::rangeLow : lynxtune::rangeHigh;
+        ui::showValueTip (*this, tuneRangeBar (r).toNearestInt(), tr ("Range") + " " + juce::String (lynxtune::paramText (shown, current()->params[(std::size_t) shown])));
+    }
     void tuneKeyClick (juce::Rectangle<float> r, juce::Point<float> at)
     {
         const auto* fx = current();
         if (fx == nullptr)
             return;
-        for (int b = 0; b < 3; ++b)
+        for (int b = 0; b < tbCount; ++b)
             if (tuneModeButton (r, b).contains (at))
             {
-                if (b == 2)
+                if (b == tbLatch)
                     tuneLatch = ! tuneLatch;
-                else
-                    tuneRemove = b == 1;
+                else if (b == tbBypass || b == tbRemove)
+                    tuneRemove = b == tbRemove;
+                else if (b == tbReset) // every note of the scale legal again, nothing bypassed, no direction
+                {
+                    std::vector<std::pair<int, float>> c;
+                    for (int k = 0; k < 12; ++k)
+                    {
+                        c.push_back ({ lynxtune::noteC + k, 1.0f });
+                        c.push_back ({ lynxtune::bypassC + k, 0.0f });
+                        c.push_back ({ lynxtune::noteDirC + k, 0.0f });
+                    }
+                    setParams (c);
+                }
+                else if (b >= tbRange0 && b < tbZoomOut)
+                {
+                    // a range preset: the keyboard's range, and the detector's input type that covers it
+                    const auto k = b - tbRange0;
+                    const auto [lo, hi] = lynxtune::rangePresetNotes (k);
+                    std::vector<std::pair<int, float>> c { { lynxtune::rangeLow, lynxtune::rangeNoteValue (lo) }, { lynxtune::rangeHigh, lynxtune::rangeNoteValue (hi) } };
+                    static constexpr float inputType[lynxtune::rangePresets] { 2.0f / 3.0f, 2.0f / 3.0f, 1.0f / 3.0f, 1.0f / 3.0f, 0.0f, 0.0f, -1.0f };
+                    if (inputType[k] >= 0.0f)
+                        c.push_back ({ lynxtune::range, inputType[k] });
+                    setParams (c);
+                }
+                else if (b == tbZoomOut) tuneShownOctaves = juce::jmin (7, tuneShownOctaves + 1);
+                else if (b == tbZoomIn) tuneShownOctaves = juce::jmax (2, tuneShownOctaves - 1);
+                else if (b == tbLeft) tuneFirstOctave = juce::jmax (0, tuneFirstOctave - 1);
+                else if (b == tbRight) tuneFirstOctave = juce::jmin (9 - tuneShownOctaves, tuneFirstOctave + 1);
+                tuneFirstOctave = juce::jlimit (0, juce::jmax (0, 9 - tuneShownOctaves), tuneFirstOctave);
                 repaint();
                 return;
             }
-        const auto pc = tuneKeyAt (r, at);
-        if (pc < 0)
+        if (tuneRangeBar (r).expanded (0.0f, 2.0f * scale()).contains (at))
+        {
+            tuneSetRangeAt (r, at.x, true);
             return;
-        const auto onP = lynxtune::noteC + pc, byP = lynxtune::bypassC + pc;
+        }
+        const auto note = tuneKeyAt (r, at);
+        if (note < 0)
+            return;
+        const auto pc = note % 12;
+        const auto onP = lynxtune::noteC + pc, byP = lynxtune::bypassC + pc, dirP = lynxtune::noteDirC + pc;
         const auto on = fx->params[(std::size_t) onP] >= 0.5f, by = fx->params[(std::size_t) byP] >= 0.5f;
+        const auto dir = lynxtune::noteDir (fx->params[(std::size_t) dirP]);
         tuneHeld = tuneLatch ? -1 : pc;
         tuneHeldValues = { fx->params[(std::size_t) onP], fx->params[(std::size_t) byP] };
+        tuneHeldDir = fx->params[(std::size_t) dirP];
         if (tuneRemove)
-            setParams ({ { onP, on ? 0.0f : 1.0f }, { byP, 0.0f } });
+        {
+            // the reference's status cycle: legal → illegal → illegal, pitch up → illegal, pitch down → legal (a note
+            // outside the scale stays illegal: only its direction cycles)
+            const auto sc = (vocal::Scale) lynxtune::effectiveScale (fx->params[lynxtune::scale], fx->params[lynxtune::moreScales]);
+            const bool scaleNote = ((vocal::scaleMask (sc, lynxtune::keyIndex (fx->params[lynxtune::key]), 0xfff) >> pc) & 1u) != 0;
+            const auto nextDir = dir == lynxtune::NoteDir::nearest ? 0.5f : (dir == lynxtune::NoteDir::up ? 1.0f : 0.0f);
+            if (scaleNote && on)
+                setParams ({ { onP, 0.0f }, { byP, 0.0f }, { dirP, 0.0f } });
+            else if (scaleNote && dir == lynxtune::NoteDir::down)
+                setParams ({ { onP, 1.0f }, { byP, 0.0f }, { dirP, 0.0f } });
+            else
+                setParams ({ { onP, on ? 1.0f : 0.0f }, { byP, 0.0f }, { dirP, nextDir } });
+        }
         else
-            setParams ({ { onP, 1.0f }, { byP, by && on ? 0.0f : 1.0f } });
+            setParams ({ { onP, 1.0f }, { byP, by && on ? 0.0f : 1.0f }, { dirP, 0.0f } });
     }
     void tuneKeyRelease()
     {
+        if (tuneRangeDrag >= 0)
+        {
+            tuneRangeDrag = -1;
+            ui::hideValueTip();
+        }
         if (tuneHeld < 0)
             return;
-        setParams ({ { lynxtune::noteC + tuneHeld, tuneHeldValues.first }, { lynxtune::bypassC + tuneHeld, tuneHeldValues.second } });
+        setParams ({ { lynxtune::noteC + tuneHeld, tuneHeldValues.first }, { lynxtune::bypassC + tuneHeld, tuneHeldValues.second },
+                     { lynxtune::noteDirC + tuneHeld, tuneHeldDir } });
         tuneHeld = -1;
     }
+    juce::String tuneKeysHint (juce::Rectangle<float> r, juce::Point<float> at) const
+    {
+        for (int b = 0; b < tbCount; ++b)
+            if (tuneModeButton (r, b).contains (at))
+            {
+                if (b == tbBypass) return tr ("Bypass mode: a key switches its note between corrected and passed as sung");
+                if (b == tbRemove) return tr ("Remove mode: a key cycles its note: legal, illegal (to the nearest note), illegal pitch up, illegal pitch down");
+                if (b == tbReset) return tr ("Reset scale: every note of the scale legal again, nothing bypassed");
+                if (b >= tbRange0 && b < tbZoomOut) return tr ("Range preset: notes sung outside the range pass uncorrected (Generic: the whole keyboard)");
+                if (b == tbZoomOut || b == tbZoomIn) return tr ("Keyboard view: show more / fewer octaves");
+                if (b == tbLeft || b == tbRight) return tr ("Keyboard view: scroll down / up an octave");
+                return tr ("Latch: off = a key's edit lasts only while it is held");
+            }
+        if (tuneRangeBar (r).expanded (0.0f, 2.0f * scale()).contains (at))
+            return tr ("Range: drag a boundary; notes sung outside it pass uncorrected");
+        return tuneRemove ? tr ("Click a key: change that note's status in every octave") : tr ("Click a key: bypass / correct that note in every octave");
+    }
     void paintAutoKey (juce::Graphics& g, juce::Rectangle<float> r)
     {
         using namespace theme;
@@ -3109,6 +3277,13 @@ public:
             rhythmMouse (e, activeLayout().items[(std::size_t) dragItem], false);
             return;
         }
+        if (tuneRangeDrag >= 0) // round 147: LYNX Tune's range boundary
+        {
+            for (const auto& it : activeLayout().items)
+                if (it.type == Item::display && juce::String (it.display) == "tunekeys")
+                    tuneSetRangeAt (rectOf (it), e.position.x, false);
+            return;
+        }
         if (dragItem < 0 || ! drag.isActive())
             return;
         const auto& item = activeLayout().items[(std::size_t) dragItem];
@@ -3277,6 +3452,8 @@ public:
             return { tr ("VU display: what the meter shows (input level, gain reduction, output level)"), {}, false, false };
         if (item.type == Item::display && juce::String (item.display) == "xy")
             return { tr ("Drag the point: both values at once"), {}, false, false };
+        if (item.type == Item::display && juce::String (item.display) == "tunekeys") // round 147
+            return { tuneKeysHint (rectOf (item), p), {}, false, false };
         if (isRhythmEdit (item)) // round 144
             return { tr ("Rhythm taps: drag up / down = level, sideways = time; double-click = add or remove a tap; right-click = patterns"), {}, false, false };
         if (isRhythmPatterns (item))
@@ -3510,6 +3687,7 @@ private:
     PitchPoint holdPoint { 0.0f, 0.0f, 0.0f };
     int tuneHeld = -1, autoKeyFlash = 0;
     std::pair<float, float> tuneHeldValues { 1.0f, 0.0f };
+    float tuneHeldDir = 0.0f; // round 147
     std::array<double, 12> keyHistogram {};
     // is the scrolling pitch trace on the current page? (it then feeds the history; else the ring does)
     bool pitchTraced() const

+ 66 - 14
src/ui/ProEditors.cpp

@@ -907,6 +907,14 @@ private:
         const auto m = meters();
         const auto newest = columnBack (0);
         drawMeter (g, m, newest.in, -60.0f, colour::meterLow.withAlpha (0.85f));
+        // round 147: the detector's energy (what the threshold is compared with, DeEsser's Energy Detector) as a
+        // blue bar inside the input meter, against the same scale as the threshold arrow
+        if (const auto det = liveMeter (1); det > 0.0f)
+        {
+            const auto y = juce::jlimit (m.getY(), m.getBottom(), meterY (det * 60.0f - 60.0f));
+            g.setColour (juce::Colour (0xff4aa3df).withAlpha (0.9f));
+            g.fillRect (juce::Rectangle<float> (m.getCentreX() - 3.0f, y, 6.0f, m.getBottom() - y));
+        }
         const auto grR = m.translated (32.0f, 0.0f).withWidth (14.0f);
         g.setColour (colour::bg1);
         g.fillRect (grR);
@@ -1505,8 +1513,9 @@ public:
     }
 
 private:
-    enum { idPrev = 1, idNext, idClose, idRange, idAnalyzer, idSolo0 = 20, idMute0 = 30 };
+    enum { idPrev = 1, idNext, idClose, idRange, idAnalyzer, idClassic, idExpert, idSolo0 = 20, idMute0 = 30 };
     int selected = 0, hoverBand = -1, dragBand = -1, dragEdge = -1;
+    bool expert = false; // round 147: the band panel's expert part (side-chain filtering, stereo link), view only
     double rangeView = 12.0;
     int analyzer = 3; // 0 off, 1 pre, 2 post, 3 pre + post (view only)
     juce::Point<float> dragStart;
@@ -1520,7 +1529,8 @@ private:
     juce::Rectangle<float> panelArea() const
     {
         const auto p = plot();
-        return { p.getCentreX() - 300.0f, p.getBottom() - 176.0f, 600.0f, 166.0f };
+        const auto w = expert ? 820.0f : 600.0f;
+        return { p.getCentreX() - w * 0.5f, p.getBottom() - 176.0f, w, 166.0f };
     }
 
     static int bp (int b, int f) { return dyn::prism::param (b, f); }
@@ -1669,6 +1679,23 @@ private:
             out.push_back (menu ({ a.getX() + 522.0f, a.getY() + 36.0f, 70.0f, 22.0f }, slope, tr ("Slope"), "12 dB|24 dB|48 dB"));
             out.push_back (menu ({ a.getX() + 522.0f, a.getY() + 76.0f, 70.0f, 22.0f }, scExternal, tr ("Side chain"), "Int|Ext"));
             out.push_back (tabs ({ a.getX() + 12.0f, a.getY() + 72.0f, 64.0f, 22.0f }, panMode, "L/R|M/S")); // round 144: what PAN balances
+            // round 147: the expert part (the reference's »): side-chain filtering and the stereo link of this band
+            out.push_back (button ({ a.getX() + 12.0f, a.getY() + 104.0f, 64.0f, 22.0f }, idExpert, expert ? tr ("Expert <<") : tr ("Expert >>"), expert,
+                                   tr ("Show the band's expert settings: side-chain filtering (band or a free range) and the stereo link")));
+            if (expert)
+            {
+                const auto x0 = a.getX() + 600.0f;
+                add (tabs ({ x0 + 10.0f, a.getY() + 26.0f, 100.0f, 22.0f }, bandScFree0 + b, "Band|Free"));
+                add (knob ({ x0 + 4.0f, a.getY() + 52.0f, 56.0f, 66.0f }, bandScLow0 + b, tr ("Low"), 0));
+                add (knob ({ x0 + 58.0f, a.getY() + 52.0f, 56.0f, 66.0f }, bandScHigh0 + b, tr ("High"), 0));
+                // the band's own slopes (Pro-MB's per-band slopes): its lower / upper crossover's slope, or the global one
+                if (b > 0)
+                    add (menu ({ x0 + 4.0f, a.getY() + 122.0f, 54.0f, 20.0f }, xoverSlope0 + b - 1, tr ("Low slope"), "Global|12|24|48"));
+                if (b < nb() - 1)
+                    add (menu ({ x0 + 60.0f, a.getY() + 122.0f, 54.0f, 20.0f }, xoverSlope0 + b, tr ("High slope"), "Global|12|24|48"));
+                add (knob ({ x0 + 126.0f, a.getY() + 22.0f, 84.0f, 92.0f }, bandLink0 + b, tr ("Link"), 1));
+                add (tabs ({ x0 + 132.0f, a.getY() + 122.0f, 74.0f, 22.0f }, bandLinkMode0 + b, "Mid|Side"));
+            }
             out.push_back (button ({ a.getRight() - 72.0f, a.getY() + 8.0f, 20.0f, 20.0f }, idPrev, "<", false, tr ("Previous / next band")));
             out.push_back (button ({ a.getRight() - 50.0f, a.getY() + 8.0f, 20.0f, 20.0f }, idNext, ">", false, tr ("Previous / next band")));
             out.push_back (button ({ a.getRight() - 26.0f, a.getY() + 8.0f, 20.0f, 20.0f }, idClose, "x", false, tr ("Close the band panel (click on the empty display does the same)")));
@@ -1683,6 +1710,10 @@ private:
         out.push_back (barValue ({ 306.0f, cy - 11.0f, 124.0f, 22.0f }, lookahead, tr ("Lookahead")));
         out.push_back (button ({ 436.0f, cy - 11.0f, 150.0f, 22.0f }, idAnalyzer, tr ("Analyzer:") + " " + tr (analyzerNames[analyzer]) + (specFrozen ? " *" : ""), false,
                                tr ("Spectrum analyzer: off, pre, post or pre + post; speed; freeze")));
+        // round 147: a project saved before the measured Dynamic phase keeps its classic engine; one click updates it
+        if (v (dynamicEngine) < 0.5f && phaseOf (v (processingMode)) == Phase::dynamic)
+            out.push_back (button ({ 592.0f, cy - 11.0f, 118.0f, 22.0f }, idClassic, tr ("Classic dynamic"), true,
+                                   tr ("This project's Dynamic phase runs the engine it was saved with (before round 147). Click to use the measured one (Pro-MB's response).")));
         out.push_back (barValue ({ bar.getRight() - 312.0f, cy - 11.0f, 92.0f, 22.0f }, mix, tr ("Mix")));
         out.push_back (barValue ({ bar.getRight() - 216.0f, cy - 11.0f, 100.0f, 22.0f }, input, tr ("In")));
         out.push_back (barValue ({ bar.getRight() - 112.0f, cy - 11.0f, 104.0f, 22.0f }, output, tr ("Out")));
@@ -1696,6 +1727,8 @@ private:
         else if (c.id == idClose) selected = -1;
         else if (c.id == idRange) rangeView = rangeView >= 30.0 ? 3.0 : rangeView >= 12.0 ? 30.0 : rangeView >= 6.0 ? 12.0 : 6.0;
         else if (c.id == idAnalyzer) { showAnalyzerMenu(); return; }
+        else if (c.id == idClassic) set ({ { dynamicEngine, 1.0f } });
+        else if (c.id == idExpert) expert = ! expert;
         else if (c.id >= idSolo0 && c.id < idSolo0 + bands) set ({ { bp (c.id - idSolo0, fSolo), v (bp (c.id - idSolo0, fSolo)) >= 0.5f ? 0.0f : 1.0f } });
         else if (c.id >= idMute0 && c.id < idMute0 + bands) set ({ { bp (c.id - idMute0, fEnabled), bandOn (c.id - idMute0) ? 0.0f : 1.0f } });
         repaint();
@@ -1968,6 +2001,14 @@ private:
             g.setFont (font (type::small, true));
             g.drawText (tr ("Band {0}", { juce::String (selected + 1) }), juce::Rectangle<float> (a.getRight() - 160.0f, a.getY() + 8.0f, 86.0f, 20.0f), juce::Justification::centredRight, false);
             caption (g, { a.getX() + 86.0f, a.getY() + 114.0f, 184.0f, 12.0f }, tr ("Mode"));
+            if (expert) // round 147: the expert part's captions and its separator
+            {
+                const auto x0 = a.getX() + 600.0f;
+                g.setColour (colour::border);
+                g.drawVerticalLine ((int) x0, a.getY() + 10.0f, a.getBottom() - 10.0f);
+                caption (g, { x0 + 6.0f, a.getY() + 10.0f, 110.0f, 12.0f }, tr ("Side chain"));
+                caption (g, { x0 + 120.0f, a.getY() + 10.0f, 96.0f, 12.0f }, tr ("Stereo link"));
+            }
         }
         // output meter
         const auto m = juce::Rectangle<float> ((float) getWidth() - 14.0f, p.getY(), 8.0f, p.getHeight());
@@ -2062,17 +2103,21 @@ private:
         out.push_back (button ({ a.getX() + 70.0f, a.getY() + 12.0f, 32.0f, 22.0f }, idPower, tr ("On"), powered (b), tr ("Band on / off: a band switched off passes clean")));
         out.push_back (button ({ a.getX() + 106.0f, a.getY() + 12.0f, 22.0f, 22.0f }, idSolo, "S", state (b) == BandState::solo, tr ("Solo the band")));
         out.push_back (button ({ a.getX() + 130.0f, a.getY() + 12.0f, 22.0f, 22.0f }, idMute, "M", state (b) == BandState::mute, tr ("Mute the band")));
-        add (menu ({ a.getX() + 160.0f, a.getY() + 10.0f, 150.0f, 26.0f }, fp (b, 0), {}, "Tube|Tape|Transistor|Fuzz"));
+        add (menu ({ a.getX() + 160.0f, a.getY() + 10.0f, 120.0f, 26.0f }, fp (b, 0), {}, "Tube|Tape|Transistor|Fuzz"));
         add (knob ({ a.getX() + 10.0f, a.getY() + 60.0f, 66.0f, 92.0f }, fp (b, 2), tr ("Mix")));
         add (knob ({ a.getX() + 78.0f, a.getY() + 60.0f, 66.0f, 92.0f }, xp (b, 6), tr ("Feedback")));
         add (knob ({ a.getX() + 146.0f, a.getY() + 60.0f, 66.0f, 92.0f }, xp (b, 7), tr ("Freq")));
         add (knob ({ a.getX() + 214.0f, a.getY() + 60.0f, 70.0f, 92.0f }, xp (b, 8), tr ("Dynamics"), 1, true));
-        add (knob ({ a.getX() + 290.0f, a.getY() + 24.0f, 132.0f, 144.0f }, fp (b, 1), tr ("Drive"), 2));
+        add (knob ({ a.getX() + 290.0f, a.getY() + 40.0f, 124.0f, 128.0f }, fp (b, 1), tr ("Drive"), 2));
+        // round 147 (Saturn 2): the drive pan beside the drive (the far channel's drive shrinks), the band's pan under
+        // its level; both act on left / right or on mid / side (the bottom bar's Channel)
+        add (knob ({ a.getX() + 352.0f, a.getY() + 2.0f, 74.0f, 52.0f }, bandDrivePanParam (b), tr ("Drive pan"), 0, true));
         add (fader ({ a.getX() + 432.0f, a.getY() + 14.0f, 42.0f, 148.0f }, xp (b, 2), tr ("Bass"), true));
         add (fader ({ a.getX() + 476.0f, a.getY() + 14.0f, 42.0f, 148.0f }, xp (b, 3), tr ("Mid"), true));
         add (fader ({ a.getX() + 520.0f, a.getY() + 14.0f, 42.0f, 148.0f }, xp (b, 4), tr ("Treble"), true));
         add (fader ({ a.getX() + 564.0f, a.getY() + 14.0f, 42.0f, 148.0f }, xp (b, 5), tr ("Presence"), true));
-        add (knob ({ a.getX() + 612.0f, a.getY() + 60.0f, 70.0f, 92.0f }, fp (b, 3), tr ("Level"), 1, true));
+        add (knob ({ a.getX() + 612.0f, a.getY() + 8.0f, 70.0f, 78.0f }, fp (b, 3), tr ("Level"), 1, true));
+        add (knob ({ a.getX() + 612.0f, a.getY() + 88.0f, 70.0f, 78.0f }, bandPanParam (b), tr ("Pan"), 1, true));
         if (count() > 1)
         {
             out.push_back (button ({ a.getRight() - 72.0f, a.getY() + 10.0f, 20.0f, 20.0f }, idPrev, "<", false, tr ("Previous / next band")));
@@ -2092,19 +2137,26 @@ private:
         out.push_back (toggle ({ s.getX() + 690.0f, s.getY(), 110.0f, s.getHeight() }, wideCuts, tr ("Wide cuts")));
         const auto bar = barArea();
         const auto cy = bar.getCentreY();
-        out.push_back (barMenu ({ 10.0f, cy - 11.0f, 160.0f, 22.0f }, xoverSlope, tr ("Crossover"), "12 dB/oct|24 dB/oct|48 dB/oct", { 0.0f, 0.5f, 1.0f }));
-        out.push_back (barMenu ({ 176.0f, cy - 11.0f, 140.0f, 22.0f }, quality, tr ("Oversampling"), "2x|4x|8x", { 0.0f, 0.5f, 1.0f }));
-        out.push_back (barMenu ({ 322.0f, cy - 11.0f, 100.0f, 22.0f }, bands, tr ("Bands"), "1|2|3|4"));
-        out.push_back (barValue ({ 428.0f, cy - 11.0f, 100.0f, 22.0f }, inputGain, tr ("In")));
-        out.push_back (barValue ({ 534.0f, cy - 11.0f, 90.0f, 22.0f }, tone, tr ("Tilt")));
-        out.push_back (barValue ({ 630.0f, cy - 11.0f, 120.0f, 22.0f }, wide() ? lowCutWide : lowCut, tr ("Low cut")));
-        out.push_back (barValue ({ 756.0f, cy - 11.0f, 130.0f, 22.0f }, wide() ? highCutWide : highCut, tr ("High cut")));
+        out.push_back (barMenu ({ 10.0f, cy - 11.0f, 150.0f, 22.0f }, xoverSlope, tr ("Crossover"), "12 dB/oct|24 dB/oct|48 dB/oct", { 0.0f, 0.5f, 1.0f }));
+        out.push_back (barMenu ({ 166.0f, cy - 11.0f, 130.0f, 22.0f }, quality, tr ("Oversampling"), "2x|4x|8x", { 0.0f, 0.5f, 1.0f }));
+        out.push_back (barMenu ({ 302.0f, cy - 11.0f, 90.0f, 22.0f }, bands, tr ("Bands"), "1|2|3|4"));
+        out.push_back (barValue ({ 398.0f, cy - 11.0f, 90.0f, 22.0f }, inputGain, tr ("In")));
+        out.push_back (barValue ({ 494.0f, cy - 11.0f, 80.0f, 22.0f }, tone, tr ("Tilt")));
+        out.push_back (barValue ({ 580.0f, cy - 11.0f, 110.0f, 22.0f }, wide() ? lowCutWide : lowCut, tr ("Low cut")));
+        out.push_back (barValue ({ 696.0f, cy - 11.0f, 120.0f, 22.0f }, wide() ? highCutWide : highCut, tr ("High cut")));
+        // round 147 (Saturn 2's channel mode): the bands work on left / right or on mid / side
+        out.push_back (barMenu ({ 822.0f, cy - 11.0f, 128.0f, 22.0f }, channelMode, tr ("Channel"), "L/R|M/S", { 0.0f, 1.0f }));
     }
 
     // band settings as a block (style, drive, mix, level + round 128's power, state, tone, feedback, dynamics) to move
     // bands around when splitting / removing
-    static constexpr int blockSize = 4 + mixsuite::ember::extraFields;
-    int blockParam (int b, int k) const { return k < 4 ? fp (b, k) : xp (b, k - 4); }
+    static constexpr int blockSize = 4 + mixsuite::ember::extraFields + 2; // round 147: + drive pan, pan
+    int blockParam (int b, int k) const
+    {
+        if (k == blockSize - 2) return mixsuite::ember::bandDrivePanParam (b);
+        if (k == blockSize - 1) return mixsuite::ember::bandPanParam (b);
+        return k < 4 ? fp (b, k) : xp (b, k - 4);
+    }
     std::array<float, blockSize> bandValues (int b) const
     {
         std::array<float, blockSize> out {};

+ 4 - 0
tests/LynxTuneTests95.inc

@@ -562,7 +562,11 @@ TEST (lynx_tune_editor_layout_round95)
         // lists the extra scales (More scales)
         if (item.type == lynx::plugui::Item::display && item.display != nullptr && std::string (item.display) == "tunekeys")
             for (int k = 0; k < 12; ++k)
+            {
                 placed[(std::size_t) (lynx::lynxtune::noteC + k)] = placed[(std::size_t) (lynx::lynxtune::bypassC + k)] = true;
+                placed[(std::size_t) (lynx::lynxtune::noteDirC + k)] = true; // round 147b: the note directions
+                placed[(std::size_t) lynx::lynxtune::rangeLow] = placed[(std::size_t) lynx::lynxtune::rangeHigh] = true; // and the range bar
+            }
         if (item.type == lynx::plugui::Item::menu && item.param != nullptr && std::string (item.param) == "Scale")
             placed[(std::size_t) lynx::lynxtune::moreScales] = true;
     }

+ 1 - 1
tests/Parity128Tests.inc

@@ -175,7 +175,7 @@ TEST (ember_round128_new_parameters_default_to_the_old_sound)
 {
     using namespace lynx::mixsuite::ember;
     const auto& in = lynx::effectInfo (lynx::EffectKind::ember);
-    CHECK ((int) in.params.size() == count && count == 83 && count <= lynx::maxEffectParams); // round 135 (7) + round 136 (the Classic voicing, 11)
+    CHECK ((int) in.params.size() == count && count == 92 && count <= lynx::maxEffectParams); // round 135 (7) + round 136 (the Classic voicing, 11) + round 147b (9)
     const auto p = mixsuite96::defaults (lynx::EffectKind::ember);
     CHECK (std::abs (inputDb (p[inputGain])) < 1e-9);
     for (int b = 0; b < maxBands; ++b)

+ 1 - 1
tests/Parity135fTests.inc

@@ -242,7 +242,7 @@ TEST (parity135f_prism_six_bands)
     using namespace dyn108;
     namespace m = lynx::dyn::prism;
     // the old parameter block keeps its indices; the new ones are appended
-    CHECK (m::bandLookahead0 == 48 && m::band5 == 52 && m::xover4 == 72 && m::bandCountParam == 76 && m::scExternal == 83 && m::processingMode == 84 && m::count == 87); // round 144: + processing, oversampling, pan mode
+    CHECK (m::bandLookahead0 == 48 && m::band5 == 52 && m::xover4 == 72 && m::bandCountParam == 76 && m::scExternal == 83 && m::processingMode == 84 && m::panMode == 86 && m::dynamicEngine == 87 && m::bandLink0 == 88 && m::count == 123); // round 144: + processing, oversampling, pan mode
     CHECK ((int) lynx::effectInfo (EffectKind::prismMultiband).params.size() == m::count);
     auto p = defaults (EffectKind::prismMultiband);
     CHECK (m::bandCount (p) == 4 && m::param (4, m::fEnabled) == 60 && m::param (5, m::fSolo) == 71);

+ 1 - 1
tests/Parity144Tests.inc

@@ -203,7 +203,7 @@ TEST (echoform_style_edit_round144)
     using namespace lynx;
     namespace e = echosuite::echoform;
     const auto d = makeEffectSlot (EffectKind::echoform).params;
-    CHECK (e::inputLevel == e::rhythmTimeLast + 1 && e::loopTreble + 1 == e::paramCount);
+    CHECK (e::inputLevel == e::rhythmTimeLast + 1 && e::loopTreble + 1 == e::voicing);
     CHECK (formatEffectParam (EffectKind::echoform, e::inputLevel, d[e::inputLevel], 120.0) == "+0.0 dB");
     CHECK (formatEffectParam (EffectKind::echoform, e::loopMid, d[e::loopMid], 120.0) == "+0.0 dB");
     CHECK (formatEffectParam (EffectKind::echoform, e::loopBass, 1.0f, 120.0) == "+18.0 dB");

+ 370 - 0
tests/Parity147Tests.inc

@@ -0,0 +1,370 @@
+// --- Round 147: Prism Multiband's measured Dynamic phase (Pro-MB, REA_rodada147 §1) ---------------------------------
+
+#include "core/MinPhaseBand.h"
+
+namespace p147
+{
+namespace m = lynx::dyn::prism;
+inline double dbToGain (double db) { return std::pow (10.0, db / 20.0); }
+inline double gainToDb (double g) { return 20.0 * std::log10 (std::max (g, 1e-12)); }
+
+// a steady sine's gain (dB) through the effect
+inline double toneGain (const lynx::EffectParams& p, double hz)
+{
+    std::vector<float> x (24000);
+    for (std::size_t i = 0; i < x.size(); ++i)
+        x[i] = (float) (0.25 * std::sin (2.0 * dyn108::pi * hz * (double) i / dyn108::sr));
+    const auto y = dyn108::run (lynx::EffectKind::prismMultiband, p, x);
+    return dyn108::rmsDb (y, 12000, 18000) - dyn108::rmsDb (x, 12000, 18000);
+}
+
+// two static bands split at `hz` (24 dB/oct): levels in dB (range 0: no dynamics)
+inline lynx::EffectParams twoBands (double lowDb, double highDb, double hz = 1000.0)
+{
+    auto p = dyn108::defaults (lynx::EffectKind::prismMultiband);
+    p[m::bandCountParam] = m::bandCountValue (2);
+    p[m::xover1] = m::crossoverValue (hz);
+    for (int b = 0; b < 2; ++b)
+        p[(std::size_t) m::param (b, m::fRange)] = 0.5f;
+    p[(std::size_t) m::param (0, m::fLevel)] = (float) ((lowDb + 30.0) / 60.0);
+    p[(std::size_t) m::param (1, m::fLevel)] = (float) ((highDb + 30.0) / 60.0);
+    return p;
+}
+} // namespace p147
+
+TEST (prism_measured_dynamic_phase_filters_round147)
+{
+    using namespace lynx;
+    using p147::dbToGain;
+    using p147::gainToDb;
+    namespace mp = minphase;
+    // [EXEC] Pro-MB 1.3.3 at 48 kHz, Dynamic phase, static band levels: magnitude (dB) and phase (degrees) at 1 kHz
+    struct Case { double lo, hi; int n; double gainDb, magDb, phaseDeg; };
+    const Case cases[] {
+        { 0.0, 1000.0, 2, -12.0, -4.08, 53.0 },     // low band to 1 kHz, 24 dB/oct
+        { 0.0, 1000.0, 1, -12.0, -4.08, 36.8 },     // 12 dB/oct
+        { 0.0, 1000.0, 2, 12.0, 7.93, -53.0 },      // +12 dB
+        { 1000.0, 0.0, 2, -12.0, -4.07, -53.0 },    // high band from 1 kHz
+        { 300.0, 3000.0, 2, -12.0, -11.50, 2.6 },   // a middle band 300 Hz – 3 kHz
+        { 300.0, 3000.0, 4, -12.0, -11.99, 2.0 },   // 48 dB/oct
+    };
+    for (const auto& c : cases)
+    {
+        mp::Band b;
+        const auto wl = c.lo > 0.0 ? mp::warp (c.lo, 48000.0) : 0.0, wh = c.hi > 0.0 ? mp::warp (c.hi, 48000.0) : 0.0;
+        b.design (wl, wh, c.n, dbToGain (c.gainDb));
+        const auto h = b.response (2.0 * mp::pi * 1000.0 / 48000.0);
+        const auto mag = gainToDb (std::abs (h)), ph = std::arg (h) * 180.0 / mp::pi;
+        std::printf ("  Prism dynamic band %.0f-%.0f Hz n=%d %+.0f dB: 1 kHz %.2f dB %.1f deg (Pro-MB %.2f dB %.1f deg)\n",
+                     c.lo, c.hi, c.n, c.gainDb, mag, ph, c.magDb, c.phaseDeg);
+        CHECK (std::abs (mag - c.magDb) < 0.1);
+        CHECK (std::abs (ph - c.phaseDeg) < 1.0);
+        // the designed magnitude is the linear-phase one everywhere
+        for (const double hz : { 50.0, 200.0, 700.0, 2000.0, 8000.0, 16000.0 })
+            CHECK (std::abs (std::abs (b.response (2.0 * mp::pi * hz / 48000.0)) - mp::bandMagnitude (wl, wh, c.n, dbToGain (c.gainDb), mp::warp (hz, 48000.0))) < 1e-6);
+        // stable: the impulse response dies away
+        b.reset();
+        double tail = 0.0;
+        for (int i = 0; i < 96000; ++i)
+        {
+            const auto y = b.process (i == 0 ? 1.0 : 0.0);
+            if (i > 90000)
+                tail += y * y;
+        }
+        CHECK (tail < 1e-20);
+    }
+}
+
+TEST (prism_measured_dynamic_phase_engine_round147)
+{
+    using namespace lynx;
+    namespace m = dyn::prism;
+    // new instances run the measured engine; the text of the switch
+    const auto def = makeEffectSlot (EffectKind::prismMultiband).params;
+    CHECK (m::measuredDynamic (def));
+    CHECK ((int) effectInfo (EffectKind::prismMultiband).params.size() == m::count);
+    CHECK (formatEffectParam (EffectKind::prismMultiband, m::dynamicEngine, 1.0f, 120.0) == "measured");
+    CHECK (formatEffectParam (EffectKind::prismMultiband, m::dynamicEngine, 0.0f, 120.0) == "classic");
+
+    // [EXEC] the low band at −12 dB below 1 kHz: −12.0 / −10.6 / −4.1 / −0.4 / 0.0 dB (Pro-MB, dynamic = linear magnitude)
+    const double hz[] { 50.0, 500.0, 1000.0, 2000.0, 10000.0 };
+    const double measured[] { -12.0, -10.6, -4.1, -0.4, 0.0 };
+    const double gains[m::bands] { -12.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
+    for (int k = 0; k < 5; ++k)
+    {
+        const auto p = p147::twoBands (-12.0, 0.0);
+        const auto g = p147::toneGain (p, hz[k]);
+        std::printf ("  Prism measured dynamic: %.0f Hz %.2f dB (Pro-MB %.1f)\n", hz[k], g, measured[k]);
+        CHECK (std::abs (g - measured[k]) < 0.15);
+        CHECK (std::abs (m::responseDb (p, gains, 48000.0, hz[k]) - g) < 0.15); // the editor's curve
+    }
+    // [EXEC] the bands are in cascade: two adjacent bands at −12 dB give −8.15 dB at their crossover (not −12),
+    // −12 / +6 dB give −0.57 dB
+    const auto both = p147::toneGain (p147::twoBands (-12.0, -12.0), 1000.0);
+    const auto mixed = p147::toneGain (p147::twoBands (-12.0, 6.0), 1000.0);
+    std::printf ("  Prism measured dynamic, two bands: -12/-12 %.2f dB (Pro-MB -8.15), -12/+6 %.2f dB (Pro-MB -0.57)\n", both, mixed);
+    CHECK (std::abs (both + 8.15) < 0.15);
+    CHECK (std::abs (mixed + 0.57) < 0.15);
+
+    // at rest the effect is the input, exactly (bands that cannot work are not run)
+    std::vector<float> noise (8192);
+    std::uint32_t seed = 11;
+    for (auto& v : noise)
+    {
+        seed = seed * 1664525u + 1013904223u;
+        v = (float) ((double) (seed >> 8) / 16777216.0 - 0.5);
+    }
+    const auto y = dyn108::run (EffectKind::prismMultiband, p147::twoBands (0.0, 0.0), noise);
+    double err = 0.0;
+    for (std::size_t i = 0; i < noise.size(); ++i)
+        err = std::max (err, (double) std::abs (y[i] - noise[i]));
+    CHECK (err < 1e-6);
+
+    // the classic engine stays for older projects: +2.76 dB at the crossover (round 144b's note)
+    auto classic = p147::twoBands (-12.0, 0.0);
+    classic[m::dynamicEngine] = 0.0f;
+    const auto old = p147::toneGain (classic, 1000.0);
+    CHECK (std::abs (old - 2.76) < 0.2);
+
+    // oversampled: the same static magnitudes
+    auto os = p147::twoBands (-12.0, 0.0);
+    os[m::oversampling] = 1.0f;
+    CHECK (std::abs (p147::toneGain (os, 50.0) + 12.0) < 0.15);
+    CHECK (std::abs (p147::toneGain (os, 1000.0) + 4.1) < 0.15);
+
+    // a working compressor band: a loud 100 Hz tone in band 1 is turned down; the high band passes untouched
+    auto comp = dyn108::defaults (EffectKind::prismMultiband);
+    for (int b = 1; b < m::bands; ++b)
+        comp[(std::size_t) m::param (b, m::fEnabled)] = 0.0f;
+    const auto g100 = p147::toneGain (comp, 100.0), g12k = p147::toneGain (comp, 12000.0);
+    std::printf ("  Prism measured dynamic, compressing band 1: 100 Hz %.2f dB, 12 kHz %.2f dB\n", g100, g12k);
+    CHECK (g100 < -1.5);
+    CHECK (std::abs (g12k) < 0.1);
+}
+
+TEST (prism_old_projects_keep_classic_dynamic_round147)
+{
+    using namespace lynx;
+    namespace m = dyn::prism;
+    // a project written now (every parameter saved) keeps the measured engine
+    auto now = makeEffectSlot (EffectKind::prismMultiband);
+    upgradeLoadedEffectParams (now, (std::size_t) m::count);
+    CHECK (m::measuredDynamic (now.params));
+    // a project written before round 147 (its parameter list ends at the pan mode) loads the classic engine
+    auto old = makeEffectSlot (EffectKind::prismMultiband);
+    upgradeLoadedEffectParams (old, (std::size_t) m::dynamicEngine);
+    CHECK (! m::measuredDynamic (old.params));
+    // other engines are left alone
+    auto crest = makeEffectSlot (EffectKind::crestCompressor);
+    const auto before = crest.params;
+    upgradeLoadedEffectParams (crest, 3);
+    CHECK (crest.params == before);
+}
+
+namespace p147
+{
+// one band over the whole spectrum compressing: threshold, ratio, range −30, knee 0 (the trial's settings)
+inline lynx::EffectParams wholeBand (double thresholdDb, double ratio)
+{
+    auto p = dyn108::defaults (lynx::EffectKind::prismMultiband);
+    p[m::bandCountParam] = m::bandCountValue (1);
+    p[(std::size_t) m::param (0, m::fThreshold)] = m::thresholdValue (thresholdDb);
+    p[(std::size_t) m::param (0, m::fRatio)] = lynx::dyn::crest::ratioValue (ratio);
+    p[(std::size_t) m::param (0, m::fRange)] = 0.0f; // −30 dB
+    p[(std::size_t) m::param (0, m::fKnee)] = 0.0f;
+    return p;
+}
+
+// steady gains (dB) of a 200 Hz tone of the given left / right amplitudes: { left, right, mid, side }
+inline std::array<double, 4> stereoGains (const lynx::EffectParams& p, double aL, double aR)
+{
+    auto slot = lynx::makeEffectSlot (lynx::EffectKind::prismMultiband);
+    slot.params = p;
+    auto fx = lynx::makeEffect (slot);
+    fx->prepare (dyn108::sr);
+    fx->reset();
+    const int n = 72000;
+    std::vector<float> l (n), r (n);
+    for (int i = 0; i < n; ++i)
+    {
+        const auto s = std::sin (2.0 * dyn108::pi * 200.0 * i / dyn108::sr);
+        l[(std::size_t) i] = (float) (aL * s);
+        r[(std::size_t) i] = (float) (aR * s);
+    }
+    const auto il = l, ir = r;
+    for (int off = 0; off < n; off += 512)
+        fx->process (l.data() + off, r.data() + off, std::min (512, n - off), p, 120.0);
+    const auto rms = [&] (const std::vector<float>& a, const std::vector<float>& b, double ka, double kb) {
+        double e = 0.0;
+        for (int i = 48000; i < n; ++i)
+        {
+            const auto v = ka * a[(std::size_t) i] + kb * b[(std::size_t) i];
+            e += v * v;
+        }
+        return 10.0 * std::log10 (e + 1e-30);
+    };
+    return { rms (l, r, 1, 0) - rms (il, ir, 1, 0), rms (l, r, 0, 1) - rms (il, ir, 0, 1),
+             rms (l, r, 0.5, 0.5) - rms (il, ir, 0.5, 0.5), rms (l, r, 0.5, -0.5) - rms (il, ir, 0.5, -0.5) };
+}
+} // namespace p147
+
+TEST (prism_stereo_link_round147)
+{
+    using namespace lynx;
+    namespace m = dyn::prism;
+    CHECK (m::bandLink0 == 88 && m::count == 123 && (int) effectInfo (EffectKind::prismMultiband).params.size() == m::count);
+    CHECK (formatEffectParam (EffectKind::prismMultiband, m::bandLink0, 0.25f, 120.0) == "50%");
+    CHECK (formatEffectParam (EffectKind::prismMultiband, m::bandLink0 + 2, 0.75f, 120.0) == "100%, 50% only");
+    CHECK (formatEffectParam (EffectKind::prismMultiband, m::bandScLow0, m::scFilterValue (2000.0), 120.0) == "2.00 kHz");
+    // [EXEC] Pro-MB, one band, threshold −30 dB, 4 : 1, range −30, knee 0; 200 Hz at −6 dB left, −36 dB right
+    struct Case { float link, mode; double l, r, mid, side; bool ms; };
+    const Case cases[] {
+        { 0.0f, 0.0f, -17.74, 0.0, 0, 0, false },      // unlinked: the quiet right side untouched
+        { 0.25f, 0.0f, -17.74, -13.47, 0, 0, false },  // 50 %
+        { 0.5f, 0.0f, -17.74, -17.74, 0, 0, false },   // 100 % (the old detector)
+        { 1.0f, 0.0f, 0, 0, -13.47, 0.0, true },       // 100 % + 100 % mid only: the side untouched
+        { 1.0f, 1.0f, 0, 0, 0.0, -13.06, true },       // side only
+        { 0.75f, 0.0f, 0, 0, -15.95, -4.74, true },    // 100 % + 50 % mid only
+    };
+    for (const auto& c : cases)
+    {
+        auto p = p147::wholeBand (-30.0, 4.0);
+        p[m::bandLink0] = c.link;
+        p[m::bandLinkMode0] = c.mode;
+        const auto g = p147::stereoGains (p, 0.5, 0.5 * std::pow (10.0, -1.5));
+        std::printf ("  Prism link %.2f mode %.0f: L %.2f R %.2f M %.2f S %.2f dB (Pro-MB %s %.2f / %.2f)\n", c.link, c.mode, g[0], g[1], g[2], g[3],
+                     c.ms ? "M/S" : "L/R", c.ms ? c.mid : c.l, c.ms ? c.side : c.r);
+        CHECK (std::abs ((c.ms ? g[2] : g[0]) - (c.ms ? c.mid : c.l)) < 0.8);
+        CHECK (std::abs ((c.ms ? g[3] : g[1]) - (c.ms ? c.side : c.r)) < 0.8);
+    }
+}
+
+TEST (prism_free_sidechain_filter_round147)
+{
+    using namespace lynx;
+    namespace m = dyn::prism;
+    // [EXEC] Pro-MB, one band, threshold −60, 2 : 1, range −30: the detector level of a −20 dB probe (from its gain)
+    // with a free side-chain filter 2 – 4 kHz: 1 kHz −22.4, 2 kHz +2.1, 3 kHz +5.5, 8 kHz −23.5 dB (relative)
+    const double hz[] { 1000.0, 2000.0, 3000.0, 8000.0 };
+    const double rel[] { -22.4, 2.1, 5.5, -23.5 };
+    for (int k = 0; k < 4; ++k)
+    {
+        auto p = p147::wholeBand (-60.0, 2.0);
+        p[m::bandScFree0] = 1.0f;
+        p[m::bandScLow0] = m::scFilterValue (2000.0);
+        p[m::bandScHigh0] = m::scFilterValue (4000.0);
+        const auto g = p147::toneGain (p, hz[k]);
+        // tone at −12 dBFS (0.25): detector = −2·gain − 60 → relative to the probe's own level
+        const auto det = -2.0 * g - 60.0 - (-12.04);
+        std::printf ("  Prism free side chain 2-4 kHz: %.0f Hz detector %+.1f dB (Pro-MB %+.1f)\n", hz[k], det, rel[k]);
+        CHECK (std::abs (det - rel[k]) < 2.0);
+    }
+    // band side chain (the default) is unchanged by the free filter's settings
+    auto a = p147::wholeBand (-60.0, 2.0), b = a;
+    b[m::bandScLow0] = m::scFilterValue (2000.0);
+    CHECK (std::abs (p147::toneGain (a, 300.0) - p147::toneGain (b, 300.0)) < 1e-6);
+}
+
+TEST (prism_promb_expert_translation_round147)
+{
+    using namespace lynx;
+    namespace m = dyn::prism;
+    std::vector<std::pair<int, float>> mb { { 0, 1.0f }, { 1, (float) std::log2 (30.0) }, { 2, 0.5f }, { 3, (float) std::log2 (30000.0) }, { 4, 0.5f },
+                                            { 6, 0.5f }, { 8, 0.6f }, { 133, 1.0f }, { 139, 1.0f },
+                                            { 15, 1.0f }, { 16, (float) std::log2 (2000.0) }, { 17, (float) std::log2 (4000.0) }, { 19, 0.25f }, { 20, 1.0f } };
+    for (int b = 1; b < 6; ++b)
+        mb.push_back ({ 22 * b, 2.0f });
+    PluginIdentity id;
+    id.format = ForeignPlugin::Format::vst3;
+    id.name = "FabFilter Pro-MB";
+    for (const float expertOn : { 0.0f, 1.0f })
+    {
+        auto values = mb;
+        values.push_back ({ 142, expertOn });
+        id.state = dyn108::fabf (151, values);
+        const auto* entry = findPluginSubstitute (id, false);
+        CHECK (entry != nullptr);
+        if (entry == nullptr)
+            continue;
+        const auto slot = makeSubstituteSlot (*entry, &id, nullptr);
+        // the band is our band 1 (from 30 Hz); expert off: the reference ignores the expert settings
+        const bool on = expertOn > 0.5f;
+        CHECK (std::abs (slot.params[m::bandLink0] - (on ? 0.25f : 0.5f)) < 1e-6f);
+        CHECK (slot.params[m::bandLinkMode0] == (on ? 1.0f : 0.0f));
+        CHECK (slot.params[m::bandScFree0] == (on ? 1.0f : 0.0f));
+        if (on)
+        {
+            CHECK (std::abs (m::scFilterHz (slot.params[m::bandScLow0]) - 2000.0) < 1.0);
+            CHECK (std::abs (m::scFilterHz (slot.params[m::bandScHigh0]) - 4000.0) < 2.0);
+        }
+        CHECK (m::measuredDynamic (slot.params)); // a translated state runs the measured Dynamic phase
+    }
+}
+
+TEST (hush_energy_detector_meter_round147)
+{
+    using namespace lynx;
+    // DeEsser's Energy Detector: Hush's second meter slot carries the detector level the threshold is compared with
+    auto slot = makeEffectSlot (EffectKind::hushDeEsser);
+    auto fx = makeEffect (slot);
+    fx->prepare (48000.0);
+    fx->reset();
+    const auto run = [&] (double hz, double amp) {
+        fx->reset();
+        std::vector<float> l (4800), r (4800);
+        for (int i = 0; i < 4800; ++i)
+            l[(std::size_t) i] = r[(std::size_t) i] = (float) (amp * std::sin (2.0 * dyn108::pi * hz * i / 48000.0));
+        for (int off = 0; off < 4800; off += 480)
+            fx->process (l.data() + off, r.data() + off, 480, slot.params, 120.0);
+        return fx->controlOutput (1) * 60.0f - 60.0f;
+    };
+    const auto loudHigh = run (9000.0, 0.5), quietHigh = run (9000.0, 0.05), low = run (200.0, 0.5);
+    std::printf ("  Hush detector meter: 9 kHz at -6 dB %.1f dB, at -26 dB %.1f dB, 200 Hz at -6 dB %.1f dB\n", loudHigh, quietHigh, low);
+    CHECK (loudHigh > -9.0 && loudHigh < 0.5);
+    CHECK (std::abs ((loudHigh - quietHigh) - 20.0) < 2.0); // follows the level
+    CHECK (low < loudHigh - 20.0);                          // the detector hears the sibilance band only
+}
+
+TEST (prism_per_crossover_slopes_round147)
+{
+    using namespace lynx;
+    namespace m = dyn::prism;
+    namespace mp = minphase;
+    CHECK (m::xoverSlope0 == 118 && m::count == 123);
+    // the default follows the global slope (the old sound)
+    const auto def = makeEffectSlot (EffectKind::prismMultiband).params;
+    for (int k = 0; k < 5; ++k)
+        CHECK (m::crossoverSlopeDbOct (def, k) == m::slopeDbOct (def[m::slope]));
+    CHECK (formatEffectParam (EffectKind::prismMultiband, m::xoverSlope0 + 1, 1.0f, 120.0) == "48 dB/oct");
+    // two bands at 1 kHz, the low one −12 dB: crossover 1 at 48 dB/oct while the global slope is 24
+    auto p = p147::twoBands (-12.0, 0.0);
+    p[m::xoverSlope0] = m::crossoverSlopeValue (48);
+    const auto w = [] (double hz) { return mp::warp (hz, 48000.0); };
+    for (const float mode : { 0.5f, 0.0f, 1.0f }) // dynamic, linear, minimum
+    {
+        p[m::processingMode] = mode;
+        const auto g = p147::toneGain (p, 500.0);
+        const auto expected = 20.0 * std::log10 (mp::bandMagnitude (0.0, w (1000.0), 4, 4, p147::dbToGain (-12.0), w (500.0)));
+        std::printf ("  Prism crossover 48 dB/oct (mode %.1f): 500 Hz %.2f dB (expected %.2f; 24 dB/oct: -10.60)\n", mode, g, expected);
+        CHECK (std::abs (g - expected) < 0.15);
+    }
+    // a middle band between a 12 dB/oct and a 48 dB/oct crossover (the measured dynamic engine, mixed orders)
+    auto q = dyn108::defaults (EffectKind::prismMultiband);
+    q[m::bandCountParam] = m::bandCountValue (3);
+    q[m::xover1] = m::crossoverValue (300.0);
+    q[m::xover2] = m::crossoverValue (3000.0);
+    q[m::xoverSlope0] = m::crossoverSlopeValue (12);
+    q[m::xoverSlope0 + 1] = m::crossoverSlopeValue (48);
+    for (int b = 0; b < 3; ++b)
+        q[(std::size_t) m::param (b, m::fRange)] = 0.5f;
+    q[(std::size_t) m::param (1, m::fLevel)] = 0.3f; // −12 dB
+    const double gains[m::bands] { 0.0, -12.0, 0.0, 0.0, 0.0, 0.0 };
+    for (const double hz : { 150.0, 300.0, 1000.0, 3000.0, 5000.0 })
+    {
+        const auto g = p147::toneGain (q, hz);
+        const auto expected = 20.0 * std::log10 (mp::bandMagnitude (w (300.0), w (3000.0), 1, 4, p147::dbToGain (-12.0), w (hz)));
+        std::printf ("  Prism mixed slopes 12 / 48: %.0f Hz %.2f dB (expected %.2f)\n", hz, g, expected);
+        CHECK (std::abs (g - expected) < 0.15);
+        CHECK (std::abs (m::responseDb (q, gains, 48000.0, hz) - expected) < 0.05);
+    }
+}

+ 191 - 0
tests/Parity147aTests.inc

@@ -0,0 +1,191 @@
+// --- Round 147a: Echoform ← EchoBoy's styles / saturation, PrimalTap's Multiply (REA_rodada147a) ------------------
+// The reference numbers below were measured black-box on the official EchoBoy / PrimalTap trials (D:\lynx-work\parity147\a).
+
+namespace p147a
+{
+// a steady sine through Echoform at 48 kHz (both inputs), the wet left after `skipSeconds`
+inline std::vector<float> echoSine (lynx::EffectParams p, double hz, double peakDb, double seconds = 2.0, double skipSeconds = 1.0)
+{
+    auto fx = lynx::makeEffect (lynx::EffectKind::echoform);
+    fx->prepare (48000.0);
+    const int n = (int) (48000.0 * seconds);
+    std::vector<float> l ((std::size_t) n), r;
+    const auto a = std::pow (10.0, peakDb / 20.0);
+    for (int i = 0; i < n; ++i)
+        l[(std::size_t) i] = (float) (a * std::sin (2.0 * 3.14159265358979 * hz * i / 48000.0));
+    r = l;
+    for (int at = 0; at < n; at += 512)
+        fx->process (l.data() + at, r.data() + at, std::min (512, n - at), p, 120.0);
+    return std::vector<float> (l.begin() + (std::ptrdiff_t) (48000.0 * skipSeconds), l.end());
+}
+
+// the amplitude of `hz` in x (a single-bin DFT over whole cycles)
+inline double toneAmp (const std::vector<float>& x, double hz)
+{
+    const int cyc = (int) std::floor (x.size() * hz / 48000.0);
+    const int n = (int) std::lround (cyc * 48000.0 / hz);
+    double re = 0.0, im = 0.0;
+    for (int i = 0; i < n; ++i)
+    {
+        const auto ph = 2.0 * 3.14159265358979 * hz * i / 48000.0;
+        re += x[(std::size_t) i] * std::cos (ph);
+        im += x[(std::size_t) i] * std::sin (ph);
+    }
+    return 2.0 * std::sqrt (re * re + im * im) / n;
+}
+
+inline lynx::EffectParams voiced (int voicing, double driveDb, double ms = 250.0)
+{
+    namespace e = lynx::echosuite::echoform;
+    auto p = p135w::cleanEcho (ms, 0.0f);
+    p[e::voicing] = e::voicingValue (voicing);
+    p[e::drive] = (float) (driveDb / 24.0);
+    return p;
+}
+} // namespace p147a
+
+TEST (echoform_voicing_params_round147a)
+{
+    using namespace lynx;
+    namespace e = echosuite::echoform;
+    CHECK ((int) effectInfo (EffectKind::echoform).params.size() == e::paramCount);
+    CHECK (e::voicing == e::loopTreble + 1 && e::multiply == e::paramCount - 1); // appended after round 144's
+    CHECK (e::paramCount <= maxEffectParams);
+    const auto p = makeEffectSlot (EffectKind::echoform).params;
+    CHECK (e::voicingOf (p[e::voicing]) == 0 && e::satTypeOf (p[e::satType]) == 0 && e::multiplyOf (p[e::multiply]) == 1);
+    CHECK (formatEffectParam (EffectKind::echoform, e::voicing, p[e::voicing], 120.0) == "off");
+    CHECK (formatEffectParam (EffectKind::echoform, e::voicing, e::voicingValue (2), 120.0) == "Studio reel");
+    CHECK (formatEffectParam (EffectKind::echoform, e::satType, e::satTypeValue (5), 120.0) == "grit");
+    CHECK (formatEffectParam (EffectKind::echoform, e::multiply, e::multiplyValue (4), 120.0) == "4x");
+    for (int k = 0; k <= e::voicingCount; ++k)
+        CHECK (e::voicingOf (e::voicingValue (k)) == k);
+    CHECK (e::voicingForEchoBoyStyle (1) == 2 && e::voicingForEchoBoyStyle (31) == 0);
+    // the names are LYNX's own (no product or trademark names)
+    for (int k = 1; k <= e::voicingCount; ++k)
+    {
+        const std::string name = e::voicingName (k);
+        CHECK (name.find ("Echo") == std::string::npos && name.find ("Memory") == std::string::npos && name.find ("Space") == std::string::npos);
+    }
+}
+
+TEST (echoform_voicing_tones_match_the_trial_round147a)
+{
+    using namespace lynx;
+    namespace e = echosuite::echoform;
+    // [EXEC] the first echo's tone (output × loop) at 125 Hz / 1 kHz / 4 kHz, 1/3-octave power ratios on the trial
+    struct Ref { int style; double db[3]; };
+    const Ref refs[] { { 1, { -3.27, -3.53, -4.71 } },   // studio tape
+                       { 10, { -12.62, 2.76, -8.59 } },  // the telephone style
+                       { 14, { -34.77, 7.31, 7.77 } },   // the transmitter style
+                       { 15, { -2.91, -2.81, -2.81 } },  // the digital style
+                       { 3, { -3.76, 0.18, -8.9 } } };   // the multi-head tape style
+    const double hz[3] { 125.0, 1000.0, 4000.0 };
+    for (const auto& r : refs)
+        for (int i = 0; i < 3; ++i)
+        {
+            const int k = e::voicingForEchoBoyStyle (r.style);
+            const auto db = e::voicingToneDb (k, false, hz[i], 48000.0) + e::voicingToneDb (k, true, hz[i], 48000.0);
+            CHECK (std::abs (db - r.db[i]) < 2.0);
+        }
+}
+
+TEST (echoform_voicing_saturation_curves_round147a)
+{
+    using namespace lynx;
+    namespace e = echosuite::echoform;
+    // [EXEC] the steady 1 kHz echo's gain over −40 … 0 dBFS (output tone at 1 kHz removed): studio tape at Saturation
+    // 24 dB (a shaper), the FM-radio style at 12 dB and the limited style at 18 dB (compressors)
+    const double lv[6] { -40, -30, -20, -12, -6, 0 };
+    struct Ref { int style; double drive; double db[6]; };
+    const Ref refs[] { { 1, 24.0, { 2.27, 2.27, 1.81, 0.03, -2.79, -6.7 } },
+                       { 12, 12.0, { -0.66, -0.86, -1.61, -3.66, -7.14, -11.9 } },
+                       { 24, 18.0, { 8.74, 8.23, 6.16, 1.43, -3.95, -9.75 } } };
+    for (const auto& r : refs)
+    {
+        const int k = e::voicingForEchoBoyStyle (r.style);
+        const auto tone = e::voicingToneDb (k, false, 1000.0, 48000.0) + e::voicingToneDb (k, true, 1000.0, 48000.0);
+        for (int i = 0; i < 6; ++i)
+            CHECK (std::abs (tone + e::satGainDb (k, 0, r.drive, lv[i]) - r.db[i]) < 1.5);
+    }
+    // through the engine: studio reel at 24 dB, a 0 dBFS sine → about −6.7 dB at 1 kHz; at −30 dBFS about +2.3 dB
+    const auto loud = p147a::echoSine (p147a::voiced (2, 24.0), 1000.0, 0.0);
+    const auto soft = p147a::echoSine (p147a::voiced (2, 24.0), 1000.0, -30.0);
+    CHECK (std::abs (20.0 * std::log10 (p147a::toneAmp (loud, 1000.0)) - -6.7) < 1.5);
+    CHECK (std::abs (20.0 * std::log10 (p147a::toneAmp (soft, 1000.0) / std::pow (10.0, -1.5)) - 2.27) < 1.5);
+}
+
+TEST (echoform_voicing_wobble_round147a)
+{
+    using namespace lynx;
+    namespace e = echosuite::echoform;
+    // [EXEC] the vibrato style's echo of a steady 1 kHz tone swings ≈ 16.7 cents rms at 5.5 Hz; the digital style is steady
+    auto cents = [] (const std::vector<float>& x) {
+        std::vector<double> zc; // rising zero crossings
+        for (std::size_t i = 1; i < x.size(); ++i)
+            if (x[i - 1] < 0.0f && x[i] >= 0.0f)
+                zc.push_back ((double) (i - 1) + x[i - 1] / (x[i - 1] - x[i]));
+        std::vector<double> c;
+        for (std::size_t i = 4; i < zc.size(); i += 4) // the period over 4 cycles
+            c.push_back (1200.0 * std::log2 (48000.0 * 4.0 / (zc[i] - zc[i - 4]) / 1000.0));
+        double m = 0.0, v = 0.0;
+        for (auto d : c) m += d;
+        m /= (double) c.size();
+        for (auto d : c) v += (d - m) * (d - m);
+        return std::sqrt (v / (double) c.size());
+    };
+    const auto vib = p147a::echoSine (p147a::voiced (e::voicingForEchoBoyStyle (20), 0.0), 1000.0, -20.0, 5.0, 1.0);
+    const auto dig = p147a::echoSine (p147a::voiced (e::voicingForEchoBoyStyle (15), 0.0), 1000.0, -20.0, 3.0, 1.0);
+    const auto c = cents (vib);
+    CHECK (c > 11.0 && c < 23.0);
+    CHECK (cents (dig) < 0.5);
+}
+
+TEST (echoform_multiply_round147a)
+{
+    using namespace lynx;
+    namespace e = echosuite::echoform;
+    // [EXEC] PrimalTap: Multiply 2x / 4x / 8x = the delay × 2 / 4 / 8, the band ≈ 6.2 / 3.1 / 1.55 kHz
+    for (int f : { 1, 2, 4, 8 })
+    {
+        auto p = p135w::cleanEcho (100.0, 0.0f);
+        p[e::multiply] = e::multiplyValue (f);
+        CHECK (e::multiplyOf (p[e::multiply]) == f);
+        std::vector<float> l, r;
+        p135w::echoImpulse (p, l, r);
+        const int at = p135w::firstAbove (l, 0.01f, 10);
+        CHECK (std::abs (at - 4800 * f) < 80);
+    }
+    auto p = p135w::cleanEcho (100.0, 0.0f);
+    p[e::multiply] = e::multiplyValue (4);
+    const auto low = p147a::toneAmp (p147a::echoSine (p, 1000.0, -20.0), 1000.0);
+    const auto high = p147a::toneAmp (p147a::echoSine (p, 5000.0, -20.0), 5000.0);
+    CHECK (20.0 * std::log10 (low / 0.1) > -3.0);
+    CHECK (20.0 * std::log10 (high / 0.1) < -40.0);
+}
+
+TEST (echoform_saturation_type_without_voicing_round147a)
+{
+    using namespace lynx;
+    namespace e = echosuite::echoform;
+    // the Clean mode with a chosen curve: Grit (the fuzzed style's) adds harmonics, Auto keeps the mode's own shaper
+    auto p = p135w::cleanEcho (250.0, 0.0f);
+    p[e::drive] = 0.5f;
+    const auto autoOut = p147a::echoSine (p, 1000.0, -6.0);
+    p[e::satType] = e::satTypeValue (5);
+    const auto grit = p147a::echoSine (p, 1000.0, -6.0);
+    const auto h3 = [] (const std::vector<float>& x) { return p147a::toneAmp (x, 3000.0) / p147a::toneAmp (x, 1000.0); };
+    const auto h2 = [] (const std::vector<float>& x) { return p147a::toneAmp (x, 2000.0) / p147a::toneAmp (x, 1000.0); };
+    CHECK (h2 (grit) + h3 (grit) > 3.0 * (h2 (autoOut) + h3 (autoOut)) + 1e-4);
+    // the EchoBoy stand-in for an unknown state plays the studio reel voicing (EchoBoy's default style)
+    PluginIdentity id;
+    id.format = ForeignPlugin::Format::vst2;
+    id.vst2Id = 0x53744542u;
+    id.name = "EchoBoy";
+    const auto* entry = findPluginSubstitute (id, false);
+    CHECK (entry != nullptr);
+    if (entry != nullptr)
+    {
+        const auto slot = makeSubstituteSlot (*entry);
+        CHECK (e::voicingOf (slot.params[(std::size_t) e::voicing]) == 2);
+    }
+}

+ 239 - 0
tests/Parity147bTests.inc

@@ -0,0 +1,239 @@
+// --- Round 147b: parity items (docs/PARITY.md, REA_rodada147b) ----------------------------------------------------
+
+namespace p147b
+{
+// one second of a 1 kHz sine through Ember (one block size), the given left / right inputs
+inline std::pair<std::vector<float>, std::vector<float>> emberRun (const lynx::EffectParams& p, float gl, float gr)
+{
+    auto fx = lynx::makeEffect (lynx::EffectKind::ember);
+    fx->prepare (48000.0);
+    std::vector<float> l (24000), r (24000);
+    for (int i = 0; i < 24000; ++i)
+    {
+        const auto s = 0.25f * (float) std::sin (2.0 * 3.14159265358979 * 1000.0 * i / 48000.0);
+        l[(std::size_t) i] = gl * s;
+        r[(std::size_t) i] = gr * s;
+    }
+    for (int at = 0; at < 24000; at += 512)
+        fx->process (l.data() + at, r.data() + at, std::min (512, 24000 - at), p, 120.0);
+    return { l, r };
+}
+inline double maxDiff (const std::vector<float>& a, const std::vector<float>& b)
+{
+    double m = 0.0;
+    for (std::size_t i = 4800; i < a.size(); ++i) m = std::max (m, (double) std::abs (a[i] - b[i]));
+    return m;
+}
+inline double peakOf (const std::vector<float>& a)
+{
+    double m = 0.0;
+    for (std::size_t i = 4800; i < a.size(); ++i) m = std::max (m, (double) std::abs (a[i]));
+    return m;
+}
+} // namespace p147b
+
+TEST (ember_saturn_channel_mode_drive_pan_band_pan_round147b)
+{
+    using namespace lynx;
+    namespace em = mixsuite::ember;
+    auto base = makeEffectSlot (EffectKind::ember).params;
+    CHECK (effectInfo (EffectKind::ember).params.size() == (std::size_t) em::count);
+    // defaults: left / right, every pan centred (the old sound)
+    CHECK (! em::midSide (base));
+    for (int b = 0; b < em::maxBands; ++b)
+    {
+        CHECK (base[(std::size_t) em::bandDrivePanParam (b)] == 0.5f && base[(std::size_t) em::bandPanParam (b)] == 0.5f);
+    }
+    CHECK (em::panScales (0.0) == std::make_pair (1.0f, 1.0f));
+    CHECK (em::panScales (-0.5) == std::make_pair (1.0f, 0.5f));  // [EXEC] pan −0.5: the right −6.02 dB
+    CHECK (em::panScales (1.0) == std::make_pair (0.0f, 1.0f));
+    CHECK (formatEffectParam (EffectKind::ember, em::channelMode, 1.0f, 120.0) == "Mid/Side");
+    CHECK (formatEffectParam (EffectKind::ember, em::band1Pan, 0.25f, 120.0) == "0.0 / -6.0 dB");
+    CHECK (formatEffectParam (EffectKind::ember, em::band2DrivePan, 0.5f, 120.0) == "centre");
+
+    base[em::drive] = 0.5f;
+    base[em::autoGain] = 0.0f;
+    // drive pan fully left [EXEC: the far side's drive × (1 − |pan|)]: left = the full drive, right = no drive
+    {
+        auto p = base;
+        p[(std::size_t) em::bandDrivePanParam (0)] = 0.0f;
+        const auto [l, r] = p147b::emberRun (p, 1.0f, 1.0f);
+        const auto [fl, fr] = p147b::emberRun (base, 1.0f, 1.0f);
+        auto q = base;
+        q[em::drive] = 0.0f;
+        const auto [zl, zr] = p147b::emberRun (q, 1.0f, 1.0f);
+        CHECK (p147b::maxDiff (l, fl) < 1e-6);
+        CHECK (p147b::maxDiff (r, zr) < 1e-6);
+        CHECK (p147b::maxDiff (r, fr) > 1e-3);
+    }
+    // half left: the right channel's drive is half the dB
+    {
+        auto p = base;
+        p[(std::size_t) em::bandDrivePanParam (0)] = 0.25f;
+        auto q = base;
+        q[em::drive] = 0.25f;
+        const auto [l, r] = p147b::emberRun (p, 1.0f, 1.0f);
+        const auto [hl, hr] = p147b::emberRun (q, 1.0f, 1.0f);
+        CHECK (p147b::maxDiff (r, hr) < 1e-6);
+    }
+    // band pan fully right: the left channel is silent (mix 100 %)
+    {
+        auto p = base;
+        p[(std::size_t) em::bandPanParam (0)] = 1.0f;
+        const auto [l, r] = p147b::emberRun (p, 1.0f, 1.0f);
+        CHECK (p147b::peakOf (l) < 1e-6 && p147b::peakOf (r) > 0.1);
+    }
+    // mid / side: a mid-only input gives the left / right result (S = 0), a side-only input is shaped on its own
+    {
+        auto p = base;
+        p[em::channelMode] = 1.0f;
+        const auto [ml, mr] = p147b::emberRun (p, 1.0f, 1.0f);
+        const auto [ll, lr] = p147b::emberRun (base, 1.0f, 1.0f);
+        CHECK (p147b::maxDiff (ml, ll) < 1e-5 && p147b::maxDiff (mr, lr) < 1e-5);
+        // pan fully left in M/S = the mid only: a side-only input disappears
+        p[(std::size_t) em::bandPanParam (0)] = 0.0f;
+        const auto [sl, sr] = p147b::emberRun (p, 1.0f, -1.0f);
+        CHECK (p147b::peakOf (sl) < 1e-6 && p147b::peakOf (sr) < 1e-6);
+        // a left-only tone in M/S with the drive panned to the mid: the right gets distortion products
+        p[(std::size_t) em::bandPanParam (0)] = 0.5f;
+        p[(std::size_t) em::bandDrivePanParam (0)] = 0.0f;
+        const auto [al, ar] = p147b::emberRun (p, 1.0f, 0.0f);
+        CHECK (p147b::peakOf (ar) > 1e-3);
+    }
+    // multiband: band 2's pan right silences its part on the left
+    {
+        auto p = base;
+        p[em::bands] = 1.0f / 3.0f;
+        p[em::xover1] = em::crossoverValue (300.0);
+        p[(std::size_t) em::bandPanParam (1)] = 1.0f;
+        const auto [l, r] = p147b::emberRun (p, 1.0f, 1.0f); // 1 kHz sits in band 2
+        CHECK (p147b::peakOf (l) < 0.2 * p147b::peakOf (r));
+    }
+}
+
+TEST (ember_saturn2_channel_mode_and_pans_translated_round147b)
+{
+    using namespace lynx;
+    PluginIdentity id;
+    id.name = "FabFilter Saturn 2";
+    // [EXEC] the trial's state: 695 = channel mode, band b drive pan at 7 + 17b + 5, band pan at + 12 (−1 … +1)
+    id.state = dyn108::ffbs (951, { { 5, 100.0f }, { 6, 1.0f }, { 7 + 5, -0.5f }, { 7 + 10, 100.0f }, { 7 + 12, 0.5f }, { 7 + 13, 1.0f },
+                                    { 695, 1.0f } });
+    const auto* entry = findPluginSubstitute (id, false);
+    CHECK (entry != nullptr);
+    if (entry == nullptr) return;
+    const auto slot = makeSubstituteSlot (*entry, &id);
+    namespace e = mixsuite::ember;
+    CHECK (e::midSide (slot.params));
+    CHECK (std::abs (e::panOf (slot.params[(std::size_t) e::bandDrivePanParam (0)]) + 0.5) < 1e-4);
+    CHECK (std::abs (e::panOf (slot.params[(std::size_t) e::bandPanParam (0)]) - 0.5) < 1e-4);
+}
+
+TEST (lynx_tune_note_status_directions_and_range_round147b)
+{
+    using namespace lynx;
+    namespace t = lynxtune;
+    CHECK ((int) effectInfo (EffectKind::lynxTune).params.size() == t::count);
+    auto p = makeEffectSlot (EffectKind::lynxTune).params;
+    // defaults: every direction "nearest", the range the whole keyboard (the old behaviour)
+    for (int k = 0; k < 12; ++k) CHECK (t::noteDir (p[(std::size_t) (t::noteDirC + k)]) == t::NoteDir::nearest);
+    CHECK (t::rangeNote (p[t::rangeLow]) == 0 && t::rangeNote (p[t::rangeHigh]) == 127);
+    CHECK (formatEffectParam (EffectKind::lynxTune, t::rangeHigh, t::rangeNoteValue (60), 120.0) == "C4");
+    CHECK (formatEffectParam (EffectKind::lynxTune, t::noteDirC + 3, 0.5f, 120.0) == "Up");
+    CHECK (t::rangePresetNotes (6) == std::make_pair (0, 127));
+    for (int k = 0; k + 1 < t::rangePresets; ++k)
+        CHECK (t::rangePresetNotes (k).first < t::rangePresetNotes (k).second && t::rangePresetNotes (k).second - t::rangePresetNotes (k).first >= 24);
+
+    // the target with an illegal note: C major without E (legal C D F G A B): 63.9 (≈ E4 − 0.1) goes to the nearest
+    // legal note by default (64 is illegal: D# / F — 65 F is nearer than 62 D), up = F4, down = D4
+    const std::uint16_t legal = (1u << 0) | (1u << 2) | (1u << 5) | (1u << 7) | (1u << 9) | (1u << 11);
+    std::array<t::NoteDir, 12> dirs {};
+    CHECK (t::targetNote (64.2, legal, -1, 0.0, dirs.data()) == 65);
+    dirs[4] = t::NoteDir::down;
+    CHECK (t::targetNote (64.2, legal, -1, 0.0, dirs.data()) == 62);
+    dirs[4] = t::NoteDir::up;
+    CHECK (t::targetNote (63.8, legal, -1, 0.0, dirs.data()) == 65);
+    CHECK (t::targetNote (60.1, legal, -1, 0.0, dirs.data()) == 60); // a legal note is untouched
+
+    // the range: a 450 Hz tone (A4 + 39 c) is pulled to 440 Hz; with the range ending at G4 it passes as sung
+    auto freqOut = [] (const EffectParams& q) {
+        auto fx = makeEffect (EffectKind::lynxTune);
+        fx->prepare (48000.0);
+        const int len = 96000;
+        std::vector<float> l (len), r (len);
+        for (int i = 0; i < len; ++i) l[(std::size_t) i] = r[(std::size_t) i] = 0.3f * (float) std::sin (2.0 * 3.14159265358979 * 450.0 * i / 48000.0);
+        for (int at = 0; at < len; at += 512)
+            fx->process (l.data() + at, r.data() + at, std::min (512, len - at), q, 120.0);
+        int crossings = 0, first = -1, last = -1;
+        for (int i = 60000; i < len; ++i)
+            if (l[(std::size_t) i - 1] < 0.0f && l[(std::size_t) i] >= 0.0f)
+            {
+                if (first < 0) first = i;
+                last = i;
+                ++crossings;
+            }
+        return crossings > 1 ? 48000.0 * (crossings - 1) / (double) (last - first) : 0.0;
+    };
+    const auto corrected = freqOut (p);
+    p[t::rangeHigh] = t::rangeNoteValue (67);
+    const auto outside = freqOut (p);
+    CHECK (std::abs (corrected - 440.0) < 3.0);
+    CHECK (std::abs (outside - 450.0) < 3.0);
+}
+
+TEST (ridge_auto_makeup_and_analog_round147b)
+{
+    using namespace lynx;
+    namespace r = mixsuite::ridge;
+    CHECK ((int) effectInfo (EffectKind::ridgeStrip).params.size() == r::count);
+    auto p = makeEffectSlot (EffectKind::ridgeStrip).params;
+    CHECK (p[r::autoMakeup] == 0.0f && p[r::analog] == 0.0f); // the old sound
+    // the console's make-up for the same threshold / ratio (round 123's measured law): none at 1:1, more with more
+    // compression
+    p[r::compRatio] = 0.0f;
+    CHECK (r::autoMakeupDb (p) == 0.0);
+    p[r::compRatio] = 0.4f;                                         // 1 + 19·0.16 = 4.04 : 1
+    p[r::compThreshold] = 0.5f;                                     // −20 dBFS = the console's −2 dB
+    const auto mk = r::autoMakeupDb (p);
+    vmatch::echannel::Settings e;
+    e.compRatio = r::ratio (0.4f);
+    e.compThreshold = -2.0;
+    CHECK (std::abs (mk - vmatch::echannel::compMakeupDb (e)) < 1e-9 && mk > 0.5);
+    p[r::compThreshold] = 0.25f;                                    // −30 dBFS: deeper, more make-up
+    CHECK (r::autoMakeupDb (p) > mk);
+    p[r::compThreshold] = 0.5f;
+    // processed: switching it on raises the output by exactly that much
+    auto run = [] (const EffectParams& q, float level) {
+        auto fx = makeEffect (EffectKind::ridgeStrip);
+        fx->prepare (48000.0);
+        std::vector<float> l (48000), rr (48000);
+        for (int i = 0; i < 48000; ++i) l[(std::size_t) i] = rr[(std::size_t) i] = level * (float) std::sin (2.0 * 3.14159265358979 * 1000.0 * i / 48000.0);
+        for (int at = 0; at < 48000; at += 512)
+            fx->process (l.data() + at, rr.data() + at, std::min (512, 48000 - at), q, 120.0);
+        return std::make_pair (l, rr);
+    };
+    const auto off = run (p, 0.3f).first;
+    p[r::autoMakeup] = 1.0f;
+    const auto onOut = run (p, 0.3f).first;
+    CHECK (std::abs (20.0 * std::log10 (p147b::peakOf (onOut) / p147b::peakOf (off)) - mk) < 0.01);
+    // ANALOG [EXEC]: white noise at −110.7 dBFS RMS per channel, uncorrelated; off = digital silence
+    auto q = makeEffectSlot (EffectKind::ridgeStrip).params;
+    const auto silent = run (q, 0.0f);
+    CHECK (p147b::peakOf (silent.first) == 0.0);
+    q[r::analog] = 1.0f;
+    const auto noisy = run (q, 0.0f);
+    double sl = 0.0, sr = 0.0, slr = 0.0;
+    for (std::size_t i = 4800; i < noisy.first.size(); ++i)
+    {
+        sl += (double) noisy.first[i] * noisy.first[i];
+        sr += (double) noisy.second[i] * noisy.second[i];
+        slr += (double) noisy.first[i] * noisy.second[i];
+    }
+    const auto count = (double) (noisy.first.size() - 4800);
+    CHECK (std::abs (10.0 * std::log10 (sl / count) + 110.73) < 0.3);
+    CHECK (std::abs (10.0 * std::log10 (sr / count) + 110.73) < 0.3);
+    CHECK (std::abs (slr / std::sqrt (sl * sr)) < 0.03);
+    // the E voicing gets the same noise
+    q[r::voicing] = 1.0f;
+    CHECK (p147b::peakOf (run (q, 0.0f).first) > 1e-6);
+}

+ 1 - 1
tests/Substitutes113Tests.inc

@@ -221,7 +221,7 @@ TEST (waves_vocal_states_translated_round113)
         int n = 0;
         const auto s = slotFor ("SSLChannel", "-1.3 1.8 1 0.35 * -30 0 0 0 0.2 * 0 0 0 -6 60 0 0.5 2.5 3 3.5 1.5 0 4.8 10.16 0 0 116 30 1 0 0 * * 1 * * 7 -18 0 0 * * * * * * -18 -18 -18 -18 -18 -18 -18 -18 0 0", n);
         namespace r = mixsuite::ridge;
-        CHECK (n == 30 && s.kind == EffectKind::ridgeStrip && s.params[r::voicing] == 1.0f);
+        CHECK (n == 31 && s.kind == EffectKind::ridgeStrip && s.params[r::voicing] == 1.0f);
         CHECK (std::abs (r::hfHz (s.params[r::hfFreq]) - 10160.0) < 1.0 && std::abs (r::bandGainDb (s.params[r::hfGain], false) - 4.8) < 0.01);
         CHECK (s.params[r::order] == 1.0f && s.params[r::compFastAttack] == 1.0f && s.params[r::eqOn] == 1.0f && s.params[r::dynOn] == 1.0f);
     }

+ 1 - 1
tests/VoiceMatchTests123.inc

@@ -50,7 +50,7 @@ TEST (ssl_e_channel_matched_voicing_round123)
     namespace r = mixsuite::ridge;
     int n = 0;
     auto s = vm123::wavesSlot ("SSLChannel", vm123::herSsl, n);
-    CHECK (n == 30 && s.kind == EffectKind::ridgeStrip);
+    CHECK (n == 31 && s.kind == EffectKind::ridgeStrip);
     CHECK (s.params[r::voicing] == 1.0f && s.params[r::filterSplit] == 1.0f && s.params[r::order] == 1.0f);
     CHECK (std::abs (r::hpfHz (s.params[r::hpf]) - 116.0) < 0.01 && std::abs (r::eQ (s.params[r::hmfQ]) - 1.5) < 1e-3);
     CHECK (std::abs (r::eCompThresholdDb (s.params[r::compThreshold]) + 1.3) < 1e-3 && std::abs (r::ratio (s.params[r::compRatio]) - 1.8) < 1e-3);

+ 3 - 0
tests/tests.cpp

@@ -15808,6 +15808,9 @@ TEST (plugin_layout_options_match_the_engine_values)
 #include "Parity144Tests.inc"
 #include "Parity144aTests.inc"
 #include "Parity144bTests.inc"
+#include "Parity147Tests.inc"
+#include "Parity147aTests.inc"
+#include "Parity147bTests.inc"
 #include "Patcher141Tests.inc"
 #include "Vox138Tests.inc"
 #include "Vox145Tests.inc"