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

Merge origin/main (Facet EQ, FL panels, vocal level, playlist groups) into feature/dyn108

Resolve the substitutes table (Pro-C -> Crest Compressor keeps round 107's
Auto gain=1 preset on top of the Pro-C 3 translator), the generic editor's
display hit-test and drag end (Prism/Ember bands + bars) and regenerate
I18nData.h from the merged pt-BR.txt.
Ka1-S 1 месяц назад
Родитель
Сommit
9805e5a133
63 измененных файлов с 5180 добавлено и 594 удалено
  1. 1 0
      CMakeLists.txt
  2. 120 0
      docs/analise/REA_rodada104.md
  3. 68 0
      docs/analise/REA_rodada105.md
  4. 116 0
      docs/analise/REA_rodada107.md
  5. 139 5
      resources/i18n/pt-BR.txt
  6. 1 1
      scripts/build-local.sh
  7. 1 1
      scripts/build-windows-zig.sh
  8. 77 0
      src/Main.cpp
  9. 3 0
      src/core/ConvolverFx.cpp
  10. 2 0
      src/core/ConvolverFx.h
  11. 29 3
      src/core/Effects.cpp
  12. 4 0
      src/core/Effects.h
  13. 25 1
      src/core/EquoFx.cpp
  14. 1 0
      src/core/EquoFx.h
  15. 4 0
      src/core/FlEffects.cpp
  16. 22 5
      src/core/FlpImport.cpp
  17. 90 1
      src/core/FruityDelayBank.cpp
  18. 2 0
      src/core/FruityDelayBank.h
  19. 2 1
      src/core/HardcoreFx.cpp
  20. 3 2
      src/core/History.cpp
  21. 9 1
      src/core/Instruments.cpp
  22. 1 0
      src/core/KeyMap.cpp
  23. 19 1
      src/core/MultibandDelayFx.cpp
  24. 87 0
      src/core/NoteEdit.cpp
  25. 11 0
      src/core/NoteEdit.h
  26. 58 8
      src/core/PluginLayout.cpp
  27. 10 3
      src/core/PluginLayout.h
  28. 590 0
      src/core/PluginLayoutFx.inc
  29. 24 0
      src/core/PluginScanPolicy.h
  30. 6 1
      src/core/PluginSubstitutes.cpp
  31. 4 3
      src/core/RackRenderer.cpp
  32. 4 1
      src/core/Scheduler.cpp
  33. 6 1
      src/core/Scheduler.h
  34. 10 2
      src/core/Song.cpp
  35. 13 1
      src/core/Song.h
  36. 38 0
      src/core/StateHandoff.h
  37. 486 0
      src/core/StateParams.cpp
  38. 46 0
      src/core/StateParams.h
  39. 1 0
      src/core/Vocodex.cpp
  40. 1 0
      src/core/Vocodex.h
  41. 80 3
      src/engine/PluginHost.cpp
  42. 1 1
      src/engine/PluginHost.h
  43. 40 1
      src/engine/ProjectFile.cpp
  44. 24 0
      src/flp/Flp.cpp
  45. 5 0
      src/flp/Flp.h
  46. 270 66
      src/ui/ChannelRackComponent.cpp
  47. 15 0
      src/ui/ChannelRackComponent.h
  48. 536 274
      src/ui/I18nData.h
  49. 7 0
      src/ui/Icons.cpp
  50. 3 2
      src/ui/Icons.h
  51. 52 1
      src/ui/MainComponent.cpp
  52. 22 0
      src/ui/MainComponent.h
  53. 486 27
      src/ui/MixerComponent.cpp
  54. 27 4
      src/ui/MixerComponent.h
  55. 506 107
      src/ui/PlaylistComponent.cpp
  56. 36 8
      src/ui/PlaylistComponent.h
  57. 77 57
      src/ui/PluginEditors.cpp
  58. 343 0
      src/ui/PluginEditorsFx.inc
  59. 214 0
      tests/PanelsTests105.inc
  60. 76 0
      tests/UiFl104Tests.inc
  61. 199 0
      tests/VocalLevel107Tests.inc
  62. 4 1
      tests/tests.cpp
  63. 23 0
      tools/renderwav.cpp

+ 1 - 0
CMakeLists.txt

@@ -31,6 +31,7 @@ add_library(lynx_core STATIC
     src/core/PluginSubstitutes.cpp
     src/core/Preferences.cpp
     src/core/PluginLayout.cpp
+    src/core/StateParams.cpp
     src/core/FlEffects.cpp
     src/core/Effector.cpp
     src/core/FlSamplers.cpp

+ 120 - 0
docs/analise/REA_rodada104.md

@@ -0,0 +1,120 @@
+# REA round 104 ("flui104"): FL Studio screens, round 2 - Playlist groups, Channel Rack filters, Mixer panel
+
+Continues docs/analise/UI_STUDY_round90.md (items 6, 8, 9 of its table). Clean-room: only layouts, behaviour and
+file fields are compared and described in our own words; LYNX keeps its own dark, flat, red-accent look. No FL
+artwork, icons or code were copied. FL captures stay outside the repository (`tmp/flui104/flref`).
+
+## Method
+
+- [EXEC] FL Studio 2026 (FL64.exe, 25.2.3 demo project files) opened `Ookay - Thief.flp` at 1920x1080; screens and
+  menus captured with a CopyFromScreen helper (right-click and key support added: `tmp/flui104/fl.sh`), under
+  `~/.cache/lynx-fl.lock`, one FL instance.
+- [EXEC] Hints read from FL's hint bar while hovering each control (mixer panel).
+- [DATA] FLP fields located by toggling one thing in FL, saving a copy and diffing the events
+  (`tmp/flui104/py/tracks.py`, `chev.py`): collapsed vs expanded group; channel filter groups matched against
+  the channels FL lists under each filter.
+- [EXEC] LYNX `--snapshot` of the same project (before: main 5dcca34; after: this branch).
+
+## Findings
+
+### Playlist (FL)
+
+- Track header layout: name on the left, a track icon, for a group header a fold arrow (up = open, down =
+  folded), and the mute LED on the far right; the selected track is marked next to the LED. Group members are
+  indented under their header and the whole group sits on one rounded block in the header's colour.
+- A folded group keeps its header; each member shrinks to a thin row (about 7 px at 1920x1080) that still shows
+  its clips as thin bars in the grid.
+- Click on a header selects the track (clips are not selected); double click opens the source of the track's
+  clip (here the pattern in the Piano Roll); the LED mutes; muting a group header greys only the header.
+- Track menu (FL order): Rename, color and icon... / Change color... / Random color / Change icon... / Auto name /
+  Auto name clips / Reset | Track mode > / Performance settings > | Size > (33, 50, 100, 150, 200 %) / Lock to
+  this size | Group with above track / Ungroup (disabled on a header) / Auto color group / Collapse grouped
+  tracks | Current clip source > (the track's pattern sources) / Lock to content / Merge clips / Consolidate
+  track(s) > / Mute all clips / Unmute all clips | Show ghost notes | Insert one / Clone... / Delete | Move up /
+  Move down.
+- Picker (left column): three exclusive tabs at the top (patterns, audio clips, automation clips), one list per
+  tab; pattern boxes show a faint miniature of the notes; "+" at the bottom of the pattern list; right click on a
+  pattern opens the pattern menu (Find first empty..., Rename and color..., Clone, Delete, Move up/down,
+  Split by channel, render items...). Selecting a clip of another kind switches the tab.
+
+### Playlist track record 0xEE (FLP) [DATA]
+
+70 bytes in FL 20+ projects (offsets from the start of the record):
+
+| offset | size | meaning | evidence |
+|---|---|---|---|
+| 0 | u32 | track index, 1-based | round 90 |
+| 4 | u32 | colour 0x00BBGGRR | round 90 |
+| 8 | u32 | icon index (BASSES 1, VOCALS 0x1E, FX 0x73...) | values differ per group header; meaning of each value not confirmed |
+| 12 | u8 | enabled (0 = muted) | round 90 |
+| 13 | f32 | size, 1.0 = 100 % | FL's Size menu ticks 100 % on all Thief tracks; other values not confirmed by a save |
+| 30 | u32 | trigger sync (5 = "4 beats") | matches the Performance settings submenu of the captured track |
+| 38 | u32 | tolerant (1) | ticked in the same submenu |
+| 46 | u8 | grouped with the track above | 0 on DRUMS, MELODICS, BASSES, VOCALS, FX, TEMPO and the empty tracks, 1 on every member |
+| 61 | u8 | group expanded | 1 -> 0 when FL collapsed BASSES and saved (only byte that changed in the record) |
+
+Other bytes: not confirmed. A grouped track belongs to the nearest ungrouped track above it (the header).
+
+### Channel Rack (FL)
+
+- Title bar: options arrow, a filter-group box ("All"), the title, the swing knob, ..., the graph editor and step
+  view switches, close.
+- The filter box lists "All", then the project's groups (Thief: Audio, Automation, Unsorted); choosing one shows
+  only those channels. "Group selected..." (Alt+G, in the rack's options menu) asks for a "Filter group name"
+  and puts the selected channels in it.
+- FLP [DATA]: event 0xE7 (text) = one filter group name, in order; event 0x91 (u32, in each channel's section) =
+  the channel's group index. Checked on Thief: the channels FL lists under "Audio" have 0, the automation
+  channels 1, Synth Bass / Saw Bass / White Noise / Piano Dark 2.
+- Channel menu (two columns): left - Piano roll / Graph editor | Rename, color and icon... / Change color... /
+  Random color / Change icon... | Load sample... / Cut itself / Show waveform preview | Insert > / Replace > /
+  Patcherize / Clone / Delete... | Assign to new instrument track; right - Cut / Copy / Paste | Fill each 2 / 4 /
+  8 steps / Advanced fill... / Auto fill | Rotate left / Rotate right | MIDI channel through / Receive notes
+  from > | Create DirectWave instrument... / Burn MIDI to >.
+
+### Mixer side panel (FL)
+
+Top to bottom: input row (an icon "Select what is included when recording audio", the input box "(none)",
+"Input latency"); 10 slot rows, each an options arrow ("FX slot N options"), the name ("Slot N" in grey italics
+when empty; "Effect slot N"), a mix knob ("Mix level: 100%") and an LED ("Mute / solo"); the built-in EQ: a
+response graph ("Tweak band N" - its handles drag), three level faders ("EQ band 1 (low shelf) level: 0.0dB"),
+a row of frequency knobs ("EQ band 1 (low shelf) freq: 90Hz") and a row of width knobs ("width: 0.27") with the
+label "Equalizer"; "Track latency"; the output box ("Audio output target": "Out 1 - Out 2" on Master).
+The slot arrow menu: Replace > / Delete... / Patcherize / presets / spare state / parameters / CPU / Move up /
+Move down / View editor / Rename, color and icon... / Change color... / Random color / Change icon... / Scaling >
+/ Help.
+
+## What LYNX does now (this round)
+
+- Model: `PlaylistTrack::grouped` / `collapsed`; `Song::channelGroups`, `ChannelDef::group`; imported from the
+  FLP (0xEE offsets 13, 46, 61; 0xE7; 0x91) and kept in .lynx (`playlistTrackGroups`, `channelGroups`,
+  channel `group`). Group rules in `core/NoteEdit` (`isGroupHeader`, `groupHeaderOf`, `groupMembers`,
+  `isFoldedAway`, `groupWithAbove`, `ungroupTrack`, `setGroupCollapsed`, `colourGroup`).
+- Playlist: FL's header layout (name, fold arrow, LED on the right, accent mark on the selected track), group
+  blocks and indented members, folded members as 7 px rows with clip bars; click selects, double click opens
+  the source of the track's first clip (empty track: rename); the track menu in FL's order with the items LYNX
+  can do (no icons, track modes, performance settings, ghost notes, consolidate, lock to content, merge clips).
+  Size is relative to LYNX's default row (38 px). The Picker has FL's three tabs, note miniatures, "+" and the
+  pattern menu on right click; it follows the pencil's source kind.
+- Channel Rack: the title bar holds the filter box, the swing knob and a graph editor switch (new `Icon::graph`);
+  rows outside the filter are hidden; new channels join the group shown; Alt+G "Group selected..."; the filter
+  menu also moves the selection to a group, renames or deletes the shown group. Channel menu in FL's two-column
+  order (Cut / Copy / Paste of the channel's notes, Cut itself = the channel's own cut group); LYNX's extras
+  (settings windows, arpeggiator, swing mix, sort, send to inserts) stay in their places.
+- Mixer: slots always show their arrow, name or "Slot N", mix knob and LED (FL's order); the arrow opens the slot
+  menu; under LYNX's inline knobs, the built-in 3-band EQ (graph with draggable band handles drawn with the
+  mixer's own filters, level faders, frequency and width knobs) and the output target box (Master: the device's
+  first active output pair; inserts "(none)").
+- Tests: `flui104_track_group_rules`, `flui104_flp_track_groups_and_filter_groups`; selftest round trip of
+  groups and filter groups.
+
+Not done (FL items without a LYNX counterpart, or left for later): track icons, track modes/performance
+settings, "Lock to this size", the mixer's input/track latency fields, per-insert device outputs.
+
+## Where I stopped / next steps
+
+- Pieces 1-3 implemented and checked: build-local with the FL Data dir 1 175 200 checks, 0 failures; Windows build;
+  snapshots of Thief (`lynx-test/flui104/after1`: `s-playlist`, `s-playlist-group-folded`, `s-playlist-picker-audio`,
+  `s-rack-filter`, `s-mixer`) side by side with FL's (`tmp/flui104/flref`).
+- Next candidates: track icons (0xEE offset 8, an icon set of LYNX's own), FL's "Lock to this size", dragging a
+  header to reorder tracks, the mixer's track latency field, mixer strip names / compact height (round 90 item 10),
+  the rack's step-view / keyboard-view switch.

+ 68 - 0
docs/analise/REA_rodada105.md

@@ -0,0 +1,68 @@
+# Round 105 — FL arrangements for the remaining native plugin windows
+
+Follows docs/analise/UI_STUDY_plugins93.md (method, layout system, §3 "adding a plugin page"). Clean-room: positions
+measured on FL Studio 2026 captures (kept in `tmp/r93/flref`, `tmp/r105/flref`, never in the repository); LYNX draws
+everything with its own vector controls. Fruity Phaser and Fruity Send engines: separate notes
+(`REA_rodada105_phaser.md`, `REA_rodada105_send.md`).
+
+## 1. Controls stored in the slot state (`core/StateParams.{h,cpp}`)
+
+FL's Delay Bank, Multiband Delay, EQUO, Convolver (and Maximus, round 93) keep most settings in the saved plugin state,
+which LYNX carries in `EffectSlot::state`. Round 93 edited Maximus' state through a Maximus-only table; this round
+generalises it: `stateparams::tableFor (kind)` lists each state control (name, FL raw range and default) with `get`,
+`with` (the state with one value replaced, clamped) and `text`. The editor numbers them after the effect's own
+parameters (`plugui::paramIndex`, `stateIndex`, `stateValue01`, `stateRaw`), so layouts name them like any parameter.
+State controls are not automatable.
+
+| Effect | State controls | Index layout |
+|---|---|---|
+| Maximus | 59 (unchanged) | as `maximusfx::stateParams` |
+| Fruity Delay Bank | 8 banks × (16 controls + 11 options) + solo + oversampling | bank b from 27·b: controls `4 + 16·b + k`, then filter 1/2 type and order, filter 1 post, mode, steps, shape, on, tap, sync |
+| Multiband Delay | 8 banks × 3 targets × 16 bands + target + bank | FL's own `bank·48 + target·16 + band` |
+| EQUO | 9 banks × 31 bands × 3 targets (thousandths of FL's 0…2 cells) | FL's table order `(bank·31 + band)·3 + target` |
+| Vocodex | its 20 controls, hold mode, order, unison, bands, draft, MOD / CAR inputs, the eight switches | patched in place at the controls block of FL's state (`vocodex::State::paramsAt`), the install-data trailer kept |
+| Fruity Convolver | predelay, self-convolution blend, stretch, EQ amount, normalise | knobs 1…4 and flag 3 of the FL state inside the slot blob |
+
+Vocodex ranges are FL's form values of REA_rodada20 §4.2.2; attack / release curve (0…2000), mod band width (0…4000),
+unison pitch (0…1000) and unison pan (0…256) are **not confirmed** (chosen around the installation presets' values:
+Default.fst has 0, 0, 2000, 250, 128). Vocodex's 2026 build creates its panel in code (no form resource), so its
+control positions come from the capture only.
+
+Unknowns: the upper end of Delay Bank's DIV (pattern steps) fader is **not confirmed** (0…16 used; the installation's
+presets use 0…13).
+
+### Live edits
+`Effect::acceptState (bytes)` (new, default false): when only a slot's state changed, `RackRenderer::build` offers the
+new state to the running effect instead of rebuilding it, so delay lines and filters keep running while a control is
+dragged. The hand-off is a single-slot lock-free mailbox (`core/StateHandoff.h`) taken at the start of `process()`.
+- Delay Bank: bank controls 4…130 go through the engine's `setControl` (FL's ProcessParam); option, solo or
+  oversampling changes rebuild the engine (as FL re-initialises the bank).
+- Multiband Delay: the cells whose engine value changed go through `setParameter` (FL's parameter path).
+- EQUO: `Engine::setBands` takes the new table and recomputes the band targets (they glide through the smoother).
+- Convolver and Maximus rebuild (their kernels / presets are derived from the whole state).
+
+## 2. Arrangements (FL Studio 2026, measured)
+
+| Plugin | Body | Arrangement |
+|---|---|---|
+| Fruity Vocoder | 416 × 306 | FREQ (FORM fader, MIN, MAX, SCALE, BW, INVERT) · ENV (ATT, REL) · MIX (L / R input buttons = swap, three listen LEDs = modulator / carrier / mix, MOD, CAR, WET faders); band display with HOLD, BANDS 4…128, FILTER 1…3. Side inputs in the options menu |
+| Frequency Splitter | 776 × 340 | band graph; CROSSOVER (slope stepper, FREQ, BANDS 3, FREQ, slope) · MAIN OUT (low / mid / high level + switch) · SENDS (output switch, level, mute per band); LINEAR PHASE, PRECISION, SPEED. Solos in the options menu (FL: behind the arrow buttons, not confirmed) |
+| Fruity Delay Bank | 583 × 278 | bank LEDs (on) and tabs 1…8 (pages), OVERSAMPLE, DRY / WET / IN / FB; per bank IN · FILTER (type menu, sections 1–3, POST, GAIN, CUT, RES) · FEEDBACK (tap, T, OFF / NORM / INV / P.PONG, TIME / OFS / SEP faders, PAN, VOL) · FB FILTER · GRAIN (DIV, SH) · OUT (NEXT, PAN, VOL) |
+| EQUO | 572 × 245 | graphic EQ bars (31 bands of the selected bank and target, drawn by dragging), BANK M / 1…8, VOL / PAN / SEND; MORPH (SHIFT, MIX, MORPH, SMOOTH, VOL), SETUP (SEND ONLY, ADD MODE, OVERSAMPLE, BW) |
+| Multiband Delay | 568 × 292 | 16 bars (selected bank / target, drawn by dragging) with the crossover frequencies; DELAY / VOL / PAN, BANK 1…8; GENTLE / STEEP / LINEAR PHASE · SCALE (×0.1, harmonic, weighted), FEEDBACK · SMOOTHING TIME, KEEP PITCH · MORPH · WET (COMP / SAT / CLIP), HP · MIX |
+| Fruity Convolver | 722 × 300 | dry, in (separation), wet, wet (separation), delay, self-conv, stretch, eq; NORMALIZE; impulse info and waveform. FL's sample-editor toolbar and its equalizer page are not reproduced |
+
+| Pitch Shifter | 744 × 280 | VOICE / MUSIC side tabs (the engine switch, `Granular`), the pitch graph (VOICE: an X/Y pad formant × pitch, **not confirmed** as FL's pad mapping); VOICE: PITCH, FORMANT faders, FORMANT CORRECTION, PITCH ANALYSIS (relative / C4…C6, fast / accurate, left / right / both); MUSIC: PITCH, DURATION faders, DENSITY, JITTER, RAND; DELAY (delay and feedback faders, T, OFF / POST / PRE / NO SHIFT); MIX. Value plates above the faders |
+| Effector | 436 × 412 | input and output GAIN on the title strip; X PARAM, Y PARAM, BYPASS, DRY/WET; X/Y pad; the tempo divisions 8/1…1/8 (Mod rate); X MOD, Y MOD, LFO shape, TEMPO; the twelve effect buttons |
+| Hardcore | 772 × 475 | INPUT, OUTPUT; EQ on + 8 band faders (125 Hz…16 kHz); CABINET (none, model A…T); five pedal boxes: LED (on), the knobs of the selected pedal with that pedal's captions (read off FL's pedal artwork: e.g. Distortion = DIST, COMB, INFERNO, GLASS; Phaser = SPEED, TUNE, WIDTH, INTENSITY), pedal type menu. FL's .hdprg preset browser is not reproduced. Hardcore's three unused parameters are now named `(unused 12/38/44)` (they all were `(unused)`) |
+| Vocodex | 598 × 600 | Mixer (WET, SG, MOD, CAR, +NOISE, the MOD HP / CAR LP / NOISE HP knobs, MOD / CAR input numbers, L-R ENCODING), Contour (from car / consonants, to mod / noise), DRAFT, THREADED; envelope follower (HOLD, ATT, REL, their curves, PEAK / RMS, MIN TIMES, freeze), ORDER, band width, mod band width, mod pitch, unison, flatness, unison pitch / pan, bands; the band gain map (read-only) and the carrier. FL's map editor and carrier patch browser are not reproduced |
+
+Also: `flPluginsForEffect` now names Fruity Vocoder, Vocodex, Effector and Frequency Splitter, so their windows' presets
+bar lists the installation's FL presets.
+
+## Where I stopped / next steps
+- Done: state-param tables (Maximus, Delay Bank, Multiband Delay, EQUO, Convolver, Vocodex) + live edits, the ten
+  arrangements above, tests (`tests/PanelsTests105.inc`), pt-BR strings.
+- Fruity Phaser and Fruity Send engines: separate pieces (see their notes).
+- Open: EQUO / Multiband Delay band modes (the per-band lock / off caps), EQUO's send target, Vocodex map editing,
+  Convolver's EQ page and IR editing, Hardcore presets (.hdprg).

+ 116 - 0
docs/analise/REA_rodada107.md

@@ -0,0 +1,116 @@
+# REA round 107: vocals quieter in LYNX than in FL (user projects)
+
+User report: whenever the user's girlfriend opens one of her vocal projects in LYNX, the voice is much quieter than
+in FL Studio. Goal: find the cause, fix it generally, verify within ~0.5 dB of FL on the vocal sections.
+
+## 1. Her projects and her setup
+
+[DATA] The projects she opened in LYNX (LYNX `recentes.txt`): `kwe.flp` (FL 24.2.2), `luisa sonsa.flp` (FL 25.2.5),
+`game over.flp` (FL 25.2.5), each in its own folder with the beat stems and her vocal takes (`untitled_<date>_Insert
+N.wav`: 44.1 kHz stereo float, both channels identical, raw level about −20 dBFS RMS). Every vocal take goes to an
+insert with the same vocal chain (her "PRINCIPAL" preset): Auto-Tune Pro, Waves SSL E-Channel, NS1, Renaissance
+Compressor, DeEsser, CLA-2A, (Fresh Air), with sends to an FX insert (H-Delay, Doubler2, Reeverb 2, Filterverse,
+Stereo Enhancer, Decapitator). `luisa sonsa` uses UADx Neve 1073 / 1176 / LA-2A, Pro-Q 4, Pro-DS, Decapitator,
+ValhallaVintageVerb, Waves Tune and NS1 instead.
+
+[DATA] LYNX's plugin list on her laptop (`%APPDATA%\LYNX\plugins.xml`): 136 plugins, but the only Waves entries are
+"L4 Ultramaximizer" from `WaveShell1-VST3 16.3_x64.vst3`; `WaveShell1-VST3 16.0_x64.vst3` — the shell that holds her
+whole Waves bundle — is in the BLACKLISTED list. So none of the Waves plugins of her vocal chain could be hosted:
+LYNX played its substitutes (round 98) in their place, with the Waves settings not translated.
+
+## 2. Cause 1: a Waves shell is "hung" for LYNX's plugin scan
+
+[SRC JUCE 8.0.4, our own dependency] `VST3PluginFormat::findAllTypesForFile` has a fast path (the bundle's
+`moduleinfo.json`) and a slow path that creates and initialises every audio-effect class of the module's factory to
+read its bus layout. A Waves shell has no moduleinfo.json and declares one class per Waves plugin (hundreds for a
+bundle). LYNX scans each file in a child process and killed it after a fixed 30 s, then blacklisted the file as hung.
+
+Fix: the scan child first loads the module, asks its factory how many classes it has and writes that number next to
+its result file; the parent then waits `30 s + 2 s × (classes − 1)` (capped at 45 min) instead of 30 s
+(core/PluginScanPolicy.h). Files blacklisted by older versions are retried once (`scan-retry.txt` marker).
+
+## 3. Cause 2 (the main one): FL's route levels follow the fader curve, up to +5.6 dB
+
+[EXEC] FL 26.1.7 command-line renders on her laptop (`FL64.exe /R /Ewav`) of `kwe.flp` variants with only her vocal
+takes audible (every other channel at volume 0), compared per 10 s window with LYNX renders of the same files:
+
+    variant                                              FL 60-70 70-80 80-89 s     LYNX 60-70 70-80 80-89 s
+    vocal chain as saved                                    -14.1 -13.4 -14.3          -27.8 -28.4 -29.2  (Waves substituted)
+    vocal inserts emptied (no plugins at all)               -14.4 -13.5 -14.8          -25.9 -25.2 -26.5
+    + FX insert emptied                                     -10.6  -9.8 -10.8          -22.0 -21.5 -22.5
+    vocal channels routed straight to Master                -16.2 -16.0 -17.2          -16.5 -16.6 -17.6
+
+With no plugin in the path the difference is a constant gain of 3.6 (11.1 dB; aligned at lag 0, same for every
+take), and it disappears when the channels go straight to Master: it is in the routing. [DATA] Her vocal insert
+(10, "VOZ 1") routes only to her FX insert (11), which routes to Master; both route levels (0xE1, parameter
+0x2000 + destination; 0x1F40 + destination before FL 24.2.99) are 16000. LYNX read a route level as
+`value / 12800` clamped to 1 (so 16000 = 0 dB) and had no level at all for the route to Master.
+
+[EXEC] Same variant (FX insert emptied), one value changed at a time, FL level change in the vocal sections:
+route 10→11 at 12800: −5.6 dB; at 6400: −18.3 dB (−12.7 dB from 12800); route 11→Master at 12800: −5.6 dB, at 6400:
+−18.3 dB. The fader curve g = (11^(1.25·v/16000) − 1)/10 gives exactly +5.6 dB at 16000, 0 dB at 12800 and −12.7 dB
+at 6400. So both route kinds are fader-curve levels with FL's fader range (0 dB at 80 %, +5.6 dB at the top).
+(Insert faders 10795→12800 and 12245→12800 moved FL by +4.0 and +1.3 dB, the curve says +3.7 and +1.0; within
+0.3 dB, not investigated further.)
+
+Fix: `MixerSend::level` is a linear gain up to `maxFaderGain` (+5.6 dB) and the import maps a route level through
+`faderGain (value / 16000)`; new `MixerTrack::masterLevel` (route to Master, same mapping, rendered by
+RackRenderer, saved in .lynx as `masterLevel`). The mixer's send knob now works in fader positions (0 dB at 80 %,
+text in dB), like FL's. Projects whose routes are at the default 12800 (or without level records, like the FL 26
+song of round 92b) are unchanged.
+
+## 4. Cause 3: a compressor substitute without makeup gain
+
+On her laptop neither FL nor LYNX has Renaissance Compressor / DeEsser / Doubler (her projects were saved with
+WaveShell 15.5, the laptop has 16.0, which lacks them): FL leaves those slots empty. LYNX plays its substitutes, and
+the Renaissance Compressor one (LYNX Compressor at its defaults, −18 dB 4:1, no makeup, since the Waves settings are
+not translated) took another 4.4 dB off the vocal (LYNX k3 → k4 renders). The compressor got an "Auto gain" switch
+(slow in/out power match, ±12 dB) and the compressor substitutes (Renaissance Compressor, other Waves compressors,
+Pro-C) turn it on: they shape dynamics but keep the level.
+
+## 5. Cause 4: overlapping clips of one vocal take silenced each other
+
+[DATA] Her comps cut one take into several clips of the same channel that overlap by a few ticks with FL's automatic
+crossfade (fade-in/out 86.5 ms), e.g. `kwe` items at ticks 12096–12336 and 12318–12720 of channel 5. [EXEC] FL plays
+both; LYNX was silent from 59.3 s to 61.0 s: the scheduler sends every audio clip of a channel with the same key and the
+audio-clip sampler stopped ALL its voices on any clip end, so the first clip's end killed the second clip. Fix: an
+audio clip's events carry its own key (`audioClipKey (playlist index)`, above the MIDI range) and a clip end fades only
+that clip's voice (other callers, key < 128, still stop everything).
+
+## 6. Notes on the references
+
+- FL's command-line render on her laptop runs in the SSH (non-interactive) session, where the Waves plugins pass the
+  audio through unchanged (renders with only Auto-Tune and with the whole chain differ by −69 dB). So FL references
+  with the Waves chain are not valid there; the routing/level findings above were measured without plugins in the
+  vocal path. LYNX hosting the Waves plugins in the same session does process them.
+- FL's "Problems loading the project" dialog is a hidden window in that session; `okdlg2.ps1` (tmp/r107) closes it
+  with WM_CLOSE.
+
+## 7. Other differences seen (not the vocal level)
+
+- `kwe`: the beat stems' last clips (start offset 77 s into 106 s stems, 73.3 → 88.6 s) stop at 78 s in LYNX, play to
+  the end in FL (FL −12.7 dB in 80–89 s without vocals, LYNX silent). Channel has 0xD7 TIME 140 (→ stretchBeats 0.73),
+  mode 1, and the wav has `acid`/`smpl` chunks. Not investigated yet.
+- `game over` / `luisa sonsa`: only 1–2 playlist tracks are enabled (byte 12 of 0xEE); her other tracks are muted in
+  the file (only her mixdown / the beat play). LYNX does the same as the file says.
+- Insert faders: FL moved +4.0 / +1.3 dB where LYNX's fader curve says +3.7 / +1.0 dB (two measurements). Open.
+
+## 8. Result on `kwe` (vocal takes only, dB RMS per 10 s window, 50–89 s)
+
+    variant                         FL (her laptop)              LYNX before                  LYNX now (renderwav)
+    vocal inserts emptied           -22.1 -14.4 -13.5 -14.8      -40.8 -25.9 -25.2 -26.5      -22.1 -14.4 -13.5 -15.3
+    + FX insert emptied             -18.1 -10.6  -9.8 -10.8      -36.9 -22.0 -21.5 -22.5      -18.1 -10.5  -9.8 -11.3
+    straight to Master              -24.6 -16.2 -16.0 -17.2      -32.3 -16.5 -16.6 -17.6      -24.6 -16.2 -16.0 -17.6
+
+Every window within 0.1 dB except the last one (0.4–0.5 dB, the song's end).
+
+## Where I stopped / next steps
+- Landed (see the commit). Verified on her laptop with the Windows build: `kwe` vocal path without plugins within
+  0.1 dB of FL in 50–80 s (0.6 dB in the last window); with the FX insert 0.3–0.5 dB.
+- Her LYNX settings were restored after the tests (plugins.xml from the backup, no scan-retry marker), so the update
+  itself retries the Waves shell scan.
+- Open: the `kwe` stems stopping at 78 s (§7), the 0.3 dB insert-fader residue (§7), the Waves chain cannot be
+  checked against FL's command-line render on her laptop (§6); demo regression baselines may move where a project
+  has route levels other than 12800 (now on FL's fader curve).
+- Tools: export report lines plugin_found / plugin_missing / insert chains; `--find-plugins`; renderwav
+  LYNX_SUBSTITUTES=1 / LYNX_DISABLE="t.k".

+ 139 - 5
resources/i18n/pt-BR.txt

@@ -2269,17 +2269,154 @@ countries: br
 "TARGET NOTES" = "NOTAS-ALVO"
 "MIDI channel" = "Canal MIDI"
 
+# --- Round 104: Playlist track groups and Picker tabs, Channel Rack filter groups, Mixer EQ and output
+"Put the selected channels in a new filter group" = "Colocar os canais selecionados num novo grupo de filtro"
+"Group selected..." = "Agrupar selecionados..."
+"(no group)" = "(sem grupo)"
+"Move selected channels to" = "Mover os canais selecionados para"
+"Rename this group..." = "Renomear este grupo..."
+"Filter group name" = "Nome do grupo de filtro"
+"Delete this group (keeps its channels)" = "Excluir este grupo (mantém os canais)"
+"Group {0}" = "Grupo {0}"
+"Graph editor" = "Editor de gráfico"
+"Change color" = "Mudar cor"
+"Random color" = "Cor aleatória"
+"Load sample..." = "Carregar sample..."
+"Insert" = "Inserir"
+"Replace" = "Substituir"
+"Delete..." = "Excluir..."
+"Fill each 2 steps" = "Preencher a cada 2 steps"
+"Fill each 4 steps" = "Preencher a cada 4 steps"
+"Fill each 8 steps" = "Preencher a cada 8 steps"
+"Advanced fill..." = "Preenchimento avançado..."
+"Channel filter group" = "Grupo de filtro dos canais"
+"(no audio device)" = "(sem dispositivo de áudio)"
+"Audio output target" = "Destino da saída de áudio"
+"Inserts reach the audio device through the Master" = "Os inserts chegam ao dispositivo de áudio pelo Master"
+"Slot {0}" = "Slot {0}"
+"level" = "nível"
+"frequency" = "frequência"
+"width" = "largura"
+"EQ band {0} ({1})" = "Banda {0} do EQ ({1})"
+"EQ: [LMB] drag the band's frequency and level  [Wheel] width  [2xLMB] back to 0 dB" = "EQ: [LMB] arraste a frequência e o nível da banda  [Wheel] largura  [2xLMB] volta a 0 dB"
+"Audio output target: where this insert's sound leaves LYNX" = "Destino da saída de áudio: por onde o som deste insert sai do LYNX"
+"Effect slot options: replace, move, delete..." = "Opções do slot de efeito: substituir, mover, excluir..."
+"Effect slot: click edits, double-click opens its window, the LED bypasses, drag or wheel reorders, right-click: options" = "Slot de efeito: clique edita, clique duplo abre a janela, o LED desliga, arrastar ou roda reordena, botão direito: opções"
+"Auto name" = "Nomear automaticamente"
+"Every track" = "Todas as faixas"
+"Group with above track" = "Agrupar com a faixa de cima"
+"Ungroup" = "Desagrupar"
+"Auto color group" = "Colorir o grupo automaticamente"
+"Collapse grouped tracks" = "Recolher as faixas agrupadas"
+"Current clip source" = "Fonte de clipe atual"
+"Mute all clips" = "Silenciar todos os clipes"
+"Unmute all clips" = "Reativar todos os clipes"
+"Insert one" = "Inserir uma"
+"Track group: [LMB] collapse / expand the grouped tracks" = "Grupo de faixas: [LMB] recolhe / expande as faixas agrupadas"
+"Track: [LMB] select  [RMB] menu  [2xLMB] open the clip source  [Shift][Wheel] move up / down" = "Faixa: [LMB] seleciona  [RMB] menu  [2xLMB] abre a fonte do clipe  [Shift][Wheel] move para cima / baixo"
+"Picker: patterns" = "Picker: patterns"
+"Picker: audio clips" = "Picker: clipes de áudio"
+"Picker: automation clips" = "Picker: clipes de automação"
+"[LMB] show" = "[LMB] mostrar"
+"Pattern: [LMB] paint it with the pencil  [2xLMB] open  [RMB] menu" = "Pattern: [LMB] pinta com o lápis  [2xLMB] abre  [RMB] menu"
+"Clip source: [LMB] paint it with the pencil" = "Fonte de clipe: [LMB] pinta com o lápis"
+# round 105: FL arrangements of Fruity Vocoder, Frequency Splitter, Fruity Delay Bank, EQUO, Multiband Delay, Fruity Convolver...
+"Add mode" = "Modo somar"
+"Bands" = "Bandas"
+"Bank" = "Banco"
+"Car" = "Port."
+"Comp|Sat|Clip" = "Comp|Sat|Clip"
+"Crossover" = "Crossover"
+"Delay|Vol|Pan" = "Delay|Vol|Pan"
+"Div" = "Div"
+"FB" = "FB"
+"FB filter" = "Filtro FB"
+"Form" = "Form."
+"Gentle|Steep|Linear phase" = "Suave|Íngreme|Fase linear"
+"Grain" = "Grão"
+"Linear phase" = "Fase linear"
+"Lowest|Low|Medium|High|Higher|Highest" = "Mínima|Baixa|Média|Alta|Mais alta|Máxima"
+"Main out" = "Saída principal"
+"Modulator|Carrier|Mix" = "Moduladora|Portadora|Mix"
+"Morph" = "Morph"
+"Next" = "Próx."
+"No impulse response" = "Sem resposta ao impulso"
+"Off|2x|4x" = "Desl.|2x|4x"
+"Off|Low pass|Band pass|Notch|High pass|Low shelf|Peaking|High shelf" = "Desl.|Passa-baixa|Passa-banda|Notch|Passa-alta|Shelf grave|Pico|Shelf agudo"
+"Off|Norm|Inv|P.pong" = "Desl.|Norm|Inv|P.pong"
+"Precision" = "Precisão"
+"Self-conv" = "Autoconv."
+"Send only" = "Só envio"
+"Sends" = "Envios"
+"Setup" = "Configuração"
+"Sh" = "Forma"
+"Shift" = "Desloc."
+"Slope" = "Inclinação"
+"Smoothing time" = "Tempo de suavização"
+"Vol|Pan|Send" = "Vol|Pan|Envio"
+"x 0.1" = "x 0,1"
+"(empty)|Distortion|Chorus|Flanger|Phaser|Reverb|Delay|Noise gate|Equalizer|Compressor|Modulator|Tube drive" = "(vazio)|Distorção|Chorus|Flanger|Phaser|Reverb|Delay|Noise gate|Equalizador|Compressor|Modulador|Válvula"
+"+Noise" = "+Ruído"
+"Band gain multiplier" = "Multiplicador de ganho por banda"
+"Bands - distribution" = "Bandas - distribuição"
+"Cabinet" = "Gabinete"
+"Carrier synthesizer" = "Sintetizador portador"
+"Carrier: own input" = "Portadora: entrada própria"
+"Carrier: side input {0}" = "Portadora: entrada lateral {0}"
+"Chorus" = "Chorus"
+"Comb" = "Pente"
+"Consonants" = "Consoantes"
+"Contour" = "Contorno"
+"Delay mode" = "Modo do delay"
+"Density" = "Densidade"
+"Dist" = "Dist"
+"Distortion" = "Distorção"
+"Distort|Lo-fi|Flanger|Phaser|Filter|Delay|Reverb|Stereo|Trans|Grain|Vox|Ring" = "Distorção|Lo-fi|Flanger|Phaser|Filtro|Delay|Reverb|Estéreo|Trans|Grão|Vox|Ring"
+"Dry/wet" = "Seco/molhado"
+"Envelope follower" = "Seguidor de envelope"
+"Fast|Accurate" = "Rápido|Preciso"
+"Flanger" = "Flanger"
+"Flatness" = "Planura"
+"Formant" = "Formante"
+"Formant correction" = "Correção de formante"
+"From" = "De"
+"Glass" = "Vidro"
+"Hi-damp" = "Amort. agudos"
+"Inferno" = "Inferno"
+"Intensity" = "Intensidade"
+"Jitter" = "Jitter"
+"L-R encoding" = "Codificação L-R"
+"Left|Right|Left + right" = "Esquerda|Direita|Esquerda + direita"
+"Middle" = "Médio"
+"Min times" = "Tempos mín."
+"Mod pitch" = "Afinação mod."
+"Mod width" = "Largura mod."
+"Modulator" = "Modulador"
+"Off|Post|Pre|No shift" = "Desl.|Pós|Pré|Sem desvio"
+"Pitch analysis" = "Análise de afinação"
+"Rand" = "Aleat."
+"Relative|C4|C5|C6" = "Relativo|C4|C5|C6"
+"SG" = "SG"
+"Sine|Saw|Square" = "Senoide|Serra|Quadrada"
+"Threaded" = "Multithread"
+"To" = "Para"
+"Tube drive" = "Válvula"
+"Uni. pan" = "Pan uníss."
+"Uni. pitch" = "Afin. uníss."
+"Voice|Music" = "Voz|Música"
+"X mod" = "Mod X"
+"X param" = "Parâm. X"
+"Y mod" = "Mod Y"
+"Y param" = "Parâm. Y"
 # --- Facet EQ editor and LYNX Tune pitch display (round 103)
 "LIVE PITCH" = "AFINAÇÃO AO VIVO"
 "Tilt shelf" = "Tilt shelf"
 "Zero latency" = "Latência zero"
 "Natural phase" = "Fase natural"
-"Linear phase" = "Fase linear"
 "Analyzer off" = "Analisador desligado"
 "Analyzer: pre" = "Analisador: pré"
 "Analyzer: post" = "Analisador: pós"
 "Analyzer: pre + post" = "Analisador: pré + pós"
-"Slope" = "Inclinação"
 "Dynamic range" = "Faixa dinâmica"
 "Solo band" = "Solo da banda"
 "Reset gain" = "Zerar ganho"
@@ -2347,11 +2484,9 @@ countries: br
 "High gain" = "Ganho agudos"
 "Ripple|Swell|Fold|Drift|Abyss|Vortex|Glint|Pulse|Expanse|Haze|Veil|Mist|Monolith|Eternity|Tide|Shoal|Spark|Plateau|Dusk|Mirage|Cluster|Beacon" = "Ondulação|Inchaço|Dobra|Deriva|Abismo|Vórtice|Lampejo|Pulso|Vastidão|Névoa seca|Véu|Névoa|Monólito|Eternidade|Maré|Cardume|Faísca|Planalto|Crepúsculo|Miragem|Aglomerado|Farol"
 "ms|Note|Dotted|Triplet" = "ms|Nota|Pontuada|Tercina"
-"Density" = "Densidade"
 "Warp" = "Distorção"
 "Shift mode" = "Modo de transposição"
 "Up|Up + down|Up, bright|Up + down, bright|No shift" = "Acima|Acima + abaixo|Acima, brilhante|Acima + abaixo, brilhante|Sem transposição"
-"Shift" = "Transposição"
 "Wide|Dense|Bright" = "Amplo|Denso|Brilhante"
 "Bright|Dark" = "Brilhante|Escuro"
 "Echo" = "Eco"
@@ -2366,7 +2501,6 @@ countries: br
 "Late mix" = "Mix da cauda"
 
 # --- Dynamics suite (round 108): Crest Compressor, Prism Multiband, Sentry Gate, Ember's bands
-"Bands" = "Bandas"
 "1 band|2|3|4" = "1 banda|2|3|4"
 "12 dB/oct|24 dB/oct|48 dB/oct" = "12 dB/oit|24 dB/oit|48 dB/oit"
 "B1" = "B1"

+ 1 - 1
scripts/build-local.sh

@@ -33,7 +33,7 @@ CORE="$CORE src/core/PluginSubstitutes.cpp"
 # settings pages, plugin manager and shortcut manager logic (round 82)
 CORE="$CORE src/core/Preferences.cpp"
 # layouts of the native plugin editors (round 93)
-CORE="$CORE src/core/PluginLayout.cpp"
+CORE="$CORE src/core/PluginLayout.cpp src/core/StateParams.cpp"
 # spectral waveforms (band analysis, multi-resolution peak cache)
 CORE="$CORE src/core/WaveAnalysis.cpp"
 # FL's Plucked!, Sawer and BeepMap engines (REA round 65)

+ 1 - 1
scripts/build-windows-zig.sh

@@ -123,7 +123,7 @@ APP_SOURCES+=(src/core/OggVorbis.cpp)
 APP_SOURCES+=(src/core/ExportOptions.cpp src/core/Mp3Encoder.cpp src/core/PluginMonitor.cpp src/core/PlaylistOps.cpp)
 APP_SOURCES+=(src/ui/NewProjectDialog.cpp src/ui/ClipProperties.cpp src/ui/PluginMonitorWindow.cpp src/ui/TouchKeyboard.cpp)
 # native plugin editors in FL's arrangement (round 93)
-APP_SOURCES+=(src/core/PluginLayout.cpp src/ui/PluginEditors.cpp)
+APP_SOURCES+=(src/core/PluginLayout.cpp src/core/StateParams.cpp src/ui/PluginEditors.cpp)
 
 echo "WavPack (decoder, C)..."
 mkdir -p "$OUT/wavpack"

+ 77 - 0
src/Main.cpp

@@ -3,6 +3,7 @@
 #include "core/Effects.h"
 #include "core/FlEffects.h"
 #include "core/FlpImport.h"
+#include "core/NoteEdit.h"
 #include "core/MaximusFx.h"
 #include "core/Harmor.h"
 #include "flp/Flp.h"
@@ -589,6 +590,10 @@ private:
         original.loopEnd = 7680;
         original.playlistTracks.resize (3);
         original.playlistTracks[2].colour = 0xFF2A6FDB; // a track colour (round 90)
+        original.playlistTracks[2].grouped = true;      // track groups and rack filter groups (round 104)
+        original.playlistTracks[1].collapsed = true;
+        original.channelGroups = { "Drums", "Keys" };
+        original.channels[1].group = 1;
         juce::String error;
 
         if (demoProjectPath.isNotEmpty()) // sample project for checking the UI with --snapshot
@@ -607,6 +612,8 @@ private:
                                && reloaded->loopStart == 960 && reloaded->loopEnd == 7680
                                && reloaded->playlistTracks.size() == 3 && reloaded->playlistTracks[2].colour == 0xFF2A6FDB
                                && reloaded->playlistTracks[1].colour == 0
+                               && reloaded->playlistTracks[2].grouped && reloaded->playlistTracks[1].collapsed && ! reloaded->playlistTracks[1].grouped
+                               && reloaded->channelGroups == original.channelGroups && reloaded->channels[1].group == 1 && reloaded->channels[0].group == -1
                                && reloaded->playlist[0].offset == 960 && reloaded->playlist[0].track == 2
                                && reloaded->mixer[3].effects.size() == 1
                                && reloaded->mixer[3].effects[0].kind == lynx::EffectKind::delay
@@ -1487,6 +1494,23 @@ private:
             lynx::AudioEngine loader (false);
             const juce::File input (inputPath);
 
+            // --find-plugins: first the targeted scan opening the project in the app runs (its plugins not known yet)
+            if (input.hasFileExtension ("flp") && juce::JUCEApplication::getCommandLineParameters().contains ("--find-plugins"))
+            {
+                juce::MemoryBlock data;
+                if (input.loadFileAsData (data))
+                    try
+                    {
+                        const auto uses = lynx::flpForeignPlugins (flp::parseProject ({ static_cast<const std::uint8_t*> (data.getData()), data.getSize() }));
+                        auto& host = loader.getPluginHost();
+                        report << "scanned=" << host.filesToScanFor (uses).joinIntoString (";") << "\n";
+                        host.scanFiles (host.filesToScanFor (uses), {});
+                    }
+                    catch (const flp::Error&)
+                    {
+                    }
+            }
+
             if (input.hasFileExtension ("flp"))
                 ok = loader.importFlpFile (input, error);
             else if (auto song = lynx::ProjectFile::load (input, error))
@@ -1542,6 +1566,32 @@ private:
                        << "unsupported=" << joined (importReport.unsupported) << "\n"
                        << "dropped_effects=" << joined (importReport.droppedEffects) << "\n"
                        << "missing_samples=" << importReport.missingSamples << "\n";
+                // third-party plugins: how each was found, or what plays in its place (diagnostics for level differences)
+                for (const auto& line : loader.getMatchedPlugins())
+                    report << "plugin_found=" << line << "\n";
+                for (const auto& m : loader.getMissingPluginDetails())
+                    report << "plugin_missing=" << juce::String::fromUTF8 (m.name.c_str()) << " -> "
+                           << juce::String::fromUTF8 (m.replacement.c_str()).replace ("{0}", juce::String::fromUTF8 (m.replacementArg.c_str())) << "\n";
+                {
+                    const auto& song = loader.getSong();
+                    for (std::size_t t = 0; t < song.mixer.size(); ++t)
+                    {
+                        const auto& track = song.mixer[t];
+                        if (track.effects.empty() && track.sends.empty())
+                            continue;
+                        report << "insert " << (int) t << " vol=" << juce::String (track.volume / lynx::unityFader, 3)
+                               << (track.muted ? " muted" : "") << (track.toMaster ? "" : " noMaster");
+                        for (const auto& s : track.sends)
+                            report << " send>" << s.target << "@" << juce::String (s.level, 3);
+                        report << " |";
+                        for (const auto& fx : track.effects)
+                            report << " [" << (fx.kind == lynx::EffectKind::plugin ? juce::String::fromUTF8 (fx.plugin.name.c_str())
+                                                                                 : juce::String::fromUTF8 (lynx::effectInfo (fx.kind).name))
+                                   << (fx.isSubstitute() ? " (substitute)" : "") << (fx.enabled ? "" : " off")
+                                   << (fx.mix < 0.999f ? " mix=" + juce::String (fx.mix, 2) : juce::String()) << "]";
+                        report << "\n";
+                    }
+                }
                 report << "open_ms=" << juce::roundToInt (loaded - started) << "\n"
                        << "prepare_ms=" << juce::roundToInt (prepared - loaded) << "\n"
                        << "render_ms=" << juce::roundToInt (juce::Time::getMillisecondCounterHiRes() - prepared) << "\n"
@@ -1939,6 +1989,33 @@ private:
             offline.dispatchPendingMessages();
             saveSnapshot (ui, prefix + "-playlist-timesel.png");
             ui.getPlaylistForSnapshot().setToolForSnapshot (lynx::EditTool::pencil);
+            // round 104: a folded track group (FL's thin member rows) and the Picker's audio tab
+            {
+                int header = -1;
+                for (int t = 0; t < (int) offline.getSong().playlistTracks.size() && header < 0; ++t)
+                    if (lynx::noteedit::isGroupHeader (offline.getSong(), t))
+                        header = t;
+                if (header >= 0)
+                {
+                    offline.editSong ([header] (lynx::Song& s) { lynx::noteedit::setGroupCollapsed (s, header, true); }, false);
+                    offline.dispatchPendingMessages();
+                    saveSnapshot (ui, prefix + "-playlist-group-folded.png");
+                    offline.editSong ([header] (lynx::Song& s) { lynx::noteedit::setGroupCollapsed (s, header, false); }, false);
+                }
+                ui.getPickerForSnapshot().setView (1);
+                offline.dispatchPendingMessages();
+                saveSnapshot (ui, prefix + "-playlist-picker-audio.png");
+                ui.getPickerForSnapshot().setView (0);
+            }
+            // round 104: the Channel Rack filtered to its first filter group
+            if (! offline.getSong().channelGroups.empty())
+            {
+                ui.selectTabForSnapshot (0);
+                ui.getRackForSnapshot().setFilterGroup (0);
+                offline.dispatchPendingMessages();
+                saveSnapshot (ui, prefix + "-rack-filter.png");
+                ui.getRackForSnapshot().setFilterGroup (-1);
+            }
             ui.selectTabForSnapshot (3);
             // LYNX_SNAPSHOT_TRACK=n: shows the effects of that mixer track
             if (const auto track = juce::SystemStats::getEnvironmentVariable ("LYNX_SNAPSHOT_TRACK", {}); track.isNotEmpty())

+ 3 - 0
src/core/ConvolverFx.cpp

@@ -757,6 +757,7 @@ std::optional<State> parseState (const std::vector<std::uint8_t>& d)
     }
     if (d.size() < o + 4)
         return std::nullopt;
+    s.flagsAt = o;
     for (int k = 0; k < 4; ++k)
         s.flags[(std::size_t) k] = d[o + (std::size_t) k];
     o += 4;
@@ -770,6 +771,8 @@ std::optional<State> parseState (const std::vector<std::uint8_t>& d)
     const int nk = s.version >= 11 ? 5 : 4;
     if (d.size() < o + 4 * (std::size_t) nk)
         return std::nullopt;
+    s.knobsAt = o;
+    s.knobCount = nk;
     for (int k = 0; k < nk; ++k)
         s.knobs[(std::size_t) k] = i32 (d, o + 4 * (std::size_t) k);
     if (nk == 4)

+ 2 - 0
src/core/ConvolverFx.h

@@ -66,6 +66,8 @@ struct State
     std::array<std::uint8_t, 4> flags {};            // [3] = normalise
     int option = 0;                                  // the int after the flags (version > 14), 0 in every known state
     std::array<int, 5> knobs { 0, 0, 0, 0, 1000 };   // page, predelay, blend, speed, EQ amount (raw)
+    std::size_t flagsAt = 0, knobsAt = 0;            // byte offsets of the flags and the knobs in the parsed state (0 = absent)
+    int knobCount = 0;                               // knobs stored (5 from version 11, else 4)
 };
 std::optional<State> parseState (const std::vector<std::uint8_t>& state);
 

+ 29 - 3
src/core/Effects.cpp

@@ -167,10 +167,21 @@ class Compressor final : public Effect
 {
 public:
     void prepare (double sr) noexcept override { sampleRate = sr; reset(); }
-    void reset() noexcept override { envelopeDb = 0.0f; }
+    void reset() noexcept override
+    {
+        envelopeDb = 0.0f;
+        inPower = outPower = 0.0f;
+        autoGain = 1.0f;
+    }
 
     void process (float* l, float* r, int n, const EffectParams& params, double) noexcept override
     {
+        // "Auto gain" (round 107): the long-term level stays where it was (slow in/out power match, ±12 dB), so the
+        // compressor shapes the dynamics without making the track quieter. Used where its settings are a guess (a
+        // substitute for a missing plugin, whose own makeup gain is unknown).
+        const auto levelMatch = params[5] >= 0.5f;
+        const auto powerCoeff = (float) std::exp (-1.0 / (1.5 * sampleRate));
+        const auto gainCoeff = (float) std::exp (-1.0 / (0.05 * sampleRate));
         const auto threshold = compThresholdDb (params[0]);
         const auto ratio = compRatio (params[1]);
         const auto attack = (float) std::exp (-1.0 / (compAttackMs (params[2]) * 0.001 * sampleRate));
@@ -195,7 +206,20 @@ public:
             if (envelopeDb < 1.0e-4f)
                 envelopeDb = 0.0f; // no audible reduction: skip the pow
 
-            const auto gain = envelopeDb > 0.0f ? dbToGain (-envelopeDb) * makeup : makeup;
+            auto gain = envelopeDb > 0.0f ? dbToGain (-envelopeDb) * makeup : makeup;
+
+            if (levelMatch)
+            {
+                const auto in = 0.5f * (l[i] * l[i] + r[i] * r[i]);
+                inPower = in + powerCoeff * (inPower - in);
+                const auto out = in * gain * gain;
+                outPower = out + powerCoeff * (outPower - out);
+                // follow only while there is signal (silence keeps the last match)
+                const auto target = inPower > 1.0e-8f && outPower > 1.0e-12f ? std::clamp (std::sqrt (inPower / outPower), 0.25f, 4.0f) : autoGain;
+                autoGain = target + gainCoeff * (autoGain - target);
+                gain *= autoGain;
+            }
+
             l[i] *= gain;
             r[i] *= gain;
         }
@@ -211,6 +235,7 @@ public:
 private:
     double sampleRate = 44100.0;
     float envelopeDb = 0.0f;
+    float inPower = 0.0f, outPower = 0.0f, autoGain = 1.0f;
     const float* sideL = nullptr;
     const float* sideR = nullptr;
     bool useSidechain = false;
@@ -2137,7 +2162,7 @@ std::string widthText (const EffectParams& params, int band)
 const EffectInfo& effectInfo (EffectKind kind)
 {
     static const EffectInfo eq { "EQ", { { "Low", 0.5f }, { "Mid", 0.5f }, { "Mid freq.", 0.5f }, { "High", 0.5f }, { "Output", 0.5f } } };
-    static const EffectInfo comp { "Compressor", { { "Threshold", 0.7f }, { "Ratio", 3.0f / 19.0f }, { "Attack", 0.67f }, { "Release", 0.54f }, { "Makeup", 0.0f } } };
+    static const EffectInfo comp { "Compressor", { { "Threshold", 0.7f }, { "Ratio", 3.0f / 19.0f }, { "Attack", 0.67f }, { "Release", 0.54f }, { "Makeup", 0.0f }, { "Auto gain", 0.0f } } };
     static const EffectInfo delay { "Delay", { { "Time", 0.3f }, { "Feedback", 0.42f }, { "Mix", 0.3f }, { "Ping-pong", 0.0f }, { "Damping", 0.3f } } };
     static const EffectInfo reverb { "Reverb", { { "Room", 0.6f }, { "Damping", 0.5f }, { "Width", 1.0f }, { "Mix", 0.25f }, { "Dry", 1.0f },
                                                  { "Low cut", 0.0f }, { "High cut", 1.0f }, { "Predelay", 0.0f } } };
@@ -2534,6 +2559,7 @@ std::string formatEffectParam (EffectKind kind, int param, float v, double bpm)
                 case 1: std::snprintf (text, sizeof (text), "%.1f:1", compRatio (v)); break;
                 case 2: std::snprintf (text, sizeof (text), "%.1f ms", compAttackMs (v)); break;
                 case 3: std::snprintf (text, sizeof (text), "%.0f ms", compReleaseMs (v)); break;
+                case 5: return v >= 0.5f ? "on" : "off";
                 default: std::snprintf (text, sizeof (text), "+%.1f dB", compMakeupDb (v)); break;
             }
             return text;

+ 4 - 0
src/core/Effects.h

@@ -98,6 +98,10 @@ public:
     // The notes held on every Channel Rack channel (`count` masks, by channel index) during the next process(); the
     // pointer stays valid until the next call. Effects that follow notes (LYNX Tune's MIDI targets) keep it.
     virtual void setHeldNotes (const NoteMask* /*channels*/, int /*count*/) noexcept {}
+    // Only the slot's state changed (an editor edited a control stored there, core/StateParams.h). Called off the audio
+    // thread on the running effect: true = it takes the new state itself, applied at the start of a later process(),
+    // so its delay lines and filters keep running; false (the default) = the slot's effect is built again.
+    virtual bool acceptState (const std::vector<std::uint8_t>& /*state*/) noexcept { return false; }
     // Latency the effect introduces (plugins), in samples. Used by PDC.
     virtual int latencySamples() const noexcept { return 0; }
 };

+ 25 - 1
src/core/EquoFx.cpp

@@ -1,6 +1,7 @@
 // FL Studio's EQUO as an exact engine (docs/analise/REA_rodada61.md). Clean-room: our own code, written from the
 // behaviour documented there.
 
+#include "core/StateHandoff.h"
 #include "core/EquoFx.h"
 
 #include <algorithm>
@@ -578,6 +579,15 @@ void Engine::setKnobs (const State& s) noexcept
     }
 }
 
+void Engine::setBands (const State& s) noexcept
+{
+    d->st.table = s.table;
+    d->st.target = s.target;
+    d->computeValues();
+    d->computeVolume();
+    d->computeSmoother();
+}
+
 void Engine::reset() noexcept
 {
     d->fresh();
@@ -764,10 +774,23 @@ public:
 
     void reset() noexcept override { engine.reset(); }
 
+    // the editor drew in the band table: the running engine glides to the new values
+    bool acceptState (const std::vector<std::uint8_t>& bytes) noexcept override
+    {
+        const auto s = parse (bytes);
+        return s && valid && incoming.offer (*s);
+    }
+
     void process (float* left, float* right, int n, const EffectParams& p, double bpm) noexcept override
     {
         if (! valid)
             return; // not an EQUO state: pass the signal through
+        if (incoming.take (next))
+        {
+            state.table = next.table;
+            state.target = next.target;
+            engine.setBands (state);
+        }
         if (offlineRendering() != rendering)
         {
             rendering = offlineRendering();
@@ -792,7 +815,8 @@ public:
     }
 
 private:
-    State state;
+    State state, next;
+    StateHandoff<State> incoming;
     bool valid = false, rendering = false, haveParams = false;
     double rate = 44100.0;
     EffectParams lastParams {};

+ 1 - 0
src/core/EquoFx.h

@@ -68,6 +68,7 @@ public:
     void prepare (double sampleRate, bool hqRender = false) noexcept;
     void set (const State& s) noexcept; // a newly loaded state (as after FL's state load)
     void setKnobs (const State& s) noexcept; // knob / option changes on the running engine
+    void setBands (const State& s) noexcept; // band table / band mode changes on the running engine (values glide)
     void reset() noexcept;              // as freshly loaded: filters cleared, gains ramp in from zero
     void flush() noexcept;              // FL's Flush message: filters cleared, gains jump to their targets
     void process (float* left, float* right, int n) noexcept; // stereo, in place, any n (FL blocks of 512)

+ 4 - 0
src/core/FlEffects.cpp

@@ -1474,6 +1474,10 @@ std::vector<std::string> flPluginsForEffect (EffectKind kind)
         case EffectKind::distructor: return { "Distructor" };
         case EffectKind::flPitchShifter: return { "Pitch Shifter" };
         case EffectKind::multibandDelay: return { "Multiband Delay" };
+        case EffectKind::vocoder: return { "Fruity Vocoder" };
+        case EffectKind::vocodex: return { "Vocodex" };
+        case EffectKind::effector: return { "Effector" };
+        case EffectKind::frequencySplitter: return { "Frequency Splitter" };
         default: return {};
     }
 }

+ 22 - 5
src/core/FlpImport.cpp

@@ -1,4 +1,5 @@
 #include "core/FlpImport.h"
+#include "core/EditorPolish.h"
 #include "core/FruityPhaser.h"
 #include "core/FlPluginDb.h"
 #include "core/FlVoiceProcessor.h"
@@ -662,6 +663,7 @@ Song importFlp (const flp::Project& input, const FlpImportOptions& options)
     song.bpm = project.tempo > 0.0 ? project.tempo : 140.0;
     song.beatsPerBar = std::clamp (project.beatsPerBar, 1, 32);
     song.swing = std::clamp (project.swing / 128.0f, 0.0f, 1.0f);
+    song.channelGroups = project.filterGroups;
     song.info.title = project.title;
     song.info.author = project.artist;
     song.info.genre = project.genre;
@@ -743,6 +745,9 @@ Song importFlp (const flp::Project& input, const FlpImportOptions& options)
         if (c.colour != 0)
             def.colour = 0xFF000000u | c.colour;
 
+        if (c.filterGroup >= 0 && c.filterGroup < (int) project.filterGroups.size())
+            def.group = c.filterGroup;
+
         if (c.hasLevels)
         {
             def.volume = std::clamp (c.volume / 12800.0f, 0.0f, 1.0f); // same curve (channelGain)
@@ -2126,7 +2131,9 @@ Song importFlp (const flp::Project& input, const FlpImportOptions& options)
 
         auto& track = song.mixer[(std::size_t) t];
 
-        // FL ranges: volume 0..16000 (12800 = 0 dB), pan ±6400, send 0..16000 (12800 = 100%)
+        // FL ranges: volume 0..16000 (12800 = 0 dB), pan ±6400, route levels 0..16000 on the fader curve too
+        // (12800 = 0 dB, 16000 = +5.6 dB; destination 0 = the route to Master). REA_rodada107 §3: FL renders with
+        // a route level of 16000 / 12800 / 6400 differ by +5.6 / 0 / −12.7 dB, the fader curve's values.
         if (p == flp::ControlId::mixerVolume)
             track.volume = std::clamp (control.value / 16000.0f, 0.0f, 1.0f);
         else if (p == flp::ControlId::mixerPan)
@@ -2147,10 +2154,12 @@ Song importFlp (const flp::Project& input, const FlpImportOptions& options)
             else
                 track.eq.width[band] = (float) std::clamp (v / 65536.0, 0.0, 1.0);
         }
-        else if (p >= flp::ControlId::mixerSendBase && p < flp::ControlId::mixerSendBase + tracks)
+        else if (p == flp::ControlId::mixerSendBase)
+            track.masterLevel = faderGain (control.value / 16000.0f);
+        else if (p > flp::ControlId::mixerSendBase && p < flp::ControlId::mixerSendBase + tracks)
             for (auto& send : track.sends)
                 if (send.target == p - flp::ControlId::mixerSendBase)
-                    send.level = std::clamp (control.value / 12800.0f, 0.0f, 1.0f);
+                    send.level = faderGain (control.value / 16000.0f);
     }
 
     // the FL template routes every insert to the send tracks at level 0; that makes no sound, only wastes CPU
@@ -2642,12 +2651,20 @@ Song importFlp (const flp::Project& input, const FlpImportOptions& options)
             {
                 const auto coloured = (t.colour & 0xFFFFFF) != 0x485156;
 
-                if (t.index >= 0 && t.index < 500 && (! t.name.empty() || ! t.enabled || coloured))
+                const auto sized = std::abs (t.heightScale - 1.0f) > 0.01f;
+
+                if (t.index >= 0 && t.index < 500 && (! t.name.empty() || ! t.enabled || coloured || t.grouped || ! t.expanded || sized))
                 {
                     if ((int) song.playlistTracks.size() <= t.index)
                         song.playlistTracks.resize ((std::size_t) t.index + 1);
 
-                    song.playlistTracks[(std::size_t) t.index] = { t.name, ! t.enabled, 0, coloured ? 0xFF000000u | t.colour : 0u };
+                    auto& track = song.playlistTracks[(std::size_t) t.index];
+                    track = { t.name, ! t.enabled, 0, coloured ? 0xFF000000u | t.colour : 0u };
+                    // FL's size is relative to its default row; LYNX keeps the same proportion of its own default
+                    if (sized)
+                        track.height = polish::clampTrackHeight ((int) std::lround (polish::defaultTrackHeight * t.heightScale));
+                    track.grouped = t.index > 0 && t.grouped;
+                    track.collapsed = ! t.expanded;
                 }
             }
     }

+ 90 - 1
src/core/FruityDelayBank.cpp

@@ -6,6 +6,7 @@
 #include <cstring>
 
 #include "core/Effects.h"
+#include "core/StateHandoff.h"
 
 // Bit-exactness with FL's plugin needs every float operation in the plugin's order and precision: no contraction into
 // fused multiply-adds, and the x87 extended precision of its pan law kept (long double; 80-bit on every x86 target LYNX
@@ -1058,7 +1059,29 @@ namespace
 class DelayBankEffect final : public Effect
 {
 public:
-    explicit DelayBankEffect (const std::vector<std::uint8_t>& slotState) : state (parse (slotState).value_or (defaultState())) {}
+    explicit DelayBankEffect (const std::vector<std::uint8_t>& slotState) : state (parse (slotState).value_or (defaultState())), accepted (state) {}
+
+    // the editor changed bank controls (0…130 go to the running engine as FL's ProcessParam); options, the solo or the
+    // oversampling need a new engine
+    bool acceptState (const std::vector<std::uint8_t>& bytes) noexcept override
+    {
+        const auto s = parse (bytes);
+        if (! s || s->p[131] != accepted.p[131] || s->p[132] != accepted.p[132])
+            return false;
+        for (int b = 0; b < banks; ++b)
+        {
+            const auto& x = s->bank[(std::size_t) b];
+            const auto& y = accepted.bank[(std::size_t) b];
+            if (x.filterType[0] != y.filterType[0] || x.filterType[1] != y.filterType[1] || x.filterOrder[0] != y.filterOrder[0]
+                || x.filterOrder[1] != y.filterOrder[1] || x.filterAfter != y.filterAfter || x.mode != y.mode || x.steps != y.steps
+                || x.amount != y.amount || x.enabled != y.enabled || x.tapBeforeFeedback != y.tapBeforeFeedback || x.sync != y.sync)
+                return false;
+        }
+        if (! incoming.offer (s->p))
+            return false;
+        accepted = *s;
+        return true;
+    }
 
     void prepare (double sampleRate) noexcept override
     {
@@ -1080,6 +1103,12 @@ public:
             engine = std::make_unique<Engine> (state, rate, bpm, block, true);
             tempo = bpm;
         }
+        if (std::array<int, stateControls> p {}; incoming.take (p))
+            for (int i = globalControls; i < automatable; ++i)
+            {
+                state.p[(std::size_t) i] = p[(std::size_t) i];
+                engine->setControl (i, p[(std::size_t) i]);
+            }
         for (int i = 0; i < globalControls; ++i)
             engine->setControl (i, g[i]);
         if (bpm != tempo)
@@ -1099,6 +1128,8 @@ private:
     static constexpr int block = 512;
     double rate = 44100.0, tempo = 0.0;
     State state;
+    State accepted; // the last state taken by acceptState (its thread only)
+    StateHandoff<std::array<int, stateControls>> incoming;
     std::unique_ptr<Engine> engine;
 };
 } // namespace
@@ -1123,4 +1154,62 @@ std::string globalText (int index, float value)
     }
     return text;
 }
+
+std::string controlText (const State& s, int index, int raw)
+{
+    char text[48];
+    if (index < 0 || index >= automatable)
+        return {};
+    if (index < globalControls)
+        return globalText (index, (float) raw / 128.0f);
+    const int b = (index - 4) >> 4, k = index - 4 - 16 * b;
+    const auto db = [&] (float g) {
+        if (g == 0.0f)
+            std::snprintf (text, sizeof (text), "-inf dB");
+        else
+            std::snprintf (text, sizeof (text), "%.1f dB%s", 20.0 * std::log10 (std::fabs ((double) g)), g < 0.0f ? " (inv.)" : "");
+    };
+    const auto pan = [&] {
+        if (raw == 0)
+            std::snprintf (text, sizeof (text), "Centred");
+        else
+            std::snprintf (text, sizeof (text), "%d%% %s", (int) std::lround (std::abs (raw) * 100.0 / 128.0), raw < 0 ? "left" : "right");
+    };
+    switch (k)
+    {
+        case 0: case 5: case 13: pan(); break;
+        case 1: case 14: case 15: db (signedVolume (raw)); break;
+        case 2: case 10:
+        {
+            // the filter's corner (REA_rodada56 §1.5): low-pass and the other types use different scales
+            const auto type = s.bank[(std::size_t) b].filterType[k == 2 ? 0 : 1];
+            const auto c = (double) raw / 65536.0;
+            const auto f = (std::exp (c * std::log (1501.0)) - 1.0) * (type == 1 ? 0.00066466664 : 0.00039993334);
+            std::snprintf (text, sizeof (text), "%.0f Hz", (std::min (f, type == 4 ? 0.6001 : 1.0001) + (type == 1 ? 0.003 : 0.0001)) * 44100.0);
+            break;
+        }
+        case 3: case 11: std::snprintf (text, sizeof (text), "%d%%", (int) std::lround (raw * 100.0 / 65536.0)); break;
+        case 4: case 12: // the shelf / peak amplitude A (unity at 128), shown as the cookbook gain 40·log10 A
+        {
+            const auto a = (std::exp (raw / 128.0 * std::log (10.0 / 9.0)) - 1.0) * 8.1 + 0.1;
+            std::snprintf (text, sizeof (text), "%+.1f dB", 40.0 * std::log10 (a));
+            break;
+        }
+        case 6: case 7: std::snprintf (text, sizeof (text), "%d%%", (int) std::lround (raw * 100.0 / 128.0)); break;
+        case 8:
+            if (s.bank[(std::size_t) b].sync) // 1920 = one beat = four steps
+                std::snprintf (text, sizeof (text), "%.2f steps", raw / 480.0);
+            else // 3840 = one second
+                std::snprintf (text, sizeof (text), "%.1f ms", raw * 1000.0 / 3840.0);
+            break;
+        case 9:
+        {
+            const auto ms = (std::exp (std::abs (raw) / 512.0 * std::log (1001.0)) - 1.0) * 50.0 / 100.0;
+            std::snprintf (text, sizeof (text), raw == 0 ? "0 ms" : "%.2f ms %s", ms, raw < 0 ? "left" : "right");
+            break;
+        }
+        default: std::snprintf (text, sizeof (text), "%d", raw); break;
+    }
+    return text;
+}
 } // namespace lynx::fldbank

+ 2 - 0
src/core/FruityDelayBank.h

@@ -83,4 +83,6 @@ private:
 std::unique_ptr<Effect> make (const std::vector<std::uint8_t>& slotState);
 const char* globalName (int index) noexcept;
 std::string globalText (int index, float value);
+// A control (0…130) as the editor shows it; `s` gives the bank's context (tempo sync for the time, filter types)
+std::string controlText (const State& s, int index, int raw);
 } // namespace lynx::fldbank

+ 2 - 1
src/core/HardcoreFx.cpp

@@ -1375,7 +1375,8 @@ std::string paramName (int i)
         std::snprintf (b, sizeof (b), "Box %d pedal", i - pBoxType + 1);
         return b;
     }
-    return "(unused)";
+    std::snprintf (b, sizeof (b), "(unused %d)", i); // FL's parameters 12, 38 and 44 do nothing
+    return b;
 }
 
 std::string paramText (int i, float v01)

+ 3 - 2
src/core/History.cpp

@@ -44,7 +44,7 @@ bool sameEffects (const MixerTrack& a, const MixerTrack& b) noexcept
 
 bool sameRouting (const MixerTrack& a, const MixerTrack& b) noexcept
 {
-    return a.sends == b.sends && a.toMaster == b.toMaster;
+    return a.sends == b.sends && a.toMaster == b.toMaster && a.masterLevel == b.masterLevel;
 }
 
 bool sameTrack (const MixerTrack& a, const MixerTrack& b) noexcept
@@ -207,7 +207,8 @@ ChangeLabel describeChange (const Song& before, const Song& after)
 
     for (std::size_t i = 0; i < after.playlistTracks.size(); ++i)
         if (before.playlistTracks[i].name != after.playlistTracks[i].name || before.playlistTracks[i].muted != after.playlistTracks[i].muted
-            || before.playlistTracks[i].colour != after.playlistTracks[i].colour)
+            || before.playlistTracks[i].colour != after.playlistTracks[i].colour || before.playlistTracks[i].grouped != after.playlistTracks[i].grouped
+            || before.playlistTracks[i].collapsed != after.playlistTracks[i].collapsed)
             return label (TR_NOOP ("Playlist tracks"));
 
     for (std::size_t i = 0; i < after.playlistTracks.size(); ++i)

+ 9 - 1
src/core/Instruments.cpp

@@ -1,4 +1,5 @@
 #include "core/Instruments.h"
+#include "core/Scheduler.h"
 
 #include "core/DirectWave.h"
 #include "core/FlSynths.h"
@@ -1744,7 +1745,14 @@ public:
     {
         if (clipMode)
         {
-            allNotesOff(); // the clip ended: fade out quickly
+            // the clip ended: its voice fades out quickly. A clip carries its own key (audioClipKey), so the next clip
+            // of the same channel that already started (a crossfade) keeps playing; other callers stop everything.
+            if (key < audioClipKeyBase)
+                allNotesOff();
+            else
+                for (auto& v : voices)
+                    if (v.active && v.key == key)
+                        v.stolen = true;
             return;
         }
 

+ 1 - 0
src/core/KeyMap.cpp

@@ -99,6 +99,7 @@ std::vector<Action> makeActions()
         { "rack.deleteSelected", TR_NOOP ("Delete the selected channels"), Context::channelRack, { chord (del, alt) } },
         { "rack.sendToInserts", TR_NOOP ("Send the selected channels to free mixer inserts"), Context::channelRack, { chord ('L', ctrl) } },
         { "rack.graphEditor", TR_NOOP ("Step graph lanes on/off"), Context::channelRack, { chord ('K', ctrl) } },
+        { "rack.groupSelected", TR_NOOP ("Put the selected channels in a new filter group"), Context::channelRack, { chord ('G', alt) } },
         { "rack.rotateLeft", TR_NOOP ("Rotate the selected channels' steps left"), Context::channelRack, { chord (left, ctrl | shift) } },
         { "rack.rotateRight", TR_NOOP ("Rotate the selected channels' steps right"), Context::channelRack, { chord (right, ctrl | shift) } },
 

+ 19 - 1
src/core/MultibandDelayFx.cpp

@@ -1,3 +1,4 @@
+#include "core/StateHandoff.h"
 #include "core/MultibandDelayFx.h"
 
 #include "core/Effects.h"
@@ -1078,8 +1079,24 @@ public:
 
     void reset() noexcept override { engine.suspend(); }
 
+    // the editor changed band cells or the selected bank: the running engine takes the new cell values
+    bool acceptState (const std::vector<std::uint8_t>& bytes) noexcept override
+    {
+        const auto s = parse (bytes);
+        return s && incoming.offer (*s);
+    }
+
     void process (float* left, float* right, int n, const EffectParams& p, double) noexcept override
     {
+        if (incoming.take (next))
+        {
+            for (int i = 0; i < 384; ++i)
+                if (const auto v = engineValue (next, i); v != engineValue (state, i))
+                    engine.setParameter (i, v);
+            for (int i = 0; i < 384; ++i)
+                state.raw[(std::size_t) i] = next.raw[(std::size_t) i];
+            state.targetSel = next.targetSel, state.bank = next.bank, state.mode = next.mode;
+        }
         if (! haveParams || p != lastParams)
         {
             lastParams = p, haveParams = true;
@@ -1098,7 +1115,8 @@ public:
     int latencySamples() const noexcept override { return engine.latencySamples(); }
 
 private:
-    State state;
+    State state, next;
+    StateHandoff<State> incoming;
     bool haveParams = false;
     EffectParams lastParams {};
     Engine engine;

+ 87 - 0
src/core/NoteEdit.cpp

@@ -699,4 +699,91 @@ void soloTrack (Song& song, int track, int trackCount)
     for (int t = 0; t < (int) h.size(); ++t)
         h[(std::size_t) t].muted = alone ? false : t != track;
 }
+// --- track groups ------------------------------------------------------------------------------------
+
+namespace
+{
+bool groupedFlag (const Song& song, int track)
+{
+    return track > 0 && track < (int) song.playlistTracks.size() && song.playlistTracks[(std::size_t) track].grouped;
+}
+} // namespace
+
+bool isGroupHeader (const Song& song, int track)
+{
+    return track >= 0 && ! groupedFlag (song, track) && groupedFlag (song, track + 1);
+}
+
+int groupHeaderOf (const Song& song, int track)
+{
+    if (track < 0)
+        return -1;
+
+    if (! groupedFlag (song, track))
+        return isGroupHeader (song, track) ? track : -1;
+
+    while (track > 0 && groupedFlag (song, track))
+        --track;
+
+    return track;
+}
+
+std::vector<int> groupMembers (const Song& song, int header)
+{
+    std::vector<int> out;
+
+    if (header < 0 || groupedFlag (song, header))
+        return out;
+
+    for (int t = header + 1; groupedFlag (song, t); ++t)
+        out.push_back (t);
+
+    return out;
+}
+
+bool isFoldedAway (const Song& song, int track)
+{
+    if (! groupedFlag (song, track))
+        return false;
+
+    const auto header = groupHeaderOf (song, track);
+    return header >= 0 && header < (int) song.playlistTracks.size() && song.playlistTracks[(std::size_t) header].collapsed;
+}
+
+void groupWithAbove (Song& song, int track)
+{
+    if (track <= 0)
+        return;
+
+    headers (song, track + 1)[(std::size_t) track].grouped = true;
+}
+
+void ungroupTrack (Song& song, int track)
+{
+    if (groupedFlag (song, track))
+        song.playlistTracks[(std::size_t) track].grouped = false;
+}
+
+void setGroupCollapsed (Song& song, int track, bool collapsed)
+{
+    const auto header = groupHeaderOf (song, track);
+
+    if (header < 0)
+        return;
+
+    headers (song, header + 1)[(std::size_t) header].collapsed = collapsed;
+}
+
+void colourGroup (Song& song, int track)
+{
+    const auto header = groupHeaderOf (song, track);
+
+    if (header < 0)
+        return;
+
+    const auto colour = header < (int) song.playlistTracks.size() ? song.playlistTracks[(std::size_t) header].colour : 0u;
+
+    for (auto t : groupMembers (song, header))
+        song.playlistTracks[(std::size_t) t].colour = colour;
+}
 } // namespace lynx::noteedit

+ 11 - 0
src/core/NoteEdit.h

@@ -163,4 +163,15 @@ void removeTrack (Song& song, int track);
 void swapTracks (Song& song, int a, int b);
 // Solo: `track` plays alone (every other track muted); on the only unmuted track it unmutes all.
 void soloTrack (Song& song, int track, int trackCount);
+
+// --- Playlist track groups (FL's "Group with above track", REA round 104) -----------------------------
+// A track with `grouped` set belongs to the group of the nearest ungrouped track above it: the header.
+bool isGroupHeader (const Song& song, int track);            // the next track is grouped with it
+int groupHeaderOf (const Song& song, int track);             // the header of the track's group (itself for a header), -1 if none
+std::vector<int> groupMembers (const Song& song, int header); // the grouped tracks under a header
+bool isFoldedAway (const Song& song, int track);             // a member of a collapsed group (drawn as a thin row)
+void groupWithAbove (Song& song, int track);                 // no-op on track 0
+void ungroupTrack (Song& song, int track);                   // a member leaves its group (headers stay)
+void setGroupCollapsed (Song& song, int track, bool collapsed); // the group of `track`
+void colourGroup (Song& song, int track);                    // "Auto color group": members take the header's colour
 } // namespace lynx::noteedit

+ 58 - 8
src/core/PluginLayout.cpp

@@ -9,6 +9,8 @@
 
 #include "core/Effects.h"
 #include "core/MaximusFx.h"
+#include "core/MultibandDelayFx.h"
+#include "core/StateParams.h"
 
 // (the i18n test scans the sources for TR_NOOP: captions below are translated by the editor)
 #ifndef TR_NOOP
@@ -1465,6 +1467,8 @@ Layout soundgoodizer()
     return l;
 }
 
+#include "core/PluginLayoutFx.inc"
+
 // --- generated layouts ------------------------------------------------------------------------------
 
 // --- LYNX originals: the mixing suite (REA round 96). Not FL arrangements: LYNX's own panels, laid out with the
@@ -2081,7 +2085,11 @@ const std::vector<EffectKind>& flLayoutKinds()
                                                  EffectKind::transientProcessor, EffectKind::fruityFreeFilter, EffectKind::fruityWaveShaper,
                                                  EffectKind::vintageChorus, EffectKind::hyperChorus, EffectKind::fruityBalance,
                                                  EffectKind::squeeze, EffectKind::maximus,
-                                                 EffectKind::vintagePhaser, EffectKind::fruityPhaser };
+                                                 EffectKind::vintagePhaser, EffectKind::fruityPhaser,
+                                                 // round 105
+                                                 EffectKind::vocoder, EffectKind::frequencySplitter, EffectKind::fruityDelayBank,
+                                                 EffectKind::equo, EffectKind::multibandDelay, EffectKind::convolver,
+                                                 EffectKind::flPitchShifter, EffectKind::effector, EffectKind::hardcore, EffectKind::vocodex };
     return kinds;
 }
 
@@ -2136,6 +2144,16 @@ const Layout& layoutFor (EffectKind kind)
         case EffectKind::maximus: l = maximus(); break;
         case EffectKind::vintagePhaser: l = vintagePhaser(); break;
         case EffectKind::fruityPhaser: l = fruityPhaser(); break;
+        case EffectKind::vocoder: l = fruityVocoder(); break;
+        case EffectKind::frequencySplitter: l = frequencySplitterLayout(); break;
+        case EffectKind::fruityDelayBank: l = fruityDelayBankLayout(); break;
+        case EffectKind::equo: l = equoLayout(); break;
+        case EffectKind::multibandDelay: l = multibandDelayLayout(); break;
+        case EffectKind::convolver: l = convolverLayout(); break;
+        case EffectKind::flPitchShifter: l = pitchShifterLayout(); break;
+        case EffectKind::effector: l = effectorLayout(); break;
+        case EffectKind::hardcore: l = hardcoreLayout(); break;
+        case EffectKind::vocodex: l = vocodexLayout(); break;
         case EffectKind::ridgeStrip: l = ridgeStrip(); break;
         case EffectKind::glowLeveler: l = glowLeveler(); break;
         case EffectKind::hushDeEsser: l = hushDeEsser(); break;
@@ -2189,34 +2207,65 @@ bool hasFlLayout (EffectKind kind)
 
 bool usesStateParams (EffectKind kind) noexcept
 {
-    return kind == EffectKind::maximus;
+    return stateparams::tableFor (kind) != nullptr;
 }
 
 int paramCount (EffectKind kind)
 {
-    return usesStateParams (kind) ? (int) maximusfx::stateParams().size() : (int) effectInfo (kind).params.size();
+    const auto* table = stateparams::tableFor (kind);
+    return (int) effectInfo (kind).params.size() + (table != nullptr ? (int) table->params.size() : 0);
+}
+
+int stateIndex (EffectKind kind, int param)
+{
+    const auto plain = (int) effectInfo (kind).params.size();
+    const auto* table = stateparams::tableFor (kind);
+    return table != nullptr && param >= plain && param < plain + (int) table->params.size() ? param - plain : -1;
 }
 
 const char* paramName (EffectKind kind, int index)
 {
     if (index < 0 || index >= paramCount (kind))
         return "";
-    return usesStateParams (kind) ? maximusfx::stateParams()[(std::size_t) index].name : effectInfo (kind).params[(std::size_t) index].name;
+    if (const auto s = stateIndex (kind, index); s >= 0)
+        return stateparams::tableFor (kind)->name (s);
+    return effectInfo (kind).params[(std::size_t) index].name;
 }
 
 int paramIndex (EffectKind kind, const char* name)
 {
     if (name == nullptr)
         return -1;
-    if (usesStateParams (kind))
-        return maximusfx::stateParamIndex (name);
     const auto& params = effectInfo (kind).params;
     for (int i = 0; i < (int) params.size(); ++i)
         if (std::strcmp (params[(std::size_t) i].name, name) == 0)
             return i;
+    if (const auto* table = stateparams::tableFor (kind))
+        if (const auto s = table->index (name); s >= 0)
+            return (int) params.size() + s;
     return -1;
 }
 
+float stateValue01 (EffectKind kind, int param, const std::vector<std::uint8_t>& state)
+{
+    const auto s = stateIndex (kind, param);
+    if (s < 0)
+        return 0.0f;
+    const auto* table = stateparams::tableFor (kind);
+    const auto& p = table->params[(std::size_t) s];
+    const auto raw = table->get (state, s).value_or (p.defaultValue);
+    return p.maximum > p.minimum ? (float) ((double) (std::clamp (raw, p.minimum, p.maximum) - p.minimum) / (double) (p.maximum - p.minimum)) : 0.0f;
+}
+
+int stateRaw (EffectKind kind, int param, float value01)
+{
+    const auto s = stateIndex (kind, param);
+    if (s < 0)
+        return 0;
+    const auto& p = stateparams::tableFor (kind)->params[(std::size_t) s];
+    return p.minimum + (int) std::lround ((double) std::clamp (value01, 0.0f, 1.0f) * (double) (p.maximum - p.minimum));
+}
+
 std::vector<std::string> optionLabels (const LayoutItem& item)
 {
     std::vector<std::string> out;
@@ -2259,7 +2308,7 @@ int optionAt (const LayoutItem& item, float value)
     return best;
 }
 
-bool isShown (EffectKind kind, const LayoutItem& item, int page, const EffectParams& params)
+bool isShown (EffectKind kind, const LayoutItem& item, int page, const EffectParams& params, const std::vector<std::uint8_t>* state)
 {
     if (item.page >= 0 && item.page != page)
         return false;
@@ -2267,7 +2316,8 @@ bool isShown (EffectKind kind, const LayoutItem& item, int page, const EffectPar
         if (param == nullptr)
             return true;
         const auto i = paramIndex (kind, param);
-        const auto v = i >= 0 && i < (int) params.size() ? params[(std::size_t) i] : 0.0f;
+        const auto v = stateIndex (kind, i) >= 0 ? (state != nullptr ? stateValue01 (kind, i, *state) : 0.0f)
+                       : i >= 0 && i < (int) params.size() ? params[(std::size_t) i] : 0.0f;
         return v >= lo && (v < hi || hi >= 1.0f); // [lo, hi), the top end included at 1
     };
     return inRange (item.whenParam, item.whenMin, item.whenMax) && inRange (item.when2Param, item.when2Min, item.when2Max);

+ 10 - 3
src/core/PluginLayout.h

@@ -48,6 +48,7 @@ enum : std::uint16_t
     boxed = 1 << 8,       // label: drawn as a header box (FL's caption plates); section: a plain cell without a title strip
     alignLeft = 1 << 9,   // value / label text aligned left
     raised = 1 << 10,     // section: a lighter inset panel inside another one
+    inverted = 1 << 11,   // toggle: lit while the value is off (FL's white "enabled" LEDs over mute switches)
 };
 
 struct LayoutItem
@@ -100,12 +101,18 @@ const std::vector<InstrumentKind>& instrumentLayoutKinds();
 // Soundgoodizer slots (EffectKind::maximus with the Soundgoodizer build): its own page, edited in the slot's state.
 const Layout& soundgoodizerLayout();
 
-// Parameter index of `name` in effectInfo(kind) (−1 = no such parameter). For kinds whose controls live in the slot's
-// state (usesStateParams: Maximus), the index of core/MaximusFx.h's stateParams instead.
+// Parameter index of `name`: first the effect's own parameters (effectInfo (kind)), then, for kinds with controls in
+// the slot's state (core/StateParams.h: Maximus, Fruity Delay Bank, Multiband Delay, EQUO, Fruity Convolver), those
+// controls numbered on after them (−1 = no such parameter).
 int paramIndex (EffectKind kind, const char* name);
 bool usesStateParams (EffectKind kind) noexcept;
 int paramCount (EffectKind kind);
 const char* paramName (EffectKind kind, int index);
+// The state control of parameter `param` (index into stateparams::tableFor (kind)), −1 = a plain parameter
+int stateIndex (EffectKind kind, int param);
+// A state control's value over its raw range (0…1) in a slot state, and the raw value of a 0…1 position
+float stateValue01 (EffectKind kind, int param, const std::vector<std::uint8_t>& state);
+int stateRaw (EffectKind kind, int param, float value01);
 
 // Options of a radio / tabs item and the value each one sets.
 std::vector<std::string> optionLabels (const LayoutItem& item);
@@ -116,5 +123,5 @@ int optionAt (const LayoutItem& item, float value);
 bool isValueControl (Item type) noexcept;
 
 // Is the item shown on `page` with these parameter values? (pages and the conditions on other parameters)
-bool isShown (EffectKind kind, const LayoutItem& item, int page, const EffectParams& params);
+bool isShown (EffectKind kind, const LayoutItem& item, int page, const EffectParams& params, const std::vector<std::uint8_t>* state = nullptr);
 } // namespace lynx::plugui

+ 590 - 0
src/core/PluginLayoutFx.inc

@@ -0,0 +1,590 @@
+// FL arrangements of round 105 (docs/analise/REA_rodada105.md): Fruity Vocoder, Frequency Splitter, Fruity Delay Bank,
+// EQUO, Multiband Delay, Fruity Convolver, Pitch Shifter, Hardcore, Effector, Vocodex. Included by PluginLayout.cpp
+// inside its anonymous namespace (it uses the builders defined there). Positions measured on FL Studio 2026's windows
+// (captures in tmp/r93/flref and tmp/r105/flref, never in the repository), one unit = one FL pixel, body origin.
+
+LayoutItem menu (float x, float y, float w, float h, const char* param, const char* options, std::vector<float> values = {})
+{
+    LayoutItem i;
+    i.type = Item::menu;
+    i.x = x, i.y = y, i.w = w, i.h = h;
+    i.param = param;
+    i.options = options;
+    i.values = std::move (values);
+    return i;
+}
+
+// a read-out on a plate above a fader or knob (FL's green value boxes)
+LayoutItem plate (float x, float y, float w, float h, const char* param)
+{
+    return value (x, y, w, h, param, boxed);
+}
+
+// a page selector that sets one digit of the editor's page: page = … + option · stride (two selectors share a page:
+// EQUO's bank and target, Multiband Delay's)
+LayoutItem pageDigit (float x, float y, float w, float h, const char* options, int stride)
+{
+    auto i = pageTabs (x, y, w, h, options);
+    i.steps = stride;
+    return i;
+}
+
+// a knob without caption plus its caption above it (FL's Delay Bank globals)
+void knobCaptionAbove (std::vector<LayoutItem>& v, float cx, float cy, float d, const char* param, const char* caption, float captionY)
+{
+    v.push_back (knob (cx, cy, d, param, nullptr, 0, noCaption));
+    v.push_back (label (cx - 24, captionY - 6, 48, 12, caption));
+}
+
+// the name of a state control (core/StateParams.h) as a stable C string for a layout item
+const char* stateName (EffectKind kind, const std::string& name)
+{
+    const auto* table = stateparams::tableFor (kind);
+    const auto i = table != nullptr ? table->index (name.c_str()) : -1;
+    return i >= 0 ? table->name (i) : "";
+}
+
+Layout fruityVocoder()
+{
+    // FREQ (FORM fader, MIN, MAX, SCALE, BW, INVERT) · ENV (ATT, REL) · MIX (listen modulator / carrier / mix LEDs,
+    // the L / R inputs, MOD, CAR, WET faders) over the band display with HOLD, BANDS 4…128 and FILTER 1…3
+    Layout l;
+    l.fl = "Fruity Vocoder";
+    l.width = 416;
+    l.height = 306;
+    auto& v = l.items;
+    v.push_back (section (12, 6, 201, 143, TR_NOOP ("Freq")));
+    v.push_back (slider (Item::vslider, 22, 30, 20, 100, "Formant", nullptr, noCaption | bipolar));
+    v.push_back (label (8, 132, 48, 12, TR_NOOP ("Form")));
+    v.push_back (knob (83, 50, 32, "Min freq.", TR_NOOP ("Min"), 79));
+    v.push_back (knob (132, 50, 32, "Max freq.", TR_NOOP ("Max"), 79));
+    v.push_back (knob (181, 50, 32, "Scale", TR_NOOP ("Scale"), 79, bipolar));
+    v.push_back (knob (83, 109, 32, "Width", TR_NOOP ("BW"), 138));
+    v.push_back (toggle (172, 97, 20, 12, "Invert", nullptr));
+    v.push_back (label (157, 113, 48, 12, TR_NOOP ("Invert")));
+    v.push_back (section (219, 6, 62, 143, TR_NOOP ("Env")));
+    v.push_back (knob (250, 50, 32, "Attack", TR_NOOP ("Att"), 79));
+    v.push_back (knob (250, 109, 32, "Release", TR_NOOP ("Rel"), 138));
+    v.push_back (section (287, 6, 116, 143, TR_NOOP ("Mix")));
+    v.push_back (toggle (306, 18, 16, 13, "Swap L/R", "L", boxed));
+    v.push_back (toggle (338, 18, 16, 13, "Swap L/R", "R", boxed));
+    v.push_back (tabs (298, 34, 96, 9, "Listen", TR_NOOP ("Modulator|Carrier|Mix")));
+    v.push_back (slider (Item::vslider, 303, 48, 20, 82, "Modulator", nullptr, noCaption));
+    v.push_back (slider (Item::vslider, 335, 48, 20, 82, "Carrier", nullptr, noCaption));
+    v.push_back (slider (Item::vslider, 368, 48, 20, 82, "Wet", nullptr, noCaption));
+    v.push_back (label (295, 133, 36, 12, TR_NOOP ("Mod")));
+    v.push_back (label (327, 133, 36, 12, TR_NOOP ("Car")));
+    v.push_back (label (360, 133, 36, 12, TR_NOOP ("Wet")));
+    v.push_back (section (13, 160, 388, 132, nullptr, boxed | raised));
+    v.push_back (label (18, 163, 200, 18, "Fruity Vocoder", dim | alignLeft));
+    v.push_back (toggle (345, 165, 50, 15, "Hold", TR_NOOP ("Hold"), boxed));
+    v.push_back (display (18, 183, 378, 86, "vocbands", "Bands"));
+    v.push_back (label (17, 273, 54, 14, TR_NOOP ("Bands"), alignLeft));
+    v.push_back (tabs (76, 273, 154, 14, "Bands", "4|8|16|32|64|128"));
+    v.push_back (label (285, 273, 54, 14, TR_NOOP ("Filter")));
+    v.push_back (tabs (343, 273, 53, 14, "Order", "1|2|3"));
+    l.menuSwitches = { "Side inputs" };
+    return l;
+}
+
+Layout frequencySplitterLayout()
+{
+    // the band graph on top; CROSSOVER (slope, freq, bands 2 / 3, freq, slope) · MAIN OUT (low / mid / high level and
+    // their switches) · SENDS (each band's send: output switch, level and switch); linear phase, precision and speed at
+    // the bottom. The solo switches (FL: behind the panels' arrow buttons, not confirmed) are in the options menu.
+    Layout l;
+    l.fl = "Frequency Splitter";
+    l.width = 776;
+    l.height = 340;
+    auto& v = l.items;
+    v.push_back (display (10, 6, 755, 214, "fsplit"));
+    v.push_back (section (10, 223, 282, 80, nullptr, boxed));
+    v.push_back (stepper (19, 243, 48, 19, "Low/mid slope", nullptr, 7));
+    v.push_back (label (19, 267, 48, 12, TR_NOOP ("Slope")));
+    v.push_back (knob (97, 250, 40, "Low/mid freq.", TR_NOOP ("Freq"), 285));
+    v.push_back (toggle (136, 245, 30, 13, "3 bands", "3", boxed));
+    v.push_back (label (127, 263, 48, 12, TR_NOOP ("Bands")));
+    v.push_back (knob (202, 250, 40, "Mid/high freq.", TR_NOOP ("Freq"), 285));
+    v.push_back (stepper (237, 243, 48, 19, "Mid/high slope", nullptr, 7));
+    v.push_back (label (237, 267, 48, 12, TR_NOOP ("Slope")));
+    v.push_back (label (14, 289, 100, 12, TR_NOOP ("Crossover"), dim | alignLeft));
+    v.push_back (section (295, 223, 190, 80, nullptr, boxed));
+    const char* const outs[3] { "Low level", "Mid level", "High level" };
+    const char* const outMutes[3] { "Low mute", "Mid mute", "High mute" };
+    const char* const sends[3] { "Low send", "Mid send", "High send" };
+    const char* const sendMutes[3] { "Low send mute", "Mid send mute", "High send mute" };
+    const char* const sendOut[3] { "Out: low", "Out: mid", "Out: high" };
+    const char* const names[3] { TR_NOOP ("Low"), TR_NOOP ("Mid"), TR_NOOP ("High") };
+    for (int b = 0; b < 3; ++b)
+    {
+        const auto cx = 337.0f + 59.0f * (float) b;
+        auto k = knob (cx, 248, 32, outs[b], nullptr, 0, noCaption);
+        k.colour = b;
+        v.push_back (k);
+        v.push_back (toggle (cx - 25, 268, 20, 11, outMutes[b], nullptr, inverted));
+        v.push_back (label (cx - 6, 268, 30, 11, names[b], alignLeft));
+    }
+    v.push_back (label (299, 289, 100, 12, TR_NOOP ("Main out"), dim | alignLeft));
+    v.push_back (section (490, 223, 275, 80, nullptr, boxed));
+    for (int b = 0; b < 3; ++b)
+    {
+        const auto x0 = 497.0f + 90.0f * (float) b;
+        v.push_back (toggle (x0, 241, 38, 18, sendOut[b], TR_NOOP ("Out"), boxed));
+        auto k = knob (x0 + 65.0f, 248, 32, sends[b], nullptr, 0, noCaption);
+        k.colour = b;
+        v.push_back (k);
+        v.push_back (toggle (x0 + 40.0f, 268, 20, 11, sendMutes[b], nullptr, inverted));
+        v.push_back (label (x0 + 59.0f, 268, 30, 11, names[b], alignLeft));
+    }
+    v.push_back (label (494, 289, 100, 12, TR_NOOP ("Sends"), dim | alignLeft));
+    v.push_back (toggle (12, 313, 100, 16, "FFT mode", TR_NOOP ("Linear phase")));
+    v.push_back (label (114, 313, 46, 16, TR_NOOP ("Precision")));
+    v.push_back (menu (162, 313, 62, 16, "FFT quality", TR_NOOP ("Lowest|Low|Medium|High|Higher|Highest"), { 0.0f, 0.2f, 0.4f, 0.6f, 0.8f, 1.0f }));
+    v.push_back (label (229, 313, 40, 16, TR_NOOP ("Speed")));
+    v.push_back (slider (Item::hslider, 272, 313, 70, 16, "FFT fade", nullptr, noCaption));
+    v.push_back (label (560, 306, 200, 28, "Frequency Splitter", dim));
+    l.menuSwitches = { "Low solo", "Mid solo", "High solo", "Low send solo", "Mid send solo", "High send solo" };
+    return l;
+}
+
+Layout fruityDelayBankLayout()
+{
+    // bank switches (LEDs) and the bank tabs 1…8 on top, OVERSAMPLE, DRY / WET / IN / FB; then the selected bank:
+    // IN (pan, vol) · FILTER (type, sections, post, gain, cut, res) · FEEDBACK (pattern tap, tempo sync, mode
+    // off / inv / norm / ping-pong, time / offset / separation faders, pan, vol) · FB FILTER · GRAIN (div, shape) ·
+    // OUT (send to the next bank, pan, vol). Everything but the four globals lives in the slot state.
+    constexpr auto k = EffectKind::fruityDelayBank;
+    Layout l;
+    l.fl = "Fruity Delay Bank";
+    l.width = 583;
+    l.height = 278;
+    l.pages = { "1", "2", "3", "4", "5", "6", "7", "8" };
+    auto& v = l.items;
+    v.push_back (section (6, 4, 571, 58, nullptr, boxed));
+    for (int b = 0; b < 8; ++b)
+        v.push_back (toggle (17.0f + 28.0f * (float) b, 16, 13, 10, stateName (k, stateparams::bankControl (b, "On")), nullptr, boxed));
+    v.push_back (pageTabs (10, 33, 222, 26, "1|2|3|4|5|6|7|8"));
+    LayoutItem ovs = menu (322, 31, 70, 16, stateName (k, "Oversample"), TR_NOOP ("Off|2x|4x"), { 0.0f, 0.5f, 1.0f });
+    v.push_back (ovs);
+    v.push_back (label (322, 47, 70, 11, TR_NOOP ("Oversample")));
+    knobCaptionAbove (v, 418, 41, 28, "Dry", TR_NOOP ("Dry"), 13);
+    knobCaptionAbove (v, 463, 41, 28, "Output", TR_NOOP ("Wet"), 13);
+    knobCaptionAbove (v, 507, 41, 28, "Input", TR_NOOP ("In"), 13);
+    knobCaptionAbove (v, 552, 41, 28, "Feedback", TR_NOOP ("FB"), 13);
+
+    const auto filterTypes = TR_NOOP ("Off|Low pass|Band pass|Notch|High pass|Low shelf|Peaking|High shelf");
+    const std::vector<float> eighths { 0.0f, 1.0f / 7, 2.0f / 7, 3.0f / 7, 4.0f / 7, 5.0f / 7, 6.0f / 7, 1.0f };
+    for (int b = 0; b < 8; ++b)
+    {
+        const auto p = [&] (const char* control) { return stateName (k, stateparams::bankControl (b, control)); };
+        const auto add = [&] (LayoutItem i) { v.push_back (onPage (std::move (i), b)); };
+        const auto dial = [&] (float cx, float cy, const char* control, const char* caption, std::uint16_t style = 0) {
+            add (knob (cx, cy, 30, p (control), caption, cy + 29, style));
+        };
+        const auto fader = [&] (float cx, const char* control, const char* caption, std::uint16_t style = 0) {
+            add (slider (Item::vslider, cx - 10, 140, 20, 108, p (control), nullptr, noCaption | style));
+            add (label (cx - 18, 255, 36, 12, caption));
+        };
+        add (section (10, 68, 56, 205, TR_NOOP ("In")));
+        dial (37, 175, "Input pan", TR_NOOP ("Pan"), bipolar);
+        dial (37, 233, "Input volume", TR_NOOP ("Vol"), bipolar);
+
+        add (section (70, 68, 107, 205, TR_NOOP ("Filter")));
+        add (menu (76, 98, 46, 16, p ("Filter 1 type"), filterTypes, eighths));
+        add (tabs (125, 98, 45, 16, p ("Filter 1 order"), "1|2|3"));
+        add (toggle (90, 172, 16, 10, p ("Filter 1 post"), nullptr, boxed));
+        add (label (74, 199, 46, 12, TR_NOOP ("Post")));
+        dial (145, 175, "Filter 1 gain", TR_NOOP ("Gain"), bipolar);
+        dial (97, 233, "Filter 1 cutoff", TR_NOOP ("Cut"));
+        dial (149, 233, "Filter 1 resonance", TR_NOOP ("Res"));
+
+        add (section (181, 68, 149, 205, TR_NOOP ("Feedback")));
+        add (toggle (188, 88, 14, 13, p ("Tap"), "|", boxed));
+        add (toggle (188, 107, 14, 13, p ("Sync"), "T", boxed));
+        LayoutItem mode = radio (210, 88, 116, 32, p ("Mode"), TR_NOOP ("Off|Norm|Inv|P.pong"), { 0.0f, 1.0f / 3, 2.0f / 3, 1.0f });
+        mode.columns = 2;
+        add (mode);
+        fader (194, "Time", TR_NOOP ("Time"));
+        fader (228, "Stereo offset", TR_NOOP ("Ofs"), bipolar);
+        fader (263, "Feedback cross", TR_NOOP ("Sep"), bipolar);
+        dial (303, 175, "Feedback pan", TR_NOOP ("Pan"), bipolar);
+        dial (303, 233, "Feedback level", TR_NOOP ("Vol"), bipolar);
+
+        add (section (335, 68, 107, 205, TR_NOOP ("FB filter")));
+        add (menu (341, 98, 46, 16, p ("Filter 2 type"), filterTypes, eighths));
+        add (tabs (390, 98, 45, 16, p ("Filter 2 order"), "1|2|3"));
+        dial (408, 175, "Filter 2 gain", TR_NOOP ("Gain"), bipolar);
+        dial (362, 233, "Filter 2 cutoff", TR_NOOP ("Cut"));
+        dial (413, 233, "Filter 2 resonance", TR_NOOP ("Res"));
+
+        add (section (446, 68, 65, 205, TR_NOOP ("Grain")));
+        fader (462, "Steps", TR_NOOP ("Div"));
+        fader (495, "Shape", TR_NOOP ("Sh"), bipolar);
+
+        add (section (516, 68, 56, 205, TR_NOOP ("Out")));
+        if (b < 7)
+            dial (543, 116, "Send to next", TR_NOOP ("Next"), bipolar);
+        dial (543, 175, "Output pan", TR_NOOP ("Pan"), bipolar);
+        dial (543, 233, "Output volume", TR_NOOP ("Vol"), bipolar);
+    }
+    // the solo bank (FL: right-click on a bank tab, not confirmed) and bank 8's missing send
+    l.editedElsewhere = { stateName (k, "Solo"), stateName (k, stateparams::bankControl (7, "Unused")) };
+    return l;
+}
+
+Layout equoLayout()
+{
+    // GRAPHIC EQ: the 31 bands of the selected bank and target (drag to draw), BANK M / 1…8, VOL / PAN / SEND;
+    // MORPH (shift, mix, morph, smooth, vol) and SETUP (send only, add mode, oversample, bandwidth). The page is the
+    // target (×1) and the bank (×3).
+    Layout l;
+    l.fl = "EQUO";
+    l.width = 572;
+    l.height = 245;
+    auto& v = l.items;
+    v.push_back (section (12, 10, 388, 220, nullptr, boxed | raised));
+    v.push_back (label (19, 13, 150, 22, "Graphic EQ", dim | alignLeft));
+    v.push_back (display (19, 40, 371, 160, "equobars"));
+    v.push_back (label (19, 208, 36, 15, TR_NOOP ("Bank"), boxed));
+    v.push_back (pageDigit (58, 208, 164, 15, "M|1|2|3|4|5|6|7|8", 3));
+    v.push_back (pageDigit (267, 208, 123, 15, TR_NOOP ("Vol|Pan|Send"), 1));
+    v.push_back (section (407, 5, 155, 130, TR_NOOP ("Morph")));
+    v.push_back (knob (426, 45, 30, "Band shift", TR_NOOP ("Shift"), 71, bipolar));
+    v.push_back (knob (483, 45, 30, "Band mix", TR_NOOP ("Mix"), 71, bipolar));
+    v.push_back (knob (542, 45, 30, "Morph", TR_NOOP ("Morph"), 71));
+    v.push_back (knob (457, 100, 30, "Smoothness", TR_NOOP ("Smooth"), 126));
+    v.push_back (knob (515, 100, 30, "Volume", TR_NOOP ("Vol"), 126));
+    v.push_back (section (407, 138, 155, 105, TR_NOOP ("Setup")));
+    v.push_back (toggle (410, 160, 100, 12, "Send only", TR_NOOP ("Send only")));
+    v.push_back (toggle (410, 205, 100, 12, "Add mode", TR_NOOP ("Add mode")));
+    v.push_back (toggle (410, 224, 100, 12, "Oversample", TR_NOOP ("Oversample")));
+    v.push_back (knob (539, 200, 28, "Bandwidth", TR_NOOP ("BW"), 229));
+    // the band cells are drawn in the graph (core/StateParams.h: "Bank 1 volume 1" …)
+    for (const auto& p : stateparams::tableFor (EffectKind::equo)->params)
+        l.editedElsewhere.push_back (p.name.c_str());
+    return l;
+}
+
+Layout multibandDelayLayout()
+{
+    // the 16 bands of the selected bank and target (drag to draw) with their frequencies; DELAY / VOL / PAN, BANK 1…8;
+    // crossover mode · SCALE (×0.1, harmonic, weighted), FEEDBACK · SMOOTHING TIME, KEEP PITCH · MORPH · WET (comp / sat /
+    // clip), HP · MIX. The selected target and bank are FL's (saved in the state).
+    constexpr auto k = EffectKind::multibandDelay;
+    Layout l;
+    l.fl = "Multiband Delay";
+    l.width = 568;
+    l.height = 292;
+    auto& v = l.items;
+    v.push_back (display (11, 8, 544, 180, "mbdbars"));
+    v.push_back (tabs (93, 195, 143, 15, stateName (k, "Target"), TR_NOOP ("Delay|Vol|Pan")));
+    v.push_back (label (245, 195, 35, 15, TR_NOOP ("Bank")));
+    v.push_back (tabs (282, 195, 134, 15, stateName (k, "Bank"), "1|2|3|4|5|6|7|8"));
+    v.push_back (label (432, 192, 123, 20, "Multiband Delay", dim));
+    v.push_back (radio (11, 226, 80, 44, "Filter mode", TR_NOOP ("Gentle|Steep|Linear phase")));
+    v.push_back (section (92, 222, 143, 50, nullptr, boxed | raised));
+    v.push_back (knob (118, 247, 32, "Delay scale", nullptr, 0, noCaption | bipolar));
+    v.push_back (toggle (145, 230, 40, 11, "Delay x0.1", TR_NOOP ("x 0.1")));
+    v.push_back (toggle (145, 254, 16, 14, "Harmonic scale", "H", boxed));
+    v.push_back (toggle (167, 254, 16, 14, "Weighting", "W", boxed));
+    v.push_back (knob (209, 247, 32, "Feedback", nullptr, 0, noCaption));
+    v.push_back (label (94, 275, 48, 12, TR_NOOP ("Scale")));
+    v.push_back (label (182, 275, 54, 12, TR_NOOP ("Feedback")));
+    v.push_back (section (241, 222, 116, 50, nullptr, boxed | raised));
+    v.push_back (knob (267, 247, 32, "Smoothing", nullptr, 0, noCaption));
+    v.push_back (toggle (290, 230, 66, 11, "Keep pitch", TR_NOOP ("Keep pitch")));
+    v.push_back (label (241, 275, 116, 12, TR_NOOP ("Smoothing time")));
+    v.push_back (section (363, 222, 50, 50, nullptr, boxed | raised));
+    v.push_back (knob (388, 247, 32, "Morph", nullptr, 0, noCaption));
+    v.push_back (label (363, 275, 50, 12, TR_NOOP ("Morph")));
+    v.push_back (section (420, 222, 90, 50, nullptr, boxed | raised));
+    v.push_back (radio (424, 226, 42, 44, "Saturation", TR_NOOP ("Comp|Sat|Clip")));
+    v.push_back (knob (488, 247, 28, "High pass", nullptr, 0, noCaption));
+    v.push_back (label (420, 275, 46, 12, TR_NOOP ("Wet")));
+    v.push_back (label (470, 275, 36, 12, TR_NOOP ("HP")));
+    v.push_back (knob (536, 247, 34, "Mix", nullptr, 0, noCaption | bipolar));
+    v.push_back (label (514, 275, 44, 12, TR_NOOP ("Mix")));
+    for (int i = 0; i < mbdelay::numBanks * 48; ++i)
+        l.editedElsewhere.push_back (stateparams::tableFor (k)->name (i));
+    return l;
+}
+
+Layout convolverLayout()
+{
+    // dry, in (input separation), wet, wet separation · delay, self-conv, stretch, eq (the state's knobs); NORMALIZE;
+    // the impulse response's waveform with its rate, format and length. FL's sample editor tools and its equalizer page
+    // are not reproduced (LYNX keeps the state's EQ curve as it is).
+    constexpr auto k = EffectKind::convolver;
+    Layout l;
+    l.fl = "Fruity Convolver";
+    l.width = 722;
+    l.height = 300;
+    auto& v = l.items;
+    v.push_back (section (2, 2, 718, 96, nullptr, boxed));
+    v.push_back (knob (41, 32, 40, "Dry", TR_NOOP ("Dry"), 68));
+    v.push_back (knob (112, 36, 28, "Input separation", TR_NOOP ("In"), 68, bipolar));
+    v.push_back (knob (162, 32, 40, "Wet", TR_NOOP ("Wet"), 68));
+    v.push_back (knob (211, 36, 28, "Wet separation", TR_NOOP ("Wet"), 68, bipolar));
+    v.push_back (knob (281, 32, 40, stateName (k, "Predelay"), TR_NOOP ("Delay"), 68));
+    v.push_back (knob (340, 32, 40, stateName (k, "Self-conv"), TR_NOOP ("Self-conv"), 68));
+    v.push_back (knob (397, 32, 40, stateName (k, "Stretch"), TR_NOOP ("Stretch"), 68, bipolar));
+    v.push_back (knob (456, 32, 40, stateName (k, "EQ"), TR_NOOP ("EQ"), 68));
+    v.push_back (toggle (622, 8, 90, 12, stateName (k, "Normalize"), TR_NOOP ("Normalize")));
+    v.push_back (label (560, 28, 150, 40, "Fruity Convolver", dim));
+    v.push_back (display (5, 104, 712, 20, "irinfo"));
+    v.push_back (display (5, 128, 712, 168, "irwave"));
+    return l;
+}
+
+Layout pitchShifterLayout()
+{
+    // VOICE / MUSIC tabs (the engine: PSOLA or granular) along the left, the pitch graph; then the page's controls —
+    // VOICE: PITCH, FORMANT faders, FORMANT CORRECTION and PITCH ANALYSIS (pitch mode, detector, channel); MUSIC: PITCH,
+    // DURATION faders, DENSITY, JITTER, RAND —, the DELAY panel (delay and feedback faders, T, OFF / POST / PRE /
+    // NO SHIFT) and MIX. Value plates above the faders and knobs, as FL's read-outs.
+    Layout l;
+    l.fl = "Pitch Shifter";
+    l.width = 744;
+    l.height = 280;
+    auto& v = l.items;
+    const auto voice = [&] (LayoutItem i) { v.push_back (when (std::move (i), "Granular", 0.0f, 0.5f)); };
+    const auto music = [&] (LayoutItem i) { v.push_back (when (std::move (i), "Granular", 0.5f, 1.0f)); };
+    const auto fader = [&] (float cx, float bottom, const char* param, const char* caption, std::uint16_t style, auto add) {
+        add (plate (cx - 21, 17, 42, 18, param));
+        add (slider (Item::vslider, cx - 10, 46, 20, bottom - 46, param, nullptr, noCaption | style));
+        add (label (cx - 30, 250, 60, 12, caption));
+    };
+    const auto always = [&] (LayoutItem i) { v.push_back (std::move (i)); };
+    v.push_back (tabs (8, 8, 30, 264, "Granular", TR_NOOP ("Voice|Music")));
+    v.push_back (section (40, 5, 260, 270, nullptr, boxed));
+    voice (display (44, 9, 252, 230, "xy", "Formant", "Pitch"));
+    music (display (44, 9, 252, 230, "psgraph"));
+    v.push_back (label (48, 244, 160, 26, "Pitch Shifter", dim | alignLeft));
+    v.push_back (section (304, 8, 120, 262, nullptr, boxed));
+    fader (333, 236, "Pitch", TR_NOOP ("Pitch"), bipolar, always);
+    fader (391, 236, "Formant", TR_NOOP ("Formant"), bipolar, voice);
+    fader (391, 236, "Duration", TR_NOOP ("Duration"), 0, music);
+    v.push_back (section (427, 8, 119, 262, nullptr, boxed));
+    voice (plate (465, 17, 42, 18, "Formant correction"));
+    voice (knob (486, 75, 44, "Formant correction", TR_NOOP ("Formant correction"), 117));
+    voice (menu (447, 156, 80, 16, "Pitch mode", TR_NOOP ("Relative|C4|C5|C6"), { 0.0f, 1.0f / 3, 2.0f / 3, 1.0f }));
+    voice (menu (447, 189, 80, 16, "Accurate detector", TR_NOOP ("Fast|Accurate")));
+    voice (menu (447, 222, 80, 16, "Channel", TR_NOOP ("Left|Right|Left + right")));
+    voice (label (432, 250, 110, 12, TR_NOOP ("Pitch analysis")));
+    music (plate (465, 17, 42, 18, "Density"));
+    music (knob (486, 75, 44, "Density", TR_NOOP ("Density"), 117));
+    music (plate (436, 171, 42, 18, "Jitter"));
+    music (knob (457, 218, 28, "Jitter", TR_NOOP ("Jitter"), 255));
+    music (plate (494, 171, 42, 18, "Random"));
+    music (knob (515, 218, 28, "Random", TR_NOOP ("Rand"), 255));
+    v.push_back (section (549, 8, 123, 262, nullptr, boxed));
+    v.push_back (plate (558, 17, 46, 18, "Delay"));
+    v.push_back (slider (Item::vslider, 570, 46, 20, 106, "Delay", nullptr, noCaption));
+    v.push_back (plate (617, 17, 42, 18, "Feedback"));
+    v.push_back (slider (Item::vslider, 628, 46, 20, 106, "Feedback", nullptr, noCaption));
+    v.push_back (label (556, 160, 36, 12, TR_NOOP ("Delay")));
+    v.push_back (toggle (594, 160, 12, 12, "Tempo sync", "T", boxed));
+    v.push_back (label (609, 160, 58, 12, TR_NOOP ("Feedback")));
+    v.push_back (radio (588, 180, 70, 60, "Delay mode", TR_NOOP ("Off|Post|Pre|No shift"), { 0.0f, 1.0f / 3, 2.0f / 3, 1.0f }));
+    v.push_back (label (556, 250, 110, 12, TR_NOOP ("Delay mode")));
+    v.push_back (section (675, 8, 63, 262, nullptr, boxed));
+    fader (706, 236, "Mix", TR_NOOP ("Mix"), 0, always);
+    return l;
+}
+
+Layout effectorLayout()
+{
+    // input / output gain on the title strip; X PARAM, Y PARAM, BYPASS, DRY/WET at the left; the X/Y pad; the tempo
+    // divisions; X MOD, Y MOD, the LFO shape and TEMPO at the right; the twelve effect buttons along the bottom
+    Layout l;
+    l.fl = "Effector";
+    l.width = 436;
+    l.height = 412;
+    auto& v = l.items;
+    v.push_back (section (5, 3, 426, 50, nullptr, boxed));
+    v.push_back (knob (37, 23, 26, "Input", TR_NOOP ("Gain"), 46));
+    v.push_back (knob (399, 23, 26, "Output", TR_NOOP ("Gain"), 46, bipolar));
+    v.push_back (label (130, 8, 176, 38, "Effector", dim));
+    v.push_back (section (5, 60, 62, 258, nullptr, boxed));
+    v.push_back (knob (37, 91, 30, "X", TR_NOOP ("X param"), 116));
+    v.push_back (knob (37, 153, 30, "Y", TR_NOOP ("Y param"), 178));
+    v.push_back (toggle (27, 205, 20, 20, "Bypass", nullptr, boxed));
+    v.push_back (label (10, 232, 54, 12, TR_NOOP ("Bypass")));
+    v.push_back (knob (37, 280, 30, "Wet", TR_NOOP ("Dry/wet"), 305));
+    v.push_back (display (72, 60, 258, 258, "xy", "X", "Y"));
+    v.push_back (radio (334, 62, 30, 254, "Mod rate", "8/1|4/1|2/1|1/1|3/4|1/2|3/8|1/4|1/8",
+                        { 1.0f, 7.0f / 8, 6.0f / 8, 5.0f / 8, 4.0f / 8, 3.0f / 8, 2.0f / 8, 1.0f / 8, 0.0f }));
+    v.push_back (section (369, 60, 62, 258, nullptr, boxed));
+    v.push_back (knob (399, 91, 30, "Mod X", TR_NOOP ("X mod"), 116, bipolar));
+    v.push_back (knob (399, 153, 30, "Mod Y", TR_NOOP ("Y mod"), 178, bipolar));
+    v.push_back (radio (382, 196, 34, 54, "LFO shape", TR_NOOP ("Sine|Saw|Square")));
+    v.push_back (knob (399, 280, 30, "Tempo red.", TR_NOOP ("Tempo"), 305));
+    LayoutItem type = radio (8, 326, 420, 80, "Type", TR_NOOP ("Distort|Lo-fi|Flanger|Phaser|Filter|Delay|Reverb|Stereo|Trans|Grain|Vox|Ring"));
+    type.columns = 6;
+    v.push_back (type);
+    return l;
+}
+
+Layout hardcoreLayout()
+{
+    // INPUT, OUTPUT; EQ on and its eight band faders (125 Hz … 16 kHz); CABINET; five pedal boxes, each with its LED
+    // (box on), the knobs of its pedal (captions per pedal type, the knobs a pedal does not use are hidden) and the
+    // pedal type under it. FL's preset browser (.hdprg) is not reproduced.
+    Layout l;
+    l.fl = "Hardcore";
+    l.width = 772;
+    l.height = 475;
+    auto& v = l.items;
+    v.push_back (section (5, 5, 762, 57, nullptr, boxed));
+    v.push_back (label (17, 9, 150, 40, "Hardcore", dim | alignLeft));
+    v.push_back (knob (183, 29, 26, "Input level", nullptr, 0, noCaption | bipolar));
+    v.push_back (label (199, 14, 50, 12, TR_NOOP ("Input"), alignLeft));
+    v.push_back (value (199, 32, 60, 14, "Input level"));
+    v.push_back (knob (273, 29, 26, "Output level", nullptr, 0, noCaption | bipolar));
+    v.push_back (label (289, 14, 50, 12, TR_NOOP ("Output"), alignLeft));
+    v.push_back (value (289, 32, 60, 14, "Output level"));
+    v.push_back (section (362, 8, 262, 50, nullptr, boxed | raised));
+    v.push_back (label (374, 12, 30, 12, TR_NOOP ("EQ")));
+    v.push_back (toggle (380, 30, 16, 16, "EQ on", nullptr, boxed));
+    static const char* const bands[8] { "125", "250", "500", "1k", "2k", "4k", "8k", "16k" };
+    static const char* const bandParams[8] { "EQ band 1", "EQ band 2", "EQ band 3", "EQ band 4", "EQ band 5", "EQ band 6", "EQ band 7", "EQ band 8" };
+    for (int b = 0; b < 8; ++b)
+    {
+        const auto x = 410.0f + 16.0f * (float) b;
+        v.push_back (label (x - 1, 11, 16, 10, bands[b]));
+        v.push_back (slider (Item::vslider, x, 22, 14, 34, bandParams[b], nullptr, noCaption | bipolar));
+    }
+    v.push_back (label (545, 12, 70, 12, TR_NOOP ("Cabinet")));
+    v.push_back (menu (545, 28, 70, 18, "Cabinet",
+                       "None|Model A|Model B|Model C|Model D|Model E|Model F|Model G|Model H|Model I|Model J|Model K|Model L|Model M|Model N|Model O|Model P|Model Q|Model R|Model S|Model T"));
+
+    // pedal types 1…11 and the captions of their knobs (FL's pedal artwork); 3-knob pedals put the third one in the middle
+    struct Pedal
+    {
+        const char* name;
+        const char* knobs[4];
+    };
+    static const Pedal pedals[12] { { "", {} },
+                                    { TR_NOOP ("Distortion"), { TR_NOOP ("Dist"), TR_NOOP ("Comb"), TR_NOOP ("Inferno"), TR_NOOP ("Glass") } },
+                                    { TR_NOOP ("Chorus"), { TR_NOOP ("Width"), TR_NOOP ("Speed"), TR_NOOP ("Intensity"), nullptr } },
+                                    { TR_NOOP ("Flanger"), { TR_NOOP ("Width"), TR_NOOP ("Speed"), TR_NOOP ("Intensity"), nullptr } },
+                                    { TR_NOOP ("Phaser"), { TR_NOOP ("Speed"), TR_NOOP ("Tune"), TR_NOOP ("Width"), TR_NOOP ("Intensity") } },
+                                    { TR_NOOP ("Reverb"), { TR_NOOP ("Decay"), TR_NOOP ("Hi-damp"), TR_NOOP ("Mix"), nullptr } },
+                                    { TR_NOOP ("Delay"), { TR_NOOP ("Time"), TR_NOOP ("Decay"), TR_NOOP ("Mix"), nullptr } },
+                                    { TR_NOOP ("Noise gate"), { TR_NOOP ("Attack"), TR_NOOP ("Release"), TR_NOOP ("Threshold"), nullptr } },
+                                    { TR_NOOP ("Equalizer"), { TR_NOOP ("Low"), TR_NOOP ("Middle"), TR_NOOP ("Treble"), TR_NOOP ("High") } },
+                                    { TR_NOOP ("Compressor"), { TR_NOOP ("Threshold"), TR_NOOP ("Ratio"), TR_NOOP ("Attack"), TR_NOOP ("Release") } },
+                                    { TR_NOOP ("Modulator"), { TR_NOOP ("Pitch"), TR_NOOP ("Amp"), TR_NOOP ("Pan"), TR_NOOP ("Rate") } },
+                                    { TR_NOOP ("Tube drive"), { TR_NOOP ("Low"), TR_NOOP ("High"), TR_NOOP ("Gain"), nullptr } } };
+    static const char* const typeParams[5] { "Box 1 pedal", "Box 2 pedal", "Box 3 pedal", "Box 4 pedal", "Box 5 pedal" };
+    static const char* const onParams[5] { "Box 1 on", "Box 2 on", "Box 3 on", "Box 4 on", "Box 5 on" };
+    static const char* const knobParams[5][5] {
+        { "Box 1 knob 1", "Box 1 knob 2", "Box 1 knob 3", "Box 1 knob 4", "Box 1 knob 5" },
+        { "Box 2 knob 1", "Box 2 knob 2", "Box 2 knob 3", "Box 2 knob 4", "Box 2 knob 5" },
+        { "Box 3 knob 1", "Box 3 knob 2", "Box 3 knob 3", "Box 3 knob 4", "Box 3 knob 5" },
+        { "Box 4 knob 1", "Box 4 knob 2", "Box 4 knob 3", "Box 4 knob 4", "Box 4 knob 5" },
+        { "Box 5 knob 1", "Box 5 knob 2", "Box 5 knob 3", "Box 5 knob 4", "Box 5 knob 5" } };
+    for (int box = 0; box < 5; ++box)
+    {
+        const auto x0 = 22.0f + 147.0f * (float) box;
+        v.push_back (section (x0, 150, 130, 270, nullptr, boxed));
+        v.push_back (section (x0 + 8, 175, 114, 128, nullptr, boxed | raised));
+        v.push_back (toggle (x0 + 61, 226, 14, 14, onParams[box], nullptr, boxed));
+        for (int t = 1; t <= 11; ++t)
+        {
+            const auto lo = ((float) t - 0.499f) / 11.0f, hi = ((float) t + 0.501f) / 11.0f; // as the engine rounds a saved 0.5
+            const auto& p = pedals[t];
+            const auto three = p.knobs[3] == nullptr;
+            for (int k = 0; k < (three ? 3 : 4); ++k)
+            {
+                const auto cx = three && k == 2 ? x0 + 68.0f : x0 + 37.0f + 60.0f * (float) (k % 2);
+                const auto cy = k < 2 ? 203.0f : (three ? 257.0f : 255.0f);
+                v.push_back (when (knob (cx, cy, 26, knobParams[box][k], p.knobs[k], cy + 20), typeParams[box], lo, hi));
+            }
+            v.push_back (when (label (x0 + 10, 282, 110, 16, p.name), typeParams[box], lo, hi));
+        }
+        v.push_back (menu (x0 + 3, 453, 127, 16, typeParams[box],
+                           TR_NOOP ("(empty)|Distortion|Chorus|Flanger|Phaser|Reverb|Delay|Noise gate|Equalizer|Compressor|Modulator|Tube drive")));
+        l.editedElsewhere.push_back (knobParams[box][4]); // no pedal has a fifth knob
+    }
+    l.editedElsewhere.push_back ("(unused 12)");
+    l.editedElsewhere.push_back ("(unused 38)");
+    l.editedElsewhere.push_back ("(unused 44)");
+    return l;
+}
+
+Layout vocodexLayout()
+{
+    // Mixer (WET, SG, MOD, CAR, +NOISE faders, the three filters, MOD / CAR inputs, L-R ENCODING), Contour (from car /
+    // consonants, to mod / noise), DRAFT, THREADED; the envelope follower (HOLD, ATT, REL, their curves, PEAK / RMS,
+    // MIN TIMES, freeze), ORDER, the band and unison knobs, the number of bands; then the band map (read-only: FL's map
+    // editor and the carrier synthesizer's patch browser are not reproduced). All controls live in the slot state.
+    constexpr auto k = EffectKind::vocodex;
+    const auto p = [] (const char* name) { return stateName (EffectKind::vocodex, name); };
+    Layout l;
+    l.fl = "Vocodex";
+    l.width = 598;
+    l.height = 600;
+    auto& v = l.items;
+    v.push_back (section (5, 3, 588, 140, nullptr, boxed | raised));
+    v.push_back (label (14, 8, 60, 18, TR_NOOP ("Mixer"), alignLeft));
+    v.push_back (label (40, 30, 54, 11, TR_NOOP ("Wet")));
+    v.push_back (knob (52, 84, 74, p ("Wet"), nullptr, 0, noCaption | big));
+    const auto fader = [&] (float cx, float top, const char* param, const char* caption, float captionY) {
+        v.push_back (slider (Item::vslider, cx - 9, top, 18, 112 - top, param, nullptr, noCaption));
+        v.push_back (label (cx - 22, captionY, 44, 11, caption));
+    };
+    fader (113, 42, p ("SG"), TR_NOOP ("SG"), 30);
+    fader (157, 42, p ("Mod level"), TR_NOOP ("Mod"), 30);
+    fader (186, 42, p ("Car level"), TR_NOOP ("Car"), 30);
+    fader (215, 54, p ("Noise"), TR_NOOP ("+Noise"), 42);
+    v.push_back (knob (148, 128, 20, p ("Mod HP"), nullptr, 0, noCaption));
+    v.push_back (label (122, 122, 18, 12, TR_NOOP ("HP")));
+    v.push_back (knob (183, 128, 20, p ("Car LP"), nullptr, 0, noCaption));
+    v.push_back (knob (215, 128, 20, p ("Noise HP"), nullptr, 0, noCaption));
+    v.push_back (label (228, 122, 18, 12, TR_NOOP ("HP")));
+    v.push_back (stepper (142, 8, 32, 17, p ("Mod input"), nullptr, 8));
+    v.push_back (stepper (180, 8, 32, 17, p ("Car input"), nullptr, 9));
+    v.push_back (toggle (222, 8, 100, 13, p ("L-R encoding"), TR_NOOP ("L-R encoding")));
+    v.push_back (label (262, 62, 76, 16, TR_NOOP ("Contour")));
+    v.push_back (toggle (280, 82, 110, 12, p ("From car"), TR_NOOP ("Car")));
+    v.push_back (toggle (280, 97, 110, 12, p ("From consonants"), TR_NOOP ("Consonants")));
+    v.push_back (toggle (280, 111, 110, 12, p ("To mod"), TR_NOOP ("Mod")));
+    v.push_back (toggle (280, 125, 110, 12, p ("To noise"), TR_NOOP ("Noise")));
+    v.push_back (label (246, 97, 34, 12, TR_NOOP ("From")));
+    v.push_back (label (246, 111, 34, 12, TR_NOOP ("To")));
+    v.push_back (toggle (428, 8, 56, 13, p ("Draft"), TR_NOOP ("Draft")));
+    v.push_back (toggle (486, 8, 72, 13, p ("Threaded"), TR_NOOP ("Threaded")));
+    v.push_back (label (400, 60, 186, 50, "Vocodex", dim));
+
+    v.push_back (section (5, 147, 588, 135, nullptr, boxed));
+    v.push_back (knob (47, 180, 36, p ("Hold"), TR_NOOP ("Hold"), 208));
+    v.push_back (knob (104, 180, 36, p ("Attack"), TR_NOOP ("Att"), 208));
+    v.push_back (knob (159, 180, 36, p ("Release"), TR_NOOP ("Rel"), 208));
+    v.push_back (toggle (196, 172, 70, 13, p ("Min times"), TR_NOOP ("Min times")));
+    v.push_back (radio (14, 220, 46, 30, p ("Hold mode"), TR_NOOP ("Peak|RMS")));
+    v.push_back (knob (108, 234, 20, p ("Attack curve"), nullptr, 0, noCaption));
+    v.push_back (knob (163, 234, 20, p ("Release curve"), nullptr, 0, noCaption));
+    v.push_back (label (10, 262, 116, 16, TR_NOOP ("Envelope follower"), alignLeft));
+    v.push_back (toggle (130, 262, 18, 16, p ("Freeze"), "*", boxed));
+    v.push_back (tabs (281, 213, 56, 9, p ("Order"), "1|2|3|4"));
+    v.push_back (label (281, 225, 56, 11, TR_NOOP ("Order")));
+    v.push_back (knob (378, 178, 36, p ("Band width"), TR_NOOP ("Width"), 207));
+    v.push_back (knob (435, 178, 28, p ("Mod band width"), nullptr, 0, noCaption));
+    v.push_back (label (410, 201, 50, 12, TR_NOOP ("Mod width")));
+    v.push_back (knob (500, 178, 36, p ("Mod pitch"), TR_NOOP ("Mod pitch"), 207, bipolar));
+    v.push_back (knob (560, 178, 36, p ("Unison"), TR_NOOP ("Unison"), 207, 0, 4));
+    v.push_back (knob (379, 236, 22, p ("Flatness"), nullptr, 0, noCaption));
+    v.push_back (label (354, 250, 50, 12, TR_NOOP ("Flatness")));
+    v.push_back (knob (510, 236, 22, p ("Unison pitch"), nullptr, 0, noCaption));
+    v.push_back (label (485, 250, 50, 12, TR_NOOP ("Uni. pitch")));
+    v.push_back (knob (560, 236, 22, p ("Unison pan"), nullptr, 0, noCaption));
+    v.push_back (label (537, 250, 48, 12, TR_NOOP ("Uni. pan")));
+    v.push_back (stepper (266, 262, 36, 17, p ("Bands"), nullptr, 95));
+    v.push_back (label (306, 262, 130, 17, TR_NOOP ("Bands - distribution"), alignLeft));
+    v.push_back (display (10, 288, 578, 280, "vcxmap"));
+    v.push_back (display (10, 574, 578, 22, "vcxcarrier"));
+    l.menuSwitches = { p ("Subtractive gate") };
+    (void) k;
+    return l;
+}

+ 24 - 0
src/core/PluginScanPolicy.h

@@ -0,0 +1,24 @@
+#pragma once
+
+// How long the plugin scan waits for the child process that describes one plugin file (engine/PluginHost.cpp).
+// A plugin file can hold many plugins: a Waves "WaveShell" VST3 declares hundreds of classes, and describing each one
+// means creating and initialising it. A fixed 30 s limit blacklisted whole Waves bundles as "hung" (REA_rodada107 §2),
+// so every Waves plugin of a project fell back to a substitute. The child now reports how many classes the file has
+// before describing them, and the limit grows with that number.
+
+#include <algorithm>
+
+namespace lynx::scanpolicy
+{
+constexpr int baseTimeoutMs = 30000;          // a file with one plugin (or whose class count is not known)
+constexpr int perClassMs = 2000;              // each further class
+constexpr int maxTimeoutMs = 45 * 60 * 1000;  // never wait longer than this for one file
+
+constexpr int timeoutMs (int classes) noexcept
+{
+    if (classes <= 1)
+        return baseTimeoutMs;
+    const auto extra = (long long) (classes - 1) * perClassMs;
+    return (int) std::min<long long> ((long long) baseTimeoutMs + extra, maxTimeoutMs);
+}
+} // namespace lynx::scanpolicy

+ 6 - 1
src/core/PluginSubstitutes.cpp

@@ -250,9 +250,11 @@ product = Renaissance Compressor
 vendor = Waves
 lynx = Compressor
 # [DATA] class ID (stereo component) and <PluginName> from real projects; its RealWorld values are readable but
-# their meaning is not confirmed, so the default preset is used
+# their meaning is not confirmed, so the default preset is used, with auto gain: the substitute shapes the dynamics
+# but keeps the level (its makeup gain is unknown; round 107: without it her vocals came out 4 dB quieter)
 vst3 = 5554535643527253636f6d7072657373
 waves = RComp
+preset = Auto gain=1
 
 [waves-cla-2a]
 product = CLA-2A
@@ -269,6 +271,7 @@ product = Waves compressor (CLA-76 / CLA-3A / C1 / SSLComp / API-2500)
 vendor = Waves
 lynx = Compressor
 waves = CLA-76; CLA-3A; C1 comp; C1comp; SSLComp; API-2500
+preset = Auto gain=1
 
 [fabfilter-pro-c]
 product = FabFilter Pro-C
@@ -279,6 +282,8 @@ names = FabFilter Pro-C 2; FabFilter Pro-C 3; Pro-C 2; Pro-C 3
 # (component state "FFBS", 100 values) is translated: style, threshold, ratio, knee, range, attack, release, hold,
 # look-ahead, character, side-chain EQ (3 bands), levels, mix, oversampling. Pro-C 2 states keep the defaults.
 translate = pro-c3
+# auto gain on by default (round 107): keeps the level when the state is not readable
+preset = Auto gain=1
 
 [fabfilter-pro-mb]
 product = FabFilter Pro-MB

+ 4 - 3
src/core/RackRenderer.cpp

@@ -216,10 +216,11 @@ std::unique_ptr<const RackState> RackState::build (Song song,
                 && i < previous->song.mixer[t].effects.size() && i < previous->effects[t].size()
                 && previous->song.mixer[t].effects[i].kind == kind
                 && (kind != EffectKind::parallel || sameContainer (previous->song.mixer[t].effects[i], slots[i])) // children are built in
-                && previous->song.mixer[t].effects[i].state == slots[i].state
                 && previous->song.mixer[t].effects[i].samplePath == slots[i].samplePath
                 && (kind != EffectKind::plugin
-                    || (previous->song.mixer[t].effects[i].plugin.id == slots[i].plugin.id && previous->sampleRate == sampleRate)))
+                    || (previous->song.mixer[t].effects[i].plugin.id == slots[i].plugin.id && previous->sampleRate == sampleRate))
+                && (previous->song.mixer[t].effects[i].state == slots[i].state
+                    || (previous->sampleRate == sampleRate && previous->effects[t][i] != nullptr && previous->effects[t][i]->acceptState (slots[i].state))))
             {
                 state->effects[t].push_back (previous->effects[t][i]);
                 continue;
@@ -313,7 +314,7 @@ void RackState::buildMixerGraph()
             depth[(std::size_t) listener] = std::max (depth[(std::size_t) listener], depth[(std::size_t) t] + 1);
 
         if (track.toMaster)
-            mixerInputs[0].push_back ({ t, 0, 1.0f });
+            mixerInputs[0].push_back ({ t, 0, track.masterLevel });
 
         for (std::size_t k = 0; k < track.sends.size(); ++k)
         {

+ 4 - 1
src/core/Scheduler.cpp

@@ -144,8 +144,10 @@ void scheduleSong (const Song& song, double startTick, int numSamples, double tp
 
     const auto secondsPerTick = 60.0 / (std::max (song.bpm, 1.0) * ppq);
 
-    for (const auto& clip : song.playlist)
+    for (std::size_t clipIndex = 0; clipIndex < song.playlist.size(); ++clipIndex)
     {
+        const auto& clip = song.playlist[clipIndex];
+
         if (clip.muted || song.isTrackMuted (clip.track))
             continue;
 
@@ -156,6 +158,7 @@ void scheduleSong (const Song& song, double startTick, int numSamples, double tp
 
             NoteEvent e;
             e.channel = clip.channel;
+            e.key = audioClipKey (clipIndex);
             e.velocity = clip.gain;
             e.fadeIn = (float) ((double) clip.fadeIn / tps);
             e.fadeOut = (float) ((double) clip.fadeOut / tps);

+ 6 - 1
src/core/Scheduler.h

@@ -11,6 +11,11 @@
 
 namespace lynx
 {
+// Audio clip events carry the clip's own "key" (above the MIDI range): the end of a clip stops only the voice that clip
+// started. Two clips of the same channel overlapping (FL's crossfaded vocal comps) both play, as in FL (REA_rodada107 §5).
+constexpr int audioClipKeyBase = 128;
+constexpr int audioClipKey (std::size_t playlistIndex) noexcept { return audioClipKeyBase + (int) (playlistIndex % 1000000u); }
+
 struct NoteEvent
 {
     enum class Type : std::uint8_t { on, off, slide, choke }; // slide: glides the sounding notes to `key`; choke: cut group
@@ -18,7 +23,7 @@ struct NoteEvent
     int sampleOffset = 0;   // 0 .. numSamples-1 within the block
     Type type = Type::on;
     int channel = 0;
-    int key = 60;
+    int key = 60;           // audio clips: audioClipKey (the clip's playlist index), so a clip's end stops only its voice
     float velocity = 0.0f;
     double startSeconds = 0.0; // audio clips: where the sample starts playing from
     float pan = 0.0f;          // -1..1, from the note

+ 10 - 2
src/core/Song.cpp

@@ -231,9 +231,9 @@ void Song::setRoute (int from, int to, bool enabled, float level)
     }
 
     if (it != t.sends.end())
-        it->level = std::clamp (level, 0.0f, 1.0f);
+        it->level = std::clamp (level, 0.0f, maxFaderGain);
     else if (canRoute (from, to))
-        t.sends.push_back ({ to, std::clamp (level, 0.0f, 1.0f) });
+        t.sends.push_back ({ to, std::clamp (level, 0.0f, maxFaderGain) });
 }
 
 std::vector<int> Song::mixerOrder() const
@@ -775,6 +775,13 @@ float faderGain (float position) noexcept
     return (std::pow (11.0f, v) - 1.0f) / 10.0f;
 }
 
+float faderPosition (float gain) noexcept
+{
+    if (! (gain > 0.0f))
+        return 0.0f;
+    return std::clamp ((float) (std::log (10.0 * (double) gain + 1.0) / std::log (11.0) / 1.25), 0.0f, 1.0f);
+}
+
 Song makeExportSong (const Song& song, bool wholeSong, std::int64_t tailTicks, std::int64_t& musicLength)
 {
     Song out = song;
@@ -851,6 +858,7 @@ int applyBounce (Song& song, int track, const std::string& samplePath, std::int6
     MixerTrack copy;
     copy.name = original.name + " (audio)";
     copy.toMaster = original.toMaster;
+    copy.masterLevel = original.masterLevel;
     copy.sends = original.sends;
     original.muted = true;
     song.mixer.push_back (copy);

+ 13 - 1
src/core/Song.h

@@ -20,6 +20,11 @@ constexpr float unityFader = 0.8f;    // fader position that gives 0 dB, as in F
 // FL mixer fader curve: g = (11^v - 1) / 10 with v = position * 1.25 (0 dB at 0.8;
 // +5.6 dB at maximum). docs/analise/REA_rodada2.md §2.2.
 float faderGain (float position) noexcept;
+// Its inverse: the fader position (0..1) that gives `gain` (0 for gain <= 0, 1 for maxFaderGain and above).
+float faderPosition (float gain) noexcept;
+// Gain at the top of the fader: +5.6 dB. FL's insert-to-insert and insert-to-Master route levels use the same curve
+// and range (0..16000, 12800 = 0 dB; REA_rodada107 §3), so a send can reach it too.
+constexpr float maxFaderGain = 1.9031f;
 
 // Channel volume with the same curve, but 1.0 = 0 dB (FL's default, 0.78, gives -5.2 dB).
 // docs/analise/REA_rodada3.md §2.
@@ -289,6 +294,7 @@ struct ChannelDef
     int cutGroup = 0;        // playing this channel cuts channels with an equal cutBy (0 = none)
     int cutBy = 0;
     std::uint32_t colour = 0; // 0xFFRRGGBB; 0 = theme default
+    int group = -1;           // the Channel Rack filter group (index into Song::channelGroups); -1 = none
 };
 
 enum class EffectKind : std::uint8_t
@@ -425,7 +431,7 @@ struct EffectSlot
 struct MixerSend
 {
     int target = 0;      // destination track (> 0; Master is `toMaster`)
-    float level = 1.0f;  // 0..1 (linear gain)
+    float level = 1.0f;  // linear gain, 0..maxFaderGain (FL's send knob: the fader curve, 0 dB at 80%, +5.6 dB at 100%)
 
     bool operator== (const MixerSend& o) const noexcept { return target == o.target && level == o.level; }
 };
@@ -466,6 +472,7 @@ struct MixerTrack
     bool solo = false;
     std::vector<EffectSlot> effects; // up to maxEffectSlots, processed in order
     bool toMaster = true;            // inserts: output to Master (besides the sends)
+    float masterLevel = 1.0f;        // level of that route to Master (linear gain, 0..maxFaderGain; FL's route knob)
     float stereo = 0.0f;             // separation: -1 = widest, 0 = normal, +1 = mono (as in FL)
     std::uint32_t colour = 0;        // 0xFFRRGGBB; 0 = theme default
     bool invertPhase = false;
@@ -639,6 +646,10 @@ struct PlaylistTrack
     bool muted = false; // clips on this track don't play
     int height = 0;     // Playlist row height in px (0 = the default)
     std::uint32_t colour = 0; // header colour 0xFFRRGGBB (from the .flp or "Rename and color"); 0 = default
+    // Track groups (FL's "Group with above track"): a grouped track belongs to the group of the nearest
+    // ungrouped track above it (the group's header). `collapsed` on a header folds its members into thin rows.
+    bool grouped = false;
+    bool collapsed = false;
 };
 
 // Splits a clip at `tick` (absolute): the original keeps the start and the return value is the rest.
@@ -688,6 +699,7 @@ struct Song
     double bpm = 130.0;
     int beatsPerBar = 4;
     float swing = 0.0f; // 0..1: delays off-beat sixteenth notes (like the swing of FL's Channel Rack)
+    std::vector<std::string> channelGroups; // the Channel Rack's filter groups (FL's "All" dropdown), by name
     float masterPitch = 0.0f; // cents, -1200..1200: shifts every note of the built-in instruments (the toolbar's master pitch)
     ProjectInfo info;
     std::vector<ChannelDef> channels;

+ 38 - 0
src/core/StateHandoff.h

@@ -0,0 +1,38 @@
+#pragma once
+
+// One value handed from a non-real-time thread to the audio thread without locks or allocation on the audio side:
+// the writer fills the slot only while it is empty, the audio thread copies it out and empties it.
+
+#include <atomic>
+
+namespace lynx
+{
+template <typename T>
+class StateHandoff
+{
+public:
+    // writer (not the audio thread): false while the previous value has not been taken yet
+    bool offer (const T& value)
+    {
+        if (full.load (std::memory_order_acquire))
+            return false;
+        slot = value;
+        full.store (true, std::memory_order_release);
+        return true;
+    }
+
+    // audio thread: the offered value, if any
+    bool take (T& out) noexcept
+    {
+        if (! full.load (std::memory_order_acquire))
+            return false;
+        out = slot;
+        full.store (false, std::memory_order_release);
+        return true;
+    }
+
+private:
+    T slot {};
+    std::atomic<bool> full { false };
+};
+} // namespace lynx

+ 486 - 0
src/core/StateParams.cpp

@@ -0,0 +1,486 @@
+#include "core/StateParams.h"
+
+#include <algorithm>
+#include <cmath>
+#include <cstdio>
+#include <cstring>
+#include <map>
+#include <mutex>
+
+#include "core/ConvolverFx.h"
+#include "core/EquoFx.h"
+#include "core/FruityDelayBank.h"
+#include "core/MaximusFx.h"
+#include "core/MultibandDelayFx.h"
+#include "core/Vocodex.h"
+
+namespace lynx::stateparams
+{
+int Table::index (const char* n) const
+{
+    if (n == nullptr)
+        return -1;
+    for (int i = 0; i < (int) params.size(); ++i)
+        if (params[(std::size_t) i].name == n)
+            return i;
+    return -1;
+}
+
+const char* Table::name (int i) const
+{
+    return i >= 0 && i < (int) params.size() ? params[(std::size_t) i].name.c_str() : "";
+}
+
+namespace
+{
+std::string format (const char* f, double v)
+{
+    char text[48];
+    std::snprintf (text, sizeof (text), f, v);
+    return text;
+}
+
+std::string panText (double v) // −1…1
+{
+    if (std::abs (v) < 0.005)
+        return "Centred";
+    return format ("%.0f%%", std::abs (v) * 100.0) + (v < 0 ? " left" : " right");
+}
+
+// --- Maximus (core/MaximusFx.h): every control of its bands lives in the state -----------------------------------
+Table maximusTable()
+{
+    Table t;
+    for (const auto& p : maximusfx::stateParams())
+        t.params.push_back ({ p.name, p.minimum, p.maximum, p.defaultValue });
+    t.get = [] (const std::vector<std::uint8_t>& s, int i) { return maximusfx::stateParam (s, i); };
+    t.with = [] (const std::vector<std::uint8_t>& s, int i, int raw) { return maximusfx::withStateParam (s, i, raw); };
+    t.text = [] (const std::vector<std::uint8_t>&, int i, int raw) { return maximusfx::stateParamText (i, raw); };
+    return t;
+}
+
+// --- Fruity Delay Bank (core/FruityDelayBank.h): the eight banks' controls and options, the solo and oversampling --
+// Index layout: bank b (0…7) owns 27 entries from 27·b: its controls 4 + 16·b + k (k = 0…15; bank 8 has no send),
+// then its 11 options; the last two entries are the solo bank and the oversampling.
+constexpr int dbankPerBank = 27, dbankControls = 16;
+const char* const dbankOptionNames[11] { "Filter 1 type", "Filter 1 order", "Filter 2 type", "Filter 2 order", "Filter 1 post", "Mode",
+                                         "Steps", "Shape", "On", "Tap", "Sync" };
+const char* const dbankControlNames[16] { "Input pan", "Input volume", "Filter 1 cutoff", "Filter 1 resonance", "Filter 1 gain",
+                                          "Feedback pan", "Feedback level", "Feedback cross", "Time", "Stereo offset",
+                                          "Filter 2 cutoff", "Filter 2 resonance", "Filter 2 gain", "Output pan", "Output volume",
+                                          "Send to next" };
+
+int dbankOption (const fldbank::BankOptions& o, int k)
+{
+    switch (k)
+    {
+        case 0: return o.filterType[0];
+        case 1: return o.filterOrder[0];
+        case 2: return o.filterType[1];
+        case 3: return o.filterOrder[1];
+        case 4: return o.filterAfter ? 1 : 0;
+        case 5: return o.mode;
+        case 6: return o.steps;
+        case 7: return o.amount;
+        case 8: return o.enabled ? 1 : 0;
+        case 9: return o.tapBeforeFeedback ? 1 : 0;
+        default: return o.sync ? 1 : 0;
+    }
+}
+
+void setDbankOption (fldbank::BankOptions& o, int k, int v)
+{
+    switch (k)
+    {
+        case 0: o.filterType[0] = v; break;
+        case 1: o.filterOrder[0] = v; break;
+        case 2: o.filterType[1] = v; break;
+        case 3: o.filterOrder[1] = v; break;
+        case 4: o.filterAfter = v != 0; break;
+        case 5: o.mode = v; break;
+        case 6: o.steps = v; break;
+        case 7: o.amount = v; break;
+        case 8: o.enabled = v != 0; break;
+        case 9: o.tapBeforeFeedback = v != 0; break;
+        default: o.sync = v != 0; break;
+    }
+}
+
+// the state control of entry i (−1 = an option or a global)
+int dbankControlOf (int i)
+{
+    if (i < 0 || i >= dbankPerBank * fldbank::banks)
+        return -1;
+    const int b = i / dbankPerBank, k = i % dbankPerBank;
+    return k < dbankControls ? 4 + 16 * b + k : -1;
+}
+
+Table delayBankTable()
+{
+    Table t;
+    const auto def = fldbank::defaultState();
+    // options: filter types 0 off … 7 high shelf, orders 0…2 (one to three sections), mode 0…3, steps 0…16
+    // (the upper end of the editor's divider is not confirmed), shape −128…128
+    constexpr int optMin[11] { 0, 0, 0, 0, 0, 0, 0, -128, 0, 0, 0 };
+    constexpr int optMax[11] { 7, 2, 7, 2, 1, 3, 16, 128, 1, 1, 1 };
+    for (int b = 0; b < fldbank::banks; ++b)
+    {
+        for (int k = 0; k < dbankControls; ++k)
+        {
+            const int c = 4 + 16 * b + k;
+            if (c >= fldbank::automatable) // bank 8 has no "send to next"
+                t.params.push_back ({ bankControl (b, "Unused"), 0, 0, 0 });
+            else
+                t.params.push_back ({ bankControl (b, dbankControlNames[k]), fldbank::controlMin (c), fldbank::controlMax (c), def.p[(std::size_t) c] });
+        }
+        for (int k = 0; k < 11; ++k)
+            t.params.push_back ({ bankControl (b, dbankOptionNames[k]), optMin[k], optMax[k], dbankOption (def.bank[(std::size_t) b], k) });
+    }
+    t.params.push_back ({ "Solo", -1, fldbank::banks - 1, -1 });
+    t.params.push_back ({ "Oversample", 0, 2, 0 });
+
+    const auto n = (int) t.params.size();
+    t.get = [n] (const std::vector<std::uint8_t>& bytes, int i) -> std::optional<int> {
+        const auto s = fldbank::parse (bytes);
+        if (! s || i < 0 || i >= n)
+            return std::nullopt;
+        if (const auto c = dbankControlOf (i); c >= 0)
+            return c < fldbank::automatable ? s->p[(std::size_t) c] : 0;
+        if (i == n - 2)
+            return s->p[131];
+        if (i == n - 1)
+            return s->p[132];
+        return dbankOption (s->bank[(std::size_t) (i / dbankPerBank)], i % dbankPerBank - dbankControls);
+    };
+    t.with = [table = t.params, n] (const std::vector<std::uint8_t>& bytes, int i, int raw) {
+        auto s = fldbank::parse (bytes);
+        if (! s || i < 0 || i >= n)
+            return bytes;
+        raw = std::clamp (raw, table[(std::size_t) i].minimum, table[(std::size_t) i].maximum);
+        if (const auto c = dbankControlOf (i); c >= 0)
+        {
+            if (c >= fldbank::automatable)
+                return bytes;
+            s->p[(std::size_t) c] = raw;
+        }
+        else if (i == n - 2)
+            s->p[131] = raw;
+        else if (i == n - 1)
+            s->p[132] = raw;
+        else
+            setDbankOption (s->bank[(std::size_t) (i / dbankPerBank)], i % dbankPerBank - dbankControls, raw);
+        return fldbank::serialise (*s);
+    };
+    t.text = [n] (const std::vector<std::uint8_t>& bytes, int i, int raw) -> std::string {
+        const auto s = fldbank::parse (bytes).value_or (fldbank::defaultState());
+        if (const auto c = dbankControlOf (i); c >= 0)
+            return fldbank::controlText (s, c, raw);
+        if (i == n - 2)
+            return raw < 0 ? "None" : format ("Bank %.0f", raw + 1.0);
+        if (i == n - 1)
+            return raw == 0 ? "Off" : format ("%.0fx", (double) (1 << raw));
+        switch (i % dbankPerBank - dbankControls)
+        {
+            case 0: case 2:
+            {
+                static const char* const types[8] { "Off", "Low pass", "Band pass", "Notch", "High pass", "Low shelf", "Peaking", "High shelf" };
+                return types[std::clamp (raw, 0, 7)];
+            }
+            case 1: case 3: return format ("%.0f", raw + 1.0) + (raw == 0 ? " section" : " sections");
+            case 5:
+            {
+                static const char* const modes[4] { "Off", "Normal", "Inverted", "Ping-pong" };
+                return modes[std::clamp (raw, 0, 3)];
+            }
+            case 6: return raw == 0 ? "Off" : format ("%.0f", raw);
+            case 7: return format ("%+.0f%%", raw * 100.0 / 128.0);
+            default: return raw != 0 ? "On" : "Off";
+        }
+    };
+    return t;
+}
+
+// --- Multiband Delay (core/MultibandDelayFx.h): 8 banks × (delay, volume, pan) × 16 bands, the editor's selection ---
+// Index layout: bank·48 + target·16 + band (FL's own parameter order), then "Target" and "Bank".
+Table multibandDelayTable()
+{
+    Table t;
+    const mbdelay::State def;
+    static const char* const targets[3] { "delay", "volume", "pan" };
+    for (int bank = 0; bank < mbdelay::numBanks; ++bank)
+        for (int target = 0; target < 3; ++target)
+            for (int band = 0; band < mbdelay::numBands; ++band)
+            {
+                char name[48];
+                std::snprintf (name, sizeof (name), "Bank %d %s %d", bank + 1, targets[target], band + 1);
+                t.params.push_back ({ name, 0, 1 << 30, def.raw[(std::size_t) (bank * 48 + target * 16 + band)] });
+            }
+    t.params.push_back ({ "Target", 0, 2, def.targetSel });
+    t.params.push_back ({ "Bank", 0, mbdelay::numBanks - 1, def.bank });
+    constexpr int cells = mbdelay::numBanks * 48;
+
+    t.get = [] (const std::vector<std::uint8_t>& bytes, int i) -> std::optional<int> {
+        const auto s = mbdelay::parse (bytes);
+        if (! s || i < 0 || i > cells + 1)
+            return std::nullopt;
+        return i < cells ? s->raw[(std::size_t) i] : i == cells ? s->targetSel : s->bank;
+    };
+    t.with = [] (const std::vector<std::uint8_t>& bytes, int i, int raw) {
+        auto s = mbdelay::parse (bytes);
+        if (! s || i < 0 || i > cells + 1)
+            return bytes;
+        if (i < cells)
+            s->raw[(std::size_t) i] = std::clamp (raw, 0, 1 << 30);
+        else if (i == cells)
+            s->targetSel = std::clamp (raw, 0, 2);
+        else
+            s->bank = std::clamp (raw, 0, mbdelay::numBanks - 1);
+        return mbdelay::serialize (*s);
+    };
+    t.text = [] (const std::vector<std::uint8_t>&, int i, int raw) -> std::string {
+        if (i == cells)
+            return std::array<const char*, 3> { "Delay", "Volume", "Pan" }[(std::size_t) std::clamp (raw, 0, 2)];
+        if (i == cells + 1)
+            return format ("Bank %.0f", raw + 1.0);
+        const auto v = (double) raw / (double) (1 << 30);
+        return (i % 48) / 16 == 2 ? panText (v * 2.0 - 1.0) : format ("%.0f%%", v * 100.0);
+    };
+    return t;
+}
+
+// --- EQUO (core/EquoFx.h): the band table, 9 banks (8 + master) × 31 bands × (volume, pan, send), 0…2 floats -----
+// Index layout: (bank·31 + band)·3 + target, FL's own table order. Raw values are thousandths.
+constexpr std::size_t equoTableAt = 4 + equofx::numBands * equofx::numTargets * 8;
+constexpr int equoCells = equofx::numBanks * equofx::numBands * equofx::numTargets;
+
+Table equoTable()
+{
+    Table t;
+    static const char* const targets[3] { "volume", "pan", "send" };
+    for (int bank = 0; bank < equofx::numBanks; ++bank)
+        for (int band = 0; band < equofx::numBands; ++band)
+            for (int target = 0; target < 3; ++target)
+            {
+                char name[48];
+                if (bank == equofx::numBanks - 1)
+                    std::snprintf (name, sizeof (name), "Master %s %d", targets[target], band + 1);
+                else
+                    std::snprintf (name, sizeof (name), "Bank %d %s %d", bank + 1, targets[target], band + 1);
+                t.params.push_back ({ name, 0, 2000, 1000 });
+            }
+    t.get = [] (const std::vector<std::uint8_t>& bytes, int i) -> std::optional<int> {
+        if (! equofx::parse (bytes) || i < 0 || i >= equoCells)
+            return std::nullopt;
+        float v = 0.0f;
+        std::memcpy (&v, bytes.data() + equoTableAt + 4 * (std::size_t) i, 4);
+        return (int) std::lround (std::clamp (v, 0.0f, 2.0f) * 1000.0f);
+    };
+    t.with = [] (const std::vector<std::uint8_t>& bytes, int i, int raw) {
+        if (! equofx::parse (bytes) || i < 0 || i >= equoCells)
+            return bytes;
+        auto out = bytes;
+        const float v = (float) std::clamp (raw, 0, 2000) / 1000.0f;
+        std::memcpy (out.data() + equoTableAt + 4 * (std::size_t) i, &v, 4);
+        return out;
+    };
+    t.text = [] (const std::vector<std::uint8_t>&, int i, int raw) -> std::string {
+        const auto v = raw / 1000.0;
+        switch (i % 3)
+        {
+            case 0: return v <= 0.0 ? "-inf dB" : format ("%+.1f dB", 20.0 * std::log10 (v)); // 1 = unity (not confirmed)
+            case 1: return panText (v - 1.0);
+            default: return format ("%.0f%%", v * 50.0);
+        }
+    };
+    return t;
+}
+
+// --- Fruity Convolver (core/ConvolverFx.h): the knobs and the normalise switch of FL's state in the slot blob ------
+Table convolverTable()
+{
+    Table t;
+    t.params = { { "Predelay", 0, 1000, 0 }, { "Self-conv", 0, 1000, 0 }, { "Stretch", -1000, 1000, 0 }, { "EQ", 0, 1000, 1000 },
+                 { "Normalize", 0, 1, 0 } };
+    using Parts = std::pair<std::vector<std::uint8_t>, std::vector<std::uint8_t>>;
+    const auto split = [] (const std::vector<std::uint8_t>& blob) -> std::optional<std::pair<Parts, convolver::State>> {
+        Parts parts;
+        if (! convolver::unpackBlob (blob, parts.first, parts.second))
+            return std::nullopt;
+        auto s = convolver::parseState (parts.first);
+        if (! s)
+            return std::nullopt;
+        return std::make_pair (std::move (parts), std::move (*s));
+    };
+    t.get = [split] (const std::vector<std::uint8_t>& blob, int i) -> std::optional<int> {
+        const auto p = split (blob);
+        if (! p || i < 0 || i > 4)
+            return std::nullopt;
+        return i == 4 ? (p->second.flags[3] != 0 ? 1 : 0) : p->second.knobs[(std::size_t) i + 1];
+    };
+    t.with = [split, table = t.params] (const std::vector<std::uint8_t>& blob, int i, int raw) {
+        auto p = split (blob);
+        if (! p || i < 0 || i > 4)
+            return blob;
+        auto& fl = p->first.first;
+        raw = std::clamp (raw, table[(std::size_t) i].minimum, table[(std::size_t) i].maximum);
+        if (i == 4)
+        {
+            if (p->second.flagsAt == 0)
+                return blob;
+            fl[p->second.flagsAt + 3] = (std::uint8_t) raw;
+        }
+        else
+        {
+            if (p->second.knobsAt == 0 || i + 1 >= p->second.knobCount)
+                return blob;
+            const auto v = (std::int32_t) raw;
+            std::memcpy (fl.data() + p->second.knobsAt + 4 * (std::size_t) (i + 1), &v, 4);
+        }
+        return convolver::packBlob (fl, p->first.second);
+    };
+    t.text = [] (const std::vector<std::uint8_t>&, int i, int raw) -> std::string {
+        const auto x = raw * 0.001;
+        switch (i)
+        {
+            case 0: return format ("%.1f ms", (std::pow (7.0, x) - 1.0) * 83.333); // REA_rodada60: (7^x − 1)·83.333 ms
+            case 1: return format ("%.0f%%", x * 100.0);
+            case 2: return format ("%.2fx", std::pow (2.0, x));                    // the sample's speed 2^x
+            case 3: return format ("%.0f%%", x * 100.0);
+            default: return raw != 0 ? "On" : "Off";
+        }
+    };
+    return t;
+}
+
+// --- Vocodex (core/Vocodex.h): FL's 20 controls, the options block and the eight switches, in place in the state -----
+// Ranges from FL's form (REA_rodada20 §4.2.2); those of attack / release curve, mod band width, unison pitch and
+// unison pan are not confirmed (chosen around the installation presets' values).
+struct VcxField
+{
+    const char* name;
+    int minimum, maximum, defaultValue;
+    int at;   // byte offset from the controls block
+    bool byte = false, inverted = false;
+};
+const std::vector<VcxField>& vcxFields()
+{
+    static const std::vector<VcxField> f {
+        { "Wet", 0, 2000, 1000, 0 }, { "SG", 0, 1000, 150, 4 }, { "Mod level", 0, 16000, 12800, 8 }, { "Mod HP", 0, 65536, 55000, 12 },
+        { "Car level", 0, 16000, 0, 16 }, { "Car LP", 0, 65536, 28000, 20 }, { "Noise", 0, 12800, 0, 24 }, { "Noise HP", 0, 65536, 55000, 28 },
+        { "Hold", 0, 10000, 1666, 32 }, { "Attack", 0, 10000, 1115, 36 }, { "Attack curve", 0, 2000, 0, 40 }, { "Release", 0, 10000, 3500, 44 },
+        { "Release curve", 0, 2000, 0, 48 }, { "Freeze", 0, 1, 0, 52 }, { "Band width", 5, 1000, 349, 56 }, { "Flatness", 0, 100, 100, 60 },
+        { "Mod band width", 0, 4000, 2000, 64 }, { "Mod pitch", -1200, 1200, 0, 68 }, { "Unison pitch", 0, 1000, 250, 72 },
+        { "Unison pan", 0, 256, 128, 76 },
+        { "Hold mode", 0, 1, 0, 80 }, { "Order", 1, 4, 2, 84 }, { "Unison", 0, 4, 0, 88 }, { "Bands", 5, 100, 47, 92 },
+        { "Draft", 0, 1, 1, 96, false, true }, { "Mod input", 0, 8, 1, 100 }, { "Car input", -1, 8, 0, 104 },
+        { "L-R encoding", 0, 1, 0, 108, true }, { "Min times", 0, 1, 1, 109, true }, { "To mod", 0, 1, 1, 110, true },
+        { "Threaded", 0, 1, 1, 111, true }, { "Subtractive gate", 0, 1, 1, 112, true }, { "To noise", 0, 1, 1, 113, true },
+        { "From car", 0, 1, 0, 114, true }, { "From consonants", 0, 1, 1, 115, true } };
+    return f;
+}
+
+// byte offset of the controls block in a slot state (FL's state + LYNX's install-data trailer); 0 = not a Vocodex state
+std::size_t vcxBlock (const std::vector<std::uint8_t>& slotState)
+{
+    const auto fl = vocodex::splitInstallData (slotState).first;
+    const auto s = vocodex::parseState (fl);
+    return s && s->paramsAt > 0 && s->paramsAt + 116 <= fl.size() ? s->paramsAt : 0;
+}
+
+Table vocodexTable()
+{
+    Table t;
+    for (const auto& f : vcxFields())
+        t.params.push_back ({ f.name, f.minimum, f.maximum, f.defaultValue });
+    t.get = [] (const std::vector<std::uint8_t>& bytes, int i) -> std::optional<int> {
+        const auto& fs = vcxFields();
+        const auto at = vcxBlock (bytes);
+        if (at == 0 || i < 0 || i >= (int) fs.size())
+            return std::nullopt;
+        const auto& f = fs[(std::size_t) i];
+        std::int32_t v = 0;
+        if (f.byte)
+            v = bytes[at + (std::size_t) f.at] != 0 ? 1 : 0;
+        else
+            std::memcpy (&v, bytes.data() + at + (std::size_t) f.at, 4);
+        return f.inverted ? (v == 0 ? 1 : 0) : v;
+    };
+    t.with = [] (const std::vector<std::uint8_t>& bytes, int i, int raw) {
+        const auto& fs = vcxFields();
+        const auto at = vcxBlock (bytes);
+        if (at == 0 || i < 0 || i >= (int) fs.size())
+            return bytes;
+        const auto& f = fs[(std::size_t) i];
+        raw = std::clamp (raw, f.minimum, f.maximum);
+        auto out = bytes;
+        if (f.inverted)
+            raw = raw != 0 ? 0 : 1;
+        if (f.byte)
+            out[at + (std::size_t) f.at] = (std::uint8_t) (raw != 0 ? 1 : 0);
+        else
+        {
+            const std::int32_t v = raw;
+            std::memcpy (out.data() + at + (std::size_t) f.at, &v, 4);
+        }
+        return out;
+    };
+    t.text = [] (const std::vector<std::uint8_t>&, int i, int raw) -> std::string {
+        const auto db = [] (double g) { return g <= 1e-9 ? std::string ("-inf dB") : format ("%+.1f dB", 20.0 * std::log10 (g)); };
+        const auto hz = [] (int v) { return format ("%.0f Hz", 40.0 * std::pow (375.0, v / 65536.0)); };
+        const auto ms = [] (int v, double k) { return format ("%.1f ms", (std::pow (501.0, v / 10000.0) - 1.0) * k); };
+        switch (i)
+        {
+            case 0: return db ((std::pow (7.0, raw / 1000.0) - 1.0) / 6.0);
+            case 1: return format ("%.0f%%", raw / 10.0);
+            case 2: case 4: return db ((std::pow (11.0, raw / 12800.0) - 1.0) / 10.0);
+            case 3: case 7: return raw == 0 ? "Off" : hz (raw);
+            case 5: return raw >= 65536 ? "Off" : hz (raw);
+            case 6: return db (0.5 * (std::pow (7.0, raw / 12800.0) - 1.0) / 6.0);
+            case 8: return ms (raw, 0.5);
+            case 9: return ms (raw, 2.0);
+            case 11: return ms (raw, 4.0);
+            case 10: case 12: return format ("x%.2f", std::pow (2.0, raw / 1000.0));
+            case 14: return format ("%.2f", 0.5 * (std::pow (5.0, raw / 1000.0) - 1.0));
+            case 15: return format ("%.0f%%", (double) raw);
+            case 16: return format ("x%.2f", std::pow (2.0, raw / 1000.0) / 4.0);
+            case 17: return format ("%+.0f ct", (double) raw);
+            case 18: return format ("%.3f oct", raw / 1000.0);
+            case 19: return format ("%.0f%%", raw * 100.0 / 128.0);
+            case 20: return raw != 0 ? "RMS" : "Peak";
+            case 21: case 23: return format ("%.0f", (double) raw);
+            case 22: return format ("%.0f", raw + 1.0); // FL shows U + 1
+            case 25: return format ("%.0f", (double) raw); // 0 = own input, k = side input k
+            case 26: return raw < 0 ? "Synth" : format ("%.0f", (double) raw);
+            default: return raw != 0 ? "On" : "Off";
+        }
+    };
+    return t;
+}
+} // namespace
+
+std::string bankControl (int bank, const char* control)
+{
+    return "B" + std::to_string (bank + 1) + " " + control;
+}
+
+const Table* tableFor (EffectKind kind)
+{
+    static std::mutex lock;
+    static std::map<EffectKind, Table> tables;
+    const std::lock_guard<std::mutex> guard (lock);
+    if (auto it = tables.find (kind); it != tables.end())
+        return &it->second;
+    Table t;
+    switch (kind)
+    {
+        case EffectKind::maximus: t = maximusTable(); break;
+        case EffectKind::fruityDelayBank: t = delayBankTable(); break;
+        case EffectKind::multibandDelay: t = multibandDelayTable(); break;
+        case EffectKind::equo: t = equoTable(); break;
+        case EffectKind::convolver: t = convolverTable(); break;
+        case EffectKind::vocodex: t = vocodexTable(); break;
+        default: return nullptr;
+    }
+    return &tables.emplace (kind, std::move (t)).first->second;
+}
+} // namespace lynx::stateparams

+ 46 - 0
src/core/StateParams.h

@@ -0,0 +1,46 @@
+#pragma once
+
+// Controls that live in an effect slot's saved state (EffectSlot::state) instead of its parameters.
+//
+// Several FL effects keep far more settings than an effect slot has parameters (Fruity Delay Bank's eight banks,
+// Multiband Delay's and EQUO's band tables, Fruity Convolver's knobs, Maximus' bands): LYNX keeps FL's own state bytes
+// and builds the exact engine from them. The native editors (core/PluginLayout.h) edit those settings through the
+// tables below: each control has a name, FL's raw range and default, and reads / writes its raw value in the state.
+// They are not automatable (FL's own automation of them is not imported either).
+
+#include <cstdint>
+#include <functional>
+#include <optional>
+#include <string>
+#include <vector>
+
+#include "core/Song.h"
+
+namespace lynx::stateparams
+{
+struct Param
+{
+    std::string name;
+    int minimum = 0, maximum = 1, defaultValue = 0;
+};
+
+struct Table
+{
+    std::vector<Param> params;
+    // the raw value of control `index` in a slot state (nullopt = not a state of this effect)
+    std::function<std::optional<int> (const std::vector<std::uint8_t>& state, int index)> get;
+    // the slot state with control `index` set to `raw` (clamped to its range); unchanged when it cannot be edited
+    std::function<std::vector<std::uint8_t> (const std::vector<std::uint8_t>& state, int index, int raw)> with;
+    // the value as the editor shows it (the state gives context: a tempo-synced time, the filter type, ...)
+    std::function<std::string (const std::vector<std::uint8_t>& state, int index, int raw)> text;
+
+    int index (const char* name) const; // −1 = no such control
+    const char* name (int index) const; // "" = out of range
+};
+
+// The state-backed controls of an effect kind (nullptr = none)
+const Table* tableFor (EffectKind kind);
+
+// Fruity Delay Bank: names of bank b's (0…7) controls, e.g. bankControl (0, "Time") = "B1 Time"
+std::string bankControl (int bank, const char* control);
+} // namespace lynx::stateparams

+ 1 - 0
src/core/Vocodex.cpp

@@ -626,6 +626,7 @@ std::optional<State> parseState (const std::vector<std::uint8_t>& d)
     }
     if (o + 20 * 4 + 0x24 > d.size())
         return std::nullopt;
+    s.paramsAt = o;
     for (auto& p : s.params)
         p = i32 (o), o += 4;
     s.holdMode = std::clamp (i32 (o), 0, 1);

+ 1 - 0
src/core/Vocodex.h

@@ -50,6 +50,7 @@ struct State
     std::array<std::uint8_t, 13> mapAxis {}; // per map: 0 = read at the band frequency, 1 = at the pitch-shifted one
     std::string tone;              // internal carrier synth preset
     std::vector<int> notes;        // notes latched on the internal carrier's keyboard
+    std::size_t paramsAt = 0;      // byte offset of `params` in the parsed state (the options block follows at +80)
 
     bool draft() const noexcept { return draftField == 0; }
     bool internalCarrier() const noexcept { return carIn < 0 && ! lrEncoding; }

+ 80 - 3
src/engine/PluginHost.cpp

@@ -1,6 +1,7 @@
 #include "engine/PluginHost.h"
 
 #include "core/Preferences.h"
+#include "core/PluginScanPolicy.h"
 
 #include "core/FlWrapper.h"
 
@@ -228,6 +229,18 @@ PluginHost::PluginHost (bool keep)
         if (auto xml = juce::XmlDocument::parse (settingsFolder().getChildFile ("plugins.xml")))
             known.recreateFromXml (*xml);
         favouriteIds = prefs::parseFavourites (settingsFolder().getChildFile ("plugin-favourites.txt").loadFileAsString().toStdString());
+        // once: files marked as failed by scans before the class-count timeout (REA_rodada107 §2) get another try,
+        // since a large bundle (Waves shell) was marked "hung" only for taking longer than 30 s
+        const auto retried = settingsFolder().getChildFile ("scan-retry.txt");
+        if (retried.loadFileAsString().getIntValue() < 1)
+        {
+            if (! known.getBlacklistedFiles().isEmpty())
+            {
+                known.clearBlacklistedFiles();
+                save();
+            }
+            retried.replaceWithText ("1\n");
+        }
     }
 }
 
@@ -325,6 +338,52 @@ void PluginHost::save()
         xml->writeTo (settingsFolder().getChildFile ("plugins.xml"));
 }
 
+namespace
+{
+// Child side of the scan: how many classes a VST3 module's factory declares (0 = unknown). The module stays loaded
+// (and initialised) for the description that follows, which loads the same module again. Windows only for now.
+int countVst3Classes (const juce::String& path)
+{
+   #if JUCE_WINDOWS
+    juce::File binary (path);
+    if (binary.isDirectory()) // bundle: Contents/x86_64-win/<name>.vst3
+        binary = binary.getChildFile ("Contents").getChildFile ("x86_64-win").getChildFile (binary.getFileName());
+    if (! binary.existsAsFile())
+        return 0;
+    // the leading part of IPluginFactory's vtable (FUnknown, then getFactoryInfo, countClasses)
+    struct Factory
+    {
+        virtual int queryInterface (const char*, void**) = 0;
+        virtual unsigned addRef() = 0;
+        virtual unsigned release() = 0;
+        virtual int getFactoryInfo (void*) = 0;
+        virtual int countClasses() = 0;
+    };
+    static juce::DynamicLibrary module; // kept open until the child exits
+    if (! module.open (binary.getFullPathName()))
+        return 0;
+    if (auto* init = (bool (*)()) module.getFunction ("InitDll"))
+        if (! init())
+            return 0;
+    auto* get = (Factory* (*)()) module.getFunction ("GetPluginFactory");
+    auto* factory = get != nullptr ? get() : nullptr;
+    if (factory == nullptr)
+        return 0;
+    const auto classes = factory->countClasses();
+    factory->release();
+    return juce::jmax (0, classes);
+   #else
+    juce::ignoreUnused (path);
+    return 0;
+   #endif
+}
+
+juce::File classCountFile (const juce::File& result)
+{
+    return result.withFileExtension ("classes");
+}
+} // namespace
+
 bool PluginHost::scanOne (juce::AudioPluginFormat& format, const juce::String& file)
 {
     // a result file of our own: several LYNX processes (and scans) may run at once
@@ -335,16 +394,27 @@ bool PluginHost::scanOne (juce::AudioPluginFormat& format, const juce::String& f
     auto ok = child.start (juce::StringArray { exe.getFullPathName(), "--scan-one", format.getName(), file, result.getFullPathName() }, 0);
     if (ok)
     {
-        // wait in short steps so a cancelled scan (or LYNX closing) doesn't wait for a slow plugin
-        const auto deadline = juce::Time::getMillisecondCounter() + (juce::uint32) scanTimeoutMs;
-        while (child.isRunning() && ! stopScan && juce::Time::getMillisecondCounter() < deadline)
+        // wait in short steps so a cancelled scan (or LYNX closing) doesn't wait for a slow plugin; a file holding
+        // many plugins (Waves shell) gets more time once the child has said how many (core/PluginScanPolicy.h)
+        const auto started = juce::Time::getMillisecondCounter();
+        auto timeout = (juce::uint32) scanpolicy::baseTimeoutMs;
+        auto classesKnown = false;
+        while (child.isRunning() && ! stopScan && juce::Time::getMillisecondCounter() - started < timeout)
+        {
             child.waitForProcessToFinish (100);
+            if (! classesKnown && classCountFile (result).existsAsFile())
+            {
+                classesKnown = true;
+                timeout = (juce::uint32) scanpolicy::timeoutMs (classCountFile (result).loadFileAsString().getIntValue());
+            }
+        }
         if (child.isRunning())
         {
             child.kill();
             if (stopScan) // not the plugin's fault: try it again next time
             {
                 result.deleteFile();
+                classCountFile (result).deleteFile();
                 return false;
             }
             ok = false; // hung: blacklist
@@ -363,6 +433,7 @@ bool PluginHost::scanOne (juce::AudioPluginFormat& format, const juce::String& f
     else if (! ok)
         known.addToBlacklist (file);
     result.deleteFile();
+    classCountFile (result).deleteFile();
     return true;
 }
 
@@ -473,8 +544,14 @@ void PluginHost::cancelBackgroundScan()
     }
 }
 
+
 int PluginHost::scanOneFile (const juce::String& formatName, const juce::String& file, const juce::File& output)
 {
+    // first tell the parent how many plugins this file holds, so it waits long enough for a large bundle
+    if (formatName == "VST3")
+        if (const auto classes = countVst3Classes (file); classes > 1)
+            classCountFile (output).replaceWithText (juce::String (classes));
+
     juce::AudioPluginFormatManager manager;
     addPluginFormats (manager);
     juce::OwnedArray<juce::PluginDescription> found;

+ 1 - 1
src/engine/PluginHost.h

@@ -127,7 +127,7 @@ public:
     // Scan child mode: describes a file's plugins into `output` (XML). Returns the number found.
     static int scanOneFile (const juce::String& formatName, const juce::String& file, const juce::File& output);
 
-    static constexpr int scanTimeoutMs = 30000;
+    // (the parent waits core/PluginScanPolicy.h's time for each file; the child first reports a VST3's class count)
 
     // Adds a specific file (e.g. a .vst3 outside the default folders).
     int addPluginFile (const juce::File& file);

+ 40 - 1
src/engine/ProjectFile.cpp

@@ -506,6 +506,13 @@ juce::String toJson (const Song& song)
 
     if (song.swing > 0.0f)
         root->setProperty ("swing", juce::roundToInt (song.swing * 1000.0f) / 1000.0);
+    if (! song.channelGroups.empty())
+    {
+        juce::Array<juce::var> groups;
+        for (const auto& name : song.channelGroups)
+            groups.add (str (name));
+        root->setProperty ("channelGroups", groups);
+    }
     if (song.masterPitch != 0.0f)
         root->setProperty ("masterPitch", (double) song.masterPitch);
     if (! song.info.empty())
@@ -565,6 +572,8 @@ juce::String toJson (const Song& song)
 
         if (c.colour != 0)
             o->setProperty ("colour", juce::String::toHexString ((juce::int64) (c.colour & 0xFFFFFF)).paddedLeft ('0', 6));
+        if (c.group >= 0)
+            o->setProperty ("group", c.group);
         if (c.swingMix != 1.0f)
             o->setProperty ("swingMix", c.swingMix);
         if (c.arp.enabled())
@@ -827,6 +836,15 @@ juce::String toJson (const Song& song)
 
         if (! colours.isEmpty())
             root->setProperty ("playlistTrackColours", colours);
+
+        // track groups: [index, grouped, collapsed] for the tracks that have either (older versions ignore it)
+        juce::Array<juce::var> groups;
+        for (std::size_t i = 0; i < song.playlistTracks.size(); ++i)
+            if (song.playlistTracks[i].grouped || song.playlistTracks[i].collapsed)
+                groups.add (juce::Array<juce::var> { (int) i, song.playlistTracks[i].grouped ? 1 : 0, song.playlistTracks[i].collapsed ? 1 : 0 });
+
+        if (! groups.isEmpty())
+            root->setProperty ("playlistTrackGroups", groups);
     }
 
     const auto anyMarkers = std::any_of (song.arrangements.begin(), song.arrangements.end(), [] (const Arrangement& a) { return ! a.markers.empty(); });
@@ -878,6 +896,8 @@ juce::String toJson (const Song& song)
 
         if (! t.toMaster)
             o->setProperty ("toMaster", false);
+        if (t.masterLevel != 1.0f)
+            o->setProperty ("masterLevel", juce::roundToInt (t.masterLevel * 10000.0f) / 10000.0);
         if (t.colour != 0)
             o->setProperty ("colour", juce::String::toHexString ((juce::int64) (t.colour & 0xFFFFFF)).paddedLeft ('0', 6));
         if (t.stereo != 0.0f)
@@ -955,6 +975,9 @@ std::optional<Song> fromJson (const juce::String& json, juce::String& error)
     song.bpm = juce::jlimit (10.0, 999.0, (double) root.getProperty ("bpm", 130.0));
     song.beatsPerBar = juce::jlimit (1, 32, (int) root.getProperty ("beatsPerBar", 4));
     song.swing = juce::jlimit (0.0f, 1.0f, (float) (double) root.getProperty ("swing", 0.0));
+    if (auto* groups = root["channelGroups"].getArray())
+        for (const auto& name : *groups)
+            song.channelGroups.push_back (name.toString().toStdString());
     song.masterPitch = juce::jlimit (-1200.0f, 1200.0f, (float) (double) root.getProperty ("masterPitch", 0.0));
     if (const auto info = root.getProperty ("info", {}); info.isObject())
     {
@@ -1023,6 +1046,8 @@ std::optional<Song> fromJson (const juce::String& json, juce::String& error)
 
             if (c.hasProperty ("colour"))
                 def.colour = 0xFF000000u | (std::uint32_t) c["colour"].toString().getHexValue32();
+            if (const int group = c.getProperty ("group", -1); group >= 0 && group < (int) song.channelGroups.size())
+                def.group = group;
 
             def.swingMix = juce::jlimit (0.0f, 1.0f, (float) (double) c.getProperty ("swingMix", 1.0));
 
@@ -1292,6 +1317,19 @@ std::optional<Song> fromJson (const juce::String& json, juce::String& error)
                 song.playlistTracks[index].colour = 0xFF000000u | ((std::uint32_t) (int) t[1] & 0xFFFFFFu);
             }
 
+    if (auto* groups = root["playlistTrackGroups"].getArray())
+        for (const auto& t : *groups)
+            if (t.isArray() && t.size() == 3 && (int) t[0] >= 0 && (int) t[0] < 500)
+            {
+                const auto index = (std::size_t) (int) t[0];
+
+                if (song.playlistTracks.size() <= index)
+                    song.playlistTracks.resize (index + 1);
+
+                song.playlistTracks[index].grouped = index > 0 && (int) t[1] != 0;
+                song.playlistTracks[index].collapsed = (int) t[2] != 0;
+            }
+
     if (auto* arrangements = root["arrangements"].getArray(); arrangements != nullptr && ! arrangements->isEmpty())
     {
         song.arrangements.clear();
@@ -1343,6 +1381,7 @@ std::optional<Song> fromJson (const juce::String& json, juce::String& error)
             track.muted = (bool) t.getProperty ("muted", false);
             track.solo = (bool) t.getProperty ("solo", false);
             track.toMaster = (bool) t.getProperty ("toMaster", true);
+            track.masterLevel = juce::jlimit (0.0f, maxFaderGain, (float) (double) t.getProperty ("masterLevel", 1.0));
             track.stereo = juce::jlimit (-1.0f, 1.0f, (float) (double) t.getProperty ("stereo", 0.0));
 
             if (t.hasProperty ("colour"))
@@ -1364,7 +1403,7 @@ std::optional<Song> fromJson (const juce::String& json, juce::String& error)
             if (auto* sends = t["sends"].getArray())
                 for (const auto& send : *sends)
                     if (send.isArray() && send.size() == 2)
-                        track.sends.push_back ({ (int) send[0], juce::jlimit (0.0f, 1.0f, (float) (double) send[1]) });
+                        track.sends.push_back ({ (int) send[0], juce::jlimit (0.0f, maxFaderGain, (float) (double) send[1]) });
 
             if (auto* effects = t["effects"].getArray())
                 for (const auto& e : *effects)

+ 24 - 0
src/flp/Flp.cpp

@@ -55,6 +55,8 @@ enum : std::uint32_t
     evChannelLevels = 0xDB,
     evChannelLevelAdjust = 0xE5, // i32 panAdj, i32 volAdj, i32 ?, i32 modXAdj, i32 modYAdj
     evChannelColour = 0x80,
+    evChannelFilterGroup = 0x91, // u32: index into the 0xE7 names (the Channel Rack's filter group, REA round 104)
+    evFilterGroupName = 0xE7,    // UTF-16 text: one per filter group, in order
     evMixerInsertColour = 0x95, // u32 0x00BBGGRR; comes before the 0xEC that opens the insert
     evMixerSlotIndex = 0x62,    // u16: closes the effect slot described by the preceding events     // u32 0x00BBGGRR (also appears in mixer slots)     // i32 pan, i32 volume, i32 pitch (cents), ...
     evPlaylistTrack = 0xEE,     // u32 index (1..500), u32 colour, u32 icon, u8 enabled, ...
@@ -740,6 +742,15 @@ Project parseProject (std::span<const std::uint8_t> file, bool channelPreset)
                 break;
             }
 
+            case evChannelFilterGroup:
+                if (section == Section::channel)
+                    channel().filterGroup = (int) (std::int32_t) e.value;
+                break;
+
+            case evFilterGroupName:
+                project.filterGroups.push_back (text (e));
+                break;
+
             case evChannelColour:
                 if (section == Section::channel)
                     channel().colour = ((e.value & 0xFF) << 16) | (e.value & 0xFF00) | ((e.value >> 16) & 0xFF);
@@ -783,6 +794,19 @@ Project parseProject (std::span<const std::uint8_t> file, bool channelPreset)
                     const auto c = readLE<std::uint32_t> (e.data, 4);
                     t.colour = ((c & 0xFF) << 16) | (c & 0xFF00) | ((c >> 16) & 0xFF);
                     t.enabled = e.data[12] != 0;
+                    // FL 20+ layout (70 bytes; REA round 104): f32 size at 13, u8 "grouped with above" at 46,
+                    // u8 "group expanded" at 61 (cleared when FL collapses the group)
+                    if (e.data.size() >= 17)
+                    {
+                        const auto h = readLE<float> (e.data, 13);
+                        if (std::isfinite (h) && h > 0.05f && h < 10.0f)
+                            t.heightScale = h;
+                    }
+                    if (e.data.size() >= 62)
+                    {
+                        t.grouped = e.data[46] != 0;
+                        t.expanded = e.data[61] != 0;
+                    }
                     arrangement().tracks.push_back (t);
                 }
                 break;

+ 5 - 0
src/flp/Flp.h

@@ -95,6 +95,7 @@ struct Channel
     // event 0xDB (channel "levels"): pan 0..12800 (6400 = center), volume 0..12800
     // (10000 = 78%, the default), pitch in cents
     std::uint32_t colour = 0; // 0xRRGGBB (0 = no stored colour)
+    int filterGroup = -1;     // 0x91: index into Project::filterGroups (-1 = none)
     bool hasLevels = false;
     int pan = 6400, volume = 10000, pitchCents = 0;
     int modX = 256, modY = 0, filterType = 0; // channel filter (0xDB with 24 B; docs/analise/REA_rodada4.md §3)
@@ -257,6 +258,9 @@ struct PlaylistTrackInfo
     std::string name;
     bool enabled = true;  // false = track muted
     std::uint32_t colour = 0x485156; // 0xRRGGBB (stored as 0x00BBGGRR); 0x485156 = FL's default grey
+    float heightScale = 1.0f; // the track's size (FL's Size menu: 0.33 .. 2.0; 1 = 100 %)
+    bool grouped = false;     // "Group with above track"
+    bool expanded = true;     // a group header's members are shown (false = "Collapse grouped tracks")
 };
 
 // Playlist time marker: 0x94 (u32: type << 24 | position in ticks), followed by
@@ -311,6 +315,7 @@ struct Project
     std::string comments; // event 0xC3 (the Info page's comments; line breaks saved as CR)
 
     std::vector<Channel> channels;
+    std::vector<std::string> filterGroups; // 0xE7: the Channel Rack's filter groups, in order
     std::vector<Pattern> patterns;
     std::vector<Arrangement> arrangements;
     std::vector<MixerInsert> mixer;

+ 270 - 66
src/ui/ChannelRackComponent.cpp

@@ -150,22 +150,155 @@ int ChannelRackComponent::numSteps() const
     return juce::jlimit (16, 512, steps);
 }
 
+bool ChannelRackComponent::isShown (int row) const
+{
+    const auto& channels = engine.getSong().channels;
+    return filterGroup < 0 || row < 0 || row >= (int) channels.size() || channels[(std::size_t) row].group == filterGroup;
+}
+
+int ChannelRackComponent::visibleIndex (int row) const
+{
+    if (filterGroup < 0)
+        return row;
+
+    int index = 0;
+    for (int r = 0; r < row && r < (int) engine.getSong().channels.size(); ++r)
+        index += isShown (r) ? 1 : 0;
+    return index + juce::jmax (0, row - (int) engine.getSong().channels.size());
+}
+
+int ChannelRackComponent::shownCount() const
+{
+    return visibleIndex ((int) engine.getSong().channels.size());
+}
+
+void ChannelRackComponent::setFilterGroup (int group)
+{
+    const auto groups = (int) engine.getSong().channelGroups.size();
+    group = group >= 0 && group < groups ? group : -1;
+
+    if (group == filterGroup)
+        return;
+
+    filterGroup = group;
+    updateSize();
+    repaint();
+
+    if (onFilterChanged)
+        onFilterChanged();
+}
+
+juce::String ChannelRackComponent::filterName() const
+{
+    const auto& groups = engine.getSong().channelGroups;
+    return filterGroup >= 0 && filterGroup < (int) groups.size() ? juce::String::fromUTF8 (groups[(std::size_t) filterGroup].c_str()) : tr ("All");
+}
+
+void ChannelRackComponent::showFilterMenu (juce::Component* target)
+{
+    const auto& song = engine.getSong();
+    juce::PopupMenu menu;
+    menu.addItem (tr ("All"), true, filterGroup < 0, [this] { setFilterGroup (-1); });
+
+    if (! song.channelGroups.empty())
+        menu.addSeparator();
+
+    for (int g = 0; g < (int) song.channelGroups.size(); ++g)
+        menu.addItem (juce::String::fromUTF8 (song.channelGroups[(std::size_t) g].c_str()), true, filterGroup == g, [this, g] { setFilterGroup (g); });
+
+    menu.addSeparator();
+    menu.addItem (tr ("Group selected...") + "\tAlt+G", [this] { groupSelected(); });
+    {
+        juce::PopupMenu move;
+        move.addItem (tr ("(no group)"), [this] { moveSelectedToGroup (-1); });
+        for (int g = 0; g < (int) song.channelGroups.size(); ++g)
+            move.addItem (juce::String::fromUTF8 (song.channelGroups[(std::size_t) g].c_str()), [this, g] { moveSelectedToGroup (g); });
+        menu.addSubMenu (tr ("Move selected channels to"), move, ! engine.getSelectedChannels().empty());
+    }
+    menu.addItem (tr ("Rename this group..."), filterGroup >= 0, false, [this] {
+        const auto group = filterGroup;
+        auto* window = new juce::AlertWindow (tr ("Filter group name"), {}, juce::MessageBoxIconType::NoIcon);
+        window->addTextEditor ("name", filterName());
+        window->addButton (tr ("OK"), 1, juce::KeyPress (juce::KeyPress::returnKey));
+        window->addButton (tr ("Cancel"), 0, juce::KeyPress (juce::KeyPress::escapeKey));
+        window->enterModalState (true, juce::ModalCallbackFunction::create ([this, group, window] (int result) {
+                                     const auto name = window->getTextEditorContents ("name").trim().toStdString();
+                                     if (result != 1 || name.empty())
+                                         return;
+                                     engine.editSong ([group, name] (Song& s) {
+                                         if (group < (int) s.channelGroups.size())
+                                             s.channelGroups[(std::size_t) group] = name;
+                                     });
+                                     if (onFilterChanged)
+                                         onFilterChanged();
+                                 }),
+                                 true);
+    });
+    menu.addItem (tr ("Delete this group (keeps its channels)"), filterGroup >= 0, false, [this] {
+        const auto group = filterGroup;
+        setFilterGroup (-1);
+        engine.editSong ([group] (Song& s) {
+            if (group >= (int) s.channelGroups.size())
+                return;
+            s.channelGroups.erase (s.channelGroups.begin() + group);
+            for (auto& c : s.channels)
+                c.group = c.group == group ? -1 : c.group > group ? c.group - 1 : c.group;
+        });
+    });
+    menu.showMenuAsync (juce::PopupMenu::Options().withTargetComponent (target));
+}
+
+void ChannelRackComponent::moveSelectedToGroup (int group)
+{
+    engine.editSong ([group, rows = engine.getSelectedChannels()] (Song& s) {
+        for (auto r : rows)
+            if (r >= 0 && r < (int) s.channels.size())
+                s.channels[(std::size_t) r].group = group >= 0 && group < (int) s.channelGroups.size() ? group : -1;
+    });
+    updateSize();
+    repaint();
+}
+
+void ChannelRackComponent::groupSelected()
+{
+    // FL: Alt+G asks for the "Filter group name"; the selected channels move into the new group, which is shown
+    auto* window = new juce::AlertWindow (tr ("Filter group name"), {}, juce::MessageBoxIconType::NoIcon);
+    window->addTextEditor ("name", tr ("Group {0}", { juce::String ((int) engine.getSong().channelGroups.size() + 1) }));
+    window->addButton (tr ("OK"), 1, juce::KeyPress (juce::KeyPress::returnKey));
+    window->addButton (tr ("Cancel"), 0, juce::KeyPress (juce::KeyPress::escapeKey));
+    window->enterModalState (true, juce::ModalCallbackFunction::create ([this, window] (int result) {
+                                 const auto name = window->getTextEditorContents ("name").trim().toStdString();
+                                 if (result != 1 || name.empty())
+                                     return;
+                                 const auto group = (int) engine.getSong().channelGroups.size();
+                                 engine.editSong ([name, rows = engine.getSelectedChannels()] (Song& s) {
+                                     s.channelGroups.push_back (name);
+                                     for (auto r : rows)
+                                         if (r >= 0 && r < (int) s.channels.size())
+                                             s.channels[(std::size_t) r].group = (int) s.channelGroups.size() - 1;
+                                 });
+                                 setFilterGroup (group);
+                             }),
+                             true);
+}
+
 void ChannelRackComponent::updateSize()
 {
-    const auto rows = (int) engine.getSong().channels.size() + 1; // +1 = "add channel" row
+    const auto rows = shownCount() + 1; // +1 = "add channel" row
     setSize (gridLeft() + numSteps() * stepWidth + 8, rows * rowHeight + 8 + (graphRow() >= 0 ? laneHeight : 0));
 }
 
 int ChannelRackComponent::graphRow() const
 {
     const auto count = (int) engine.getSong().channels.size();
-    return graphLanes && count > 0 ? juce::jlimit (0, count - 1, engine.getSelectedChannel()) : -1;
+    const auto row = graphLanes && count > 0 ? juce::jlimit (0, count - 1, engine.getSelectedChannel()) : -1;
+    return row >= 0 && isShown (row) ? row : -1;
 }
 
 int ChannelRackComponent::rowY (int row) const
 {
     const auto lane = graphRow();
-    return 4 + row * rowHeight + (lane >= 0 && row > lane ? laneHeight : 0);
+    return 4 + visibleIndex (row) * rowHeight + (lane >= 0 && row > lane ? laneHeight : 0);
 }
 
 int ChannelRackComponent::rowAtY (int y) const
@@ -182,7 +315,18 @@ int ChannelRackComponent::rowAtY (int y) const
             y -= laneHeight;
     }
 
-    return (y - 4) / rowHeight;
+    const auto index = (y - 4) / rowHeight;
+
+    if (filterGroup < 0)
+        return index;
+
+    // the index-th shown row (the "add channel" row after the last one)
+    const auto count = (int) engine.getSong().channels.size();
+    int seen = 0;
+    for (int r = 0; r < count; ++r)
+        if (isShown (r) && seen++ == index)
+            return r;
+    return count + (index - seen);
 }
 
 juce::Rectangle<int> ChannelRackComponent::laneBounds() const
@@ -269,7 +413,7 @@ void ChannelRackComponent::paint (juce::Graphics& g)
     {
         const auto y = rowY (row);
 
-        if (y > clip.getBottom() || y + rowHeight < clip.getY())
+        if (! isShown (row) || y > clip.getBottom() || y + rowHeight < clip.getY())
             continue;
 
         const auto& channel = song.channels[(std::size_t) row];
@@ -346,7 +490,7 @@ void ChannelRackComponent::paint (juce::Graphics& g)
         {
             const auto y = rowY (row);
 
-            if (y > column.getBottom() || y + rowHeight < column.getY())
+            if (! isShown (row) || y > column.getBottom() || y + rowHeight < column.getY())
                 continue;
 
             const auto& channel = song.channels[(std::size_t) row];
@@ -978,6 +1122,9 @@ void ChannelRackComponent::toggleGraphLanes()
     graphLanes = ! graphLanes;
     updateSize();
     repaint();
+
+    if (onFilterChanged) // the title's graph switch follows
+        onFilterChanged();
 }
 
 // --- fills, rotation and organisation ------------------------------------------------------------
@@ -1029,6 +1176,8 @@ void ChannelRackComponent::selectUnused()
 int ChannelRackComponent::addChannel (ChannelDef c, bool openEditor)
 {
     int index = 0;
+    if (filterGroup >= 0 && c.group < 0) // a new channel joins the group shown (FL)
+        c.group = filterGroup;
     engine.editSong ([&] (Song& s) {
         c.mixerTrack = s.nextFreeInsert();
         s.channels.push_back (c);
@@ -1636,13 +1785,79 @@ void ChannelRackComponent::showChannelMenu (int channel)
     });
     instruments.addSubMenu (tr ("Plugin (VST/VST3/CLAP)"), plugins);
 
+    // FL's layout (REA round 104): two columns, the channel on the left (editors, name and colour, sample,
+    // insert / replace / clone / delete) and its steps on the right (clipboard, fills, rotation); LYNX's own
+    // items (settings windows, arpeggiator, organisation) follow in their place
     juce::PopupMenu menu;
     menu.addSectionHeader (juce::String::fromUTF8 (c.name.c_str()));
+    const auto selected = (int) engine.getSelectedChannels().size();
+    const auto count = (int) engine.getSong().channels.size();
+
+    menu.addItem (tr ("Piano Roll") + "\tF7", [this] {
+        if (onOpenPianoRoll)
+            onOpenPianoRoll();
+    });
+    menu.addItem (tr ("Graph editor") + "\tCtrl+K", true, graphLanes, [this] { toggleGraphLanes(); });
+    menu.addSeparator();
+    menu.addItem (tr ("Rename and color...") + "\tF2", [this, channel] { rename (channel); });
+    {
+        juce::PopupMenu colours;
+        colours.addItem (tr ("Default"), [this, channel] { engine.editSong ([channel] (Song& s) { s.channels[(std::size_t) channel].colour = 0; }); });
+
+        for (auto colour : lynxPalette())
+        {
+            juce::Image swatch (juce::Image::ARGB, 16, 16, true);
+            juce::Graphics (swatch).fillAll (juce::Colour (colour));
+            juce::PopupMenu::Item item;
+            item.text = "#" + juce::String::toHexString ((juce::int64) (colour & 0xFFFFFF)).paddedLeft ('0', 6).toUpperCase();
+            item.image = std::make_unique<juce::DrawableImage> (swatch);
+            item.isTicked = c.colour == colour;
+            item.action = [this, channel, colour] { engine.editSong ([channel, colour] (Song& s) { s.channels[(std::size_t) channel].colour = colour; }); };
+            colours.addItem (std::move (item));
+        }
 
+        menu.addSubMenu (tr ("Change color"), colours);
+    }
+    menu.addItem (tr ("Random color"), [this, channel] {
+        const auto& palette = lynxPalette();
+        const auto colour = palette[(std::size_t) juce::Random::getSystemRandom().nextInt ((int) palette.size())];
+        engine.editSong ([channel, colour] (Song& s) { s.channels[(std::size_t) channel].colour = colour; });
+    });
+    menu.addSeparator();
+    menu.addItem (tr ("Load sample..."), c.instrument != InstrumentKind::audioClip, false, [this, channel] { chooseSample (channel); });
+    {
+        // "Cut itself": a new note cuts the channel's own sounding note (its cut group and "cut by" are its own)
+        const auto self = 1000 + channel;
+        const auto cutsItself = c.cutGroup != 0 && c.cutGroup == c.cutBy;
+        menu.addItem (tr ("Cut itself"), true, cutsItself, [this, channel, self, cutsItself] {
+            engine.editSong ([channel, self, cutsItself] (Song& s) {
+                auto& ch = s.channels[(std::size_t) channel];
+                ch.cutGroup = ch.cutBy = cutsItself ? 0 : self;
+            });
+        });
+    }
+    menu.addSeparator();
+    {
+        juce::PopupMenu insert;
+        addInstrumentItems (insert, channel);
+        menu.addSubMenu (tr ("Insert"), insert);
+    }
+    menu.addSubMenu (tr ("Replace"), instruments);
+    menu.addItem (selected > 1 ? tr ("Clone {0} channels", { juce::String (selected) }) : tr ("Clone") + "\tAlt+C", [this] { cloneSelected(); });
+
+    if (selected > 1)
+        menu.addItem (tr ("Delete {0} channels", { juce::String (selected) }) + "\tAlt+Del", selected < count, false, [this] { deleteSelected(); });
+    else
+        menu.addItem (tr ("Delete...") + "\tAlt+Del", count > 1, false, [this, channel] {
+            closeEditor (channel);
+            engine.editSong ([channel] (Song& s) { s.removeChannel (channel); });
+            openEditorRow = -1;
+        });
+
+    // LYNX: the channel's settings windows and its arpeggiator
+    menu.addSeparator();
     if (c.instrument == InstrumentKind::sampler)
     {
-        menu.addItem (tr ("Sample: {0}", { juce::File (juce::String::fromUTF8 (c.samplePath.c_str())).getFileName() }),
-                      false, false, [] {});
         menu.addItem (tr ("Sampler settings (pitch, envelope, reverse)..."),
                       [this, channel] { openChannelSettings (engine, channel); });
         menu.addItem (tr ("Edit the sample in the audio editor..."), ! c.samplePath.empty(), false, [this, channel] { openAudioEditorForChannel (engine, channel); });
@@ -1666,12 +1881,6 @@ void ChannelRackComponent::showChannelMenu (int channel)
         if (auto* p = dynamic_cast<PluginInstrument*> (engine.getChannelInstrument (channel).get()))
             addPluginParameterItems (menu, engine, p->getInstance(), { AutomationTargetKind::channelParam, channel, 0, 0 });
     }
-
-    menu.addItem (tr ("Piano Roll"), [this] {
-        if (onOpenPianoRoll)
-            onOpenPianoRoll();
-    });
-    menu.addSubMenu (tr ("Instrument"), instruments);
     {
         // channel arpeggiator
         const auto arp = c.arp;
@@ -1708,41 +1917,51 @@ void ChannelRackComponent::showChannelMenu (int channel)
         menu.addSubMenu (arp.enabled() ? tr ("Arpeggiator (on)") : tr ("Arpeggiator"), arpMenu);
     }
 
-    menu.addItem (tr ("Rename and color...") + "\tF2", [this, channel] { rename (channel); });
+    // --- second column: the channel's steps in the current pattern ---
+    menu.addColumnBreak();
     {
-        juce::PopupMenu colours;
-        colours.addItem (tr ("Default"), [this, channel] { engine.editSong ([channel] (Song& s) { s.channels[(std::size_t) channel].colour = 0; }); });
-
-        for (auto colour : lynxPalette())
-        {
-            juce::Image swatch (juce::Image::ARGB, 16, 16, true);
-            juce::Graphics (swatch).fillAll (juce::Colour (colour));
-            juce::PopupMenu::Item item;
-            item.text = "#" + juce::String::toHexString ((juce::int64) (colour & 0xFFFFFF)).paddedLeft ('0', 6).toUpperCase();
-            item.image = std::make_unique<juce::DrawableImage> (swatch);
-            item.isTicked = c.colour == colour;
-            item.action = [this, channel, colour] { engine.editSong ([channel, colour] (Song& s) { s.channels[(std::size_t) channel].colour = colour; }); };
-            colours.addItem (std::move (item));
-        }
-
-        menu.addSubMenu (tr ("Color"), colours);
-    }
-    {
-        juce::PopupMenu steps;
-        steps.addItem (tr ("Fill every 2 steps"), [this] { fillSelected (2); });
-        steps.addItem (tr ("Fill every 4 steps"), [this] { fillSelected (4); });
-        steps.addItem (tr ("Fill every 8 steps"), [this] { fillSelected (8); });
-        steps.addItem (tr ("Euclidean fill..."), [this, channel] { showEuclideanFill (channel); });
-        steps.addSeparator();
-        steps.addItem (tr ("Rotate left") + "\tCtrl+Shift+Left", [this] { rotateSelected (-1); });
-        steps.addItem (tr ("Rotate right") + "\tCtrl+Shift+Right", [this] { rotateSelected (1); });
-        steps.addSeparator();
-        steps.addItem (tr ("Graph lanes (velocity, pan, pitch...)") + "\tCtrl+K", true, graphLanes, [this] { toggleGraphLanes(); });
-        steps.addSeparator();
-        steps.addItem (tr ("Swing mix ({0})...", { juce::String (juce::roundToInt (c.swingMix * 100.0f)) + "%" }),
-                       [this, channel] { setSwingMixOfSelected (channel); });
-        menu.addSubMenu (tr ("Steps"), steps);
+        auto notesOf = [this, channel] {
+            std::vector<Note> out;
+            const auto& song = engine.getSong();
+            for (const auto& n : song.patterns[(std::size_t) song.currentPattern].notes)
+                if (n.channel == channel)
+                    out.push_back (n);
+            return out;
+        };
+        auto clear = [channel] (Song& s) {
+            auto& notes = s.patterns[(std::size_t) s.currentPattern].notes;
+            notes.erase (std::remove_if (notes.begin(), notes.end(), [channel] (const Note& n) { return n.channel == channel; }), notes.end());
+        };
+        const auto hasNotes = ! notesOf().empty();
+        menu.addItem (tr ("Cut"), hasNotes, false, [this, notesOf, clear] {
+            stepClipboard = notesOf();
+            engine.editSong (clear);
+        });
+        menu.addItem (tr ("Copy"), hasNotes, false, [notesOf] { stepClipboard = notesOf(); });
+        menu.addItem (tr ("Paste"), ! stepClipboard.empty(), false, [this, channel, clear] {
+            engine.editSong ([channel, clear, notes = stepClipboard] (Song& s) {
+                clear (s);
+                auto& target = s.patterns[(std::size_t) s.currentPattern].notes;
+                for (auto n : notes)
+                {
+                    n.channel = channel;
+                    target.push_back (n);
+                }
+                std::stable_sort (target.begin(), target.end(), [] (const Note& a, const Note& b) { return a.start < b.start; });
+            });
+        });
     }
+    menu.addSeparator();
+    menu.addItem (tr ("Fill each 2 steps"), [this] { fillSelected (2); });
+    menu.addItem (tr ("Fill each 4 steps"), [this] { fillSelected (4); });
+    menu.addItem (tr ("Fill each 8 steps"), [this] { fillSelected (8); });
+    menu.addItem (tr ("Advanced fill..."), [this, channel] { showEuclideanFill (channel); });
+    menu.addSeparator();
+    menu.addItem (tr ("Rotate left") + "\tShift+Ctrl+Left", [this] { rotateSelected (-1); });
+    menu.addItem (tr ("Rotate right") + "\tShift+Ctrl+Right", [this] { rotateSelected (1); });
+    menu.addSeparator();
+    menu.addItem (tr ("Swing mix ({0})...", { juce::String (juce::roundToInt (c.swingMix * 100.0f)) + "%" }),
+                  [this, channel] { setSwingMixOfSelected (channel); });
     menu.addItem (tr ("Clear notes in this pattern"), [this, channel] {
         engine.editSong ([channel] (Song& s) {
             auto& notes = s.patterns[(std::size_t) s.currentPattern].notes;
@@ -1751,16 +1970,8 @@ void ChannelRackComponent::showChannelMenu (int channel)
         });
     });
 
-    // organisation (acts on the selection)
-    const auto selected = (int) engine.getSelectedChannels().size();
-    const auto count = (int) engine.getSong().channels.size();
+    // organisation (acts on the selection; FL keeps these in the rack's options menu)
     menu.addSeparator();
-    menu.addItem (selected > 1 ? tr ("Clone {0} channels", { juce::String (selected) }) : tr ("Clone channel"), [this] { cloneSelected(); });
-    {
-        juce::PopupMenu insert;
-        addInstrumentItems (insert, channel);
-        menu.addSubMenu (tr ("Insert channel here"), insert);
-    }
     menu.addItem (tr ("Move up") + "\tAlt+Up", engine.getSelectedChannels().front() > 0, false, [this] { moveSelected (-1); });
     menu.addItem (tr ("Move down") + "\tAlt+Down", engine.getSelectedChannels().back() < count - 1, false, [this] { moveSelected (1); });
     menu.addItem (tr ("Send to free mixer inserts") + "\tCtrl+L", [this] { sendSelectedToInserts(); });
@@ -1773,16 +1984,7 @@ void ChannelRackComponent::showChannelMenu (int channel)
         menu.addSubMenu (tr ("Sort channels"), sort);
     }
     menu.addItem (tr ("Select unused channels"), [this] { selectUnused(); });
-    menu.addSeparator();
-
-    if (selected > 1)
-        menu.addItem (tr ("Delete {0} channels", { juce::String (selected) }) + "\tAlt+Del", selected < count, false, [this] { deleteSelected(); });
-    else
-        menu.addItem (tr ("Delete channel") + "\tAlt+Del", count > 1, false, [this, channel] {
-            closeEditor (channel);
-            engine.editSong ([channel] (Song& s) { s.removeChannel (channel); });
-            openEditorRow = -1;
-        });
+    menu.addItem (tr ("Group selected...") + "\tAlt+G", [this] { groupSelected(); });
 
     menu.showMenuAsync (juce::PopupMenu::Options().withTargetComponent (this).withMousePosition());
 }
@@ -1792,6 +1994,8 @@ void ChannelRackComponent::addInstrumentItems (juce::PopupMenu& menu, int insert
     // a new channel of `kind`, at the end (insertAt < 0) or at a row
     auto add = [this, insertAt] (ChannelDef c) {
         int index = 0;
+        if (filterGroup >= 0 && c.group < 0)
+            c.group = filterGroup;
         engine.editSong ([&] (Song& s) {
             c.mixerTrack = s.nextFreeInsert();
             index = insertAt < 0 ? (s.channels.push_back (c), (int) s.channels.size() - 1) : insertChannel (s, insertAt, c);

+ 15 - 0
src/ui/ChannelRackComponent.h

@@ -103,6 +103,17 @@ public:
     // The menu of instruments and plugins to add as a new channel (also the toolbar's plugin picker).
     void showAddChannelMenu (int insertAt = -1);
 
+    // Channel filter groups (FL's "All" dropdown in the rack's title, REA round 104): -1 shows every channel,
+    // otherwise only the channels of that group (Song::channelGroups). New channels join the group shown.
+    int getFilterGroup() const noexcept { return filterGroup; }
+    void setFilterGroup (int group);
+    juce::String filterName() const;
+    void showFilterMenu (juce::Component* target);
+    void groupSelected (); // "Group selected..." (Alt+G): the selected channels go into a new, named group
+    void moveSelectedToGroup (int group); // -1 = no group
+    bool isShown (int row) const;          // not hidden by the filter
+    std::function<void()> onFilterChanged; // the title shows the filter's name and the graph editor's state
+
     static constexpr int rowHeight = 30;
     static constexpr int muteWidth = 26;
     static constexpr int knobWidth = 28;
@@ -126,6 +137,10 @@ private:
     int gridLeft() const noexcept { return selectLeft() + selectWidth + 8; }
     juce::Rectangle<int> rowBounds (int row) const;
     int rowY (int row) const;       // top of a row (rows below the graph lane shift down)
+    int filterGroup = -1;
+    static inline std::vector<Note> stepClipboard; // the channel menu's Cut / Copy / Paste (a channel's notes)
+    int visibleIndex (int row) const; // the row's place among the shown rows
+    int shownCount() const;
     int rowAtY (int y) const;       // row under y (the lane counts as its channel's row)
     int graphRow() const;           // the row the lane belongs to (the primary selection), -1 when hidden
     juce::Rectangle<int> laneBounds() const;

+ 536 - 274
src/ui/I18nData.h

@@ -5971,280 +5971,542 @@ inline constexpr unsigned char ptBR[] = {
 116, 195, 170, 110, 99, 105, 97, 34, 10, 34, 84, 65, 82, 71, 69, 84, 32, 78, 79, 84, 69, 83, 34, 32,
 61, 32, 34, 78, 79, 84, 65, 83, 45, 65, 76, 86, 79, 34, 10, 34, 77, 73, 68, 73, 32, 99, 104, 97,
 110, 110, 101, 108, 34, 32, 61, 32, 34, 67, 97, 110, 97, 108, 32, 77, 73, 68, 73, 34, 10, 10, 35, 32,
-45, 45, 45, 32, 70, 97, 99, 101, 116, 32, 69, 81, 32, 101, 100, 105, 116, 111, 114, 32, 97, 110, 100, 32,
-76, 89, 78, 88, 32, 84, 117, 110, 101, 32, 112, 105, 116, 99, 104, 32, 100, 105, 115, 112, 108, 97, 121, 32,
-40, 114, 111, 117, 110, 100, 32, 49, 48, 51, 41, 10, 34, 76, 73, 86, 69, 32, 80, 73, 84, 67, 72, 34,
-32, 61, 32, 34, 65, 70, 73, 78, 65, 195, 135, 195, 131, 79, 32, 65, 79, 32, 86, 73, 86, 79, 34, 10,
-34, 84, 105, 108, 116, 32, 115, 104, 101, 108, 102, 34, 32, 61, 32, 34, 84, 105, 108, 116, 32, 115, 104, 101,
-108, 102, 34, 10, 34, 90, 101, 114, 111, 32, 108, 97, 116, 101, 110, 99, 121, 34, 32, 61, 32, 34, 76, 97,
-116, 195, 170, 110, 99, 105, 97, 32, 122, 101, 114, 111, 34, 10, 34, 78, 97, 116, 117, 114, 97, 108, 32, 112,
-104, 97, 115, 101, 34, 32, 61, 32, 34, 70, 97, 115, 101, 32, 110, 97, 116, 117, 114, 97, 108, 34, 10, 34,
-76, 105, 110, 101, 97, 114, 32, 112, 104, 97, 115, 101, 34, 32, 61, 32, 34, 70, 97, 115, 101, 32, 108, 105,
-110, 101, 97, 114, 34, 10, 34, 65, 110, 97, 108, 121, 122, 101, 114, 32, 111, 102, 102, 34, 32, 61, 32, 34,
-65, 110, 97, 108, 105, 115, 97, 100, 111, 114, 32, 100, 101, 115, 108, 105, 103, 97, 100, 111, 34, 10, 34, 65,
-110, 97, 108, 121, 122, 101, 114, 58, 32, 112, 114, 101, 34, 32, 61, 32, 34, 65, 110, 97, 108, 105, 115, 97,
-100, 111, 114, 58, 32, 112, 114, 195, 169, 34, 10, 34, 65, 110, 97, 108, 121, 122, 101, 114, 58, 32, 112, 111,
-115, 116, 34, 32, 61, 32, 34, 65, 110, 97, 108, 105, 115, 97, 100, 111, 114, 58, 32, 112, 195, 179, 115, 34,
-10, 34, 65, 110, 97, 108, 121, 122, 101, 114, 58, 32, 112, 114, 101, 32, 43, 32, 112, 111, 115, 116, 34, 32,
-61, 32, 34, 65, 110, 97, 108, 105, 115, 97, 100, 111, 114, 58, 32, 112, 114, 195, 169, 32, 43, 32, 112, 195,
-179, 115, 34, 10, 34, 83, 108, 111, 112, 101, 34, 32, 61, 32, 34, 73, 110, 99, 108, 105, 110, 97, 195, 167,
-195, 163, 111, 34, 10, 34, 68, 121, 110, 97, 109, 105, 99, 32, 114, 97, 110, 103, 101, 34, 32, 61, 32, 34,
-70, 97, 105, 120, 97, 32, 100, 105, 110, 195, 162, 109, 105, 99, 97, 34, 10, 34, 83, 111, 108, 111, 32, 98,
-97, 110, 100, 34, 32, 61, 32, 34, 83, 111, 108, 111, 32, 100, 97, 32, 98, 97, 110, 100, 97, 34, 10, 34,
-82, 101, 115, 101, 116, 32, 103, 97, 105, 110, 34, 32, 61, 32, 34, 90, 101, 114, 97, 114, 32, 103, 97, 110,
-104, 111, 34, 10, 34, 82, 101, 109, 111, 118, 101, 32, 98, 97, 110, 100, 34, 32, 61, 32, 34, 82, 101, 109,
-111, 118, 101, 114, 32, 98, 97, 110, 100, 97, 34, 10, 34, 68, 101, 116, 101, 99, 116, 32, 116, 104, 101, 32,
-69, 81, 39, 115, 32, 105, 110, 112, 117, 116, 34, 32, 61, 32, 34, 68, 101, 116, 101, 99, 116, 97, 114, 32,
-97, 32, 101, 110, 116, 114, 97, 100, 97, 32, 100, 111, 32, 69, 81, 34, 10, 34, 68, 101, 116, 101, 99, 116,
-32, 116, 104, 101, 32, 115, 105, 100, 101, 99, 104, 97, 105, 110, 34, 32, 61, 32, 34, 68, 101, 116, 101, 99,
-116, 97, 114, 32, 111, 32, 115, 105, 100, 101, 99, 104, 97, 105, 110, 34, 10, 34, 80, 114, 111, 99, 101, 115,
-115, 105, 110, 103, 58, 32, 122, 101, 114, 111, 32, 108, 97, 116, 101, 110, 99, 121, 32, 40, 109, 105, 110, 105,
-109, 117, 109, 32, 112, 104, 97, 115, 101, 41, 44, 32, 110, 97, 116, 117, 114, 97, 108, 32, 112, 104, 97, 115,
-101, 32, 40, 116, 104, 101, 32, 97, 110, 97, 108, 111, 103, 32, 99, 117, 114, 118, 101, 39, 115, 32, 112, 104,
-97, 115, 101, 41, 32, 111, 114, 32, 108, 105, 110, 101, 97, 114, 32, 112, 104, 97, 115, 101, 32, 40, 110, 111,
-32, 112, 104, 97, 115, 101, 32, 115, 104, 105, 102, 116, 41, 59, 32, 116, 104, 101, 32, 108, 97, 116, 101, 110,
-99, 121, 32, 105, 115, 32, 114, 101, 112, 111, 114, 116, 101, 100, 32, 116, 111, 32, 80, 68, 67, 34, 32, 61,
-32, 34, 80, 114, 111, 99, 101, 115, 115, 97, 109, 101, 110, 116, 111, 58, 32, 108, 97, 116, 195, 170, 110, 99,
-105, 97, 32, 122, 101, 114, 111, 32, 40, 102, 97, 115, 101, 32, 109, 195, 173, 110, 105, 109, 97, 41, 44, 32,
-102, 97, 115, 101, 32, 110, 97, 116, 117, 114, 97, 108, 32, 40, 97, 32, 102, 97, 115, 101, 32, 100, 97, 32,
-99, 117, 114, 118, 97, 32, 97, 110, 97, 108, 195, 179, 103, 105, 99, 97, 41, 32, 111, 117, 32, 102, 97, 115,
-101, 32, 108, 105, 110, 101, 97, 114, 32, 40, 115, 101, 109, 32, 100, 101, 115, 118, 105, 111, 32, 100, 101, 32,
-102, 97, 115, 101, 41, 59, 32, 97, 32, 108, 97, 116, 195, 170, 110, 99, 105, 97, 32, 195, 169, 32, 105, 110,
-102, 111, 114, 109, 97, 100, 97, 32, 97, 111, 32, 80, 68, 67, 34, 10, 34, 87, 104, 97, 116, 32, 116, 104,
-101, 32, 100, 121, 110, 97, 109, 105, 99, 32, 98, 97, 110, 100, 115, 32, 108, 105, 115, 116, 101, 110, 32, 116,
-111, 58, 32, 116, 104, 101, 32, 69, 81, 39, 115, 32, 105, 110, 112, 117, 116, 32, 111, 114, 32, 97, 32, 115,
-105, 100, 101, 99, 104, 97, 105, 110, 32, 116, 114, 97, 99, 107, 34, 32, 61, 32, 34, 79, 32, 113, 117, 101,
-32, 97, 115, 32, 98, 97, 110, 100, 97, 115, 32, 100, 105, 110, 195, 162, 109, 105, 99, 97, 115, 32, 101, 115,
-99, 117, 116, 97, 109, 58, 32, 97, 32, 101, 110, 116, 114, 97, 100, 97, 32, 100, 111, 32, 69, 81, 32, 111,
-117, 32, 117, 109, 97, 32, 102, 97, 105, 120, 97, 32, 100, 101, 32, 115, 105, 100, 101, 99, 104, 97, 105, 110,
-34, 10, 34, 82, 101, 109, 111, 118, 101, 32, 116, 104, 101, 32, 98, 97, 110, 100, 32, 40, 68, 101, 108, 101,
-116, 101, 41, 34, 32, 61, 32, 34, 82, 101, 109, 111, 118, 101, 114, 32, 97, 32, 98, 97, 110, 100, 97, 32,
-40, 68, 101, 108, 101, 116, 101, 41, 34, 10, 34, 83, 111, 108, 111, 58, 32, 104, 101, 97, 114, 32, 111, 110,
-108, 121, 32, 116, 104, 105, 115, 32, 98, 97, 110, 100, 39, 115, 32, 114, 101, 103, 105, 111, 110, 32, 40, 83,
-41, 34, 32, 61, 32, 34, 83, 111, 108, 111, 58, 32, 111, 117, 118, 105, 114, 32, 115, 195, 179, 32, 97, 32,
-114, 101, 103, 105, 195, 163, 111, 32, 100, 101, 115, 116, 97, 32, 98, 97, 110, 100, 97, 32, 40, 83, 41, 34,
-10, 34, 68, 121, 110, 97, 109, 105, 99, 32, 69, 81, 58, 32, 116, 104, 101, 32, 98, 97, 110, 100, 39, 115,
-32, 103, 97, 105, 110, 32, 109, 111, 118, 101, 115, 32, 98, 121, 32, 117, 112, 32, 116, 111, 32, 105, 116, 115,
-32, 114, 97, 110, 103, 101, 32, 119, 104, 101, 110, 32, 105, 116, 115, 32, 114, 101, 103, 105, 111, 110, 32, 103,
-111, 101, 115, 32, 111, 118, 101, 114, 32, 116, 104, 101, 32, 116, 104, 114, 101, 115, 104, 111, 108, 100, 34, 32,
-61, 32, 34, 69, 81, 32, 100, 105, 110, 195, 162, 109, 105, 99, 111, 58, 32, 111, 32, 103, 97, 110, 104, 111,
-32, 100, 97, 32, 98, 97, 110, 100, 97, 32, 115, 101, 32, 109, 111, 118, 101, 32, 97, 116, 195, 169, 32, 97,
-32, 115, 117, 97, 32, 102, 97, 105, 120, 97, 32, 113, 117, 97, 110, 100, 111, 32, 97, 32, 114, 101, 103, 105,
-195, 163, 111, 32, 100, 101, 108, 97, 32, 112, 97, 115, 115, 97, 32, 100, 111, 32, 108, 105, 109, 105, 97, 114,
-34, 10, 34, 66, 97, 110, 100, 32, 115, 104, 97, 112, 101, 34, 32, 61, 32, 34, 70, 111, 114, 109, 97, 116,
-111, 32, 100, 97, 32, 98, 97, 110, 100, 97, 34, 10, 34, 68, 121, 110, 97, 109, 105, 99, 32, 114, 97, 110,
-103, 101, 58, 32, 100, 114, 97, 103, 32, 117, 112, 32, 111, 114, 32, 100, 111, 119, 110, 34, 32, 61, 32, 34,
-70, 97, 105, 120, 97, 32, 100, 105, 110, 195, 162, 109, 105, 99, 97, 58, 32, 97, 114, 114, 97, 115, 116, 101,
-32, 112, 97, 114, 97, 32, 99, 105, 109, 97, 32, 111, 117, 32, 112, 97, 114, 97, 32, 98, 97, 105, 120, 111,
-34, 10, 34, 68, 111, 117, 98, 108, 101, 45, 99, 108, 105, 99, 107, 32, 116, 111, 32, 97, 100, 100, 32, 97,
-32, 98, 97, 110, 100, 59, 32, 109, 111, 117, 115, 101, 32, 119, 104, 101, 101, 108, 32, 61, 32, 81, 32, 111,
-102, 32, 116, 104, 101, 32, 115, 101, 108, 101, 99, 116, 101, 100, 32, 98, 97, 110, 100, 34, 32, 61, 32, 34,
-68, 117, 112, 108, 111, 32, 99, 108, 105, 113, 117, 101, 32, 112, 97, 114, 97, 32, 97, 100, 105, 99, 105, 111,
-110, 97, 114, 32, 117, 109, 97, 32, 98, 97, 110, 100, 97, 59, 32, 114, 111, 100, 97, 32, 100, 111, 32, 109,
-111, 117, 115, 101, 32, 61, 32, 81, 32, 100, 97, 32, 98, 97, 110, 100, 97, 32, 115, 101, 108, 101, 99, 105,
-111, 110, 97, 100, 97, 34, 10, 34, 79, 85, 84, 34, 32, 61, 32, 34, 83, 65, 195, 141, 68, 65, 34, 10,
-34, 83, 67, 65, 76, 69, 34, 32, 61, 32, 34, 69, 83, 67, 65, 76, 65, 34, 10, 34, 108, 97, 116, 101,
-110, 99, 121, 32, 123, 48, 125, 32, 115, 97, 109, 112, 108, 101, 115, 34, 32, 61, 32, 34, 108, 97, 116, 195,
-170, 110, 99, 105, 97, 32, 123, 48, 125, 32, 97, 109, 111, 115, 116, 114, 97, 115, 34, 10, 34, 68, 111, 117,
-98, 108, 101, 45, 99, 108, 105, 99, 107, 32, 116, 111, 32, 97, 100, 100, 32, 97, 32, 98, 97, 110, 100, 34,
-32, 61, 32, 34, 68, 117, 112, 108, 111, 32, 99, 108, 105, 113, 117, 101, 32, 112, 97, 114, 97, 32, 97, 100,
-105, 99, 105, 111, 110, 97, 114, 32, 117, 109, 97, 32, 98, 97, 110, 100, 97, 34, 10, 34, 68, 121, 110, 97,
-109, 105, 99, 34, 32, 61, 32, 34, 68, 105, 110, 195, 162, 109, 105, 99, 111, 34, 10, 34, 70, 82, 69, 81,
-34, 32, 61, 32, 34, 70, 82, 69, 81, 34, 10, 34, 71, 65, 73, 78, 34, 32, 61, 32, 34, 71, 65, 78,
-72, 79, 34, 10, 34, 82, 65, 78, 71, 69, 34, 32, 61, 32, 34, 70, 65, 73, 88, 65, 34, 10, 34, 84,
-72, 82, 69, 83, 72, 79, 76, 68, 34, 32, 61, 32, 34, 76, 73, 77, 73, 65, 82, 34, 10, 34, 65, 84,
-84, 65, 67, 75, 34, 32, 61, 32, 34, 65, 84, 65, 81, 85, 69, 34, 10, 34, 82, 69, 76, 69, 65, 83,
-69, 34, 32, 61, 32, 34, 82, 69, 76, 69, 65, 83, 69, 34, 10, 34, 79, 112, 101, 110, 32, 70, 97, 99,
-101, 116, 32, 69, 81, 34, 32, 61, 32, 34, 65, 98, 114, 105, 114, 32, 111, 32, 70, 97, 99, 101, 116, 32,
-69, 81, 34, 10, 34, 84, 97, 114, 103, 101, 116, 34, 32, 61, 32, 34, 65, 108, 118, 111, 34, 10, 34, 67,
-111, 114, 114, 101, 99, 116, 105, 111, 110, 34, 32, 61, 32, 34, 67, 111, 114, 114, 101, 195, 167, 195, 163, 111,
-34, 10, 34, 80, 108, 97, 121, 32, 97, 32, 118, 111, 105, 99, 101, 32, 111, 114, 32, 97, 110, 32, 105, 110,
-115, 116, 114, 117, 109, 101, 110, 116, 32, 116, 104, 114, 111, 117, 103, 104, 32, 116, 104, 101, 32, 105, 110, 115,
-101, 114, 116, 32, 116, 111, 32, 115, 101, 101, 32, 105, 116, 115, 32, 112, 105, 116, 99, 104, 34, 32, 61, 32,
-34, 84, 111, 113, 117, 101, 32, 117, 109, 97, 32, 118, 111, 122, 32, 111, 117, 32, 117, 109, 32, 105, 110, 115,
-116, 114, 117, 109, 101, 110, 116, 111, 32, 112, 111, 114, 32, 101, 115, 116, 101, 32, 105, 110, 115, 101, 114, 116,
-32, 112, 97, 114, 97, 32, 118, 101, 114, 32, 97, 32, 97, 102, 105, 110, 97, 195, 167, 195, 163, 111, 34, 10,
-34, 105, 110, 112, 117, 116, 34, 32, 61, 32, 34, 101, 110, 116, 114, 97, 100, 97, 34, 10, 34, 99, 111, 114,
-114, 101, 99, 116, 101, 100, 34, 32, 61, 32, 34, 99, 111, 114, 114, 105, 103, 105, 100, 111, 34, 10, 34, 80,
-114, 101, 32, 43, 32, 80, 111, 115, 116, 34, 32, 61, 32, 34, 80, 114, 195, 169, 32, 43, 32, 80, 195, 179,
-115, 34, 10, 34, 73, 110, 118, 101, 114, 116, 32, 97, 108, 108, 32, 103, 97, 105, 110, 115, 34, 32, 61, 32,
-34, 73, 110, 118, 101, 114, 116, 101, 114, 32, 116, 111, 100, 111, 115, 32, 111, 115, 32, 103, 97, 110, 104, 111,
-115, 34, 10, 34, 82, 101, 109, 111, 118, 101, 32, 97, 108, 108, 32, 98, 97, 110, 100, 115, 34, 32, 61, 32,
-34, 82, 101, 109, 111, 118, 101, 114, 32, 116, 111, 100, 97, 115, 32, 97, 115, 32, 98, 97, 110, 100, 97, 115,
-34, 10, 34, 83, 112, 101, 99, 116, 114, 117, 109, 32, 97, 110, 97, 108, 121, 122, 101, 114, 58, 32, 111, 102,
-102, 44, 32, 112, 114, 101, 44, 32, 112, 111, 115, 116, 32, 111, 114, 32, 112, 114, 101, 32, 43, 32, 112, 111,
-115, 116, 34, 32, 61, 32, 34, 65, 110, 97, 108, 105, 115, 97, 100, 111, 114, 32, 100, 101, 32, 101, 115, 112,
-101, 99, 116, 114, 111, 58, 32, 100, 101, 115, 108, 105, 103, 97, 100, 111, 44, 32, 112, 114, 195, 169, 44, 32,
-112, 195, 179, 115, 32, 111, 117, 32, 112, 114, 195, 169, 32, 43, 32, 112, 195, 179, 115, 34, 10, 34, 70, 114,
-101, 113, 117, 101, 110, 99, 121, 32, 115, 99, 97, 108, 101, 58, 32, 110, 117, 109, 98, 101, 114, 115, 32, 111,
-114, 32, 97, 32, 112, 105, 97, 110, 111, 32, 107, 101, 121, 98, 111, 97, 114, 100, 34, 32, 61, 32, 34, 69,
-115, 99, 97, 108, 97, 32, 100, 101, 32, 102, 114, 101, 113, 117, 195, 170, 110, 99, 105, 97, 58, 32, 110, 195,
-186, 109, 101, 114, 111, 115, 32, 111, 117, 32, 117, 109, 32, 116, 101, 99, 108, 97, 100, 111, 32, 100, 101, 32,
-112, 105, 97, 110, 111, 34, 10, 34, 80, 114, 101, 118, 105, 111, 117, 115, 32, 47, 32, 110, 101, 120, 116, 32,
-98, 97, 110, 100, 34, 32, 61, 32, 34, 66, 97, 110, 100, 97, 32, 97, 110, 116, 101, 114, 105, 111, 114, 32,
-47, 32, 112, 114, 195, 179, 120, 105, 109, 97, 34, 10, 34, 67, 108, 111, 115, 101, 32, 116, 104, 101, 32, 98,
-97, 110, 100, 32, 112, 97, 110, 101, 108, 32, 40, 99, 108, 105, 99, 107, 32, 111, 110, 32, 116, 104, 101, 32,
-101, 109, 112, 116, 121, 32, 103, 114, 97, 112, 104, 32, 100, 111, 101, 115, 32, 116, 104, 101, 32, 115, 97, 109,
-101, 41, 34, 32, 61, 32, 34, 70, 101, 99, 104, 97, 114, 32, 111, 32, 112, 97, 105, 110, 101, 108, 32, 100,
-97, 32, 98, 97, 110, 100, 97, 32, 40, 117, 109, 32, 99, 108, 105, 113, 117, 101, 32, 110, 111, 32, 103, 114,
-195, 161, 102, 105, 99, 111, 32, 118, 97, 122, 105, 111, 32, 102, 97, 122, 32, 111, 32, 109, 101, 115, 109, 111,
-41, 34, 10, 34, 71, 114, 97, 112, 104, 32, 115, 99, 97, 108, 101, 58, 32, 99, 108, 105, 99, 107, 32, 116,
-111, 32, 115, 119, 105, 116, 99, 104, 32, 98, 101, 116, 119, 101, 101, 110, 32, 51, 44, 32, 54, 44, 32, 49,
-50, 32, 97, 110, 100, 32, 51, 48, 32, 100, 66, 34, 32, 61, 32, 34, 69, 115, 99, 97, 108, 97, 32, 100,
-111, 32, 103, 114, 195, 161, 102, 105, 99, 111, 58, 32, 99, 108, 105, 113, 117, 101, 32, 112, 97, 114, 97, 32,
-97, 108, 116, 101, 114, 110, 97, 114, 32, 101, 110, 116, 114, 101, 32, 51, 44, 32, 54, 44, 32, 49, 50, 32,
-101, 32, 51, 48, 32, 100, 66, 34, 10, 34, 100, 114, 97, 103, 32, 61, 32, 102, 114, 101, 113, 117, 101, 110,
-99, 121, 32, 97, 110, 100, 32, 103, 97, 105, 110, 32, 40, 67, 116, 114, 108, 32, 102, 105, 110, 101, 44, 32,
-83, 104, 105, 102, 116, 32, 111, 110, 101, 32, 100, 105, 114, 101, 99, 116, 105, 111, 110, 32, 111, 110, 108, 121,
-41, 59, 32, 119, 104, 101, 101, 108, 32, 61, 32, 81, 59, 32, 65, 108, 116, 45, 99, 108, 105, 99, 107, 32,
-111, 114, 32, 100, 111, 117, 98, 108, 101, 45, 99, 108, 105, 99, 107, 32, 61, 32, 114, 101, 109, 111, 118, 101,
-59, 32, 114, 105, 103, 104, 116, 45, 99, 108, 105, 99, 107, 32, 61, 32, 109, 101, 110, 117, 34, 32, 61, 32,
-34, 97, 114, 114, 97, 115, 116, 97, 114, 32, 61, 32, 102, 114, 101, 113, 117, 195, 170, 110, 99, 105, 97, 32,
-101, 32, 103, 97, 110, 104, 111, 32, 40, 67, 116, 114, 108, 32, 102, 105, 110, 111, 44, 32, 83, 104, 105, 102,
-116, 32, 115, 195, 179, 32, 117, 109, 97, 32, 100, 105, 114, 101, 195, 167, 195, 163, 111, 41, 59, 32, 114, 111,
-100, 97, 32, 61, 32, 81, 59, 32, 65, 108, 116, 43, 99, 108, 105, 113, 117, 101, 32, 111, 117, 32, 100, 117,
-112, 108, 111, 32, 99, 108, 105, 113, 117, 101, 32, 61, 32, 114, 101, 109, 111, 118, 101, 114, 59, 32, 98, 111,
-116, 195, 163, 111, 32, 100, 105, 114, 101, 105, 116, 111, 32, 61, 32, 109, 101, 110, 117, 34, 10, 34, 68, 111,
-117, 98, 108, 101, 45, 99, 108, 105, 99, 107, 58, 32, 110, 101, 119, 32, 98, 97, 110, 100, 32, 32, 45, 32,
-32, 100, 114, 97, 103, 58, 32, 102, 114, 101, 113, 117, 101, 110, 99, 121, 32, 47, 32, 103, 97, 105, 110, 32,
-32, 45, 32, 32, 119, 104, 101, 101, 108, 58, 32, 81, 32, 32, 45, 32, 32, 114, 105, 103, 104, 116, 45, 99,
-108, 105, 99, 107, 58, 32, 109, 101, 110, 117, 34, 32, 61, 32, 34, 68, 117, 112, 108, 111, 32, 99, 108, 105,
-113, 117, 101, 58, 32, 110, 111, 118, 97, 32, 98, 97, 110, 100, 97, 32, 32, 45, 32, 32, 97, 114, 114, 97,
-115, 116, 97, 114, 58, 32, 102, 114, 101, 113, 117, 195, 170, 110, 99, 105, 97, 32, 47, 32, 103, 97, 110, 104,
-111, 32, 32, 45, 32, 32, 114, 111, 100, 97, 58, 32, 81, 32, 32, 45, 32, 32, 98, 111, 116, 195, 163, 111,
-32, 100, 105, 114, 101, 105, 116, 111, 58, 32, 109, 101, 110, 117, 34, 10, 34, 80, 114, 111, 99, 101, 115, 115,
-105, 110, 103, 58, 34, 32, 61, 32, 34, 80, 114, 111, 99, 101, 115, 115, 97, 109, 101, 110, 116, 111, 58, 34,
-10, 34, 65, 110, 97, 108, 121, 122, 101, 114, 58, 34, 32, 61, 32, 34, 65, 110, 97, 108, 105, 115, 97, 100,
-111, 114, 58, 34, 10, 34, 68, 101, 116, 101, 99, 116, 111, 114, 58, 34, 32, 61, 32, 34, 68, 101, 116, 101,
-99, 116, 111, 114, 58, 34, 10, 34, 68, 121, 110, 97, 109, 105, 99, 32, 69, 81, 58, 32, 116, 104, 101, 32,
-103, 97, 105, 110, 32, 102, 111, 108, 108, 111, 119, 115, 32, 116, 104, 101, 32, 108, 101, 118, 101, 108, 32, 111,
-102, 32, 116, 104, 101, 32, 98, 97, 110, 100, 39, 115, 32, 114, 101, 103, 105, 111, 110, 32, 40, 116, 104, 114,
-101, 115, 104, 111, 108, 100, 44, 32, 114, 97, 110, 103, 101, 41, 34, 32, 61, 32, 34, 69, 81, 32, 100, 105,
-110, 195, 162, 109, 105, 99, 111, 58, 32, 111, 32, 103, 97, 110, 104, 111, 32, 115, 101, 103, 117, 101, 32, 111,
-32, 110, 195, 173, 118, 101, 108, 32, 100, 97, 32, 114, 101, 103, 105, 195, 163, 111, 32, 100, 97, 32, 98, 97,
-110, 100, 97, 32, 40, 108, 105, 109, 105, 97, 114, 44, 32, 102, 97, 105, 120, 97, 41, 34, 10, 10, 35, 32,
-76, 89, 78, 88, 39, 115, 32, 114, 101, 118, 101, 114, 98, 115, 32, 40, 114, 111, 117, 110, 100, 32, 49, 48,
-48, 41, 10, 34, 67, 111, 110, 99, 101, 114, 116, 32, 72, 97, 108, 108, 124, 80, 108, 97, 116, 101, 124, 82,
-111, 111, 109, 124, 67, 104, 97, 109, 98, 101, 114, 124, 82, 97, 110, 100, 111, 109, 32, 83, 112, 97, 99, 101,
-124, 67, 104, 111, 114, 117, 115, 32, 83, 112, 97, 99, 101, 124, 65, 109, 98, 105, 101, 110, 99, 101, 124, 66,
-114, 105, 103, 104, 116, 32, 72, 97, 108, 108, 124, 78, 97, 118, 101, 124, 71, 114, 105, 116, 32, 72, 97, 108,
-108, 124, 71, 114, 105, 116, 32, 80, 108, 97, 116, 101, 124, 83, 109, 111, 111, 116, 104, 32, 80, 108, 97, 116,
-101, 124, 83, 109, 111, 111, 116, 104, 32, 82, 111, 111, 109, 124, 83, 109, 111, 111, 116, 104, 32, 83, 112, 97,
-99, 101, 124, 71, 97, 116, 101, 100, 124, 68, 114, 105, 102, 116, 32, 67, 104, 97, 109, 98, 101, 114, 124, 68,
-114, 105, 102, 116, 32, 72, 97, 108, 108, 124, 68, 114, 105, 102, 116, 32, 83, 112, 97, 99, 101, 124, 67, 97,
-116, 104, 101, 100, 114, 97, 108, 124, 71, 114, 97, 110, 100, 32, 72, 97, 108, 108, 124, 86, 105, 110, 116, 97,
-103, 101, 32, 67, 104, 97, 109, 98, 101, 114, 124, 86, 105, 110, 116, 97, 103, 101, 32, 72, 97, 108, 108, 34,
-32, 61, 32, 34, 83, 97, 108, 97, 32, 100, 101, 32, 99, 111, 110, 99, 101, 114, 116, 111, 124, 80, 108, 97,
-99, 97, 124, 83, 97, 108, 97, 124, 67, 195, 162, 109, 97, 114, 97, 124, 69, 115, 112, 97, 195, 167, 111, 32,
-97, 108, 101, 97, 116, 195, 179, 114, 105, 111, 124, 69, 115, 112, 97, 195, 167, 111, 32, 99, 104, 111, 114, 117,
-115, 124, 65, 109, 98, 105, 195, 170, 110, 99, 105, 97, 124, 83, 97, 108, 195, 163, 111, 32, 98, 114, 105, 108,
-104, 97, 110, 116, 101, 124, 78, 97, 118, 101, 124, 83, 97, 108, 195, 163, 111, 32, 115, 117, 106, 111, 124, 80,
-108, 97, 99, 97, 32, 115, 117, 106, 97, 124, 80, 108, 97, 99, 97, 32, 115, 117, 97, 118, 101, 124, 83, 97,
-108, 97, 32, 115, 117, 97, 118, 101, 124, 69, 115, 112, 97, 195, 167, 111, 32, 115, 117, 97, 118, 101, 124, 71,
-97, 116, 101, 100, 124, 67, 195, 162, 109, 97, 114, 97, 32, 195, 160, 32, 100, 101, 114, 105, 118, 97, 124, 83,
-97, 108, 195, 163, 111, 32, 195, 160, 32, 100, 101, 114, 105, 118, 97, 124, 69, 115, 112, 97, 195, 167, 111, 32,
-195, 160, 32, 100, 101, 114, 105, 118, 97, 124, 67, 97, 116, 101, 100, 114, 97, 108, 124, 71, 114, 97, 110, 100,
-101, 32, 115, 97, 108, 195, 163, 111, 124, 67, 195, 162, 109, 97, 114, 97, 32, 118, 105, 110, 116, 97, 103, 101,
-124, 83, 97, 108, 195, 163, 111, 32, 118, 105, 110, 116, 97, 103, 101, 34, 10, 34, 49, 57, 55, 48, 115, 124,
-49, 57, 56, 48, 115, 124, 78, 111, 119, 34, 32, 61, 32, 34, 65, 110, 111, 115, 32, 55, 48, 124, 65, 110,
-111, 115, 32, 56, 48, 124, 65, 116, 117, 97, 108, 34, 10, 34, 66, 97, 115, 115, 32, 109, 117, 108, 116, 34,
-32, 61, 32, 34, 77, 117, 108, 116, 46, 32, 103, 114, 97, 118, 101, 115, 34, 10, 34, 66, 97, 115, 115, 32,
-120, 111, 118, 101, 114, 34, 32, 61, 32, 34, 67, 111, 114, 116, 101, 32, 103, 114, 97, 118, 101, 115, 34, 10,
-34, 72, 105, 103, 104, 32, 102, 114, 101, 113, 34, 32, 61, 32, 34, 70, 114, 101, 113, 46, 32, 97, 103, 117,
-100, 111, 115, 34, 10, 34, 77, 111, 100, 32, 100, 101, 112, 116, 104, 34, 32, 61, 32, 34, 80, 114, 111, 102,
-46, 32, 109, 111, 100, 46, 34, 10, 34, 82, 111, 111, 109, 34, 32, 61, 32, 34, 83, 97, 108, 97, 34, 10,
-34, 76, 97, 114, 103, 101, 32, 82, 111, 111, 109, 124, 77, 101, 100, 105, 117, 109, 32, 82, 111, 111, 109, 124,
-66, 114, 105, 103, 104, 116, 32, 82, 111, 111, 109, 124, 76, 97, 114, 103, 101, 32, 67, 104, 97, 109, 98, 101,
-114, 124, 68, 97, 114, 107, 32, 82, 111, 111, 109, 124, 68, 97, 114, 107, 32, 67, 104, 97, 109, 98, 101, 114,
-124, 68, 97, 114, 107, 32, 83, 112, 97, 99, 101, 124, 68, 101, 101, 112, 32, 83, 112, 97, 99, 101, 124, 77,
-105, 114, 114, 111, 114, 32, 83, 112, 97, 99, 101, 124, 86, 97, 115, 116, 32, 83, 112, 97, 99, 101, 124, 68,
-105, 115, 116, 97, 110, 116, 32, 83, 112, 97, 99, 101, 124, 68, 101, 110, 115, 101, 32, 82, 111, 111, 109, 34,
-32, 61, 32, 34, 83, 97, 108, 97, 32, 103, 114, 97, 110, 100, 101, 124, 83, 97, 108, 97, 32, 109, 195, 169,
-100, 105, 97, 124, 83, 97, 108, 97, 32, 98, 114, 105, 108, 104, 97, 110, 116, 101, 124, 67, 195, 162, 109, 97,
-114, 97, 32, 103, 114, 97, 110, 100, 101, 124, 83, 97, 108, 97, 32, 101, 115, 99, 117, 114, 97, 124, 67, 195,
-162, 109, 97, 114, 97, 32, 101, 115, 99, 117, 114, 97, 124, 69, 115, 112, 97, 195, 167, 111, 32, 101, 115, 99,
-117, 114, 111, 124, 69, 115, 112, 97, 195, 167, 111, 32, 112, 114, 111, 102, 117, 110, 100, 111, 124, 69, 115, 112,
-97, 195, 167, 111, 32, 101, 115, 112, 101, 108, 104, 97, 100, 111, 124, 69, 115, 112, 97, 195, 167, 111, 32, 118,
-97, 115, 116, 111, 124, 69, 115, 112, 97, 195, 167, 111, 32, 100, 105, 115, 116, 97, 110, 116, 101, 124, 83, 97,
-108, 97, 32, 100, 101, 110, 115, 97, 34, 10, 34, 69, 97, 114, 108, 121, 32, 47, 32, 108, 97, 116, 101, 34,
-32, 61, 32, 34, 73, 110, 105, 99, 105, 97, 108, 32, 47, 32, 102, 105, 110, 97, 108, 34, 10, 34, 69, 97,
-114, 108, 121, 34, 32, 61, 32, 34, 82, 101, 102, 108, 101, 120, 195, 181, 101, 115, 32, 105, 110, 105, 99, 105,
-97, 105, 115, 34, 10, 34, 76, 97, 116, 101, 34, 32, 61, 32, 34, 67, 97, 117, 100, 97, 34, 10, 34, 72,
-105, 103, 104, 32, 109, 117, 108, 116, 34, 32, 61, 32, 34, 77, 117, 108, 116, 46, 32, 97, 103, 117, 100, 111,
-115, 34, 10, 34, 72, 105, 103, 104, 32, 120, 111, 118, 101, 114, 34, 32, 61, 32, 34, 67, 111, 114, 116, 101,
-32, 97, 103, 117, 100, 111, 115, 34, 10, 34, 80, 108, 97, 116, 101, 34, 32, 61, 32, 34, 80, 108, 97, 99,
-97, 34, 10, 34, 83, 105, 108, 118, 101, 114, 124, 80, 101, 119, 116, 101, 114, 124, 78, 105, 99, 107, 101, 108,
-124, 66, 114, 111, 110, 122, 101, 124, 66, 105, 115, 109, 117, 116, 104, 124, 84, 105, 110, 124, 90, 105, 110, 99,
-124, 80, 108, 97, 116, 105, 110, 117, 109, 124, 84, 117, 110, 103, 115, 116, 101, 110, 124, 73, 114, 111, 110, 124,
-71, 111, 108, 100, 124, 76, 101, 97, 100, 34, 32, 61, 32, 34, 80, 114, 97, 116, 97, 124, 80, 101, 108, 116,
-114, 101, 124, 78, 195, 173, 113, 117, 101, 108, 124, 66, 114, 111, 110, 122, 101, 124, 66, 105, 115, 109, 117, 116,
-111, 124, 69, 115, 116, 97, 110, 104, 111, 124, 90, 105, 110, 99, 111, 124, 80, 108, 97, 116, 105, 110, 97, 124,
-84, 117, 110, 103, 115, 116, 195, 170, 110, 105, 111, 124, 70, 101, 114, 114, 111, 124, 79, 117, 114, 111, 124, 67,
-104, 117, 109, 98, 111, 34, 10, 34, 76, 111, 119, 32, 102, 114, 101, 113, 34, 32, 61, 32, 34, 70, 114, 101,
-113, 46, 32, 103, 114, 97, 118, 101, 115, 34, 10, 34, 76, 111, 119, 32, 103, 97, 105, 110, 34, 32, 61, 32,
-34, 71, 97, 110, 104, 111, 32, 103, 114, 97, 118, 101, 115, 34, 10, 34, 72, 105, 103, 104, 32, 103, 97, 105,
-110, 34, 32, 61, 32, 34, 71, 97, 110, 104, 111, 32, 97, 103, 117, 100, 111, 115, 34, 10, 34, 82, 105, 112,
-112, 108, 101, 124, 83, 119, 101, 108, 108, 124, 70, 111, 108, 100, 124, 68, 114, 105, 102, 116, 124, 65, 98, 121,
-115, 115, 124, 86, 111, 114, 116, 101, 120, 124, 71, 108, 105, 110, 116, 124, 80, 117, 108, 115, 101, 124, 69, 120,
-112, 97, 110, 115, 101, 124, 72, 97, 122, 101, 124, 86, 101, 105, 108, 124, 77, 105, 115, 116, 124, 77, 111, 110,
-111, 108, 105, 116, 104, 124, 69, 116, 101, 114, 110, 105, 116, 121, 124, 84, 105, 100, 101, 124, 83, 104, 111, 97,
-108, 124, 83, 112, 97, 114, 107, 124, 80, 108, 97, 116, 101, 97, 117, 124, 68, 117, 115, 107, 124, 77, 105, 114,
-97, 103, 101, 124, 67, 108, 117, 115, 116, 101, 114, 124, 66, 101, 97, 99, 111, 110, 34, 32, 61, 32, 34, 79,
-110, 100, 117, 108, 97, 195, 167, 195, 163, 111, 124, 73, 110, 99, 104, 97, 195, 167, 111, 124, 68, 111, 98, 114,
-97, 124, 68, 101, 114, 105, 118, 97, 124, 65, 98, 105, 115, 109, 111, 124, 86, 195, 179, 114, 116, 105, 99, 101,
-124, 76, 97, 109, 112, 101, 106, 111, 124, 80, 117, 108, 115, 111, 124, 86, 97, 115, 116, 105, 100, 195, 163, 111,
-124, 78, 195, 169, 118, 111, 97, 32, 115, 101, 99, 97, 124, 86, 195, 169, 117, 124, 78, 195, 169, 118, 111, 97,
-124, 77, 111, 110, 195, 179, 108, 105, 116, 111, 124, 69, 116, 101, 114, 110, 105, 100, 97, 100, 101, 124, 77, 97,
-114, 195, 169, 124, 67, 97, 114, 100, 117, 109, 101, 124, 70, 97, 195, 173, 115, 99, 97, 124, 80, 108, 97, 110,
-97, 108, 116, 111, 124, 67, 114, 101, 112, 195, 186, 115, 99, 117, 108, 111, 124, 77, 105, 114, 97, 103, 101, 109,
-124, 65, 103, 108, 111, 109, 101, 114, 97, 100, 111, 124, 70, 97, 114, 111, 108, 34, 10, 34, 109, 115, 124, 78,
-111, 116, 101, 124, 68, 111, 116, 116, 101, 100, 124, 84, 114, 105, 112, 108, 101, 116, 34, 32, 61, 32, 34, 109,
-115, 124, 78, 111, 116, 97, 124, 80, 111, 110, 116, 117, 97, 100, 97, 124, 84, 101, 114, 99, 105, 110, 97, 34,
-10, 34, 68, 101, 110, 115, 105, 116, 121, 34, 32, 61, 32, 34, 68, 101, 110, 115, 105, 100, 97, 100, 101, 34,
-10, 34, 87, 97, 114, 112, 34, 32, 61, 32, 34, 68, 105, 115, 116, 111, 114, 195, 167, 195, 163, 111, 34, 10,
-34, 83, 104, 105, 102, 116, 32, 109, 111, 100, 101, 34, 32, 61, 32, 34, 77, 111, 100, 111, 32, 100, 101, 32,
-116, 114, 97, 110, 115, 112, 111, 115, 105, 195, 167, 195, 163, 111, 34, 10, 34, 85, 112, 124, 85, 112, 32, 43,
-32, 100, 111, 119, 110, 124, 85, 112, 44, 32, 98, 114, 105, 103, 104, 116, 124, 85, 112, 32, 43, 32, 100, 111,
-119, 110, 44, 32, 98, 114, 105, 103, 104, 116, 124, 78, 111, 32, 115, 104, 105, 102, 116, 34, 32, 61, 32, 34,
-65, 99, 105, 109, 97, 124, 65, 99, 105, 109, 97, 32, 43, 32, 97, 98, 97, 105, 120, 111, 124, 65, 99, 105,
-109, 97, 44, 32, 98, 114, 105, 108, 104, 97, 110, 116, 101, 124, 65, 99, 105, 109, 97, 32, 43, 32, 97, 98,
-97, 105, 120, 111, 44, 32, 98, 114, 105, 108, 104, 97, 110, 116, 101, 124, 83, 101, 109, 32, 116, 114, 97, 110,
-115, 112, 111, 115, 105, 195, 167, 195, 163, 111, 34, 10, 34, 83, 104, 105, 102, 116, 34, 32, 61, 32, 34, 84,
-114, 97, 110, 115, 112, 111, 115, 105, 195, 167, 195, 163, 111, 34, 10, 34, 87, 105, 100, 101, 124, 68, 101, 110,
-115, 101, 124, 66, 114, 105, 103, 104, 116, 34, 32, 61, 32, 34, 65, 109, 112, 108, 111, 124, 68, 101, 110, 115,
-111, 124, 66, 114, 105, 108, 104, 97, 110, 116, 101, 34, 10, 34, 66, 114, 105, 103, 104, 116, 124, 68, 97, 114,
-107, 34, 32, 61, 32, 34, 66, 114, 105, 108, 104, 97, 110, 116, 101, 124, 69, 115, 99, 117, 114, 111, 34, 10,
-34, 69, 99, 104, 111, 34, 32, 61, 32, 34, 69, 99, 111, 34, 10, 34, 69, 99, 104, 111, 32, 109, 111, 100,
-101, 34, 32, 61, 32, 34, 77, 111, 100, 111, 32, 100, 111, 32, 101, 99, 111, 34, 10, 34, 67, 108, 101, 97,
-110, 124, 84, 97, 112, 101, 124, 68, 105, 103, 105, 116, 97, 108, 124, 65, 110, 97, 108, 111, 103, 124, 68, 101,
-116, 117, 110, 101, 124, 82, 101, 118, 101, 114, 115, 101, 124, 82, 101, 118, 101, 114, 115, 101, 32, 85, 112, 124,
-82, 101, 118, 101, 114, 115, 101, 32, 68, 111, 119, 110, 124, 82, 101, 118, 101, 114, 115, 101, 32, 85, 112, 47,
-68, 111, 119, 110, 124, 83, 112, 97, 114, 107, 108, 101, 124, 83, 119, 97, 114, 109, 124, 76, 111, 45, 102, 105,
-34, 32, 61, 32, 34, 76, 105, 109, 112, 111, 124, 70, 105, 116, 97, 124, 68, 105, 103, 105, 116, 97, 108, 124,
-65, 110, 97, 108, 195, 179, 103, 105, 99, 111, 124, 68, 101, 115, 97, 102, 105, 110, 97, 100, 111, 124, 82, 101,
-118, 101, 114, 115, 111, 124, 82, 101, 118, 101, 114, 115, 111, 32, 97, 99, 105, 109, 97, 124, 82, 101, 118, 101,
-114, 115, 111, 32, 97, 98, 97, 105, 120, 111, 124, 82, 101, 118, 101, 114, 115, 111, 32, 97, 99, 105, 109, 97,
-47, 97, 98, 97, 105, 120, 111, 124, 66, 114, 105, 108, 104, 111, 124, 69, 110, 120, 97, 109, 101, 124, 76, 111,
-45, 102, 105, 34, 10, 34, 69, 99, 104, 111, 32, 62, 32, 82, 101, 118, 124, 82, 101, 118, 32, 62, 32, 69,
-99, 104, 111, 34, 32, 61, 32, 34, 69, 99, 111, 32, 62, 32, 82, 101, 118, 124, 82, 101, 118, 32, 62, 32,
-69, 99, 111, 34, 10, 34, 82, 101, 118, 101, 114, 98, 32, 109, 111, 100, 101, 34, 32, 61, 32, 34, 77, 111,
-100, 111, 32, 100, 111, 32, 114, 101, 118, 101, 114, 98, 34, 10, 34, 82, 111, 111, 109, 124, 67, 104, 97, 109,
-98, 101, 114, 124, 80, 108, 97, 116, 101, 124, 72, 97, 108, 108, 124, 67, 97, 116, 104, 101, 100, 114, 97, 108,
-124, 83, 112, 97, 99, 101, 124, 70, 114, 101, 101, 122, 101, 124, 71, 97, 116, 101, 100, 34, 32, 61, 32, 34,
-83, 97, 108, 97, 124, 67, 195, 162, 109, 97, 114, 97, 124, 80, 108, 97, 99, 97, 124, 83, 97, 108, 195, 163,
-111, 124, 67, 97, 116, 101, 100, 114, 97, 108, 124, 69, 115, 112, 97, 195, 167, 111, 124, 67, 111, 110, 103, 101,
-108, 97, 114, 124, 71, 97, 116, 101, 100, 34, 10, 34, 66, 114, 105, 103, 104, 116, 124, 78, 101, 117, 116, 114,
-97, 108, 124, 68, 97, 114, 107, 124, 86, 105, 110, 116, 97, 103, 101, 34, 32, 61, 32, 34, 66, 114, 105, 108,
-104, 97, 110, 116, 101, 124, 78, 101, 117, 116, 114, 111, 124, 69, 115, 99, 117, 114, 111, 124, 86, 105, 110, 116,
-97, 103, 101, 34, 10, 34, 68, 97, 109, 112, 105, 110, 103, 34, 32, 61, 32, 34, 65, 109, 111, 114, 116, 101,
-99, 105, 109, 101, 110, 116, 111, 34, 10, 34, 66, 97, 115, 115, 32, 102, 114, 101, 113, 34, 32, 61, 32, 34,
-70, 114, 101, 113, 46, 32, 103, 114, 97, 118, 101, 115, 34, 10, 34, 76, 97, 116, 101, 32, 109, 105, 120, 34,
-32, 61, 32, 34, 77, 105, 120, 32, 100, 97, 32, 99, 97, 117, 100, 97, 34, 10, 10, 35, 32, 45, 45, 45,
-32, 68, 121, 110, 97, 109, 105, 99, 115, 32, 115, 117, 105, 116, 101, 32, 40, 114, 111, 117, 110, 100, 32, 49,
-48, 56, 41, 58, 32, 67, 114, 101, 115, 116, 32, 67, 111, 109, 112, 114, 101, 115, 115, 111, 114, 44, 32, 80,
-114, 105, 115, 109, 32, 77, 117, 108, 116, 105, 98, 97, 110, 100, 44, 32, 83, 101, 110, 116, 114, 121, 32, 71,
-97, 116, 101, 44, 32, 69, 109, 98, 101, 114, 39, 115, 32, 98, 97, 110, 100, 115, 10, 34, 66, 97, 110, 100,
-115, 34, 32, 61, 32, 34, 66, 97, 110, 100, 97, 115, 34, 10, 34, 49, 32, 98, 97, 110, 100, 124, 50, 124,
+45, 45, 45, 32, 82, 111, 117, 110, 100, 32, 49, 48, 52, 58, 32, 80, 108, 97, 121, 108, 105, 115, 116, 32,
+116, 114, 97, 99, 107, 32, 103, 114, 111, 117, 112, 115, 32, 97, 110, 100, 32, 80, 105, 99, 107, 101, 114, 32,
+116, 97, 98, 115, 44, 32, 67, 104, 97, 110, 110, 101, 108, 32, 82, 97, 99, 107, 32, 102, 105, 108, 116, 101,
+114, 32, 103, 114, 111, 117, 112, 115, 44, 32, 77, 105, 120, 101, 114, 32, 69, 81, 32, 97, 110, 100, 32, 111,
+117, 116, 112, 117, 116, 10, 34, 80, 117, 116, 32, 116, 104, 101, 32, 115, 101, 108, 101, 99, 116, 101, 100, 32,
+99, 104, 97, 110, 110, 101, 108, 115, 32, 105, 110, 32, 97, 32, 110, 101, 119, 32, 102, 105, 108, 116, 101, 114,
+32, 103, 114, 111, 117, 112, 34, 32, 61, 32, 34, 67, 111, 108, 111, 99, 97, 114, 32, 111, 115, 32, 99, 97,
+110, 97, 105, 115, 32, 115, 101, 108, 101, 99, 105, 111, 110, 97, 100, 111, 115, 32, 110, 117, 109, 32, 110, 111,
+118, 111, 32, 103, 114, 117, 112, 111, 32, 100, 101, 32, 102, 105, 108, 116, 114, 111, 34, 10, 34, 71, 114, 111,
+117, 112, 32, 115, 101, 108, 101, 99, 116, 101, 100, 46, 46, 46, 34, 32, 61, 32, 34, 65, 103, 114, 117, 112,
+97, 114, 32, 115, 101, 108, 101, 99, 105, 111, 110, 97, 100, 111, 115, 46, 46, 46, 34, 10, 34, 40, 110, 111,
+32, 103, 114, 111, 117, 112, 41, 34, 32, 61, 32, 34, 40, 115, 101, 109, 32, 103, 114, 117, 112, 111, 41, 34,
+10, 34, 77, 111, 118, 101, 32, 115, 101, 108, 101, 99, 116, 101, 100, 32, 99, 104, 97, 110, 110, 101, 108, 115,
+32, 116, 111, 34, 32, 61, 32, 34, 77, 111, 118, 101, 114, 32, 111, 115, 32, 99, 97, 110, 97, 105, 115, 32,
+115, 101, 108, 101, 99, 105, 111, 110, 97, 100, 111, 115, 32, 112, 97, 114, 97, 34, 10, 34, 82, 101, 110, 97,
+109, 101, 32, 116, 104, 105, 115, 32, 103, 114, 111, 117, 112, 46, 46, 46, 34, 32, 61, 32, 34, 82, 101, 110,
+111, 109, 101, 97, 114, 32, 101, 115, 116, 101, 32, 103, 114, 117, 112, 111, 46, 46, 46, 34, 10, 34, 70, 105,
+108, 116, 101, 114, 32, 103, 114, 111, 117, 112, 32, 110, 97, 109, 101, 34, 32, 61, 32, 34, 78, 111, 109, 101,
+32, 100, 111, 32, 103, 114, 117, 112, 111, 32, 100, 101, 32, 102, 105, 108, 116, 114, 111, 34, 10, 34, 68, 101,
+108, 101, 116, 101, 32, 116, 104, 105, 115, 32, 103, 114, 111, 117, 112, 32, 40, 107, 101, 101, 112, 115, 32, 105,
+116, 115, 32, 99, 104, 97, 110, 110, 101, 108, 115, 41, 34, 32, 61, 32, 34, 69, 120, 99, 108, 117, 105, 114,
+32, 101, 115, 116, 101, 32, 103, 114, 117, 112, 111, 32, 40, 109, 97, 110, 116, 195, 169, 109, 32, 111, 115, 32,
+99, 97, 110, 97, 105, 115, 41, 34, 10, 34, 71, 114, 111, 117, 112, 32, 123, 48, 125, 34, 32, 61, 32, 34,
+71, 114, 117, 112, 111, 32, 123, 48, 125, 34, 10, 34, 71, 114, 97, 112, 104, 32, 101, 100, 105, 116, 111, 114,
+34, 32, 61, 32, 34, 69, 100, 105, 116, 111, 114, 32, 100, 101, 32, 103, 114, 195, 161, 102, 105, 99, 111, 34,
+10, 34, 67, 104, 97, 110, 103, 101, 32, 99, 111, 108, 111, 114, 34, 32, 61, 32, 34, 77, 117, 100, 97, 114,
+32, 99, 111, 114, 34, 10, 34, 82, 97, 110, 100, 111, 109, 32, 99, 111, 108, 111, 114, 34, 32, 61, 32, 34,
+67, 111, 114, 32, 97, 108, 101, 97, 116, 195, 179, 114, 105, 97, 34, 10, 34, 76, 111, 97, 100, 32, 115, 97,
+109, 112, 108, 101, 46, 46, 46, 34, 32, 61, 32, 34, 67, 97, 114, 114, 101, 103, 97, 114, 32, 115, 97, 109,
+112, 108, 101, 46, 46, 46, 34, 10, 34, 73, 110, 115, 101, 114, 116, 34, 32, 61, 32, 34, 73, 110, 115, 101,
+114, 105, 114, 34, 10, 34, 82, 101, 112, 108, 97, 99, 101, 34, 32, 61, 32, 34, 83, 117, 98, 115, 116, 105,
+116, 117, 105, 114, 34, 10, 34, 68, 101, 108, 101, 116, 101, 46, 46, 46, 34, 32, 61, 32, 34, 69, 120, 99,
+108, 117, 105, 114, 46, 46, 46, 34, 10, 34, 70, 105, 108, 108, 32, 101, 97, 99, 104, 32, 50, 32, 115, 116,
+101, 112, 115, 34, 32, 61, 32, 34, 80, 114, 101, 101, 110, 99, 104, 101, 114, 32, 97, 32, 99, 97, 100, 97,
+32, 50, 32, 115, 116, 101, 112, 115, 34, 10, 34, 70, 105, 108, 108, 32, 101, 97, 99, 104, 32, 52, 32, 115,
+116, 101, 112, 115, 34, 32, 61, 32, 34, 80, 114, 101, 101, 110, 99, 104, 101, 114, 32, 97, 32, 99, 97, 100,
+97, 32, 52, 32, 115, 116, 101, 112, 115, 34, 10, 34, 70, 105, 108, 108, 32, 101, 97, 99, 104, 32, 56, 32,
+115, 116, 101, 112, 115, 34, 32, 61, 32, 34, 80, 114, 101, 101, 110, 99, 104, 101, 114, 32, 97, 32, 99, 97,
+100, 97, 32, 56, 32, 115, 116, 101, 112, 115, 34, 10, 34, 65, 100, 118, 97, 110, 99, 101, 100, 32, 102, 105,
+108, 108, 46, 46, 46, 34, 32, 61, 32, 34, 80, 114, 101, 101, 110, 99, 104, 105, 109, 101, 110, 116, 111, 32,
+97, 118, 97, 110, 195, 167, 97, 100, 111, 46, 46, 46, 34, 10, 34, 67, 104, 97, 110, 110, 101, 108, 32, 102,
+105, 108, 116, 101, 114, 32, 103, 114, 111, 117, 112, 34, 32, 61, 32, 34, 71, 114, 117, 112, 111, 32, 100, 101,
+32, 102, 105, 108, 116, 114, 111, 32, 100, 111, 115, 32, 99, 97, 110, 97, 105, 115, 34, 10, 34, 40, 110, 111,
+32, 97, 117, 100, 105, 111, 32, 100, 101, 118, 105, 99, 101, 41, 34, 32, 61, 32, 34, 40, 115, 101, 109, 32,
+100, 105, 115, 112, 111, 115, 105, 116, 105, 118, 111, 32, 100, 101, 32, 195, 161, 117, 100, 105, 111, 41, 34, 10,
+34, 65, 117, 100, 105, 111, 32, 111, 117, 116, 112, 117, 116, 32, 116, 97, 114, 103, 101, 116, 34, 32, 61, 32,
+34, 68, 101, 115, 116, 105, 110, 111, 32, 100, 97, 32, 115, 97, 195, 173, 100, 97, 32, 100, 101, 32, 195, 161,
+117, 100, 105, 111, 34, 10, 34, 73, 110, 115, 101, 114, 116, 115, 32, 114, 101, 97, 99, 104, 32, 116, 104, 101,
+32, 97, 117, 100, 105, 111, 32, 100, 101, 118, 105, 99, 101, 32, 116, 104, 114, 111, 117, 103, 104, 32, 116, 104,
+101, 32, 77, 97, 115, 116, 101, 114, 34, 32, 61, 32, 34, 79, 115, 32, 105, 110, 115, 101, 114, 116, 115, 32,
+99, 104, 101, 103, 97, 109, 32, 97, 111, 32, 100, 105, 115, 112, 111, 115, 105, 116, 105, 118, 111, 32, 100, 101,
+32, 195, 161, 117, 100, 105, 111, 32, 112, 101, 108, 111, 32, 77, 97, 115, 116, 101, 114, 34, 10, 34, 83, 108,
+111, 116, 32, 123, 48, 125, 34, 32, 61, 32, 34, 83, 108, 111, 116, 32, 123, 48, 125, 34, 10, 34, 108, 101,
+118, 101, 108, 34, 32, 61, 32, 34, 110, 195, 173, 118, 101, 108, 34, 10, 34, 102, 114, 101, 113, 117, 101, 110,
+99, 121, 34, 32, 61, 32, 34, 102, 114, 101, 113, 117, 195, 170, 110, 99, 105, 97, 34, 10, 34, 119, 105, 100,
+116, 104, 34, 32, 61, 32, 34, 108, 97, 114, 103, 117, 114, 97, 34, 10, 34, 69, 81, 32, 98, 97, 110, 100,
+32, 123, 48, 125, 32, 40, 123, 49, 125, 41, 34, 32, 61, 32, 34, 66, 97, 110, 100, 97, 32, 123, 48, 125,
+32, 100, 111, 32, 69, 81, 32, 40, 123, 49, 125, 41, 34, 10, 34, 69, 81, 58, 32, 91, 76, 77, 66, 93,
+32, 100, 114, 97, 103, 32, 116, 104, 101, 32, 98, 97, 110, 100, 39, 115, 32, 102, 114, 101, 113, 117, 101, 110,
+99, 121, 32, 97, 110, 100, 32, 108, 101, 118, 101, 108, 32, 32, 91, 87, 104, 101, 101, 108, 93, 32, 119, 105,
+100, 116, 104, 32, 32, 91, 50, 120, 76, 77, 66, 93, 32, 98, 97, 99, 107, 32, 116, 111, 32, 48, 32, 100,
+66, 34, 32, 61, 32, 34, 69, 81, 58, 32, 91, 76, 77, 66, 93, 32, 97, 114, 114, 97, 115, 116, 101, 32,
+97, 32, 102, 114, 101, 113, 117, 195, 170, 110, 99, 105, 97, 32, 101, 32, 111, 32, 110, 195, 173, 118, 101, 108,
+32, 100, 97, 32, 98, 97, 110, 100, 97, 32, 32, 91, 87, 104, 101, 101, 108, 93, 32, 108, 97, 114, 103, 117,
+114, 97, 32, 32, 91, 50, 120, 76, 77, 66, 93, 32, 118, 111, 108, 116, 97, 32, 97, 32, 48, 32, 100, 66,
+34, 10, 34, 65, 117, 100, 105, 111, 32, 111, 117, 116, 112, 117, 116, 32, 116, 97, 114, 103, 101, 116, 58, 32,
+119, 104, 101, 114, 101, 32, 116, 104, 105, 115, 32, 105, 110, 115, 101, 114, 116, 39, 115, 32, 115, 111, 117, 110,
+100, 32, 108, 101, 97, 118, 101, 115, 32, 76, 89, 78, 88, 34, 32, 61, 32, 34, 68, 101, 115, 116, 105, 110,
+111, 32, 100, 97, 32, 115, 97, 195, 173, 100, 97, 32, 100, 101, 32, 195, 161, 117, 100, 105, 111, 58, 32, 112,
+111, 114, 32, 111, 110, 100, 101, 32, 111, 32, 115, 111, 109, 32, 100, 101, 115, 116, 101, 32, 105, 110, 115, 101,
+114, 116, 32, 115, 97, 105, 32, 100, 111, 32, 76, 89, 78, 88, 34, 10, 34, 69, 102, 102, 101, 99, 116, 32,
+115, 108, 111, 116, 32, 111, 112, 116, 105, 111, 110, 115, 58, 32, 114, 101, 112, 108, 97, 99, 101, 44, 32, 109,
+111, 118, 101, 44, 32, 100, 101, 108, 101, 116, 101, 46, 46, 46, 34, 32, 61, 32, 34, 79, 112, 195, 167, 195,
+181, 101, 115, 32, 100, 111, 32, 115, 108, 111, 116, 32, 100, 101, 32, 101, 102, 101, 105, 116, 111, 58, 32, 115,
+117, 98, 115, 116, 105, 116, 117, 105, 114, 44, 32, 109, 111, 118, 101, 114, 44, 32, 101, 120, 99, 108, 117, 105,
+114, 46, 46, 46, 34, 10, 34, 69, 102, 102, 101, 99, 116, 32, 115, 108, 111, 116, 58, 32, 99, 108, 105, 99,
+107, 32, 101, 100, 105, 116, 115, 44, 32, 100, 111, 117, 98, 108, 101, 45, 99, 108, 105, 99, 107, 32, 111, 112,
+101, 110, 115, 32, 105, 116, 115, 32, 119, 105, 110, 100, 111, 119, 44, 32, 116, 104, 101, 32, 76, 69, 68, 32,
+98, 121, 112, 97, 115, 115, 101, 115, 44, 32, 100, 114, 97, 103, 32, 111, 114, 32, 119, 104, 101, 101, 108, 32,
+114, 101, 111, 114, 100, 101, 114, 115, 44, 32, 114, 105, 103, 104, 116, 45, 99, 108, 105, 99, 107, 58, 32, 111,
+112, 116, 105, 111, 110, 115, 34, 32, 61, 32, 34, 83, 108, 111, 116, 32, 100, 101, 32, 101, 102, 101, 105, 116,
+111, 58, 32, 99, 108, 105, 113, 117, 101, 32, 101, 100, 105, 116, 97, 44, 32, 99, 108, 105, 113, 117, 101, 32,
+100, 117, 112, 108, 111, 32, 97, 98, 114, 101, 32, 97, 32, 106, 97, 110, 101, 108, 97, 44, 32, 111, 32, 76,
+69, 68, 32, 100, 101, 115, 108, 105, 103, 97, 44, 32, 97, 114, 114, 97, 115, 116, 97, 114, 32, 111, 117, 32,
+114, 111, 100, 97, 32, 114, 101, 111, 114, 100, 101, 110, 97, 44, 32, 98, 111, 116, 195, 163, 111, 32, 100, 105,
+114, 101, 105, 116, 111, 58, 32, 111, 112, 195, 167, 195, 181, 101, 115, 34, 10, 34, 65, 117, 116, 111, 32, 110,
+97, 109, 101, 34, 32, 61, 32, 34, 78, 111, 109, 101, 97, 114, 32, 97, 117, 116, 111, 109, 97, 116, 105, 99,
+97, 109, 101, 110, 116, 101, 34, 10, 34, 69, 118, 101, 114, 121, 32, 116, 114, 97, 99, 107, 34, 32, 61, 32,
+34, 84, 111, 100, 97, 115, 32, 97, 115, 32, 102, 97, 105, 120, 97, 115, 34, 10, 34, 71, 114, 111, 117, 112,
+32, 119, 105, 116, 104, 32, 97, 98, 111, 118, 101, 32, 116, 114, 97, 99, 107, 34, 32, 61, 32, 34, 65, 103,
+114, 117, 112, 97, 114, 32, 99, 111, 109, 32, 97, 32, 102, 97, 105, 120, 97, 32, 100, 101, 32, 99, 105, 109,
+97, 34, 10, 34, 85, 110, 103, 114, 111, 117, 112, 34, 32, 61, 32, 34, 68, 101, 115, 97, 103, 114, 117, 112,
+97, 114, 34, 10, 34, 65, 117, 116, 111, 32, 99, 111, 108, 111, 114, 32, 103, 114, 111, 117, 112, 34, 32, 61,
+32, 34, 67, 111, 108, 111, 114, 105, 114, 32, 111, 32, 103, 114, 117, 112, 111, 32, 97, 117, 116, 111, 109, 97,
+116, 105, 99, 97, 109, 101, 110, 116, 101, 34, 10, 34, 67, 111, 108, 108, 97, 112, 115, 101, 32, 103, 114, 111,
+117, 112, 101, 100, 32, 116, 114, 97, 99, 107, 115, 34, 32, 61, 32, 34, 82, 101, 99, 111, 108, 104, 101, 114,
+32, 97, 115, 32, 102, 97, 105, 120, 97, 115, 32, 97, 103, 114, 117, 112, 97, 100, 97, 115, 34, 10, 34, 67,
+117, 114, 114, 101, 110, 116, 32, 99, 108, 105, 112, 32, 115, 111, 117, 114, 99, 101, 34, 32, 61, 32, 34, 70,
+111, 110, 116, 101, 32, 100, 101, 32, 99, 108, 105, 112, 101, 32, 97, 116, 117, 97, 108, 34, 10, 34, 77, 117,
+116, 101, 32, 97, 108, 108, 32, 99, 108, 105, 112, 115, 34, 32, 61, 32, 34, 83, 105, 108, 101, 110, 99, 105,
+97, 114, 32, 116, 111, 100, 111, 115, 32, 111, 115, 32, 99, 108, 105, 112, 101, 115, 34, 10, 34, 85, 110, 109,
+117, 116, 101, 32, 97, 108, 108, 32, 99, 108, 105, 112, 115, 34, 32, 61, 32, 34, 82, 101, 97, 116, 105, 118,
+97, 114, 32, 116, 111, 100, 111, 115, 32, 111, 115, 32, 99, 108, 105, 112, 101, 115, 34, 10, 34, 73, 110, 115,
+101, 114, 116, 32, 111, 110, 101, 34, 32, 61, 32, 34, 73, 110, 115, 101, 114, 105, 114, 32, 117, 109, 97, 34,
+10, 34, 84, 114, 97, 99, 107, 32, 103, 114, 111, 117, 112, 58, 32, 91, 76, 77, 66, 93, 32, 99, 111, 108,
+108, 97, 112, 115, 101, 32, 47, 32, 101, 120, 112, 97, 110, 100, 32, 116, 104, 101, 32, 103, 114, 111, 117, 112,
+101, 100, 32, 116, 114, 97, 99, 107, 115, 34, 32, 61, 32, 34, 71, 114, 117, 112, 111, 32, 100, 101, 32, 102,
+97, 105, 120, 97, 115, 58, 32, 91, 76, 77, 66, 93, 32, 114, 101, 99, 111, 108, 104, 101, 32, 47, 32, 101,
+120, 112, 97, 110, 100, 101, 32, 97, 115, 32, 102, 97, 105, 120, 97, 115, 32, 97, 103, 114, 117, 112, 97, 100,
+97, 115, 34, 10, 34, 84, 114, 97, 99, 107, 58, 32, 91, 76, 77, 66, 93, 32, 115, 101, 108, 101, 99, 116,
+32, 32, 91, 82, 77, 66, 93, 32, 109, 101, 110, 117, 32, 32, 91, 50, 120, 76, 77, 66, 93, 32, 111, 112,
+101, 110, 32, 116, 104, 101, 32, 99, 108, 105, 112, 32, 115, 111, 117, 114, 99, 101, 32, 32, 91, 83, 104, 105,
+102, 116, 93, 91, 87, 104, 101, 101, 108, 93, 32, 109, 111, 118, 101, 32, 117, 112, 32, 47, 32, 100, 111, 119,
+110, 34, 32, 61, 32, 34, 70, 97, 105, 120, 97, 58, 32, 91, 76, 77, 66, 93, 32, 115, 101, 108, 101, 99,
+105, 111, 110, 97, 32, 32, 91, 82, 77, 66, 93, 32, 109, 101, 110, 117, 32, 32, 91, 50, 120, 76, 77, 66,
+93, 32, 97, 98, 114, 101, 32, 97, 32, 102, 111, 110, 116, 101, 32, 100, 111, 32, 99, 108, 105, 112, 101, 32,
+32, 91, 83, 104, 105, 102, 116, 93, 91, 87, 104, 101, 101, 108, 93, 32, 109, 111, 118, 101, 32, 112, 97, 114,
+97, 32, 99, 105, 109, 97, 32, 47, 32, 98, 97, 105, 120, 111, 34, 10, 34, 80, 105, 99, 107, 101, 114, 58,
+32, 112, 97, 116, 116, 101, 114, 110, 115, 34, 32, 61, 32, 34, 80, 105, 99, 107, 101, 114, 58, 32, 112, 97,
+116, 116, 101, 114, 110, 115, 34, 10, 34, 80, 105, 99, 107, 101, 114, 58, 32, 97, 117, 100, 105, 111, 32, 99,
+108, 105, 112, 115, 34, 32, 61, 32, 34, 80, 105, 99, 107, 101, 114, 58, 32, 99, 108, 105, 112, 101, 115, 32,
+100, 101, 32, 195, 161, 117, 100, 105, 111, 34, 10, 34, 80, 105, 99, 107, 101, 114, 58, 32, 97, 117, 116, 111,
+109, 97, 116, 105, 111, 110, 32, 99, 108, 105, 112, 115, 34, 32, 61, 32, 34, 80, 105, 99, 107, 101, 114, 58,
+32, 99, 108, 105, 112, 101, 115, 32, 100, 101, 32, 97, 117, 116, 111, 109, 97, 195, 167, 195, 163, 111, 34, 10,
+34, 91, 76, 77, 66, 93, 32, 115, 104, 111, 119, 34, 32, 61, 32, 34, 91, 76, 77, 66, 93, 32, 109, 111,
+115, 116, 114, 97, 114, 34, 10, 34, 80, 97, 116, 116, 101, 114, 110, 58, 32, 91, 76, 77, 66, 93, 32, 112,
+97, 105, 110, 116, 32, 105, 116, 32, 119, 105, 116, 104, 32, 116, 104, 101, 32, 112, 101, 110, 99, 105, 108, 32,
+32, 91, 50, 120, 76, 77, 66, 93, 32, 111, 112, 101, 110, 32, 32, 91, 82, 77, 66, 93, 32, 109, 101, 110,
+117, 34, 32, 61, 32, 34, 80, 97, 116, 116, 101, 114, 110, 58, 32, 91, 76, 77, 66, 93, 32, 112, 105, 110,
+116, 97, 32, 99, 111, 109, 32, 111, 32, 108, 195, 161, 112, 105, 115, 32, 32, 91, 50, 120, 76, 77, 66, 93,
+32, 97, 98, 114, 101, 32, 32, 91, 82, 77, 66, 93, 32, 109, 101, 110, 117, 34, 10, 34, 67, 108, 105, 112,
+32, 115, 111, 117, 114, 99, 101, 58, 32, 91, 76, 77, 66, 93, 32, 112, 97, 105, 110, 116, 32, 105, 116, 32,
+119, 105, 116, 104, 32, 116, 104, 101, 32, 112, 101, 110, 99, 105, 108, 34, 32, 61, 32, 34, 70, 111, 110, 116,
+101, 32, 100, 101, 32, 99, 108, 105, 112, 101, 58, 32, 91, 76, 77, 66, 93, 32, 112, 105, 110, 116, 97, 32,
+99, 111, 109, 32, 111, 32, 108, 195, 161, 112, 105, 115, 34, 10, 35, 32, 114, 111, 117, 110, 100, 32, 49, 48,
+53, 58, 32, 70, 76, 32, 97, 114, 114, 97, 110, 103, 101, 109, 101, 110, 116, 115, 32, 111, 102, 32, 70, 114,
+117, 105, 116, 121, 32, 86, 111, 99, 111, 100, 101, 114, 44, 32, 70, 114, 101, 113, 117, 101, 110, 99, 121, 32,
+83, 112, 108, 105, 116, 116, 101, 114, 44, 32, 70, 114, 117, 105, 116, 121, 32, 68, 101, 108, 97, 121, 32, 66,
+97, 110, 107, 44, 32, 69, 81, 85, 79, 44, 32, 77, 117, 108, 116, 105, 98, 97, 110, 100, 32, 68, 101, 108,
+97, 121, 44, 32, 70, 114, 117, 105, 116, 121, 32, 67, 111, 110, 118, 111, 108, 118, 101, 114, 46, 46, 46, 10,
+34, 65, 100, 100, 32, 109, 111, 100, 101, 34, 32, 61, 32, 34, 77, 111, 100, 111, 32, 115, 111, 109, 97, 114,
+34, 10, 34, 66, 97, 110, 100, 115, 34, 32, 61, 32, 34, 66, 97, 110, 100, 97, 115, 34, 10, 34, 66, 97,
+110, 107, 34, 32, 61, 32, 34, 66, 97, 110, 99, 111, 34, 10, 34, 67, 97, 114, 34, 32, 61, 32, 34, 80,
+111, 114, 116, 46, 34, 10, 34, 67, 111, 109, 112, 124, 83, 97, 116, 124, 67, 108, 105, 112, 34, 32, 61, 32,
+34, 67, 111, 109, 112, 124, 83, 97, 116, 124, 67, 108, 105, 112, 34, 10, 34, 67, 114, 111, 115, 115, 111, 118,
+101, 114, 34, 32, 61, 32, 34, 67, 114, 111, 115, 115, 111, 118, 101, 114, 34, 10, 34, 68, 101, 108, 97, 121,
+124, 86, 111, 108, 124, 80, 97, 110, 34, 32, 61, 32, 34, 68, 101, 108, 97, 121, 124, 86, 111, 108, 124, 80,
+97, 110, 34, 10, 34, 68, 105, 118, 34, 32, 61, 32, 34, 68, 105, 118, 34, 10, 34, 70, 66, 34, 32, 61,
+32, 34, 70, 66, 34, 10, 34, 70, 66, 32, 102, 105, 108, 116, 101, 114, 34, 32, 61, 32, 34, 70, 105, 108,
+116, 114, 111, 32, 70, 66, 34, 10, 34, 70, 111, 114, 109, 34, 32, 61, 32, 34, 70, 111, 114, 109, 46, 34,
+10, 34, 71, 101, 110, 116, 108, 101, 124, 83, 116, 101, 101, 112, 124, 76, 105, 110, 101, 97, 114, 32, 112, 104,
+97, 115, 101, 34, 32, 61, 32, 34, 83, 117, 97, 118, 101, 124, 195, 141, 110, 103, 114, 101, 109, 101, 124, 70,
+97, 115, 101, 32, 108, 105, 110, 101, 97, 114, 34, 10, 34, 71, 114, 97, 105, 110, 34, 32, 61, 32, 34, 71,
+114, 195, 163, 111, 34, 10, 34, 76, 105, 110, 101, 97, 114, 32, 112, 104, 97, 115, 101, 34, 32, 61, 32, 34,
+70, 97, 115, 101, 32, 108, 105, 110, 101, 97, 114, 34, 10, 34, 76, 111, 119, 101, 115, 116, 124, 76, 111, 119,
+124, 77, 101, 100, 105, 117, 109, 124, 72, 105, 103, 104, 124, 72, 105, 103, 104, 101, 114, 124, 72, 105, 103, 104,
+101, 115, 116, 34, 32, 61, 32, 34, 77, 195, 173, 110, 105, 109, 97, 124, 66, 97, 105, 120, 97, 124, 77, 195,
+169, 100, 105, 97, 124, 65, 108, 116, 97, 124, 77, 97, 105, 115, 32, 97, 108, 116, 97, 124, 77, 195, 161, 120,
+105, 109, 97, 34, 10, 34, 77, 97, 105, 110, 32, 111, 117, 116, 34, 32, 61, 32, 34, 83, 97, 195, 173, 100,
+97, 32, 112, 114, 105, 110, 99, 105, 112, 97, 108, 34, 10, 34, 77, 111, 100, 117, 108, 97, 116, 111, 114, 124,
+67, 97, 114, 114, 105, 101, 114, 124, 77, 105, 120, 34, 32, 61, 32, 34, 77, 111, 100, 117, 108, 97, 100, 111,
+114, 97, 124, 80, 111, 114, 116, 97, 100, 111, 114, 97, 124, 77, 105, 120, 34, 10, 34, 77, 111, 114, 112, 104,
+34, 32, 61, 32, 34, 77, 111, 114, 112, 104, 34, 10, 34, 78, 101, 120, 116, 34, 32, 61, 32, 34, 80, 114,
+195, 179, 120, 46, 34, 10, 34, 78, 111, 32, 105, 109, 112, 117, 108, 115, 101, 32, 114, 101, 115, 112, 111, 110,
+115, 101, 34, 32, 61, 32, 34, 83, 101, 109, 32, 114, 101, 115, 112, 111, 115, 116, 97, 32, 97, 111, 32, 105,
+109, 112, 117, 108, 115, 111, 34, 10, 34, 79, 102, 102, 124, 50, 120, 124, 52, 120, 34, 32, 61, 32, 34, 68,
+101, 115, 108, 46, 124, 50, 120, 124, 52, 120, 34, 10, 34, 79, 102, 102, 124, 76, 111, 119, 32, 112, 97, 115,
+115, 124, 66, 97, 110, 100, 32, 112, 97, 115, 115, 124, 78, 111, 116, 99, 104, 124, 72, 105, 103, 104, 32, 112,
+97, 115, 115, 124, 76, 111, 119, 32, 115, 104, 101, 108, 102, 124, 80, 101, 97, 107, 105, 110, 103, 124, 72, 105,
+103, 104, 32, 115, 104, 101, 108, 102, 34, 32, 61, 32, 34, 68, 101, 115, 108, 46, 124, 80, 97, 115, 115, 97,
+45, 98, 97, 105, 120, 97, 124, 80, 97, 115, 115, 97, 45, 98, 97, 110, 100, 97, 124, 78, 111, 116, 99, 104,
+124, 80, 97, 115, 115, 97, 45, 97, 108, 116, 97, 124, 83, 104, 101, 108, 102, 32, 103, 114, 97, 118, 101, 124,
+80, 105, 99, 111, 124, 83, 104, 101, 108, 102, 32, 97, 103, 117, 100, 111, 34, 10, 34, 79, 102, 102, 124, 78,
+111, 114, 109, 124, 73, 110, 118, 124, 80, 46, 112, 111, 110, 103, 34, 32, 61, 32, 34, 68, 101, 115, 108, 46,
+124, 78, 111, 114, 109, 124, 73, 110, 118, 124, 80, 46, 112, 111, 110, 103, 34, 10, 34, 80, 114, 101, 99, 105,
+115, 105, 111, 110, 34, 32, 61, 32, 34, 80, 114, 101, 99, 105, 115, 195, 163, 111, 34, 10, 34, 83, 101, 108,
+102, 45, 99, 111, 110, 118, 34, 32, 61, 32, 34, 65, 117, 116, 111, 99, 111, 110, 118, 46, 34, 10, 34, 83,
+101, 110, 100, 32, 111, 110, 108, 121, 34, 32, 61, 32, 34, 83, 195, 179, 32, 101, 110, 118, 105, 111, 34, 10,
+34, 83, 101, 110, 100, 115, 34, 32, 61, 32, 34, 69, 110, 118, 105, 111, 115, 34, 10, 34, 83, 101, 116, 117,
+112, 34, 32, 61, 32, 34, 67, 111, 110, 102, 105, 103, 117, 114, 97, 195, 167, 195, 163, 111, 34, 10, 34, 83,
+104, 34, 32, 61, 32, 34, 70, 111, 114, 109, 97, 34, 10, 34, 83, 104, 105, 102, 116, 34, 32, 61, 32, 34,
+68, 101, 115, 108, 111, 99, 46, 34, 10, 34, 83, 108, 111, 112, 101, 34, 32, 61, 32, 34, 73, 110, 99, 108,
+105, 110, 97, 195, 167, 195, 163, 111, 34, 10, 34, 83, 109, 111, 111, 116, 104, 105, 110, 103, 32, 116, 105, 109,
+101, 34, 32, 61, 32, 34, 84, 101, 109, 112, 111, 32, 100, 101, 32, 115, 117, 97, 118, 105, 122, 97, 195, 167,
+195, 163, 111, 34, 10, 34, 86, 111, 108, 124, 80, 97, 110, 124, 83, 101, 110, 100, 34, 32, 61, 32, 34, 86,
+111, 108, 124, 80, 97, 110, 124, 69, 110, 118, 105, 111, 34, 10, 34, 120, 32, 48, 46, 49, 34, 32, 61, 32,
+34, 120, 32, 48, 44, 49, 34, 10, 34, 40, 101, 109, 112, 116, 121, 41, 124, 68, 105, 115, 116, 111, 114, 116,
+105, 111, 110, 124, 67, 104, 111, 114, 117, 115, 124, 70, 108, 97, 110, 103, 101, 114, 124, 80, 104, 97, 115, 101,
+114, 124, 82, 101, 118, 101, 114, 98, 124, 68, 101, 108, 97, 121, 124, 78, 111, 105, 115, 101, 32, 103, 97, 116,
+101, 124, 69, 113, 117, 97, 108, 105, 122, 101, 114, 124, 67, 111, 109, 112, 114, 101, 115, 115, 111, 114, 124, 77,
+111, 100, 117, 108, 97, 116, 111, 114, 124, 84, 117, 98, 101, 32, 100, 114, 105, 118, 101, 34, 32, 61, 32, 34,
+40, 118, 97, 122, 105, 111, 41, 124, 68, 105, 115, 116, 111, 114, 195, 167, 195, 163, 111, 124, 67, 104, 111, 114,
+117, 115, 124, 70, 108, 97, 110, 103, 101, 114, 124, 80, 104, 97, 115, 101, 114, 124, 82, 101, 118, 101, 114, 98,
+124, 68, 101, 108, 97, 121, 124, 78, 111, 105, 115, 101, 32, 103, 97, 116, 101, 124, 69, 113, 117, 97, 108, 105,
+122, 97, 100, 111, 114, 124, 67, 111, 109, 112, 114, 101, 115, 115, 111, 114, 124, 77, 111, 100, 117, 108, 97, 100,
+111, 114, 124, 86, 195, 161, 108, 118, 117, 108, 97, 34, 10, 34, 43, 78, 111, 105, 115, 101, 34, 32, 61, 32,
+34, 43, 82, 117, 195, 173, 100, 111, 34, 10, 34, 66, 97, 110, 100, 32, 103, 97, 105, 110, 32, 109, 117, 108,
+116, 105, 112, 108, 105, 101, 114, 34, 32, 61, 32, 34, 77, 117, 108, 116, 105, 112, 108, 105, 99, 97, 100, 111,
+114, 32, 100, 101, 32, 103, 97, 110, 104, 111, 32, 112, 111, 114, 32, 98, 97, 110, 100, 97, 34, 10, 34, 66,
+97, 110, 100, 115, 32, 45, 32, 100, 105, 115, 116, 114, 105, 98, 117, 116, 105, 111, 110, 34, 32, 61, 32, 34,
+66, 97, 110, 100, 97, 115, 32, 45, 32, 100, 105, 115, 116, 114, 105, 98, 117, 105, 195, 167, 195, 163, 111, 34,
+10, 34, 67, 97, 98, 105, 110, 101, 116, 34, 32, 61, 32, 34, 71, 97, 98, 105, 110, 101, 116, 101, 34, 10,
+34, 67, 97, 114, 114, 105, 101, 114, 32, 115, 121, 110, 116, 104, 101, 115, 105, 122, 101, 114, 34, 32, 61, 32,
+34, 83, 105, 110, 116, 101, 116, 105, 122, 97, 100, 111, 114, 32, 112, 111, 114, 116, 97, 100, 111, 114, 34, 10,
+34, 67, 97, 114, 114, 105, 101, 114, 58, 32, 111, 119, 110, 32, 105, 110, 112, 117, 116, 34, 32, 61, 32, 34,
+80, 111, 114, 116, 97, 100, 111, 114, 97, 58, 32, 101, 110, 116, 114, 97, 100, 97, 32, 112, 114, 195, 179, 112,
+114, 105, 97, 34, 10, 34, 67, 97, 114, 114, 105, 101, 114, 58, 32, 115, 105, 100, 101, 32, 105, 110, 112, 117,
+116, 32, 123, 48, 125, 34, 32, 61, 32, 34, 80, 111, 114, 116, 97, 100, 111, 114, 97, 58, 32, 101, 110, 116,
+114, 97, 100, 97, 32, 108, 97, 116, 101, 114, 97, 108, 32, 123, 48, 125, 34, 10, 34, 67, 104, 111, 114, 117,
+115, 34, 32, 61, 32, 34, 67, 104, 111, 114, 117, 115, 34, 10, 34, 67, 111, 109, 98, 34, 32, 61, 32, 34,
+80, 101, 110, 116, 101, 34, 10, 34, 67, 111, 110, 115, 111, 110, 97, 110, 116, 115, 34, 32, 61, 32, 34, 67,
+111, 110, 115, 111, 97, 110, 116, 101, 115, 34, 10, 34, 67, 111, 110, 116, 111, 117, 114, 34, 32, 61, 32, 34,
+67, 111, 110, 116, 111, 114, 110, 111, 34, 10, 34, 68, 101, 108, 97, 121, 32, 109, 111, 100, 101, 34, 32, 61,
+32, 34, 77, 111, 100, 111, 32, 100, 111, 32, 100, 101, 108, 97, 121, 34, 10, 34, 68, 101, 110, 115, 105, 116,
+121, 34, 32, 61, 32, 34, 68, 101, 110, 115, 105, 100, 97, 100, 101, 34, 10, 34, 68, 105, 115, 116, 34, 32,
+61, 32, 34, 68, 105, 115, 116, 34, 10, 34, 68, 105, 115, 116, 111, 114, 116, 105, 111, 110, 34, 32, 61, 32,
+34, 68, 105, 115, 116, 111, 114, 195, 167, 195, 163, 111, 34, 10, 34, 68, 105, 115, 116, 111, 114, 116, 124, 76,
+111, 45, 102, 105, 124, 70, 108, 97, 110, 103, 101, 114, 124, 80, 104, 97, 115, 101, 114, 124, 70, 105, 108, 116,
+101, 114, 124, 68, 101, 108, 97, 121, 124, 82, 101, 118, 101, 114, 98, 124, 83, 116, 101, 114, 101, 111, 124, 84,
+114, 97, 110, 115, 124, 71, 114, 97, 105, 110, 124, 86, 111, 120, 124, 82, 105, 110, 103, 34, 32, 61, 32, 34,
+68, 105, 115, 116, 111, 114, 195, 167, 195, 163, 111, 124, 76, 111, 45, 102, 105, 124, 70, 108, 97, 110, 103, 101,
+114, 124, 80, 104, 97, 115, 101, 114, 124, 70, 105, 108, 116, 114, 111, 124, 68, 101, 108, 97, 121, 124, 82, 101,
+118, 101, 114, 98, 124, 69, 115, 116, 195, 169, 114, 101, 111, 124, 84, 114, 97, 110, 115, 124, 71, 114, 195, 163,
+111, 124, 86, 111, 120, 124, 82, 105, 110, 103, 34, 10, 34, 68, 114, 121, 47, 119, 101, 116, 34, 32, 61, 32,
+34, 83, 101, 99, 111, 47, 109, 111, 108, 104, 97, 100, 111, 34, 10, 34, 69, 110, 118, 101, 108, 111, 112, 101,
+32, 102, 111, 108, 108, 111, 119, 101, 114, 34, 32, 61, 32, 34, 83, 101, 103, 117, 105, 100, 111, 114, 32, 100,
+101, 32, 101, 110, 118, 101, 108, 111, 112, 101, 34, 10, 34, 70, 97, 115, 116, 124, 65, 99, 99, 117, 114, 97,
+116, 101, 34, 32, 61, 32, 34, 82, 195, 161, 112, 105, 100, 111, 124, 80, 114, 101, 99, 105, 115, 111, 34, 10,
+34, 70, 108, 97, 110, 103, 101, 114, 34, 32, 61, 32, 34, 70, 108, 97, 110, 103, 101, 114, 34, 10, 34, 70,
+108, 97, 116, 110, 101, 115, 115, 34, 32, 61, 32, 34, 80, 108, 97, 110, 117, 114, 97, 34, 10, 34, 70, 111,
+114, 109, 97, 110, 116, 34, 32, 61, 32, 34, 70, 111, 114, 109, 97, 110, 116, 101, 34, 10, 34, 70, 111, 114,
+109, 97, 110, 116, 32, 99, 111, 114, 114, 101, 99, 116, 105, 111, 110, 34, 32, 61, 32, 34, 67, 111, 114, 114,
+101, 195, 167, 195, 163, 111, 32, 100, 101, 32, 102, 111, 114, 109, 97, 110, 116, 101, 34, 10, 34, 70, 114, 111,
+109, 34, 32, 61, 32, 34, 68, 101, 34, 10, 34, 71, 108, 97, 115, 115, 34, 32, 61, 32, 34, 86, 105, 100,
+114, 111, 34, 10, 34, 72, 105, 45, 100, 97, 109, 112, 34, 32, 61, 32, 34, 65, 109, 111, 114, 116, 46, 32,
+97, 103, 117, 100, 111, 115, 34, 10, 34, 73, 110, 102, 101, 114, 110, 111, 34, 32, 61, 32, 34, 73, 110, 102,
+101, 114, 110, 111, 34, 10, 34, 73, 110, 116, 101, 110, 115, 105, 116, 121, 34, 32, 61, 32, 34, 73, 110, 116,
+101, 110, 115, 105, 100, 97, 100, 101, 34, 10, 34, 74, 105, 116, 116, 101, 114, 34, 32, 61, 32, 34, 74, 105,
+116, 116, 101, 114, 34, 10, 34, 76, 45, 82, 32, 101, 110, 99, 111, 100, 105, 110, 103, 34, 32, 61, 32, 34,
+67, 111, 100, 105, 102, 105, 99, 97, 195, 167, 195, 163, 111, 32, 76, 45, 82, 34, 10, 34, 76, 101, 102, 116,
+124, 82, 105, 103, 104, 116, 124, 76, 101, 102, 116, 32, 43, 32, 114, 105, 103, 104, 116, 34, 32, 61, 32, 34,
+69, 115, 113, 117, 101, 114, 100, 97, 124, 68, 105, 114, 101, 105, 116, 97, 124, 69, 115, 113, 117, 101, 114, 100,
+97, 32, 43, 32, 100, 105, 114, 101, 105, 116, 97, 34, 10, 34, 77, 105, 100, 100, 108, 101, 34, 32, 61, 32,
+34, 77, 195, 169, 100, 105, 111, 34, 10, 34, 77, 105, 110, 32, 116, 105, 109, 101, 115, 34, 32, 61, 32, 34,
+84, 101, 109, 112, 111, 115, 32, 109, 195, 173, 110, 46, 34, 10, 34, 77, 111, 100, 32, 112, 105, 116, 99, 104,
+34, 32, 61, 32, 34, 65, 102, 105, 110, 97, 195, 167, 195, 163, 111, 32, 109, 111, 100, 46, 34, 10, 34, 77,
+111, 100, 32, 119, 105, 100, 116, 104, 34, 32, 61, 32, 34, 76, 97, 114, 103, 117, 114, 97, 32, 109, 111, 100,
+46, 34, 10, 34, 77, 111, 100, 117, 108, 97, 116, 111, 114, 34, 32, 61, 32, 34, 77, 111, 100, 117, 108, 97,
+100, 111, 114, 34, 10, 34, 79, 102, 102, 124, 80, 111, 115, 116, 124, 80, 114, 101, 124, 78, 111, 32, 115, 104,
+105, 102, 116, 34, 32, 61, 32, 34, 68, 101, 115, 108, 46, 124, 80, 195, 179, 115, 124, 80, 114, 195, 169, 124,
+83, 101, 109, 32, 100, 101, 115, 118, 105, 111, 34, 10, 34, 80, 105, 116, 99, 104, 32, 97, 110, 97, 108, 121,
+115, 105, 115, 34, 32, 61, 32, 34, 65, 110, 195, 161, 108, 105, 115, 101, 32, 100, 101, 32, 97, 102, 105, 110,
+97, 195, 167, 195, 163, 111, 34, 10, 34, 82, 97, 110, 100, 34, 32, 61, 32, 34, 65, 108, 101, 97, 116, 46,
+34, 10, 34, 82, 101, 108, 97, 116, 105, 118, 101, 124, 67, 52, 124, 67, 53, 124, 67, 54, 34, 32, 61, 32,
+34, 82, 101, 108, 97, 116, 105, 118, 111, 124, 67, 52, 124, 67, 53, 124, 67, 54, 34, 10, 34, 83, 71, 34,
+32, 61, 32, 34, 83, 71, 34, 10, 34, 83, 105, 110, 101, 124, 83, 97, 119, 124, 83, 113, 117, 97, 114, 101,
+34, 32, 61, 32, 34, 83, 101, 110, 111, 105, 100, 101, 124, 83, 101, 114, 114, 97, 124, 81, 117, 97, 100, 114,
+97, 100, 97, 34, 10, 34, 84, 104, 114, 101, 97, 100, 101, 100, 34, 32, 61, 32, 34, 77, 117, 108, 116, 105,
+116, 104, 114, 101, 97, 100, 34, 10, 34, 84, 111, 34, 32, 61, 32, 34, 80, 97, 114, 97, 34, 10, 34, 84,
+117, 98, 101, 32, 100, 114, 105, 118, 101, 34, 32, 61, 32, 34, 86, 195, 161, 108, 118, 117, 108, 97, 34, 10,
+34, 85, 110, 105, 46, 32, 112, 97, 110, 34, 32, 61, 32, 34, 80, 97, 110, 32, 117, 110, 195, 173, 115, 115,
+46, 34, 10, 34, 85, 110, 105, 46, 32, 112, 105, 116, 99, 104, 34, 32, 61, 32, 34, 65, 102, 105, 110, 46,
+32, 117, 110, 195, 173, 115, 115, 46, 34, 10, 34, 86, 111, 105, 99, 101, 124, 77, 117, 115, 105, 99, 34, 32,
+61, 32, 34, 86, 111, 122, 124, 77, 195, 186, 115, 105, 99, 97, 34, 10, 34, 88, 32, 109, 111, 100, 34, 32,
+61, 32, 34, 77, 111, 100, 32, 88, 34, 10, 34, 88, 32, 112, 97, 114, 97, 109, 34, 32, 61, 32, 34, 80,
+97, 114, 195, 162, 109, 46, 32, 88, 34, 10, 34, 89, 32, 109, 111, 100, 34, 32, 61, 32, 34, 77, 111, 100,
+32, 89, 34, 10, 34, 89, 32, 112, 97, 114, 97, 109, 34, 32, 61, 32, 34, 80, 97, 114, 195, 162, 109, 46,
+32, 89, 34, 10, 35, 32, 45, 45, 45, 32, 70, 97, 99, 101, 116, 32, 69, 81, 32, 101, 100, 105, 116, 111,
+114, 32, 97, 110, 100, 32, 76, 89, 78, 88, 32, 84, 117, 110, 101, 32, 112, 105, 116, 99, 104, 32, 100, 105,
+115, 112, 108, 97, 121, 32, 40, 114, 111, 117, 110, 100, 32, 49, 48, 51, 41, 10, 34, 76, 73, 86, 69, 32,
+80, 73, 84, 67, 72, 34, 32, 61, 32, 34, 65, 70, 73, 78, 65, 195, 135, 195, 131, 79, 32, 65, 79, 32,
+86, 73, 86, 79, 34, 10, 34, 84, 105, 108, 116, 32, 115, 104, 101, 108, 102, 34, 32, 61, 32, 34, 84, 105,
+108, 116, 32, 115, 104, 101, 108, 102, 34, 10, 34, 90, 101, 114, 111, 32, 108, 97, 116, 101, 110, 99, 121, 34,
+32, 61, 32, 34, 76, 97, 116, 195, 170, 110, 99, 105, 97, 32, 122, 101, 114, 111, 34, 10, 34, 78, 97, 116,
+117, 114, 97, 108, 32, 112, 104, 97, 115, 101, 34, 32, 61, 32, 34, 70, 97, 115, 101, 32, 110, 97, 116, 117,
+114, 97, 108, 34, 10, 34, 65, 110, 97, 108, 121, 122, 101, 114, 32, 111, 102, 102, 34, 32, 61, 32, 34, 65,
+110, 97, 108, 105, 115, 97, 100, 111, 114, 32, 100, 101, 115, 108, 105, 103, 97, 100, 111, 34, 10, 34, 65, 110,
+97, 108, 121, 122, 101, 114, 58, 32, 112, 114, 101, 34, 32, 61, 32, 34, 65, 110, 97, 108, 105, 115, 97, 100,
+111, 114, 58, 32, 112, 114, 195, 169, 34, 10, 34, 65, 110, 97, 108, 121, 122, 101, 114, 58, 32, 112, 111, 115,
+116, 34, 32, 61, 32, 34, 65, 110, 97, 108, 105, 115, 97, 100, 111, 114, 58, 32, 112, 195, 179, 115, 34, 10,
+34, 65, 110, 97, 108, 121, 122, 101, 114, 58, 32, 112, 114, 101, 32, 43, 32, 112, 111, 115, 116, 34, 32, 61,
+32, 34, 65, 110, 97, 108, 105, 115, 97, 100, 111, 114, 58, 32, 112, 114, 195, 169, 32, 43, 32, 112, 195, 179,
+115, 34, 10, 34, 68, 121, 110, 97, 109, 105, 99, 32, 114, 97, 110, 103, 101, 34, 32, 61, 32, 34, 70, 97,
+105, 120, 97, 32, 100, 105, 110, 195, 162, 109, 105, 99, 97, 34, 10, 34, 83, 111, 108, 111, 32, 98, 97, 110,
+100, 34, 32, 61, 32, 34, 83, 111, 108, 111, 32, 100, 97, 32, 98, 97, 110, 100, 97, 34, 10, 34, 82, 101,
+115, 101, 116, 32, 103, 97, 105, 110, 34, 32, 61, 32, 34, 90, 101, 114, 97, 114, 32, 103, 97, 110, 104, 111,
+34, 10, 34, 82, 101, 109, 111, 118, 101, 32, 98, 97, 110, 100, 34, 32, 61, 32, 34, 82, 101, 109, 111, 118,
+101, 114, 32, 98, 97, 110, 100, 97, 34, 10, 34, 68, 101, 116, 101, 99, 116, 32, 116, 104, 101, 32, 69, 81,
+39, 115, 32, 105, 110, 112, 117, 116, 34, 32, 61, 32, 34, 68, 101, 116, 101, 99, 116, 97, 114, 32, 97, 32,
+101, 110, 116, 114, 97, 100, 97, 32, 100, 111, 32, 69, 81, 34, 10, 34, 68, 101, 116, 101, 99, 116, 32, 116,
+104, 101, 32, 115, 105, 100, 101, 99, 104, 97, 105, 110, 34, 32, 61, 32, 34, 68, 101, 116, 101, 99, 116, 97,
+114, 32, 111, 32, 115, 105, 100, 101, 99, 104, 97, 105, 110, 34, 10, 34, 80, 114, 111, 99, 101, 115, 115, 105,
+110, 103, 58, 32, 122, 101, 114, 111, 32, 108, 97, 116, 101, 110, 99, 121, 32, 40, 109, 105, 110, 105, 109, 117,
+109, 32, 112, 104, 97, 115, 101, 41, 44, 32, 110, 97, 116, 117, 114, 97, 108, 32, 112, 104, 97, 115, 101, 32,
+40, 116, 104, 101, 32, 97, 110, 97, 108, 111, 103, 32, 99, 117, 114, 118, 101, 39, 115, 32, 112, 104, 97, 115,
+101, 41, 32, 111, 114, 32, 108, 105, 110, 101, 97, 114, 32, 112, 104, 97, 115, 101, 32, 40, 110, 111, 32, 112,
+104, 97, 115, 101, 32, 115, 104, 105, 102, 116, 41, 59, 32, 116, 104, 101, 32, 108, 97, 116, 101, 110, 99, 121,
+32, 105, 115, 32, 114, 101, 112, 111, 114, 116, 101, 100, 32, 116, 111, 32, 80, 68, 67, 34, 32, 61, 32, 34,
+80, 114, 111, 99, 101, 115, 115, 97, 109, 101, 110, 116, 111, 58, 32, 108, 97, 116, 195, 170, 110, 99, 105, 97,
+32, 122, 101, 114, 111, 32, 40, 102, 97, 115, 101, 32, 109, 195, 173, 110, 105, 109, 97, 41, 44, 32, 102, 97,
+115, 101, 32, 110, 97, 116, 117, 114, 97, 108, 32, 40, 97, 32, 102, 97, 115, 101, 32, 100, 97, 32, 99, 117,
+114, 118, 97, 32, 97, 110, 97, 108, 195, 179, 103, 105, 99, 97, 41, 32, 111, 117, 32, 102, 97, 115, 101, 32,
+108, 105, 110, 101, 97, 114, 32, 40, 115, 101, 109, 32, 100, 101, 115, 118, 105, 111, 32, 100, 101, 32, 102, 97,
+115, 101, 41, 59, 32, 97, 32, 108, 97, 116, 195, 170, 110, 99, 105, 97, 32, 195, 169, 32, 105, 110, 102, 111,
+114, 109, 97, 100, 97, 32, 97, 111, 32, 80, 68, 67, 34, 10, 34, 87, 104, 97, 116, 32, 116, 104, 101, 32,
+100, 121, 110, 97, 109, 105, 99, 32, 98, 97, 110, 100, 115, 32, 108, 105, 115, 116, 101, 110, 32, 116, 111, 58,
+32, 116, 104, 101, 32, 69, 81, 39, 115, 32, 105, 110, 112, 117, 116, 32, 111, 114, 32, 97, 32, 115, 105, 100,
+101, 99, 104, 97, 105, 110, 32, 116, 114, 97, 99, 107, 34, 32, 61, 32, 34, 79, 32, 113, 117, 101, 32, 97,
+115, 32, 98, 97, 110, 100, 97, 115, 32, 100, 105, 110, 195, 162, 109, 105, 99, 97, 115, 32, 101, 115, 99, 117,
+116, 97, 109, 58, 32, 97, 32, 101, 110, 116, 114, 97, 100, 97, 32, 100, 111, 32, 69, 81, 32, 111, 117, 32,
+117, 109, 97, 32, 102, 97, 105, 120, 97, 32, 100, 101, 32, 115, 105, 100, 101, 99, 104, 97, 105, 110, 34, 10,
+34, 82, 101, 109, 111, 118, 101, 32, 116, 104, 101, 32, 98, 97, 110, 100, 32, 40, 68, 101, 108, 101, 116, 101,
+41, 34, 32, 61, 32, 34, 82, 101, 109, 111, 118, 101, 114, 32, 97, 32, 98, 97, 110, 100, 97, 32, 40, 68,
+101, 108, 101, 116, 101, 41, 34, 10, 34, 83, 111, 108, 111, 58, 32, 104, 101, 97, 114, 32, 111, 110, 108, 121,
+32, 116, 104, 105, 115, 32, 98, 97, 110, 100, 39, 115, 32, 114, 101, 103, 105, 111, 110, 32, 40, 83, 41, 34,
+32, 61, 32, 34, 83, 111, 108, 111, 58, 32, 111, 117, 118, 105, 114, 32, 115, 195, 179, 32, 97, 32, 114, 101,
+103, 105, 195, 163, 111, 32, 100, 101, 115, 116, 97, 32, 98, 97, 110, 100, 97, 32, 40, 83, 41, 34, 10, 34,
+68, 121, 110, 97, 109, 105, 99, 32, 69, 81, 58, 32, 116, 104, 101, 32, 98, 97, 110, 100, 39, 115, 32, 103,
+97, 105, 110, 32, 109, 111, 118, 101, 115, 32, 98, 121, 32, 117, 112, 32, 116, 111, 32, 105, 116, 115, 32, 114,
+97, 110, 103, 101, 32, 119, 104, 101, 110, 32, 105, 116, 115, 32, 114, 101, 103, 105, 111, 110, 32, 103, 111, 101,
+115, 32, 111, 118, 101, 114, 32, 116, 104, 101, 32, 116, 104, 114, 101, 115, 104, 111, 108, 100, 34, 32, 61, 32,
+34, 69, 81, 32, 100, 105, 110, 195, 162, 109, 105, 99, 111, 58, 32, 111, 32, 103, 97, 110, 104, 111, 32, 100,
+97, 32, 98, 97, 110, 100, 97, 32, 115, 101, 32, 109, 111, 118, 101, 32, 97, 116, 195, 169, 32, 97, 32, 115,
+117, 97, 32, 102, 97, 105, 120, 97, 32, 113, 117, 97, 110, 100, 111, 32, 97, 32, 114, 101, 103, 105, 195, 163,
+111, 32, 100, 101, 108, 97, 32, 112, 97, 115, 115, 97, 32, 100, 111, 32, 108, 105, 109, 105, 97, 114, 34, 10,
+34, 66, 97, 110, 100, 32, 115, 104, 97, 112, 101, 34, 32, 61, 32, 34, 70, 111, 114, 109, 97, 116, 111, 32,
+100, 97, 32, 98, 97, 110, 100, 97, 34, 10, 34, 68, 121, 110, 97, 109, 105, 99, 32, 114, 97, 110, 103, 101,
+58, 32, 100, 114, 97, 103, 32, 117, 112, 32, 111, 114, 32, 100, 111, 119, 110, 34, 32, 61, 32, 34, 70, 97,
+105, 120, 97, 32, 100, 105, 110, 195, 162, 109, 105, 99, 97, 58, 32, 97, 114, 114, 97, 115, 116, 101, 32, 112,
+97, 114, 97, 32, 99, 105, 109, 97, 32, 111, 117, 32, 112, 97, 114, 97, 32, 98, 97, 105, 120, 111, 34, 10,
+34, 68, 111, 117, 98, 108, 101, 45, 99, 108, 105, 99, 107, 32, 116, 111, 32, 97, 100, 100, 32, 97, 32, 98,
+97, 110, 100, 59, 32, 109, 111, 117, 115, 101, 32, 119, 104, 101, 101, 108, 32, 61, 32, 81, 32, 111, 102, 32,
+116, 104, 101, 32, 115, 101, 108, 101, 99, 116, 101, 100, 32, 98, 97, 110, 100, 34, 32, 61, 32, 34, 68, 117,
+112, 108, 111, 32, 99, 108, 105, 113, 117, 101, 32, 112, 97, 114, 97, 32, 97, 100, 105, 99, 105, 111, 110, 97,
+114, 32, 117, 109, 97, 32, 98, 97, 110, 100, 97, 59, 32, 114, 111, 100, 97, 32, 100, 111, 32, 109, 111, 117,
+115, 101, 32, 61, 32, 81, 32, 100, 97, 32, 98, 97, 110, 100, 97, 32, 115, 101, 108, 101, 99, 105, 111, 110,
+97, 100, 97, 34, 10, 34, 79, 85, 84, 34, 32, 61, 32, 34, 83, 65, 195, 141, 68, 65, 34, 10, 34, 83,
+67, 65, 76, 69, 34, 32, 61, 32, 34, 69, 83, 67, 65, 76, 65, 34, 10, 34, 108, 97, 116, 101, 110, 99,
+121, 32, 123, 48, 125, 32, 115, 97, 109, 112, 108, 101, 115, 34, 32, 61, 32, 34, 108, 97, 116, 195, 170, 110,
+99, 105, 97, 32, 123, 48, 125, 32, 97, 109, 111, 115, 116, 114, 97, 115, 34, 10, 34, 68, 111, 117, 98, 108,
+101, 45, 99, 108, 105, 99, 107, 32, 116, 111, 32, 97, 100, 100, 32, 97, 32, 98, 97, 110, 100, 34, 32, 61,
+32, 34, 68, 117, 112, 108, 111, 32, 99, 108, 105, 113, 117, 101, 32, 112, 97, 114, 97, 32, 97, 100, 105, 99,
+105, 111, 110, 97, 114, 32, 117, 109, 97, 32, 98, 97, 110, 100, 97, 34, 10, 34, 68, 121, 110, 97, 109, 105,
+99, 34, 32, 61, 32, 34, 68, 105, 110, 195, 162, 109, 105, 99, 111, 34, 10, 34, 70, 82, 69, 81, 34, 32,
+61, 32, 34, 70, 82, 69, 81, 34, 10, 34, 71, 65, 73, 78, 34, 32, 61, 32, 34, 71, 65, 78, 72, 79,
+34, 10, 34, 82, 65, 78, 71, 69, 34, 32, 61, 32, 34, 70, 65, 73, 88, 65, 34, 10, 34, 84, 72, 82,
+69, 83, 72, 79, 76, 68, 34, 32, 61, 32, 34, 76, 73, 77, 73, 65, 82, 34, 10, 34, 65, 84, 84, 65,
+67, 75, 34, 32, 61, 32, 34, 65, 84, 65, 81, 85, 69, 34, 10, 34, 82, 69, 76, 69, 65, 83, 69, 34,
+32, 61, 32, 34, 82, 69, 76, 69, 65, 83, 69, 34, 10, 34, 79, 112, 101, 110, 32, 70, 97, 99, 101, 116,
+32, 69, 81, 34, 32, 61, 32, 34, 65, 98, 114, 105, 114, 32, 111, 32, 70, 97, 99, 101, 116, 32, 69, 81,
+34, 10, 34, 84, 97, 114, 103, 101, 116, 34, 32, 61, 32, 34, 65, 108, 118, 111, 34, 10, 34, 67, 111, 114,
+114, 101, 99, 116, 105, 111, 110, 34, 32, 61, 32, 34, 67, 111, 114, 114, 101, 195, 167, 195, 163, 111, 34, 10,
+34, 80, 108, 97, 121, 32, 97, 32, 118, 111, 105, 99, 101, 32, 111, 114, 32, 97, 110, 32, 105, 110, 115, 116,
+114, 117, 109, 101, 110, 116, 32, 116, 104, 114, 111, 117, 103, 104, 32, 116, 104, 101, 32, 105, 110, 115, 101, 114,
+116, 32, 116, 111, 32, 115, 101, 101, 32, 105, 116, 115, 32, 112, 105, 116, 99, 104, 34, 32, 61, 32, 34, 84,
+111, 113, 117, 101, 32, 117, 109, 97, 32, 118, 111, 122, 32, 111, 117, 32, 117, 109, 32, 105, 110, 115, 116, 114,
+117, 109, 101, 110, 116, 111, 32, 112, 111, 114, 32, 101, 115, 116, 101, 32, 105, 110, 115, 101, 114, 116, 32, 112,
+97, 114, 97, 32, 118, 101, 114, 32, 97, 32, 97, 102, 105, 110, 97, 195, 167, 195, 163, 111, 34, 10, 34, 105,
+110, 112, 117, 116, 34, 32, 61, 32, 34, 101, 110, 116, 114, 97, 100, 97, 34, 10, 34, 99, 111, 114, 114, 101,
+99, 116, 101, 100, 34, 32, 61, 32, 34, 99, 111, 114, 114, 105, 103, 105, 100, 111, 34, 10, 34, 80, 114, 101,
+32, 43, 32, 80, 111, 115, 116, 34, 32, 61, 32, 34, 80, 114, 195, 169, 32, 43, 32, 80, 195, 179, 115, 34,
+10, 34, 73, 110, 118, 101, 114, 116, 32, 97, 108, 108, 32, 103, 97, 105, 110, 115, 34, 32, 61, 32, 34, 73,
+110, 118, 101, 114, 116, 101, 114, 32, 116, 111, 100, 111, 115, 32, 111, 115, 32, 103, 97, 110, 104, 111, 115, 34,
+10, 34, 82, 101, 109, 111, 118, 101, 32, 97, 108, 108, 32, 98, 97, 110, 100, 115, 34, 32, 61, 32, 34, 82,
+101, 109, 111, 118, 101, 114, 32, 116, 111, 100, 97, 115, 32, 97, 115, 32, 98, 97, 110, 100, 97, 115, 34, 10,
+34, 83, 112, 101, 99, 116, 114, 117, 109, 32, 97, 110, 97, 108, 121, 122, 101, 114, 58, 32, 111, 102, 102, 44,
+32, 112, 114, 101, 44, 32, 112, 111, 115, 116, 32, 111, 114, 32, 112, 114, 101, 32, 43, 32, 112, 111, 115, 116,
+34, 32, 61, 32, 34, 65, 110, 97, 108, 105, 115, 97, 100, 111, 114, 32, 100, 101, 32, 101, 115, 112, 101, 99,
+116, 114, 111, 58, 32, 100, 101, 115, 108, 105, 103, 97, 100, 111, 44, 32, 112, 114, 195, 169, 44, 32, 112, 195,
+179, 115, 32, 111, 117, 32, 112, 114, 195, 169, 32, 43, 32, 112, 195, 179, 115, 34, 10, 34, 70, 114, 101, 113,
+117, 101, 110, 99, 121, 32, 115, 99, 97, 108, 101, 58, 32, 110, 117, 109, 98, 101, 114, 115, 32, 111, 114, 32,
+97, 32, 112, 105, 97, 110, 111, 32, 107, 101, 121, 98, 111, 97, 114, 100, 34, 32, 61, 32, 34, 69, 115, 99,
+97, 108, 97, 32, 100, 101, 32, 102, 114, 101, 113, 117, 195, 170, 110, 99, 105, 97, 58, 32, 110, 195, 186, 109,
+101, 114, 111, 115, 32, 111, 117, 32, 117, 109, 32, 116, 101, 99, 108, 97, 100, 111, 32, 100, 101, 32, 112, 105,
+97, 110, 111, 34, 10, 34, 80, 114, 101, 118, 105, 111, 117, 115, 32, 47, 32, 110, 101, 120, 116, 32, 98, 97,
+110, 100, 34, 32, 61, 32, 34, 66, 97, 110, 100, 97, 32, 97, 110, 116, 101, 114, 105, 111, 114, 32, 47, 32,
+112, 114, 195, 179, 120, 105, 109, 97, 34, 10, 34, 67, 108, 111, 115, 101, 32, 116, 104, 101, 32, 98, 97, 110,
+100, 32, 112, 97, 110, 101, 108, 32, 40, 99, 108, 105, 99, 107, 32, 111, 110, 32, 116, 104, 101, 32, 101, 109,
+112, 116, 121, 32, 103, 114, 97, 112, 104, 32, 100, 111, 101, 115, 32, 116, 104, 101, 32, 115, 97, 109, 101, 41,
+34, 32, 61, 32, 34, 70, 101, 99, 104, 97, 114, 32, 111, 32, 112, 97, 105, 110, 101, 108, 32, 100, 97, 32,
+98, 97, 110, 100, 97, 32, 40, 117, 109, 32, 99, 108, 105, 113, 117, 101, 32, 110, 111, 32, 103, 114, 195, 161,
+102, 105, 99, 111, 32, 118, 97, 122, 105, 111, 32, 102, 97, 122, 32, 111, 32, 109, 101, 115, 109, 111, 41, 34,
+10, 34, 71, 114, 97, 112, 104, 32, 115, 99, 97, 108, 101, 58, 32, 99, 108, 105, 99, 107, 32, 116, 111, 32,
+115, 119, 105, 116, 99, 104, 32, 98, 101, 116, 119, 101, 101, 110, 32, 51, 44, 32, 54, 44, 32, 49, 50, 32,
+97, 110, 100, 32, 51, 48, 32, 100, 66, 34, 32, 61, 32, 34, 69, 115, 99, 97, 108, 97, 32, 100, 111, 32,
+103, 114, 195, 161, 102, 105, 99, 111, 58, 32, 99, 108, 105, 113, 117, 101, 32, 112, 97, 114, 97, 32, 97, 108,
+116, 101, 114, 110, 97, 114, 32, 101, 110, 116, 114, 101, 32, 51, 44, 32, 54, 44, 32, 49, 50, 32, 101, 32,
+51, 48, 32, 100, 66, 34, 10, 34, 100, 114, 97, 103, 32, 61, 32, 102, 114, 101, 113, 117, 101, 110, 99, 121,
+32, 97, 110, 100, 32, 103, 97, 105, 110, 32, 40, 67, 116, 114, 108, 32, 102, 105, 110, 101, 44, 32, 83, 104,
+105, 102, 116, 32, 111, 110, 101, 32, 100, 105, 114, 101, 99, 116, 105, 111, 110, 32, 111, 110, 108, 121, 41, 59,
+32, 119, 104, 101, 101, 108, 32, 61, 32, 81, 59, 32, 65, 108, 116, 45, 99, 108, 105, 99, 107, 32, 111, 114,
+32, 100, 111, 117, 98, 108, 101, 45, 99, 108, 105, 99, 107, 32, 61, 32, 114, 101, 109, 111, 118, 101, 59, 32,
+114, 105, 103, 104, 116, 45, 99, 108, 105, 99, 107, 32, 61, 32, 109, 101, 110, 117, 34, 32, 61, 32, 34, 97,
+114, 114, 97, 115, 116, 97, 114, 32, 61, 32, 102, 114, 101, 113, 117, 195, 170, 110, 99, 105, 97, 32, 101, 32,
+103, 97, 110, 104, 111, 32, 40, 67, 116, 114, 108, 32, 102, 105, 110, 111, 44, 32, 83, 104, 105, 102, 116, 32,
+115, 195, 179, 32, 117, 109, 97, 32, 100, 105, 114, 101, 195, 167, 195, 163, 111, 41, 59, 32, 114, 111, 100, 97,
+32, 61, 32, 81, 59, 32, 65, 108, 116, 43, 99, 108, 105, 113, 117, 101, 32, 111, 117, 32, 100, 117, 112, 108,
+111, 32, 99, 108, 105, 113, 117, 101, 32, 61, 32, 114, 101, 109, 111, 118, 101, 114, 59, 32, 98, 111, 116, 195,
+163, 111, 32, 100, 105, 114, 101, 105, 116, 111, 32, 61, 32, 109, 101, 110, 117, 34, 10, 34, 68, 111, 117, 98,
+108, 101, 45, 99, 108, 105, 99, 107, 58, 32, 110, 101, 119, 32, 98, 97, 110, 100, 32, 32, 45, 32, 32, 100,
+114, 97, 103, 58, 32, 102, 114, 101, 113, 117, 101, 110, 99, 121, 32, 47, 32, 103, 97, 105, 110, 32, 32, 45,
+32, 32, 119, 104, 101, 101, 108, 58, 32, 81, 32, 32, 45, 32, 32, 114, 105, 103, 104, 116, 45, 99, 108, 105,
+99, 107, 58, 32, 109, 101, 110, 117, 34, 32, 61, 32, 34, 68, 117, 112, 108, 111, 32, 99, 108, 105, 113, 117,
+101, 58, 32, 110, 111, 118, 97, 32, 98, 97, 110, 100, 97, 32, 32, 45, 32, 32, 97, 114, 114, 97, 115, 116,
+97, 114, 58, 32, 102, 114, 101, 113, 117, 195, 170, 110, 99, 105, 97, 32, 47, 32, 103, 97, 110, 104, 111, 32,
+32, 45, 32, 32, 114, 111, 100, 97, 58, 32, 81, 32, 32, 45, 32, 32, 98, 111, 116, 195, 163, 111, 32, 100,
+105, 114, 101, 105, 116, 111, 58, 32, 109, 101, 110, 117, 34, 10, 34, 80, 114, 111, 99, 101, 115, 115, 105, 110,
+103, 58, 34, 32, 61, 32, 34, 80, 114, 111, 99, 101, 115, 115, 97, 109, 101, 110, 116, 111, 58, 34, 10, 34,
+65, 110, 97, 108, 121, 122, 101, 114, 58, 34, 32, 61, 32, 34, 65, 110, 97, 108, 105, 115, 97, 100, 111, 114,
+58, 34, 10, 34, 68, 101, 116, 101, 99, 116, 111, 114, 58, 34, 32, 61, 32, 34, 68, 101, 116, 101, 99, 116,
+111, 114, 58, 34, 10, 34, 68, 121, 110, 97, 109, 105, 99, 32, 69, 81, 58, 32, 116, 104, 101, 32, 103, 97,
+105, 110, 32, 102, 111, 108, 108, 111, 119, 115, 32, 116, 104, 101, 32, 108, 101, 118, 101, 108, 32, 111, 102, 32,
+116, 104, 101, 32, 98, 97, 110, 100, 39, 115, 32, 114, 101, 103, 105, 111, 110, 32, 40, 116, 104, 114, 101, 115,
+104, 111, 108, 100, 44, 32, 114, 97, 110, 103, 101, 41, 34, 32, 61, 32, 34, 69, 81, 32, 100, 105, 110, 195,
+162, 109, 105, 99, 111, 58, 32, 111, 32, 103, 97, 110, 104, 111, 32, 115, 101, 103, 117, 101, 32, 111, 32, 110,
+195, 173, 118, 101, 108, 32, 100, 97, 32, 114, 101, 103, 105, 195, 163, 111, 32, 100, 97, 32, 98, 97, 110, 100,
+97, 32, 40, 108, 105, 109, 105, 97, 114, 44, 32, 102, 97, 105, 120, 97, 41, 34, 10, 10, 35, 32, 76, 89,
+78, 88, 39, 115, 32, 114, 101, 118, 101, 114, 98, 115, 32, 40, 114, 111, 117, 110, 100, 32, 49, 48, 48, 41,
+10, 34, 67, 111, 110, 99, 101, 114, 116, 32, 72, 97, 108, 108, 124, 80, 108, 97, 116, 101, 124, 82, 111, 111,
+109, 124, 67, 104, 97, 109, 98, 101, 114, 124, 82, 97, 110, 100, 111, 109, 32, 83, 112, 97, 99, 101, 124, 67,
+104, 111, 114, 117, 115, 32, 83, 112, 97, 99, 101, 124, 65, 109, 98, 105, 101, 110, 99, 101, 124, 66, 114, 105,
+103, 104, 116, 32, 72, 97, 108, 108, 124, 78, 97, 118, 101, 124, 71, 114, 105, 116, 32, 72, 97, 108, 108, 124,
+71, 114, 105, 116, 32, 80, 108, 97, 116, 101, 124, 83, 109, 111, 111, 116, 104, 32, 80, 108, 97, 116, 101, 124,
+83, 109, 111, 111, 116, 104, 32, 82, 111, 111, 109, 124, 83, 109, 111, 111, 116, 104, 32, 83, 112, 97, 99, 101,
+124, 71, 97, 116, 101, 100, 124, 68, 114, 105, 102, 116, 32, 67, 104, 97, 109, 98, 101, 114, 124, 68, 114, 105,
+102, 116, 32, 72, 97, 108, 108, 124, 68, 114, 105, 102, 116, 32, 83, 112, 97, 99, 101, 124, 67, 97, 116, 104,
+101, 100, 114, 97, 108, 124, 71, 114, 97, 110, 100, 32, 72, 97, 108, 108, 124, 86, 105, 110, 116, 97, 103, 101,
+32, 67, 104, 97, 109, 98, 101, 114, 124, 86, 105, 110, 116, 97, 103, 101, 32, 72, 97, 108, 108, 34, 32, 61,
+32, 34, 83, 97, 108, 97, 32, 100, 101, 32, 99, 111, 110, 99, 101, 114, 116, 111, 124, 80, 108, 97, 99, 97,
+124, 83, 97, 108, 97, 124, 67, 195, 162, 109, 97, 114, 97, 124, 69, 115, 112, 97, 195, 167, 111, 32, 97, 108,
+101, 97, 116, 195, 179, 114, 105, 111, 124, 69, 115, 112, 97, 195, 167, 111, 32, 99, 104, 111, 114, 117, 115, 124,
+65, 109, 98, 105, 195, 170, 110, 99, 105, 97, 124, 83, 97, 108, 195, 163, 111, 32, 98, 114, 105, 108, 104, 97,
+110, 116, 101, 124, 78, 97, 118, 101, 124, 83, 97, 108, 195, 163, 111, 32, 115, 117, 106, 111, 124, 80, 108, 97,
+99, 97, 32, 115, 117, 106, 97, 124, 80, 108, 97, 99, 97, 32, 115, 117, 97, 118, 101, 124, 83, 97, 108, 97,
+32, 115, 117, 97, 118, 101, 124, 69, 115, 112, 97, 195, 167, 111, 32, 115, 117, 97, 118, 101, 124, 71, 97, 116,
+101, 100, 124, 67, 195, 162, 109, 97, 114, 97, 32, 195, 160, 32, 100, 101, 114, 105, 118, 97, 124, 83, 97, 108,
+195, 163, 111, 32, 195, 160, 32, 100, 101, 114, 105, 118, 97, 124, 69, 115, 112, 97, 195, 167, 111, 32, 195, 160,
+32, 100, 101, 114, 105, 118, 97, 124, 67, 97, 116, 101, 100, 114, 97, 108, 124, 71, 114, 97, 110, 100, 101, 32,
+115, 97, 108, 195, 163, 111, 124, 67, 195, 162, 109, 97, 114, 97, 32, 118, 105, 110, 116, 97, 103, 101, 124, 83,
+97, 108, 195, 163, 111, 32, 118, 105, 110, 116, 97, 103, 101, 34, 10, 34, 49, 57, 55, 48, 115, 124, 49, 57,
+56, 48, 115, 124, 78, 111, 119, 34, 32, 61, 32, 34, 65, 110, 111, 115, 32, 55, 48, 124, 65, 110, 111, 115,
+32, 56, 48, 124, 65, 116, 117, 97, 108, 34, 10, 34, 66, 97, 115, 115, 32, 109, 117, 108, 116, 34, 32, 61,
+32, 34, 77, 117, 108, 116, 46, 32, 103, 114, 97, 118, 101, 115, 34, 10, 34, 66, 97, 115, 115, 32, 120, 111,
+118, 101, 114, 34, 32, 61, 32, 34, 67, 111, 114, 116, 101, 32, 103, 114, 97, 118, 101, 115, 34, 10, 34, 72,
+105, 103, 104, 32, 102, 114, 101, 113, 34, 32, 61, 32, 34, 70, 114, 101, 113, 46, 32, 97, 103, 117, 100, 111,
+115, 34, 10, 34, 77, 111, 100, 32, 100, 101, 112, 116, 104, 34, 32, 61, 32, 34, 80, 114, 111, 102, 46, 32,
+109, 111, 100, 46, 34, 10, 34, 82, 111, 111, 109, 34, 32, 61, 32, 34, 83, 97, 108, 97, 34, 10, 34, 76,
+97, 114, 103, 101, 32, 82, 111, 111, 109, 124, 77, 101, 100, 105, 117, 109, 32, 82, 111, 111, 109, 124, 66, 114,
+105, 103, 104, 116, 32, 82, 111, 111, 109, 124, 76, 97, 114, 103, 101, 32, 67, 104, 97, 109, 98, 101, 114, 124,
+68, 97, 114, 107, 32, 82, 111, 111, 109, 124, 68, 97, 114, 107, 32, 67, 104, 97, 109, 98, 101, 114, 124, 68,
+97, 114, 107, 32, 83, 112, 97, 99, 101, 124, 68, 101, 101, 112, 32, 83, 112, 97, 99, 101, 124, 77, 105, 114,
+114, 111, 114, 32, 83, 112, 97, 99, 101, 124, 86, 97, 115, 116, 32, 83, 112, 97, 99, 101, 124, 68, 105, 115,
+116, 97, 110, 116, 32, 83, 112, 97, 99, 101, 124, 68, 101, 110, 115, 101, 32, 82, 111, 111, 109, 34, 32, 61,
+32, 34, 83, 97, 108, 97, 32, 103, 114, 97, 110, 100, 101, 124, 83, 97, 108, 97, 32, 109, 195, 169, 100, 105,
+97, 124, 83, 97, 108, 97, 32, 98, 114, 105, 108, 104, 97, 110, 116, 101, 124, 67, 195, 162, 109, 97, 114, 97,
+32, 103, 114, 97, 110, 100, 101, 124, 83, 97, 108, 97, 32, 101, 115, 99, 117, 114, 97, 124, 67, 195, 162, 109,
+97, 114, 97, 32, 101, 115, 99, 117, 114, 97, 124, 69, 115, 112, 97, 195, 167, 111, 32, 101, 115, 99, 117, 114,
+111, 124, 69, 115, 112, 97, 195, 167, 111, 32, 112, 114, 111, 102, 117, 110, 100, 111, 124, 69, 115, 112, 97, 195,
+167, 111, 32, 101, 115, 112, 101, 108, 104, 97, 100, 111, 124, 69, 115, 112, 97, 195, 167, 111, 32, 118, 97, 115,
+116, 111, 124, 69, 115, 112, 97, 195, 167, 111, 32, 100, 105, 115, 116, 97, 110, 116, 101, 124, 83, 97, 108, 97,
+32, 100, 101, 110, 115, 97, 34, 10, 34, 69, 97, 114, 108, 121, 32, 47, 32, 108, 97, 116, 101, 34, 32, 61,
+32, 34, 73, 110, 105, 99, 105, 97, 108, 32, 47, 32, 102, 105, 110, 97, 108, 34, 10, 34, 69, 97, 114, 108,
+121, 34, 32, 61, 32, 34, 82, 101, 102, 108, 101, 120, 195, 181, 101, 115, 32, 105, 110, 105, 99, 105, 97, 105,
+115, 34, 10, 34, 76, 97, 116, 101, 34, 32, 61, 32, 34, 67, 97, 117, 100, 97, 34, 10, 34, 72, 105, 103,
+104, 32, 109, 117, 108, 116, 34, 32, 61, 32, 34, 77, 117, 108, 116, 46, 32, 97, 103, 117, 100, 111, 115, 34,
+10, 34, 72, 105, 103, 104, 32, 120, 111, 118, 101, 114, 34, 32, 61, 32, 34, 67, 111, 114, 116, 101, 32, 97,
+103, 117, 100, 111, 115, 34, 10, 34, 80, 108, 97, 116, 101, 34, 32, 61, 32, 34, 80, 108, 97, 99, 97, 34,
+10, 34, 83, 105, 108, 118, 101, 114, 124, 80, 101, 119, 116, 101, 114, 124, 78, 105, 99, 107, 101, 108, 124, 66,
+114, 111, 110, 122, 101, 124, 66, 105, 115, 109, 117, 116, 104, 124, 84, 105, 110, 124, 90, 105, 110, 99, 124, 80,
+108, 97, 116, 105, 110, 117, 109, 124, 84, 117, 110, 103, 115, 116, 101, 110, 124, 73, 114, 111, 110, 124, 71, 111,
+108, 100, 124, 76, 101, 97, 100, 34, 32, 61, 32, 34, 80, 114, 97, 116, 97, 124, 80, 101, 108, 116, 114, 101,
+124, 78, 195, 173, 113, 117, 101, 108, 124, 66, 114, 111, 110, 122, 101, 124, 66, 105, 115, 109, 117, 116, 111, 124,
+69, 115, 116, 97, 110, 104, 111, 124, 90, 105, 110, 99, 111, 124, 80, 108, 97, 116, 105, 110, 97, 124, 84, 117,
+110, 103, 115, 116, 195, 170, 110, 105, 111, 124, 70, 101, 114, 114, 111, 124, 79, 117, 114, 111, 124, 67, 104, 117,
+109, 98, 111, 34, 10, 34, 76, 111, 119, 32, 102, 114, 101, 113, 34, 32, 61, 32, 34, 70, 114, 101, 113, 46,
+32, 103, 114, 97, 118, 101, 115, 34, 10, 34, 76, 111, 119, 32, 103, 97, 105, 110, 34, 32, 61, 32, 34, 71,
+97, 110, 104, 111, 32, 103, 114, 97, 118, 101, 115, 34, 10, 34, 72, 105, 103, 104, 32, 103, 97, 105, 110, 34,
+32, 61, 32, 34, 71, 97, 110, 104, 111, 32, 97, 103, 117, 100, 111, 115, 34, 10, 34, 82, 105, 112, 112, 108,
+101, 124, 83, 119, 101, 108, 108, 124, 70, 111, 108, 100, 124, 68, 114, 105, 102, 116, 124, 65, 98, 121, 115, 115,
+124, 86, 111, 114, 116, 101, 120, 124, 71, 108, 105, 110, 116, 124, 80, 117, 108, 115, 101, 124, 69, 120, 112, 97,
+110, 115, 101, 124, 72, 97, 122, 101, 124, 86, 101, 105, 108, 124, 77, 105, 115, 116, 124, 77, 111, 110, 111, 108,
+105, 116, 104, 124, 69, 116, 101, 114, 110, 105, 116, 121, 124, 84, 105, 100, 101, 124, 83, 104, 111, 97, 108, 124,
+83, 112, 97, 114, 107, 124, 80, 108, 97, 116, 101, 97, 117, 124, 68, 117, 115, 107, 124, 77, 105, 114, 97, 103,
+101, 124, 67, 108, 117, 115, 116, 101, 114, 124, 66, 101, 97, 99, 111, 110, 34, 32, 61, 32, 34, 79, 110, 100,
+117, 108, 97, 195, 167, 195, 163, 111, 124, 73, 110, 99, 104, 97, 195, 167, 111, 124, 68, 111, 98, 114, 97, 124,
+68, 101, 114, 105, 118, 97, 124, 65, 98, 105, 115, 109, 111, 124, 86, 195, 179, 114, 116, 105, 99, 101, 124, 76,
+97, 109, 112, 101, 106, 111, 124, 80, 117, 108, 115, 111, 124, 86, 97, 115, 116, 105, 100, 195, 163, 111, 124, 78,
+195, 169, 118, 111, 97, 32, 115, 101, 99, 97, 124, 86, 195, 169, 117, 124, 78, 195, 169, 118, 111, 97, 124, 77,
+111, 110, 195, 179, 108, 105, 116, 111, 124, 69, 116, 101, 114, 110, 105, 100, 97, 100, 101, 124, 77, 97, 114, 195,
+169, 124, 67, 97, 114, 100, 117, 109, 101, 124, 70, 97, 195, 173, 115, 99, 97, 124, 80, 108, 97, 110, 97, 108,
+116, 111, 124, 67, 114, 101, 112, 195, 186, 115, 99, 117, 108, 111, 124, 77, 105, 114, 97, 103, 101, 109, 124, 65,
+103, 108, 111, 109, 101, 114, 97, 100, 111, 124, 70, 97, 114, 111, 108, 34, 10, 34, 109, 115, 124, 78, 111, 116,
+101, 124, 68, 111, 116, 116, 101, 100, 124, 84, 114, 105, 112, 108, 101, 116, 34, 32, 61, 32, 34, 109, 115, 124,
+78, 111, 116, 97, 124, 80, 111, 110, 116, 117, 97, 100, 97, 124, 84, 101, 114, 99, 105, 110, 97, 34, 10, 34,
+87, 97, 114, 112, 34, 32, 61, 32, 34, 68, 105, 115, 116, 111, 114, 195, 167, 195, 163, 111, 34, 10, 34, 83,
+104, 105, 102, 116, 32, 109, 111, 100, 101, 34, 32, 61, 32, 34, 77, 111, 100, 111, 32, 100, 101, 32, 116, 114,
+97, 110, 115, 112, 111, 115, 105, 195, 167, 195, 163, 111, 34, 10, 34, 85, 112, 124, 85, 112, 32, 43, 32, 100,
+111, 119, 110, 124, 85, 112, 44, 32, 98, 114, 105, 103, 104, 116, 124, 85, 112, 32, 43, 32, 100, 111, 119, 110,
+44, 32, 98, 114, 105, 103, 104, 116, 124, 78, 111, 32, 115, 104, 105, 102, 116, 34, 32, 61, 32, 34, 65, 99,
+105, 109, 97, 124, 65, 99, 105, 109, 97, 32, 43, 32, 97, 98, 97, 105, 120, 111, 124, 65, 99, 105, 109, 97,
+44, 32, 98, 114, 105, 108, 104, 97, 110, 116, 101, 124, 65, 99, 105, 109, 97, 32, 43, 32, 97, 98, 97, 105,
+120, 111, 44, 32, 98, 114, 105, 108, 104, 97, 110, 116, 101, 124, 83, 101, 109, 32, 116, 114, 97, 110, 115, 112,
+111, 115, 105, 195, 167, 195, 163, 111, 34, 10, 34, 87, 105, 100, 101, 124, 68, 101, 110, 115, 101, 124, 66, 114,
+105, 103, 104, 116, 34, 32, 61, 32, 34, 65, 109, 112, 108, 111, 124, 68, 101, 110, 115, 111, 124, 66, 114, 105,
+108, 104, 97, 110, 116, 101, 34, 10, 34, 66, 114, 105, 103, 104, 116, 124, 68, 97, 114, 107, 34, 32, 61, 32,
+34, 66, 114, 105, 108, 104, 97, 110, 116, 101, 124, 69, 115, 99, 117, 114, 111, 34, 10, 34, 69, 99, 104, 111,
+34, 32, 61, 32, 34, 69, 99, 111, 34, 10, 34, 69, 99, 104, 111, 32, 109, 111, 100, 101, 34, 32, 61, 32,
+34, 77, 111, 100, 111, 32, 100, 111, 32, 101, 99, 111, 34, 10, 34, 67, 108, 101, 97, 110, 124, 84, 97, 112,
+101, 124, 68, 105, 103, 105, 116, 97, 108, 124, 65, 110, 97, 108, 111, 103, 124, 68, 101, 116, 117, 110, 101, 124,
+82, 101, 118, 101, 114, 115, 101, 124, 82, 101, 118, 101, 114, 115, 101, 32, 85, 112, 124, 82, 101, 118, 101, 114,
+115, 101, 32, 68, 111, 119, 110, 124, 82, 101, 118, 101, 114, 115, 101, 32, 85, 112, 47, 68, 111, 119, 110, 124,
+83, 112, 97, 114, 107, 108, 101, 124, 83, 119, 97, 114, 109, 124, 76, 111, 45, 102, 105, 34, 32, 61, 32, 34,
+76, 105, 109, 112, 111, 124, 70, 105, 116, 97, 124, 68, 105, 103, 105, 116, 97, 108, 124, 65, 110, 97, 108, 195,
+179, 103, 105, 99, 111, 124, 68, 101, 115, 97, 102, 105, 110, 97, 100, 111, 124, 82, 101, 118, 101, 114, 115, 111,
+124, 82, 101, 118, 101, 114, 115, 111, 32, 97, 99, 105, 109, 97, 124, 82, 101, 118, 101, 114, 115, 111, 32, 97,
+98, 97, 105, 120, 111, 124, 82, 101, 118, 101, 114, 115, 111, 32, 97, 99, 105, 109, 97, 47, 97, 98, 97, 105,
+120, 111, 124, 66, 114, 105, 108, 104, 111, 124, 69, 110, 120, 97, 109, 101, 124, 76, 111, 45, 102, 105, 34, 10,
+34, 69, 99, 104, 111, 32, 62, 32, 82, 101, 118, 124, 82, 101, 118, 32, 62, 32, 69, 99, 104, 111, 34, 32,
+61, 32, 34, 69, 99, 111, 32, 62, 32, 82, 101, 118, 124, 82, 101, 118, 32, 62, 32, 69, 99, 111, 34, 10,
+34, 82, 101, 118, 101, 114, 98, 32, 109, 111, 100, 101, 34, 32, 61, 32, 34, 77, 111, 100, 111, 32, 100, 111,
+32, 114, 101, 118, 101, 114, 98, 34, 10, 34, 82, 111, 111, 109, 124, 67, 104, 97, 109, 98, 101, 114, 124, 80,
+108, 97, 116, 101, 124, 72, 97, 108, 108, 124, 67, 97, 116, 104, 101, 100, 114, 97, 108, 124, 83, 112, 97, 99,
+101, 124, 70, 114, 101, 101, 122, 101, 124, 71, 97, 116, 101, 100, 34, 32, 61, 32, 34, 83, 97, 108, 97, 124,
+67, 195, 162, 109, 97, 114, 97, 124, 80, 108, 97, 99, 97, 124, 83, 97, 108, 195, 163, 111, 124, 67, 97, 116,
+101, 100, 114, 97, 108, 124, 69, 115, 112, 97, 195, 167, 111, 124, 67, 111, 110, 103, 101, 108, 97, 114, 124, 71,
+97, 116, 101, 100, 34, 10, 34, 66, 114, 105, 103, 104, 116, 124, 78, 101, 117, 116, 114, 97, 108, 124, 68, 97,
+114, 107, 124, 86, 105, 110, 116, 97, 103, 101, 34, 32, 61, 32, 34, 66, 114, 105, 108, 104, 97, 110, 116, 101,
+124, 78, 101, 117, 116, 114, 111, 124, 69, 115, 99, 117, 114, 111, 124, 86, 105, 110, 116, 97, 103, 101, 34, 10,
+34, 68, 97, 109, 112, 105, 110, 103, 34, 32, 61, 32, 34, 65, 109, 111, 114, 116, 101, 99, 105, 109, 101, 110,
+116, 111, 34, 10, 34, 66, 97, 115, 115, 32, 102, 114, 101, 113, 34, 32, 61, 32, 34, 70, 114, 101, 113, 46,
+32, 103, 114, 97, 118, 101, 115, 34, 10, 34, 76, 97, 116, 101, 32, 109, 105, 120, 34, 32, 61, 32, 34, 77,
+105, 120, 32, 100, 97, 32, 99, 97, 117, 100, 97, 34, 10, 10, 35, 32, 45, 45, 45, 32, 68, 121, 110, 97,
+109, 105, 99, 115, 32, 115, 117, 105, 116, 101, 32, 40, 114, 111, 117, 110, 100, 32, 49, 48, 56, 41, 58, 32,
+67, 114, 101, 115, 116, 32, 67, 111, 109, 112, 114, 101, 115, 115, 111, 114, 44, 32, 80, 114, 105, 115, 109, 32,
+77, 117, 108, 116, 105, 98, 97, 110, 100, 44, 32, 83, 101, 110, 116, 114, 121, 32, 71, 97, 116, 101, 44, 32,
+69, 109, 98, 101, 114, 39, 115, 32, 98, 97, 110, 100, 115, 10, 34, 49, 32, 98, 97, 110, 100, 124, 50, 124,
 51, 124, 52, 34, 32, 61, 32, 34, 49, 32, 98, 97, 110, 100, 97, 124, 50, 124, 51, 124, 52, 34, 10, 34,
 49, 50, 32, 100, 66, 47, 111, 99, 116, 124, 50, 52, 32, 100, 66, 47, 111, 99, 116, 124, 52, 56, 32, 100,
 66, 47, 111, 99, 116, 34, 32, 61, 32, 34, 49, 50, 32, 100, 66, 47, 111, 105, 116, 124, 50, 52, 32, 100,

+ 7 - 0
src/ui/Icons.cpp

@@ -522,6 +522,13 @@ Shape make (Icon icon)
             fi.addRoundedRectangle (15.0f, 17.0f, 4.0f, 3.5f, 1.0f);
             break;
         }
+        case Icon::graph: // bars of different heights standing on a base line (a step graph)
+            line (st, 3.5f, 20.5f, 20.5f, 20.5f);
+            fi.addRoundedRectangle (4.0f, 11.0f, 3.0f, 8.0f, 1.0f);
+            fi.addRoundedRectangle (8.5f, 6.0f, 3.0f, 13.0f, 1.0f);
+            fi.addRoundedRectangle (13.0f, 13.5f, 3.0f, 5.5f, 1.0f);
+            fi.addRoundedRectangle (17.5f, 9.0f, 3.0f, 10.0f, 1.0f);
+            break;
         case Icon::tuningFork: // two prongs on a stem, with a weighted foot
         {
             juce::Path f;

+ 3 - 2
src/ui/Icons.h

@@ -24,10 +24,11 @@ enum class Icon
     countIn, waitInput, // recording: count-in and wait for input
     mouseLeft, mouseMiddle, mouseWheel, // hint bar gestures (with rightClick)
     tuningFork, // master pitch
-    drumBrush   // Piano Roll: the drum paint tool
+    drumBrush,  // Piano Roll: the drum paint tool
+    graph       // Channel Rack: the step graph editor (velocity, pan... bars)
 };
 
-constexpr int iconCount = (int) Icon::drumBrush + 1;
+constexpr int iconCount = (int) Icon::graph + 1;
 
 namespace icons
 {

+ 52 - 1
src/ui/MainComponent.cpp

@@ -240,7 +240,28 @@ MainComponent::MainComponent (AudioEngine& e, bool restoreUserSettings)
     workspace.setContent (Panel::mixer, mixer, "Mixer", Icon::mixer);
     workspace.setContent (Panel::browser, browser, "Browser", Icon::browser);
     workspace.setTitleTooltip (Panel::channelRack, tr ("Shift+wheel here changes the pattern"));
-    workspace.setTitleAccessory (Panel::channelRack, &swingSlider, 26); // FL keeps the global swing in the rack's title bar
+    // FL keeps the channel filter, the global swing and the graph editor switch in the rack's title bar
+    rackFilterBox.text = rack.filterName();
+    rackFilterBox.onClick = [this] { rack.showFilterMenu (&rackFilterBox); };
+    rack.onFilterChanged = [this] {
+        rackFilterBox.text = rack.filterName();
+        rackFilterBox.repaint();
+        rackGraphButton.setToggleState (rack.areGraphLanesShown(), juce::dontSendNotification);
+    };
+    rackGraphButton.setClickingTogglesState (false);
+    rackGraphButton.onClick = [this] { rack.toggleGraphLanes(); };
+    rackTitleTools.addAndMakeVisible (rackFilterBox);
+    rackTitleTools.addAndMakeVisible (swingSlider);
+    rackTitleTools.addAndMakeVisible (rackGraphButton);
+    rackTitleTools.layout = [this] {
+        auto r = rackTitleTools.getLocalBounds();
+        rackFilterBox.setBounds (r.removeFromLeft (96).reduced (0, 3));
+        r.removeFromLeft (4);
+        swingSlider.setBounds (r.removeFromLeft (26));
+        r.removeFromLeft (4);
+        rackGraphButton.setBounds (r.removeFromLeft (24).reduced (0, 1));
+    };
+    workspace.setTitleAccessory (Panel::channelRack, &rackTitleTools, rackTitleToolsWidth);
     workspace.onPanelMenu = [this] (Panel panel, juce::PopupMenu& menu) { addPanelMenuItems (panel, menu); };
     workspace.onFocusChanged = [this] (Panel) { refreshPanelButtons(); };
     workspace.onKeyInDetachedWindow = [this] (const juce::KeyPress& key) { return keyPressed (key); };
@@ -265,6 +286,8 @@ MainComponent::MainComponent (AudioEngine& e, bool restoreUserSettings)
         openPianoRoll();
     };
     picker.onOpenPattern = [this] { showPanel (Panel::channelRack); };
+    picker.onPatternMenu = [this] { makePatternMenu().showMenuAsync (juce::PopupMenu::Options().withMousePosition()); };
+    picker.onNewPattern = [this] { newPatternButton.onClick(); };
     playlist.onRenamePattern = [this] (int p) { showRenamePattern (p); };
     playlist.onOpenInSampler = [this] (int channel) {
         // the audio clip's file in a new Sampler channel (to play it from notes), its settings open
@@ -832,6 +855,7 @@ bool MainComponent::runAction (const std::string& id)
         refreshRecordOptionButtons();
     }
     else if (is ("rack.graphEditor")) rack.toggleGraphLanes();
+    else if (is ("rack.groupSelected")) rack.groupSelected();
     else if (is ("rack.rotateLeft")) rack.rotateSelected (-1);
     else if (is ("rack.rotateRight")) rack.rotateSelected (1);
     else if (is ("browser.previous")) browser.step (-1, false);
@@ -1252,6 +1276,7 @@ void MainComponent::addPanelMenuItems (Panel panel, juce::PopupMenu& menu)
             sort.addItem (tr ("By type"), [this] { rack.sortChannels (ChannelSort::type); });
             menu.addSubMenu (tr ("Sort channels"), sort);
             menu.addItem (tr ("Select unused channels"), [this] { rack.selectUnused(); });
+            action (menu, "rack.groupSelected", tr ("Group selected..."));
             break;
         }
         case Panel::playlist:
@@ -1647,6 +1672,15 @@ void MainComponent::changeListenerCallback (juce::ChangeBroadcaster*)
     refreshModeButton();
     tempoDisplay.repaint();
 
+    // a project with other filter groups (or none): the rack's filter falls back to "All"
+    if (rack.getFilterGroup() >= (int) song.channelGroups.size())
+        rack.setFilterGroup (-1);
+    if (rackFilterBox.text != rack.filterName())
+    {
+        rackFilterBox.text = rack.filterName();
+        rackFilterBox.repaint();
+    }
+
     if ((int) song.channels.size() != fittedChannelCount && fittedChannelCount >= 0) // a row was added or removed
         fitChannelRack (false);
 
@@ -2004,6 +2038,8 @@ void MainComponent::setQuickTips()
     tip (perfMeter, tr ("CPU, memory and polyphony"));
     tip (output, tr ("Output monitor"));
     tip (swingSlider, tr ("Swing"));
+    tip (rackFilterBox, tr ("Channel filter group"));
+    tip (rackGraphButton, tr ("Graph editor"));
 
     for (int i = 0; i < workspace::panelCount; ++i)
         tip (panelButtons[(std::size_t) i], tr (panelName ((Panel) i)), panelAction ((Panel) i));
@@ -3006,4 +3042,19 @@ void MainComponent::showAudioSettings()
 {
     openSettings ((int) SettingsPage::audio);
 }
+// --- the Channel Rack's filter box ---------------------------------------------------------------
+
+void MainComponent::FilterBox::paint (juce::Graphics& g)
+{
+    using namespace theme;
+    auto area = getLocalBounds().toFloat();
+    g.setColour (hovered ? colour::bg3 : colour::bg1);
+    g.fillRoundedRectangle (area, radius::sm);
+    g.setColour (hovered ? colour::borderStrong : colour::border);
+    g.drawRoundedRectangle (area.reduced (0.5f), radius::sm, 1.0f);
+    g.setColour (colour::textPrimary);
+    g.setFont (font (type::small));
+    g.drawText (text, getLocalBounds().withTrimmedLeft (7).withTrimmedRight (16), juce::Justification::centredLeft, true);
+    icons::draw (g, Icon::chevronDown, area.removeFromRight (16.0f).reduced (3.0f).translated (-2.0f, 0.0f), colour::textSecondary);
+}
 } // namespace lynx

+ 22 - 0
src/ui/MainComponent.h

@@ -90,6 +90,7 @@ public:
     MixerComponent& getMixerForSnapshot() { return mixer; }
     std::unique_ptr<juce::Component> makeQuickAddForSnapshot();
     PlaylistComponent& getPlaylistForSnapshot() { return playlist; }
+    PatternPicker& getPickerForSnapshot() { return picker; }
     void selectMixerTrackForSnapshot (int track, int slot = -1)
     {
         mixer.selectTrack (track);
@@ -255,6 +256,27 @@ private:
     IconButton newPatternButton { "newPattern", Icon::plus };
     IconButton patternMenuButton { "patternMenu", Icon::more };
     juce::Slider swingSlider { juce::Slider::RotaryHorizontalVerticalDrag, juce::Slider::NoTextBox }; // in the Channel Rack's title bar
+    // The Channel Rack's title tools (FL keeps them in the rack's title bar, REA round 104): the channel filter
+    // group box ("All"), the global swing knob and the graph editor switch.
+    struct FilterBox final : public juce::Component
+    {
+        juce::String text;
+        bool hovered = false;
+        std::function<void()> onClick;
+        void paint (juce::Graphics& g) override;
+        void mouseEnter (const juce::MouseEvent&) override { hovered = true; repaint(); }
+        void mouseExit (const juce::MouseEvent&) override { hovered = false; repaint(); }
+        void mouseDown (const juce::MouseEvent&) override { if (onClick) onClick(); }
+    };
+    struct RackTitleTools final : public juce::Component
+    {
+        std::function<void()> layout;
+        void resized() override { if (layout) layout(); }
+    };
+    RackTitleTools rackTitleTools;
+    FilterBox rackFilterBox;
+    IconButton rackGraphButton { "rackGraph", Icon::graph };
+    static constexpr int rackTitleToolsWidth = 96 + 4 + 26 + 4 + 24;
     // one icon per workspace panel (F5..F9): click toggles, right-click shows it maximized
     std::array<IconButton, workspace::panelCount> panelButtons { IconButton { "playlistPanel", Icon::playlist },
                                                                  IconButton { "rackPanel", Icon::channelRack },

+ 486 - 27
src/ui/MixerComponent.cpp

@@ -8,6 +8,9 @@
 #include "ui/BrowserComponent.h"
 #include "ui/ExportDialog.h"
 
+#include <complex>
+
+#include "core/Biquad.h"
 #include "core/Effects.h"
 #include "engine/Text.h"
 #include "ui/FacetEqEditor.h"
@@ -91,7 +94,8 @@ ui::ValueSpec stereoSpec (const juce::String& name)
 
 ui::ValueSpec sendSpec (const juce::String& name)
 {
-    auto spec = ui::percentSpec (name, 1.0);
+    // FL's send knob: the fader curve (0 dB at 80 %, +5.6 dB at the top); the value is the knob position
+    auto spec = ui::faderSpec (name, unityFader);
     spec.pixelsForRange = 120.0;
     return spec;
 }
@@ -548,7 +552,7 @@ void MixerStrips::paint (juce::Graphics& g)
                 if (on && t > 0)
                     for (const auto& send : song.mixer[(std::size_t) selected].sends)
                         if (send.target == t)
-                            drawKnob (g, sendArea (t).toFloat().withSizeKeepingCentre (22.0f, 22.0f), send.level, false,
+                            drawKnob (g, sendArea (t).toFloat().withSizeKeepingCentre (22.0f, 22.0f), faderPosition (send.level), false,
                                       dragging (Part::send) ? colour::accent : colour::accentHover, hovered (Part::send) || dragging (Part::send));
             }
             else if (feedsSelected) // this insert sends into the selected one
@@ -690,7 +694,7 @@ void MixerStrips::mouseDown (const juce::MouseEvent& e)
 
         if (ui::isResetClick (e))
         {
-            setValue (Part::send, t, 1.0);
+            setValue (Part::send, t, unityFader); // 0 dB
             showTip (Part::send, t, true);
             return;
         }
@@ -914,7 +918,7 @@ double MixerStrips::valueOf (Part part, int t) const
         if (selected > 0 && selected < (int) song.mixer.size())
             for (const auto& send : song.mixer[(std::size_t) selected].sends)
                 if (send.target == t)
-                    return send.level;
+                    return faderPosition (send.level);
         return 0.0;
     }
 
@@ -929,7 +933,7 @@ void MixerStrips::setValue (Part part, int t, double value)
     if (part == Part::send)
     {
         const auto from = selected;
-        engine.editSong ([from, t, v = (float) value] (Song& s) { s.setRoute (from, t, true, v); });
+        engine.editSong ([from, t, v = faderGain ((float) value)] (Song& s) { s.setRoute (from, t, true, v); });
         return;
     }
 
@@ -1535,7 +1539,288 @@ const std::vector<EffectSlot>* EffectsPanel::slots() const
 
 juce::Rectangle<int> EffectsPanel::mixBounds (int slot) const
 {
-    return slotBounds (slot).removeFromRight (26);
+    return slotBounds (slot).withTrimmedRight (20).removeFromRight (24);
+}
+
+juce::Rectangle<int> EffectsPanel::ledBounds (int slot) const
+{
+    return slotBounds (slot).removeFromRight (20);
+}
+
+juce::Rectangle<int> EffectsPanel::arrowBounds (int slot) const
+{
+    return slotBounds (slot).removeFromLeft (18);
+}
+
+// --- the insert's built-in EQ and its output (FL's layout under the slots, REA round 104) ---------
+
+namespace
+{
+constexpr int eqGraphHeight = 84, eqKnobsHeight = 46, outputRowHeight = 30;
+constexpr float eqMinHz = 20.0f, eqMaxHz = 20000.0f, eqRangeDb = 18.0f;
+const char* const eqBandNames[] = { TR_NOOP ("Low shelf"), TR_NOOP ("Peak"), TR_NOOP ("High shelf") };
+
+juce::Colour eqBandColour (int band)
+{
+    return band == 0 ? juce::Colour (0xFFE0A33Au) : band == 1 ? juce::Colour (0xFF5FC27Eu) : juce::Colour (0xFF5B9BE6u);
+}
+
+// stored 0..1 <-> the band's value
+float eqToValue (const TrackEq& eq, int band, int what)
+{
+    const auto b = (std::size_t) band;
+    if (what == 0)
+        return (eq.gainDb[b] + eqRangeDb) / (2.0f * eqRangeDb);
+    if (what == 1)
+        return std::log (eq.hz[b] / 10.0f) / std::log (1600.0f);
+    return eq.width[b];
+}
+
+void eqFromValue (TrackEq& eq, int band, int what, float v)
+{
+    const auto b = (std::size_t) band;
+    v = juce::jlimit (0.0f, 1.0f, v);
+    if (what == 0)
+        eq.gainDb[b] = std::round ((v * 2.0f * eqRangeDb - eqRangeDb) * 10.0f) / 10.0f;
+    else if (what == 1)
+        eq.hz[b] = std::round (10.0f * std::pow (1600.0f, v));
+    else
+        eq.width[b] = v;
+}
+
+// the EQ's response at `hz` (dB), with the filters the mixer runs (RackRenderer::applyTrackEq)
+float eqResponseDb (const TrackEq& eq, double hz, double sampleRate)
+{
+    Biquad bands[3];
+    bands[0].shelf (sampleRate, std::min ((double) eq.hz[0], sampleRate * 0.45), eq.gainDb[0], false, TrackEq::shelfSlope (eq.width[0]));
+    bands[1].peaking (sampleRate, std::min ((double) eq.hz[1], sampleRate * 0.45), TrackEq::peakQ (eq.width[1]), eq.gainDb[1]);
+    bands[2].shelf (sampleRate, std::min ((double) eq.hz[2], sampleRate * 0.45), eq.gainDb[2], true, TrackEq::shelfSlope (eq.width[2]));
+    const auto w = juce::MathConstants<double>::twoPi * hz / sampleRate;
+    const std::complex<double> z1 = std::polar (1.0, -w), z2 = std::polar (1.0, -2.0 * w);
+    double db = 0.0;
+    for (int b = 0; b < 3; ++b)
+    {
+        if (eq.gainDb[(std::size_t) b] == 0.0f)
+            continue; // a band at 0 dB is not processed (like FL)
+        const auto& f = bands[b];
+        const auto h = (f.b0 + f.b1 * z1 + f.b2 * z2) / (1.0 + f.a1 * z1 + f.a2 * z2);
+        db += 20.0 * std::log10 (std::max (1e-9, std::abs (h)));
+    }
+    return (float) db;
+}
+} // namespace
+
+int EffectsPanel::bottomTop() const
+{
+    return getHeight() - (eqGraphHeight + eqKnobsHeight + outputRowHeight + 22);
+}
+
+juce::Rectangle<int> EffectsPanel::eqGraphBounds() const
+{
+    return { 8, bottomTop() + 8, getWidth() - 16 - 3 * 18 - 6, eqGraphHeight };
+}
+
+juce::Rectangle<int> EffectsPanel::eqFaderBounds (int band) const
+{
+    const auto graph = eqGraphBounds();
+    return { graph.getRight() + 6 + band * 18, graph.getY(), 16, graph.getHeight() };
+}
+
+juce::Rectangle<int> EffectsPanel::eqKnobBounds (int band, int what) const
+{
+    const auto fader = eqFaderBounds (band);
+    return { fader.getCentreX() - 11, eqGraphBounds().getBottom() + 2 + (what - 1) * 22, 22, 22 };
+}
+
+juce::Rectangle<int> EffectsPanel::outputBounds() const
+{
+    return { 34, getHeight() - outputRowHeight - 2, getWidth() - 42, outputRowHeight - 8 };
+}
+
+juce::Point<float> EffectsPanel::eqHandle (int band) const
+{
+    const auto graph = eqGraphBounds().toFloat().reduced (4.0f);
+    const auto& eq = engine.getSong().mixer[(std::size_t) track].eq;
+    const auto hz = juce::jlimit (eqMinHz, eqMaxHz, eq.hz[(std::size_t) band]);
+    const auto x = graph.getX() + graph.getWidth() * std::log (hz / eqMinHz) / std::log (eqMaxHz / eqMinHz);
+    const auto y = graph.getCentreY() - graph.getHeight() * 0.5f * eq.gainDb[(std::size_t) band] / eqRangeDb;
+    return { x, y };
+}
+
+int EffectsPanel::eqControlAt (juce::Point<int> p) const
+{
+    if (slots() == nullptr)
+        return 0;
+    for (int b = 0; b < 3; ++b)
+    {
+        if (eqFaderBounds (b).contains (p))
+            return eqParamBase - b * 3;
+        for (int what = 1; what <= 2; ++what)
+            if (eqKnobBounds (b, what).contains (p))
+                return eqParamBase - b * 3 - what;
+    }
+    if (eqGraphBounds().contains (p))
+    {
+        // the nearest handle (by distance in the graph): FL's "Tweak band N"
+        int best = 0;
+        float bestDistance = 1e9f;
+        for (int b = 0; b < 3; ++b)
+            if (const auto d = eqHandle (b).getDistanceFrom (p.toFloat()); d < bestDistance)
+            {
+                bestDistance = d;
+                best = b;
+            }
+        return eqPointBase - best;
+    }
+    return 0;
+}
+
+void EffectsPanel::setEqFromGraph (int band, juce::Point<int> p)
+{
+    const auto graph = eqGraphBounds().toFloat().reduced (4.0f);
+    const auto fx = juce::jlimit (0.0f, 1.0f, (p.x - graph.getX()) / graph.getWidth());
+    const auto hz = juce::jlimit (10.0f, 16000.0f, std::round (eqMinHz * std::pow (eqMaxHz / eqMinHz, fx)));
+    const auto db = juce::jlimit (-eqRangeDb, eqRangeDb, std::round ((graph.getCentreY() - p.y) / (graph.getHeight() * 0.5f) * eqRangeDb * 10.0f) / 10.0f);
+    engine.editSong ([t = track, band, hz, db] (Song& s) {
+        if (t < (int) s.mixer.size())
+        {
+            s.mixer[(std::size_t) t].eq.hz[(std::size_t) band] = hz;
+            s.mixer[(std::size_t) t].eq.gainDb[(std::size_t) band] = db;
+        }
+    });
+}
+
+void EffectsPanel::paintEq (juce::Graphics& g)
+{
+    using namespace theme;
+    const auto& song = engine.getSong();
+    if (track < 0 || track >= (int) song.mixer.size())
+        return;
+    const auto& eq = song.mixer[(std::size_t) track].eq;
+    const auto top = bottomTop();
+    g.setColour (colour::border);
+    g.fillRect (8, top, getWidth() - 16, 1);
+
+    // the response graph: frequency (log) across, ±18 dB up and down
+    const auto graph = eqGraphBounds().toFloat();
+    g.setColour (colour::bg1);
+    g.fillRoundedRectangle (graph, radius::sm);
+    g.setColour (colour::border);
+    g.drawRoundedRectangle (graph.reduced (0.5f), radius::sm, 1.0f);
+    const auto inner = graph.reduced (4.0f);
+    g.setColour (colour::gridBeat);
+    for (float hz : { 100.0f, 1000.0f, 10000.0f })
+    {
+        const auto x = inner.getX() + inner.getWidth() * std::log (hz / eqMinHz) / std::log (eqMaxHz / eqMinHz);
+        g.drawVerticalLine ((int) x, inner.getY(), inner.getBottom());
+    }
+    g.drawHorizontalLine ((int) inner.getCentreY(), inner.getX(), inner.getRight());
+
+    juce::Path curve;
+    const auto sampleRate = juce::jmax (8000.0, engine.getTransport().sampleRate.load());
+    for (int i = 0; i <= (int) inner.getWidth(); i += 2)
+    {
+        const auto hz = eqMinHz * std::pow (eqMaxHz / eqMinHz, (float) i / inner.getWidth());
+        const auto db = juce::jlimit (-eqRangeDb, eqRangeDb, eqResponseDb (eq, hz, sampleRate));
+        const auto y = inner.getCentreY() - inner.getHeight() * 0.5f * db / eqRangeDb;
+        if (i == 0)
+            curve.startNewSubPath (inner.getX(), y);
+        else
+            curve.lineTo (inner.getX() + (float) i, y);
+    }
+    g.setColour (eq.active() ? colour::accent : colour::textSecondary.withAlpha (0.6f));
+    g.strokePath (curve, juce::PathStrokeType (1.5f));
+
+    for (int b = 0; b < 3; ++b)
+    {
+        const auto hot = hoverEq == eqPointBase - b || dragParam == eqPointBase - b;
+        const auto handle = eqHandle (b);
+        g.setColour (eqBandColour (b).withAlpha (hot ? 1.0f : 0.8f));
+        g.fillEllipse (juce::Rectangle<float> (hot ? 10.0f : 8.0f, hot ? 10.0f : 8.0f).withCentre (handle));
+    }
+
+    // the gain faders (one per band) and the frequency / width knobs under them
+    for (int b = 0; b < 3; ++b)
+    {
+        const auto fader = eqFaderBounds (b).toFloat();
+        const auto hot = hoverEq == eqParamBase - b * 3 || dragParam == eqParamBase - b * 3;
+        g.setColour (colour::bg0);
+        g.fillRoundedRectangle (fader.withSizeKeepingCentre (3.0f, fader.getHeight() - 6.0f), 1.5f);
+        g.setColour (colour::border);
+        g.drawHorizontalLine ((int) fader.getCentreY(), fader.getX() + 2.0f, fader.getRight() - 2.0f);
+        const auto v = eqToValue (eq, b, 0);
+        const auto y = fader.getBottom() - 6.0f - v * (fader.getHeight() - 12.0f);
+        g.setColour (hot ? colour::textPrimary : colour::textSecondary);
+        g.fillRoundedRectangle (juce::Rectangle<float> (fader.getWidth() - 2.0f, 7.0f).withCentre ({ fader.getCentreX(), y }), 2.0f);
+        g.setColour (eqBandColour (b));
+        g.fillRect (juce::Rectangle<float> (fader.getWidth() - 6.0f, 1.5f).withCentre ({ fader.getCentreX(), y }));
+
+        for (int what = 1; what <= 2; ++what)
+        {
+            const auto code = eqParamBase - b * 3 - what;
+            drawKnob (g, eqKnobBounds (b, what).toFloat().reduced (2.0f), eqToValue (eq, b, what), false, eqBandColour (b),
+                      hoverEq == code || dragParam == code);
+        }
+    }
+
+    g.setColour (colour::textSecondary);
+    g.setFont (font (type::title));
+    g.drawText (tr ("Equalizer"), 10, eqGraphBounds().getBottom() + 4, eqKnobBounds (0, 1).getX() - 40, 20, juce::Justification::centredLeft);
+    g.setFont (font (type::caption));
+    g.setColour (colour::textDisabled);
+    g.drawText (tr ("Freq"), eqKnobBounds (0, 1).getX() - 34, eqKnobBounds (0, 1).getY(), 32, 22, juce::Justification::centredRight);
+    g.drawText (tr ("Width"), eqKnobBounds (0, 2).getX() - 34, eqKnobBounds (0, 2).getY(), 32, 22, juce::Justification::centredRight);
+
+    // the audio output target
+    auto box = outputBounds().toFloat();
+    g.setColour (colour::border);
+    g.fillRect (8, (int) box.getY() - 5, getWidth() - 16, 1);
+    icons::draw (g, Icon::exportAudio, juce::Rectangle<float> (10.0f, box.getY(), 18.0f, box.getHeight()).withSizeKeepingCentre (16.0f, 16.0f),
+                 colour::textSecondary);
+    g.setColour (hoverOutput ? colour::bg4 : colour::bg3);
+    g.fillRoundedRectangle (box, radius::sm);
+    g.setColour (hoverOutput ? colour::borderStrong : colour::border);
+    g.drawRoundedRectangle (box.reduced (0.5f), radius::sm, 1.0f);
+    g.setColour (track == 0 ? colour::textPrimary : colour::textSecondary);
+    g.setFont (font (type::body));
+    g.drawText (outputName(), box.withTrimmedLeft (8.0f).withTrimmedRight (18.0f).toNearestInt(), juce::Justification::centredLeft, true);
+    icons::draw (g, Icon::chevronDown, box.removeFromRight (18.0f).reduced (4.0f).translated (-2.0f, 0.0f), colour::textSecondary);
+}
+
+juce::String EffectsPanel::outputName() const
+{
+    // Master plays into the device's first output pair; inserts reach it through Master (FL's "(none)")
+    if (track != 0)
+        return tr ("(none)");
+    auto* device = const_cast<AudioEngine&> (engine).getDeviceManager().getCurrentAudioDevice();
+    if (device == nullptr)
+        return tr ("(no audio device)");
+    const auto names = device->getOutputChannelNames();
+    const auto active = device->getActiveOutputChannels();
+    juce::StringArray used;
+    for (int i = 0; i < names.size() && used.size() < 2; ++i)
+        if (active[i])
+            used.add (names[i]);
+    return used.isEmpty() ? tr ("(none)") : used.joinIntoString (" - ");
+}
+
+void EffectsPanel::showOutputMenu()
+{
+    juce::PopupMenu menu;
+    menu.addSectionHeader (tr ("Audio output target"));
+    if (track != 0)
+    {
+        menu.addItem (tr ("(none)"), false, true, [] {});
+        menu.addItem (tr ("Inserts reach the audio device through the Master"), false, false, [] {});
+    }
+    else
+        menu.addItem (outputName(), false, true, [] {});
+    menu.addSeparator();
+    menu.addItem (tr ("Audio settings..."), [] {
+        if (mixerinput::openAudioSettings)
+            mixerinput::openAudioSettings();
+    });
+    menu.showMenuAsync (juce::PopupMenu::Options().withTargetComponent (this).withTargetScreenArea (localAreaToGlobal (outputBounds())));
 }
 
 juce::Rectangle<int> EffectsPanel::slotBounds (int slot) const
@@ -1567,7 +1852,7 @@ juce::Rectangle<int> EffectsPanel::knobBounds (int param) const
     const auto columns = count > 9 ? 4 : 3;
     const auto w = (getWidth() - 16) / columns;
     const auto rows = juce::jmax (1, (count + columns - 1) / columns);
-    const auto rowHeight = count > 9 ? juce::jlimit (64, 86, (getHeight() - top - 4) / rows) : 86;
+    const auto rowHeight = count > 9 ? juce::jlimit (64, 86, (bottomTop() - top - 4) / rows) : 86;
 
     // volume gate: the 32 steps are bars (gateStepsBounds); the knobs are mix/attack/release
     if (gateSelected())
@@ -1853,6 +2138,7 @@ void EffectsPanel::paint (juce::Graphics& g)
 
     g.setFont (font (type::body));
 
+    // the 10 slots, as FL draws them: options arrow, name ("Slot N" when empty), mix knob, LED
     for (int i = 0; i < maxEffectSlots; ++i)
     {
         const auto r = slotBounds (i);
@@ -1861,12 +2147,8 @@ void EffectsPanel::paint (juce::Graphics& g)
         const auto slotHovered = i == hoverSlot && dragSlot < 0;
         g.setColour (isSelected ? colour::bg5 : filled ? (slotHovered ? colour::bg4 : colour::bg3) : (slotHovered ? colour::bg3 : colour::bg2.brighter (0.03f)));
         g.fillRoundedRectangle (r.toFloat(), radius::sm);
-
-        if (! filled)
-        {
-            g.setColour (slotHovered ? colour::borderStrong : colour::border);
-            g.drawRoundedRectangle (r.toFloat().reduced (0.5f), radius::sm, 1.0f);
-        }
+        g.setColour (slotHovered ? colour::borderStrong : colour::border);
+        g.drawRoundedRectangle (r.toFloat().reduced (0.5f), radius::sm, 1.0f);
 
         if (isSelected)
         {
@@ -1874,15 +2156,26 @@ void EffectsPanel::paint (juce::Graphics& g)
             g.fillRoundedRectangle (r.toFloat().withWidth (3.0f).reduced (0.0f, 3.0f), 1.5f);
         }
 
+        {
+            const auto a = arrowBounds (i).toFloat().withSizeKeepingCentre (5.0f, 8.0f).translated (1.0f, 0.0f);
+            juce::Path tri;
+            tri.addTriangle (a.getX(), a.getY(), a.getRight(), a.getCentreY(), a.getX(), a.getBottom());
+            g.setColour (slotHovered && hoverArrow ? colour::textPrimary : colour::textSecondary.withAlpha (filled ? 1.0f : 0.6f));
+            g.fillPath (tri);
+        }
+
+        const auto ledArea = ledBounds (i).toFloat().withSizeKeepingCentre (8.0f, 8.0f);
+        const auto textArea = r.withTrimmedLeft (20).withTrimmedRight (46);
+
         if (filled)
         {
             const auto& slot = (*s)[(std::size_t) i];
             g.setColour (muteLed (! slot.enabled));
-            g.fillEllipse ((float) r.getX() + 8, (float) r.getCentreY() - 4, 8, 8);
+            g.fillEllipse (ledArea);
             if (slotHovered && hoverLed)
             {
                 g.setColour (colour::textSecondary);
-                g.drawEllipse ((float) r.getX() + 6, (float) r.getCentreY() - 6, 12, 12, 1.0f);
+                g.drawEllipse (ledArea.expanded (2.0f), 1.0f);
             }
             g.setColour (slot.enabled ? colour::textPrimary : colour::textDisabled);
             // a LYNX substitute shows the plugin it stands in for, with a "LYNX" badge
@@ -1892,10 +2185,10 @@ void EffectsPanel::paint (juce::Graphics& g)
                                                         : juce::String::fromUTF8 (effectInfo (slot.kind).name);
             if (slot.sidechain > 0 && slot.sidechain < (int) engine.getSong().mixer.size())
                 name << juce::String::fromUTF8 (" \xe2\x86\x90 ") << juce::String::fromUTF8 (engine.getSong().mixer[(std::size_t) slot.sidechain].name.c_str());
-            auto textArea = r.withTrimmedLeft (24).withTrimmedRight (28);
+            auto text = textArea;
             if (substitute)
             {
-                const auto badge = textArea.removeFromRight (34).withSizeKeepingCentre (32, 14).toFloat();
+                const auto badge = text.removeFromRight (34).withSizeKeepingCentre (32, 14).toFloat();
                 g.setColour (colour::info.withAlpha (slot.enabled ? 0.25f : 0.12f));
                 g.fillRoundedRectangle (badge, 3.0f);
                 g.setColour (slot.enabled ? colour::info : colour::textDisabled);
@@ -1905,20 +2198,29 @@ void EffectsPanel::paint (juce::Graphics& g)
                 g.setFont (keep);
                 g.setColour (slot.enabled ? colour::textPrimary : colour::textDisabled);
             }
-            g.drawText (juce::String (i + 1) + ". " + name, textArea, juce::Justification::centredLeft);
+            g.drawText (name, text, juce::Justification::centredLeft);
 
             // slot's dry/wet knob
             const auto mixActive = (hoverParam == mixParam && hoverSlot == i) || (dragParam == mixParam && selectedSlot == i);
-            drawKnob (g, mixBounds (i).toFloat().withSizeKeepingCentre (20.0f, 20.0f), slot.mix, false,
+            drawKnob (g, mixBounds (i).toFloat().withSizeKeepingCentre (18.0f, 18.0f), slot.mix, false,
                       slot.enabled ? (dragParam == mixParam && selectedSlot == i ? colour::accent : colour::info) : colour::textDisabled, mixActive);
         }
-        else if (i == (int) s->size() || slotHovered)
+        else
         {
+            // an empty slot keeps its controls in place (dimmed), as FL shows them
+            g.setColour (muteLed (false).withAlpha (0.3f));
+            g.fillEllipse (ledArea);
+            drawKnob (g, mixBounds (i).toFloat().withSizeKeepingCentre (18.0f, 18.0f), 1.0f, false, colour::textDisabled.withAlpha (0.5f), false);
             g.setColour (slotHovered ? colour::textSecondary : colour::textDisabled);
-            g.drawText (juce::String (i + 1) + ". " + tr ("(empty: click to add)"), r.withTrimmedLeft (24), juce::Justification::centredLeft);
+            g.setFont (juce::Font (font (type::body)).italicised());
+            g.drawText (tr ("Slot {0}", { juce::String (i + 1) }), textArea, juce::Justification::centredLeft);
+            g.setFont (font (type::body));
         }
     }
 
+    paintEq (g);
+    g.reduceClipRegion (0, 0, getWidth(), bottomTop() - 6); // the selected effect's knobs stay above the EQ
+
     if (dragSlot >= 0 && dropSlot >= 0 && dropSlot != dragSlot) // where the dragged slot lands
     {
         const auto r = slotBounds (dropSlot);
@@ -2135,6 +2437,34 @@ void EffectsPanel::mouseDown (const juce::MouseEvent& e)
     if (s == nullptr)
         return;
 
+    // the built-in EQ and the output target (bottom section)
+    if (outputBounds().contains (e.getPosition()))
+    {
+        showOutputMenu();
+        return;
+    }
+
+    if (const auto eqControl = eqControlAt (e.getPosition()); eqControl != 0)
+    {
+        if (isEqPoint (eqControl))
+        {
+            dragParam = eqControl;
+            setEqFromGraph (eqPointBase - eqControl, e.getPosition());
+            return;
+        }
+        if (e.mods.isPopupMenu())
+            ui::showValueMenu (*this, &engine, specFor (eqControl, -1), valueOf (eqControl, -1), [this, eqControl] (double v) { setValue (eqControl, -1, v); });
+        else if (ui::isResetClick (e))
+            setValue (eqControl, -1, specFor (eqControl, -1).defaultValue);
+        else
+        {
+            dragParam = eqControl;
+            drag.begin (e, valueOf (eqControl, -1));
+            showTip (eqControl, -1, false);
+        }
+        return;
+    }
+
     if (track > 0 && armBounds().contains (e.getPosition()))
     {
         if (e.mods.isPopupMenu())
@@ -2176,6 +2506,14 @@ void EffectsPanel::mouseDown (const juce::MouseEvent& e)
             return;
         }
 
+        if (arrowBounds (i).contains (e.getPosition())) // FL's slot options arrow
+        {
+            selectedSlot = i;
+            repaint();
+            showSlotMenu (i);
+            return;
+        }
+
         selectedSlot = i;
         repaint();
 
@@ -2200,7 +2538,7 @@ void EffectsPanel::mouseDown (const juce::MouseEvent& e)
 
         if (e.mods.isPopupMenu())
             showSlotMenu (i);
-        else if (e.x < r.getX() + 22) // LED: bypass
+        else if (ledBounds (i).contains (e.getPosition())) // LED: bypass
             engine.editSong ([t = track, i] (Song& song) {
                 auto& slot = song.mixer[(std::size_t) t].effects[(std::size_t) i];
                 slot.enabled = ! slot.enabled;
@@ -2302,6 +2640,26 @@ ui::ValueSpec EffectsPanel::specFor (int param, int slot) const
     ui::ValueSpec spec;
     spec.pixelsForRange = 150.0;
 
+    if (isEqParam (param)) // the built-in EQ (stored 0..1 here: gain ±18 dB, frequency 10 Hz..16 kHz log, width)
+    {
+        const auto band = (eqParamBase - param) / 3, what = (eqParamBase - param) % 3;
+        const juce::String whatName = what == 0 ? tr ("level") : what == 1 ? tr ("frequency") : tr ("width");
+        spec.name = juce::String::fromUTF8 (song.mixer[(std::size_t) track].name.c_str()) + " - " + tr ("EQ band {0} ({1})", { juce::String (band + 1), tr (eqBandNames[band]) })
+                    + " " + whatName;
+        TrackEq defaults;
+        spec.defaultValue = eqToValue (defaults, band, what);
+        spec.toText = [band, what] (double v) {
+            TrackEq eq;
+            eqFromValue (eq, band, what, (float) v);
+            const auto b = (std::size_t) band;
+            return what == 0 ? juce::String (eq.gainDb[b], 1) + " dB"
+                   : what == 1 ? (eq.hz[b] >= 1000.0f ? juce::String (eq.hz[b] / 1000.0f, 2) + " kHz" : juce::String ((int) eq.hz[b]) + " Hz")
+                               : juce::String (eq.width[b], 2);
+        };
+        spec.fromText = ui::inverseOf (spec.toText, 0.0, 1.0);
+        return spec;
+    }
+
     if (const auto* s = slots(); s == nullptr || slot < 0 || slot >= (int) s->size())
         return spec;
 
@@ -2329,6 +2687,11 @@ ui::ValueSpec EffectsPanel::specFor (int param, int slot) const
 
 double EffectsPanel::valueOf (int param, int slot) const
 {
+    if (isEqParam (param))
+        return track >= 0 && track < (int) engine.getSong().mixer.size()
+                   ? eqToValue (engine.getSong().mixer[(std::size_t) track].eq, (eqParamBase - param) / 3, (eqParamBase - param) % 3)
+                   : 0.0;
+
     const auto* s = slots();
 
     if (s == nullptr || slot < 0 || slot >= (int) s->size())
@@ -2340,6 +2703,15 @@ double EffectsPanel::valueOf (int param, int slot) const
 
 void EffectsPanel::setValue (int param, int slot, double value)
 {
+    if (isEqParam (param))
+    {
+        engine.editSong ([t = track, band = (eqParamBase - param) / 3, what = (eqParamBase - param) % 3, v = (float) value] (Song& song) {
+            if (t < (int) song.mixer.size())
+                eqFromValue (song.mixer[(std::size_t) t].eq, band, what, v);
+        });
+        return;
+    }
+
     const auto* s = slots();
 
     if (s == nullptr || slot < 0 || slot >= (int) s->size())
@@ -2364,6 +2736,18 @@ int EffectsPanel::mixKnobAt (juce::Point<int> p) const
 
 void EffectsPanel::mouseWheelMove (const juce::MouseEvent& e, const juce::MouseWheelDetails& wheel)
 {
+    if (auto eqControl = eqControlAt (e.getPosition()); eqControl != 0)
+    {
+        if (isEqPoint (eqControl)) // the wheel over a handle changes the band's width
+            eqControl = eqParamBase - (eqPointBase - eqControl) * 3 - 2;
+        if (const auto v = ui::wheelValue (valueOf (eqControl, -1), e, wheel, specFor (eqControl, -1)))
+        {
+            setValue (eqControl, -1, *v);
+            showTip (eqControl, -1, true);
+        }
+        return;
+    }
+
     if (const auto slot = mixKnobAt (e.getPosition()); slot >= 0)
     {
         if (const auto v = ui::wheelValue (valueOf (mixParam, slot), e, wheel, specFor (mixParam, slot)))
@@ -2403,6 +2787,29 @@ ui::Hint EffectsPanel::hintAt (juce::Point<int> p)
 {
     const auto gesture = ui::valueGestures();
 
+    if (isEqParam (dragParam))
+        return ui::valueHint (specFor (dragParam, -1), valueOf (dragParam, -1), gesture);
+
+    if (const auto eqControl = eqControlAt (p); eqControl != 0)
+    {
+        if (isEqParam (eqControl))
+            return ui::valueHint (specFor (eqControl, -1), valueOf (eqControl, -1), gesture);
+        ui::Hint h;
+        const auto band = eqPointBase - eqControl;
+        h.text = tr ("EQ: [LMB] drag the band's frequency and level  [Wheel] width  [2xLMB] back to 0 dB");
+        h.value = tr ("Band {0}", { juce::String (band + 1) }) + " - " + tr (eqBandNames[band]);
+        return h;
+    }
+
+    if (outputBounds().contains (p))
+    {
+        ui::Hint h;
+        h.text = tr ("Audio output target: where this insert's sound leaves LYNX");
+        h.value = outputName();
+        h.hasMenu = true;
+        return h;
+    }
+
     if (dragParam == mixParam || (dragParam >= 0 && drag.isActive()))
         return ui::valueHint (specFor (dragParam, dragParam == mixParam ? juce::jmax (0, selectedSlot) : selectedSlot),
                               valueOf (dragParam, dragParam == mixParam ? juce::jmax (0, selectedSlot) : selectedSlot), gesture);
@@ -2446,7 +2853,8 @@ ui::Hint EffectsPanel::hintAt (juce::Point<int> p)
         if (slotBounds (i).contains (p))
         {
             const auto used = slots() != nullptr && i < (int) slots()->size();
-            h.text = used ? tr ("Effect slot: click edits, the LED bypasses, drag or wheel reorders, right-click: replace, move, delete")
+            h.text = used ? (arrowBounds (i).contains (p) ? tr ("Effect slot options: replace, move, delete...")
+                                                          : tr ("Effect slot: click edits, double-click opens its window, the LED bypasses, drag or wheel reorders, right-click: options"))
                           : tr ("Empty slot: click to add an effect");
             h.hasMenu = used;
         }
@@ -2472,6 +2880,19 @@ void EffectsPanel::mouseDrag (const juce::MouseEvent& e)
         return;
     }
 
+    if (isEqPoint (dragParam))
+    {
+        setEqFromGraph (eqPointBase - dragParam, e.getPosition());
+        return;
+    }
+
+    if (isEqParam (dragParam))
+    {
+        setValue (dragParam, -1, drag.update (e, specFor (dragParam, -1)));
+        showTip (dragParam, -1, false);
+        return;
+    }
+
     if (dragParam == gateStepParam)
     {
         setGateStep (e.getPosition());
@@ -2500,6 +2921,19 @@ void EffectsPanel::mouseDrag (const juce::MouseEvent& e)
 
 void EffectsPanel::showTip (int param, int slot, bool transient)
 {
+    if (isEqParam (param))
+    {
+        const auto band = (eqParamBase - param) / 3, what = (eqParamBase - param) % 3;
+        const auto area = what == 0 ? eqFaderBounds (band) : eqKnobBounds (band, what);
+        const auto spec = specFor (param, -1);
+        ui::postHint (ui::valueHint (spec, valueOf (param, -1), ui::valueGestures()));
+        if (transient)
+            ui::flashValueTip (*this, area, spec.text (valueOf (param, -1)));
+        else
+            ui::showValueTip (*this, area, spec.text (valueOf (param, -1)));
+        return;
+    }
+
     const auto* s = slots();
 
     if (s == nullptr || slot < 0 || slot >= (int) s->size())
@@ -2537,9 +2971,23 @@ void EffectsPanel::mouseMove (const juce::MouseEvent& e)
         led = p.x < slotBounds (slot).getX() + 22;
 
     const auto input = track > 0 && armBounds().contains (p) ? 1 : track > 0 && inputBoxBounds().contains (p) ? 2 : 0;
+    const auto eq = eqControlAt (p);
+    const auto output = outputBounds().contains (p);
+    auto arrow = false;
+    for (int i = 0; i < maxEffectSlots; ++i)
+        if (arrowBounds (i).contains (p))
+        {
+            slot = i;
+            arrow = true;
+        }
+    if (slot >= 0)
+        led = ledBounds (slot).contains (p);
 
-    if (slot != hoverSlot || param != hoverParam || led != hoverLed || input != hoverInput)
+    if (slot != hoverSlot || param != hoverParam || led != hoverLed || input != hoverInput || eq != hoverEq || output != hoverOutput || arrow != hoverArrow)
     {
+        hoverEq = eq;
+        hoverOutput = output;
+        hoverArrow = arrow;
         hoverInput = input;
         hoverSlot = slot;
         hoverParam = param;
@@ -2550,8 +2998,10 @@ void EffectsPanel::mouseMove (const juce::MouseEvent& e)
 
 void EffectsPanel::mouseExit (const juce::MouseEvent&)
 {
-    if (hoverSlot >= 0 || hoverParam != -1 || hoverInput != 0)
+    if (hoverSlot >= 0 || hoverParam != -1 || hoverInput != 0 || hoverEq != 0 || hoverOutput || hoverArrow)
     {
+        hoverEq = 0;
+        hoverOutput = hoverArrow = false;
         hoverInput = 0;
         hoverSlot = hoverParam = -1;
         hoverLed = false;
@@ -2582,13 +3032,22 @@ void EffectsPanel::mouseUp (const juce::MouseEvent&)
 
 void EffectsPanel::mouseDoubleClick (const juce::MouseEvent& e)
 {
+    if (const auto eqControl = eqControlAt (e.getPosition()); eqControl != 0)
+    {
+        if (isEqPoint (eqControl)) // the band back to 0 dB
+            setValue (eqParamBase - (eqPointBase - eqControl) * 3, -1, specFor (eqParamBase, -1).defaultValue);
+        else
+            setValue (eqControl, -1, specFor (eqControl, -1).defaultValue);
+        return;
+    }
+
     for (int i = 0; slots() != nullptr && i < (int) slots()->size(); ++i)
         if (mixBounds (i).contains (e.getPosition()))
         {
             engine.editSong ([t = track, i] (Song& song) { song.mixer[(std::size_t) t].effects[(std::size_t) i].mix = 1.0f; });
             return;
         }
-        else if (slotBounds (i).contains (e.getPosition()) && e.x >= slotBounds (i).getX() + 22)
+        else if (slotBounds (i).contains (e.getPosition()) && ! arrowBounds (i).contains (e.getPosition()) && ! ledBounds (i).contains (e.getPosition()))
         {
             openEditor (i); // double-click on the name: the effect's window (as clicking a slot in FL)
             return;
@@ -2673,7 +3132,7 @@ int EffectsPanel::slotAt (juce::Point<int> p) const
 {
     const auto* s = slots();
     for (int i = 0; s != nullptr && i < (int) s->size(); ++i)
-        if (slotBounds (i).contains (p) && ! mixBounds (i).contains (p) && p.x >= slotBounds (i).getX() + 22)
+        if (slotBounds (i).contains (p) && ! mixBounds (i).contains (p) && ! ledBounds (i).contains (p) && ! arrowBounds (i).contains (p))
             return i;
     return -1;
 }

+ 27 - 4
src/ui/MixerComponent.h

@@ -138,10 +138,13 @@ private:
     JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MixerStrips)
 };
 
-// Effects panel for the selected track: 10 slots and the knobs of the chosen slot.
-//  - click an empty slot: choose an effect; click an occupied one: edit its knobs
-//  - slot LED: on/off (bypass); right-click: replace, move, delete
-//  - knob to the right of the slot: dry/wet (drag; double-click resets to 100%)
+// Effects panel for the selected track, in FL's layout (REA round 104): the audio input row, 10 slots, the
+// knobs of the chosen slot (LYNX), then the insert's built-in 3-band EQ and its audio output target.
+//  - click an empty slot ("Slot N"): choose an effect; click an occupied one: edit its knobs; double click: its window
+//  - the arrow on the left of a slot (or right-click): the slot's options (add / replace, move, delete...)
+//  - on the right of a slot: the mix knob (drag; double-click resets to 100%) and the LED (on/off, bypass)
+//  - EQ: drag a band's handle in the graph (frequency and gain; wheel: width), its fader (gain) or its knobs
+//    (frequency, width)
 class EffectsPanel final : public juce::Component,
                            public ui::HintSource,
                            public juce::DragAndDropTarget,
@@ -197,6 +200,26 @@ private:
     juce::Rectangle<int> slotBounds (int slot) const;
     juce::Rectangle<int> mixBounds (int slot) const; // dry/wet knob on the slot's row
     static constexpr int mixParam = -2;
+    // FL's layout (REA round 104)
+    juce::Rectangle<int> arrowBounds (int slot) const; // the slot's options arrow
+    juce::Rectangle<int> ledBounds (int slot) const;   // the slot's on/off LED
+    int bottomTop() const;                             // top of the EQ + output section
+    juce::Rectangle<int> eqGraphBounds() const;
+    juce::Rectangle<int> eqFaderBounds (int band) const;
+    juce::Rectangle<int> eqKnobBounds (int band, int what) const; // what: 1 = frequency, 2 = width
+    juce::Rectangle<int> outputBounds() const;
+    juce::Point<float> eqHandle (int band) const;      // where a band's handle sits in the graph
+    int eqControlAt (juce::Point<int> p) const;        // an EQ control under p (eqParamBase/eqPointBase codes), or 0
+    void paintEq (juce::Graphics& g);
+    void setEqFromGraph (int band, juce::Point<int> p);
+    void showOutputMenu();
+    juce::String outputName() const;
+    static constexpr int eqParamBase = -100; // eqParamBase - band * 3 - what (0 gain, 1 frequency, 2 width), stored 0..1
+    static constexpr int eqPointBase = -200; // eqPointBase - band: dragging the band's handle in the graph
+    static bool isEqParam (int p) noexcept { return p <= eqParamBase && p > eqParamBase - 9; }
+    static bool isEqPoint (int p) noexcept { return p <= eqPointBase && p > eqPointBase - 3; }
+    int hoverEq = 0;
+    bool hoverOutput = false, hoverArrow = false;
     static constexpr int gateStepParam = -3; // drawing the volume gate steps
     juce::Rectangle<int> knobBounds (int param) const;
     bool gateSelected() const;

+ 506 - 107
src/ui/PlaylistComponent.cpp

@@ -303,6 +303,8 @@ double PlaylistComponent::xToTick (int x) const { return (x - headerWidth) / pix
 int PlaylistComponent::heightOf (int track) const
 {
     const auto& tracks = engine.getSong().playlistTracks;
+    if (noteedit::isFoldedAway (engine.getSong(), track))
+        return foldedHeight;
     const auto h = track >= 0 && track < (int) tracks.size() ? tracks[(std::size_t) track].height : 0;
     return h > 0 ? polish::clampTrackHeight (h) : trackHeight;
 }
@@ -352,7 +354,7 @@ int PlaylistComponent::dividerAt (juce::Point<int> p) const
     const auto track = yToTrack (p.y);
 
     for (auto t : { track - 1, track })
-        if (t >= 0 && std::abs (p.y - (trackToY (t) + heightOf (t))) <= 3)
+        if (t >= 0 && ! noteedit::isFoldedAway (engine.getSong(), t) && std::abs (p.y - (trackToY (t) + heightOf (t))) <= 3)
             return t;
 
     return -1;
@@ -609,6 +611,21 @@ void PlaylistComponent::paint (juce::Graphics& g)
             if (! g.getClipBounds().toFloat().intersects (r.expanded (1.0f)))
                 continue; // outside the area being repainted
 
+            if (noteedit::isFoldedAway (song, c.track)) // a folded group: each member's clips as a thin bar (FL)
+            {
+                const auto barColour = c.kind == ClipKind::audio        ? colour::audioClip
+                                       : c.kind == ClipKind::automation ? colour::automation
+                                                                        : tame (patternColour (song, c.pattern));
+                g.setColour (barColour.withAlpha (c.muted ? 0.35f : 0.9f));
+                g.fillRect (juce::Rectangle<float> (x0, y + 2.0f, juce::jmax (2.0f, x1 - x0 - 1.0f), (float) foldedHeight - 4.0f));
+                if (isSelected (i))
+                {
+                    g.setColour (colour::textPrimary);
+                    g.drawRect (juce::Rectangle<float> (x0, y + 1.0f, juce::jmax (2.0f, x1 - x0 - 1.0f), (float) foldedHeight - 2.0f), 1.0f);
+                }
+                continue;
+            }
+
             if (c.kind == ClipKind::automation)
             {
                 paintAutomationClip (g, c, r);
@@ -802,6 +819,8 @@ void PlaylistComponent::paint (juce::Graphics& g)
     }
 
     // --- track headers -----------------------------------------------------
+    // FL's layout: the name on the left, a group header's fold arrow and the mute LED on the right; grouped
+    // tracks sit indented on a block in their header's colour; members of a folded group are thin rows
     {
         const auto headers = juce::Rectangle<int> (0, headerHeight, headerWidth, grid.getHeight());
         juce::Graphics::ScopedSaveState state (g);
@@ -810,6 +829,25 @@ void PlaylistComponent::paint (juce::Graphics& g)
         g.fillRect (headers);
         g.setFont (font (type::small));
 
+        auto colourOf = [&song] (int t) { return t >= 0 && t < (int) song.playlistTracks.size() ? song.playlistTracks[(std::size_t) t].colour : 0u; };
+
+        // group blocks first (behind the headers): from the header's top to the last member's bottom
+        for (int t = 0; t < tracks; ++t)
+        {
+            if (! noteedit::isGroupHeader (song, t))
+                continue;
+            const auto members = noteedit::groupMembers (song, t);
+            const auto last = members.empty() ? t : members.back();
+            const auto top = trackToY (t), bottom = trackToY (last) + heightOf (last);
+            if (top > headers.getBottom() || bottom < headers.getY())
+                continue;
+            auto block = colour::bg3;
+            if (const auto c = colourOf (t); c != 0)
+                block = block.interpolatedWith (tame (juce::Colour (c)), 0.28f);
+            g.setColour (block);
+            g.fillRoundedRectangle (juce::Rectangle<float> (1.0f, (float) top + 1.0f, (float) headerWidth - 2.0f, (float) (bottom - top) - 2.0f), radius::md);
+        }
+
         for (int t = 0; t < tracks; ++t)
         {
             const auto y = trackToY (t);
@@ -818,28 +856,62 @@ void PlaylistComponent::paint (juce::Graphics& g)
             if (y > headers.getBottom() || y + trackHeight < headers.getY())
                 continue;
 
+            if (noteedit::isFoldedAway (song, t))
+                continue; // the group block shows through: a thin row, as FL draws a folded group
+
             const auto muted = song.isTrackMuted (t);
             const auto custom = t < (int) song.playlistTracks.size() && ! song.playlistTracks[(std::size_t) t].name.empty();
             const auto hovered = hover.header && hover.track == t;
+            const auto member = noteedit::groupHeaderOf (song, t) >= 0 && ! noteedit::isGroupHeader (song, t);
+            const auto groupHead = noteedit::isGroupHeader (song, t);
+            const auto left = member ? (float) groupIndent : 2.0f;
             auto plate = muted ? colour::bg2 : colour::bg3;
-            const auto trackColour = t < (int) song.playlistTracks.size() ? song.playlistTracks[(std::size_t) t].colour : 0u;
+            const auto trackColour = colourOf (t);
             if (trackColour != 0) // the track's colour (FL projects colour their track headers by group)
-                plate = plate.interpolatedWith (tame (juce::Colour (trackColour)), muted ? 0.22f : 0.5f);
+                plate = plate.interpolatedWith (tame (juce::Colour (trackColour)), muted ? 0.22f : (groupHead ? 0.62f : 0.5f));
             if (hovered)
                 plate = plate.interpolatedWith (colour::bg5, 0.6f);
+            const auto plateArea = juce::Rectangle<float> (left, (float) y + 1.0f, (float) headerWidth - 2.0f - left, (float) trackHeight - 3.0f);
             g.setColour (plate);
-            g.fillRoundedRectangle (juce::Rectangle<float> (2.0f, (float) y + 1.0f, (float) headerWidth - 4.0f, (float) trackHeight - 3.0f), radius::sm);
+            g.fillRoundedRectangle (plateArea, radius::sm);
+
+            if (t == currentTrack) // the selected track (FL marks it next to the LED)
+            {
+                g.setColour (colour::accent);
+                g.fillRoundedRectangle (plateArea.withWidth (3.0f).reduced (0.0f, 3.0f), 1.5f);
+            }
+
+            const auto led = trackLed (t).toFloat();
             g.setColour (muteLed (muted));
-            g.fillEllipse (7.0f, (float) y + trackHeight / 2.0f - 4.0f, 8.0f, 8.0f);
+            g.fillEllipse (led.withSizeKeepingCentre (8.0f, 8.0f));
             if (hovered && hover.led) // the LED is a button: ring it
             {
                 g.setColour (colour::textPrimary.withAlpha (0.7f));
-                g.drawEllipse (5.0f, (float) y + trackHeight / 2.0f - 6.0f, 12.0f, 12.0f, 1.0f);
+                g.drawEllipse (led.withSizeKeepingCentre (12.0f, 12.0f), 1.0f);
+            }
+
+            auto textRight = led.getX() - 2.0f;
+            if (const auto arrow = trackArrow (t); ! arrow.isEmpty())
+            {
+                const auto collapsed = t < (int) song.playlistTracks.size() && song.playlistTracks[(std::size_t) t].collapsed;
+                const auto a = arrow.toFloat().withSizeKeepingCentre (8.0f, 5.0f);
+                juce::Path tri;
+                if (collapsed) // folded: points down (FL), open: up
+                    tri.addTriangle (a.getX(), a.getY(), a.getRight(), a.getY(), a.getCentreX(), a.getBottom());
+                else
+                    tri.addTriangle (a.getX(), a.getBottom(), a.getRight(), a.getBottom(), a.getCentreX(), a.getY());
+                g.setColour (hovered && hover.arrow ? colour::textPrimary : colour::textSecondary);
+                g.fillPath (tri);
+                textRight = (float) arrow.getX();
             }
+
             g.setColour (muted ? colour::textDisabled : (custom ? colour::textPrimary : colour::textSecondary));
+            g.setFont (font (type::small, groupHead));
+            const auto textLeft = (int) left + 6;
             g.drawFittedText (custom ? juce::String::fromUTF8 (song.playlistTracks[(std::size_t) t].name.c_str())
                                      : tr ("Track {0}", { juce::String (t + 1) }),
-                              20, y, headerWidth - 24, trackHeight, juce::Justification::centredLeft, trackHeight >= 30 ? 2 : 1, 0.8f);
+                              textLeft, y, juce::jmax (8, (int) textRight - textLeft - 2), trackHeight, juce::Justification::centredLeft,
+                              trackHeight >= 30 ? 2 : 1, 0.8f);
 
             // the divider under the header: lit while hovered or dragged (drag resizes the track)
             if (hover.divider == t || (drag == Drag::trackResize && (resizeTrack == t || resizeAll)))
@@ -1285,22 +1357,38 @@ void PlaylistComponent::mouseDown (const juce::MouseEvent& e)
         return;
     }
 
-    // track header: the LED mutes (Ctrl+click or right-click on it: solo); right-click elsewhere: track menu
+    // track header: the LED mutes (Ctrl+click or right-click on it: solo), a group header's arrow folds the
+    // group, a click elsewhere selects the track; right-click elsewhere: track menu
     if (e.x < headerWidth && e.y >= headerHeight && e.y < gridArea().getBottom())
     {
         const auto track = yToTrack (e.y);
-        const auto onLed = e.x < 20;
+
+        if (noteedit::isFoldedAway (engine.getSong(), track)) // a thin row of a folded group: only its menu
+        {
+            if (e.mods.isPopupMenu())
+                showTrackMenu (track);
+            return;
+        }
+
+        const auto onLed = trackLed (track).expanded (3).contains (e.getPosition());
+        const auto onArrow = trackArrow (track).contains (e.getPosition());
 
         if (onLed && (e.mods.isPopupMenu() || e.mods.isCtrlDown()))
             engine.editSong ([track, count = numTracks()] (Song& s) { noteedit::soloTrack (s, track, count); });
         else if (e.mods.isPopupMenu())
             showTrackMenu (track);
         else if (onLed)
+            editTrack (track, [] (PlaylistTrack& t) { t.muted = ! t.muted; });
+        else if (onArrow)
             engine.editSong ([track] (Song& s) {
-                if ((int) s.playlistTracks.size() <= track)
-                    s.playlistTracks.resize ((std::size_t) track + 1);
-                s.playlistTracks[(std::size_t) track].muted = ! s.playlistTracks[(std::size_t) track].muted;
+                const auto folded = track < (int) s.playlistTracks.size() && s.playlistTracks[(std::size_t) track].collapsed;
+                noteedit::setGroupCollapsed (s, track, ! folded);
             });
+        else if (! noteedit::isFoldedAway (engine.getSong(), track))
+        {
+            currentTrack = track;
+            repaint (0, headerHeight, headerWidth, getHeight() - headerHeight);
+        }
         return;
     }
 
@@ -2211,67 +2299,205 @@ void PlaylistComponent::deleteTimeSelection()
     sortClips();
 }
 
+juce::Rectangle<int> PlaylistComponent::trackLed (int track) const
+{
+    const auto h = heightOf (track);
+    return { headerWidth - 17, trackToY (track) + h / 2 - 6, 12, 12 };
+}
+
+juce::Rectangle<int> PlaylistComponent::trackArrow (int track) const
+{
+    if (! noteedit::isGroupHeader (engine.getSong(), track))
+        return {};
+
+    const auto led = trackLed (track);
+    return { led.getX() - 15, led.getY() - 1, 13, led.getHeight() + 2 };
+}
+
+void PlaylistComponent::editTrack (int track, std::function<void (PlaylistTrack&)> change)
+{
+    if (track < 0)
+        return;
+
+    engine.editSong ([track, change] (Song& s) {
+        if ((int) s.playlistTracks.size() <= track)
+            s.playlistTracks.resize ((std::size_t) track + 1);
+        change (s.playlistTracks[(std::size_t) track]);
+    });
+}
+
+// The track menu in FL's order (REA round 104): name and colour, size, grouping, its clips, insert / clone /
+// delete, move. FL items LYNX has no counterpart for (icons, track modes, performance settings, ghost notes,
+// consolidate) are left out.
 void PlaylistComponent::showTrackMenu (int track)
 {
     const auto& song = engine.getSong();
-    const auto muted = song.isTrackMuted (track);
     const auto count = numTracks();
+    const auto info = track < (int) song.playlistTracks.size() ? song.playlistTracks[(std::size_t) track] : PlaylistTrack {};
     juce::PopupMenu menu;
-    menu.addSectionHeader (track < (int) song.playlistTracks.size() && ! song.playlistTracks[(std::size_t) track].name.empty()
-                               ? juce::String::fromUTF8 (song.playlistTracks[(std::size_t) track].name.c_str())
-                               : tr ("Track {0}", { juce::String (track + 1) }));
+    menu.addSectionHeader (! info.name.empty() ? juce::String::fromUTF8 (info.name.c_str()) : tr ("Track {0}", { juce::String (track + 1) }));
     menu.addItem (tr ("Rename and color..."), [this, track] { renameTrack (track); });
-    menu.addItem (muted ? tr ("Unmute") : tr ("Mute"), [this, track] {
-        engine.editSong ([track] (Song& s) {
-            if ((int) s.playlistTracks.size() <= track)
-                s.playlistTracks.resize ((std::size_t) track + 1);
-            s.playlistTracks[(std::size_t) track].muted = ! s.playlistTracks[(std::size_t) track].muted;
-        });
+    {
+        juce::PopupMenu colours;
+        colours.addItem (tr ("Default"), true, info.colour == 0, [this, track] { editTrack (track, [] (PlaylistTrack& t) { t.colour = 0; }); });
+        colours.addSeparator();
+        for (auto c : lynxPalette())
+        {
+            juce::Image swatch (juce::Image::ARGB, 16, 16, true);
+            juce::Graphics (swatch).fillAll (juce::Colour (c));
+            juce::PopupMenu::Item item;
+            item.text = "#" + juce::String::toHexString ((juce::int64) (c & 0xFFFFFF)).paddedLeft ('0', 6).toUpperCase();
+            item.image = std::make_unique<juce::DrawableImage> (swatch);
+            item.isTicked = info.colour == c;
+            item.action = [this, track, c] { editTrack (track, [c] (PlaylistTrack& t) { t.colour = c; }); };
+            colours.addItem (std::move (item));
+        }
+        menu.addSubMenu (tr ("Change color"), colours);
+    }
+    menu.addItem (tr ("Random color"), [this, track] {
+        const auto& palette = lynxPalette();
+        const auto c = palette[(std::size_t) juce::Random::getSystemRandom().nextInt ((int) palette.size())];
+        editTrack (track, [c] (PlaylistTrack& t) { t.colour = c; });
     });
-    menu.addItem (tr ("Solo (mute the other tracks)"), [this, track, count] { engine.editSong ([track, count] (Song& s) { noteedit::soloTrack (s, track, count); }); });
-    menu.addSeparator();
-    menu.addItem (tr ("Insert a track above"), [this, track] {
-        setSelection ({});
-        engine.editSong ([track] (Song& s) { noteedit::insertTrack (s, track); });
+    menu.addItem (tr ("Auto name"), [this, track] {
+        // the name of the source of the track's first clip (pattern, audio or automation channel)
+        const auto& s = engine.getSong();
+        const Clip* first = nullptr;
+        for (const auto& c : s.playlist)
+            if (c.track == track && (first == nullptr || c.start < first->start))
+                first = &c;
+        if (first == nullptr)
+            return;
+        std::string name;
+        if (first->kind == ClipKind::pattern && first->pattern >= 0 && first->pattern < (int) s.patterns.size())
+            name = s.patterns[(std::size_t) first->pattern].name;
+        else if (first->kind == ClipKind::audio && first->channel >= 0 && first->channel < (int) s.channels.size())
+            name = s.channels[(std::size_t) first->channel].name;
+        else if (first->kind == ClipKind::automation && first->automation >= 0 && first->automation < (int) s.automations.size())
+            name = s.automations[(std::size_t) first->automation].name;
+        if (! name.empty())
+            editTrack (track, [name] (PlaylistTrack& t) { t.name = name; });
     });
-    menu.addItem (tr ("Insert a track below"), [this, track] {
-        setSelection ({});
-        engine.editSong ([track] (Song& s) { noteedit::insertTrack (s, track + 1); });
+    menu.addItem (tr ("Reset"), [this, track] {
+        editTrack (track, [] (PlaylistTrack& t) {
+            t.name.clear();
+            t.colour = 0;
+            t.height = 0;
+            t.muted = false;
+        });
     });
-    menu.addItem (tr ("Move up"), track > 0, false, [this, track] { engine.editSong ([track] (Song& s) { noteedit::swapTracks (s, track, track - 1); }); });
-    menu.addItem (tr ("Move down"), [this, track] { engine.editSong ([track] (Song& s) { noteedit::swapTracks (s, track, track + 1); }); });
     menu.addSeparator();
     {
-        // row heights (P18); dragging the divider under a header does the same
-        struct Size
-        {
-            const char* name;
-            int height;
-        };
-        static const Size sizes[] = { { TR_NOOP ("Small"), 24 }, { TR_NOOP ("Normal"), trackHeight }, { TR_NOOP ("Large"), 60 }, { TR_NOOP ("Huge"), 100 } };
-        juce::PopupMenu one, all;
+        // FL's sizes are relative to the default row; dragging the divider under a header sets any size (P18)
+        juce::PopupMenu size, all;
         const auto current = heightOf (track);
 
-        for (const auto& size : sizes)
+        for (int percent : { 33, 50, 100, 150, 200 })
         {
-            one.addItem (tr (size.name) + " (" + juce::String (size.height) + " px)", true, current == size.height,
-                         [this, track, h = size.height] { setTrackHeights ({ track }, h); });
-            all.addItem (tr (size.name) + " (" + juce::String (size.height) + " px)", [this, count, h = size.height] {
+            const auto h = polish::clampTrackHeight ((int) std::lround (trackHeight * percent / 100.0));
+            size.addItem (juce::String (percent) + "%", true, current == h, [this, track, h] { setTrackHeights ({ track }, h); });
+            all.addItem (juce::String (percent) + "%", [this, count, h] {
                 std::vector<int> tracks;
                 for (int t = 0; t < count; ++t)
                     tracks.push_back (t);
                 setTrackHeights (tracks, h);
             });
         }
-
-        menu.addSubMenu (tr ("Track height"), one);
-        menu.addSubMenu (tr ("Height of every track"), all);
+        size.addSeparator();
+        size.addSubMenu (tr ("Every track"), all);
+        menu.addSubMenu (tr ("Size"), size);
+    }
+    menu.addSeparator();
+    {
+        const auto header = noteedit::groupHeaderOf (song, track);
+        const auto member = info.grouped && track > 0;
+        const auto folded = header >= 0 && header < (int) song.playlistTracks.size() && song.playlistTracks[(std::size_t) header].collapsed;
+        menu.addItem (tr ("Group with above track"), track > 0 && ! member, member, [this, track] {
+            engine.editSong ([track] (Song& s) { noteedit::groupWithAbove (s, track); });
+        });
+        menu.addItem (tr ("Ungroup"), member, false, [this, track] { engine.editSong ([track] (Song& s) { noteedit::ungroupTrack (s, track); }); });
+        menu.addItem (tr ("Auto color group"), header >= 0, false, [this, track] { engine.editSong ([track] (Song& s) { noteedit::colourGroup (s, track); }); });
+        menu.addItem (tr ("Collapse grouped tracks"), header >= 0, folded, [this, track, folded] {
+            engine.editSong ([track, folded] (Song& s) { noteedit::setGroupCollapsed (s, track, ! folded); });
+        });
+    }
+    menu.addSeparator();
+    {
+        // the sources of the track's clips: choosing one makes it what the pencil paints (FL's "Current clip source")
+        juce::PopupMenu sources;
+        std::vector<std::pair<ClipKind, int>> seen;
+        for (const auto& c : song.playlist)
+        {
+            if (c.track != track)
+                continue;
+            const auto key = std::pair { c.kind, c.kind == ClipKind::pattern ? c.pattern : c.kind == ClipKind::audio ? c.channel : c.automation };
+            if (std::find (seen.begin(), seen.end(), key) != seen.end())
+                continue;
+            seen.push_back (key);
+            juce::String name;
+            if (key.first == ClipKind::pattern && key.second >= 0 && key.second < (int) song.patterns.size())
+                name = juce::String::fromUTF8 (song.patterns[(std::size_t) key.second].name.c_str());
+            else if (key.first == ClipKind::automation && key.second >= 0 && key.second < (int) song.automations.size())
+                name = juce::String::fromUTF8 (song.automations[(std::size_t) key.second].name.c_str());
+            else if (key.second >= 0 && key.second < (int) song.channels.size())
+                name = juce::String::fromUTF8 (song.channels[(std::size_t) key.second].name.c_str());
+            const auto ticked = brush.kind == key.first && (key.first == ClipKind::pattern ? song.currentPattern == key.second : brush.index == key.second);
+            sources.addItem (name, true, ticked, [this, key] {
+                brush.kind = key.first;
+                brush.index = key.first == ClipKind::pattern ? -1 : key.second;
+                if (key.first == ClipKind::pattern)
+                    engine.editSong ([p = key.second] (Song& s) { s.currentPattern = p; }, false);
+                engine.sendChangeMessage();
+            });
+        }
+        menu.addSubMenu (tr ("Current clip source"), sources, ! seen.empty());
+        auto muteAll = [this, track] (bool mute) {
+            engine.editSong ([track, mute] (Song& s) {
+                for (auto& c : s.playlist)
+                    if (c.track == track)
+                        c.muted = mute;
+            });
+        };
+        const auto hasClips = ! seen.empty();
+        menu.addItem (tr ("Mute all clips"), hasClips, false, [muteAll] { muteAll (true); });
+        menu.addItem (tr ("Unmute all clips"), hasClips, false, [muteAll] { muteAll (false); });
     }
     menu.addSeparator();
-    menu.addItem (tr ("Delete the track and its clips"), [this, track] {
+    menu.addItem (tr ("Insert one"), [this, track] {
+        setSelection ({});
+        engine.editSong ([track] (Song& s) { noteedit::insertTrack (s, track); });
+    });
+    menu.addItem (tr ("Clone"), [this, track] {
+        // a copy of the track (name, colour, size, group) and its clips, right below it
+        setSelection ({});
+        engine.editSong ([track] (Song& s) {
+            noteedit::insertTrack (s, track + 1);
+            if (track < (int) s.playlistTracks.size())
+            {
+                auto copy = s.playlistTracks[(std::size_t) track];
+                copy.collapsed = false;
+                if (noteedit::isGroupHeader (s, track) || copy.grouped)
+                    copy.grouped = true; // stays in the same group
+                s.playlistTracks[(std::size_t) track + 1] = copy;
+            }
+            std::vector<Clip> copies;
+            for (const auto& c : s.playlist)
+                if (c.track == track)
+                {
+                    copies.push_back (c);
+                    copies.back().track = track + 1;
+                }
+            s.playlist.insert (s.playlist.end(), copies.begin(), copies.end());
+        });
+        sortClips();
+    });
+    menu.addItem (tr ("Delete"), [this, track] {
         setSelection ({});
         engine.editSong ([track] (Song& s) { noteedit::removeTrack (s, track); });
     });
+    menu.addSeparator();
+    menu.addItem (tr ("Move up"), track > 0, false, [this, track] { engine.editSong ([track] (Song& s) { noteedit::swapTracks (s, track, track - 1); }); });
+    menu.addItem (tr ("Move down"), track + 1 < count, false, [this, track] { engine.editSong ([track] (Song& s) { noteedit::swapTracks (s, track, track + 1); }); });
     menu.showMenuAsync (juce::PopupMenu::Options().withTargetComponent (this).withMousePosition());
 }
 
@@ -3083,7 +3309,9 @@ PlaylistComponent::Hover PlaylistComponent::hoverAt (juce::Point<int> p) const
         h.header = true;
         h.track = yToTrack (p.y);
         h.divider = dividerAt (p);
-        h.led = h.divider < 0 && p.x < 20;
+        const auto folded = noteedit::isFoldedAway (engine.getSong(), h.track);
+        h.led = ! folded && h.divider < 0 && trackLed (h.track).expanded (3).contains (p);
+        h.arrow = ! folded && h.divider < 0 && trackArrow (h.track).contains (p);
         return h;
     }
 
@@ -3141,7 +3369,7 @@ void PlaylistComponent::updateCursor (juce::ModifierKeys mods)
         return;
     }
     if (hover.header)
-        cursor = hover.led ? gesture::Cursor::point : gesture::Cursor::normal;
+        cursor = hover.led || hover.arrow ? gesture::Cursor::point : gesture::Cursor::normal;
     else if (gridArea().contains (p))
     {
         const gesture::Mods m { mods.isShiftDown(), mods.isCtrlDown(), mods.isAltDown() };
@@ -3175,10 +3403,11 @@ ui::Hint PlaylistComponent::hintAt (juce::Point<int> p)
 
     if (h.header)
     {
-        hint.text = h.led ? tr ("Track: [LMB] mute / unmute  [Ctrl][LMB] or [RMB] solo")
-                          : tr ("Track: [RMB] menu  [2xLMB] rename  [Shift][Wheel] move up / down");
+        hint.text = h.led     ? tr ("Track: [LMB] mute / unmute  [Ctrl][LMB] or [RMB] solo")
+                    : h.arrow ? tr ("Track group: [LMB] collapse / expand the grouped tracks")
+                              : tr ("Track: [LMB] select  [RMB] menu  [2xLMB] open the clip source  [Shift][Wheel] move up / down");
         hint.value = trackName (h.track);
-        hint.hasMenu = ! h.led;
+        hint.hasMenu = ! h.led && ! h.arrow;
         return hint;
     }
 
@@ -3228,10 +3457,24 @@ void PlaylistComponent::mouseDoubleClick (const juce::MouseEvent& e)
         return;
     }
 
-    // double-click a track name: rename it
-    if (e.x >= 20 && e.x < headerWidth && e.y >= headerHeight && e.y < gridArea().getBottom() && e.mods.isLeftButtonDown())
+    // double-click a track header: open the source of the track's first clip (FL); empty tracks: rename
+    if (e.x < headerWidth && e.y >= headerHeight && e.y < gridArea().getBottom() && e.mods.isLeftButtonDown())
     {
-        renameTrack (yToTrack (e.y));
+        const auto track = yToTrack (e.y);
+
+        if (trackLed (track).expanded (3).contains (e.getPosition()) || trackArrow (track).contains (e.getPosition()))
+            return;
+
+        const auto& playlist = engine.getSong().playlist;
+        int first = -1;
+        for (int i = 0; i < (int) playlist.size(); ++i)
+            if (playlist[(std::size_t) i].track == track && (first < 0 || playlist[(std::size_t) i].start < playlist[(std::size_t) first].start))
+                first = i;
+
+        if (first >= 0)
+            openClipSource (first, e.mods.isAltDown());
+        else
+            renameTrack (track);
         return;
     }
 
@@ -3241,7 +3484,19 @@ void PlaylistComponent::mouseDoubleClick (const juce::MouseEvent& e)
     if (hit < 0)
         return;
 
-    const auto& clip = engine.getSong().playlist[(std::size_t) hit];
+    openClipSource (hit, e.mods.isAltDown());
+}
+
+void PlaylistComponent::openClipSource (int hit, bool other)
+{
+    if (hit < 0 || hit >= (int) engine.getSong().playlist.size())
+        return;
+
+    const auto clip = engine.getSong().playlist[(std::size_t) hit];
+
+    if (clip.kind == ClipKind::pattern && clip.pattern != engine.getSong().currentPattern
+        && clip.pattern < (int) engine.getSong().patterns.size())
+        engine.editSong ([p = clip.pattern] (Song& s) { s.currentPattern = p; }, false);
 
     if (clip.kind == ClipKind::automation)
         openAutomationEditor (engine, clip.automation);
@@ -3250,7 +3505,7 @@ void PlaylistComponent::mouseDoubleClick (const juce::MouseEvent& e)
         auto pianoRoll = editPatternsIn == 2
                          || (editPatternsIn == 0 && clip.pattern < (int) engine.getSong().patterns.size()
                              && hasPianoRollNotes (engine.getSong().patterns[(std::size_t) clip.pattern]));
-        if (e.mods.isAltDown())
+        if (other)
             pianoRoll = ! pianoRoll;
 
         if (pianoRoll && onOpenPianoRoll)
@@ -3504,6 +3759,7 @@ PatternPicker::PatternPicker (AudioEngine& e, PlaylistComponent& p)
       playlist (p)
 {
     engine.addChangeListener (this);
+    seenBrush = playlist.brush.kind;
 }
 
 PatternPicker::~PatternPicker()
@@ -3513,6 +3769,20 @@ PatternPicker::~PatternPicker()
 
 void PatternPicker::changeListenerCallback (juce::ChangeBroadcaster*)
 {
+    // the pencil's source changed elsewhere (a clip clicked, the track menu): show its kind, as FL does
+    if (playlist.brush.kind != seenBrush)
+    {
+        seenBrush = playlist.brush.kind;
+        view = seenBrush == ClipKind::audio ? 1 : seenBrush == ClipKind::automation ? 2 : 0;
+        scroll = 0;
+    }
+    repaint();
+}
+
+void PatternPicker::setView (int newView)
+{
+    view = juce::jlimit (0, 2, newView);
+    scroll = 0;
     repaint();
 }
 
@@ -3520,33 +3790,44 @@ std::vector<PatternPicker::Row> PatternPicker::rows() const
 {
     const auto& song = engine.getSong();
     std::vector<Row> list;
-    list.push_back ({ ClipKind::pattern, -1, tr ("Patterns"), {} });
 
-    for (int i = 0; i < (int) song.patterns.size(); ++i)
-        list.push_back ({ ClipKind::pattern, i, juce::String::fromUTF8 (song.patterns[(std::size_t) i].name.c_str()),
-                          PlaylistComponent::patternColour (song, i) });
+    if (view == 0)
+        for (int i = 0; i < (int) song.patterns.size(); ++i)
+            list.push_back ({ ClipKind::pattern, i, juce::String::fromUTF8 (song.patterns[(std::size_t) i].name.c_str()),
+                              PlaylistComponent::patternColour (song, i) });
 
-    bool audioHeader = false;
-    for (int c = 0; c < (int) song.channels.size(); ++c)
-        if (song.channels[(std::size_t) c].instrument == InstrumentKind::audioClip)
-        {
-            if (! audioHeader)
-                list.push_back ({ ClipKind::audio, -1, tr ("Audio"), {} });
-            audioHeader = true;
-            list.push_back ({ ClipKind::audio, c, juce::String::fromUTF8 (song.channels[(std::size_t) c].name.c_str()), theme::colour::audioClip });
-        }
+    if (view == 1)
+        for (int c = 0; c < (int) song.channels.size(); ++c)
+            if (song.channels[(std::size_t) c].instrument == InstrumentKind::audioClip)
+                list.push_back ({ ClipKind::audio, c, juce::String::fromUTF8 (song.channels[(std::size_t) c].name.c_str()),
+                                  PlaylistComponent::audioClipColour (song.channels[(std::size_t) c]) });
 
-    if (! song.automations.empty())
-        list.push_back ({ ClipKind::automation, -1, tr ("Automation"), {} });
-    for (int a = 0; a < (int) song.automations.size(); ++a)
-        list.push_back ({ ClipKind::automation, a, juce::String::fromUTF8 (song.automations[(std::size_t) a].name.c_str()), theme::colour::automation });
+    if (view == 2)
+        for (int a = 0; a < (int) song.automations.size(); ++a)
+            list.push_back ({ ClipKind::automation, a, juce::String::fromUTF8 (song.automations[(std::size_t) a].name.c_str()), theme::colour::automation });
 
     return list;
 }
 
+juce::Rectangle<int> PatternPicker::tabBounds (int tab) const
+{
+    const auto w = (getWidth() - 8) / 3;
+    return { 4 + tab * w, 2, w, headerHeight - 4 };
+}
+
+int PatternPicker::listBottom() const
+{
+    return view == 0 ? getHeight() - footerHeight : getHeight();
+}
+
+juce::Rectangle<int> PatternPicker::addBounds() const
+{
+    return view == 0 ? juce::Rectangle<int> (4, getHeight() - footerHeight + 2, getWidth() - 8, footerHeight - 4) : juce::Rectangle<int>();
+}
+
 int PatternPicker::rowAt (int y) const
 {
-    if (y < headerHeight)
+    if (y < headerHeight || y >= listBottom())
         return -1;
 
     const auto index = (y - headerHeight) / rowHeight + scroll;
@@ -3563,42 +3844,86 @@ void PatternPicker::paint (juce::Graphics& g)
     g.fillRect (0, 0, getWidth(), headerHeight);
     g.setColour (colour::border);
     g.fillRect (0, headerHeight - 1, getWidth(), 1);
-    g.setColour (colour::textSecondary);
-    g.setFont (font (type::small, true));
-    g.drawText (theme::caps (tr ("Picker")), 10, 0, getWidth() - 20, headerHeight, juce::Justification::centredLeft);
 
-    for (int i = scroll; i < (int) list.size(); ++i)
+    // the three tabs: patterns, audio clips, automation clips
+    const Icon tabIcons[] = { Icon::pattern, Icon::audioFile, Icon::automate };
+    for (int t = 0; t < 3; ++t)
     {
-        const auto y = headerHeight + (i - scroll) * rowHeight;
-
-        if (y > getHeight())
-            break;
+        const auto r = tabBounds (t).toFloat();
+        if (t == view || t == hoverTab)
+        {
+            g.setColour (t == view ? colour::bg5 : colour::bg4);
+            g.fillRoundedRectangle (r, radius::sm);
+        }
+        icons::draw (g, tabIcons[t], r.withSizeKeepingCentre (16.0f, 16.0f), t == view ? colour::accent : t == hoverTab ? colour::textPrimary : colour::textSecondary);
+    }
 
-        const auto& row = list[(std::size_t) i];
+    {
+        juce::Graphics::ScopedSaveState state (g);
+        g.reduceClipRegion (0, headerHeight, getWidth(), listBottom() - headerHeight);
 
-        if (row.index < 0) // section title
+        for (int i = scroll; i < (int) list.size(); ++i)
         {
-            g.setColour (colour::textDisabled);
-            g.setFont (font (type::caption, true));
-            g.drawText (theme::caps (row.name), 10, y, getWidth() - 20, rowHeight - 3, juce::Justification::bottomLeft);
-            continue;
-        }
+            const auto y = headerHeight + (i - scroll) * rowHeight;
+
+            if (y > listBottom())
+                break;
+
+            const auto& row = list[(std::size_t) i];
+            const auto r = juce::Rectangle<int> (4, y + 2, getWidth() - 8, rowHeight - 4);
+            const auto current = row.kind == ClipKind::pattern ? (playlist.brush.kind == ClipKind::pattern && row.index == song.currentPattern)
+                                                               : (playlist.brush.kind == row.kind && playlist.brush.index == row.index);
+            const auto rowColour = tame (row.colour);
+            const auto box = r.toFloat();
+            auto fill = rowColour.interpolatedWith (colour::bg3, current ? 0.25f : 0.55f);
+            if (i == hoverRow && ! current)
+                fill = fill.interpolatedWith (colour::bg5, 0.35f);
+            g.setColour (fill);
+            g.fillRoundedRectangle (box, radius::sm);
+
+            // a faint miniature of the pattern's notes behind the name (FL's picker shows the same)
+            if (row.kind == ClipKind::pattern && row.index < (int) song.patterns.size())
+            {
+                const auto& pattern = song.patterns[(std::size_t) row.index];
+                if (! pattern.notes.empty())
+                {
+                    int low = 127, high = 0;
+                    for (const auto& n : pattern.notes)
+                    {
+                        low = juce::jmin (low, n.key);
+                        high = juce::jmax (high, n.key);
+                    }
+                    const auto body = box.reduced (3.0f, 3.0f);
+                    const auto span = (float) juce::jmax (6, high - low + 2);
+                    const auto length = (double) juce::jmax<std::int64_t> (1, pattern.effectiveLength (song.beatsPerBar));
+                    g.setColour (clipContentColour (rowColour).withAlpha (0.35f));
+                    for (const auto& n : pattern.notes)
+                    {
+                        const auto nx = body.getX() + (float) (n.start / length) * body.getWidth();
+                        const auto nw = juce::jmax (1.5f, (float) (n.length / length) * body.getWidth());
+                        const auto ny = body.getBottom() - ((float) (n.key - low) + 1.0f) / span * body.getHeight();
+                        g.fillRect (nx, ny, juce::jmin (nw, body.getRight() - nx), 1.5f);
+                    }
+                }
+            }
 
-        const auto r = juce::Rectangle<int> (4, y + 2, getWidth() - 8, rowHeight - 4);
-        const auto current = row.kind == ClipKind::pattern ? (playlist.brush.kind == ClipKind::pattern && row.index == song.currentPattern)
-                                                           : (playlist.brush.kind == row.kind && playlist.brush.index == row.index);
-        const auto rowColour = tame (row.colour);
-        const auto box = r.toFloat();
-        g.setColour (current ? rowColour.interpolatedWith (colour::bg3, 0.35f) : colour::bg3);
-        g.fillRoundedRectangle (box, radius::sm);
+            if (current) // the current source: the accent strip
+            {
+                g.setColour (colour::accent);
+                g.fillRoundedRectangle (box.withWidth (3.0f), 1.5f);
+            }
 
-        // colour swatch on the left; the current row gets the accent strip instead
-        g.setColour (current ? colour::accent : rowColour);
-        g.fillRoundedRectangle (box.withWidth (3.0f), 1.5f);
+            g.setColour (clipTitleText (fill));
+            g.setFont (font (type::small, current));
+            g.drawText (row.name, r.withTrimmedLeft (9).withTrimmedRight (4), juce::Justification::centredLeft, true);
+        }
+    }
 
-        g.setColour (current ? clipTitleText (rowColour.interpolatedWith (colour::bg3, 0.35f)) : colour::textPrimary.withAlpha (0.85f));
-        g.setFont (font (type::small, current));
-        g.drawText (row.name, r.withTrimmedLeft (10).withTrimmedRight (4), juce::Justification::centredLeft, true);
+    if (const auto add = addBounds(); ! add.isEmpty())
+    {
+        g.setColour (hoverAdd ? colour::bg4 : colour::bg3);
+        g.fillRoundedRectangle (add.toFloat(), radius::sm);
+        icons::draw (g, Icon::plus, add.toFloat().withSizeKeepingCentre (14.0f, 14.0f), hoverAdd ? colour::textPrimary : colour::textSecondary);
     }
 
     g.setColour (colour::border);
@@ -3607,18 +3932,36 @@ void PatternPicker::paint (juce::Graphics& g)
 
 void PatternPicker::mouseDown (const juce::MouseEvent& e)
 {
+    for (int t = 0; t < 3; ++t)
+        if (tabBounds (t).contains (e.getPosition()))
+        {
+            setView (t);
+            return;
+        }
+
+    if (addBounds().contains (e.getPosition()))
+    {
+        if (onNewPattern)
+            onNewPattern();
+        return;
+    }
+
     const auto list = rows();
     const auto i = rowAt (e.y);
 
-    if (i < 0 || list[(std::size_t) i].index < 0)
+    if (i < 0)
         return;
 
     const auto& row = list[(std::size_t) i];
     playlist.brush = { row.kind, row.index };
+    seenBrush = row.kind;
 
     if (row.kind == ClipKind::pattern && row.index != engine.getSong().currentPattern)
         engine.editSong ([p = row.index] (Song& s) { s.currentPattern = p; }, false);
 
+    if (e.mods.isPopupMenu() && row.kind == ClipKind::pattern && onPatternMenu)
+        onPatternMenu();
+
     repaint();
 }
 
@@ -3627,14 +3970,70 @@ void PatternPicker::mouseDoubleClick (const juce::MouseEvent& e)
     const auto list = rows();
     const auto i = rowAt (e.y);
 
-    if (i >= 0 && list[(std::size_t) i].kind == ClipKind::pattern && list[(std::size_t) i].index >= 0 && onOpenPattern)
+    if (i >= 0 && list[(std::size_t) i].kind == ClipKind::pattern && onOpenPattern)
         onOpenPattern();
 }
 
+void PatternPicker::mouseMove (const juce::MouseEvent& e)
+{
+    int tab = -1;
+    for (int t = 0; t < 3; ++t)
+        if (tabBounds (t).contains (e.getPosition()))
+            tab = t;
+    const auto row = rowAt (e.y);
+    const auto add = addBounds().contains (e.getPosition());
+
+    if (tab != hoverTab || row != hoverRow || add != hoverAdd)
+    {
+        hoverTab = tab;
+        hoverRow = row;
+        hoverAdd = add;
+        repaint();
+    }
+}
+
+void PatternPicker::mouseExit (const juce::MouseEvent&)
+{
+    hoverTab = hoverRow = -1;
+    hoverAdd = false;
+    repaint();
+}
+
+ui::Hint PatternPicker::hintAt (juce::Point<int> p)
+{
+    ui::Hint hint;
+    const char* tabs[] = { TR_NOOP ("Picker: patterns"), TR_NOOP ("Picker: audio clips"), TR_NOOP ("Picker: automation clips") };
+
+    for (int t = 0; t < 3; ++t)
+        if (tabBounds (t).contains (p))
+        {
+            hint.text = tr (tabs[t]) + "  " + tr ("[LMB] show");
+            return hint;
+        }
+
+    if (addBounds().contains (p))
+    {
+        hint.text = tr ("New pattern");
+        return hint;
+    }
+
+    const auto list = rows();
+    if (const auto i = rowAt (p.y); i >= 0)
+    {
+        hint.value = list[(std::size_t) i].name;
+        hint.text = list[(std::size_t) i].kind == ClipKind::pattern
+                        ? tr ("Pattern: [LMB] paint it with the pencil  [2xLMB] open  [RMB] menu")
+                        : tr ("Clip source: [LMB] paint it with the pencil");
+        hint.hasMenu = list[(std::size_t) i].kind == ClipKind::pattern;
+    }
+
+    return hint;
+}
+
 void PatternPicker::mouseWheelMove (const juce::MouseEvent&, const juce::MouseWheelDetails& wheel)
 {
     const auto rows = (int) this->rows().size();
-    const auto visible = juce::jmax (1, (getHeight() - headerHeight) / rowHeight);
+    const auto visible = juce::jmax (1, (listBottom() - headerHeight) / rowHeight);
     scroll = juce::jlimit (0, juce::jmax (0, rows - visible), scroll - (int) std::round (wheel.deltaY * 6.0f));
     repaint();
 }

+ 36 - 8
src/ui/PlaylistComponent.h

@@ -31,8 +31,10 @@ namespace lynx
 //  - the clip under the mouse is outlined, its edges show grips and its title strip a menu button; the
 //    cursor and the hint bar tell what a click would do (core/EditorGestures.h)
 //  - right click on a clip's name strip (or its menu button) opens its menu (split, make unique, etc.)
-//  - track header: LED mutes the track (Ctrl+click or right-click on it: solo); right click elsewhere opens
-//    the track menu; double click renames; Shift+wheel moves the track up / down
+//  - track header (FL's layout: name, group arrow, LED on the right): click selects the track, the LED mutes it
+//    (Ctrl+click or right-click on it: solo), the arrow of a group header folds / unfolds its group; right
+//    click elsewhere opens the track menu (FL's order); double click opens the source of the track's first
+//    clip; Shift+wheel moves the track up / down. Grouped tracks are indented under their header (REA round 104)
 //  - keys (via handleKey): Delete, Backspace (global grid on/off), Ctrl+A/C/X/V, Ctrl+B (repeats the
 //    time selection when there is one), Ctrl+Ins / Ctrl+Del insert / remove the time selection, Esc
 class PlaylistComponent final : public juce::Component,
@@ -116,6 +118,8 @@ public:
     static constexpr int rulerTop = toolbarHeight + overviewHeight;
     static constexpr int headerHeight = rulerTop + timelineHeight;
     static constexpr int trackHeight = 38; // the default row height (each track can be resized: P18)
+    static constexpr int foldedHeight = 7; // a member of a collapsed group: a thin row of clip bars (as FL)
+    static constexpr int groupIndent = 8;  // grouped tracks' headers are indented under their group header
     static constexpr int scrollBarSize = 12;
 
     static juce::Colour patternColour (const Song& song, int pattern);
@@ -191,6 +195,11 @@ private:
     void renameArrangement();
     void renameTrack (int track);
     void showTrackMenu (int track);
+    void openClipSource (int clip, bool other); // double click: the clip's pattern / automation (Alt: the other editor)
+    juce::Rectangle<int> trackLed (int track) const;   // the mute LED on the right of a header
+    juce::Rectangle<int> trackArrow (int track) const; // a group header's fold arrow (empty for other tracks)
+    void editTrack (int track, std::function<void (PlaylistTrack&)> change);
+    int currentTrack = -1; // the track selected by a click on its header (FL marks it next to the LED)
 
     AudioEngine& engine;
     juce::ScrollBar hBar { false }, vBar { true }; // hBar is hidden: the overview strip scrolls sideways
@@ -245,11 +254,12 @@ private:
     {
         int clip = -1, track = -1;
         gesture::Target target = gesture::Target::empty;
-        bool header = false, led = false;
+        bool header = false, led = false, arrow = false;
         int divider = -1; // the track whose bottom edge in the headers is under the mouse (resizes it)
         bool operator== (const Hover& o) const
         {
-            return clip == o.clip && track == o.track && target == o.target && header == o.header && led == o.led && divider == o.divider;
+            return clip == o.clip && track == o.track && target == o.target && header == o.header && led == o.led && arrow == o.arrow
+                   && divider == o.divider;
         }
     };
     Hover hover;
@@ -278,9 +288,11 @@ private:
 
     JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PlaylistComponent)
 };
-// Playlist "Picker" (as in FL): list of patterns with their colors; clicking chooses the
-// pattern the Playlist pencil paints; double click opens it in the Channel Rack.
+// Playlist "Picker" (as in FL): three tabs at the top (patterns, audio clips, automation clips) and the list
+// of that kind; clicking chooses what the Playlist pencil paints, double click opens a pattern; right click on
+// a pattern opens the pattern menu; "+" at the bottom of the pattern list adds a pattern (REA round 104).
 class PatternPicker final : public juce::Component,
+                            public ui::HintSource,
                             private juce::ChangeListener
 {
 public:
@@ -291,27 +303,43 @@ public:
     void mouseDown (const juce::MouseEvent& e) override;
     void mouseDoubleClick (const juce::MouseEvent& e) override;
     void mouseWheelMove (const juce::MouseEvent& e, const juce::MouseWheelDetails& wheel) override;
+    void mouseMove (const juce::MouseEvent& e) override;
+    void mouseExit (const juce::MouseEvent& e) override;
+    ui::Hint hintAt (juce::Point<int> position) override;
 
     std::function<void()> onOpenPattern;
+    std::function<void()> onPatternMenu; // right click on a pattern (it is the current one by then)
+    std::function<void()> onNewPattern;  // the "+" under the pattern list
     static constexpr int width = 150;
 
+    // the kind listed: 0 = patterns, 1 = audio clips, 2 = automation clips
+    void setView (int newView);
+    int getView() const noexcept { return view; }
+
 private:
     void changeListenerCallback (juce::ChangeBroadcaster*) override;
 
     struct Row
     {
         ClipKind kind;
-        int index;            // pattern, audio or automation channel; -1 = section title
+        int index;            // pattern, audio or automation channel
         juce::String name;
         juce::Colour colour;
     };
     std::vector<Row> rows() const;
     int rowAt (int y) const;
+    juce::Rectangle<int> tabBounds (int tab) const;
+    juce::Rectangle<int> addBounds() const; // the "+" (pattern view only)
+    int listBottom() const;
 
     AudioEngine& engine;
     PlaylistComponent& playlist;
+    int view = 0;
+    ClipKind seenBrush = ClipKind::pattern; // the list follows the pencil's kind when it changes elsewhere
     int scroll = 0; // in rows
-    static constexpr int rowHeight = 22, headerHeight = 24;
+    int hoverTab = -1, hoverRow = -1;
+    bool hoverAdd = false;
+    static constexpr int rowHeight = 28, headerHeight = 26, footerHeight = 22;
 };
 
 // The Playlist tab: the Picker on the left and the Playlist (does not own them).

+ 77 - 57
src/ui/PluginEditors.cpp

@@ -15,6 +15,11 @@
 #include "core/ParametricEqFl.h"
 #include "core/VocalPitch.h"
 #include "core/PluginLayout.h"
+#include "core/StateParams.h"
+#include "core/ConvolverFx.h"
+#include "core/EquoFx.h"
+#include "core/MultibandDelayFx.h"
+#include "core/Vocodex.h"
 #include "engine/Text.h"
 #include "ui/DynamicsDisplays.h"
 #include "ui/I18n.h"
@@ -70,7 +75,9 @@ public:
         }
 
         page = initialPage;
-        if (stateBacked() && initialPage == 0)
+        if (kind == EffectKind::equo && initialPage == 0)
+            page = 3; // bank 1, volume (FL opens EQUO on its first bank)
+        if (kind == EffectKind::maximus && stateBacked() && initialPage == 0)
             if (const auto* fx = current())
                 page = maximusfx::selectedBand (fx->state); // FL reopens Maximus on the band selected when it was saved
         engine.addChangeListener (this);
@@ -129,7 +136,7 @@ public:
     bool visible (const LayoutItem& item) const
     {
         const auto* fx = current();
-        return fx != nullptr && plugui::isShown (kind, item, page, fx->params);
+        return fx != nullptr && plugui::isShown (kind, item, page, fx->params, &fx->state);
     }
 
     // the knob's circle inside its cell (the caption takes the rest)
@@ -156,7 +163,8 @@ public:
                 continue;
             if (item.type == Item::display && rectOf (item).contains (p) && (juce::String (item.display) == "eq" || juce::String (item.display) == "xy"
                                                                     || juce::String (item.display) == "sgamount" || juce::String (item.display) == "sgpresets"
-                                                                    || juce::String (item.display) == "prismbands" || juce::String (item.display) == "emberbands"))
+                                                                    || juce::String (item.display) == "prismbands" || juce::String (item.display) == "emberbands"
+                                                                    || isBars (item)))
                 return i;
             if (item.type == Item::display || (item.param == nullptr && ! hasStyle (item, plugui::pageTabs)))
                 continue;
@@ -170,46 +178,33 @@ public:
 
     // --- values --------------------------------------------------------------------------------------
 
-    // Maximus: the controls edit the parameters stored in the slot's state (core/MaximusFx.h), not EffectSlot::params
+    // Controls stored in the slot's state (core/StateParams.h: Maximus' bands, Delay Bank's banks, band tables...)
+    // edit those bytes instead of EffectSlot::params
     bool stateBacked() const { return plugui::usesStateParams (kind) && layout != &plugui::soundgoodizerLayout(); }
-
-    static float stateNormalised (int param, int raw)
-    {
-        const auto& p = maximusfx::stateParams()[(std::size_t) param];
-        return p.maximum > p.minimum ? (float) (raw - p.minimum) / (float) (p.maximum - p.minimum) : 0.0f;
-    }
-
-    static int stateRaw (int param, float value)
-    {
-        const auto& p = maximusfx::stateParams()[(std::size_t) param];
-        return p.minimum + juce::roundToInt (juce::jlimit (0.0f, 1.0f, value) * (float) (p.maximum - p.minimum));
-    }
+    bool isStateParam (int param) const { return stateBacked() && plugui::stateIndex (kind, param) >= 0; }
+    const stateparams::Table& stateTable() const { return *stateparams::tableFor (kind); }
 
     float valueOf (int param) const
     {
         const auto* fx = current();
-        if (stateBacked())
-        {
-            if (fx == nullptr || param < 0 || param >= plugui::paramCount (kind))
-                return 0.0f;
-            const auto raw = maximusfx::stateParam (fx->state, param);
-            return stateNormalised (param, raw.value_or (maximusfx::stateParams()[(std::size_t) param].defaultValue));
-        }
+        if (isStateParam (param))
+            return fx != nullptr ? plugui::stateValue01 (kind, param, fx->state) : 0.0f;
         return fx != nullptr && param >= 0 && param < maxEffectParams ? fx->params[(std::size_t) param] : 0.0f;
     }
 
     void setValue (int param, float value)
     {
-        if (stateBacked())
+        if (isStateParam (param))
         {
             const auto* fx = current();
-            if (fx == nullptr || param < 0 || param >= plugui::paramCount (kind))
+            if (fx == nullptr)
                 return;
-            const auto raw = stateRaw (param, value);
-            if (maximusfx::stateParam (fx->state, param) == raw)
+            const auto s = plugui::stateIndex (kind, param);
+            const auto raw = plugui::stateRaw (kind, param, value);
+            if (stateTable().get (fx->state, s) == raw)
                 return;
-            engine.editSong ([t = track, s = slot, bytes = maximusfx::withStateParam (fx->state, param, raw)] (Song& song) {
-                song.mixer[(std::size_t) t].effects[(std::size_t) s].state = bytes;
+            engine.editSong ([t = track, sl = slot, bytes = stateTable().with (fx->state, s, raw)] (Song& song) {
+                song.mixer[(std::size_t) t].effects[(std::size_t) sl].state = bytes;
             });
             return;
         }
@@ -225,8 +220,8 @@ public:
         const auto* fx = current();
         if (fx == nullptr || param < 0)
             return {};
-        if (stateBacked())
-            return param < plugui::paramCount (kind) ? utf8 (maximusfx::stateParamText (param, stateRaw (param, value)).c_str()) : juce::String();
+        if (isStateParam (param))
+            return utf8 (stateTable().text (fx->state, plugui::stateIndex (kind, param), plugui::stateRaw (kind, param, value)).c_str());
         return utf8 (formatEffectParam (kind, param, value, engine.getSong().bpm, fx->params).c_str());
     }
 
@@ -245,19 +240,19 @@ public:
         const auto param = paramOf (item);
         const auto& info = effectInfo (kind);
 
-        if (stateBacked())
+        if (isStateParam (param))
         {
             // not automatable (the values live in the state): drag, wheel, reset and type-in only
-            if (param < 0 || param >= plugui::paramCount (kind))
-                return spec;
-            const auto& p = maximusfx::stateParams()[(std::size_t) param];
-            spec.name = trackName() + " - " + utf8 (info.name) + " - " + utf8 (p.name);
-            spec.defaultValue = stateNormalised (param, p.defaultValue);
-            spec.pixelsForRange = item.type == Item::hslider ? juce::jmax (60.0, (double) rectOf (item).getWidth()) : 180.0;
+            const auto& p = stateTable().params[(std::size_t) plugui::stateIndex (kind, param)];
+            spec.name = trackName() + " - " + utf8 (info.name) + " - " + utf8 (p.name.c_str());
+            spec.defaultValue = p.maximum > p.minimum ? (double) (p.defaultValue - p.minimum) / (double) (p.maximum - p.minimum) : 0.0;
+            spec.pixelsForRange = item.type == Item::hslider ? juce::jmax (60.0, (double) rectOf (item).getWidth())
+                                  : item.type == Item::vslider ? juce::jmax (60.0, (double) rectOf (item).getHeight())
+                                                               : 180.0;
             if (item.steps > 0)
                 spec.interval = 1.0 / item.steps;
-            else if (p.maximum - p.minimum <= 8)
-                spec.interval = 1.0 / (p.maximum - p.minimum);
+            else if (p.maximum - p.minimum <= 16)
+                spec.interval = 1.0 / juce::jmax (1, p.maximum - p.minimum);
             spec.toText = [this, param] (double v) { return valueText (param, (float) v); };
             spec.fromText = ui::inverseOf (spec.toText, 0.0, 1.0);
             return spec;
@@ -423,6 +418,11 @@ public:
                 break;
 
             case Item::value:
+                if (hasStyle (item, plugui::boxed)) // a read-out plate (FL's value boxes)
+                {
+                    g.setColour (colour::bg0);
+                    g.fillRoundedRectangle (r, radius::sm * s);
+                }
                 g.setColour (hot ? colour::accent : (fx.enabled ? colour::textPrimary : colour::textDisabled));
                 g.setFont (font (juce::jmax (8.0f, 11.0f * s)));
                 g.drawFittedText (valueText (param, value), r.toNearestInt(),
@@ -567,7 +567,8 @@ public:
             {
                 const auto labels = plugui::optionLabels (item);
                 const auto texts = optionTexts (item);
-                const auto chosen = hasStyle (item, plugui::pageTabs) ? page : plugui::optionAt (item, value);
+                const auto chosen = hasStyle (item, plugui::pageTabs) ? (item.steps > 0 ? (page / item.steps) % juce::jmax (1, (int) labels.size()) : page)
+                                                                      : plugui::optionAt (item, value);
                 const auto vertical = isVertical (item);
                 const auto count = (float) juce::jmax (1, (int) labels.size());
                 const auto w = vertical ? r.getWidth() : r.getWidth() / count;
@@ -601,7 +602,7 @@ public:
 
             case Item::toggle:
             {
-                const auto on = value >= 0.5f;
+                const auto on = (value >= 0.5f) != hasStyle (item, plugui::inverted);
                 if (hasStyle (item, plugui::boxed)) // a small lit button with its letter (FL's T / L buttons)
                 {
                     g.setColour (on ? (fx.enabled ? colour::accent : colour::textSecondary) : (hot ? colour::bg6 : colour::bg5));
@@ -1271,6 +1272,9 @@ public:
                 return 0.5f + 0.5f * juce::jlimit (-1.0f, 1.0f, mixsuite::ember::shape (style, (x * 2.0f - 1.0f) * drive) * norm);
             }, inner, false);
         }
+        else if (paintFxDisplay (g, id, item, inner, fx))
+        {
+        }
         else // a plain well with the plugin's name (FL's scopes / animations are not reproduced)
         {
             g.setColour (colour::bg2);
@@ -1286,6 +1290,8 @@ public:
         }
     }
 
+#include "ui/PluginEditorsFx.inc"
+
     // --- Gross Beat: the selected slots' envelopes ------------------------------------------------------
 
     void paintGrossBeat (juce::Graphics& g, const juce::String& id, juce::Rectangle<float> r, const EffectSlot& fx)
@@ -1680,7 +1686,11 @@ public:
         {
             const auto n = juce::jmax (1, (int) plugui::optionLabels (item).size());
             const auto along = isVertical (item) ? (e.position.y - r.getY()) / r.getHeight() : (e.position.x - r.getX()) / r.getWidth();
-            page = juce::jlimit (0, n - 1, (int) (along * (float) n));
+            const auto o = juce::jlimit (0, n - 1, (int) (along * (float) n));
+            if (item.steps > 0) // one digit of the page (EQUO: target ×1, bank ×3)
+                page += (o - (page / item.steps) % n) * item.steps;
+            else
+                page = o;
             hoverItem = -1;
             repaint();
             return;
@@ -1724,6 +1734,13 @@ public:
             xyMouse (e, item);
             return;
         }
+        if (isBars (item))
+        {
+            dragItem = index;
+            barsDragging = true;
+            barsMouse (e, item, true);
+            return;
+        }
         if (item.type == Item::display) // the EQ graph
         {
             if (eqMouseDown (e, item) && eqDragging)
@@ -1841,6 +1858,11 @@ public:
             xyMouse (e, activeLayout().items[(std::size_t) dragItem]);
             return;
         }
+        if (barsDragging && dragItem >= 0)
+        {
+            barsMouse (e, activeLayout().items[(std::size_t) dragItem], false);
+            return;
+        }
         if (dragItem < 0 || ! drag.isActive())
             return;
         const auto& item = activeLayout().items[(std::size_t) dragItem];
@@ -1867,9 +1889,9 @@ public:
             dragItem = -1;
             ui::hideValueTip();
         }
-        if (xyDragging || sgDragging)
+        if (xyDragging || sgDragging || barsDragging)
         {
-            xyDragging = sgDragging = false;
+            xyDragging = sgDragging = barsDragging = false;
             dragItem = -1;
             ui::hideValueTip();
         }
@@ -2055,21 +2077,19 @@ public:
         menu.addItem (tr ("Reset to defaults"), [this] {
             const auto& info = effectInfo (kind);
             presetName = {};
+            auto bytes = current() != nullptr ? current()->state : std::vector<std::uint8_t> {};
             if (stateBacked())
             {
-                if (const auto* fx = current())
-                {
-                    auto bytes = fx->state;
-                    for (int p = 0; p < plugui::paramCount (kind); ++p)
-                        bytes = maximusfx::withStateParam (bytes, p, maximusfx::stateParams()[(std::size_t) p].defaultValue);
-                    engine.editSong ([t = track, s = slot, bytes] (Song& song) { song.mixer[(std::size_t) t].effects[(std::size_t) s].state = bytes; });
-                }
-                return;
+                const auto& table = stateTable();
+                for (int p = 0; p < (int) table.params.size(); ++p)
+                    bytes = table.with (bytes, p, table.params[(std::size_t) p].defaultValue);
             }
-            engine.editSong ([t = track, s = slot, info] (Song& song) {
-                auto& params = song.mixer[(std::size_t) t].effects[(std::size_t) s].params;
-                for (std::size_t i = 0; i < info.params.size() && i < params.size(); ++i)
-                    params[i] = info.params[i].defaultValue;
+            engine.editSong ([t = track, s = slot, info, bytes, state = stateBacked()] (Song& song) {
+                auto& fx = song.mixer[(std::size_t) t].effects[(std::size_t) s];
+                for (std::size_t i = 0; i < info.params.size() && i < fx.params.size(); ++i)
+                    fx.params[i] = info.params[i].defaultValue;
+                if (state)
+                    fx.state = bytes;
             });
         });
         // switches that FL keeps out of the panel (in its own menus): on / off here

+ 343 - 0
src/ui/PluginEditorsFx.inc

@@ -0,0 +1,343 @@
+// Displays of the round-105 arrangements (core/PluginLayoutFx.inc): included inside NativeEffectEditor's class body.
+// Band tables (EQUO, Multiband Delay) are drawn as bars and edited by dragging across them.
+
+    // --- band tables ------------------------------------------------------------------------------------
+
+    struct Bars
+    {
+        std::vector<int> params;           // the editor parameter of each bar (state controls)
+        std::vector<juce::String> labels;  // under each bar
+        bool bipolar = false;              // pan: drawn from the centre
+    };
+
+    Bars barsFor (const juce::String& id) const
+    {
+        Bars b;
+        const auto* fx = current();
+        if (fx == nullptr)
+            return b;
+        const auto plain = (int) effectInfo (kind).params.size();
+        if (id == "equobars")
+        {
+            // page digits: target ×1 (vol, pan, send), bank ×3 (M = the master bank 8, then 1…8)
+            const auto target = page % 3, option = (page / 3) % 9;
+            const auto bank = option == 0 ? equofx::numBanks - 1 : option - 1;
+            for (int band = 0; band < equofx::numBands; ++band)
+            {
+                b.params.push_back (plain + (bank * equofx::numBands + band) * equofx::numTargets + target);
+                const auto hz = 20.0 * std::pow (2.0, band / 3.0);
+                b.labels.push_back (band % 3 != 0 ? juce::String() : hz >= 1000.0 ? juce::String (hz / 1000.0, 2) + "k" : juce::String (juce::roundToInt (hz)));
+            }
+            b.bipolar = target == 1;
+        }
+        else if (id == "mbdbars")
+        {
+            const auto& table = stateTable();
+            const auto cells = mbdelay::numBanks * 48;
+            const auto target = juce::jlimit (0, 2, table.get (fx->state, cells).value_or (0));
+            const auto bank = juce::jlimit (0, mbdelay::numBanks - 1, table.get (fx->state, cells + 1).value_or (mbdelay::numBanks - 1));
+            static const char* const freqs[16] { "31", "47", "71", "112", "172", "264", "413", "624", "958", "1.5k", "2.3k", "3.6k",
+                                                 "5.5k", "8.4k", "12.7k", "19.0k" };
+            for (int band = 0; band < mbdelay::numBands; ++band)
+            {
+                b.params.push_back (plain + bank * 48 + target * 16 + band);
+                b.labels.push_back (freqs[band]);
+            }
+            b.bipolar = target == 2;
+        }
+        return b;
+    }
+
+    static bool isBars (const LayoutItem& item)
+    {
+        return item.type == Item::display && item.display != nullptr
+               && (std::strcmp (item.display, "equobars") == 0 || std::strcmp (item.display, "mbdbars") == 0);
+    }
+
+    juce::Rectangle<float> barsArea (const LayoutItem& item) const
+    {
+        return rectOf (item).reduced (4.0f * scale()).withTrimmedBottom (14.0f * scale());
+    }
+
+    void paintBars (juce::Graphics& g, const LayoutItem& item, const EffectSlot& fx)
+    {
+        using namespace theme;
+        const auto s = scale();
+        const auto b = barsFor (item.display);
+        const auto area = barsArea (item);
+        const auto n = (int) b.params.size();
+        if (n == 0)
+            return;
+        const auto w = area.getWidth() / (float) n;
+        const auto c = fx.enabled ? colour::accent : colour::textDisabled;
+        for (int i = 0; i < n; ++i)
+        {
+            const auto cell = juce::Rectangle<float> (area.getX() + w * (float) i, area.getY(), w, area.getHeight()).reduced (1.0f, 0.0f);
+            g.setColour (colour::bg2);
+            g.fillRect (cell);
+            const auto v = valueOf (b.params[(std::size_t) i]);
+            const auto y = cell.getBottom() - cell.getHeight() * v;
+            const auto base = b.bipolar ? cell.getCentreY() : cell.getBottom();
+            g.setColour (c.withAlpha (0.25f));
+            g.fillRect (cell.withTop (juce::jmin (y, base)).withBottom (juce::jmax (y, base)));
+            g.setColour (c);
+            g.fillRect (cell.withTop (y - 1.5f * s).withHeight (3.0f * s));
+            g.setColour (colour::textSecondary);
+            g.setFont (font (juce::jmax (7.0f, 8.5f * s)));
+            g.drawFittedText (b.labels[(std::size_t) i], juce::Rectangle<float> (cell.getX() - 6.0f * s, area.getBottom() + 1.0f, cell.getWidth() + 12.0f * s, 12.0f * s).toNearestInt(),
+                              juce::Justification::centred, 1, 0.6f);
+        }
+        if (b.bipolar)
+        {
+            g.setColour (colour::gridBar);
+            g.drawHorizontalLine ((int) area.getCentreY(), area.getX(), area.getRight());
+        }
+    }
+
+    // drag across the bars: every bar the mouse passes takes the mouse's height (one edit per mouse event)
+    void barsMouse (const juce::MouseEvent& e, const LayoutItem& item, bool start)
+    {
+        const auto* fx = current();
+        const auto b = barsFor (item.display);
+        const auto area = barsArea (item);
+        if (fx == nullptr || b.params.empty())
+            return;
+        const auto n = (int) b.params.size();
+        const auto barAt = [&] (float x) { return juce::jlimit (0, n - 1, (int) ((x - area.getX()) / area.getWidth() * (float) n)); };
+        const auto v = juce::jlimit (0.0f, 1.0f, (area.getBottom() - e.position.y) / juce::jmax (1.0f, area.getHeight()));
+        const auto to = barAt (e.position.x);
+        const auto from = start ? to : barAt (barsLastX);
+        barsLastX = e.position.x;
+        auto bytes = fx->state;
+        const auto& table = stateTable();
+        for (int i = juce::jmin (from, to); i <= juce::jmax (from, to); ++i)
+        {
+            const auto p = b.params[(std::size_t) i];
+            bytes = table.with (bytes, plugui::stateIndex (kind, p), plugui::stateRaw (kind, p, v));
+        }
+        if (bytes != fx->state)
+            engine.editSong ([t = track, sl = slot, bytes] (Song& song) { song.mixer[(std::size_t) t].effects[(std::size_t) sl].state = bytes; });
+        ui::showValueTip (*this, rectOf (item).toNearestInt(), valueText (b.params[(std::size_t) to], v));
+    }
+
+    float barsLastX = 0.0f;
+    bool barsDragging = false;
+
+    // --- the other displays -----------------------------------------------------------------------------
+
+    // true = drawn (id is one of round 105's displays)
+    bool paintFxDisplay (juce::Graphics& g, const juce::String& id, const LayoutItem& item, juce::Rectangle<float> inner, const EffectSlot& fx)
+    {
+        using namespace theme;
+        const auto s = scale();
+        const auto curveColour = fx.enabled ? colour::accent : colour::textDisabled;
+
+        if (id == "equobars" || id == "mbdbars")
+        {
+            paintBars (g, item, fx);
+            return true;
+        }
+        if (id == "vocbands") // Fruity Vocoder: one column per band (FL animates their levels; LYNX shows the bands)
+        {
+            const auto bands = 4 << juce::jlimit (0, 5, juce::roundToInt (param01 ("Bands") * 5.0f));
+            const auto shown = juce::jmin (bands, 32);
+            const auto w = inner.getWidth() / (float) shown;
+            for (int i = 0; i < shown; ++i)
+            {
+                const auto cell = juce::Rectangle<float> (inner.getX() + w * (float) i, inner.getY(), w, inner.getHeight()).reduced (1.0f, 0.0f);
+                g.setColour (colour::bg2);
+                g.fillRect (cell);
+                g.setColour (curveColour.withAlpha (0.8f));
+                g.fillRect (cell.withTop (cell.getY() + cell.getHeight() * 0.32f).withHeight (2.0f * s));
+            }
+            if (bands > shown)
+            {
+                g.setColour (colour::textSecondary);
+                g.setFont (font (juce::jmax (8.0f, 9.0f * s)));
+                g.drawText (juce::String (bands), inner.reduced (4.0f * s), juce::Justification::bottomRight);
+            }
+            return true;
+        }
+        if (id == "fsplit") // Frequency Splitter: the low / mid / high bands over 20 Hz…20 kHz at their levels
+        {
+            const auto fOf = [] (float v) { return 30.0 * std::pow (2.0, 9.0589 * v); };
+            static const int slopes[8] { 6, 12, 18, 24, 36, 48, 72, 96 };
+            const auto slopeOf = [] (float v) { return slopes[juce::jlimit (0, 7, (int) (v / 0.125f))]; };
+            const auto levelOf = [] (float v) { return v < 0.5f ? 2.0f * v : 1.0f + 13.8866f * (v - 0.5f); };
+            const auto xOf = [&] (double hz) { return (float) (std::log (juce::jlimit (20.0, 20000.0, hz) / 20.0) / std::log (1000.0)); };
+            const auto three = param01 ("3 bands") >= 0.5f;
+            auto f1 = fOf (param01 ("Low/mid freq.")), f2 = fOf (param01 ("Mid/high freq."));
+            const auto s1 = slopeOf (param01 ("Low/mid slope")), s2 = slopeOf (param01 ("Mid/high slope"));
+            g.setFont (font (juce::jmax (7.0f, 8.5f * s)));
+            for (const double hz : { 20.0, 50.0, 100.0, 200.0, 500.0, 1000.0, 2000.0, 5000.0, 10000.0 })
+            {
+                const auto x = inner.getX() + inner.getWidth() * xOf (hz);
+                g.setColour (colour::gridBeat);
+                g.drawVerticalLine ((int) x, inner.getY(), inner.getBottom());
+                g.setColour (colour::textDisabled);
+                g.drawText (hz >= 1000.0 ? juce::String (juce::roundToInt (hz / 1000.0)) + "k" : juce::String (juce::roundToInt (hz)),
+                            juce::Rectangle<float> (x + 2.0f * s, inner.getBottom() - 12.0f * s, 30.0f * s, 11.0f * s), juce::Justification::centredLeft);
+            }
+            g.setColour (colour::gridBar);
+            g.drawHorizontalLine ((int) inner.getCentreY(), inner.getX(), inner.getRight());
+            const auto dbAt = [] (double hz, double fc, int slope, bool low) {
+                const auto oct = std::log2 (hz / fc) * (low ? 1.0 : -1.0);
+                return oct <= 0.0 ? -3.0 * std::pow (2.0, oct * 2.0) : -3.0 - slope * oct; // a smooth knee at the crossover
+            };
+            const char* const levels[3] { "Low level", "Mid level", "High level" };
+            const juce::Colour colours[3] { juce::Colour (0xffe5383b), juce::Colour (0xffe8b631), juce::Colour (0xff5fd35a) };
+            for (int band = 0; band < (three ? 3 : 2); ++band)
+            {
+                const auto gainDb = 20.0 * std::log10 (juce::jmax (1.0e-4f, levelOf (param01 (levels[three ? band : band * 2]))));
+                strokeBand (g, inner, colours[three ? band : band * 2].withAlpha (fx.enabled ? 1.0f : 0.4f), [&] (double hz) {
+                    double db = 0.0;
+                    if (band == 0)
+                        db = dbAt (hz, f1, s1, true);
+                    else if (band == 1 && three)
+                        db = dbAt (hz, f1, s1, false) + dbAt (hz, f2, s2, true);
+                    else
+                        db = dbAt (hz, three ? f2 : f1, three ? s2 : s1, false);
+                    return (float) ((db + gainDb + 48.0) / 96.0); // ±48 dB
+                });
+            }
+            return true;
+        }
+        if (id == "psgraph") // Pitch Shifter (music page): the pitch as a line over the grid
+        {
+            grid8 (g, inner);
+            const auto y = inner.getBottom() - inner.getHeight() * param01 ("Pitch");
+            g.setColour (curveColour);
+            g.drawHorizontalLine ((int) y, inner.getX(), inner.getRight());
+            return true;
+        }
+        if (id == "vcxmap" || id == "vcxcarrier") // Vocodex: the band gain map (read-only) and the carrier
+        {
+            const auto st = vocodex::parseState (vocodex::splitInstallData (fx.state).first);
+            if (id == "vcxcarrier")
+            {
+                g.setColour (colour::textSecondary);
+                g.setFont (font (juce::jmax (8.0f, 10.0f * s)));
+                juce::String text = tr ("Carrier: own input");
+                if (st && st->internalCarrier())
+                    text = tr ("Carrier synthesizer") + ": " + (st->tone.empty() ? juce::String ("-") : juce::String (st->tone));
+                else if (st && st->carIn > 0)
+                    text = tr ("Carrier: side input {0}", { juce::String (st->carIn) });
+                g.drawText (text, inner, juce::Justification::centredLeft);
+                return true;
+            }
+            grid8 (g, inner);
+            g.setColour (colour::textDisabled);
+            g.setFont (font (juce::jmax (8.0f, 9.0f * s), true));
+            g.drawText (caps (tr ("Band gain multiplier")), inner.reduced (4.0f * s), juce::Justification::topLeft);
+            if (st && ! st->maps[0].x.empty())
+            {
+                const auto& m = st->maps[0];
+                const auto last = juce::jmax (1e-9, m.x.back());
+                juce::Path path;
+                for (std::size_t i = 0; i < m.x.size(); ++i)
+                {
+                    const juce::Point<float> pt { inner.getX() + inner.getWidth() * (float) (m.x[i] / last),
+                                                  inner.getBottom() - inner.getHeight() * (float) juce::jlimit (0.0, 1.0, m.y[i]) };
+                    if (i == 0)
+                        path.startNewSubPath (pt);
+                    else
+                        path.lineTo (pt);
+                    g.setColour (curveColour);
+                    g.drawEllipse (juce::Rectangle<float> (6.0f * s, 6.0f * s).withCentre (pt), 1.0f);
+                }
+                g.strokePath (path, juce::PathStrokeType (juce::jmax (1.5f, 2.0f * s)));
+            }
+            return true;
+        }
+        if (id == "irinfo" || id == "irwave") // Fruity Convolver: the impulse response
+        {
+            const auto ir = convolverAudio (fx);
+            if (id == "irinfo")
+            {
+                g.setColour (colour::textSecondary);
+                g.setFont (font (juce::jmax (8.0f, 10.0f * s)));
+                if (ir.l.empty())
+                    g.drawText (tr ("No impulse response"), inner, juce::Justification::centredLeft);
+                else
+                    g.drawText (juce::String (juce::roundToInt (ir.rate)) + " Hz    " + (ir.r.empty() ? tr ("Mono") : tr ("Stereo")) + "    "
+                                    + juce::String ((double) ir.l.size() / ir.rate, 3) + " s",
+                                inner, juce::Justification::centredLeft);
+                return true;
+            }
+            g.setColour (colour::gridBeat);
+            g.drawHorizontalLine ((int) inner.getCentreY(), inner.getX(), inner.getRight());
+            if (ir.l.empty())
+                return true;
+            const auto columns = juce::jmax (1, (int) inner.getWidth());
+            float peak = 1.0e-9f;
+            for (auto x : ir.l)
+                peak = juce::jmax (peak, std::abs (x));
+            g.setColour (curveColour.withAlpha (0.9f));
+            for (int c = 0; c < columns; ++c)
+            {
+                const auto a = ir.l.size() * (std::size_t) c / (std::size_t) columns, z = ir.l.size() * (std::size_t) (c + 1) / (std::size_t) columns;
+                float m = 0.0f;
+                for (auto i = a; i < z && i < ir.l.size(); ++i)
+                    m = juce::jmax (m, std::abs (ir.l[i]));
+                const auto h = inner.getHeight() * 0.5f * m / peak;
+                g.drawVerticalLine ((int) inner.getX() + c, inner.getCentreY() - h, inner.getCentreY() + h + 1.0f);
+            }
+            return true;
+        }
+        return false;
+    }
+
+    void grid8 (juce::Graphics& g, juce::Rectangle<float> area)
+    {
+        g.setColour (theme::colour::gridBeat);
+        for (int i = 1; i < 8; ++i)
+        {
+            g.drawVerticalLine ((int) (area.getX() + area.getWidth() * (float) i / 8.0f), area.getY(), area.getBottom());
+            g.drawHorizontalLine ((int) (area.getY() + area.getHeight() * (float) i / 8.0f), area.getX(), area.getRight());
+        }
+    }
+
+    template <typename F>
+    void strokeBand (juce::Graphics& g, juce::Rectangle<float> area, juce::Colour c, F yOfHz)
+    {
+        juce::Path p;
+        const auto steps = juce::jmax (32, (int) area.getWidth() / 2);
+        for (int i = 0; i <= steps; ++i)
+        {
+            const auto x = (float) i / (float) steps;
+            const auto hz = 20.0 * std::pow (1000.0, (double) x);
+            const auto y = juce::jlimit (0.0f, 1.0f, yOfHz (hz));
+            const juce::Point<float> pt { area.getX() + area.getWidth() * x, area.getBottom() - area.getHeight() * y };
+            if (i == 0)
+                p.startNewSubPath (pt);
+            else
+                p.lineTo (pt);
+        }
+        auto fill = p;
+        fill.lineTo (area.getRight(), area.getBottom());
+        fill.lineTo (area.getX(), area.getBottom());
+        fill.closeSubPath();
+        g.setColour (c.withAlpha (0.16f));
+        g.fillPath (fill);
+        g.setColour (c);
+        g.strokePath (p, juce::PathStrokeType (juce::jmax (1.5f, 2.0f * scale())));
+    }
+
+    // the impulse response of a Convolver slot, decoded once per state
+    const convolver::Audio& convolverAudio (const EffectSlot& fx)
+    {
+        if (fx.state != irState)
+        {
+            irState = fx.state;
+            irAudio = {};
+            std::vector<std::uint8_t> fl, file;
+            if (convolver::unpackBlob (fx.state, fl, file))
+                if (const auto st = convolver::parseState (fl))
+                    if (auto a = convolver::decodeAudio (st->fromFile ? file : st->wav))
+                        irAudio = std::move (*a);
+        }
+        return irAudio;
+    }
+
+    std::vector<std::uint8_t> irState;
+    convolver::Audio irAudio;

+ 214 - 0
tests/PanelsTests105.inc

@@ -0,0 +1,214 @@
+#include "core/EquoFx.h"
+#include "core/FruityDelayBank.h"
+#include "core/MultibandDelayFx.h"
+#include "core/StateParams.h"
+
+// --- round 105: FL arrangements of the remaining native plugin windows, state-backed controls ---------------------
+
+namespace panels105
+{
+// stereo noise (fixed seed), n frames
+inline std::vector<float> noise (int n, std::uint32_t seed)
+{
+    std::vector<float> v ((std::size_t) n);
+    for (auto& x : v)
+    {
+        seed = seed * 1664525u + 1013904223u;
+        x = ((float) (seed >> 8) / 16777216.0f - 0.5f) * 0.5f;
+    }
+    return v;
+}
+
+inline double energy (const std::vector<float>& l, const std::vector<float>& r)
+{
+    double e = 0.0;
+    for (std::size_t i = 0; i < l.size(); ++i)
+        e += (double) l[i] * l[i] + (double) r[i] * r[i];
+    return e;
+}
+} // namespace panels105
+
+TEST (state_params_delay_bank_round_trip)
+{
+    using namespace lynx;
+    const auto* table = stateparams::tableFor (EffectKind::fruityDelayBank);
+    CHECK (table != nullptr);
+    if (table == nullptr)
+        return;
+    CHECK (table->params.size() == 8u * 27u + 2u);
+    const auto state = fldbank::serialise (fldbank::defaultState());
+    const auto time = table->index ("B1 Time");
+    CHECK (time == 8);
+    CHECK (table->get (state, time).value_or (-1) == fldbank::defaultState().p[12]);
+    const auto edited = table->with (state, time, 960);
+    CHECK (table->get (edited, time).value_or (-1) == 960);
+    CHECK (fldbank::parse (edited)->p[12] == 960);
+    CHECK (table->get (table->with (state, time, 99999), time).value_or (-1) == 7680); // clamped
+    CHECK (table->text (edited, time, 1920) == "4.00 steps");                         // synced: one beat
+    const auto mode = table->index ("B2 Mode");
+    CHECK (mode == 27 + 16 + 5);
+    CHECK (table->get (table->with (state, mode, 3), mode).value_or (-1) == 3);
+    CHECK (fldbank::parse (table->with (state, mode, 3))->bank[1].mode == 3);
+    CHECK (table->text (state, mode, 3) == "Ping-pong");
+    CHECK (table->text (state, table->index ("Solo"), -1) == "None");
+    CHECK (table->text (state, table->index ("B1 Input pan"), -64) == "50% left");
+    CHECK (table->text (state, table->index ("B1 Filter 1 gain"), 128) == "+0.0 dB");
+    // editor indices: the four globals first, then the state controls
+    CHECK (plugui::paramIndex (EffectKind::fruityDelayBank, "Feedback") == 3);
+    CHECK (plugui::paramIndex (EffectKind::fruityDelayBank, "B1 Time") == 4 + 8);
+    CHECK (plugui::stateIndex (EffectKind::fruityDelayBank, 3) == -1);
+    CHECK (plugui::stateIndex (EffectKind::fruityDelayBank, 12) == 8);
+    CHECK (std::abs (plugui::stateValue01 (EffectKind::fruityDelayBank, 12, edited) - 960.0f / 7680.0f) < 1e-6f);
+    CHECK (plugui::stateRaw (EffectKind::fruityDelayBank, 12, 0.25f) == 1920);
+}
+
+TEST (state_params_band_tables)
+{
+    using namespace lynx;
+    // Multiband Delay: bank·48 + target·16 + band, then the editor's target and bank
+    const auto* mbd = stateparams::tableFor (EffectKind::multibandDelay);
+    CHECK (mbd != nullptr && mbd->params.size() == 8u * 48u + 2u);
+    const auto mstate = mbdelay::serialize (mbdelay::State {});
+    const auto cell = 2 * 48 + 1 * 16 + 5;
+    CHECK (mbd->index ("Bank 3 volume 6") == cell);
+    const auto m2 = mbd->with (mstate, cell, 1 << 29);
+    CHECK (mbdelay::parse (m2)->raw[(std::size_t) cell] == 1 << 29);
+    CHECK (mbd->text (m2, cell, 1 << 29) == "50%");
+    CHECK (mbd->text (m2, 2 * 48 + 2 * 16, 1 << 29) == "Centred");
+    CHECK (mbd->get (mbd->with (mstate, 8 * 48 + 1, 2), 8 * 48 + 1).value_or (-1) == 2);
+
+    // EQUO: (bank·31 + band)·3 + target, thousandths of FL's 0…2 cells
+    const auto* equo = stateparams::tableFor (EffectKind::equo);
+    CHECK (equo != nullptr && equo->params.size() == 9u * 31u * 3u);
+    CHECK (equo->index ("Master pan 1") == (8 * 31) * 3 + 1);
+    CHECK (equo->get ({ 1, 2, 3 }, 0) == std::nullopt); // not an EQUO state
+
+    // Convolver: the knobs of the FL state inside the slot blob
+    const auto* conv = stateparams::tableFor (EffectKind::convolver);
+    CHECK (conv != nullptr && conv->params.size() == 5u);
+    CHECK (conv->text ({}, 2, 1000) == "2.00x");
+    CHECK (conv->text ({}, 0, 0) == "0.0 ms");
+
+    // Maximus keeps its 59 controls at their old indices
+    CHECK (plugui::paramIndex (EffectKind::maximus, "Master release") == 7 + 13 * 3 + 9);
+}
+
+TEST (delay_bank_takes_state_edits_while_running)
+{
+    using namespace lynx;
+    // an edited bank control reaches the running engine (no rebuild); an option change asks for a new effect
+    auto state = fldbank::defaultState();
+    const auto bytes = fldbank::serialise (state);
+    auto fx = fldbank::make (bytes);
+    fx->prepare (44100.0);
+    auto slot = makeEffectSlot (EffectKind::fruityDelayBank);
+    constexpr int n = 512;
+    std::vector<float> l = panels105::noise (n, 1), r = panels105::noise (n, 2);
+    for (int b = 0; b < 40; ++b)
+    {
+        auto x = l, y = r;
+        fx->process (x.data(), y.data(), n, slot.params, 120.0);
+    }
+    const auto* table = stateparams::tableFor (EffectKind::fruityDelayBank);
+    // bank 1's output volume to 0: only the dry signal is left
+    auto quiet = table->with (bytes, table->index ("B1 Output volume"), 0);
+    CHECK (fx->acceptState (quiet));
+    CHECK (! fx->acceptState (table->with (quiet, table->index ("B1 Mode"), 3))); // previous one not taken yet
+    slot.params[0] = 0.0f; // dry off
+    double tail = 0.0;
+    for (int b = 0; b < 20; ++b)
+    {
+        auto x = l, y = r;
+        fx->process (x.data(), y.data(), n, slot.params, 120.0);
+        if (b >= 10)
+            tail += panels105::energy (x, y);
+    }
+    CHECK (tail < 1e-6 * panels105::energy (l, r));
+    CHECK (! fx->acceptState (table->with (quiet, table->index ("B1 Mode"), 3))); // an option: rebuild
+    CHECK (fx->acceptState (table->with (quiet, table->index ("B1 Time"), 480)));
+}
+
+TEST (band_table_effects_take_state_edits)
+{
+    using namespace lynx;
+    constexpr int n = 512;
+    const auto l = panels105::noise (n, 3), r = panels105::noise (n, 4);
+    // Multiband Delay: every volume cell of every bank at 0 → the wet path falls silent, mix fully wet
+    {
+        auto bytes = mbdelay::serialize (mbdelay::State {});
+        auto fx = mbdelay::make (bytes);
+        fx->prepare (44100.0);
+        auto slot = makeEffectSlot (EffectKind::multibandDelay);
+        slot.params[(std::size_t) plugui::paramIndex (EffectKind::multibandDelay, "Mix")] = 1.0f;
+        slot.params[(std::size_t) plugui::paramIndex (EffectKind::multibandDelay, "Feedback")] = 0.0f;
+        for (int b = 0; b < 8; ++b)
+        {
+            auto x = l, y = r;
+            fx->process (x.data(), y.data(), n, slot.params, 120.0);
+        }
+        const auto* table = stateparams::tableFor (EffectKind::multibandDelay);
+        for (int bank = 0; bank < 8; ++bank)
+            for (int band = 0; band < 16; ++band)
+                bytes = table->with (bytes, bank * 48 + 16 + band, 0);
+        CHECK (fx->acceptState (bytes));
+        double tail = 0.0;
+        for (int b = 0; b < 200; ++b)
+        {
+            auto x = l, y = r;
+            fx->process (x.data(), y.data(), n, slot.params, 120.0);
+            if (b >= 190)
+                tail += panels105::energy (x, y);
+        }
+        CHECK (tail < 1e-4 * panels105::energy (l, r));
+    }
+}
+
+TEST (round105_layouts_are_fl_arrangements)
+{
+    using namespace lynx;
+    for (const auto kind : { EffectKind::vocoder, EffectKind::frequencySplitter, EffectKind::fruityDelayBank, EffectKind::equo,
+                             EffectKind::multibandDelay, EffectKind::convolver })
+    {
+        CHECK (plugui::hasFlLayout (kind));
+        const auto& l = plugui::layoutFor (kind);
+        auto controls = 0;
+        for (const auto& item : l.items)
+            controls += plugui::isValueControl (item.type) && item.param != nullptr ? 1 : 0;
+        CHECK (controls >= 8);
+    }
+    // the Delay Bank's pages are its eight banks, each with its own controls
+    const auto& db = plugui::layoutFor (EffectKind::fruityDelayBank);
+    CHECK (db.pages.size() == 8u);
+    auto onBank3 = 0;
+    for (const auto& item : db.items)
+        if (item.page == 2 && item.param != nullptr && std::string (item.param).rfind ("B3 ", 0) == 0)
+            ++onBank3;
+    CHECK (onBank3 >= 20);
+}
+
+TEST (state_params_vocodex_in_place)
+{
+    using namespace lynx;
+    // the Default preset of the installation (skipped without the FL Data directory)
+    const auto file = std::filesystem::path (realFlpDir) / "Patches" / "Plugin presets" / "Effects" / "Vocodex" / "Default.fst";
+    if (realFlpDir.empty() || ! std::filesystem::exists (file))
+        return;
+    std::ifstream in (file, std::ios::binary);
+    const std::vector<std::uint8_t> bytes ((std::istreambuf_iterator<char> (in)), std::istreambuf_iterator<char>());
+    const auto fx = effectFromFlPreset (bytes);
+    CHECK (fx && fx->kind == EffectKind::vocodex);
+    if (! fx || fx->kind != EffectKind::vocodex)
+        return;
+    const auto* table = stateparams::tableFor (EffectKind::vocodex);
+    CHECK (table->get (fx->state, table->index ("Wet")).value_or (-1) == 1000);
+    CHECK (table->get (fx->state, table->index ("Bands")).value_or (-1) == 47);
+    CHECK (table->get (fx->state, table->index ("Draft")).value_or (-1) == 1);   // the field is 0 = Draft on
+    CHECK (table->get (fx->state, table->index ("From car")).value_or (-1) == 0);
+    auto edited = table->with (fx->state, table->index ("Bands"), 60);
+    edited = table->with (edited, table->index ("Draft"), 0);
+    edited = table->with (edited, table->index ("From car"), 1);
+    CHECK (edited.size() == fx->state.size());
+    const auto st = vocodex::parseState (vocodex::splitInstallData (edited).first);
+    CHECK (st && st->bands == 60 && ! st->draft() && st->fromCar);
+    CHECK (table->text (edited, table->index ("Mod pitch"), -1200) == "-1200 ct");
+}

+ 76 - 0
tests/UiFl104Tests.inc

@@ -0,0 +1,76 @@
+// Round 104 (docs/analise/REA_rodada104.md): Playlist track groups, the Channel Rack's filter groups.
+
+TEST (flui104_track_group_rules)
+{
+    lynx::Song song;
+    song.playlistTracks.resize (8);
+    // 1 = header of 2, 3; 5 = header of 6; 0, 4, 7 alone
+    lynx::noteedit::groupWithAbove (song, 2);
+    lynx::noteedit::groupWithAbove (song, 3);
+    lynx::noteedit::groupWithAbove (song, 6);
+    lynx::noteedit::groupWithAbove (song, 0); // track 0 can't join a group
+    CHECK (! song.playlistTracks[0].grouped);
+    CHECK (lynx::noteedit::isGroupHeader (song, 1) && lynx::noteedit::isGroupHeader (song, 5));
+    CHECK (! lynx::noteedit::isGroupHeader (song, 0) && ! lynx::noteedit::isGroupHeader (song, 2) && ! lynx::noteedit::isGroupHeader (song, 4));
+    CHECK (lynx::noteedit::groupHeaderOf (song, 3) == 1 && lynx::noteedit::groupHeaderOf (song, 1) == 1);
+    CHECK (lynx::noteedit::groupHeaderOf (song, 4) == -1 && lynx::noteedit::groupHeaderOf (song, 6) == 5);
+    CHECK ((lynx::noteedit::groupMembers (song, 1) == std::vector<int> { 2, 3 }));
+    CHECK (lynx::noteedit::groupMembers (song, 2).empty()); // a member is no header
+
+    // folding hides the members only
+    lynx::noteedit::setGroupCollapsed (song, 3, true); // any track of the group folds it
+    CHECK (song.playlistTracks[1].collapsed);
+    CHECK (lynx::noteedit::isFoldedAway (song, 2) && lynx::noteedit::isFoldedAway (song, 3));
+    CHECK (! lynx::noteedit::isFoldedAway (song, 1) && ! lynx::noteedit::isFoldedAway (song, 6));
+
+    // "Auto color group" gives the header's colour to the members
+    song.playlistTracks[5].colour = 0xFF123456u;
+    lynx::noteedit::colourGroup (song, 6);
+    CHECK (song.playlistTracks[6].colour == 0xFF123456u && song.playlistTracks[4].colour == 0);
+
+    // a member leaving its group: the members below it now hang from it (the flag model FL stores)
+    lynx::noteedit::ungroupTrack (song, 2);
+    CHECK (! song.playlistTracks[2].grouped && lynx::noteedit::groupHeaderOf (song, 3) == 2);
+    CHECK (! lynx::noteedit::isGroupHeader (song, 1));
+    lynx::noteedit::ungroupTrack (song, 1); // a header stays as it is
+    CHECK (! song.playlistTracks[1].grouped);
+}
+
+TEST (flui104_flp_track_groups_and_filter_groups)
+{
+    if (realFlpDir.empty())
+        return;
+
+    const auto path = std::filesystem::path (realFlpDir) / "Demo projects" / "Demo songs" / "Ookay - Thief.flp";
+    if (! std::filesystem::exists (path))
+        return;
+
+    std::ifstream in (path, std::ios::binary);
+    const std::vector<std::uint8_t> file ((std::istreambuf_iterator<char> (in)), {});
+    const auto project = flp::parseProject (file);
+    const auto song = lynx::importFlp (project);
+
+    // FL's groups in Thief: DRUMS (1..14), MELODICS (15..22), BASSES (23..26), VOCALS (27..35), FX (36..39); TEMPO alone
+    CHECK (song.playlistTracks.size() >= 40);
+    if (song.playlistTracks.size() >= 40)
+    {
+        CHECK (lynx::noteedit::isGroupHeader (song, 0) && lynx::noteedit::groupMembers (song, 0).size() == 13);
+        CHECK (lynx::noteedit::isGroupHeader (song, 22) && lynx::noteedit::groupMembers (song, 22).size() == 3);
+        CHECK (song.playlistTracks[23].name == "Synth Bass" && lynx::noteedit::groupHeaderOf (song, 23) == 22);
+        CHECK (lynx::noteedit::isGroupHeader (song, 26) && lynx::noteedit::isGroupHeader (song, 35));
+        CHECK (lynx::noteedit::groupHeaderOf (song, 39) == -1 && ! lynx::noteedit::isGroupHeader (song, 39)); // TEMPO
+        CHECK (! song.playlistTracks[22].collapsed); // the demo has every group open
+    }
+
+    // the Channel Rack's filter groups: Audio, Automation, Unsorted; Synth Bass is unsorted, the kick an audio channel
+    CHECK ((project.filterGroups == std::vector<std::string> { "Audio", "Automation", "Unsorted" }));
+    CHECK ((song.channelGroups == std::vector<std::string> { "Audio", "Automation", "Unsorted" }));
+    auto groupOf = [&song] (const char* name) {
+        for (const auto& c : song.channels)
+            if (c.name == name)
+                return c.group;
+        return -2;
+    };
+    CHECK (groupOf ("Synth Bass") == 2 && groupOf ("Piano Dark") == 2);
+    CHECK (groupOf ("Grv Kick 27") == 0 && groupOf ("Main Vox") == 0);
+}

+ 199 - 0
tests/VocalLevel107Tests.inc

@@ -0,0 +1,199 @@
+// --- round 107: vocals quieter than in FL (a Waves shell blacklisted by the plugin scan) -----------------------------
+
+#include "core/PluginScanPolicy.h"
+#include "core/PluginSubstitutes.h"
+
+TEST (plugin_scan_waits_longer_for_files_with_many_plugins)
+{
+    using namespace lynx::scanpolicy;
+    // one plugin (or an unknown count): the old 30 s
+    CHECK (timeoutMs (0) == 30000);
+    CHECK (timeoutMs (1) == 30000);
+    // a Waves shell (hundreds of classes, each created and initialised to be described) gets minutes, not 30 s
+    CHECK (timeoutMs (2) == 32000);
+    CHECK (timeoutMs (400) == 30000 + 399 * 2000);
+    CHECK (timeoutMs (400) > 10 * 60 * 1000);
+    // never unbounded
+    CHECK (timeoutMs (100000) == maxTimeoutMs);
+    CHECK (timeoutMs (1 << 30) == maxTimeoutMs);
+}
+
+namespace vocal107
+{
+// a project with Master, insert 1 → insert 2 → Master, and FL's route levels for both routes (0xE1)
+lynx::Song importRoutes (std::int32_t sendLevel, std::int32_t masterLevel)
+{
+    FlpBuilder b (96);
+    b.ascii (0xC7, "24.2.2.4646");
+    auto insert = [&b] (std::vector<std::uint8_t> routes) {
+        std::vector<std::uint8_t> params (12, 0);
+        params[4] = 0x08; // enabled
+        b.data (0xEC, params);
+        routes.resize (127, 0);
+        b.data (0xEB, routes);
+    };
+    insert ({});
+    insert ({ 0, 0, 1 });  // insert 1 → insert 2 only
+    insert ({ 1 });        // insert 2 → Master
+    std::vector<std::uint8_t> controls;
+    auto control = [&controls] (std::uint32_t id, std::int32_t value) {
+        for (auto v : { 0u, id, (std::uint32_t) value })
+            for (int k = 0; k < 4; ++k)
+                controls.push_back ((std::uint8_t) (v >> (8 * k)));
+    };
+    // FL 24.2 stores the mixer class as 0x2…, routes at 0x1F40 + destination (normalised on load)
+    control (0x20000000u + (1u << 22) + 0x1F40u + 2u, sendLevel);
+    control (0x20000000u + (2u << 22) + 0x1F40u, masterLevel);
+    b.data (0xE1, controls);
+    return lynx::importFlp (flp::parseProject (b.bytes));
+}
+} // namespace vocal107
+
+TEST (flp_route_levels_use_the_fader_curve_and_reach_plus_5_6_db)
+{
+    // REA_rodada107 §3 [EXEC]: FL renders of the user's song with the vocal route at 16000 / 12800 / 6400 differ by
+    // +5.6 / 0 / −12.7 dB, and the route to Master counts the same way. LYNX read 16000 as 100 % (0 dB) and 6400 as
+    // 50 % (−6 dB): her vocals, routed insert → FX insert → Master at 16000 each, came out 11 dB quieter than in FL.
+    auto db = [] (float g) { return 20.0f * std::log10 (g); };
+    const auto full = vocal107::importRoutes (16000, 16000);
+    CHECK (full.mixer.size() > 2 && full.mixer[1].sends.size() == 1 && full.mixer[1].sends[0].target == 2);
+    CHECK (! full.mixer[1].toMaster && full.mixer[2].toMaster);
+    CHECK (std::abs (db (full.mixer[1].sends[0].level) - 5.59f) < 0.02f);
+    CHECK (std::abs (db (full.mixer[2].masterLevel) - 5.59f) < 0.02f);
+    CHECK (std::abs (full.mixer[1].sends[0].level - lynx::maxFaderGain) < 1e-3f);
+
+    const auto unity = vocal107::importRoutes (12800, 12800);
+    CHECK (std::abs (unity.mixer[1].sends[0].level - 1.0f) < 1e-5f && std::abs (unity.mixer[2].masterLevel - 1.0f) < 1e-5f);
+
+    const auto low = vocal107::importRoutes (6400, 6400);
+    CHECK (std::abs (db (low.mixer[1].sends[0].level) - (-12.7f)) < 0.05f);
+    CHECK (std::abs (db (low.mixer[2].masterLevel) - (-12.7f)) < 0.05f);
+
+    // no level record: the route plays at 0 dB
+    const auto none = lynx::Song::defaultMixer (3);
+    CHECK (none[1].masterLevel == 1.0f);
+}
+
+TEST (mixer_route_to_master_level_and_hot_sends_are_rendered)
+{
+    // two channels of 0.5 DC on inserts 1 and 2 → 1.0 on Master; the route levels scale each path
+    CHECK (std::abs (renderMixerCase ([] (lynx::Song& s) { s.mixer[1].masterLevel = 0.5f; }) - 0.75f) < 1e-4f);
+    // insert 1 → insert 3 at +5.6 dB (FL's top), insert 1 not to Master
+    CHECK (std::abs (renderMixerCase ([] (lynx::Song& s) {
+                         s.setRoute (1, 3, true, lynx::maxFaderGain);
+                         s.setRoute (1, 0, false);
+                     }) - (0.5f + 0.5f * lynx::maxFaderGain)) < 1e-3f);
+    // the old 0..1 clamp is gone, but a send never exceeds the fader's top
+    lynx::Song s;
+    s.mixer = lynx::Song::defaultMixer (4);
+    s.setRoute (1, 2, true, 5.0f);
+    CHECK (s.mixer[1].sends.size() == 1 && std::abs (s.mixer[1].sends[0].level - lynx::maxFaderGain) < 1e-6f);
+}
+
+TEST (fader_position_inverts_fader_gain)
+{
+    for (float p : { 0.05f, 0.25f, 0.5f, 0.8f, 0.95f, 1.0f })
+        CHECK (std::abs (lynx::faderPosition (lynx::faderGain (p)) - p) < 1e-4f);
+    CHECK (lynx::faderPosition (0.0f) == 0.0f && lynx::faderPosition (-1.0f) == 0.0f);
+    CHECK (std::abs (lynx::faderPosition (1.0f) - lynx::unityFader) < 1e-5f);
+    CHECK (lynx::faderPosition (10.0f) == 1.0f);
+    CHECK (std::abs (lynx::faderGain (1.0f) - lynx::maxFaderGain) < 1e-3f);
+}
+
+TEST (compressor_auto_gain_keeps_the_long_term_level)
+{
+    // a vocal-like signal (a 220 Hz tone with a slow 2 Hz swell, peaks near −6 dBFS) through LYNX's Compressor at its
+    // defaults (−18 dB, 4:1, no makeup): quieter; with "Auto gain" the level after a few seconds is the input's
+    auto run = [] (bool autoGain) {
+        auto fx = lynx::makeEffect (lynx::EffectKind::compressor);
+        auto slot = lynx::makeEffectSlot (lynx::EffectKind::compressor);
+        slot.params[5] = autoGain ? 1.0f : 0.0f;
+        fx->prepare (48000.0);
+        double in = 0.0, out = 0.0;
+        std::vector<float> l (480), r (480);
+        for (int block = 0; block < 1000; ++block) // 10 s
+        {
+            for (int i = 0; i < 480; ++i)
+            {
+                const auto t = (block * 480 + i) / 48000.0;
+                l[(std::size_t) i] = r[(std::size_t) i] = (float) (0.5 * (0.6 + 0.4 * std::sin (2.0 * 3.14159265 * 2.0 * t)) * std::sin (2.0 * 3.14159265 * 220.0 * t));
+            }
+            if (block >= 600)
+                for (auto v : l)
+                    in += (double) v * v;
+            fx->process (l.data(), r.data(), 480, slot.params, 0.0);
+            if (block >= 600)
+                for (auto v : l)
+                    out += (double) v * v;
+        }
+        return 10.0 * std::log10 (out / in);
+    };
+    const auto plain = run (false), matched = run (true);
+    std::printf ("  compressor: %.2f dB without auto gain, %.2f dB with\n", plain, matched);
+    CHECK (plain < -2.0);
+    CHECK (std::abs (matched) < 0.5);
+}
+
+TEST (compressor_substitutes_keep_the_level)
+{
+    // Renaissance Compressor (missing on the user's laptop, in FL too): the substitute shapes dynamics with auto gain
+    lynx::PluginIdentity id;
+    id.format = lynx::ForeignPlugin::Format::vst3;
+    id.hasClassId = true;
+    const char* hex = "5554535643527253636f6d7072657373";
+    for (int i = 0; i < 16; ++i)
+        id.classId[(std::size_t) i] = (std::uint8_t) std::stoi (std::string (hex + 2 * i, 2), nullptr, 16);
+    lynx::EffectSlot slot;
+    slot.kind = lynx::EffectKind::plugin;
+    CHECK (lynx::substituteEffectSlot (slot, id));
+    CHECK (slot.kind == lynx::EffectKind::compressor && slot.params[5] >= 0.5f);
+}
+
+TEST (overlapping_audio_clips_of_one_channel_both_play)
+{
+    // REA_rodada107 §5: her vocal comps are cut into clips of the same take that overlap by a few ticks (FL's automatic
+    // crossfade). The end of the first clip stopped every voice of the channel, so the second clip went silent for its
+    // whole length (2 s of vocal missing in "kwe" at 59 s). Each clip's end now stops only its own voice.
+    lynx::Song s;
+    s.bpm = 120.0;
+    s.mode = lynx::PlayMode::song;
+    s.mixer = lynx::Song::defaultMixer (1);
+    lynx::ChannelDef c;
+    c.instrument = lynx::InstrumentKind::audioClip;
+    c.samplePath = "dc";
+    c.volume = 1.0f;
+    c.mixerTrack = 1;
+    s.channels.push_back (c);
+    s.patterns.emplace_back();
+    lynx::Clip a;
+    a.kind = lynx::ClipKind::audio;
+    a.channel = 0;
+    a.start = 0;
+    a.length = lynx::ppq * 2;           // 1 s
+    lynx::Clip b = a;
+    b.start = lynx::ppq * 2 - lynx::ppq / 8; // starts just before the first one ends
+    b.length = lynx::ppq * 2;
+    b.offset = lynx::ppq;
+    s.playlist = { a, b };
+
+    auto provider = [] (const std::string&) {
+        auto d = std::make_shared<lynx::SampleData>();
+        d->left.assign (48000 * 4, 1.0f);
+        return std::shared_ptr<const lynx::SampleData> (d);
+    };
+    auto state = lynx::RackState::build (s, nullptr, 48000.0, provider);
+    lynx::RackRenderer r;
+    r.prepare (48000.0, 512);
+    std::vector<float> all, l (512), rr (512);
+    const auto tps = lynx::ticksPerSample (s.bpm, 48000.0);
+    for (double tick = 0.0; tick < lynx::ppq * 4.0; tick += 512 * tps)
+    {
+        r.process (state.get(), true, tick, 512, l.data(), rr.data());
+        all.insert (all.end(), l.begin(), l.end());
+    }
+    const auto unity = 1.0f / lynx::channelGain (10000.0f / 12800.0f);
+    CHECK (std::abs (all[24000] - unity) < 0.02f);            // first clip
+    CHECK (std::abs (all[48000 + 24000] - unity) < 0.02f);    // second clip, after the first one's end
+    CHECK (std::abs (all[48000 + 40000] - unity) < 0.02f);
+    CHECK (lynx::audioClipKey (0) >= 128 && lynx::audioClipKey (1) != lynx::audioClipKey (0));
+}

+ 4 - 1
tests/tests.cpp

@@ -6233,7 +6233,7 @@ std::map<std::string, std::string> sourceKeys (const std::filesystem::path& srcD
     for (const auto& entry : std::filesystem::recursive_directory_iterator (srcDir))
     {
         const auto ext = entry.path().extension().string();
-        if (! entry.is_regular_file() || (ext != ".cpp" && ext != ".h"))
+        if (! entry.is_regular_file() || (ext != ".cpp" && ext != ".h" && ext != ".inc"))
             continue;
 
         // drop // comment lines (they may quote tr ("...") as an example)
@@ -15437,9 +15437,11 @@ TEST (level_audit_demo_imports_round89)
     }
 }
 #include "UiLook90Tests.inc"
+#include "UiFl104Tests.inc"
 #include "DialogsTests84.inc"
 #include "SubstituteTests.inc"
 #include "MixSuiteTests96.inc"
+#include "PanelsTests105.inc"
 
 // --- native plugin editors (round 93): FL's arrangements ---------------------------------------------------------
 
@@ -15609,3 +15611,4 @@ TEST (plugin_layout_options_match_the_engine_values)
 #include "LynxTuneTests95.inc"
 #include "LynxVerbTests100.inc"
 #include "FacetTests103.inc"
+#include "VocalLevel107Tests.inc"

+ 23 - 0
tools/renderwav.cpp

@@ -20,6 +20,7 @@
 #include <algorithm>
 #include <filesystem>
 #include <map>
+#include <sstream>
 #include <string>
 #include <chrono>
 #include <thread>
@@ -33,6 +34,7 @@
 
 #include "WavReader.h"
 #include "core/FlpImport.h"
+#include "core/PluginSubstitutes.h"
 #include "core/RackRenderer.h"
 #include "core/WorkerPool.h"
 
@@ -132,6 +134,27 @@ int main (int argc, char** argv)
         return 1;
     }
 
+    // LYNX_SUBSTITUTES=1: third-party effects become their LYNX substitutes, as in the app when none is installed
+    // (otherwise they stay unresolved, i.e. silent pass-through); LYNX_DISABLE="t.k t.k": those insert slots off
+    if (const char* e = std::getenv ("LYNX_SUBSTITUTES"); e != nullptr && std::atoi (e) != 0)
+        for (std::size_t t = 0; t < song.mixer.size(); ++t)
+            for (auto& fx : song.mixer[t].effects)
+                if (fx.kind == lynx::EffectKind::plugin && fx.plugin.foreign.format != lynx::ForeignPlugin::Format::none
+                    && lynx::substituteEffectSlot (fx, lynx::pluginIdentity (fx.plugin.foreign)))
+                    std::printf ("insert %d: %s -> %s\n", (int) t, lynx::substituteOriginalName (fx).c_str(), lynx::effectInfo (fx.kind).name);
+    if (const char* e = std::getenv ("LYNX_DISABLE"))
+    {
+        std::istringstream list (e);
+        std::string item;
+        while (list >> item)
+            if (const auto dot = item.find ('.'); dot != std::string::npos)
+            {
+                const auto t = (std::size_t) std::atoi (item.substr (0, dot).c_str()), k = (std::size_t) std::atoi (item.substr (dot + 1).c_str());
+                if (t < song.mixer.size() && k < song.mixer[t].effects.size())
+                    song.mixer[t].effects[k].enabled = false;
+            }
+    }
+
     // "song" instead of the index: the whole song (playlist), like the app's export
     const bool wholeSong = argc > 3 && std::string (argv[3]) == "song";
     std::int64_t songTicks = 0;