Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.
C# audioaudio-unitavaloniacpp20cross-platformdawdigital-audio-workstationdspjucelinux-audiomcp-servermidimusicmusic-productionpiano-rollplugin-hostsequencersynthesizervstvst3
Redesign of Flux
Egor Khindikaynen83aee1447048
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex b5edfe7b..e91eb8a7 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -19,6 +19,22 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.## [Unreleased]### Added+- **Nota Flux's editor is now the almanac's card, and the vector's worlds carry their own+ unison.** The card shrinks from 900 to **700 × 260** and reads left to right: the+ **Vector** field (the four worlds in their graph colours, the vector as a brass dot, and a+ dashed teal ring where Motion and React pull it), **React** (a source picker that lists+ the tracks when it opens, a scope of what Flux hears — envelope, transients and tilt —+ beside the reaction's own level, LISTEN and the four targets) and **Macros** (Age, Motion,+ Filter, Env and Space, then **glide, tune and gain**, which had no control on the card+ before). A status strip reads the patch back in words: the blend of the four worlds, or+ the source, target, **transients per bar** and where the vector is being pulled. FILTER+ now shows the cutoff the engine actually uses at the current vector, and double-clicking+ the field puts the vector back on its default. The "adaptive unison" the card promised is+ real now: each world detunes a twin of the oscillator by its own amount (Warm the most,+ Moog not at all), a little wider with Age. Projects load unchanged — no parameter moved.+- **Nota Flux ships 25 factory presets** (was 6) — pads, keys and plucks, basses, leads and+ a set of reactive patches meant for a drum or bass source, including the six that existed+ before under their old names.- **The Nota Drum Rack's editor is now the almanac's card, with a kit picker in its header.**The header's **‹ Kit ⌄ ›** picker loads any factory kit into the rack in place (itreplaces the pads) and steps through them; a rack names its kit even after a project is@@ -279,6 +295,13 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.tokens its own comments named.### Fixed+- **Nota Flux: with no source assigned, React is off.** It used to listen to Flux's own+ output instead, so a patch aimed at the filter or the vector wobbled with its own chords.+ The React followers now also run on time constants rather than once per audio block at a+ fixed rate, so the reaction feels the same at any buffer size.+- **Nota Flux: a repeated note no longer cuts itself off.** A note-off released every voice+ of its pitch, so a note that started a hair before the previous one of the same pitch+ ended went silent with it. A note-off now releases only the oldest held one.- **Nota Bass: back-to-back notes no longer drop out.** Two things silenced the next note ofa tight line. A note-off released *every* note of its pitch, so when a repeated notestarted a sample before the previous one ended (float rounding, a Note Length or arpdiff --git a/DESIGN.html b/DESIGN.htmlindex eee09170..adf47234 100644--- a/DESIGN.html+++ b/DESIGN.html@@ -513,7 +513,7 @@ ul.plain{margin:0;padding-left:18px;color:var(--text-secondary)} ul.plain li{mar<div class="slider" style="width:100%;grid-template-columns:34px 1fr 36px"><span>Wet</span><span class="track"><b style="width:45%"></b><u style="left:45%"></u></span><span>45 %</span></div></div></div></div></div>- <p class="note">Width exceptions by decision: Rhythm 900, Flux 900, Bass 1060, Physical 720, and the plugin / parameter-list stubs.</p>+ <p class="note">Width exceptions by decision: Rhythm 900, Bass 1060, Physical 720, and the plugin / parameter-list stubs.</p></section><section id="shell">@@ -531,7 +531,7 @@ ul.plain{margin:0;padding-left:18px;color:var(--text-secondary)} ul.plain li{mar<li>Transport at the top, with the view switch leading it.</li><li>English shell copy — tooltips are short and verb-first.</li><li>Frequent choices with more than four options stay segments.</li>- <li>Rhythm, Flux, Bass and Physical cards are wider than 700.</li>+ <li>Rhythm, Bass and Physical cards are wider than 700.</li><li>Default zoom 28 px per beat; <code>FREQ</code>, <code>RESO</code>, <code>THRESH</code> as labels; Play turns green in Session.</li></ul></section>diff --git a/DESIGN.md b/DESIGN.mdindex 804cd15c..64d4625e 100644--- a/DESIGN.md+++ b/DESIGN.md@@ -368,7 +368,7 @@ Every built-in device is a **700 × 260** card (`DeviceCardKit.CardH`, width fro(teal for LFOs and envelopes) on the arc; end-of-chain trim fills with Border strong.- A bypassed card keeps its layout and turns to the disabled look via `Inactive`.-Width exceptions, by decision: **Rhythm 900, Flux 900, Bass 1060, Physical 720** (squeezing+Width exceptions, by decision: **Rhythm 900, Bass 1060, Physical 720** (squeezingthem would be a redesign) and the host-plugin / parameter-list stubs (230, 190).## Shell@@ -428,7 +428,7 @@ Decisions taken while aligning the app, kept on purpose:Amp Model (7) and Cabinet (5), Compressor Character (5), Vintage Character (6), DelayDivision (8), Arp Rate (8) and Order (8), Aurora Warp (5) and Filter (5), Bass LFO wave (5),Monolith Glide range (6), Pendulum Division (5) and Wave (5).-- **Wide instruments** — Rhythm, Flux, Bass, Physical (see § Device cards).+- **Wide instruments** — Rhythm, Bass, Physical (see § Device cards).- **Preset picker in the device header.** The almanac allows only name, badge and bypassthere; switching presets is frequent enough to stay one click away.- **Zoom 28 px per beat** by default, not a 16 px bar; the ruler labels every bar once a bardiff --git a/FEATURES.md b/FEATURES.mdindex 67a99d4f..45f6900f 100644--- a/FEATURES.md+++ b/FEATURES.md@@ -289,9 +289,10 @@ and user presets, automation, persistence and cloning.Mono/Poly. 25 factory presets.- **Nota Physical** — physical modelling.- **Nota Flux** — vector-morphing analog synth: an XY pad with four "timbre worlds"- (WARM/GLASS/MOOG/GRAIN), **React** (sidechain modulation from another track:- Filter/Pitch/Space/vector), 5 macro knobs (Age/Motion/Filter/Env/Space), and a sidechain- scope.+ (WARM/GLASS/MOOG/GRAIN) whose resonance, drive and unison the vector blends, **React**+ (sidechain modulation from another track: Filter/Pitch/Space/Vector, with a live scope of+ its envelope, transients and tilt, and transients per bar), 5 macro knobs+ (Age/Motion/Filter/Env/Space), glide, tune and gain. 25 factory presets.- **Nota Rhythm** — drum machine: 8 voices (analog and FM kick, noise snare, metallichats, clap, rim, tom, perc), a 16-step sequencer (locked to the transport), 4 patternbanks (A–D), accents, per-step velocity, Swing/Humanize, and a per-voice **Sample** modediff --git a/scripts/design-html.py b/scripts/design-html.pyindex 22545fd0..0a88e0f9 100755--- a/scripts/design-html.py+++ b/scripts/design-html.py@@ -445,7 +445,7 @@ ul.plain{{margin:0;padding-left:18px;color:var(--text-secondary)}} ul.plain li{{<div class="slider" style="width:100%;grid-template-columns:34px 1fr 36px"><span>Wet</span><span class="track"><b style="width:45%"></b><u style="left:45%"></u></span><span>45 %</span></div></div></div></div></div>- <p class="note">Width exceptions by decision: Rhythm 900, Flux 900, Bass 1060, Physical 720, and the plugin / parameter-list stubs.</p>+ <p class="note">Width exceptions by decision: Rhythm 900, Bass 1060, Physical 720, and the plugin / parameter-list stubs.</p></section><section id="shell">@@ -463,7 +463,7 @@ ul.plain{{margin:0;padding-left:18px;color:var(--text-secondary)}} ul.plain li{{<li>Transport at the top, with the view switch leading it.</li><li>English shell copy — tooltips are short and verb-first.</li><li>Frequent choices with more than four options stay segments.</li>- <li>Rhythm, Flux, Bass and Physical cards are wider than 700.</li>+ <li>Rhythm, Bass and Physical cards are wider than 700.</li><li>Default zoom 28 px per beat; <code>FREQ</code>, <code>RESO</code>, <code>THRESH</code> as labels; Play turns green in Session.</li></ul></section>diff --git a/src/managed/Nota.App/Controls/FluxReactScope.cs b/src/managed/Nota.App/Controls/FluxReactScope.csindex c3733acb..26d3fec5 100644--- a/src/managed/Nota.App/Controls/FluxReactScope.cs+++ b/src/managed/Nota.App/Controls/FluxReactScope.cs@@ -2,11 +2,14 @@// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.//// Detail · Devices — the Nota Flux "React" scope: a rolling view of what the synth hears on-// its sidechain. Olive = the input level (material), teal = the smoothed envelope follower,-// bright teal ticks = detected transients, and a right-edge bar = the spectral tilt. Fed one-// (env, transient, tilt) sample per UI tick via Push(); keeps its own ring buffer.+// its sidechain, in a graph window (NotaGraph). Teal above the centre line = the envelope+// follower; the neutral line below = the spectral tilt (brighter material swings further+// down); teal verticals = detected transients. A narrow well to the right is the reaction+// itself — how hard the target is being driven right now. With no source the window is+// neutral: a flat line and one Ink 6 sentence. Fed one sample per UI tick via Push().using System;+using System.Globalization;using Avalonia;using Avalonia.Controls;using Avalonia.Media;@@ -16,95 +19,111 @@ namespace Nota.App;internal sealed class FluxReactScope : Control{private const int N = 150;+ private const double BarW = 8, Gap = 4;private readonly float[] _env = new float[N];- private readonly float[] _flw = new float[N]; // smoothed follower+ private readonly float[] _tilt = new float[N];private readonly float[] _tr = new float[N];private int _head;- private float _tilt = 0.5f, _follow;-- private static Color Inset => NotaPalette.BgSunken.Color;- private static Color Olive => NotaPalette.SignalIn.Color;- private static Color Teal => NotaPalette.Teal.Color;- private static Color TealBright => NotaPalette.TealBright.Color;+ private float _react;+ private bool _live;public FluxReactScope() { ClipToBounds = true; }- public void Push(float env, float transient, float tilt)+ /// <summary>Whether a source is assigned. Off clears the history.</summary>+ public bool Live+ {+ get => _live;+ set+ {+ if (_live == value) return;+ _live = value;+ if (!value) { Array.Clear(_env); Array.Clear(_tilt); Array.Clear(_tr); _react = 0; }+ InvalidateVisual();+ }+ }++ public void Push(float env, float transient, float tilt, float react){- env = Math.Clamp(env, 0, 1);- _follow += (env - _follow) * 0.20f;- _env[_head] = env;- _flw[_head] = _follow;+ _env[_head] = Math.Clamp(env * 3.5f, 0, 1); // the engine's own env → 0..1 scaling+ _tilt[_head] = Math.Clamp(tilt, 0, 1);_tr[_head] = Math.Clamp(transient, 0, 1);_head = (_head + 1) % N;- _tilt = Math.Clamp(tilt, 0, 1);+ _react = Math.Clamp(react, 0, 1);InvalidateVisual();}public override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height;- if (w < 4 || h < 4) return;- ctx.FillRectangle(new SolidColorBrush(Inset), new Rect(Bounds.Size), 6);+ if (w < BarW + Gap + 8 || h < 12) return;+ var plot = new Rect(0, 0, w - BarW - Gap, h);+ NotaGraph.Window(ctx, plot);+ double mid = Math.Round(h / 2) + 0.5, half = h * 0.40;- const double barW = 6, gap = 4;- double pw = w - barW - gap; // plot width (leave room for the tilt bar)- double mid = h / 2;- double half = h * 0.42;+ // centre line and the two quarter lines, dashed.+ var quarter = new Pen(NotaPalette.GridBeat, 1, new DashStyle(new double[] { 2, 3 }, 0));+ ctx.DrawLine(NotaGraph.GridPen, new Point(1, mid), new Point(plot.Width - 1, mid));+ ctx.DrawLine(quarter, new Point(1, Math.Round(h / 4) + 0.5), new Point(plot.Width - 1, Math.Round(h / 4) + 0.5));+ ctx.DrawLine(quarter, new Point(1, Math.Round(h * 3 / 4) + 0.5), new Point(plot.Width - 1, Math.Round(h * 3 / 4) + 0.5));- // olive "material" envelope (mirrored around the centre line).- var top = new StreamGeometry();- var bot = new StreamGeometry();- using (var tc = top.Open())- using (var bc = bot.Open())+ using (ctx.PushClip(plot.Deflate(1))){- for (int i = 0; i < N; i++)+ if (!_live)+ ctx.DrawLine(new Pen(NotaPalette.BorderStrong, 1.4), new Point(1, mid), new Point(plot.Width - 1, mid));+ else{- int idx = (_head + i) % N;- double x = pw * i / (N - 1);- double a = _env[idx] * half;- var pt = new Point(x, mid - a);- var pb = new Point(x, mid + a);- if (i == 0) { tc.BeginFigure(pt, false); bc.BeginFigure(pb, false); }- else { tc.LineTo(pt); bc.LineTo(pb); }+ double X(int i) => 1 + (plot.Width - 2) * i / (N - 1);++ // transients: a teal vertical on each rising edge past the threshold.+ var tick = new Pen(NotaPalette.Wash(NotaPalette.Teal, 0x90), 1);+ for (int i = 1; i < N; i++)+ {+ int idx = (_head + i) % N, prev = (_head + i - 1) % N;+ if (_tr[idx] > 0.35f && _tr[prev] <= 0.35f)+ {+ double x = Math.Round(X(i)) + 0.5;+ ctx.DrawLine(tick, new Point(x, 1), new Point(x, h - 1));+ }+ }++ // tilt below the centre (neutral), envelope above it (teal).+ ctx.DrawGeometry(null, NotaGraph.SecondaryPen(NotaPalette.BorderStrong, 1.2), Curve(i => mid + 2 + _tilt[i] * (half - 2), X));+ ctx.DrawGeometry(null, NotaGraph.SecondaryPen(NotaPalette.Teal, 1.6), Curve(i => mid - 2 - _env[i] * (half - 2), X));}- tc.EndFigure(false); bc.EndFigure(false);}- var olivePen = new Pen(new SolidColorBrush(Olive, 0.85), 1);- ctx.DrawGeometry(null, olivePen, top);- ctx.DrawGeometry(null, olivePen, bot);- // teal envelope follower (top curve, brighter/smoother).- var flw = new StreamGeometry();- using (var fc = flw.Open())+ var lbl = new FormattedText("SIDECHAIN", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, NotaFonts.SansBold,+ NotaType.KnobLabel, _live ? NotaPalette.TextTertiary : NotaPalette.TextDisabled);+ ctx.DrawText(lbl, new Point(6, 4));+ NotaGraph.Axis(ctx, plot, NotaGraph.Corner.TopRight, "env · transients · tilt", _live ? NotaPalette.TealBright : NotaPalette.TextAxis);+ if (!_live){- for (int i = 0; i < N; i++)- {- int idx = (_head + i) % N;- double x = pw * i / (N - 1);- var p = new Point(x, mid - _flw[idx] * half);- if (i == 0) fc.BeginFigure(p, false); else fc.LineTo(p);- }- fc.EndFigure(false);+ var none = new FormattedText("no source assigned", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, NotaFonts.Sans,+ NotaType.KnobLabel, NotaPalette.TextDisabled);+ ctx.DrawText(none, new Point((plot.Width - none.Width) / 2, h - 8 - none.Height));}- ctx.DrawGeometry(null, new Pen(new SolidColorBrush(Teal), 1.6), flw);- // transient ticks.- var tickPen = new Pen(new SolidColorBrush(TealBright, 0.5), 1);- for (int i = 1; i < N; i++)+ // the reaction, in its own narrow well.+ var bar = new Rect(w - BarW, 0, BarW, h);+ ctx.DrawRectangle(NotaPalette.BgSunken, NotaGraph.FramePen, new RoundedRect(bar.Deflate(0.5), NotaRadius.ClipValue));+ if (_live && _react > 0.005f){- int idx = (_head + i) % N, prev = (_head + i - 1) % N;- if (_tr[idx] > 0.35f && _tr[idx] >= _tr[prev]) // rising edge past threshold- {- double x = pw * i / (N - 1);- ctx.DrawLine(tickPen, new Point(x, 4), new Point(x, h - 4));- }+ double fill = (h - 4) * _react;+ ctx.FillRectangle(NotaPalette.Teal, new Rect(bar.X + 2, h - 2 - fill, BarW - 4, fill), (float)NotaRadius.ClipValue);}+ }- // right-edge spectral-tilt bar.- double bx = w - barW;- ctx.FillRectangle(NotaPalette.SurfaceAbyss, new Rect(bx, 3, barW, h - 6), 3);- double fillH = (h - 6) * _tilt;- ctx.FillRectangle(NotaPalette.Teal, new Rect(bx, 3 + (h - 6 - fillH), barW, fillH), (float)NotaRadius.ClipValue);+ private StreamGeometry Curve(Func<int, double> y, Func<int, double> x)+ {+ var g = new StreamGeometry();+ using var gc = g.Open();+ for (int i = 0; i < N; i++)+ {+ int idx = (_head + i) % N;+ var p = new Point(x(i), y(idx));+ if (i == 0) gc.BeginFigure(p, false); else gc.LineTo(p);+ }+ gc.EndFigure(false);+ return g;}}diff --git a/src/managed/Nota.App/Controls/FluxVectorPad.cs b/src/managed/Nota.App/Controls/FluxVectorPad.csindex 1850b1aa..d5f2ec72 100644--- a/src/managed/Nota.App/Controls/FluxVectorPad.cs+++ b/src/managed/Nota.App/Controls/FluxVectorPad.cs@@ -1,12 +1,14 @@// SPDX-License-Identifier: AGPL-3.0-only// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.//-// Detail · Devices — the Nota Flux vector pad: a draggable XY control whose four corners-// are "timbre worlds" (WARM / GLASS / MOOG / GRAIN). The background is a four-corner radial-// gradient (one glow per world) over the sunken inset, matching the mockup. A bright dot is-// the current vector; a teal dashed "ghost" shows where Motion + React are pulling it.+// Detail · Devices — the Nota Flux vector field: a draggable XY control whose four corners+// are "timbre worlds" (WARM / GLASS / MOOG / GRAIN). It is a graph window (NotaGraph): well,+// hairline, radius 4, a crosshair in the grid colour, and the corner names in the four role+// chromas — brass, steel, rose, teal — the only place on the card they appear. The brass+// dot is the vector the parameters hold; a dashed teal ring, reached by a dashed arc, is+// where Motion and React pull it right now.// X = 0..1 left→right, Y = 0..1 top→bottom. Reports drags via ValueChanged; Begin/End frame-// an automation-write gesture on both axes.+// an automation-write gesture on both axes. Left button only; double-click resets.using System;using System.Globalization;@@ -19,17 +21,6 @@ namespace Nota.App;internal sealed class FluxVectorPad : Control{- private static Color Inset => NotaPalette.BgSunken.Color;- private static Color GridCol => NotaPalette.PadGrid.Color;- private static Color BorderCol => NotaPalette.GraphBorder.Color;- private static Color Warm => NotaPalette.Accent.Color; // top-left- private static Color Glass => NotaPalette.InkColor("#6D8FB5"); // top-right- private static Color Moog => NotaPalette.InkColor("#C4756A"); // bottom-left- private static Color Grain => NotaPalette.InkColor("#7E8A6A"); // bottom-right- private static Color DotCol => NotaPalette.AccentBright.Color;- private static Color Teal => NotaPalette.Teal.Color;- private static readonly IBrush Muted = NotaPalette.TextTertiary;-private double _x = 0.34, _y = 0.28; // base vector (params)private double _gx = 0.34, _gy = 0.28; // effective (Motion + React) ghostprivate bool _ghost;@@ -38,8 +29,17 @@ internal sealed class FluxVectorPad : Controlpublic Action<double, double>? ValueChanged;public Action? GestureBegin;public Action? GestureEnd;+ /// <summary>Double-click: put the vector back on its default.</summary>+ public Action? Reset;++ public FluxVectorPad()+ {+ ClipToBounds = true;+ Cursor = new Cursor(StandardCursorType.Hand);+ DoubleTapped += (_, e) => { Reset?.Invoke(); e.Handled = true; };+ }- public FluxVectorPad() { ClipToBounds = true; }+ public bool Dragging => _drag;/// <summary>Set the base vector position (from params) without firing ValueChanged.</summary>public void SetValue(double x, double y)@@ -49,7 +49,7 @@ internal sealed class FluxVectorPad : Control_x = x; _y = y; InvalidateVisual();}- /// <summary>Set the effective (Motion + React) ghost dot; show=false hides it.</summary>+ /// <summary>Set the effective (Motion + React) ghost; show=false hides it.</summary>public void SetGhost(double x, double y, bool show){x = Math.Clamp(x, 0, 1); y = Math.Clamp(y, 0, 1);@@ -59,6 +59,8 @@ internal sealed class FluxVectorPad : Controlprotected override void OnPointerPressed(PointerPressedEventArgs e){+ if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return; // right-click bubbles+ if (e.ClickCount > 1) return; // DoubleTapped resets_drag = true; GestureBegin?.Invoke();e.Pointer.Capture(this);Apply(e.GetPosition(this));@@ -72,6 +74,10 @@ internal sealed class FluxVectorPad : Control{if (_drag) { _drag = false; e.Pointer.Capture(null); GestureEnd?.Invoke(); }}+ protected override void OnPointerCaptureLost(PointerCaptureLostEventArgs e)+ {+ if (_drag) { _drag = false; GestureEnd?.Invoke(); }+ }private void Apply(Point p){@@ -84,45 +90,45 @@ internal sealed class FluxVectorPad : Controlpublic override void Render(DrawingContext ctx){var r = new Rect(Bounds.Size);- // base + four-corner radial glows.- ctx.FillRectangle(new SolidColorBrush(Inset), r, 8);-- // crosshair grid.- var grid = new Pen(new SolidColorBrush(GridCol), 1);- ctx.DrawLine(grid, new Point(r.Width / 2, 0), new Point(r.Width / 2, r.Height));- ctx.DrawLine(grid, new Point(0, r.Height / 2), new Point(r.Width, r.Height / 2));-- // corner labels.- Label(ctx, "WARM", Warm, 6, 4, false);- Label(ctx, "GLASS", Glass, r.Width - 6, 4, true);- Label(ctx, "MOOG", Moog, 6, r.Height - 15, false);- Label(ctx, "GRAIN", Grain, r.Width - 6, r.Height - 15, true);-- // React/Motion ghost: dashed line from base to effective + hollow teal dot.- var bx = _x * r.Width; var by = _y * r.Height;+ if (r.Width < 8 || r.Height < 8) return;+ NotaGraph.Window(ctx, r);++ // crosshair.+ ctx.DrawLine(NotaGraph.GridPen, new Point(Math.Round(r.Width / 2) + 0.5, 1), new Point(Math.Round(r.Width / 2) + 0.5, r.Height - 1));+ ctx.DrawLine(NotaGraph.GridPen, new Point(1, Math.Round(r.Height / 2) + 0.5), new Point(r.Width - 1, Math.Round(r.Height / 2) + 0.5));++ // corner worlds, in the graph chromas.+ Label(ctx, "WARM", NotaPalette.Accent, 6, 4, false);+ Label(ctx, "GLASS", NotaPalette.Steel, r.Width - 6, 4, true);+ Label(ctx, "MOOG", NotaPalette.Rose, 6, r.Height - 13, false);+ Label(ctx, "GRAIN", NotaPalette.Teal, r.Width - 6, r.Height - 13, true);++ var b = new Point(_x * r.Width, _y * r.Height);if (_ghost){- var gx = _gx * r.Width; var gy = _gy * r.Height;- var dash = new Pen(new SolidColorBrush(Teal, 0.75), 1, new DashStyle(new double[] { 3, 3 }, 0));- ctx.DrawLine(dash, new Point(bx, by), new Point(gx, gy));- var ring = new Pen(new SolidColorBrush(Teal, 0.85), 1.3, new DashStyle(new double[] { 3, 2 }, 0));- ctx.DrawEllipse(null, ring, new Point(gx, gy), 6, 6);+ // A dashed arc from the vector to where it is pulled, then a dashed ring there.+ var g = new Point(_gx * r.Width, _gy * r.Height);+ var d = g - b;+ var bend = new Point((b.X + g.X) / 2 - d.Y * 0.18, (b.Y + g.Y) / 2 + d.X * 0.18);+ var geo = new StreamGeometry();+ using (var gc = geo.Open())+ {+ gc.BeginFigure(b, false);+ gc.QuadraticBezierTo(bend, g);+ gc.EndFigure(false);+ }+ var dash = new Pen(NotaPalette.Teal, 1.4, new DashStyle(new double[] { 2, 2 }, 0));+ ctx.DrawGeometry(null, dash, geo);+ ctx.DrawEllipse(null, new Pen(NotaPalette.Teal, 1.5, new DashStyle(new double[] { 2, 1.5 }, 0)), g, 6, 6);}- // current vector dot (glow + bright core).- ctx.DrawEllipse(new SolidColorBrush(DotCol, 0.28), null, new Point(bx, by), 11, 11);- ctx.DrawEllipse(new SolidColorBrush(DotCol), new Pen(NotaPalette.BgSunken, 1), new Point(bx, by), 6, 6);-- // 1px inner border to match the mockup pad frame.- ctx.DrawRectangle(null, new Pen(new SolidColorBrush(BorderCol), 1), r, 8, 8);+ // the vector: Brass Light with a ground-coloured ring.+ ctx.DrawEllipse(NotaPalette.AccentBright, new Pen(NotaPalette.AccentSubtle, 2), b, 7, 7);}-- private void Label(DrawingContext ctx, string text, Color col, double x, double y, bool rightAlign)+ private static void Label(DrawingContext ctx, string text, IBrush ink, double x, double y, bool rightAlign){- var ft = new FormattedText(text, CultureInfo.InvariantCulture, FlowDirection.LeftToRight,- NotaFonts.SansBold, 9, new SolidColorBrush(col));- double ox = rightAlign ? x - ft.Width : x;- ctx.DrawText(ft, new Point(ox, y));+ var ft = new FormattedText(text, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, NotaFonts.SansBold, NotaType.KnobLabel, ink);+ ctx.DrawText(ft, new Point(rightAlign ? x - ft.Width : x, y));}}diff --git a/src/managed/Nota.App/DeviceCards/Instruments/FluxInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/FluxInstrumentCard.csindex 7ceda014..098cb5b3 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/FluxInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/FluxInstrumentCard.cs@@ -1,19 +1,26 @@// SPDX-License-Identifier: AGPL-3.0-only// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.//-// Detail · Devices — built-in Nota Flux editor (instrument kind 11), built to the-// shared 900×260 card shell (header 26 · body 234). Three-// columns:-// VECTOR — a draggable XY pad whose four corners are timbre "worlds" (WARM/GLASS/MOOG/GRAIN),-// with the four-corner radial gradient and a teal ghost dot for Motion + React.-// REACT — the signature feature: a sidechain source picker + a live analysis scope-// (env / transients / tilt) + LISTEN amount + TARGET (Filter/Pitch/Space/Vector).-// MACROS — five one-knob controls (Age / Motion / Filter / Env / Space), the rest adaptive.-// Every parameter is a plugin-param → automation / persist / clone. The knobs are the shared-// Nota gauge Knob (not the mockup's flat gauges).+// Detail · Devices — built-in Nota Flux editor (instrument kind 11): the vector synth that+// listens to a track, in the 700 × 260 card the almanac draws for it.+//+// Vector 186 the XY field — four timbre worlds at the corners, the brass dot is the+// vector, a dashed teal ring is where Motion and React pull it.+// React the sidechain source, a live scope of what the synth hears (envelope,+// transients, tilt) beside the reaction's own level, LISTEN and the TARGET+// it drives (Filter / Pitch / Space / Vector). With no source React is off:+// the scope goes flat and LISTEN and TARGET dim.+// Macros 186 the five one-knob macros (Age, Motion, Filter, Env, Space), then glide,+// tune and gain; resonance, attack/release and unison follow the vector.+// Status 18 the patch read back in words — the world blend, or what React is doing.+//+// The four role chromas live only inside the vector field. Brass is the parameter itself;+// teal is the reaction and what receives it. Everything is a plugin param → automation /+// persist / clone, and the card follows automation live.using System;using System.Collections.Generic;+using System.Diagnostics;using Avalonia;using Avalonia.Controls;using Avalonia.Input;@@ -28,18 +35,33 @@ internal sealed class FluxInstrumentCard : IInstrumentCard{public bool BodyOnly => true;public string Subtitle => "VECTOR";- public double CardWidth => 900;+ public double CardWidth => 700;- private static readonly IBrush Ink = NotaPalette.TextOnAccent;- private static readonly IBrush ReactBg = NotaPalette.SurfaceInset;- private static readonly IBrush Inset = NotaPalette.BgSunken;- private static readonly IBrush Border2 = NotaPalette.BorderDefault;- private static readonly IBrush TealB = NotaPalette.Teal;- private static readonly IBrush TealBright = NotaPalette.TealBright;- private static readonly IBrush Muted = NotaPalette.TextTertiary;+ private const double SideW = 186, HeadH = 20, StatusH = 18;private static readonly string[] Targets = { "Filter", "Pitch", "Space", "Vector" };private static readonly string[] RateNames = { "1/1", "1/2", "1/4", "1/8", "1/8T", "1/16" };+ private static readonly string[] WorldNames = { "warm", "glass", "moog", "grain" };++ // The engine's worlds and maps (FluxSynth.h), so the FILTER readout says what it does.+ private static readonly (double Cutoff, double Bright)[] Worlds = { (0.42, 0.20), (0.88, 0.95), (0.38, 0.10), (0.55, 0.55) };+ private static double[] Weights(double x, double y) => new[] { (1 - x) * (1 - y), x * (1 - y), (1 - x) * y, x * y };+ private static double CutoffHz(float filter, double x, double y)+ {+ var w = Weights(x, y);+ double cut = 0, bright = 0;+ for (int i = 0; i < 4; i++) { cut += Worlds[i].Cutoff * w[i]; bright += Worlds[i].Bright * w[i]; }+ double n = Math.Clamp(cut * 0.55 + (filter - 0.5) * 0.9 + bright * 0.18, 0.02, 0.99);+ return Math.Clamp(50 * Math.Pow(18000.0 / 50.0, n), 40, 20000);+ }+ private static double ExpMap(float v, double lo, double hi) => lo * Math.Pow(hi / lo, Math.Clamp(v, 0f, 1f));++ private static string AgeWord(float v) => v < 0.12f ? "clean" : v < 0.45f ? "vintage" : v < 0.78f ? "worn" : "broken";+ private static string EnvWord(float v) => v < 0.4f ? "pad" : v < 0.6f ? "pad→pluck" : "pluck";+ private static string GlideT(float v) => v <= 0.001f ? "off" : NotaNum.Time(ExpMap(v, 0.005, 0.6));+ private static string Cents(float v) => NotaNum.Unit(Math.Round((v - 0.5) * 100), "+0;−0;0", "ct");+ private static string Pct(float v) => NotaNum.Pct(v);+ private static string Coord(double v) => NotaNum.Str(v, "0.00");public Control Build(DeviceCardContext ctx){@@ -50,178 +72,404 @@ internal sealed class FluxInstrumentCard : IInstrumentCardfor (int i = 0; i < pc; i++) idx[engine.PluginParamId(track, -1, i)] = i;int I(string id) => idx.TryGetValue(id, out var i) ? i : -1;float G(string id) => I(id) is var i and >= 0 ? engine.PluginParamGet(track, -1, i) : 0f;- void SetId(string id, float v) { if (I(id) is var i and >= 0) engine.PluginParamSet(track, -1, i, Math.Clamp(v, 0f, 1f)); }+ void SetP(string id, float v) { if (I(id) is var i and >= 0) engine.PluginParamSet(track, -1, i, Math.Clamp(v, 0f, 1f)); }void Begin(string id) { if (I(id) >= 0) engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); }void End(string id) { if (I(id) >= 0) engine.EndAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); }+ int TargetIdx() => Math.Clamp((int)Math.Round(G("target") * 3f), 0, 3);+ int RateIdx() => Math.Clamp((int)Math.Round(G("motrate") * 5f), 0, 5);var readouts = new List<Action>();- TextBlock Mono(string t, IBrush c, double fs = 9) { var tb = new TextBlock { Text = t, FontSize = fs, Foreground = c, VerticalAlignment = VerticalAlignment.Center }; tb.BindResource(TextBlock.FontFamilyProperty, "Font.Mono"); return tb; }- TextBlock Sec(string t, IBrush? c = null) => new() { Text = t, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = c ?? Muted, VerticalAlignment = VerticalAlignment.Center };+ // Live state from the engine's scope, refreshed on the playhead tick.+ var sc = new float[9];+ double effX = G("vecx"), effY = G("vecy");+ float react = 0;+ bool live = engine.InstrumentSidechainSource(track) >= 0;+ var onsetLog = new Queue<(double T, float Count)>();+ var clock = Stopwatch.StartNew();+ int perBar = 0;- int TargetIdx() => Math.Clamp((int)Math.Round(G("target") * 3f), 0, 3);- int RateIdx() => Math.Clamp((int)Math.Round(G("motrate") * 5f), 0, 5);- string AgeWord(float v) => v < 0.12f ? "clean" : v < 0.45f ? "vintage" : v < 0.78f ? "worn" : "broken";+ var status = new TextBlock { FontSize = 8, Foreground = TextSecondary, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis };+ var meta = new TextBlock { FontSize = 8, Foreground = TextSecondary, VerticalAlignment = VerticalAlignment.Center, FontFamily = NotaFonts.MonoFamily };++ void Refresh()+ {+ foreach (var r in readouts) r();+ status.Text = Summary();+ meta.Text = Meta();+ }++ // ---- shared builders --------------------------------------------------+ static TextBlock Cap(string t, IBrush? c = null) => new()+ {+ Text = t, FontSize = NotaType.KnobLabel, FontWeight = FontWeight.Bold,+ LetterSpacing = NotaType.KnobLabelTracking * 1.5, Foreground = c ?? TextTertiary,+ VerticalAlignment = VerticalAlignment.Center,+ };+ static TextBlock Note(string t, IBrush? c = null) => new()+ {+ Text = t, FontSize = NotaType.KnobLabel, Foreground = c ?? TextDisabled,+ VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis,+ };+ static TextBlock Mono(string t, IBrush? c = null) => new()+ {+ Text = t, FontSize = NotaType.Axis, Foreground = c ?? TextTertiary, FontFamily = NotaFonts.MonoFamily,+ VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis,+ };- // ---- VECTOR column --------------------------------------------------+ // A knob as a table cell: short label on the card, the full name for MIDI learn.+ (Control Cell, Knob Knob, TextBlock Value) PKnob(string id, string label, string learn, Func<float, string> fmt,+ double size, double cellW, IBrush? arc = null)+ {+ var value = new TextBlock { Text = fmt(G(id)), Foreground = TextPrimary };+ var knob = new Knob(G(id), 1.0)+ {+ Accent = true, ArcColor = arc, Width = size, Height = size,+ Default = I(id) is var d and >= 0 ? engine.InstrumentParamDefault(track, d) : double.NaN,+ };+ if (I(id) is var pi and >= 0)+ {+ knob.ValueChanged += v => { engine.PluginParamSet(track, -1, pi, (float)v); value.Text = fmt((float)v); Refresh(); };+ knob.GestureBegin += () => Begin(id);+ knob.GestureEnd += () => End(id);+ ctx.AddInstFader(pi, knob, value, fmt);+ MidiLearn.Bind(knob, MidiTarget.PluginParam(track, -1, pi), learn);+ }+ var cell = KnobCell(label, knob, value, cellW);+ cell.HorizontalAlignment = HorizontalAlignment.Center;+ cell.VerticalAlignment = VerticalAlignment.Center;+ return (cell, knob, value);+ }++ Grid Slider(string label, string id, Func<string> text)+ {+ int pi = I(id);+ var row = SliderRow(label, () => G(id), v => { SetP(id, (float)v); Refresh(); }, text, out var sync,+ begin: pi >= 0 ? () => Begin(id) : null,+ end: pi >= 0 ? () => End(id) : null,+ reset: pi >= 0 ? () => { SetP(id, engine.InstrumentParamDefault(track, pi)); Refresh(); } : null,+ labelWidth: 34, valueWidth: 38);+ readouts.Add(sync);+ if (pi >= 0) MidiLearn.Bind(row, MidiTarget.PluginParam(track, -1, pi), label);+ return row;+ }++ Grid Head(Control left, Control? right = null)+ {+ var g = new Grid { Height = HeadH, ColumnDefinitions = new ColumnDefinitions("Auto,*"), Margin = new Thickness(8, 0) };+ g.Children.Add(left);+ if (right is not null)+ {+ right.HorizontalAlignment = HorizontalAlignment.Right;+ Grid.SetColumn(right, 1); g.Children.Add(right);+ }+ return g;+ }++ // ---- Vector -------------------------------------------------------------var pad = new FluxVectorPad { VerticalAlignment = VerticalAlignment.Stretch, HorizontalAlignment = HorizontalAlignment.Stretch };- pad.ValueChanged += (x, y) => { SetId("vecx", (float)x); SetId("vecy", (float)y); };+ pad.ValueChanged += (x, y) => { SetP("vecx", (float)x); SetP("vecy", (float)y); Refresh(); };pad.GestureBegin += () => { Begin("vecx"); Begin("vecy"); };pad.GestureEnd += () => { End("vecx"); End("vecy"); };- var vecReadout = Mono("", Muted, 8);- readouts.Add(() => vecReadout.Text = $"x {G("vecx"):0.00} · y {G("vecy"):0.00}");- var vecHeader = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), Height = 12 };- var vr = vecReadout; vr.HorizontalAlignment = HorizontalAlignment.Right; Grid.SetColumn(vr, 1);- vecHeader.Children.Add(Sec("VECTOR")); vecHeader.Children.Add(vr);- var vecDock = new DockPanel { LastChildFill = true };- DockPanel.SetDock(vecHeader, Dock.Top); vecDock.Children.Add(vecHeader);- vecDock.Children.Add(new Border { Margin = new Thickness(0, 5, 0, 0), Child = pad });- var vecCol = new Border { Width = 238, Padding = new Thickness(9, 8), Child = vecDock };-- // ---- REACT column ---------------------------------------------------- var scope = new FluxReactScope { VerticalAlignment = VerticalAlignment.Stretch };- var scopeVals = new float[8];-- // source picker.- var srcCombo = new ComboBox { FontSize = 9, MinWidth = 108, Foreground = TealBright, VerticalAlignment = VerticalAlignment.Center };- var srcIds = new List<int> { -1 };- srcCombo.Items.Add("No source");- int nt = engine.TrackCount;- for (int i = 0; i < nt; i++)- {- if (!engine.TryGetTrackInfo(i, out var ti) || ti.Id == track) continue;- string kd = ti.IsReturn ? "Return" : ti.IsInstrument ? "Instr" : "Audio";- srcIds.Add(ti.Id);- srcCombo.Items.Add($"{i + 1} · {kd}");+ pad.Reset = () =>+ {+ Begin("vecx"); Begin("vecy");+ if (I("vecx") is var xi and >= 0) SetP("vecx", engine.InstrumentParamDefault(track, xi));+ if (I("vecy") is var yi and >= 0) SetP("vecy", engine.InstrumentParamDefault(track, yi));+ End("vecx"); End("vecy");+ Refresh();+ };+ ToolTip.SetTip(pad, "Drag to blend the four timbres · double-click to reset");+ if (I("vecx") is var vxi and >= 0) MidiLearn.Bind(pad, MidiTarget.PluginParam(track, -1, vxi), "Vector X");++ bool VectorPulled() => live && TargetIdx() == 3;+ bool Ghost() => Math.Abs(effX - G("vecx")) > 0.012 || Math.Abs(effY - G("vecy")) > 0.012;++ var vecReadout = Mono("");+ var vecFoot = Mono("");+ readouts.Add(() =>+ {+ if (!pad.Dragging) pad.SetValue(G("vecx"), G("vecy"));+ pad.SetGhost(effX, effY, Ghost());+ vecReadout.Text = $"x {Coord(G("vecx"))} · y {Coord(G("vecy"))}";+ vecReadout.Foreground = VectorPulled() ? AccentBright : TextSecondary;+ bool pulled = VectorPulled();+ vecFoot.Text = pulled ? "dashed — where the reaction pulls"+ : Ghost() ? "dashed — where motion drifts" : "four timbres · drag the point";+ vecFoot.Foreground = pulled ? NotaPalette.TealBright : TextTertiary;+ });++ var vecGrid = new Grid { RowDefinitions = new RowDefinitions($"{HeadH},*,{StatusH}") };+ vecGrid.Children.Add(HeaderStrip(Head(Cap("VECTOR"), vecReadout)));+ var padHost = new Border { Padding = new Thickness(6), Child = pad };+ Grid.SetRow(padHost, 1); vecGrid.Children.Add(padHost);+ var vecFootHost = FootStrip(vecFoot);+ Grid.SetRow(vecFootHost, 2); vecGrid.Children.Add(vecFootHost);+ var vecPanel = SectionBox(vecGrid);+ vecPanel.Width = SideW;++ // ---- React --------------------------------------------------------------+ // Source picker: a sunken field that opens the other tracks; the list is read when+ // it opens, so a track added since the card was built is there.+ string SourceName(int id)+ {+ if (id < 0) return "No source";+ for (int i = 0; i < engine.TrackCount; i++)+ {+ if (!engine.TryGetTrackInfo(i, out var ti) || ti.Id != id) continue;+ string name = engine.GetTrackName(id);+ if (string.IsNullOrWhiteSpace(name)) name = $"Track {i + 1}";+ string kind = ti.Type switch { 2 => " · return", 3 => " · bus", _ => "" };+ return name + kind;+ }+ return "No source";}- srcCombo.SelectedIndex = Math.Max(0, srcIds.IndexOf(engine.InstrumentSidechainSource(track)));- srcCombo.SelectionChanged += (_, _) =>+ var srcText = new TextBlock { FontSize = 8, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis, MaxWidth = 110 };+ var srcChevron = new Glyph(GlyphKind.ChevronDown, 7) { Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(6, 0, 0, 0) };+ var srcField = new Border{- int sel = srcCombo.SelectedIndex;- if (sel < 0 || sel >= srcIds.Count) return;- engine.SetInstrumentSidechainSource(track, srcIds[sel]);- ctx.NotifyChanged();+ Height = 15, MinWidth = 92, CornerRadius = NotaRadius.Badge, BorderBrush = BorderDef, BorderThickness = new Thickness(1),+ Padding = new Thickness(6, 0, 5, 0), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,+ Child = new DockPanel { Children = { Docked(srcChevron, Dock.Right), srcText } },};- var reactHead = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), Height = 16 };- reactHead.Children.Add(Sec("REACT", TealB));- var reactSub = Sec("the synth listens to a track"); reactSub.Margin = new Thickness(6, 0, 0, 0); Grid.SetColumn(reactSub, 1);- reactHead.Children.Add(reactSub);- Grid.SetColumn(srcCombo, 2); reactHead.Children.Add(srcCombo);-- var scopeHead = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), Height = 11 };- scopeHead.Children.Add(Sec("SIDECHAIN"));- var scopeSub = Mono("env · transients · tilt", TealB, 8); scopeSub.HorizontalAlignment = HorizontalAlignment.Right; Grid.SetColumn(scopeSub, 1);- scopeHead.Children.Add(scopeSub);- var scopeDock = new DockPanel { LastChildFill = true };- DockPanel.SetDock(scopeHead, Dock.Top); scopeDock.Children.Add(scopeHead);- scopeDock.Children.Add(new Border { Margin = new Thickness(0, 3, 0, 0), Child = scope });- var scopeBox = new Border { Background = Inset, BorderBrush = NotaPalette.GraphBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(6, 4), Child = scopeDock };-- // LISTEN knob + TARGET segmented.- var listen = InstrumentControls.InstKnob(ctx, idx, "listen", "LISTEN", DoRefresh, v => $"{v * 100:0}\u2009%", 40, 56, TealB);- var targetChips = new Border[4];- var targetRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2 };- void SyncTarget() { int cur = TargetIdx(); for (int i = 0; i < 4; i++) { bool on = i == cur; targetChips[i].Background = on ? NotaPalette.Wash(NotaPalette.Teal, 0x28) : Brushes.Transparent; targetChips[i].BorderBrush = on ? TealB : Brushes.Transparent; ((TextBlock)targetChips[i].Child!).Foreground = on ? TealBright : Muted; } }- for (int i = 0; i < 4; i++)- {- int iv = i;- var chip = new Border { CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Padding = new Thickness(7, 2), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = Targets[i], FontSize = 9, Foreground = Muted, HorizontalAlignment = HorizontalAlignment.Center } };- chip.PointerPressed += (_, _) => { Begin("target"); SetId("target", iv / 3f); End("target"); SyncTarget(); };- targetChips[i] = chip; targetRow.Children.Add(chip);+ ToolTip.SetTip(srcField, "Choose the track Flux listens to");+ void SetSource(int id)+ {+ engine.SetInstrumentSidechainSource(track, id);+ live = engine.InstrumentSidechainSource(track) >= 0;+ onsetLog.Clear(); perBar = 0;+ ctx.NotifyChanged();+ Refresh();}- readouts.Add(SyncTarget);- var targetBox = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Padding = new Thickness(2), Child = targetRow };- var targetStack = new StackPanel { Spacing = 3, VerticalAlignment = VerticalAlignment.Center, Children =- {- Sec("TARGET — what the reaction drives"), targetBox,- Mono("→ sidechain drags the vector in rhythm", Muted, 8),- } };- var reactBottom = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 12, Children = { listen, targetStack } };- var reactCol = new Border- {- Width = 340, Background = ReactBg, BorderBrush = Border2, BorderThickness = new Thickness(1, 2, 1, 0),- Padding = new Thickness(10, 8), Child = new DockPanel { LastChildFill = true }+ srcField.PointerPressed += (_, e) =>+ {+ if (!e.GetCurrentPoint(srcField).Properties.IsLeftButtonPressed) return;+ e.Handled = true;+ int cur = engine.InstrumentSidechainSource(track);+ var flyout = new MenuFlyout();+ var none = new MenuItem { Header = "No source", ToggleType = MenuItemToggleType.Radio, IsChecked = cur < 0 };+ none.Click += (_, _) => SetSource(-1);+ flyout.Items.Add(none);+ for (int i = 0; i < engine.TrackCount; i++)+ {+ if (!engine.TryGetTrackInfo(i, out var ti) || ti.Id == track) continue;+ int id = ti.Id;+ var mi = new MenuItem { Header = $"{i + 1} · {SourceName(id)}", ToggleType = MenuItemToggleType.Radio, IsChecked = id == cur };+ mi.Click += (_, _) => SetSource(id);+ flyout.Items.Add(mi);+ }+ flyout.ShowAt(srcField);+ };++ var reactCap = Cap("REACT");+ var reactSub = Note("the synth listens to a track");+ reactSub.Margin = new Thickness(6, 0, 0, 0);+ var reactHead = new Grid { Height = HeadH, ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), Margin = new Thickness(8, 0) };+ reactHead.Children.Add(reactCap);+ Grid.SetColumn(reactSub, 1); reactHead.Children.Add(reactSub);+ Grid.SetColumn(srcField, 2); reactHead.Children.Add(srcField);++ var scope = new FluxReactScope { VerticalAlignment = VerticalAlignment.Stretch, Live = live };++ var listen = PKnob("listen", "LISTEN", "Listen", Pct, NotaSize.KnobSecondary, 44, Teal);+ var targetSeg = Segments(Targets, TargetIdx, iv => { Begin("target"); SetP("target", iv / 3f); End("target"); Refresh(); },+ out var targetSync, fill: true, dim: () => !live, padX: 2);+ readouts.Add(targetSync);+ if (I("target") is var tgi and >= 0) MidiLearn.Bind(targetSeg, MidiTarget.PluginParam(track, -1, tgi), "Target");+ var targetHint = Mono("");+ var targetStack = new StackPanel+ {+ Spacing = 5, VerticalAlignment = VerticalAlignment.Center,+ Children = { Cap("TARGET — what the reaction drives"), targetSeg, targetHint },+ };+ string TargetLine() => !live ? "→ assign a source to turn the reaction on" : TargetIdx() switch+ {+ 0 => "→ the sidechain opens the filter",+ 1 => "→ the sidechain bends the pitch up",+ 2 => "→ the sidechain swells the space",+ _ => "→ the sidechain drags the vector in rhythm",};- var reactDock = (DockPanel)reactCol.Child!;- DockPanel.SetDock(reactHead, Dock.Top); reactDock.Children.Add(reactHead);- DockPanel.SetDock(reactBottom, Dock.Bottom); reactDock.Children.Add(reactBottom);- reactDock.Children.Add(new Border { Margin = new Thickness(0, 6, 0, 6), Child = scopeBox });-- // ---- MACROS column --------------------------------------------------- // A custom macro cell so Motion's readout can cycle the sync rate on click.- Control Macro(string id, string name, Func<float, string> fmt, Action<TextBlock>? decorate = null)- {- if (!idx.TryGetValue(id, out var i)) return new Panel();- var value = Mono(fmt(G(id)), TextPrimary, 8);- var knob = new Knob(G(id), 1.0) { Accent = true, Default = engine.InstrumentParamDefault(track, i), Width = 40, Height = 40 };- knob.ValueChanged += v => { engine.PluginParamSet(track, -1, i, (float)v); value.Text = fmt((float)v); DoRefresh(); };- knob.GestureBegin += () => Begin(id);- knob.GestureEnd += () => End(id);- ctx.AddInstFader(i, knob, value, fmt);- MidiLearn.Bind(knob, MidiTarget.PluginParam(track, -1, i), name);- decorate?.Invoke(value);- return KnobCell(name, knob, value, 56);+ readouts.Add(() =>+ {+ scope.Live = live;+ listen.Knob.IsDim = !live;+ reactCap.Foreground = live ? NotaPalette.TealBright : TextTertiary;+ reactSub.Foreground = live ? NotaPalette.TextMuted : TextDisabled;+ int src = engine.InstrumentSidechainSource(track);+ srcText.Text = SourceName(src);+ srcText.Foreground = live ? TextPrimary : TextDisabled;+ srcField.Background = live ? NotaPalette.SurfaceRaised : NotaPalette.BgSunken;+ targetHint.Text = TargetLine();+ targetHint.Foreground = live ? NotaPalette.TealBright : TextDisabled;+ });++ var reactBottom = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), ColumnSpacing = 10 };+ reactBottom.Children.Add(listen.Cell);+ Grid.SetColumn(targetStack, 1); reactBottom.Children.Add(targetStack);+ var reactBody = new Grid { RowDefinitions = new RowDefinitions("*,62"), RowSpacing = 5, Margin = new Thickness(7, 5, 7, 4) };+ reactBody.Children.Add(scope);+ var bottomHost = new Border+ {+ BorderBrush = NotaPalette.GraphBorder, BorderThickness = new Thickness(0, 1, 0, 0), Padding = new Thickness(0, 4, 0, 0), Child = reactBottom,+ };+ Grid.SetRow(bottomHost, 1); reactBody.Children.Add(bottomHost);++ var reactGrid = new Grid { RowDefinitions = new RowDefinitions($"{HeadH},*") };+ reactGrid.Children.Add(HeaderStrip(reactHead));+ Grid.SetRow(reactBody, 1); reactGrid.Children.Add(reactBody);+ var reactPanel = SectionBox(reactGrid);++ // ---- Macros -------------------------------------------------------------+ const double MacroSize = 26, MacroCell = 54;+ var motion = PKnob("motion", "MOTION", "Motion", v => $"{RateNames[RateIdx()]} · {Pct(v)}", MacroSize, MacroCell);+ // Click the Motion readout to step its tempo-sync rate.+ motion.Value.Cursor = new Cursor(StandardCursorType.Hand);+ motion.Value.Background = Brushes.Transparent;+ ToolTip.SetTip(motion.Value, "Click to change the Motion sync rate");+ motion.Value.PointerPressed += (_, e) =>+ {+ if (!e.GetCurrentPoint(motion.Value).Properties.IsLeftButtonPressed) return;+ e.Handled = true;+ Begin("motrate"); SetP("motrate", (RateIdx() + 1) % 6 / 5f); End("motrate");+ motion.Value.Text = $"{RateNames[RateIdx()]} · {Pct(G("motion"))}";+ Refresh();+ };+ var filter = PKnob("filter", "FILTER", "Filter", v => NotaNum.Hz(CutoffHz(v, G("vecx"), G("vecy"))), MacroSize, MacroCell);+ // The cutoff also moves with the vector — keep the readout honest while dragging it.+ readouts.Add(() => { if (!filter.Knob.Dragging) filter.Value.Text = NotaNum.Hz(CutoffHz(G("filter"), G("vecx"), G("vecy"))); });+ readouts.Add(() => { if (!motion.Knob.Dragging) motion.Value.Text = $"{RateNames[RateIdx()]} · {Pct(G("motion"))}"; });+ var macros = new[]+ {+ PKnob("age", "AGE", "Age", AgeWord, MacroSize, MacroCell).Cell,+ motion.Cell,+ filter.Cell,+ PKnob("env", "ENV", "Env", EnvWord, MacroSize, MacroCell).Cell,+ PKnob("space", "SPACE", "Space", Pct, MacroSize, MacroCell).Cell,+ };+ var macroGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,*,*"), RowDefinitions = new RowDefinitions("*,*") };+ for (int i = 0; i < macros.Length; i++)+ {+ Grid.SetColumn(macros[i], i % 3); Grid.SetRow(macros[i], i / 3);+ macroGrid.Children.Add(macros[i]);}+ var voiceRows = new StackPanel+ {+ Spacing = 4,+ Children =+ {+ Slider("GLIDE", "glide", () => GlideT(G("glide"))),+ Slider("TUNE", "tune", () => Cents(G("tune"))),+ Slider("GAIN", "gain", () => Pct(G("gain"))),+ },+ };+ var macroFoot = Mono("adaptive: reso · a/r · unison", TextDisabled);+ var macroBody = new Grid { RowDefinitions = new RowDefinitions("*,Auto,Auto"), Margin = new Thickness(8, 4, 8, 0) };+ macroBody.Children.Add(macroGrid);+ var voiceHost = new Border+ {+ BorderBrush = NotaPalette.GraphBorder, BorderThickness = new Thickness(0, 1, 0, 0), Padding = new Thickness(0, 5, 0, 5), Child = voiceRows,+ };+ Grid.SetRow(voiceHost, 1); macroBody.Children.Add(voiceHost);+ var macroFootHost = FootStrip(macroFoot);+ macroFootHost.Margin = new Thickness(-8, 0);+ Grid.SetRow(macroFootHost, 2); macroBody.Children.Add(macroFootHost);++ var macroGridHost = new Grid { RowDefinitions = new RowDefinitions($"{HeadH},*") };+ macroGridHost.Children.Add(HeaderStrip(Head(Cap("MACROS"), Note("one knob each"))));+ Grid.SetRow(macroBody, 1); macroGridHost.Children.Add(macroBody);+ var macroPanel = SectionBox(macroGridHost);+ macroPanel.Width = SideW;- var macroRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Children =- {- Macro("age", "AGE", v => AgeWord(v)),- Macro("motion", "MOTION", v => $"{RateNames[RateIdx()]} · {v * 100:0}\u2009%", MakeRateCycler),- Macro("filter", "FILTER", v => $"{60 * Math.Pow(300, v):0}\u2009Hz"),- Macro("env", "ENV", v => v < 0.4f ? "pad" : v < 0.6f ? "pad⇢pluck" : "pluck"),- Macro("space", "SPACE", v => $"{v * 100:0}\u2009%"),- } };- var macroHead = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), Height = 12 };- macroHead.Children.Add(Sec("MACROS"));- var mh = Sec("one knob each · rest is adaptive"); mh.HorizontalAlignment = HorizontalAlignment.Right; Grid.SetColumn(mh, 1);- macroHead.Children.Add(mh);- var macroDock = new DockPanel { LastChildFill = true };- DockPanel.SetDock(macroHead, Dock.Top); macroDock.Children.Add(macroHead);- var macroFoot = Mono("resonance · attack/release · unison — adaptive", NotaPalette.TextDisabled, 8);- macroFoot.HorizontalAlignment = HorizontalAlignment.Center;- DockPanel.SetDock(macroFoot, Dock.Bottom); macroDock.Children.Add(macroFoot);- macroDock.Children.Add(macroRow);- var macroCol = new Border { Padding = new Thickness(10, 8), Child = macroDock };-- // Click the Motion readout to cycle the tempo-sync rate.- void MakeRateCycler(TextBlock value)- {- value.Cursor = new Cursor(StandardCursorType.Hand);- SetToolTip(value, "Click to change Motion sync rate");- value.PointerPressed += (_, _) =>+ // ---- status strip -------------------------------------------------------+ string Summary()+ {+ if (!live)+ {+ var w = Weights(G("vecx"), G("vecy"));+ var parts = new List<string>();+ for (int i = 0; i < 4; i++) parts.Add($"{WorldNames[i]} {Pct((float)w[i])}");+ return $"Vector x {Coord(G("vecx"))} · y {Coord(G("vecy"))} → {string.Join(" · ", parts)} · react off";+ }+ string src = SourceName(engine.InstrumentSidechainSource(track));+ string what = TargetIdx() switch{- int r = (RateIdx() + 1) % 6;- Begin("motrate"); SetId("motrate", r / 5f); End("motrate");- DoRefresh();+ 3 => $"vector x {Coord(G("vecx"))} → {Coord(effX)}",+ 0 => $"cutoff +{Pct(react * 0.45f)} of range",+ 1 => NotaNum.Unit(react * 3, "+0.0;−0.0;0", "st"),+ _ => $"space +{Pct(react * 0.5f)}",};+ string hits = perBar == 1 ? "1 transient per bar" : $"{perBar} transients per bar";+ return $"{src} → {Targets[TargetIdx()].ToLowerInvariant()} · listen {Pct(G("listen"))} · {hits} · {what}";}+ string Meta() => $"MOTION {RateNames[RateIdx()]} · TUNE {Cents(G("tune"))} · GAIN {Pct(G("gain"))}";- // ---- assemble body --------------------------------------------------- var body = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,*"), Background = NotaPalette.BgApp };- Grid.SetColumn(vecCol, 0); Grid.SetColumn(reactCol, 1); Grid.SetColumn(macroCol, 2);- body.Children.Add(vecCol); body.Children.Add(reactCol); body.Children.Add(macroCol);+ var statusBar = new Grid { Height = StatusH, ColumnDefinitions = new ColumnDefinitions("*,Auto"), ColumnSpacing = 10 };+ statusBar.Children.Add(status);+ Grid.SetColumn(meta, 1); statusBar.Children.Add(meta);+ var statusHost = new Border+ {+ Height = StatusH, BorderBrush = BorderDef, BorderThickness = new Thickness(0, 1, 0, 0),+ Background = NotaPalette.SurfaceAbyss, Padding = new Thickness(8, 0), Child = statusBar,+ };- void DoRefresh() { foreach (var r in readouts) r(); }+ // ---- assembly -----------------------------------------------------------+ var body = new Grid+ {+ ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = NotaSpace.DeviceGap,+ Margin = new Thickness(NotaSpace.DeviceGap),+ };+ body.Children.Add(vecPanel);+ Grid.SetColumn(reactPanel, 1); body.Children.Add(reactPanel);+ Grid.SetColumn(macroPanel, 2); body.Children.Add(macroPanel);- void Refresh()+ DockPanel.SetDock(statusHost, Dock.Bottom);+ var root = new DockPanel { LastChildFill = true, Background = NotaPalette.Gutter, Children = { statusHost, body } };++ // Live tick: the scope, the pulled vector, transients per bar, then every readout.+ void Tick(){- int n = engine.InstrumentScope(track, scopeVals);- if (n >= 4)+ int n = engine.InstrumentScope(track, sc);+ live = engine.InstrumentSidechainSource(track) >= 0;+ if (n >= 6){- scope.Push(scopeVals[0], scopeVals[1], scopeVals[2]); // env, transient, tilt- pad.SetValue(G("vecx"), G("vecy"));- if (n >= 6)- {- double ex = scopeVals[4], ey = scopeVals[5];- bool moved = Math.Abs(ex - G("vecx")) > 0.012 || Math.Abs(ey - G("vecy")) > 0.012;- pad.SetGhost(ex, ey, moved);- }+ react = live ? sc[3] : 0f;+ effX = sc[4]; effY = sc[5];+ scope.Live = live;+ if (live) scope.Push(sc[0], sc[1], sc[2], react);}- DoRefresh();+ if (n >= 8 && live)+ {+ double now = clock.Elapsed.TotalSeconds;+ onsetLog.Enqueue((now, sc[7]));+ double bar = 4 * 60.0 / Math.Max(20, engine.Bpm);+ while (onsetLog.Count > 1 && now - onsetLog.Peek().T > bar) onsetLog.Dequeue();+ perBar = (int)Math.Max(0, sc[7] - onsetLog.Peek().Count);+ }+ Refresh();}- ctx.SetInstLiveViz(Refresh);- DoRefresh();- return body;+ ctx.SetInstLiveViz(Tick);+ Tick();+ return root;}- private static void SetToolTip(Control c, string text) => ToolTip.SetTip(c, text);+ private static T Docked<T>(T c, Dock d) where T : Control { DockPanel.SetDock(c, d); return c; }++ // A device section: card ground, hairline, radius 6 — the almanac's section box.+ private static Border SectionBox(Control child) => new()+ {+ Background = NotaPalette.SurfaceCard, BorderBrush = BorderDef, BorderThickness = new Thickness(1),+ CornerRadius = NotaRadius.Tile, ClipToBounds = true, Child = child,+ };++ // A section's own header strip: a hairline under it, nothing else.+ private static Border HeaderStrip(Control child) => new()+ {+ BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 0, 1), Child = child,+ };++ // A section's foot line: a hairline over one mono sentence.+ private static Border FootStrip(Control child) => new()+ {+ BorderBrush = NotaPalette.GraphBorder, BorderThickness = new Thickness(0, 1, 0, 0),+ Padding = new Thickness(8, 0), MinHeight = 16, Child = child,+ };}diff --git a/src/managed/Nota.Infrastructure/Persistence/FactoryPresetCatalog.cs b/src/managed/Nota.Infrastructure/Persistence/FactoryPresetCatalog.csindex daa6184f..af412d23 100644--- a/src/managed/Nota.Infrastructure/Persistence/FactoryPresetCatalog.cs+++ b/src/managed/Nota.Infrastructure/Persistence/FactoryPresetCatalog.cs@@ -582,14 +582,41 @@ public sealed class FactoryPresetCatalog : IFactoryPresetsInst("grain", 10, "Shimmer", ("scanmode", 0.5f), ("coarse", 0.75f), ("grainsize", 0.5f), ("density", 0.8f), ("pitchrand", 0.1f), ("spread", 0.6f), ("filfreq", 1f), ("release", 0.6f), ("volume", 0.76f));Inst("grain", 10, "Sub Grain", ("scanmode", 0.5f), ("coarse", 0.25f), ("grainsize", 0.6f), ("density", 0.7f), ("filfreq", 0.4f), ("filreso", 0.2f), ("volume", 0.85f));- // ---- Nota Flux (kind 11) — vector-morph synth. Vector (X,Y) blends WARM/GLASS/- // MOOG/GRAIN; target: 0 Filter, 1 Pitch, 2 Space, 3 Vector (=1.0).+ // ---- Nota Flux (kind 11) — vector-morph synth, 25 presets. Vector (X,Y) blends the+ // corners WARM (0,0) · GLASS (1,0) · MOOG (0,1) · GRAIN (1,1); target: 0 Filter,+ // 1/3 Pitch, 2/3 Space, 1 Vector; motrate 0 1/1 · .2 1/2 · .4 1/4 · .6 1/8 ·+ // .8 1/8T · 1 1/16; env 0 pad → 1 pluck; tune 0.5 = 0 ct. React needs a source+ // track — without one the patch plays as it is drawn.+ // Pads and textures.Inst("flux", 11, "Warm Drift", ("vecx", 0.34f), ("vecy", 0.28f), ("age", 0.30f), ("motion", 0.45f), ("motrate", 0.4f), ("filter", 0.62f), ("env", 0.55f), ("space", 0.40f), ("listen", 0.72f), ("target", 1f));+ Inst("flux", 11, "Velvet Pad", ("vecx", 0.12f), ("vecy", 0.18f), ("age", 0.35f), ("motion", 0.35f), ("motrate", 0.2f), ("filter", 0.50f), ("env", 0.10f), ("space", 0.60f), ("listen", 0.50f), ("target", 1f));+ Inst("flux", 11, "Grain Pad", ("vecx", 0.80f), ("vecy", 0.85f), ("age", 0.60f), ("motion", 0.50f), ("motrate", 0.2f), ("filter", 0.50f), ("env", 0.35f), ("space", 0.55f), ("listen", 0.5f), ("target", 1f));+ Inst("flux", 11, "Tape Choir", ("vecx", 0.30f), ("vecy", 0.35f), ("age", 0.75f), ("motion", 0.40f), ("motrate", 0f), ("filter", 0.45f), ("env", 0.20f), ("space", 0.70f), ("listen", 0.40f), ("target", 2f / 3f));+ Inst("flux", 11, "Slow Tide", ("vecx", 0.60f), ("vecy", 0.20f), ("age", 0.40f), ("motion", 0.80f), ("motrate", 0f), ("filter", 0.52f), ("env", 0f), ("space", 0.75f), ("listen", 0.30f), ("target", 1f));+ Inst("flux", 11, "Dust Drone", ("vecx", 0.85f), ("vecy", 0.90f), ("age", 0.90f), ("motion", 0.65f), ("motrate", 0f), ("filter", 0.40f), ("env", 0f), ("space", 0.85f), ("tune", 0.47f), ("listen", 0.40f), ("target", 1f));+ Inst("flux", 11, "Grain Storm", ("vecx", 1f), ("vecy", 1f), ("age", 0.80f), ("motion", 0.70f), ("motrate", 1f), ("filter", 0.60f), ("env", 0.40f), ("space", 0.50f), ("listen", 0.70f), ("target", 1f));+ // Keys and plucks.Inst("flux", 11, "Glass Keys", ("vecx", 0.85f), ("vecy", 0.15f), ("age", 0.10f), ("motion", 0.20f), ("filter", 0.72f), ("env", 0.82f), ("space", 0.30f), ("listen", 0.4f), ("target", 0f));+ Inst("flux", 11, "Glass Pluck", ("vecx", 0.90f), ("vecy", 0.08f), ("age", 0.05f), ("motion", 0.10f), ("filter", 0.70f), ("env", 0.95f), ("space", 0.35f), ("listen", 0.60f), ("target", 0f));+ Inst("flux", 11, "Crystal Bells", ("vecx", 1f), ("vecy", 0f), ("age", 0f), ("motion", 0.15f), ("motrate", 0.6f), ("filter", 0.82f), ("env", 0.90f), ("space", 0.60f), ("listen", 0.40f), ("target", 2f / 3f));+ Inst("flux", 11, "Night Keys", ("vecx", 0.70f), ("vecy", 0.30f), ("age", 0.45f), ("motion", 0.20f), ("motrate", 0.2f), ("filter", 0.55f), ("env", 0.75f), ("space", 0.45f), ("listen", 0.50f), ("target", 0f));+ Inst("flux", 11, "Digital Rain", ("vecx", 0.95f), ("vecy", 0.60f), ("age", 0.15f), ("motion", 0.50f), ("motrate", 1f), ("filter", 0.75f), ("env", 0.92f), ("space", 0.55f), ("listen", 0.60f), ("target", 2f / 3f));+ // Basses.Inst("flux", 11, "Moog Bass", ("vecx", 0.05f), ("vecy", 0.90f), ("age", 0.35f), ("motion", 0.10f), ("filter", 0.45f), ("env", 0.70f), ("space", 0.15f), ("listen", 0.3f), ("target", 0f));- Inst("flux", 11, "Grain Pad", ("vecx", 0.80f), ("vecy", 0.85f), ("age", 0.60f), ("motion", 0.50f), ("motrate", 0.2f), ("filter", 0.50f), ("env", 0.35f), ("space", 0.55f), ("listen", 0.5f), ("target", 3f / 3f));+ Inst("flux", 11, "Sub Pressure", ("vecx", 0f), ("vecy", 1f), ("age", 0.10f), ("motion", 0f), ("filter", 0.35f), ("env", 0.65f), ("space", 0.05f), ("listen", 0.80f), ("target", 0f));+ Inst("flux", 11, "Rubber Bass", ("vecx", 0.20f), ("vecy", 0.95f), ("age", 0.20f), ("motion", 0.05f), ("filter", 0.40f), ("env", 0.80f), ("space", 0.05f), ("glide", 0.15f), ("listen", 0.50f), ("target", 0f));+ // Leads and brass.+ Inst("flux", 11, "Moog Lead", ("vecx", 0.10f), ("vecy", 0.75f), ("age", 0.25f), ("motion", 0.10f), ("filter", 0.66f), ("env", 0.60f), ("space", 0.20f), ("glide", 0.30f), ("listen", 0.30f), ("target", 1f / 3f));+ Inst("flux", 11, "Portamento Lead",("vecx", 0.55f), ("vecy", 0.15f), ("age", 0.15f), ("motion", 0.10f), ("filter", 0.70f), ("env", 0.55f), ("space", 0.30f), ("glide", 0.45f), ("listen", 0.30f), ("target", 1f / 3f));+ Inst("flux", 11, "Analog Brass", ("vecx", 0.15f), ("vecy", 0.55f), ("age", 0.30f), ("motion", 0.10f), ("filter", 0.60f), ("env", 0.45f), ("space", 0.25f), ("listen", 0.40f), ("target", 0f));+ Inst("flux", 11, "Broken Radio", ("vecx", 0.75f), ("vecy", 0.70f), ("age", 1f), ("motion", 0.55f), ("motrate", 0.6f), ("filter", 0.42f), ("env", 0.50f), ("space", 0.30f), ("listen", 0.60f), ("target", 1f));+ // Reactive — give them a drum or bass track as the source.Inst("flux", 11, "Reactive Vector",("vecx", 0.30f), ("vecy", 0.30f), ("age", 0.25f), ("motion", 0.30f), ("filter", 0.6f), ("env", 0.5f), ("space", 0.50f), ("listen", 0.90f), ("target", 1f));Inst("flux", 11, "Filter Chase", ("vecx", 0.45f), ("vecy", 0.50f), ("age", 0.20f), ("motion", 0.25f), ("filter", 0.55f), ("env", 0.5f), ("space", 0.35f), ("listen", 0.85f), ("target", 0f));+ Inst("flux", 11, "Pumping Chords", ("vecx", 0.40f), ("vecy", 0.25f), ("age", 0.20f), ("motion", 0.15f), ("filter", 0.60f), ("env", 0.35f), ("space", 0.40f), ("listen", 1f), ("target", 0f));+ Inst("flux", 11, "Duck Space", ("vecx", 0.55f), ("vecy", 0.30f), ("age", 0.20f), ("motion", 0.20f), ("filter", 0.58f), ("env", 0.25f), ("space", 0.80f), ("listen", 0.85f), ("target", 2f / 3f));+ Inst("flux", 11, "Vector Dance", ("vecx", 0.50f), ("vecy", 0.50f), ("age", 0.20f), ("motion", 0.60f), ("motrate", 0.6f), ("filter", 0.60f), ("env", 0.60f), ("space", 0.35f), ("listen", 0.90f), ("target", 1f));+ Inst("flux", 11, "Pitch Wobble", ("vecx", 0.20f), ("vecy", 0.50f), ("age", 0.30f), ("motion", 0.30f), ("filter", 0.55f), ("env", 0.55f), ("space", 0.30f), ("listen", 0.70f), ("target", 1f / 3f));// ---- Nota Rhythm (kind 12) — drum-machine kit voicings. Voices: 0 Kick, 1 Snare,// 2 Clap, 3 Rim, 4 Closed Hat, 5 Open Hat, 6 Tom, 7 Perc. Param id "v{n}_{p}"diff --git a/src/native/nota.engine/src/FluxSynth.h b/src/native/nota.engine/src/FluxSynth.hindex eed8fa16..07416481 100644--- a/src/native/nota.engine/src/FluxSynth.h+++ b/src/native/nota.engine/src/FluxSynth.h@@ -8,13 +8,15 @@//// Vector (X,Y) blends four "timbre worlds" at the pad corners into one voice engine// WARM (saw, warm) · GLASS (bright square) · MOOG (fat, resonant) · GRAIN (gritty/noise)-// Osc (saw↔square↔noise morph) + Sub → drive (tanh) → TPT SVF low-pass → Amp (ADSR)-// then a shared Space stage (mini stereo reverb + width). Age adds analog wear-// (per-voice detune drift + hiss). Motion is a tempo-synced internal drift of the vector.+// Osc (saw↔square↔noise morph, plus a detuned twin — the adaptive unison) + Sub → drive+// (tanh) → TPT SVF low-pass → Amp (ADSR), then a shared Space stage (mini stereo reverb ++// width). Age adds analog wear (per-voice detune drift + hiss). Motion is a tempo-synced+// internal drift of the vector. Resonance, unison and drive are never set directly: each+// world carries its own, and the vector blends them ("adaptive").//// React: the sidechain's envelope / transients / spectral tilt drive one Target —// Filter, Pitch, Space, or Vector (drags the pad dot in rhythm). With no source-// assigned it self-listens to its own output so the section still breathes.+// assigned React is off: the followers fall to rest and nothing is modulated.//// All parameters ride the Instrument plugin-param interface (normalized 0..1, stable ids)// → automation / persist / clone for free. Header-only, allocation-free after construction.@@ -44,7 +46,9 @@ public:kNumParams};// Live telemetry (scopeRead) — the editor draws the React scope + the moving pad dot.- enum Scope { S_Env = 0, S_Transient, S_Tilt, S_React, S_VecX, S_VecY, S_Active, kScopeN };+ // S_Onsets counts detected transients since construction (the editor turns it into+ // transients per bar); S_Source is 1 while a source is assigned.+ enum Scope { S_Env = 0, S_Transient, S_Tilt, S_React, S_VecX, S_VecY, S_Active, S_Onsets, S_Source, kScopeN };FluxSynth() {set(VecX, 0.34f); set(VecY, 0.28f);@@ -138,17 +142,22 @@ public:v->freqTarget = 440.0 * std::pow(2.0, (pitch - 69) / 12.0);v->freqCur = (glideOn && lastFreq_ > 0.0) ? lastFreq_ : v->freqTarget;v->vel = velocity;- v->phM = 0.0; v->phMu = 0.25; v->phS = 0.0;+ v->phM = 0.0; v->phMu = noise(); v->phS = 0.0; // the unison twin starts off-phasev->aEnv = 0.0f; v->aStage = Stage::Attack;v->s1[0] = v->s1[1] = 0.0;v->rndDet = noise() * 2.0f - 1.0f;v->pan = (noise() * 2.0f - 1.0f);v->active = true;+ v->seq = ++noteSeq_;lastFreq_ = v->freqTarget;}+ // Releases the oldest held note of this pitch only: a repeated note that starts a hair+ // before the previous one ends keeps sounding when the old one lets go.void noteOff(int32_t pitch) override {+ Voice* oldest = nullptr;for (auto& v : voices_)- if (v.active && v.pitch == pitch && v.aStage != Stage::Release) v.aStage = Stage::Release;+ if (v.active && v.pitch == pitch && v.aStage != Stage::Release && (!oldest || v.seq < oldest->seq)) oldest = &v;+ if (oldest) oldest->aStage = Stage::Release;}void allNotesOff() override { for (auto& v : voices_) v.active = false; }@@ -190,6 +199,11 @@ public:const double m01 = std::clamp(waveMix * 2.0, 0.0, 1.0); // saw → squareconst double noiseMix = std::clamp((waveMix - 0.5) * 2.0, 0.0, 1.0);const float subLvl = (float)w.subLvl;+ // Adaptive unison: a twin of the morph oscillator, detuned by the world's spread+ // (and a little more with Age), mixed in at equal power.+ const double uniMix = std::clamp(w.uni, 0.0, 1.0);+ const double uniDet = std::exp2(uniMix * (7.0 + get(Age) * 8.0) / 1200.0);+ const double uniNorm = 1.0 / std::sqrt(1.0 + uniMix * uniMix);// amp ADSR from Env macro (pad ⇠⇢ pluck).const double e = get(Env);@@ -209,7 +223,6 @@ public:const float wetAmt = space * 0.6f;const double driftInc = 0.4 * invSr; // ~0.4 Hz analog drift- double outSq = 0.0;int active = 0;for (int32_t i = 0; i < frames; ++i) {driftPhase_ += driftInc; if (driftPhase_ >= 1.0) driftPhase_ -= 1.0;@@ -226,13 +239,13 @@ public:const double f = v.freqCur * tuneMult * pitchReactMult * std::exp2(cents / 1200.0);const double inc = f * invSr;- // Morph oscillator: saw → square → noise.- const double saw = (2.0 * v.phM - 1.0) - polyBlep(v.phM, inc);- double sq = v.phM < 0.5 ? 1.0 : -1.0;- sq += polyBlep(v.phM, inc);- double p2 = v.phM + 0.5; if (p2 >= 1.0) p2 -= 1.0;- sq -= polyBlep(p2, inc);- double tone = saw + (sq - saw) * m01;+ // Morph oscillator: saw → square → noise, with its detuned twin.+ double tone = morph(v.phM, inc, m01);+ if (uniMix > 1e-3) {+ const double inc2 = inc * uniDet;+ tone = (tone + morph(v.phMu, inc2, m01) * uniMix) * uniNorm;+ v.phMu += inc2; if (v.phMu >= 1.0) v.phMu -= 1.0;+ }tone = tone * (1.0 - noiseMix) + (noise() * 2.0f - 1.0f) * noiseMix;v.phM += inc; if (v.phM >= 1.0) v.phM -= 1.0;@@ -260,16 +273,11 @@ public:r = std::tanh(r * gain);out[i * 2] += l;out[i * 2 + 1] += r;- outSq += (double)mono * mono;}for (auto& v : voices_) if (v.active) ++active;activeVoices_.store(active, std::memory_order_relaxed);- // Self-listen fallback level: a gentle follower on our own output.- const float outRms = frames > 0 ? (float)std::sqrt(outSq / frames) : 0.0f;- selfEnv_ += (outRms - selfEnv_) * 0.10f;-// Publish telemetry for the editor.scope_[S_Env].store(scFast_, std::memory_order_relaxed);scope_[S_Transient].store(scTransient_, std::memory_order_relaxed);@@ -278,6 +286,8 @@ public:scope_[S_VecX].store((float)vx, std::memory_order_relaxed);scope_[S_VecY].store((float)vy, std::memory_order_relaxed);scope_[S_Active].store((float)active, std::memory_order_relaxed);+ scope_[S_Onsets].store((float)onsets_, std::memory_order_relaxed);+ scope_[S_Source].store(hasSource_ ? 1.0f : 0.0f, std::memory_order_relaxed);}private:@@ -287,12 +297,13 @@ private:static constexpr double kMotBeats[6] = { 4.0, 2.0, 1.0, 0.5, 1.0 / 3.0, 0.25 };// A timbre "world" at a pad corner. Bilinearly blended by the vector (X,Y).- struct World { double wave, subLvl, cutoff, reso, drive, bright; };- // wave sub cutoff reso drive bright- static constexpr World WARM {0.15, 0.45, 0.42, 0.12, 0.30, 0.20}; // top-left- static constexpr World GLASS {0.70, 0.08, 0.88, 0.30, 0.12, 0.95}; // top-right- static constexpr World MOOG {0.05, 0.70, 0.38, 0.62, 0.55, 0.10}; // bottom-left- static constexpr World GRAIN {0.85, 0.20, 0.55, 0.22, 0.80, 0.55}; // bottom-right+ // The editor mirrors these (FluxInstrumentCard) to read the cutoff back in Hz.+ struct World { double wave, subLvl, cutoff, reso, drive, bright, uni; };+ // wave sub cutoff reso drive bright unison+ static constexpr World WARM {0.15, 0.45, 0.42, 0.12, 0.30, 0.20, 0.55}; // top-left+ static constexpr World GLASS {0.70, 0.08, 0.88, 0.30, 0.12, 0.95, 0.35}; // top-right+ static constexpr World MOOG {0.05, 0.70, 0.38, 0.62, 0.55, 0.10, 0.00}; // bottom-left+ static constexpr World GRAIN {0.85, 0.20, 0.55, 0.22, 0.80, 0.55, 0.25}; // bottom-rightstatic World blend(double x, double y) {const double wt = (1 - x) * (1 - y), gt = x * (1 - y), mt = (1 - x) * y, rt = x * y;auto mix = [&](double a, double b, double c, double d) { return a * wt + b * gt + c * mt + d * rt; };@@ -301,7 +312,8 @@ private:mix(WARM.cutoff, GLASS.cutoff, MOOG.cutoff, GRAIN.cutoff),mix(WARM.reso, GLASS.reso, MOOG.reso, GRAIN.reso),mix(WARM.drive, GLASS.drive, MOOG.drive, GRAIN.drive),- mix(WARM.bright, GLASS.bright, MOOG.bright, GRAIN.bright) };+ mix(WARM.bright, GLASS.bright, MOOG.bright, GRAIN.bright),+ mix(WARM.uni, GLASS.uni, MOOG.uni, GRAIN.uni) };}enum class Stage { Attack, Decay, Sustain, Release, Off };@@ -311,6 +323,7 @@ private:double freqTarget = 0.0, freqCur = 0.0;double phM = 0.0, phMu = 0.0, phS = 0.0;float vel = 0.0f, aEnv = 0.0f, rndDet = 0.0f, pan = 0.0f;+ uint32_t seq = 0; // note-on order, for noteOffStage aStage = Stage::Attack;double s1[2] = {0, 0};};@@ -318,7 +331,8 @@ private:// ---- React analysis: fast/slow envelope, transient, spectral tilt -----void analyzeSidechain(int32_t frames) {double sumSq = 0.0, sumHi = 0.0;- if (scBuf_ && scFrames_ > 0) {+ hasSource_ = scTrackId_.load(std::memory_order_relaxed) >= 0;+ if (hasSource_ && scBuf_ && scFrames_ > 0) {const int n = std::min(frames, scFrames_);for (int i = 0; i < n; ++i) {const float m = 0.5f * (scBuf_[i * 2] + scBuf_[i * 2 + 1]);@@ -329,21 +343,38 @@ private:const float rms = n > 0 ? (float)std::sqrt(sumSq / n) : 0.0f;const float hi = n > 0 ? (float)std::sqrt(sumHi / n) : 0.0f;const float tilt = std::clamp(hi / (rms + 1e-5f) * 0.8f, 0.0f, 1.0f);- updateFollowers(rms, tilt);+ updateFollowers(rms, tilt, frames);} else {- // No source: self-listen so the React scope still breathes.- updateFollowers(selfEnv_, scTilt_);+ // No source (or a silent one): the followers fall to rest, tilt to neutral.+ updateFollowers(0.0f, 0.5f, frames);}// consume the buffer (only valid for this block).scBuf_ = nullptr; scFrames_ = 0;}- void updateFollowers(float rms, float tilt) {- scFast_ += (rms - scFast_) * (rms > scFast_ ? 0.6f : 0.08f);- scSlow_ += (rms - scSlow_) * 0.03f;- scTransient_ = std::clamp((scFast_ - scSlow_) * 5.0f, 0.0f, 1.0f);- scTilt_ += (tilt - scTilt_) * 0.15f;+ // The followers run once per block with time constants, so they behave the same at any+ // block size (tuned at 512 frames / 48 kHz: attack ~12 ms, release ~130 ms, slow ~350 ms).+ float coef(int32_t frames, double tauSec) const {+ return (float)(1.0 - std::exp(-(double)std::max<int32_t>(1, frames) / (tauSec * sampleRate_)));+ }+ void updateFollowers(float rms, float tilt, int32_t frames) {+ const float prevFast = scFast_;+ scFast_ += (rms - scFast_) * coef(frames, rms > scFast_ ? 0.0117 : 0.128);+ scSlow_ += (rms - scSlow_) * coef(frames, 0.35);+ // Transient = how far the fast follower jumps above the slow one, relative to it, so+ // a quiet source registers its hits as clearly as a loud one (gated at about −50 dB).+ scTransient_ = scFast_ > 0.003f ? std::clamp((scFast_ / (scSlow_ + 1e-3f) - 1.0f) * 0.5f, 0.0f, 1.0f) : 0.0f;+ scTilt_ += (tilt - scTilt_) * coef(frames, 0.066);+ // An onset: the fast follower jumps (by a fifth or more) while standing clear of the+ // slow one. One per hit — it re-arms only once the level has fallen a third below the+ // hit's peak, so the ripple of a low note inside one hit doesn't count twice.+ if (!onsetArmed_) {+ onsetPeak_ = std::max(onsetPeak_, scFast_);+ if (scFast_ < onsetPeak_ * 0.67f) onsetArmed_ = true;+ } else if (scTransient_ > 0.35f && scFast_ > prevFast * 1.2f) {+ ++onsets_; onsetArmed_ = false; onsetPeak_ = scFast_;+ }const float env01 = std::clamp(scFast_ * 3.5f, 0.0f, 1.0f);- reactAmt_ = get(Listen) * env01;+ reactAmt_ = hasSource_ ? get(Listen) * env01 : 0.0f;}// ---- helpers ----------------------------------------------------------@@ -375,6 +406,15 @@ private:(void)k;return v2; // low-pass}+ // One sample of the saw → square morph at phase `ph` (band-limited with polyBLEP).+ static double morph(double ph, double inc, double m01) {+ const double saw = (2.0 * ph - 1.0) - polyBlep(ph, inc);+ double sq = ph < 0.5 ? 1.0 : -1.0;+ sq += polyBlep(ph, inc);+ double p2 = ph + 0.5; if (p2 >= 1.0) p2 -= 1.0;+ sq -= polyBlep(p2, inc);+ return saw + (sq - saw) * m01;+ }static double polyBlep(double t, double dt) {if (dt <= 0.0) return 0.0;if (t < dt) { double x = t / dt; return x + x - x * x - 1.0; }@@ -428,6 +468,7 @@ private:bool playing_ = false;double motionPhase_ = 0.0, driftPhase_ = 0.0;double lastFreq_ = 0.0;+ uint32_t noteSeq_ = 0;double a1_ = 0.0, a2_ = 0.0, a3_ = 0.0; // shared filter coeffs (block rate)uint32_t rng_ = 0x9E3779B9u;@@ -436,7 +477,10 @@ private:int32_t scFrames_ = 0;std::atomic<int32_t> scTrackId_{-1};float scLp_ = 0.0f, scFast_ = 0.0f, scSlow_ = 0.0f, scTransient_ = 0.0f, scTilt_ = 0.5f;- float reactAmt_ = 0.0f, selfEnv_ = 0.0f;+ float reactAmt_ = 0.0f;+ bool hasSource_ = false, onsetArmed_ = true;+ float onsetPeak_ = 0.0f;+ uint32_t onsets_ = 0;std::atomic<int32_t> activeVoices_{0};std::atomic<float> scope_[kScopeN];diff --git a/tests/Nota.SmokeTest/DesignTokenCheck.cs b/tests/Nota.SmokeTest/DesignTokenCheck.csindex 58969435..6c6a3706 100644--- a/tests/Nota.SmokeTest/DesignTokenCheck.cs+++ b/tests/Nota.SmokeTest/DesignTokenCheck.cs@@ -385,9 +385,9 @@ internal static class DesignTokenCheckyield return (Regex.IsMatch(kit, @"HeaderH = 22;"), "device card header is 22px");// Accepted exceptions (decided 2026-09-16): plug-in / parameter stubs are narrow; the- // Rhythm, Flux, Bass and Physical instruments keep their wider layouts.+ // Rhythm, Bass and Physical instruments keep their wider layouts.var exempt = new HashSet<string> { "PluginDeviceBody.cs", "GenericParamDeviceBody.cs", "GenericMidiBody.cs",- "RhythmInstrumentCard.cs", "FluxInstrumentCard.cs", "BassInstrumentCard.cs", "PhysicalInstrumentCard.cs" };+ "RhythmInstrumentCard.cs", "BassInstrumentCard.cs", "PhysicalInstrumentCard.cs" };var off = Directory.EnumerateFiles(Path.Combine(app, "DeviceCards"), "*.cs", SearchOption.AllDirectories).Where(f => !exempt.Contains(Path.GetFileName(f))).SelectMany(f => Regex.Matches(File.ReadAllText(f), @"public double (?:Card)?Width => (?<w>[0-9]+);")diff --git a/tests/Nota.SmokeTest/Program.cs b/tests/Nota.SmokeTest/Program.csindex eabafd88..d298f7d4 100644--- a/tests/Nota.SmokeTest/Program.cs+++ b/tests/Nota.SmokeTest/Program.cs@@ -2538,14 +2538,91 @@ Console.WriteLine("-- Nota Flux --");fe.PluginParamSet(t, -1, vx, 0.34f); fe.PluginParamSet(t, -1, vy, 0.28f);var rbuf = new float[4096 * 2];fe.Seek(0.0); fe.Play();- float envSeen = 0f;- var sc = new float[8];- for (int b = 0; b < 20; b++) { fe.RenderOffline(rbuf, 4096); int n = fe.InstrumentScope(t, sc); if (n >= 4) envSeen = Math.Max(envSeen, sc[0]); }+ float envSeen = 0f, reactSeen = 0f, pulled = 0f;+ var sc = new float[9];+ int scN = 0;+ for (int b = 0; b < 20; b++)+ {+ fe.RenderOffline(rbuf, 4096); scN = fe.InstrumentScope(t, sc);+ if (scN >= 6) { envSeen = Math.Max(envSeen, sc[0]); reactSeen = Math.Max(reactSeen, sc[3]); pulled = Math.Max(pulled, sc[4] - 0.34f); }+ }fe.StopTransport();+ Check(scN == 9, $"Flux scope publishes 9 values (got {scN})");Check(envSeen > 0.001f, $"React scope registers the sidechain envelope (env {envSeen:F3})");+ Check(reactSeen > 0.01f && pulled > 0.01f, $"React on Vector pulls the vector with a source (react {reactSeen:F3}, Δx {pulled:F3})");+ Check(sc[7] >= 2 && sc[8] == 1f, $"React counts the source's transients (onsets {sc[7]:F0}, source {sc[8]:F0})");fe.SetInstrumentSidechainSource(t, -1);Check(fe.InstrumentSidechainSource(t) == -1, "instrument sidechain clears");+ // From here on the master is Flux alone: silence the duplicate and the drum source.+ fe.SetTrackMute(t2, true); fe.SetTrackMute(drum, true);++ // With no source React is off: its own loud notes don't modulate anything.+ fe.SetClipNotes(t, 0, new[] { new NotaNote(48, 0.0, 3.0, 1f), new NotaNote(55, 0.0, 3.0, 1f), new NotaNote(60, 0.0, 3.0, 1f) });+ float reactOff = 0f, driftOff = 0f;+ fe.Seek(0.0); fe.Play();+ for (int b = 0; b < 12; b++)+ {+ fe.RenderOffline(rbuf, 4096);+ if (fe.InstrumentScope(t, sc) >= 9) { reactOff = Math.Max(reactOff, sc[3]); driftOff = Math.Max(driftOff, sc[8]); }+ }+ FluxStop();+ Check(reactOff == 0f && driftOff == 0f, $"no source → React is off (react {reactOff:F3})");++ // A repeated note that starts before the previous one ends keeps sounding when the old+ // one's note-off arrives. A plucky, dry patch, so a released voice is silent in the+ // window: the overlapping pair must stay well above the first note on its own.+ int envI = -1, spI = -1;+ for (int i = 0; i < pc; i++) { string pid = fe.PluginParamId(t, -1, i); if (pid == "env") envI = i; else if (pid == "space") spI = i; }+ fe.PluginParamSet(t, -1, envI, 0.8f); fe.PluginParamSet(t, -1, spI, 0f);+ float WindowRms(NotaNote[] notes)+ {+ fe.SetClipNotes(t, 0, notes);+ var obuf = new float[FluxFrames(2.2) * 2];+ fe.Seek(0.0); fe.Play(); FluxRender(obuf); FluxStop();+ int from = FluxFrames(1.4), len = FluxFrames(0.4);+ double acc = 0; for (int i = from; i < from + len; i++) acc += obuf[i * 2] * obuf[i * 2];+ return (float)Math.Sqrt(acc / len);+ }+ float alone = WindowRms(new[] { new NotaNote(60, 0.0, 1.02, 0.9f) });+ float held = WindowRms(new[] { new NotaNote(60, 0.0, 1.02, 0.9f), new NotaNote(60, 1.0, 1.5, 0.9f) });+ Check(held > 0.01f && held > alone * 5, $"Flux: an overlapping repeat of a note keeps sounding (RMS {held:F3} vs {alone:F4} released)");+ int FluxFrames(double beats) => (int)Math.Round(beats * 60.0 / 120.0 * (fe.SampleRate > 0 ? fe.SampleRate : 48000.0));+ // Stop, then render a stopped block so the engine flushes held voices (it releases them+ // on the play→stop edge it sees while rendering).+ void FluxStop() { fe.StopTransport(); fe.RenderOffline(new float[64 * 2], 64); }+ void FluxRender(float[] buf) // in 4096-frame blocks, as the engine's host would+ {+ var blk = new float[4096 * 2];+ for (int at = 0; at < buf.Length / 2; at += 4096)+ {+ int n = Math.Min(4096, buf.Length / 2 - at);+ fe.RenderOffline(blk, n);+ Array.Copy(blk, 0, buf, at * 2, n * 2);+ }+ }++ // Factory presets: 25 ship, every named param is a real Flux id, each applies in place+ // and renders audible and finite.+ {+ var cat = new FactoryPresetCatalog();+ var mine = cat.All().Where(p => p.IsInstrument && p.BuiltinKind == 11).ToList();+ Check(mine.Count == 25, $"Nota Flux ships 25 factory presets (got {mine.Count})");+ var bad = mine.SelectMany(p => cat.Document(p.Id)!.NamedParams!.Keys.Where(k => !fIds.Contains(k)).Select(k => $"{p.DisplayName}:{k}")).ToList();+ Check(bad.Count == 0, $"every Flux preset param id exists{(bad.Count > 0 ? " — bad: " + string.Join(", ", bad) : "")}");+ fe.SetClipNotes(t, 0, new[] { new NotaNote(48, 0.0, 1.5, 0.9f), new NotaNote(55, 0.0, 1.5, 0.9f), new NotaNote(62, 0.5, 1.0, 0.9f) });+ var off = new System.Collections.Generic.List<string>();+ var pbuf = new float[FluxFrames(2.0) * 2];+ foreach (var p in mine)+ {+ if (cat.ApplyInPlace(fe, p.Id, t, -1).Length != 0) { off.Add($"{p.DisplayName} (apply)"); continue; }+ fe.Seek(0.0); fe.Play(); FluxRender(pbuf); FluxStop();+ bool ok = true; foreach (var x in pbuf) if (!float.IsFinite(x) || Math.Abs(x) > 1.01f) { ok = false; break; }+ float rms = Rms(pbuf, pbuf.Length / 2);+ if (!ok || rms < 0.01f) off.Add($"{p.DisplayName} ({rms:F3})");+ }+ Check(off.Count == 0, $"every Flux preset applies and renders audible and finite{(off.Count > 0 ? " — off: " + string.Join(", ", off) : "")}");+ }}// ============================ Sampler ======================================