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
Align the UI with the Nota Design Almanac
Egor Khindikaynenabca8d78c07d
diff --git a/.claude/skills/nota-design/SKILL.md b/.claude/skills/nota-design/SKILL.mdindex 1097f298..12222d40 100644--- a/.claude/skills/nota-design/SKILL.md+++ b/.claude/skills/nota-design/SKILL.md@@ -1,107 +1,111 @@---name: nota-design-description: Nota's UI design language — "Ember", a warm-graphite palette with a brass accent, in two variants (Ember Graphite dark, Ember Paper light), used across the Avalonia/C# desktop app. Use whenever building or restyling any Nota UI (windows, panels, controls, device cards, custom-drawn views like the piano roll / waveform / arrangement) so everything stays visually consistent. Points at the authoritative token files and the full guideline rather than restating values.+description: Nota's UI design language — "Ember", warm neutrals with a single brass accent, in two variants (Ember Graphite dark, Ember Paper light), derived from the Nota Design Almanac and used across the Avalonia/C# desktop app. Use whenever building or restyling any Nota UI (windows, panels, controls, device cards, custom-drawn views like the piano roll / waveform / arrangement) so everything stays visually consistent. Points at the authoritative token files and the full guideline rather than restating values.user-invocable: true---# Nota design language — Ember-Warm neutrals (hue ~40°) lit by a single **brass** accent, in two variants:-**Ember Graphite** (dark, the default — a DAW is used in dark rooms for long sessions)-and **Ember Paper** (light — same hues and roles, brass darkened to bronze so a mark-carries the same emphasis against paper). Preferences → Appearance picks Dark / Light /-System; switching is live.+Warm neutrals (hue ~40°) lit by exactly one accent, **brass**, in two variants:+**Ember Graphite** (dark, the default) and **Ember Paper** (light — same roles, brass+darkened to bronze). Preferences → Appearance picks Graphite / Paper / System; the switch+is live. The rules come from the **Nota Design Almanac** (`nota-design/Nota.html`, beside+the mockups); `DESIGN.md` is that almanac as the app implements it, plus the departures+the project accepted.## Read these first — do not work from memory| File | What it gives you ||---|---|-| `DESIGN.md` | **The guideline.** Rules, every token value, device-card conventions, the control kit, known drift. Start here. |-| `DESIGN.html` | The same thing rendered — swatches, live control specimens, card anatomy at true size. Open it when the question is "what should this look like". |-| `src/managed/Nota.App/Theme/NotaTheme.axaml` | **Definitive** source of colour, geometry and control styles. |-| `src/managed/Nota.App/Theme/NotaPalette.cs` | Mirror of the above for custom-drawn views. Kept in sync by hand. |-| `src/managed/Nota.App/Theme/NotaThemeService.cs` | Applies a variant to both layers and repaints. |-| `src/managed/Nota.App/DeviceCardKit.cs` | Palette aliases + atomic builders for device cards. |+| `DESIGN.md` | **The guideline.** Rules, every token value for both variants, type scales, number setting, controls and states, device cards, shell, the tests, accepted departures, known drift. Start here. |+| `DESIGN.html` | The same thing rendered — swatches, control specimens, a device card at true size, Graphite/Paper toggle. Generated by `scripts/design-html.py`. |+| `src/managed/Nota.App/Theme/NotaTheme.axaml` | **Definitive** colour (Dark + Light), geometry, type classes, control styles. |+| `Theme/NotaPalette.cs` | Colour slots for custom-drawn views (`Wash`, `Ink`, `Derived`). |+| `Theme/NotaGeometry.cs` · `NotaFonts.cs` · `NotaNum.cs` | Radii/sizes/spacing · Geist typefaces and type scale · number formatting. |+| `DeviceCardKit.cs`, `Controls/` | The shared controls and card builders; `Controls/NotaGraph.cs` for graph windows. |+| `tests/Nota.SmokeTest/DesignTokenCheck.cs` | The guard tests — run the smoke test after any UI change. |If `DESIGN.md` / `DESIGN.html` disagree with the theme files, **the theme files win** andthe docs need fixing. Say so rather than propagating the drift.> This skill deliberately does **not** restate token values. An earlier version did, and-> it drifted a whole palette out of date — it still described a cool-slate scheme with a-> cyan accent long after the app moved to Ember Graphite. Read the files.+> it drifted a whole palette out of date. Read the files.## Non-negotiables-- **Never hardcode a colour or size in a view.** XAML: `{DynamicResource Brush.*}` —- a `StaticResource` cannot follow the variant — and `{StaticResource Radius.*}` for- geometry. Custom-drawn C#: `NotaPalette` (a named token, `Wash(slot, alpha)`, or- `Ink("#hex")` for a one-off device hue) or `DeviceCardKit`. A literal is not just- off-palette, it is stuck in one variant.-- **Nothing may snapshot a colour.** `NotaPalette` hands out long-lived brushes whose- `Color` is re-pointed on a variant change, so `new SolidColorBrush(slot.Color)` freezes- the view. A `static readonly Color` must become a property; a gradient must come from- `NotaPalette.VGradient`; anything a view derives itself must be dropped on- `NotaPalette.Changed`.-- **One accent, spent sparingly.** Brass marks primary actions, selection, focus, active- state, and the time-domain data that is the point of a DAW. Everything else is neutral.- Green / amber / red are status only.-- **Flat fills.** No gradients, no textures, no background images, no glow.-- **Structure over shadows.** 1px `Brush.BorderDefault` lines separate panels. Shadows- only for floating layers.-- **No scale or bounce.** Motion is 100–240ms ease-out, opacity + ≤6px translate.-- **Mono means data.** Numbers that are read, compared or aligned use `Font.Mono`;- prose never does.-- **Sentence case, no emoji.** The only glyphs allowed as text are `·` and the transport- symbols already in use.--## Device cards — the two-colour rule--Cards are a fixed 260px tall (`DeviceCardKit.CardH`): header 26 · LIVE strip 34 · body 200.--- **Brass = the audio path.** Anything the signal passes through. On a knob: `Accent = true`.-- **Teal `#5B9E9C` = modulation and detection.** LFOs, envelopes, sidechain detectors,- followers. Pass as the knob's `ArcColor`; group behind a 2px teal left border with a- teal section label.-- **Output rail stays muted** — `Brush.BorderStrong`, not brass.--Full anatomy, frame specs and rail dimensions: see `DESIGN.md` § Device cards.+Most of these are enforced by `DesignTokenCheck`; the smoke test fails when one breaks.++- **No literals in views.** XAML: `{DynamicResource Brush.*}` (a `StaticResource` cannot+ follow the variant) and `{StaticResource Radius.*|Control.*|Space.*}`. C#: `NotaPalette`+ (a slot, `Wash(slot, alpha)`, `Ink("#hex")` for a one-off device hue), `NotaRadius`,+ `NotaSize`, `NotaSpace`, `NotaFonts`, `NotaType`. No hex outside `Ink()`, no RGB typed as+ numbers, no `Colors.X` / `Brushes.X` except `Transparent`, no font family names.+- **Nothing may snapshot a colour.** `new SolidColorBrush(slot.Color)`, a+ `static readonly Color` or brush built from the palette, or a static array of palette+ colours freezes the view in one variant. Use the slot, `Wash`, `Derived`, a property, or+ read `.Color` inside `Render`. Track colours: `ArrangementView.TrackBrush(index)`.+- **One accent.** Brass means active, selected, changed. Red is recording and overload+ only; green and yellow are meter zones and live signal. There is no second accent.+- **Role chromas (brass · teal · rose · steel) live only inside graphs**, in that order,+ never on buttons or as state. A modulated knob's arc takes its source's chroma.+- **Flat, three levels deep.** No gradients, glow, textures or drop shadows (only a+ floating plugin window has one). Depth is lightness + hairline + an inner top line.+- **Opacity is not a state.** Disabled and muted take the next Ink step; use+ `Inactive.Set` for a subtree. The only allowed `Opacity` is a drag ghost.+- **State changes colour only** — never size, border width or position. Hover and colour+ transitions 120 ms ease-out; meters, playhead and spectra are never animated.+- **Geist for words, Geist Mono for measurements.** Nothing under 7 px.+- **Numbers are set, not printed.** The app installs a display culture (point decimal,+ U+2212 minus). Put a thin space ` ` before units, keep precision fixed (dB one+ decimal, tempo two, percent whole, Hz up to 999 then `3.2 k`) — use `NotaNum` helpers.+- **Icons are geometry.** `Glyph` / `GlyphKind`; no unicode symbols (`■ ▶ ● ✓ ★ ▾`…) and+ no emoji as text. `·` separates meta; `→` in prose is fine.+- **Copy:** English. Parameter labels caps, one word, no vowel-dropped contractions+ (`FEEDBACK`, not `FDBK`; `FREQ`/`RESO`/`THRESH` are allowed). Tooltips short and+ verb-first. Sentence case. Empty states are one Ink 5 line.++## Device cards++- **700 × 260** (`DeviceCardKit.CardH`; width exceptions are listed in `DESIGN.md`).+- **Header 22:** name left; processing-type badge (mono caps) and bypass right — nothing+ else. Presets, A/B, move, delete go in the header's right-click menu.+- **Body:** inset 6, sections radius 6 with gap 5; columns choice → work → output.+- Brass for the audio path and active state; modulation shows its source chroma; graphs go+ through `NotaGraph` (Well, hairline, radius 4, corner axis labels, no fills under curves).## Adding a control-Reuse the kit before writing anything new — `Knob`, `KnobCell`, `ValueBar`, `MiniFader`,-`VFader`, `PanKnob`, `DragNumber`, `MeterBar`, `ChipRow`, `Labeled`, `TextButton`,-`NaBadge`. The inventory with sizes is in `DESIGN.md` § Control kit.+Reuse before writing: `Knob` (sizes snap to 34/36/44), `DeviceCardKit.KnobCell` (53 tall),+`SwitchTrack` / `DeviceCardKit.Switch` (18 × 10), `DeviceCardKit.Segments`, `SliderTrack` /+`DeviceCardKit.SliderRow`, `MiniFader`, `PanBar`, `VFader`, `DragNumber`, `MeterBar` /+`StereoMeter` / `GrMeter`, `Glyph`, `NaBadge`. Sizes and specs: `DESIGN.md` § Controls.-If you do add one, it **must** match the shared interaction contract:+A new value control **must** match the interaction contract:-- Vertical drag, up increases, full range over ~140px+- Vertical drag, up increases, full range over ~140 px; Shift/Ctrl/⌘ for fine steps;+ `ns-resize`; a click never jumps the value; no horizontal drag- Double-click restores the default-- Left button only — right-click must bubble to the CV-modulate menu+- Left button only — right-click must bubble to the CV-modulate / MIDI Learn menu- `GestureBegin` / `GestureEnd` bracket `BeginAutomationWrite` / `EndAutomationWrite`- Register with `MidiLearn.Bind`- Live-follow refresher that **skips while dragging**-- Mono readout so width does not jump--## Visualisers--A device draws **the thing it does**, not a generic graph — and where possible draws it-for real (the reverb tail is an actual impulse response; amp harmonics come from pushing-a sine through the real waveshaper). Ground is `Brush.BgSunken` with a `#221F1A` inner-border. Families and existing views: `DESIGN.md` § Visualisers.+- Mono readout so width does not jump; the value is always visible, not only in a tooltip## Applying it (Avalonia)-- `NotaTheme.axaml` is merged in `App.axaml`; the app runs `RequestedThemeVariant="Dark"`.-- Button classes: `primary`, `secondary` (default), `ghost`, `danger`. Transport chrome:- `tp-icon`, `tp-play`, `chip`, `seg`. Containers: `Border.Card`, `Border.Panel`,- `Border.well`.-- Text classes: `Heading`, `Caption`, `SectionLabel`, `Mono`.-- Custom-drawn views may cache token colours as fields, but the values must match the- theme exactly.+- `NotaTheme.axaml` is merged in `App.axaml`; `NotaThemeService` applies the variant to both+ layers. `NotaNum.Install()` runs in `App.Initialize`.+- Buttons: default (raised), `primary` (one solid brass action per context), `ghost`,+ `cell`, `chip`, `tp-icon`, `tp-play`; `ToggleButton.seg` inside `Border.segmented`.+ Containers: `Border.Panel`, `Border.Card`, `Border.well`, `Border.transport`,+ `Border.console`. Fields: `TextBox.field`, `TextBox.search`.+- Text: shell `Title`, `Heading`, `Name`, `Caption`, `SectionLabel`, `Readout`, `Value`,+ `Eyebrow`; device `DeviceName`, `DeviceSection`, `RowLabel`, `KnobLabel`, `KnobValue`,+ `Axis`.-## When you change a colour+## When you change a token1. Edit **both** branches in `NotaTheme.axaml` — `Dark` and `Light`.-2. Mirror the pair into the `NotaPalette` slot — nothing enforces this.-3. Update `DESIGN.md` **and** `DESIGN.html` so the docs stay true.-4. Check it in both variants. `DESIGN.html` has a variant toggle in its masthead.+2. Mirror the pair into the `NotaPalette` slot — the smoke test checks the pair.+3. Run `python3 scripts/design-html.py` and update the table in `DESIGN.md`.+4. Check both variants — in the app and in `DESIGN.html` (`?variant=paper`).diff --git a/DESIGN.html b/DESIGN.htmlindex 6b7acabe..107860b3 100644--- a/DESIGN.html+++ b/DESIGN.html@@ -1,1352 +1,562 @@+<!-- SPDX-License-Identifier: AGPL-3.0-only -->+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->+<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8"><title>Ember</title><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>-<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap">-+<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap"><style>/* ============================================================================Ember — Nota's design system, documented in its own palette.- Every value below is lifted from src/managed/Nota.App/Theme/NotaTheme.axaml.- Two variants: Ember Graphite (dark, the default) and Ember Paper (light).- The toggle in the masthead flips data-variant on :root, so every specimen- on this page is rendered by the same tokens the app uses. Nothing here is- painted with a raw hex — that is the point.+ The colour variables below are generated from+ src/managed/Nota.App/Theme/NotaTheme.axaml (Dark → :root, Light → [data-variant=paper]).+ Generated by scripts/design-html.py — edit that, then rerun it. Every specimen on the page is painted+ through these variables — nothing uses a raw hex.========================================================================= */-:root {- /* Surfaces */- --surface-abyss: #0A0908;- --bg-sunken: #100F0D;- --bg-app: #171613;- --lane-b: #191814;- --surface-card: #1E1C18;- --surface-raised: #26231E;- --surface-hover: #2E2B24;- --surface-active: #332F27;- --surface-selected: #24D8A03D;- --surface-inset: #1B1916;- --graph-border: #221F1A;-- /* Grid lines */- --grid-beat: #1F1D18;- --grid-bar: #2A2721;-- /* Text */- --text-primary: #E9E4D8;+ --surface-abyss: #0A0908;+ --bg-app: #0B0A09;+ --gutter: #0C0B09;+ --bg-sunken: #100F0D;+ --panel: #141310;+ --surface-card: #171613;+ --surface-raised: #1C1A16;+ --surface-hover: #252219;+ --track-off: #26231E;+ --surface-active: #100F0D;+ --lane-b: #131210;+ --chrome-bg: #100F0D;+ --surface-selected: #241F17;+ --hairline: #221F1A;+ --border-default: #2C2923;+ --border-strong: #3A362D;+ --border-brass: #6B5326;+ --grid-beat: #1E1C18;+ --grid-bar: #2A2721;+ --text-heading: #F2EDE1;+ --text-primary: #E9E4D8;+ --text-strong: #C7C0B0;--text-secondary: #A39D8F;- --text-tertiary: #6E6A5E;- --text-disabled: #4A463D;+ --text-muted: #8D8779;+ --text-tertiary: #6E6A5E;+ --text-disabled: #55514A;+ --text-axis: #4A463D;--text-on-accent: #171613;-- /* Borders */- --border-default: #2C2923;- --border-strong: #3A362D;-- /* Accent (brass) + semantic */- --accent: #D8A03D;- --accent-hover: #E8B24C;+ --accent: #D8A03D;--accent-bright: #F0C060;- --accent-subtle: #24D8A03D;- --success: #58B368;+ --accent-hover: #E9BE6A;+ --accent-deep: #B08536;+ --accent-dim: #8A6B2E;+ --accent-edge: #5E4A22;+ --accent-subtle: #241F17;+ --record: #C25B44;+ --record-ink: #F4E3DC;+ --danger: #C2554A;+ --danger-hover: #D0685C;+ --danger-bright: #E08A72;+ --danger-subtle: rgba(194,85,74,0.200);--warning: #D9C34C;- --danger: #D95F4C;- --danger-hover: #E4715F;- --danger-subtle: #33D95F4C;-- /* Track palette + returns */- --track-1: #C4756A; --track-2: #C99C55; --track-3: #9BA65D; --track-4: #6FA383;- --track-5: #5B9E9C; --track-6: #6D8FB5; --track-7: #9B7FA6; --track-8: #B57286;- --return-a: #7C88A0; --return-b: #A08A7C;- --teal: #5B9E9C;-- /* Geometry */- --r-sm: 5px; --r-md: 7px; --r-lg: 10px; --r-xl: 14px; --r-clip: 4px; --r-pill: 8px;-- --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;- --font-mono: "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;-- --measure: 68ch;+ --success: #58B368;+ --success-dim: #7FB069;+ --chroma-teal: #5B9E9C;+ --chroma-teal-light: #7FC0BE;+ --chroma-rose: #B57286;+ --chroma-rose-light: #D79BAB;+ --chroma-steel: #6D8FB5;+ --track1: #58B368;+ --track2: #4E9E7A;+ --track3: #3E8E8E;+ --track4: #5AA0B8;+ --track5: #C77F55;+ --track6: #7A6FB0;+ --track7: #B05A7A;+ --track8: #9AA64A;+ --track9: #7FA88E;+ --return-a: #7FA88E;+ --return-b: #6B907B;+ --master: #D8A03D;+ --r-bar: 1px; --r-clip: 2px; --r-badge: 3px; --r-control: 4px;+ --r-tile: 5px; --r-panel: 6px; --r-body: 8px;+ --font-ui: "Geist", system-ui, sans-serif;+ --font-mono: "Geist Mono", ui-monospace, Menlo, monospace;+ --sunken: inset 0 1px 0 rgba(0,0,0,.5);+ --raised: inset 0 1px 0 rgba(255,255,255,.03);+ color-scheme: dark;}--/* Ember Paper — the same roles on a warm paper ground. Only the colour tokens- move; geometry and type are variant-independent. */:root[data-variant="paper"] {- --surface-abyss: #DCD6C5;- --bg-sunken: #E4DFD1;- --bg-app: #EFEADE;- --lane-b: #E9E4D6;- --surface-card: #F8F5EC;- --surface-raised: #FFFEF8;- --surface-hover: #E7E1D0;- --surface-active: #DBD4C0;- --surface-selected: #2EA87415;- --surface-inset: #E7E2D4;- --graph-border: #D5CFBE;-+ --surface-abyss: #D8D1BE;+ --bg-app: #DCD6C5;+ --gutter: #E0DAC9;+ --bg-sunken: #E4DFD1;+ --panel: #EAE5D7;+ --surface-card: #EFEADE;+ --surface-raised: #F8F5EC;+ --surface-hover: #E7E1D0;+ --track-off: #DBD4C0;+ --surface-active: #D5CEBB;+ --lane-b: #E7E2D4;+ --chrome-bg: #E4DFD1;+ --surface-selected: #F2E4C4;+ --hairline: #D5CFBE;+ --border-default: #D5CEBB;+ --border-strong: #BDB5A0;+ --border-brass: #C9A254;--grid-beat: #DED8C8;- --grid-bar: #CFC8B4;-- --text-primary: #241F17;+ --grid-bar: #CFC8B4;+ --text-heading: #1A150E;+ --text-primary: #241F17;+ --text-strong: #3E382C;--text-secondary: #5E5849;- --text-tertiary: #8A8474;- --text-disabled: #ADA694;+ --text-muted: #746D5C;+ --text-tertiary: #8A8474;+ --text-disabled: #9E9786;+ --text-axis: #ADA694;--text-on-accent: #FFFBF2;-- --border-default: #D5CEBB;- --border-strong: #BDB5A0;-- --accent: #A87415;- --accent-hover: #8F6110;+ --accent: #A87415;--accent-bright: #744D07;- --accent-subtle: #24A87415;- --success: #2C7A3E;- --warning: #837010;- --danger: #B03A28;+ --accent-hover: #8F6110;+ --accent-deep: #7A5008;+ --accent-dim: #9C8034;+ --accent-edge: #D3B173;+ --accent-subtle: #F2E4C4;+ --record: #B54A32;+ --record-ink: #FFF4EE;+ --danger: #B13E33;--danger-hover: #C64A36;- --danger-subtle: #33B03A28;-- --track-1: #9A4A3E; --track-2: #97682A; --track-3: #646E32; --track-4: #42765A;- --track-5: #2F7472; --track-6: #3E6288; --track-7: #6A5176; --track-8: #86465B;- --return-a: #4D5972; --return-b: #705B4E;- --teal: #2F7472;-}--/* Variant toggle */-.variant { display: inline-flex; gap: 2px; padding: 2px; margin-top: 18px;- background: var(--bg-sunken); border: 1px solid var(--border-default); border-radius: var(--r-sm); }-.variant button { appearance: none; border: 0; cursor: pointer; border-radius: 3px;- padding: 4px 12px; font: 500 11px/1.4 var(--font-ui); color: var(--text-secondary); background: transparent; }-.variant button[aria-pressed="true"] { background: var(--accent); color: var(--text-on-accent); font-weight: 600; }--* { box-sizing: border-box; }--body {- margin: 0;- background: var(--bg-sunken);- color: var(--text-primary);- font-family: var(--font-ui);- font-size: 14px;- line-height: 1.6;- -webkit-font-smoothing: antialiased;-}--/* ---- Shell -------------------------------------------------------------- */--.shell {- display: grid;- grid-template-columns: 220px minmax(0, 1fr);- gap: 0;- max-width: 1240px;- margin: 0 auto;- align-items: start;-}--.rail {- position: sticky;- top: 0;- height: 100vh;- overflow-y: auto;- padding: 32px 20px 32px 24px;- border-right: 1px solid var(--border-default);- background: var(--bg-sunken);-}--.rail__mark {- font-family: var(--font-mono);- font-size: 11px;- font-weight: 700;- letter-spacing: .14em;- text-transform: uppercase;- color: var(--accent);- margin: 0 0 4px;-}--.rail__sub {- font-size: 11px;- color: var(--text-tertiary);- margin: 0 0 24px;- line-height: 1.5;-}--.rail nav { display: flex; flex-direction: column; gap: 1px; }--.rail a {- display: block;- padding: 5px 9px;- border-radius: var(--r-sm);- color: var(--text-secondary);- text-decoration: none;- font-size: 12px;- transition: background .12s ease-out, color .12s ease-out;-}-.rail a:hover { background: var(--surface-hover); color: var(--text-primary); }-.rail a:focus-visible { outline: 1px solid var(--accent-bright); outline-offset: 1px; }--.main { padding: 32px 40px 96px; min-width: 0; }--/* ---- Masthead ----------------------------------------------------------- */--.masthead { padding: 8px 0 40px; border-bottom: 1px solid var(--border-default); margin-bottom: 40px; }--.masthead h1 {- font-size: clamp(34px, 5vw, 52px);- font-weight: 700;- letter-spacing: -.03em;- line-height: 1.02;- margin: 0 0 16px;- text-wrap: balance;-}-.masthead h1 em { font-style: normal; color: var(--accent); }--.masthead p { max-width: var(--measure); color: var(--text-secondary); margin: 0 0 12px; }--.hue-strip { display: flex; height: 4px; border-radius: 2px; overflow: hidden; margin: 24px 0 0; }-.hue-strip span { flex: 1; }--/* ---- Sections ----------------------------------------------------------- */--section { margin-bottom: 52px; scroll-margin-top: 24px; }--.eyebrow {- font-family: var(--font-mono);- font-size: 10px;- font-weight: 700;- letter-spacing: .16em;- text-transform: uppercase;- color: var(--text-tertiary);- margin: 0 0 10px;-}--section > h2 {- font-size: 22px;- font-weight: 600;- letter-spacing: -.015em;- margin: 0 0 12px;- text-wrap: balance;-}--section > p { max-width: var(--measure); color: var(--text-secondary); margin: 0 0 20px; }--h3 {- font-size: 13px;- font-weight: 600;- color: var(--text-primary);- margin: 28px 0 12px;-}--a.inline { color: var(--accent-bright); text-decoration: none; border-bottom: 1px solid var(--border-strong); }-a.inline:hover { border-bottom-color: var(--accent); }--code {- font-family: var(--font-mono);- font-size: .87em;- color: var(--accent-bright);- background: var(--bg-app);- border: 1px solid var(--border-default);- border-radius: var(--r-clip);- padding: 1px 5px;-}--/* ---- Panel (mirrors Border.Card) --------------------------------------- */--.panel {- background: var(--surface-card);- border: 1px solid var(--border-default);- border-radius: var(--r-lg);- padding: 20px;-}--.note {- background: var(--bg-app);- border: 1px solid var(--border-default);- border-left: 2px solid var(--accent);- border-radius: var(--r-clip);- padding: 12px 16px;- font-size: 13px;- color: var(--text-secondary);- max-width: var(--measure);-}-.note.warn { border-left-color: var(--warning); }-.note strong { color: var(--text-primary); font-weight: 600; }--/* ---- Swatches ----------------------------------------------------------- */--.swatches {- display: grid;- grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));- gap: 10px;-}--.sw {- display: flex;- flex-direction: column;- gap: 0;- background: var(--surface-card);- border: 1px solid var(--border-default);- border-radius: var(--r-md);- overflow: hidden;- padding: 0;- font: inherit;- text-align: left;- color: inherit;- cursor: pointer;- transition: border-color .12s ease-out;-}-.sw:hover { border-color: var(--border-strong); }-.sw:focus-visible { outline: 1px solid var(--accent-bright); outline-offset: 1px; }--.sw__chip { height: 52px; border-bottom: 1px solid var(--border-default); }-.sw__meta { padding: 8px 10px 9px; }--.sw__key {- font-family: var(--font-mono);- font-size: 10.5px;- color: var(--text-primary);- display: block;- word-break: break-all;-}-.sw__hex {- font-family: var(--font-mono);- font-size: 10.5px;- color: var(--text-tertiary);- font-variant-numeric: tabular-nums;-}-.sw__role { font-size: 10.5px; color: var(--text-tertiary); }-.sw.copied .sw__hex { color: var(--accent-bright); }--/* Checkerboard behind translucent swatches so alpha reads honestly */-.alpha {- background-image:- linear-gradient(45deg, var(--surface-raised) 25%, transparent 25%),- linear-gradient(-45deg, var(--surface-raised) 25%, transparent 25%),- linear-gradient(45deg, transparent 75%, var(--surface-raised) 75%),- linear-gradient(-45deg, transparent 75%, var(--surface-raised) 75%);- background-size: 12px 12px;- background-position: 0 0, 0 6px, 6px -6px, -6px 0;-}-.alpha > i { display: block; height: 100%; }--/* ---- Tables ------------------------------------------------------------- */--.tablewrap { overflow-x: auto; border: 1px solid var(--border-default); border-radius: var(--r-md); }--table { border-collapse: collapse; width: 100%; font-size: 12.5px; min-width: 480px; }--th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border-default); }-th {- font-family: var(--font-mono);- font-size: 10px;- font-weight: 700;- letter-spacing: .12em;- text-transform: uppercase;- color: var(--text-tertiary);- background: var(--bg-app);-}-tr:last-child td { border-bottom: none; }-td.k { font-family: var(--font-mono); color: var(--text-primary); white-space: nowrap; }-td.v { font-family: var(--font-mono); color: var(--accent-bright); font-variant-numeric: tabular-nums; white-space: nowrap; }-td.d { color: var(--text-secondary); }--/* ---- Specimen surface --------------------------------------------------- */--.specimen {- background: var(--bg-app);- border: 1px solid var(--border-default);- border-radius: var(--r-md);- padding: 20px;- display: flex;- flex-wrap: wrap;- gap: 10px;- align-items: center;-}-.specimen.sunken { background: var(--bg-sunken); }-.specimen.col { flex-direction: column; align-items: stretch; gap: 14px; }--.specimen__label {- font-family: var(--font-mono);- font-size: 10px;- letter-spacing: .12em;- text-transform: uppercase;- color: var(--text-tertiary);- width: 100%;- margin-bottom: -2px;-}--/* ---- Real component specimens (1:1 with NotaTheme.axaml) ---------------- */--.btn {- height: 26px;- padding: 0 14px;- border-radius: var(--r-md);- font-family: var(--font-ui);- font-size: 11px;- font-weight: 500;- background: var(--surface-card);- color: var(--text-primary);- border: 1px solid var(--border-strong);- cursor: pointer;- transition: background .12s ease-out;-}-.btn:hover { background: var(--surface-hover); }-.btn:active { background: var(--surface-active); }-.btn:focus-visible { outline: none; border-color: var(--accent-bright); }--.btn--primary { background: var(--accent); color: var(--text-on-accent); border: none; }-.btn--primary:hover { background: var(--accent-hover); }-.btn--ghost { background: transparent; border: none; }-.btn--ghost:hover { background: var(--surface-hover); }-.btn--danger { background: var(--danger); color: var(--text-on-accent); border: none; }-.btn--danger:hover { background: var(--danger-hover); }-.btn[disabled] { color: var(--text-disabled); opacity: .55; cursor: not-allowed; }--.tgl {- height: 26px; padding: 0 12px; border-radius: var(--r-md);- font-family: var(--font-ui); font-size: 11px; font-weight: 500;- background: var(--surface-card); color: var(--text-secondary);- border: 1px solid var(--border-strong); cursor: pointer;- transition: background .12s ease-out;-}-.tgl:hover { background: var(--surface-hover); }-.tgl--on { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent-bright); }-.tgl--rec { background: var(--danger); border-color: var(--danger); color: var(--text-on-accent); }--.tp {- width: 28px; height: 28px; padding: 0;- border-radius: var(--r-sm);- background: var(--surface-raised);- border: 1px solid var(--border-strong);- color: var(--text-secondary);- font-size: 11px; cursor: pointer;- display: inline-flex; align-items: center; justify-content: center;-}-.tp:hover { background: var(--surface-hover); }-.tp--rec-on { background: #33D95F4C; border-color: var(--danger); color: var(--danger); }-.tp--play { width: 34px; background: var(--accent); border: none; color: var(--text-on-accent); }-.tp--session { background: var(--success); }--.chip {- height: 28px; padding: 0 9px;- border-radius: var(--r-sm);- background: var(--surface-raised);- color: var(--text-secondary);- border: 1px solid var(--border-strong);- font-family: var(--font-ui); font-size: 11px; cursor: pointer;- display: inline-flex; align-items: center;-}-.chip:hover { background: var(--surface-hover); }--.well {- height: 28px;- display: inline-flex; align-items: center;- padding: 0 10px;- background: var(--bg-sunken);- border: 1px solid var(--border-default);- border-radius: var(--r-sm);- font-family: var(--font-mono);- font-size: 11px;- color: var(--text-primary);- font-variant-numeric: tabular-nums;-}--.seg {- display: inline-flex; gap: 0; padding: 2px;- background: var(--bg-sunken);- border: 1px solid var(--border-default);- border-radius: var(--r-sm);-}-.seg button {- height: 22px; padding: 0 10px; border-radius: 3px;- background: transparent; border: none;- color: var(--text-secondary);- font-family: var(--font-ui); font-size: 11px; cursor: pointer;-}-.seg button[aria-pressed="true"] { background: var(--accent); color: var(--text-on-accent); font-weight: 600; }--.cbx { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-secondary); cursor: pointer; }-.cbx__box {- width: 16px; height: 16px; border-radius: var(--r-sm);- background: var(--bg-sunken); border: 1px solid var(--border-strong);- display: inline-flex; align-items: center; justify-content: center;-}-.cbx--on .cbx__box { background: var(--accent); border-color: var(--accent); }-.cbx--on { color: var(--text-primary); }-.cbx__box svg { display: block; }--.field {- height: 28px; padding: 0 9px;- background: var(--bg-sunken);- border: 1px solid var(--border-default);- border-radius: var(--r-sm);- color: var(--text-primary);- font-family: var(--font-ui); font-size: 11px;- min-width: 160px;-}-.field::placeholder { color: var(--text-tertiary); }-.field:focus { outline: none; border-color: var(--accent); }--.listbox {- background: var(--bg-sunken);- border: 1px solid var(--border-default);- border-radius: var(--r-md);- padding: 3px;- max-width: 260px;-}-.listbox div {- font-size: 11px; color: var(--text-secondary);- padding: 5px 8px; border-radius: var(--r-md); cursor: pointer;-}-.listbox div:hover { background: var(--surface-hover); }-.listbox div[aria-selected="true"] { background: var(--surface-selected); color: var(--text-primary); }--/* ---- Track colour cycle ------------------------------------------------- */--.tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }-.track {- border: 1px solid var(--border-default);- border-radius: var(--r-md);- background: var(--surface-card);- overflow: hidden;-}-.track__bar { height: 6px; }-.track__body { padding: 8px 10px; }-.track__name { font-size: 11px; color: var(--text-primary); }-.track__hex { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }--/* ---- Arrangement lane mock --------------------------------------------- */--.lane-demo {- border: 1px solid var(--border-default);- border-radius: var(--r-md);- overflow: hidden;- background: var(--bg-app);-}-.lane {- height: 40px;- position: relative;- border-bottom: 1px solid var(--border-default);- background:- repeating-linear-gradient(to right, var(--grid-bar) 0 1px, transparent 1px 80px),- repeating-linear-gradient(to right, var(--grid-beat) 0 1px, transparent 1px 20px),- var(--bg-app);-}-.lane:nth-child(even) { background:- repeating-linear-gradient(to right, var(--grid-bar) 0 1px, transparent 1px 80px),- repeating-linear-gradient(to right, var(--grid-beat) 0 1px, transparent 1px 20px),- var(--lane-b);-}-.lane:last-child { border-bottom: none; }-.clip {- position: absolute; top: 6px; bottom: 6px;- border-radius: var(--r-clip);- display: flex; align-items: center; padding: 0 7px;- font-size: 10px; color: var(--text-on-accent); font-weight: 500;- overflow: hidden; white-space: nowrap;-}-.playhead { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--accent-bright); }--/* ---- Do / Don't --------------------------------------------------------- */--.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 12px; }-.rule {- background: var(--surface-card);- border: 1px solid var(--border-default);- border-radius: var(--r-md);- padding: 14px 16px;-}-.rule h4 {- margin: 0 0 6px;- font-size: 12px;- font-weight: 600;- display: flex; align-items: center; gap: 7px;-}-.rule p { margin: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; }-.rule--do h4 { color: var(--success); }-.rule--dont h4 { color: var(--danger); }-.rule__glyph { font-family: var(--font-mono); font-size: 13px; }--footer {- border-top: 1px solid var(--border-default);- padding-top: 20px;- font-size: 12px;- color: var(--text-tertiary);- max-width: var(--measure);-}--/* ---- Device card anatomy ------------------------------------------------ */--.card-anatomy {- width: 100%;- max-width: 620px;- background: var(--bg-app);- border: 1px solid var(--border-default);- border-radius: var(--r-md);- overflow: hidden;- font-size: 11px;-}-.ca-row { display: flex; align-items: center; gap: 8px; padding: 0 9px; }-.ca-head { height: 26px; background: var(--surface-card); border-bottom: 1px solid var(--border-default); }-.ca-live { height: 34px; background: var(--surface-card); border-bottom: 1px solid var(--border-default); }-.ca-body { height: 132px; display: flex; }--.ca-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex: none; }-.ca-name { font-size: 11px; font-weight: 600; color: var(--text-primary); }-.ca-tag { font-size: 9px; font-weight: 700; letter-spacing: .08em; color: var(--text-tertiary); }-.ca-preset {- height: 18px; min-width: 92px; background: var(--bg-sunken);- border: 1px solid var(--border-default); border-radius: 4px;- display: flex; align-items: center; gap: 5px; padding: 0 6px;- font-size: 10px; color: var(--text-primary);-}-.ca-preset span:last-child { margin-left: auto; color: var(--text-tertiary); font-size: 8px; }-.ca-ab { display: flex; background: var(--bg-sunken); border: 1px solid var(--border-default); border-radius: 4px; padding: 1px; gap: 1px; }-.ca-ab i { font-style: normal; font-size: 9px; padding: 1px 6px; border-radius: 3px; color: var(--text-tertiary); }-.ca-ab i.on { background: var(--accent); color: var(--text-on-accent); font-weight: 600; }-.ca-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }-.ca-cpu { font-family: var(--font-mono); font-size: 9px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }-.ca-peak { font-family: var(--font-mono); font-size: 9px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }-.ca-meters { display: flex; flex-direction: column; gap: 2px; width: 46px; }-.ca-meters div { height: 3px; border-radius: 2px; background: var(--bg-sunken); overflow: hidden; display: flex; }-.ca-glyph { font-size: 10px; color: var(--text-tertiary); }--.ca-seclabel { font-size: 8px; font-weight: 700; letter-spacing: .1em; color: var(--text-tertiary); flex: none; }-.ca-slider { display: flex; align-items: center; gap: 5px; }-.ca-slider b { font-size: 8px; font-weight: 700; color: var(--text-tertiary); }-.ca-track { width: 50px; height: 3px; border-radius: 2px; background: var(--bg-sunken); position: relative; }-.ca-track i { position: absolute; inset: 0 auto 0 0; border-radius: 2px; }-.ca-thumb { position: absolute; top: -3px; width: 8px; height: 9px; border-radius: 2px; background: var(--text-secondary); margin-left: -4px; }-.ca-val { font-family: var(--font-mono); font-size: 9px; color: var(--text-primary); font-variant-numeric: tabular-nums; }--.ca-rail { width: 80px; flex: none; background: #1B1916; border-right: 1px solid var(--border-default); padding: 5px; display: flex; flex-direction: column; gap: 2px; }-.ca-tab { height: 20px; border-radius: 4px; border-left: 2px solid transparent; display: flex; align-items: center; padding: 0 7px; font-size: 10px; font-weight: 500; color: var(--text-tertiary); }-.ca-tab.on { background: var(--surface-raised); border-left-color: var(--accent); color: var(--text-primary); }-.ca-tab.mod.on { border-left-color: #5B9E9C; }-.ca-main { flex: 1; padding: 10px; display: flex; gap: 14px; align-items: center; }-.ca-out { width: 108px; flex: none; background: #1B1916; border-left: 1px solid var(--border-default); padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }-.ca-out .ca-track { width: auto; flex: 1; }-.ca-outrow { display: flex; align-items: center; gap: 5px; }-.ca-spine { border-left: 2px solid #5B9E9C; padding-left: 7px; display: flex; flex-direction: column; gap: 4px; }-.ca-spine .ca-seclabel { color: #5B9E9C; }--.ca-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 11px; color: var(--text-tertiary); }-.ca-legend span { display: inline-flex; align-items: center; gap: 6px; }-.ca-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }--/* Knob specimen drawn to the real geometry */-.knobcell { width: 58px; display: flex; flex-direction: column; align-items: center; gap: 1px; }-.knobcell figure { margin: 0; width: 38px; height: 38px; }-.knobcell .kv { font-family: var(--font-mono); font-size: 8px; color: var(--text-primary); }-.knobcell .kl { font-size: 8px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .02em; }--.kit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }-.kit {- background: var(--surface-card);- border: 1px solid var(--border-default);- border-radius: var(--r-md);- padding: 12px 14px;-}-.kit h4 { margin: 0 0 3px; font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--accent-bright); }-.kit .dim { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); display: block; margin-bottom: 6px; font-variant-numeric: tabular-nums; }-.kit p { margin: 0; font-size: 12px; color: var(--text-secondary); line-height: 1.5; }--.vizcat { margin-bottom: 14px; }-.vizcat h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--text-primary); }-.vizcat p { margin: 0; font-size: 12px; color: var(--text-secondary); line-height: 1.6; }-.vizcat code { font-size: 11px; }--@media (prefers-reduced-motion: reduce) {- * { transition: none !important; animation: none !important; }-}--@media (max-width: 860px) {- .shell { grid-template-columns: 1fr; }- .rail { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border-default); }- .rail nav { flex-direction: row; flex-wrap: wrap; gap: 2px; }- .main { padding: 28px 20px 72px; }-}+ --danger-bright: #A3391B;+ --danger-subtle: rgba(177,62,51,0.200);+ --warning: #837010;+ --success: #2C7A3E;+ --success-dim: #609548;+ --chroma-teal: #2F7472;+ --chroma-teal-light: #3E8A88;+ --chroma-rose: #86465B;+ --chroma-rose-light: #7F2D43;+ --chroma-steel: #3E6288;+ --track1: #328140;+ --track2: #306F53;+ --track3: #256464;+ --track4: #317187;+ --track5: #985127;+ --track6: #4B4082;+ --track7: #7F3450;+ --track8: #6C752C;+ --track9: #4D7A5D;+ --return-a: #4D7A5D;+ --return-b: #3E6A4D;+ --master: #A87415;+ --sunken: inset 0 1px 0 rgba(0,0,0,.12);+ --raised: inset 0 1px 0 rgba(255,255,255,.4);+ color-scheme: light;+}+*{box-sizing:border-box}+html,body{margin:0;background:var(--gutter);color:var(--text-primary);font:400 13px/1.55 var(--font-ui);-webkit-font-smoothing:antialiased}+.mono{font-family:var(--font-mono);font-variant-numeric:tabular-nums}+code{font-family:var(--font-mono);font-size:11px;color:var(--text-secondary)}+a{color:var(--accent-hover)}+.page{max-width:1120px;margin:0 auto;padding:0 20px 80px}+header.mast{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:16px;padding:14px 20px;margin:0 -20px 12px;background:var(--gutter);border-bottom:1px solid var(--border-default)}+.mast h1{font:600 13px/1 var(--font-ui);color:var(--text-heading);margin:0}+.mast .eyebrow{margin:0}+.mast nav{display:flex;gap:14px;flex-wrap:wrap;margin-left:8px}+.mast nav a{color:var(--text-secondary);text-decoration:none;font-size:11px;font-weight:500}+.mast nav a:hover{color:var(--text-primary)}+.spacer{flex:1}+.eyebrow{font:500 9px/1 var(--font-mono);letter-spacing:.18em;text-transform:uppercase;color:var(--accent-dim);margin:0 0 8px}+section{background:var(--panel);border:1px solid var(--border-default);border-radius:var(--r-panel);padding:20px;margin:12px 0}+h2{font:600 26px/1.1 var(--font-ui);letter-spacing:-.015em;color:var(--text-heading);margin:0 0 8px}+h3{font:700 10px/1 var(--font-ui);letter-spacing:.14em;text-transform:uppercase;color:var(--text-tertiary);margin:22px 0 10px}+p{color:var(--text-secondary);max-width:72ch;margin:0 0 10px}+.lead{color:var(--text-muted)}+/* segmented */+.seg{display:inline-flex;gap:2px;padding:3px;height:30px;background:var(--bg-sunken);border:1px solid var(--hairline);border-radius:var(--r-tile);box-shadow:var(--sunken)}+.seg button{all:unset;cursor:pointer;height:22px;padding:0 10px;border-radius:var(--r-badge);font:500 11px/22px var(--font-ui);color:var(--text-secondary)}+.seg button[aria-pressed="true"]{background:var(--accent);color:var(--text-on-accent)}+.seg--device button{font-size:9px;height:18px;line-height:18px;padding:0 7px}+.seg--device{height:24px}+/* rules */+.rules{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:8px}+.rule{background:var(--surface-card);border:1px solid var(--border-default);border-radius:var(--r-tile);padding:12px 14px}+.rule b{display:block;color:var(--text-primary);font-weight:600;margin-bottom:4px}+.rule span{color:var(--text-secondary)}+/* swatches */+.swatches{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:8px}+.sw{all:unset;cursor:pointer;display:grid;grid-template-columns:36px 1fr auto;grid-template-areas:"chip name hex" "chip key key" "chip use use";column-gap:10px;padding:8px;border-radius:var(--r-tile);background:var(--surface-card);border:1px solid var(--border-default)}+.sw:hover{background:var(--surface-hover);border-color:var(--border-strong)}+.sw__chip{grid-area:chip;border-radius:var(--r-control);border:1px solid var(--border-strong);min-height:48px}+.sw__name{grid-area:name;font-weight:600;color:var(--text-primary)}+.sw__key{grid-area:key;font-size:10px;color:var(--text-muted)}+.sw__hex{grid-area:hex;font-size:10px;color:var(--text-secondary)}+.sw__use{grid-area:use;font-size:11px;color:var(--text-muted)}+.sw.copied .sw__hex{color:var(--accent-hover)}+/* tables */+.tbl{overflow-x:auto}+table{border-collapse:collapse;width:100%;font-size:12px}+th{text-align:left;font:700 9px/1 var(--font-ui);letter-spacing:.12em;text-transform:uppercase;color:var(--text-tertiary);padding:8px 10px;border-bottom:1px solid var(--border-default)}+td{padding:7px 10px;border-bottom:1px solid var(--hairline);color:var(--text-secondary);vertical-align:middle}+td:first-child{color:var(--text-primary)}+/* type */+.spec{display:grid;grid-template-columns:200px 1fr;gap:6px 16px;align-items:baseline}+.spec .k{font:400 10px/1.4 var(--font-mono);color:var(--text-muted)}+/* geometry */+.radii{display:flex;flex-wrap:wrap;gap:14px}+.radius{display:flex;flex-direction:column;align-items:center;gap:6px;font-size:11px;color:var(--text-secondary)}+.radius i{display:block;width:56px;height:40px;background:var(--surface-raised);border:1px solid var(--border-strong)}+.depth{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}+.depth div{height:84px;border-radius:var(--r-panel);padding:10px;font-size:11px;color:var(--text-secondary)}+/* controls */+.row{display:flex;flex-wrap:wrap;align-items:center;gap:16px;margin:6px 0}+.demo{background:var(--surface-card);border:1px solid var(--border-default);border-radius:var(--r-body);padding:16px}+.knob{display:block}+.knobs{display:flex;gap:22px;align-items:flex-end}+.knobs figure{margin:0;display:flex;flex-direction:column;align-items:center;gap:6px;font-size:10px;color:var(--text-muted)}+.cell{display:flex;flex-direction:column;align-items:center;width:53px}+.cell__label{font:700 7px/9px var(--font-ui);letter-spacing:.08em;text-transform:uppercase;color:var(--text-tertiary)}+.cell__value{font-size:7px;line-height:10px;color:var(--text-secondary)}+.cell--hot .cell__label,.cell--hot .cell__value{color:var(--accent-bright)}+.cell--dim .cell__label,.cell--dim .cell__value{color:var(--text-disabled)}+.switch{display:inline-flex;align-items:center;gap:6px;font:700 7px/1 var(--font-ui);letter-spacing:.08em;text-transform:uppercase;color:var(--text-tertiary)}+.switch i{position:relative;width:18px;height:10px;border-radius:5px;background:var(--track-off)}+.switch i::after{content:"";position:absolute;top:1.5px;left:1.5px;width:7px;height:7px;border-radius:50%;background:var(--text-tertiary)}+.switch.on i{background:var(--accent)}+.switch.on i::after{left:9.5px;background:var(--panel)}+.switch.on{color:var(--text-secondary)}+.chip{display:inline-flex;align-items:center;gap:6px;height:20px;padding:0 9px;border-radius:10px;border:1px solid var(--border-default);background:var(--surface-raised);font:500 11px/1 var(--font-ui);color:var(--text-strong)}+.chip i{width:6px;height:6px;border-radius:50%}+.chip.on{background:var(--accent-subtle);border-color:var(--border-brass);color:var(--accent-hover)}+.slider{display:grid;grid-template-columns:70px 1fr 42px;align-items:center;gap:8px;width:280px;height:18px}+.slider span:first-child{font:700 8px/1 var(--font-ui);letter-spacing:.1em;text-transform:uppercase;color:var(--text-tertiary)}+.slider span:last-child{font:400 9px/1 var(--font-mono);color:var(--text-primary);text-align:right}+.track{position:relative;height:3px;border-radius:var(--r-clip);background:var(--bg-sunken)}+.track b{position:absolute;left:0;top:0;bottom:0;border-radius:var(--r-clip);background:var(--accent)}+.track u{position:absolute;top:-2px;width:6px;height:7px;border-radius:var(--r-clip);background:var(--accent-bright);margin-left:-3px}+.slider.dim .track b{background:var(--border-strong)} .slider.dim .track u{background:var(--text-tertiary)} .slider.dim span:first-child{color:var(--text-disabled)}+.btn{display:inline-flex;align-items:center;height:26px;padding:0 12px;border-radius:var(--r-control);border:1px solid var(--border-default);background:var(--surface-raised);box-shadow:var(--raised);font:500 11px/1 var(--font-ui);color:var(--text-strong)}+.btn.hover{background:var(--surface-hover);border-color:var(--border-strong);color:var(--text-primary)}+.btn.pressed{background:var(--bg-sunken);box-shadow:none;color:var(--accent-deep)}+.btn.on{background:var(--accent-subtle);border-color:var(--border-brass);color:var(--accent-hover)}+.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--text-on-accent);box-shadow:none}+.btn.off{background:var(--panel);border-color:var(--hairline);color:var(--text-disabled);box-shadow:none}+.field{display:inline-flex;align-items:center;gap:8px;height:26px;width:220px;padding:0 9px;border-radius:var(--r-tile);border:1px solid var(--hairline);background:var(--bg-sunken);box-shadow:var(--sunken);font-size:11px;color:var(--text-disabled)}+.field.focus{border-color:var(--border-brass);color:var(--text-primary)}+.btn small,.states small{display:block}+.states{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}+.states figure{margin:0;display:flex;flex-direction:column;gap:6px;font-size:10px;color:var(--text-muted)}+.states figure .btn{align-self:flex-start}+.transport+.note{margin-top:8px}+/* transport */+.transport{display:flex;align-items:center;gap:12px;height:42px;padding:0 10px;background:var(--surface-abyss);border:1px solid var(--border-default);border-radius:var(--r-panel);box-shadow:var(--sunken);overflow-x:auto}+.tp{flex:none;display:grid;place-items:center;width:34px;height:34px;border-radius:var(--r-tile);background:var(--surface-raised);border:1px solid var(--border-default);box-shadow:var(--raised)}+.tp.play{width:46px;background:var(--accent);border-color:var(--accent)}+.tp .stop{width:10px;height:10px;border-radius:1px;background:var(--text-strong)}+.tp .play-tri{width:0;height:0;border-left:11px solid var(--text-on-accent);border-top:7px solid transparent;border-bottom:7px solid transparent;margin-left:2px}+.tp .rec{width:11px;height:11px;border-radius:50%;background:var(--record)}+.tp.rec-on{background:var(--record);border-color:var(--record)} .tp.rec-on .rec{background:var(--record-ink)}+.readout{flex:none;display:flex;flex-direction:column;align-items:center;gap:2px}+.readout b{font:500 13px/1 var(--font-mono);color:var(--accent-bright)}+.readout b.n{color:var(--text-primary)}+.readout span{font:700 7px/1 var(--font-ui);letter-spacing:.12em;color:var(--text-tertiary)}+.vr{flex:none;width:1px;height:24px;background:var(--border-default)}+/* graph window */+.graph{background:var(--bg-sunken);border:1px solid var(--hairline);border-radius:var(--r-control);position:relative}+.graph .axis{position:absolute;font:400 7px/1 var(--font-mono);color:var(--text-axis)}+.graph .title{position:absolute;left:6px;top:5px;font:700 8px/1 var(--font-ui);letter-spacing:.08em;color:var(--text-tertiary)}+.meters{display:flex;gap:5px;align-items:flex-end;height:120px}+.meter{position:relative;width:11px;height:120px;border-radius:var(--r-clip);background:var(--bg-sunken);overflow:hidden}+.meter i{position:absolute;left:0;right:0;bottom:0}+/* card */+.card{width:700px;height:260px;background:var(--bg-app);border:1px solid var(--border-default);border-radius:var(--r-body);overflow:hidden;display:grid;grid-template-rows:22px 1fr}+.card__head{display:flex;align-items:center;gap:8px;padding:0 8px;border-bottom:1px solid var(--border-default);background:var(--panel)}+.card__name{font:600 12px/1 var(--font-ui);color:var(--text-primary)}+.card__badge{margin-left:auto;font:500 9px/1 var(--font-mono);letter-spacing:.12em;color:var(--text-tertiary)}+.card__body{display:grid;grid-template-columns:150px 1fr 150px;gap:5px;padding:6px}+.sect{background:var(--surface-card);border:1px solid var(--border-default);border-radius:var(--r-panel);padding:6px 8px;display:flex;flex-direction:column;gap:6px;min-width:0}+.sect h5{margin:0;font:700 9px/1 var(--font-ui);letter-spacing:.12em;text-transform:uppercase;color:var(--text-tertiary)}+.anat{position:relative;display:inline-block}+.scroll{overflow-x:auto;padding-bottom:4px}+.note{font-size:11px;color:var(--text-muted)}+/* shell */+.shell{display:grid;grid-template-rows:24px 30px 1fr 14px;gap:0;height:260px;border:1px solid var(--border-default);border-radius:var(--r-body);overflow:hidden;background:var(--gutter);font:700 9px/1 var(--font-ui);letter-spacing:.12em;color:var(--text-tertiary)}+.shell>div{display:flex;align-items:center;padding:0 10px}+.shell .h{background:var(--bg-sunken);justify-content:center;color:var(--text-heading);letter-spacing:0;font:600 11px/1 var(--font-ui);border-bottom:1px solid var(--border-default)}+.shell .t{background:var(--surface-abyss);border-bottom:1px solid var(--border-default)}+.shell .b{display:grid;grid-template-columns:180px 1fr;gap:12px;padding:12px;align-items:stretch}+.shell .b div{border-radius:var(--r-panel);border:1px solid var(--border-default);display:grid;place-items:center}+.shell .b div:first-child{background:var(--panel)} .shell .b div:last-child{background:var(--bg-sunken)}+.shell .s{background:var(--bg-sunken);border-top:1px solid var(--border-default)}+ul.plain{margin:0;padding-left:18px;color:var(--text-secondary)} ul.plain li{margin:3px 0}+@media (max-width:760px){.spec{grid-template-columns:1fr} .mast nav{display:none}}</style>--<div class="shell">- <aside class="rail">- <p class="rail__mark">Nota</p>- <p class="rail__sub">Ember<br>design system</p>- <nav>- <a href="#principles">Principles</a>- <a href="#colour">Colour</a>- <a href="#type">Typography</a>- <a href="#geometry">Geometry</a>- <a href="#components">Components</a>- <a href="#data">Data surfaces</a>- <a href="#tracks">Track palette</a>- <a href="#cards">Device cards</a>- <a href="#kit">Control kit</a>- <a href="#viz">Visualisers</a>- <a href="#motion">Motion & copy</a>- <a href="#drift">Known drift</a>- </nav>- </aside>-- <main class="main">-- <header class="masthead">- <h1>Ember <em>Graphite</em> & <em>Paper</em></h1>- <p>Nota's UI runs on a warm palette — neutrals pulled to roughly 40° hue, lit by a single brass accent. <strong style="color:var(--text-primary);font-weight:600">Ember Graphite</strong> is the dark default: a DAW is used in dark rooms for long sessions. <strong style="color:var(--text-primary);font-weight:600">Ember Paper</strong> is the same system on a warm light ground — same hues, same roles, with brass darkened to bronze because against paper a mark needs less lightness, not more, to carry the same emphasis.</p>- <p>The concrete source of truth is <code>src/managed/Nota.App/Theme/NotaTheme.axaml</code> (both variants, in <code>ThemeDictionaries</code>), mirrored for custom-drawn views in <code>Theme/NotaPalette.cs</code>. This page documents those two files. <strong style="color:var(--text-primary);font-weight:600">Never hardcode a colour or size in a view</strong> — reference the token, or it is stuck in one variant.</p>- <div class="variant" role="group" aria-label="Palette variant">- <button type="button" data-set="graphite" aria-pressed="true">Ember Graphite</button>- <button type="button" data-set="paper" aria-pressed="false">Ember Paper</button>- </div>- <div class="hue-strip">- <span style="background:var(--bg-sunken)"></span><span style="background:var(--bg-app)"></span><span style="background:var(--surface-card)"></span><span style="background:var(--surface-raised)"></span><span style="background:var(--border-strong)"></span><span style="background:var(--text-tertiary)"></span><span style="background:var(--text-secondary)"></span><span style="background:var(--text-primary)"></span><span style="background:var(--accent)"></span><span style="background:var(--accent-bright)"></span>- </div>- </header>-- <section id="principles">- <p class="eyebrow">01 — Foundation</p>- <h2>Principles</h2>- <p>Six rules decide almost every question that comes up. When a new screen feels wrong, one of these is usually being broken.</p>- <div class="rules">- <div class="rule rule--do">- <h4><span class="rule__glyph">+</span> One accent, spent carefully</h4>- <p>Brass marks primary actions, selection, focus, active state, and the time-domain data that is the point of a DAW. Everything else stays neutral. Green, amber and red are for status only — never decoration.</p>- </div>- <div class="rule rule--dont">- <h4><span class="rule__glyph">−</span> No gradients or texture</h4>- <p>Flat solid fills throughout. No background images, no glass, no glow. The waveform is the imagery.</p>- </div>- <div class="rule rule--do">- <h4><span class="rule__glyph">+</span> Structure over shadows</h4>- <p>Panels are separated by 1px <code>Brush.BorderDefault</code> lines. Shadows belong only to floating layers — menus and dialogs.</p>- </div>- <div class="rule rule--do">- <h4><span class="rule__glyph">+</span> Dense, but on a grid</h4>- <p>Controls are 22–28px, text runs 10–13px. A DAW shows a lot at once; density is the point. Spacing still steps in 4px.</p>- </div>- <div class="rule rule--dont">- <h4><span class="rule__glyph">−</span> No emoji, no scale transforms</h4>- <p>Icons follow Lucide geometry at ~1.75 stroke. The only glyphs allowed as text are the meta separator <code>·</code> and the transport symbols already in use. Hover never bounces or scales.</p>- </div>- <div class="rule rule--do">- <h4><span class="rule__glyph">+</span> Mono means data</h4>- <p>If a number is read, compared or aligned — position, BPM, sample counts, latency — it is set in the mono face. Prose never is.</p>- </div>- </div>- </section>-- <section id="colour">- <p class="eyebrow">02 — Colour</p>- <h2>Palette</h2>- <p>Click any swatch to copy its hex. The hex shown is the one for the variant selected in the masthead. Translucent tokens are shown over a checkerboard so the alpha reads honestly.</p>-- <h3>Surfaces</h3>- <div class="swatches">- <button class="sw" data-hex="#0A0908" data-paper="#DCD6C5"><span class="sw__chip" style="background:var(--surface-abyss)"></span><span class="sw__meta"><span class="sw__key">Brush.SurfaceAbyss</span><span class="sw__hex">#0A0908</span> <span class="sw__role">· deepest recess — meter troughs, transport console</span></span></button>- <button class="sw" data-hex="#100F0D" data-paper="#E4DFD1"><span class="sw__chip" style="background:var(--bg-sunken)"></span><span class="sw__meta"><span class="sw__key">Brush.BgSunken</span><span class="sw__hex">#100F0D</span> <span class="sw__role">· wells, lanes, chrome</span></span></button>- <button class="sw" data-hex="#171613" data-paper="#EFEADE"><span class="sw__chip" style="background:var(--bg-app)"></span><span class="sw__meta"><span class="sw__key">Brush.BgApp</span><span class="sw__hex">#171613</span> <span class="sw__role">· app ground</span></span></button>- <button class="sw" data-hex="#191814" data-paper="#E9E4D6"><span class="sw__chip" style="background:var(--lane-b)"></span><span class="sw__meta"><span class="sw__key">Brush.LaneB</span><span class="sw__hex">#191814</span> <span class="sw__role">· lane alternation</span></span></button>- <button class="sw" data-hex="#1E1C18" data-paper="#F8F5EC"><span class="sw__chip" style="background:var(--surface-card)"></span><span class="sw__meta"><span class="sw__key">Brush.SurfaceCard</span><span class="sw__hex">#1E1C18</span> <span class="sw__role">· panels, cards</span></span></button>- <button class="sw" data-hex="#26231E" data-paper="#FFFEF8"><span class="sw__chip" style="background:var(--surface-raised)"></span><span class="sw__meta"><span class="sw__key">Brush.SurfaceRaised</span><span class="sw__hex">#26231E</span> <span class="sw__role">· transport, chips</span></span></button>- <button class="sw" data-hex="#2E2B24" data-paper="#E7E1D0"><span class="sw__chip" style="background:var(--surface-hover)"></span><span class="sw__meta"><span class="sw__key">Brush.SurfaceHover</span><span class="sw__hex">#2E2B24</span> <span class="sw__role">· hover</span></span></button>- <button class="sw" data-hex="#332F27" data-paper="#DBD4C0"><span class="sw__chip" style="background:var(--surface-active)"></span><span class="sw__meta"><span class="sw__key">Brush.SurfaceActive</span><span class="sw__hex">#332F27</span> <span class="sw__role">· pressed</span></span></button>- <button class="sw" data-hex="#24D8A03D" data-paper="#24A87415"><span class="sw__chip alpha"><i style="background:var(--accent-subtle)"></i></span><span class="sw__meta"><span class="sw__key">Brush.SurfaceSelected</span><span class="sw__hex">#24D8A03D</span> <span class="sw__role">· 14% brass</span></span></button>- </div>-- <h3>Text</h3>- <div class="swatches">- <button class="sw" data-hex="#E9E4D8" data-paper="#241F17"><span class="sw__chip" style="background:var(--text-primary)"></span><span class="sw__meta"><span class="sw__key">Brush.TextPrimary</span><span class="sw__hex">#E9E4D8</span> <span class="sw__role">· warm off-white</span></span></button>- <button class="sw" data-hex="#A39D8F" data-paper="#5E5849"><span class="sw__chip" style="background:var(--text-secondary)"></span><span class="sw__meta"><span class="sw__key">Brush.TextSecondary</span><span class="sw__hex">#A39D8F</span> <span class="sw__role">· labels, captions</span></span></button>- <button class="sw" data-hex="#6E6A5E" data-paper="#8A8474"><span class="sw__chip" style="background:var(--text-tertiary)"></span><span class="sw__meta"><span class="sw__key">Brush.TextTertiary</span><span class="sw__hex">#6E6A5E</span> <span class="sw__role">· section labels</span></span></button>- <button class="sw" data-hex="#4A463D" data-paper="#ADA694"><span class="sw__chip" style="background:var(--text-disabled)"></span><span class="sw__meta"><span class="sw__key">Brush.TextDisabled</span><span class="sw__hex">#4A463D</span> <span class="sw__role">· disabled</span></span></button>- <button class="sw" data-hex="#171613" data-paper="#FFFBF2"><span class="sw__chip" style="background:var(--text-on-accent)"></span><span class="sw__meta"><span class="sw__key">Brush.TextOnAccent</span><span class="sw__hex">#171613</span> <span class="sw__role">· ink on brass</span></span></button>- </div>-- <h3>Borders & grid</h3>- <div class="swatches">- <button class="sw" data-hex="#2C2923" data-paper="#D5CEBB"><span class="sw__chip" style="background:var(--border-default)"></span><span class="sw__meta"><span class="sw__key">Brush.BorderDefault</span><span class="sw__hex">#2C2923</span> <span class="sw__role">· panel separation</span></span></button>- <button class="sw" data-hex="#3A362D" data-paper="#BDB5A0"><span class="sw__chip" style="background:var(--border-strong)"></span><span class="sw__meta"><span class="sw__key">Brush.BorderStrong</span><span class="sw__hex">#3A362D</span> <span class="sw__role">· control outlines</span></span></button>- <button class="sw" data-hex="#1F1D18" data-paper="#DED8C8"><span class="sw__chip" style="background:var(--grid-beat)"></span><span class="sw__meta"><span class="sw__key">Brush.GridBeat</span><span class="sw__hex">#1F1D18</span> <span class="sw__role">· beat lines</span></span></button>- <button class="sw" data-hex="#2A2721" data-paper="#CFC8B4"><span class="sw__chip" style="background:var(--grid-bar)"></span><span class="sw__meta"><span class="sw__key">Brush.GridBar</span><span class="sw__hex">#2A2721</span> <span class="sw__role">· bar lines</span></span></button>- </div>-- <h3>Accent & semantic</h3>- <div class="swatches">- <button class="sw" data-hex="#D8A03D" data-paper="#A87415"><span class="sw__chip" style="background:var(--accent)"></span><span class="sw__meta"><span class="sw__key">Brush.Accent</span><span class="sw__hex">#D8A03D</span> <span class="sw__role">· brass</span></span></button>- <button class="sw" data-hex="#E8B24C" data-paper="#8F6110"><span class="sw__chip" style="background:var(--accent-hover)"></span><span class="sw__meta"><span class="sw__key">Brush.AccentHover</span><span class="sw__hex">#E8B24C</span> <span class="sw__role">· hover</span></span></button>- <button class="sw" data-hex="#F0C060" data-paper="#744D07"><span class="sw__chip" style="background:var(--accent-bright)"></span><span class="sw__meta"><span class="sw__key">Brush.AccentBright</span><span class="sw__hex">#F0C060</span> <span class="sw__role">· focus, playhead</span></span></button>- <button class="sw" data-hex="#24D8A03D" data-paper="#24A87415"><span class="sw__chip alpha"><i style="background:var(--accent-subtle)"></i></span><span class="sw__meta"><span class="sw__key">Brush.AccentSubtle</span><span class="sw__hex">#24D8A03D</span> <span class="sw__role">· toggle-on wash</span></span></button>- <button class="sw" data-hex="#58B368" data-paper="#2C7A3E"><span class="sw__chip" style="background:var(--success)"></span><span class="sw__meta"><span class="sw__key">Brush.Success</span><span class="sw__hex">#58B368</span> <span class="sw__role">· session play</span></span></button>- <button class="sw" data-hex="#D9C34C" data-paper="#837010"><span class="sw__chip" style="background:var(--warning)"></span><span class="sw__meta"><span class="sw__key">Brush.Warning</span><span class="sw__hex">#D9C34C</span> <span class="sw__role">· caution</span></span></button>- <button class="sw" data-hex="#D95F4C" data-paper="#B03A28"><span class="sw__chip" style="background:var(--danger)"></span><span class="sw__meta"><span class="sw__key">Brush.Danger</span><span class="sw__hex">#D95F4C</span> <span class="sw__role">· record, destructive</span></span></button>- <button class="sw" data-hex="#E4715F" data-paper="#C64A36"><span class="sw__chip" style="background:var(--danger-hover)"></span><span class="sw__meta"><span class="sw__key">Brush.DangerHover</span><span class="sw__hex">#E4715F</span> <span class="sw__role">· hover</span></span></button>- </div>-- <div class="note" style="margin-top:20px">- <strong>Fluent is retinted, not overridden.</strong> The theme reassigns <code>SystemAccentColor</code> and its six light/dark ramps to the brass family, so stock Avalonia controls — slider fills, checkboxes, focus rings — match the palette instead of shipping default blue.- </div>- </section>-- <section id="type">- <p class="eyebrow">03 — Typography</p>- <h2>Two faces, one job each</h2>- <p>Inter carries every word a person reads. The mono face carries every number a person compares. There is no third role.</p>-- <div class="tablewrap">- <table>- <thead><tr><th>Role</th><th>Key / class</th><th>Spec</th><th>Colour</th></tr></thead>- <tbody>- <tr><td class="d">UI text</td><td class="k">Font.UI</td><td class="v">Inter</td><td class="d">Everything readable</td></tr>- <tr><td class="d">Data</td><td class="k">Font.Mono</td><td class="v">Cascadia Code → Menlo → Consolas</td><td class="d">Position, BPM, counts, latency</td></tr>- <tr><td class="d">Heading</td><td class="k">TextBlock.Heading</td><td class="v">13px / SemiBold</td><td class="d">TextPrimary</td></tr>- <tr><td class="d">Body / control</td><td class="k">— (default)</td><td class="v">11px / Medium</td><td class="d">TextPrimary</td></tr>- <tr><td class="d">Caption</td><td class="k">TextBlock.Caption</td><td class="v">10px</td><td class="d">TextSecondary</td></tr>- <tr><td class="d">Section label</td><td class="k">TextBlock.SectionLabel</td><td class="v">10px / Bold</td><td class="d">TextTertiary</td></tr>- </tbody>- </table>- </div>-- <h3>Copy</h3>- <p>Sentence case everywhere — buttons, menus, titles. Imperative for actions, declarative for status. The middle dot <code>·</code> separates meta fields. Empty states get one short line and one primary action.</p>- <div class="specimen col">- <span class="specimen__label">Status readouts</span>- <div style="display:flex;flex-wrap:wrap;gap:10px;align-items:center">- <span class="well">Playing · 128.00 BPM · 4/4</span>- <span class="well">Bar 5 · 1 · 000</span>- <span class="well">Plugins: 46</span>- </div>- </div>- </section>-- <section id="geometry">- <p class="eyebrow">04 — Geometry</p>- <h2>Radii, heights, spacing</h2>- <p>Radius scales with the size of the thing: the smaller and denser the element, the tighter the corner.</p>-- <div class="tablewrap">- <table>- <thead><tr><th>Token</th><th>Value</th><th>Applies to</th></tr></thead>- <tbody>- <tr><td class="k">Radius.Clip</td><td class="v">4</td><td class="d">Arrangement clips</td></tr>- <tr><td class="k">Radius.Sm</td><td class="v">5</td><td class="d">Chips, wells, transport buttons, checkboxes</td></tr>- <tr><td class="k">Radius.Md</td><td class="v">7</td><td class="d">Buttons, list boxes, menus</td></tr>- <tr><td class="k">Radius.Pill</td><td class="v">8</td><td class="d">Pills</td></tr>- <tr><td class="k">Radius.Lg</td><td class="v">10</td><td class="d">Cards, panels, track rows</td></tr>- <tr><td class="k">Radius.Xl</td><td class="v">14</td><td class="d">Dialogs</td></tr>- <tr><td class="k">Control.Sm</td><td class="v">22</td><td class="d">Segmented buttons</td></tr>- <tr><td class="k">Control.Md</td><td class="v">26</td><td class="d">Buttons, toggles — the default</td></tr>- <tr><td class="k">Control.Lg</td><td class="v">28</td><td class="d">Transport, chips, fields, combo boxes</td></tr>- </tbody>- </table>- </div>-- <div class="note warn" style="margin-top:18px">- <strong>Spacing is a convention, not a token.</strong> The 4px step (4 · 8 · 12 · 16 · 20 · 24) is followed throughout, but no <code>Space.*</code> resources exist in the theme — values are written inline. Panels pad 16; cards and track rows pad 10.- </div>- </section>-- <section id="components">- <p class="eyebrow">05 — Components</p>- <h2>Specimens</h2>- <p>Every control below is rebuilt from the styles in <code>NotaTheme.axaml</code> at true size. Hover and click them — the states are the real ones.</p>-- <h3>Buttons</h3>- <div class="specimen">- <span class="specimen__label">Button — secondary is the default</span>- <button class="btn btn--primary" type="button">Add instrument track</button>- <button class="btn" type="button">Secondary</button>- <button class="btn btn--ghost" type="button">Ghost</button>- <button class="btn btn--danger" type="button">Delete track</button>- <button class="btn" type="button" disabled>Disabled</button>- </div>-- <h3>Toggles</h3>- <div class="specimen">- <span class="specimen__label">ToggleButton — brass wash when checked</span>- <button class="tgl" type="button" aria-pressed="false">Loop</button>- <button class="tgl tgl--on" type="button" aria-pressed="true">Metro</button>- <button class="tgl tgl--rec" type="button" aria-pressed="true">Rec arm</button>- </div>-- <h3>Transport</h3>- <div class="specimen">- <span class="specimen__label">Transport chrome — 28px controls on surface-raised, inside the 60px row</span>- <button class="tp tp--play" type="button" aria-label="Play">▶</button>- <button class="tp" type="button" aria-label="Stop">■</button>- <button class="tp tp--rec-on" type="button" aria-label="Record" aria-pressed="true">●</button>- <span class="well">5 · 1 · 000</span>- <span class="well">128.00</span>- <span class="well">4/4</span>- <span class="seg" role="group" aria-label="View">- <button type="button" aria-pressed="true">Arrangement</button>- <button type="button" aria-pressed="false">Session</button>- </span>- <button class="chip" type="button">Snap ¼</button>- </div>- <div class="note" style="margin-top:14px">- <strong>Play turns green in Session.</strong> The one place the accent yields: <code>Button.tp-play.session</code> swaps brass for <code>Brush.Success</code>, so the transport tells you which context you are driving.- </div>-- <h3>Fields & selection</h3>- <div class="specimen">- <span class="specimen__label">Inputs sit in a sunken well; focus borders brass</span>- <input class="field" type="text" placeholder="Search devices…" aria-label="Search devices">- <label class="cbx cbx--on"><span class="cbx__box"><svg width="9" height="7" viewBox="0 0 9 7" fill="none" aria-hidden="true"><path d="M0 3.5 L3.2 6.7 L9 0" stroke="var(--text-on-accent)" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg></span>Normalize</label>- <label class="cbx"><span class="cbx__box"></span>Dither</label>- </div>- <div class="specimen" style="margin-top:10px">- <span class="specimen__label">ListBox — selection is a brass wash, not a solid fill</span>- <div class="listbox" role="listbox" aria-label="Devices">- <div role="option" aria-selected="false">Nota Volt</div>- <div role="option" aria-selected="true">Nota Operator</div>- <div role="option" aria-selected="false">Nota Sampler</div>- <div role="option" aria-selected="false">Drum Rack</div>- </div>- </div>-- <h3>States</h3>- <div class="tablewrap">- <table>- <thead><tr><th>State</th><th>Treatment</th></tr></thead>- <tbody>- <tr><td class="d">Hover</td><td class="d"><code>Brush.SurfaceHover</code> on rows and ghost buttons; solid buttons go to <code>Brush.AccentHover</code></td></tr>- <tr><td class="d">Pressed</td><td class="d"><code>Brush.SurfaceActive</code></td></tr>- <tr><td class="d">Checked</td><td class="d"><code>Brush.AccentSubtle</code> fill, <code>Brush.Accent</code> border, <code>Brush.AccentBright</code> text</td></tr>- <tr><td class="d">Selected</td><td class="d"><code>Brush.SurfaceSelected</code> + text promoted to primary</td></tr>- <tr><td class="d">Keyboard focus</td><td class="d">1px <code>Brush.AccentBright</code> ring — no glow, no offset</td></tr>- <tr><td class="d">Disabled</td><td class="d"><code>Brush.TextDisabled</code>, opacity 0.5–0.55</td></tr>- </tbody>- </table>- </div>-- <div class="note warn" style="margin-top:18px">- <strong>Transport buttons are deliberately not focusable.</strong> <code>IsTabStop</code> and <code>Focusable</code> are false on every Button and ToggleButton, so global hotkeys (Space, R, L, Return) always reach the window instead of being swallowed by a focused control.- </div>- </section>-- <section id="data">- <p class="eyebrow">06 — Data surfaces</p>- <h2>The waveform is the imagery</h2>- <p>Custom-drawn views — arrangement, piano roll, waveform — sit on <code>Brush.BgSunken</code> and carry the accent family. Grid lines stay under ~12% contrast against the lane so they read as structure, never as content.</p>-- <div class="lane-demo" aria-hidden="true">- <div class="lane"><span class="clip" style="left:12px;width:150px;background:var(--track-2)">Drums</span><span class="clip" style="left:184px;width:96px;background:var(--track-2)">Fill</span></div>- <div class="lane"><span class="clip" style="left:52px;width:210px;background:var(--track-5)">Bass</span></div>- <div class="lane"><span class="clip" style="left:92px;width:170px;background:var(--track-7)">Keys</span><span class="playhead" style="left:196px"></span></div>- </div>-- <div class="tablewrap" style="margin-top:16px">- <table>- <thead><tr><th>Element</th><th>Token</th><th>Value</th></tr></thead>- <tbody>- <tr><td class="d">Lane ground</td><td class="k">Brush.BgApp / Brush.LaneB</td><td class="v">#171613 / #191814 · paper #EFEADE / #E9E4D6</td></tr>- <tr><td class="d">Beat lines</td><td class="k">Brush.GridBeat</td><td class="v">#1F1D18 · paper #DED8C8</td></tr>- <tr><td class="d">Bar lines</td><td class="k">Brush.GridBar</td><td class="v">#2A2721 · paper #CFC8B4</td></tr>- <tr><td class="d">Clip radius</td><td class="k">Radius.Clip</td><td class="v">4</td></tr>- <tr><td class="d">Playhead, selected note</td><td class="k">Brush.AccentBright</td><td class="v">#F0C060 · paper #744D07</td></tr>- <tr><td class="d">Waveform, MIDI note</td><td class="k">Brush.Accent</td><td class="v">#D8A03D · paper #A87415</td></tr>- </tbody>- </table>- </div>-- <div class="note" style="margin-top:18px">- <strong>Render overrides cannot resolve XAML resources cheaply</strong>, so custom-drawn views read from <code>NotaPalette.cs</code> instead. That file mirrors the theme one-for-one — change a colour in both, or the arrangement drifts from the chrome around it.- </div>- </section>-- <section id="tracks">- <p class="eyebrow">07 — Track palette</p>- <h2>Eight tracks, then it wraps</h2>- <p>Track colours are assigned round-robin from <code>Brush.Track1..8</code>. They are muted and equal-weight on purpose: no track should look more important than another, and none competes with the brass accent. A track inside a group takes its group's hue instead, varied across the three shades so siblings stay apart inside one family; an explicitly coloured track keeps its own colour.</p>-- <div class="tracks">- <div class="track"><div class="track__bar" style="background:var(--track-1)"></div><div class="track__body"><div class="track__name">Track 1 · rust</div><div class="track__hex">#C4756A</div></div></div>- <div class="track"><div class="track__bar" style="background:var(--track-2)"></div><div class="track__body"><div class="track__name">Track 2 · amber</div><div class="track__hex">#C99C55</div></div></div>- <div class="track"><div class="track__bar" style="background:var(--track-3)"></div><div class="track__body"><div class="track__name">Track 3 · olive</div><div class="track__hex">#9BA65D</div></div></div>- <div class="track"><div class="track__bar" style="background:var(--track-4)"></div><div class="track__body"><div class="track__name">Track 4 · sage</div><div class="track__hex">#6FA383</div></div></div>- <div class="track"><div class="track__bar" style="background:var(--track-5)"></div><div class="track__body"><div class="track__name">Track 5 · teal</div><div class="track__hex">#5B9E9C</div></div></div>- <div class="track"><div class="track__bar" style="background:var(--track-6)"></div><div class="track__body"><div class="track__name">Track 6 · slate</div><div class="track__hex">#6D8FB5</div></div></div>- <div class="track"><div class="track__bar" style="background:var(--track-7)"></div><div class="track__body"><div class="track__name">Track 7 · mauve</div><div class="track__hex">#9B7FA6</div></div></div>- <div class="track"><div class="track__bar" style="background:var(--track-8)"></div><div class="track__body"><div class="track__name">Track 8 · rose</div><div class="track__hex">#B57286</div></div></div>- <div class="track"><div class="track__bar" style="background:var(--return-a)"></div><div class="track__body"><div class="track__name">Return A</div><div class="track__hex">#7C88A0</div></div></div>- <div class="track"><div class="track__bar" style="background:var(--return-b)"></div><div class="track__body"><div class="track__name">Return B</div><div class="track__hex">#A08A7C</div></div></div>- <div class="track"><div class="track__bar" style="background:var(--accent)"></div><div class="track__body"><div class="track__name">Master</div><div class="track__hex">#D8A03D</div></div></div>- </div>- <p style="margin-top:14px;font-size:12.5px">Track 5 (teal) doubles as the modulation accent in custom-drawn views. Master reuses the brass accent — the master strip is the one channel that <em>should</em> read as primary.</p>- </section>-- <section id="cards">- <p class="eyebrow">08 — Device cards</p>- <h2>Anatomy of a card</h2>- <p>Every built-in device and instrument editor is a card of fixed height <strong style="color:var(--text-primary);font-weight:600">260px</strong> (<code>DeviceCardKit.CardH</code>). Width varies per device kind and is declared by the body strategy. The vertical budget is spent the same way every time.</p>-- <div class="card-anatomy" aria-hidden="true">- <div class="ca-row ca-head">- <span class="ca-dot"></span>- <span class="ca-name">Nota Auto Filter</span>- <span class="ca-tag">BUILT-IN</span>- <span class="ca-preset"><span>Default</span><span>▾</span></span>- <span class="ca-ab"><i class="on">A</i><i>B</i></span>- <span class="ca-right">- <span class="ca-cpu">0.2 %</span>- <span class="ca-meters">- <div><i style="width:62%;background:var(--success)"></i><i style="width:5%;background:var(--warning)"></i></div>- <div><i style="width:57%;background:var(--success)"></i><i style="width:4%;background:var(--warning)"></i></div>- </span>- <span class="ca-peak">−5.2</span>- <span class="ca-glyph">✕ ⠿</span>- </span>- </div>-- <div class="ca-row ca-live">- <span class="ca-seclabel">LIVE</span>- <span class="ca-slider"><b>FREQ</b><span class="ca-track"><i style="width:58%;background:var(--accent)"></i><span class="ca-thumb" style="left:58%"></span></span><span class="ca-val">1.2 kHz</span></span>- <span class="ca-slider"><b>RES</b><span class="ca-track"><i style="width:34%;background:var(--accent)"></i><span class="ca-thumb" style="left:34%"></span></span><span class="ca-val">0.34</span></span>- <span class="ca-slider"><b>LFO</b><span class="ca-track"><i style="width:45%;background:var(--track-5)"></i><span class="ca-thumb" style="left:45%"></span></span><span class="ca-val">2.0 Hz</span></span>- </div>-- <div class="ca-body">- <div class="ca-rail">- <div class="ca-tab on">Filter</div>- <div class="ca-tab mod">LFO</div>- <div class="ca-tab mod">Env</div>- </div>- <div class="ca-main">- <div class="knobcell">- <figure>- <svg viewBox="0 0 38 38" width="38" height="38" aria-hidden="true">- <path d="M7.69 30.31 A16 16 0 1 1 30.31 30.31" fill="none" stroke="var(--bg-sunken)" stroke-width="3.52" stroke-linecap="round"/>- <path d="M7.69 30.31 A16 16 0 0 1 27.57 5.49" fill="none" stroke="var(--accent)" stroke-width="3.52" stroke-linecap="round"/>- <line x1="19" y1="19" x2="24.66" y2="10.08" stroke="var(--text-primary)" stroke-width="2" stroke-linecap="round"/>- </svg>- </figure>- <span class="kv">1.2k</span><span class="kl">Freq</span>- </div>- <div class="knobcell">- <figure>- <svg viewBox="0 0 38 38" width="38" height="38" aria-hidden="true">- <path d="M7.69 30.31 A16 16 0 1 1 30.31 30.31" fill="none" stroke="var(--bg-sunken)" stroke-width="3.52" stroke-linecap="round"/>- <path d="M7.69 30.31 A16 16 0 0 1 8.61 6.83" fill="none" stroke="var(--border-strong)" stroke-width="3.52" stroke-linecap="round"/>- <line x1="19" y1="19" x2="12.14" y2="10.97" stroke="var(--text-primary)" stroke-width="2" stroke-linecap="round"/>- </svg>- </figure>- <span class="kv">0.35</span><span class="kl">Res</span>- </div>- <div class="ca-spine">- <span class="ca-seclabel">MODULATION</span>- <div class="knobcell" style="width:46px">- <figure>- <svg viewBox="0 0 38 38" width="38" height="38" aria-hidden="true">- <path d="M7.69 30.31 A16 16 0 1 1 30.31 30.31" fill="none" stroke="var(--bg-sunken)" stroke-width="3.52" stroke-linecap="round"/>- <path d="M7.69 30.31 A16 16 0 1 1 34.80 16.50" fill="none" stroke="var(--track-5)" stroke-width="3.52" stroke-linecap="round"/>- <line x1="19" y1="19" x2="29.43" y2="17.35" stroke="var(--text-primary)" stroke-width="2" stroke-linecap="round"/>- </svg>- </figure>- <span class="kv" style="font-size:7px">80%</span><span class="kl" style="font-size:7px">Amount</span>- </div>- </div>- </div>- <div class="ca-out">- <div class="ca-outrow"><b class="ca-seclabel">GAIN</b><span class="ca-val" style="margin-left:auto">−2.0</span></div>- <span class="ca-track"><i style="width:80%;background:var(--border-strong)"></i><span class="ca-thumb" style="left:80%"></span></span>- <div class="ca-outrow" style="margin-top:auto"><b class="ca-seclabel">PAN</b><span class="ca-track"><span class="ca-thumb" style="left:50%"></span></span><span class="ca-val" style="font-size:8px;color:var(--text-tertiary)">C</span></div>- </div>- </div>- </div>-- <div class="ca-legend">- <span><i style="background:var(--accent)"></i> Brass — audio path</span>- <span><i style="background:var(--track-5)"></i> Teal — modulation & detection</span>- <span><i style="background:var(--border-strong)"></i> Muted — output rail</span>- <span><i style="background:var(--success)"></i> Green — signal present</span>- </div>-- <h3>Vertical budget</h3>- <div class="tablewrap">- <table>- <thead><tr><th>Band</th><th>Height</th><th>Contains</th></tr></thead>- <tbody>- <tr><td class="d">Header</td><td class="v">26</td><td class="d">Power dot · name · type tag · preset · A/B · CPU · stereo meter · peak dB · close & drag</td></tr>- <tr><td class="d">LIVE strip</td><td class="v">34</td><td class="d">The two or three parameters worth reaching for mid-take, as inline sliders</td></tr>- <tr><td class="d">Body</td><td class="v">200</td><td class="d">Tab rail (80) · main area · output rail (100–150)</td></tr>- <tr><td class="d"><strong style="color:var(--text-primary)">Total</strong></td><td class="v">260</td><td class="d"><code>DeviceCardKit.CardH</code></td></tr>- </tbody>- </table>- </div>-- <h3>The two-colour rule</h3>- <p>This is the one convention that carries the most meaning, and the easiest to get wrong.</p>- <div class="rules">- <div class="rule rule--do">- <h4><span class="rule__glyph">+</span> Brass is the audio path</h4>- <p>Anything the signal actually passes through — gain, frequency, drive, mix — draws its arc or fill in <code>Brush.Accent</code>. On a knob that means <code>Accent = true</code>.</p>- </div>- <div class="rule rule--do">- <h4><span class="rule__glyph">+</span> Teal is modulation</h4>- <p>Anything that <em>controls</em> rather than carries the signal — LFOs, envelopes, sidechain detectors, followers — uses teal <code>#5B9E9C</code> (<code>Brush.Track5</code>, aliased in the kit as <code>Teal</code>), passed via the knob's <code>ArcColor</code>. Group them behind a 2px teal left border with a teal section label.</p>- </div>- <div class="rule rule--dont">- <h4><span class="rule__glyph">−</span> The output rail stays muted</h4>- <p>Trim and pan at the end of the chain fill with <code>Brush.BorderStrong</code>, not brass. They are housekeeping, not the sound.</p>- </div>- <div class="rule rule--do">- <h4><span class="rule__glyph">+</span> Tab accent follows the tab</h4>- <p>An active tab takes a 2px left border: brass for signal pages (Osc, Filter), teal for modulation pages (Env, LFO, Mod).</p>- </div>- </div>-- <h3>Frame</h3>- <div class="tablewrap">- <table>- <thead><tr><th>Part</th><th>Spec</th></tr></thead>- <tbody>- <tr><td class="d">Card</td><td class="d"><code>Brush.SurfaceRaised</code> fill, 1px <code>Brush.BorderDefault</code>, radius 7, clipped to bounds</td></tr>- <tr><td class="d">Header</td><td class="d">26px, 1px bottom border, 8px horizontal pad, title 11px SemiBold <code>TextPrimary</code></td></tr>- <tr><td class="d">Body inset</td><td class="d">10px — unless the strategy sets <code>FullBleed</code>, then it pads itself</td></tr>- <tr><td class="d">Tab rail</td><td class="d">80px, background <code>#1B1916</code>, 1px right border, 5px pad, tabs 20px tall / radius 4</td></tr>- <tr><td class="d">Output rail</td><td class="d">100–150px, background <code>#1B1916</code>, 1px left border</td></tr>- <tr><td class="d">Graph panels</td><td class="d"><code>Brush.BgSunken</code> ground with a <code>#221F1A</code> inner border</td></tr>- </tbody>- </table>- </div>- <div class="note warn" style="margin-top:16px">- <strong><code>#1B1916</code> and <code>#221F1A</code> are not tokens.</strong> Both are in daily use — 36 and 22 files respectively — but neither is declared in <code>NotaTheme.axaml</code> or <code>NotaPalette.cs</code>. They are de-facto surfaces that should be promoted to <code>Brush.SurfaceRail</code> and <code>Brush.BorderPanel</code>.- </div>- </section>-- <section id="kit">- <p class="eyebrow">09 — Control kit</p>- <h2>What you build a card out of</h2>- <p>Card bodies are assembled from a small set of custom-drawn controls plus the state-free builders in <code>DeviceCardKit</code>. Avalonia's stock controls are too chunky at this density, so almost everything here is purpose-built.</p>-- <h3>Interaction contract</h3>- <p>Every value control in the kit behaves identically. Match this exactly when adding one — the consistency is the feature.</p>- <div class="tablewrap">- <table>- <thead><tr><th>Gesture</th><th>Behaviour</th></tr></thead>- <tbody>- <tr><td class="d">Vertical drag</td><td class="d">Up increases. The knob travels its full range over ~140px of movement.</td></tr>- <tr><td class="d">Double-click</td><td class="d">Restores the parameter default (<code>Default</code>; <code>NaN</code> disables it).</td></tr>- <tr><td class="d">Left button only</td><td class="d">Right-click deliberately bubbles through, so the CV-modulate context menu still opens.</td></tr>- <tr><td class="d">Gesture brackets</td><td class="d"><code>GestureBegin</code> / <code>GestureEnd</code> wrap <code>BeginAutomationWrite</code> / <code>EndAutomationWrite</code>, so a move recorded while playing lands as automation.</td></tr>- <tr><td class="d">MIDI learn</td><td class="d">Knobs register through <code>MidiLearn.Bind</code> with the parameter's display name.</td></tr>- <tr><td class="d">Live follow</td><td class="d">A refresher re-reads engine state each UI tick and skips while <code>Dragging</code> is true, so automation never fights the hand.</td></tr>- <tr><td class="d">Numeric readout</td><td class="d">Mono, so the width does not jump as digits change.</td></tr>- </tbody>- </table>- </div>-- <h3>Value controls</h3>- <div class="kit-grid">- <div class="kit">- <h4>Knob</h4><span class="dim">38 × 38 · 270° sweep from 135°</span>- <p>The workhorse. Dark <code>BgSunken</code> groove, value arc over it, pointer line at 0.66 r. Arc thickness scales with radius. Neutral <code>BorderStrong</code> by default; brass with <code>Accent</code>; any colour via <code>ArcColor</code>.</p>- </div>- <div class="kit">- <h4>KnobCell</h4><span class="dim">58 wide · knob / value / caption</span>- <p>The standard labelled cell: knob, 8px mono value, 8px uppercase tertiary caption. Below 52px wide both texts drop to 7px and the caption ellipsises.</p>- </div>- <div class="kit">- <h4>ValueBar</h4><span class="dim">h 18 · min-w 46</span>- <p>A rounded sunken field with the value text centred over a horizontal fill. Same drag and reset contract as the knob. Fill is teal or brass by role.</p>- </div>- <div class="kit">- <h4>MiniFader</h4><span class="dim">h 12 · min-w 40 · 3px track</span>- <p>Thin horizontal fader with an 8×9 cap. Built for the 64px arrangement track header, where the stock slider does not fit.</p>- </div>- <div class="kit">- <h4>VFader</h4><span class="dim">w 30 · range 0–1.5</span>- <p>Vertical fader for mixer strips. Cap is <code>SurfaceHover</code> with a <code>TextDisabled</code> outline and a track-coloured line.</p>- </div>- <div class="kit">- <h4>PanKnob</h4><span class="dim">26 × 26 · −1…1</span>- <p>Radial pan. Sunken face, 1.5px <code>BorderStrong</code> ring, 2px round-capped <code>TextSecondary</code> indicator.</p>- </div>- <div class="kit">- <h4>PanBar</h4><span class="dim">bipolar, centre-out</span>- <p>Horizontal pan for the track header. Brass fill grows from the centre toward the panned side; reads “50L … C … 50R”.</p>- </div>- <div class="kit">- <h4>DragNumber</h4><span class="dim">mono readout</span>- <p>Numeric field that edits by vertical drag, or double-click to type. Commits on Enter or blur.</p>- </div>- </div>-- <h3>Meters</h3>- <div class="kit-grid">- <div class="kit">- <h4>MeterBar</h4><span class="dim">v: w 10 · h: 12 × min 80</span>- <p>Peak/RMS level, fed ~30 Hz. dB-mapped −60…0 with green / amber / red zones. Rises instantly, falls on a fixed decay, peak-hold ticks in <code>TextPrimary</code>.</p>- </div>- <div class="kit">- <h4>StereoMeter</h4><span class="dim">two 3px bars</span>- <p>L over R, for the output rail and the card header. Same zone colours as MeterBar.</p>- </div>- <div class="kit">- <h4>GrMeter</h4><span class="dim">hangs from the top</span>- <p>Gain reduction — draws downward from 0 dB, so more compression reads as more bar.</p>- </div>- <div class="kit">- <h4>MixBar</h4><span class="dim">h 6</span>- <p>Proportional source levels as amber segments, bright to faint. Used under Volt's noise panel to show the Osc1 / Osc2 / Noise sum.</p>- </div>- </div>-- <h3>Chrome builders</h3>- <div class="kit-grid">- <div class="kit">- <h4>ChipRow</h4><span class="dim">radius 4 · 9px · pad 6×2</span>- <p>Single-select over an integer. Selected chip fills brass with <code>TextOnAccent</code> ink; the rest sit on <code>SurfaceCard</code> with a <code>BorderStrong</code> outline.</p>- </div>- <div class="kit">- <h4>Labeled</h4><span class="dim">8px uppercase tertiary</span>- <p>Puts a centred caption above any control. The default way to title something that is not a knob.</p>- </div>- <div class="kit">- <h4>TextButton</h4><span class="dim">radius 5 · 11px · pad 10×4</span>- <p>In-card action button on <code>SurfaceCard</code> with a <code>BorderStrong</code> outline.</p>- </div>- <div class="kit">- <h4>BypassTag</h4><span class="dim">8px bold · radius 3</span>- <p>The “BYPASSED” marker on a disabled device.</p>- </div>- <div class="kit">- <h4>NaBadge</h4><span class="dim">h 16 · radius 8 (Pill)</span>- <p>Marks a control drawn from the mockup whose feature is not built yet. Two variants — <code>N/A</code> and <code>M7+</code>. The control it sits on stays visible but disabled, so nothing shifts when the feature ships.</p>- </div>- <div class="kit">- <h4>Glyph & Hint</h4><span class="dim">10px / 11px tertiary</span>- <p>A clickable text glyph that dims to <code>TextDisabled</code> when inactive, and a quiet inline hint line.</p>- </div>- </div>- </section>-- <section id="viz">- <p class="eyebrow">10 — Visualisers</p>- <h2>Every device shows its own state</h2>- <p>Around forty custom-drawn views live in <code>Controls/</code>. The rule behind all of them: a device should draw the thing it does, not a generic graph. They share one ground — <code>Brush.BgSunken</code> with a <code>#221F1A</code> inner border — and read data straight from the engine on the UI tick.</p>-- <div class="vizcat">- <h4>Transfer curves — what goes in against what comes out</h4>- <p><code>AmpCurve</code> · <code>CompTransfer</code> · <code>VintageViz</code> · <code>VelocityCurveViz</code>. Input on x, output on y, dashed unity diagonal for reference.</p>- </div>- <div class="vizcat">- <h4>Frequency response</h4>- <p><code>AutoFilterCurve</code> · <code>DynamicEqCurve</code> · <code>EqThreeCurve</code> · <code>EqCurve</code> · <code>AmpToneCurve</code>. Magnitude over a log-frequency grid. A dynamic EQ draws two curves — static and reacted.</p>- </div>- <div class="vizcat">- <h4>Spectra</h4>- <p><code>AmpHarmonics</code> · <code>OperatorSpectrumViz</code> · <code>CollisionViz</code>. Harmonic magnitudes as bars — the amp pushes a unit sine through its own waveshaper to get real numbers rather than a drawing.</p>- </div>- <div class="vizcat">- <h4>Scrolling history</h4>- <p><code>AutoGainViz</code> · <code>CompGrHistory</code> · <code>CeilingScope</code> · <code>AutoShiftViz</code> · <code>FluxReactScope</code> · <code>ShutterViz</code> · <code>ForgeViz</code>. A ring of the last few seconds. Gain reduction hangs downward from the top.</p>- </div>- <div class="vizcat">- <h4>Waveform & sample</h4>- <p><code>GrainWaveViz</code> · <code>RhythmWaveViz</code> · <code>StrataWave</code> · <code>AuroraStack</code> · <code>MonolithViews</code>. Drawn in the app's standard waveform style so a sample looks the same wherever it appears.</p>- </div>- <div class="vizcat">- <h4>Grids & sequencers</h4>- <p><code>ArpGrid</code> (16 steps per lane) · <code>VoltMatrix</code> (bipolar source × destination) · <code>BeatRepeatViz</code> (64 slots) · <code>DelayTaps</code> (echo train, L above R).</p>- </div>- <div class="vizcat">- <h4>Envelopes & shapes</h4>- <p><code>SynthViz</code> · <code>VoltEnv</code> · <code>ReverbTail</code> · <code>RhythmHitViz</code> · <code>LengthGateViz</code> · <code>DistributionViz</code> · <code>AutoPanViz</code>. Where possible these are real — the reverb tail is an actual decaying impulse response, not a drawn curve.</p>- </div>- <div class="vizcat">- <h4>The instrument drawn as itself</h4>- <p><code>PendulumViz</code> · <code>FluxVectorPad</code> · <code>ChordKeysViz</code> · <code>OperatorAlgoViz</code>. The strongest cards in the set: Pendulum shows its balls swinging across the triangular field, Flux gives you the XY pad to drag, Chord shows the resulting notes on a keyboard.</p>- </div>- <div class="vizcat">- <h4>Icons</h4>- <p><code>WaveIcon</code> · <code>GrainShapeIcon</code> · <code>AutoFilterIcons</code>. Tiny custom glyphs — waveform shapes, grain windows, filter types — drawn rather than shipped as assets.</p>- </div>- </section>-- <section id="motion">- <p class="eyebrow">11 — Motion & voice</p>- <h2>Fast and quiet</h2>- <p>Transitions run 100–240ms on an ease-out curve, and they may only change opacity or translate by 6px or less. No scaling, no bouncing, no spring. A DAW is operated, not admired — motion that delays a click is a bug.</p>- <div class="rules">- <div class="rule rule--do">- <h4><span class="rule__glyph">+</span> Layout skeleton</h4>- <p>36px title bar → a single 60px transport row → body (on <code>Brush.BgApp</code>) → 22px status bar. The transport is one row, not the transport + toolbar pair it used to be: which view · what plays · the numbers you set · the switches you flip · then, pinned right, what the machine is doing. Transport, position and loop share a <code>Border.console</code> recess on <code>Brush.SurfaceAbyss</code>; tempo, signature, grid and launch quantize use one <code>.cell</code> shape — mono value over an 8px <code>.CellLabel</code>. Panels are <code>Brush.SurfaceCard</code> with a 1px bottom border. The body holds <strong>islands</strong>: the browser, the arrangement and the modular canvas are <code>Radius.Md</code> cards with a 1px <code>Brush.BorderDefault</code> edge, clipped to their bounds, floating on the app ground with an 8px gutter; the splitter between two islands is a 2px transparent grab strip inside that gutter and carries no line of its own.</p>- <p>Arrangement rows are not one pitch. A <strong>track</strong> row is 64px and its header carries every control (name + kind · mute/solo/arm + input · fader + dB + pan, with a level rail on the right edge). A <strong>group</strong> row is a 26px titled bar — disclosure, name, mute/solo, a 4px level rail, kind tag — and opens to a full 64px row only while it is the selected track. Header column 228px. A <strong>clip</strong> is a tinted body (<code>Radius.Clip</code>) under a 2px band in the track colour, with the waveform or notes across its full height; the name is drawn over the body, only where a run of clips begins.</p>- </div>- <div class="rule rule--do">- <h4><span class="rule__glyph">+</span> Scrollbars recede</h4>- <p>9px wide, thumb on <code>Brush.BorderStrong</code>, brightening to tertiary on hover and brass while dragged. The stepper arrows are hidden — at this scale they are noise.</p>- </div>- </div>- </section>-- <section id="drift">- <p class="eyebrow">12 — Maintenance</p>- <h2>Known drift & gaps</h2>- <p>Things that are true today and should not surprise you.</p>- <div class="tablewrap">- <table>- <thead><tr><th>Item</th><th>Status</th></tr></thead>- <tbody>- <tr><td class="d">The <code>nota-design</code> agent skill</td><td class="d">Rewritten to point at the theme files rather than restate values — the earlier copy had drifted to a cool-slate palette with a cyan accent. Now current for both variants.</td></tr>- <tr><td class="d">Custom title bar</td><td class="d">Built: a 36px frameless bar on <code>Brush.ChromeBg</code>, macOS traffic lights in a left inset, document name centred; Windows reserves 180px for the native caption buttons.</td></tr>- <tr><td class="d">Display face</td><td class="d">Inter is bundled as a stand-in for Geist. Swap <code>Font.UI</code> once Geist ships with the app.</td></tr>- <tr><td class="d"><code>Space.*</code> tokens</td><td class="d">Do not exist. The 4px grid is honoured by convention only.</td></tr>- <tr><td class="d">Two palette files</td><td class="d"><code>NotaTheme.axaml</code> and <code>NotaPalette.cs</code> must be edited together — nothing enforces it. Each token now carries two values, so one colour change is four edits: the Dark and Light dictionaries, the palette slot, and this page.</td></tr>- <tr><td class="d">Ink hues are derived</td><td class="d">A one-off device hue (<code>NotaPalette.Ink</code>) gets its Ember Paper counterpart from a lightness reflection rather than an authored value. Most land well; pin the ones that do not in <code>NotaPalette.InkOverrides</code> instead of reaching for a literal.</td></tr>- <tr><td class="d">Stored colours</td><td class="d">Tag swatches, Strata layer hues and Drum Rack kit dots are <em>data</em>, not tokens — they stay hex in source and are re-tinted through <code>Ink()</code> at the point of use.</td></tr>- <tr><td class="d">Mockup typography</td><td class="d">The mockups specify Geist and Geist Mono throughout. The app substitutes Inter and the Cascadia/Menlo/Consolas stack, so weights sit slightly differently than the source designs.</td></tr>- </tbody>- </table>- </div>- </section>-- <footer>- Nota · Ember Graphite & Ember Paper. Generated from <code>Theme/NotaTheme.axaml</code> and <code>Theme/NotaPalette.cs</code>. When this page and those files disagree, the files win — and this page is wrong.- </footer>-- </main>+</head>+<body>+<div class="page">+<header class="mast">+ <div><p class="eyebrow">Nota · design</p><h1>Ember</h1></div>+ <nav><a href="#rules">Rules</a><a href="#colour">Colour</a><a href="#type">Type</a><a href="#geometry">Geometry</a><a href="#controls">Controls</a><a href="#states">States</a><a href="#graphs">Graphs</a><a href="#cards">Cards</a><a href="#shell">Shell</a></nav>+ <span class="spacer"></span>+ <div class="seg" role="group" aria-label="Variant"><button data-v="graphite" aria-pressed="true">Graphite</button><button data-v="paper" aria-pressed="false">Paper</button></div>+</header>++<section id="rules">+ <p class="eyebrow">01 · Foundation</p>+ <h2>Rules</h2>+ <p class="lead">The Nota Design Almanac, as the app implements it. <a href="DESIGN.md">DESIGN.md</a> is the text version with every value, the tests that enforce it and the accepted departures.</p>+ <div class="rules">+ <div class="rule"><b>One accent</b><span>Brass means “active, selected, changed”. There is no second accent.</span></div>+ <div class="rule"><b>Semantics only where they apply</b><span>Red is recording and overload. Green and yellow are meter zones and live signal.</span></div>+ <div class="rule"><b>Chromas live inside graphs</b><span>Teal, rose and steel separate sources in a visualisation — never on buttons, never as state.</span></div>+ <div class="rule"><b>Flat material</b><span>No gradients, glow or texture. Depth is lightness plus a hairline, three levels at most.</span></div>+ <div class="rule"><b>Two faces, one split</b><span>Geist for names and words, Geist Mono for measurements. Nothing under 7 px.</span></div>+ <div class="rule"><b>One control, many sizes</b><span>Each control has one implementation; its value is always visible next to it.</span></div>+ <div class="rule"><b>State changes colour only</b><span>Never size, border width or position. Nothing moves on hover.</span></div>+ <div class="rule"><b>Real time is not animated</b><span>Meters, playhead and spectra jump to the value.</span></div>+ <div class="rule"><b>Muted is an Ink step</b><span>Disabled and quiet text take the next Ink step. Opacity is not a state.</span></div>+ <div class="rule"><b>Numbers are set</b><span class="mono">−3.3 dB · 72 % · 3.2 k · 120.00</span></div>+ </div>+</section>++<section id="colour">+ <p class="eyebrow">02 · Colour</p>+ <h2>Palette</h2>+ <p>Click a swatch to copy its hex for the variant selected above. Values come straight from <code>NotaTheme.axaml</code>.</p>+ <h3>Surfaces · far to near</h3><div class="swatches"><button class="sw" data-dark="#0A0908" data-light="#D8D1BE" title="Copy hex"><span class="sw__chip" style="background:var(--surface-abyss)"></span><span class="sw__name">Void</span><code class="sw__key">Brush.SurfaceAbyss</code><span class="sw__hex mono"></span><span class="sw__use">Deepest recess — the transport strip</span></button><button class="sw" data-dark="#0B0A09" data-light="#DCD6C5" title="Copy hex"><span class="sw__chip" style="background:var(--bg-app)"></span><span class="sw__name">App</span><code class="sw__key">Brush.BgApp</code><span class="sw__hex mono"></span><span class="sw__use">Window ground, plugin body</span></button><button class="sw" data-dark="#0C0B09" data-light="#E0DAC9" title="Copy hex"><span class="sw__chip" style="background:var(--gutter)"></span><span class="sw__name">Gutter</span><code class="sw__key">Brush.Gutter</code><span class="sw__hex mono"></span><span class="sw__use">The gaps panels float in</span></button><button class="sw" data-dark="#100F0D" data-light="#E4DFD1" title="Copy hex"><span class="sw__chip" style="background:var(--bg-sunken)"></span><span class="sw__name">Well</span><code class="sw__key">Brush.BgSunken</code><span class="sw__hex mono"></span><span class="sw__use">Graph windows, fields, slider tracks</span></button><button class="sw" data-dark="#141310" data-light="#EAE5D7" title="Copy hex"><span class="sw__chip" style="background:var(--panel)"></span><span class="sw__name">Panel</span><code class="sw__key">Brush.Panel</code><span class="sw__hex mono"></span><span class="sw__use">Browser, headers, inspector</span></button><button class="sw" data-dark="#171613" data-light="#EFEADE" title="Copy hex"><span class="sw__chip" style="background:var(--surface-card)"></span><span class="sw__name">Card</span><code class="sw__key">Brush.SurfaceCard</code><span class="sw__hex mono"></span><span class="sw__use">A section inside a device</span></button><button class="sw" data-dark="#1C1A16" data-light="#F8F5EC" title="Copy hex"><span class="sw__chip" style="background:var(--surface-raised)"></span><span class="sw__name">Raised</span><code class="sw__key">Brush.SurfaceRaised</code><span class="sw__hex mono"></span><span class="sw__use">Button at rest</span></button><button class="sw" data-dark="#252219" data-light="#E7E1D0" title="Copy hex"><span class="sw__chip" style="background:var(--surface-hover)"></span><span class="sw__name">Hover</span><code class="sw__key">Brush.SurfaceHover</code><span class="sw__hex mono"></span><span class="sw__use">Hovered button or row</span></button><button class="sw" data-dark="#26231E" data-light="#DBD4C0" title="Copy hex"><span class="sw__chip" style="background:var(--track-off)"></span><span class="sw__name">Track off</span><code class="sw__key">Brush.TrackOff</code><span class="sw__hex mono"></span><span class="sw__use">Track of an off switch</span></button><button class="sw" data-dark="#241F17" data-light="#F2E4C4" title="Copy hex"><span class="sw__chip" style="background:var(--surface-selected)"></span><span class="sw__name">Brass Wash</span><code class="sw__key">Brush.SurfaceSelected</code><span class="sw__hex mono"></span><span class="sw__use">Selected row, engaged ground</span></button></div>+ <h3>Lines</h3><div class="swatches"><button class="sw" data-dark="#221F1A" data-light="#D5CFBE" title="Copy hex"><span class="sw__chip" style="background:var(--hairline)"></span><span class="sw__name">Hairline</span><code class="sw__key">Brush.Hairline</code><span class="sw__hex mono"></span><span class="sw__use">Row dividers, graph frame</span></button><button class="sw" data-dark="#2C2923" data-light="#D5CEBB" title="Copy hex"><span class="sw__chip" style="background:var(--border-default)"></span><span class="sw__name">Border</span><code class="sw__key">Brush.BorderDefault</code><span class="sw__hex mono"></span><span class="sw__use">Panel, button, field</span></button><button class="sw" data-dark="#3A362D" data-light="#BDB5A0" title="Copy hex"><span class="sw__chip" style="background:var(--border-strong)"></span><span class="sw__name">Border strong</span><code class="sw__key">Brush.BorderStrong</code><span class="sw__hex mono"></span><span class="sw__use">Knob cap, hovered border</span></button><button class="sw" data-dark="#6B5326" data-light="#C9A254" title="Copy hex"><span class="sw__chip" style="background:var(--border-brass)"></span><span class="sw__name">Border brass</span><code class="sw__key">Brush.BorderBrass</code><span class="sw__hex mono"></span><span class="sw__use">Engaged button, focus</span></button><button class="sw" data-dark="#1E1C18" data-light="#DED8C8" title="Copy hex"><span class="sw__chip" style="background:var(--grid-beat)"></span><span class="sw__name">Grid</span><code class="sw__key">Brush.GridBeat</code><span class="sw__hex mono"></span><span class="sw__use">Grid inside graphs</span></button><button class="sw" data-dark="#2A2721" data-light="#CFC8B4" title="Copy hex"><span class="sw__chip" style="background:var(--grid-bar)"></span><span class="sw__name">Grid bar</span><code class="sw__key">Brush.GridBar</code><span class="sw__hex mono"></span><span class="sw__use">Bar lines</span></button></div>+ <h3>Ink · eight steps</h3><div class="swatches"><button class="sw" data-dark="#F2EDE1" data-light="#1A150E" title="Copy hex"><span class="sw__chip" style="background:var(--text-heading)"></span><span class="sw__name">Ink 0</span><code class="sw__key">Brush.TextHeading</code><span class="sw__hex mono"></span><span class="sw__use">Page title, project name</span></button><button class="sw" data-dark="#E9E4D8" data-light="#241F17" title="Copy hex"><span class="sw__chip" style="background:var(--text-primary)"></span><span class="sw__name">Ink 1</span><code class="sw__key">Brush.TextPrimary</code><span class="sw__hex mono"></span><span class="sw__use">Names, values</span></button><button class="sw" data-dark="#C7C0B0" data-light="#3E382C" title="Copy hex"><span class="sw__chip" style="background:var(--text-strong)"></span><span class="sw__name">Ink 2</span><code class="sw__key">Brush.TextStrong</code><span class="sw__hex mono"></span><span class="sw__use">Button text, readouts</span></button><button class="sw" data-dark="#A39D8F" data-light="#5E5849" title="Copy hex"><span class="sw__chip" style="background:var(--text-secondary)"></span><span class="sw__name">Ink 3</span><code class="sw__key">Brush.TextSecondary</code><span class="sw__hex mono"></span><span class="sw__use">Inactive but readable</span></button><button class="sw" data-dark="#8D8779" data-light="#746D5C" title="Copy hex"><span class="sw__chip" style="background:var(--text-muted)"></span><span class="sw__name">Ink 4</span><code class="sw__key">Brush.TextMuted</code><span class="sw__hex mono"></span><span class="sw__use">Explanations, units</span></button><button class="sw" data-dark="#6E6A5E" data-light="#8A8474" title="Copy hex"><span class="sw__chip" style="background:var(--text-tertiary)"></span><span class="sw__name">Ink 5</span><code class="sw__key">Brush.TextTertiary</code><span class="sw__hex mono"></span><span class="sw__use">Caps labels, empty states</span></button><button class="sw" data-dark="#55514A" data-light="#9E9786" title="Copy hex"><span class="sw__chip" style="background:var(--text-disabled)"></span><span class="sw__name">Ink 6</span><code class="sw__key">Brush.TextDisabled</code><span class="sw__hex mono"></span><span class="sw__use">Placeholder, disabled</span></button><button class="sw" data-dark="#4A463D" data-light="#ADA694" title="Copy hex"><span class="sw__chip" style="background:var(--text-axis)"></span><span class="sw__name">Ink 7</span><code class="sw__key">Brush.TextAxis</code><span class="sw__hex mono"></span><span class="sw__use">Axis labels in graphs only</span></button></div>+ <h3>Brass · the only accent</h3><div class="swatches"><button class="sw" data-dark="#D8A03D" data-light="#A87415" title="Copy hex"><span class="sw__chip" style="background:var(--accent)"></span><span class="sw__name">Brass</span><code class="sw__key">Brush.Accent</code><span class="sw__hex mono"></span><span class="sw__use">Arc, fill, playhead, one solid button</span></button><button class="sw" data-dark="#F0C060" data-light="#744D07" title="Copy hex"><span class="sw__chip" style="background:var(--accent-bright)"></span><span class="sw__name">Brass Light</span><code class="sw__key">Brush.AccentBright</code><span class="sw__hex mono"></span><span class="sw__use">Pointer, modified label</span></button><button class="sw" data-dark="#E9BE6A" data-light="#8F6110" title="Copy hex"><span class="sw__chip" style="background:var(--accent-hover)"></span><span class="sw__name">Brass Hover</span><code class="sw__key">Brush.AccentHover</code><span class="sw__hex mono"></span><span class="sw__use">Engaged text</span></button><button class="sw" data-dark="#B08536" data-light="#7A5008" title="Copy hex"><span class="sw__chip" style="background:var(--accent-deep)"></span><span class="sw__name">Brass Deep</span><code class="sw__key">Brush.AccentDeep</code><span class="sw__hex mono"></span><span class="sw__use">Pressed</span></button><button class="sw" data-dark="#8A6B2E" data-light="#9C8034" title="Copy hex"><span class="sw__chip" style="background:var(--accent-dim)"></span><span class="sw__name">Brass Dim</span><code class="sw__key">Brush.AccentDim</code><span class="sw__hex mono"></span><span class="sw__use">Eyebrows, section marks</span></button><button class="sw" data-dark="#5E4A22" data-light="#D3B173" title="Copy hex"><span class="sw__chip" style="background:var(--accent-edge)"></span><span class="sw__name">Brass Edge</span><code class="sw__key">Brush.AccentEdge</code><span class="sw__hex mono"></span><span class="sw__use">Brass chip border</span></button></div>+ <h3>Semantics</h3><div class="swatches"><button class="sw" data-dark="#C25B44" data-light="#B54A32" title="Copy hex"><span class="sw__chip" style="background:var(--record)"></span><span class="sw__name">Record</span><code class="sw__key">Brush.Record</code><span class="sw__hex mono"></span><span class="sw__use">Active recording — the only red</span></button><button class="sw" data-dark="#F4E3DC" data-light="#FFF4EE" title="Copy hex"><span class="sw__chip" style="background:var(--record-ink)"></span><span class="sw__name">Record ink</span><code class="sw__key">Brush.RecordInk</code><span class="sw__hex mono"></span><span class="sw__use">Disc on engaged record</span></button><button class="sw" data-dark="#C2554A" data-light="#B13E33" title="Copy hex"><span class="sw__chip" style="background:var(--danger)"></span><span class="sw__name">Alert</span><code class="sw__key">Brush.Danger</code><span class="sw__hex mono"></span><span class="sw__use">Overload, clipping</span></button><button class="sw" data-dark="#E08A72" data-light="#A3391B" title="Copy hex"><span class="sw__chip" style="background:var(--danger-bright)"></span><span class="sw__name">Alert Light</span><code class="sw__key">Brush.DangerBright</code><span class="sw__hex mono"></span><span class="sw__use">Overload readout</span></button><button class="sw" data-dark="#D9C34C" data-light="#837010" title="Copy hex"><span class="sw__chip" style="background:var(--warning)"></span><span class="sw__name">Caution</span><code class="sw__key">Brush.Warning</code><span class="sw__hex mono"></span><span class="sw__use">Meter −6…0 dB</span></button><button class="sw" data-dark="#58B368" data-light="#2C7A3E" title="Copy hex"><span class="sw__chip" style="background:var(--success)"></span><span class="sw__name">Signal</span><code class="sw__key">Brush.Success</code><span class="sw__hex mono"></span><span class="sw__use">Working zone, live signal</span></button><button class="sw" data-dark="#7FB069" data-light="#609548" title="Copy hex"><span class="sw__chip" style="background:var(--success-dim)"></span><span class="sw__name">Signal Dim</span><code class="sw__key">Brush.SuccessDim</code><span class="sw__hex mono"></span><span class="sw__use">Input, metronome</span></button></div>+ <h3>Role chromas · inside graphs only, in this order</h3><div class="swatches"><button class="sw" data-dark="#D8A03D" data-light="#A87415" title="Copy hex"><span class="sw__chip" style="background:var(--accent)"></span><span class="sw__name">1 · Brass</span><code class="sw__key">Brush.Accent</code><span class="sw__hex mono"></span><span class="sw__use">Primary: left, mid, main</span></button><button class="sw" data-dark="#5B9E9C" data-light="#2F7472" title="Copy hex"><span class="sw__chip" style="background:var(--chroma-teal)"></span><span class="sw__name">2 · Teal</span><code class="sw__key">Brush.ChromaTeal</code><span class="sw__hex mono"></span><span class="sw__use">Lows, early, input, modulation</span></button><button class="sw" data-dark="#B57286" data-light="#86465B" title="Copy hex"><span class="sw__chip" style="background:var(--chroma-rose)"></span><span class="sw__name">3 · Rose</span><code class="sw__key">Brush.ChromaRose</code><span class="sw__hex mono"></span><span class="sw__use">Right, highs, tail</span></button><button class="sw" data-dark="#6D8FB5" data-light="#3E6288" title="Copy hex"><span class="sw__chip" style="background:var(--chroma-steel)"></span><span class="sw__name">4 · Steel</span><code class="sw__key">Brush.ChromaSteel</code><span class="sw__hex mono"></span><span class="sw__use">Rare fourth layer</span></button><button class="sw" data-dark="#7FC0BE" data-light="#3E8A88" title="Copy hex"><span class="sw__chip" style="background:var(--chroma-teal-light)"></span><span class="sw__name">Teal light</span><code class="sw__key">Brush.ChromaTealLight</code><span class="sw__hex mono"></span><span class="sw__use">Text on teal</span></button><button class="sw" data-dark="#D79BAB" data-light="#7F2D43" title="Copy hex"><span class="sw__chip" style="background:var(--chroma-rose-light)"></span><span class="sw__name">Rose light</span><code class="sw__key">Brush.ChromaRoseLight</code><span class="sw__hex mono"></span><span class="sw__use">Text on rose</span></button></div>+ <h3>Track palette · nine roles</h3><div class="swatches"><button class="sw" data-dark="#58B368" data-light="#328140" title="Copy hex"><span class="sw__chip" style="background:var(--track1)"></span><span class="sw__name">Drums</span><code class="sw__key">Brush.Track1</code><span class="sw__hex mono"></span><span class="sw__use"></span></button><button class="sw" data-dark="#4E9E7A" data-light="#306F53" title="Copy hex"><span class="sw__chip" style="background:var(--track2)"></span><span class="sw__name">Perc</span><code class="sw__key">Brush.Track2</code><span class="sw__hex mono"></span><span class="sw__use"></span></button><button class="sw" data-dark="#3E8E8E" data-light="#256464" title="Copy hex"><span class="sw__chip" style="background:var(--track3)"></span><span class="sw__name">Bass</span><code class="sw__key">Brush.Track3</code><span class="sw__hex mono"></span><span class="sw__use"></span></button><button class="sw" data-dark="#5AA0B8" data-light="#317187" title="Copy hex"><span class="sw__chip" style="background:var(--track4)"></span><span class="sw__name">Keys</span><code class="sw__key">Brush.Track4</code><span class="sw__hex mono"></span><span class="sw__use"></span></button><button class="sw" data-dark="#C77F55" data-light="#985127" title="Copy hex"><span class="sw__chip" style="background:var(--track5)"></span><span class="sw__name">Texture</span><code class="sw__key">Brush.Track5</code><span class="sw__hex mono"></span><span class="sw__use"></span></button><button class="sw" data-dark="#7A6FB0" data-light="#4B4082" title="Copy hex"><span class="sw__chip" style="background:var(--track6)"></span><span class="sw__name">FX</span><code class="sw__key">Brush.Track6</code><span class="sw__hex mono"></span><span class="sw__use"></span></button><button class="sw" data-dark="#B05A7A" data-light="#7F3450" title="Copy hex"><span class="sw__chip" style="background:var(--track7)"></span><span class="sw__name">Brass</span><code class="sw__key">Brush.Track7</code><span class="sw__hex mono"></span><span class="sw__use"></span></button><button class="sw" data-dark="#9AA64A" data-light="#6C752C" title="Copy hex"><span class="sw__chip" style="background:var(--track8)"></span><span class="sw__name">Vox</span><code class="sw__key">Brush.Track8</code><span class="sw__hex mono"></span><span class="sw__use"></span></button><button class="sw" data-dark="#7FA88E" data-light="#4D7A5D" title="Copy hex"><span class="sw__chip" style="background:var(--track9)"></span><span class="sw__name">Return</span><code class="sw__key">Brush.Track9</code><span class="sw__hex mono"></span><span class="sw__use"></span></button></div>+</section>++<section id="type">+ <p class="eyebrow">03 · Type</p>+ <h2>Geist and Geist Mono</h2>+ <p>A proportional face for names and words; mono for anything that is a measurement, so digits keep their width as a knob turns.</p>+ <h3>Shell scale</h3>+ <div class="spec">+ <span class="k">Title · 600 · 26</span><span style="font:600 26px/1.1 var(--font-ui);letter-spacing:-.015em;color:var(--text-heading)">Controls</span>+ <span class="k">Heading · 600 · 13</span><span style="font:600 13px var(--font-ui);color:var(--text-heading)">Northern Reverb Study</span>+ <span class="k">Name · 500 · 12</span><span style="font:500 12px var(--font-ui)">Stone Vault · Long Tail</span>+ <span class="k">default · 500 · 11</span><span style="font:500 11px var(--font-ui);color:var(--text-strong)">Arrangement · Session · Modular</span>+ <span class="k">Caption · 400 · 11 · Ink 4</span><span style="font:400 11px/1.65 var(--font-ui);color:var(--text-muted)">Load as an effect on the selected track</span>+ <span class="k">SectionLabel · 700 · 10 caps</span><span style="font:700 10px var(--font-ui);letter-spacing:.14em;color:var(--text-tertiary)">SURFACES</span>+ <span class="k">Readout · mono 500 · 13</span><span class="mono" style="font-weight:500;font-size:13px">12.3.04 · 120.00</span>+ <span class="k">Value · mono 400 · 10</span><span class="mono" style="font-size:10px;color:var(--text-secondary)">−3.3 dB · 48 k · 2.4 MB</span>+ <span class="k">Eyebrow · mono 500 · 9 caps</span><span class="mono" style="font-weight:500;font-size:9px;letter-spacing:.18em;color:var(--accent-dim)">NOTA · CONVOLUTION</span>+ </div>+ <h3>Device scale · inside a 700 × 260 card</h3>+ <div class="spec">+ <span class="k">DeviceName · 600 · 12</span><span style="font:600 12px var(--font-ui)">Nota Chamber</span>+ <span class="k">DeviceSection · 700 · 9 caps</span><span style="font:700 9px var(--font-ui);letter-spacing:.12em;color:var(--text-tertiary)">EARLY REFLECTIONS</span>+ <span class="k">RowLabel · 700 · 8 caps</span><span style="font:700 8px var(--font-ui);letter-spacing:.1em;color:var(--text-tertiary)">PRE-DELAY</span>+ <span class="k">KnobLabel · 700 · 7 caps</span><span style="font:700 7px var(--font-ui);letter-spacing:.08em;color:var(--text-tertiary)">DECAY</span>+ <span class="k">KnobValue · mono · 7</span><span class="mono" style="font-size:7px;color:var(--text-secondary)">4.6 s</span>+ <span class="k">Axis · mono · 7 · Ink 7</span><span class="mono" style="font-size:7px;color:var(--text-axis)">30 Hz — 18k</span>+ </div>+ <h3>Setting numbers</h3>+ <div class="tbl"><table>+ <tr><th>Rule</th><th>Yes</th><th>No</th></tr>+ <tr><td>Thin space before the unit</td><td class="mono">4.6 s · −3.3 dB · 72 %</td><td class="mono">4.6s · -3,3dB</td></tr>+ <tr><td>Typographic minus; plus only where the sign matters</td><td class="mono">−18.0 dB · +0.8 dB</td><td class="mono">-18.0 dB</td></tr>+ <tr><td>Fixed precision</td><td class="mono">dB 1 · tempo 2 · % 0 · 440 Hz · 3.2 k</td><td class="mono">3200 Hz · 72.4 %</td></tr>+ <tr><td>Labels: English caps, one word</td><td class="mono">FEEDBACK · PRE-DELAY · FREQ</td><td class="mono">Fdbk: · Value</td></tr>+ </table></div>+</section>++<section id="geometry">+ <p class="eyebrow">04 · Material</p>+ <h2>Radii, sizes, depth</h2>+ <h3>Radii · by size, not role</h3>+ <div class="radii">+ <div class="radius"><i style="border-radius:var(--r-bar)"></i>1 · bar</div>+ <div class="radius"><i style="border-radius:var(--r-clip)"></i>2 · clip, meter</div>+ <div class="radius"><i style="border-radius:var(--r-badge)"></i>3 · badge</div>+ <div class="radius"><i style="border-radius:var(--r-control)"></i>4 · graph, button</div>+ <div class="radius"><i style="border-radius:var(--r-tile)"></i>5 · tile, search</div>+ <div class="radius"><i style="border-radius:var(--r-panel)"></i>6 · panel, section</div>+ <div class="radius"><i style="border-radius:var(--r-body)"></i>8 · device body</div>+ <div class="radius"><i style="border-radius:20px"></i>pill · chip, switch</div>+ </div>+ <h3>Sizes and steps</h3>+ <div class="tbl"><table>+ <tr><th>Element</th><th>px</th><th>Token</th></tr>+ <tr><td>Device card</td><td class="mono">700 × 260</td><td><code>DeviceCardKit.CardH</code></td></tr>+ <tr><td>Transport strip · buttons · Play</td><td class="mono">42 · 34 · 46</td><td><code>Control.Console / Transport / Play</code></td></tr>+ <tr><td>Shell button, field</td><td class="mono">26</td><td><code>Control.Shell</code></td></tr>+ <tr><td>Tab segment in its container</td><td class="mono">24 in 30</td><td><code>Control.Seg / SegGroup</code></td></tr>+ <tr><td>Filter chip</td><td class="mono">20</td><td><code>Control.Chip</code></td></tr>+ <tr><td>Knob · secondary / regular / main</td><td class="mono">34 / 36 / 44</td><td><code>Control.Knob*</code></td></tr>+ <tr><td>Parameter cell</td><td class="mono">53</td><td><code>Control.ParamCell</code></td></tr>+ <tr><td>Switch · slider track · meter</td><td class="mono">18 × 10 · 3 · 11 / 5</td><td></td></tr>+ <tr><td>Device steps · hair / gap / inset / wide</td><td class="mono">2 · 5 · 6 · 8</td><td><code>Space.Device*</code></td></tr>+ <tr><td>Shell steps · tile / gutter / inset</td><td class="mono">8 · 12 · 20</td><td><code>Space.Tile / Gutter / Inset</code></td></tr>+ </table></div>+ <h3>Three levels of depth</h3>+ <div class="depth">+ <div style="background:var(--bg-sunken);border:1px solid var(--hairline);box-shadow:var(--sunken)">Sunken · Well · Hairline · inner top line</div>+ <div style="background:var(--surface-card);border:1px solid var(--border-default)">Flat · Card · Border · no shadow</div>+ <div style="background:var(--surface-raised);border:1px solid var(--border-default);box-shadow:var(--raised)">Raised · Raised · Border · inner highlight</div>+ </div>+</section>++<section id="controls">+ <p class="eyebrow">05 · Controls</p>+ <h2>One implementation each</h2>+ <p>Vertical drag, up increases, ~140 px for the full range; Shift for fine steps; double-click resets; left button only, so right-click reaches the modulation menu.</p>+ <h3>Knob · 34 / 36 / 44</h3>+ <div class="demo knobs">+ <figure><svg class="knob" width="34" height="34" viewBox="0 0 52 52" aria-hidden="true"><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--bg-sunken);stroke-width:5;stroke-linecap:round" stroke-dasharray="99.0 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--accent);stroke-width:5;stroke-linecap:round" stroke-dasharray="54.4 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="14" style="fill:var(--surface-raised);stroke:var(--border-strong);stroke-width:1"/><line x1="26" y1="26" x2="28.0" y2="17.6" style="stroke:var(--accent-bright);stroke-width:2.4;stroke-linecap:round"/></svg>secondary</figure>+ <figure><svg class="knob" width="36" height="36" viewBox="0 0 52 52" aria-hidden="true"><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--bg-sunken);stroke-width:5;stroke-linecap:round" stroke-dasharray="99.0 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--accent);stroke-width:5;stroke-linecap:round" stroke-dasharray="39.6 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="14" style="fill:var(--surface-raised);stroke:var(--border-strong);stroke-width:1"/><line x1="26" y1="26" x2="22.1" y2="18.3" style="stroke:var(--accent-bright);stroke-width:2.4;stroke-linecap:round"/></svg>regular</figure>+ <figure><svg class="knob" width="44" height="44" viewBox="0 0 52 52" aria-hidden="true"><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--bg-sunken);stroke-width:5;stroke-linecap:round" stroke-dasharray="99.0 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--accent);stroke-width:5;stroke-linecap:round" stroke-dasharray="69.3 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="14" style="fill:var(--surface-raised);stroke:var(--border-strong);stroke-width:1"/><line x1="26" y1="26" x2="33.0" y2="20.9" style="stroke:var(--accent-bright);stroke-width:2.4;stroke-linecap:round"/></svg>main</figure>+ <figure><svg class="knob" width="36" height="36" viewBox="0 0 52 52" aria-hidden="true"><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--bg-sunken);stroke-width:5;stroke-linecap:round" stroke-dasharray="99.0 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--chroma-teal);stroke-width:5;stroke-linecap:round" stroke-dasharray="61.4 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="14" style="fill:var(--surface-raised);stroke:var(--border-strong);stroke-width:1"/><line x1="26" y1="26" x2="30.7" y2="18.7" style="stroke:var(--chroma-teal-light);stroke-width:2.4;stroke-linecap:round"/></svg>modulated</figure>+ <figure><svg class="knob" width="36" height="36" viewBox="0 0 52 52" aria-hidden="true"><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--bg-sunken);stroke-width:5;stroke-linecap:round" stroke-dasharray="99.0 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--border-strong);stroke-width:5;stroke-linecap:round" stroke-dasharray="39.6 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="14" style="fill:var(--surface-raised);stroke:var(--border-strong);stroke-width:1"/><line x1="26" y1="26" x2="22.1" y2="18.3" style="stroke:var(--text-disabled);stroke-width:2.4;stroke-linecap:round"/></svg>inactive</figure>+ </div>+ <h3>Parameter cell · 53 tall</h3>+ <div class="demo row" style="gap:6px">+ <div class="cell cell--hot"><svg class="knob" width="34" height="34" viewBox="0 0 52 52" aria-hidden="true"><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--bg-sunken);stroke-width:5;stroke-linecap:round" stroke-dasharray="99.0 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--accent);stroke-width:5;stroke-linecap:round" stroke-dasharray="59.4 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="14" style="fill:var(--surface-raised);stroke:var(--border-strong);stroke-width:1"/><line x1="26" y1="26" x2="29.9" y2="18.3" style="stroke:var(--accent-bright);stroke-width:2.4;stroke-linecap:round"/></svg><span class="cell__label">DECAY</span><span class="cell__value mono">4.6 s</span></div>+ <div class="cell"><svg class="knob" width="34" height="34" viewBox="0 0 52 52" aria-hidden="true"><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--bg-sunken);stroke-width:5;stroke-linecap:round" stroke-dasharray="99.0 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--accent);stroke-width:5;stroke-linecap:round" stroke-dasharray="34.6 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="14" style="fill:var(--surface-raised);stroke:var(--border-strong);stroke-width:1"/><line x1="26" y1="26" x2="20.4" y2="19.4" style="stroke:var(--accent-bright);stroke-width:2.4;stroke-linecap:round"/></svg><span class="cell__label">SIZE</span><span class="cell__value mono">31 m</span></div>+ <div class="cell"><svg class="knob" width="34" height="34" viewBox="0 0 52 52" aria-hidden="true"><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--bg-sunken);stroke-width:5;stroke-linecap:round" stroke-dasharray="99.0 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--accent);stroke-width:5;stroke-linecap:round" stroke-dasharray="41.6 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="14" style="fill:var(--surface-raised);stroke:var(--border-strong);stroke-width:1"/><line x1="26" y1="26" x2="22.8" y2="17.9" style="stroke:var(--accent-bright);stroke-width:2.4;stroke-linecap:round"/></svg><span class="cell__label">MIX</span><span class="cell__value mono">42 %</span></div>+ <div class="cell"><svg class="knob" width="34" height="34" viewBox="0 0 52 52" aria-hidden="true"><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--bg-sunken);stroke-width:5;stroke-linecap:round" stroke-dasharray="99.0 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--chroma-teal);stroke-width:5;stroke-linecap:round" stroke-dasharray="29.7 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="14" style="fill:var(--surface-raised);stroke:var(--border-strong);stroke-width:1"/><line x1="26" y1="26" x2="19.0" y2="20.9" style="stroke:var(--chroma-teal-light);stroke-width:2.4;stroke-linecap:round"/></svg><span class="cell__label">MOD</span><span class="cell__value mono">18 %</span></div>+ <div class="cell cell--dim"><svg class="knob" width="34" height="34" viewBox="0 0 52 52" aria-hidden="true"><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--bg-sunken);stroke-width:5;stroke-linecap:round" stroke-dasharray="99.0 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--border-strong);stroke-width:5;stroke-linecap:round" stroke-dasharray="0.0 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="14" style="fill:var(--surface-raised);stroke:var(--border-strong);stroke-width:1"/><line x1="26" y1="26" x2="19.9" y2="32.1" style="stroke:var(--text-disabled);stroke-width:2.4;stroke-linecap:round"/></svg><span class="cell__label">WIDTH</span><span class="cell__value mono">off</span></div>+ </div>+ <p class="note">Brass Light label and value: the parameter differs from its default. A modulated arc takes its source's chroma; the label stays neutral.</p>+ <h3>Switch · segments · chips</h3>+ <div class="demo">+ <div class="row"><span class="switch on"><i></i>True stereo</span><span class="switch"><i></i>Reverse IR</span>+ <div class="seg seg--device"><button aria-pressed="false">Eco</button><button aria-pressed="true">Mid</button><button aria-pressed="false">High</button></div>+ <div class="seg"><button aria-pressed="true">Arrangement</button><button aria-pressed="false">Session</button><button aria-pressed="false">Modular</button></div></div>+ <div class="row"><span class="chip on">Favorites</span><span class="chip"><i style="background:var(--danger)"></i>bass</span><span class="chip"><i style="background:var(--track4)"></i>analog</span><span class="chip"><i style="background:var(--track2)"></i>clean</span><span class="chip mono">+2</span></div>+ </div>+ <h3>Slider row</h3>+ <div class="demo">+ <div class="slider"><span>Pre-delay</span><span class="track"><b style="width:30%"></b><u style="left:30%"></u></span><span>24 ms</span></div>+ <div class="slider"><span>Diffusion</span><span class="track"><b style="width:72%"></b><u style="left:72%"></u></span><span>72 %</span></div>+ <div class="slider dim"><span>Damping</span><span class="track"><b style="width:55%"></b><u style="left:55%"></u></span><span>4.1 k</span></div>+ </div>+ <h3>Transport · shapes, not an icon font</h3>+ <div class="transport">+ <div class="seg"><button aria-pressed="true">Arrangement</button><button aria-pressed="false">Session</button><button aria-pressed="false">Modular</button></div>+ <span class="tp"><i class="stop"></i></span><span class="tp play"><i class="play-tri"></i></span><span class="tp"><i class="rec"></i></span><span class="tp rec-on"><i class="rec"></i></span>+ <span class="vr"></span>+ <span class="readout"><b>12.3.04</b><span>BARS</span></span>+ <span class="vr"></span>+ <span class="readout"><b class="n">120.00</b><span>BPM</span></span><span class="readout"><b class="n">4/4</b><span>SIG</span></span><span class="readout"><b class="n">1/4</b><span>GRID</span></span>+ </div>+ <p class="note">Play is 46 wide against 34 — found by hand, not by eye. Record at rest is neutral with a red disc; engaged it is solid Record with a pale disc.</p>+</section>++<section id="states">+ <p class="eyebrow">06 · States</p>+ <h2>Colour changes, nothing moves</h2>+ <div class="demo states">+ <figure><span class="btn">Rest</span>Raised · Border · Ink 2</figure>+ <figure><span class="btn hover">Hover</span>Hover · Border strong · Ink 1</figure>+ <figure><span class="btn pressed">Pressed</span>Well · Brass Deep</figure>+ <figure><span class="btn on">Engaged</span>Brass Wash · Border brass</figure>+ <figure><span class="btn primary">Export</span>One solid action per context</figure>+ <figure><span class="btn off">Disabled</span>Panel · Hairline · Ink 6</figure>+ </div>+ <div class="row" style="margin-top:12px"><span class="field">Search</span><span class="field focus">Stone Vault</span></div>+ <p class="note">Hover and colour 120 ms ease-out. Empty state: one Ink 5 line, centred, no illustration, no call-to-action button.</p>+</section>++<section id="graphs">+ <p class="eyebrow">07 · Visualisations</p>+ <h2>One graph window</h2>+ <p>Well ground, hairline frame, radius 4, grid lines, mono axis labels in the corners only. Primary curve 1.8 px brass, others 1.2–1.6 px in their chroma. No fills under curves.</p>+ <div class="row" style="align-items:stretch">+ <div class="graph" style="width:420px;height:150px">+ <span class="title">RESPONSE</span>+ <svg width="420" height="150" viewBox="0 0 420 150" aria-hidden="true">+ <g style="stroke:var(--grid-beat);stroke-width:1"><line x1="70" y1="0" x2="70" y2="150"/><line x1="140" y1="0" x2="140" y2="150"/><line x1="210" y1="0" x2="210" y2="150"/><line x1="280" y1="0" x2="280" y2="150"/><line x1="350" y1="0" x2="350" y2="150"/><line x1="0" y1="75" x2="420" y2="75"/></g>+ <path d="M0 75 C60 75 80 50 120 48 S170 75 210 75 S260 110 300 108 S360 75 420 75" style="fill:none;stroke:var(--chroma-teal);stroke-width:1.4"/>+ <path d="M0 75 C50 75 90 40 130 38 S190 75 230 80 S300 100 330 96 S390 75 420 75" style="fill:none;stroke:var(--accent);stroke-width:1.8;stroke-linecap:round"/>+ <circle cx="130" cy="38" r="4.5" style="fill:var(--accent);stroke:var(--bg-sunken);stroke-width:2"/>+ <circle cx="330" cy="96" r="4.5" style="fill:var(--text-secondary);stroke:var(--bg-sunken);stroke-width:2"/>+ </svg>+ <span class="axis" style="left:4px;bottom:4px">20</span><span class="axis" style="right:4px;bottom:4px">20k Hz</span>+ </div>+ <div class="graph" style="padding:12px 16px;display:flex;gap:18px;align-items:flex-end">+ <div class="meters">+ <div class="meter"><i style="height:62%;background:var(--success)"></i></div>+ <div class="meter"><i style="height:62%;background:var(--success)"></i><i style="bottom:62%;height:16%;background:var(--warning)"></i></div>+ </div>+ <div class="mono" style="font-size:9px;color:var(--text-secondary);line-height:1.8">L −6.4 dB<br>R <span style="color:var(--danger-bright)">+0.8 dB</span></div>+ </div>+ </div>+ <p class="note">Meters: 11 wide, 5 apart, zones Signal → −6 dB Caution → 0 Alert. Peak hold stays until clicked. Timeline clips: flat, radius 2, no outline; playhead 1 px brass with a 7 × 5 flag.</p>+</section>++<section id="cards">+ <p class="eyebrow">08 · Device cards</p>+ <h2>700 × 260, at true size</h2>+ <p>Header 22: name left; processing-type badge and bypass right — nothing else (presets, A/B, move and delete are in the right-click menu). Body inset 6, sections radius 6 with gap 5. Three columns: choice → work → output.</p>+ <div class="scroll"><div class="card">+ <div class="card__head"><span class="card__name">Nota Chamber</span><span class="card__badge">CONVOLUTION</span><span class="switch on" style="margin-left:6px"><i></i></span></div>+ <div class="card__body">+ <div class="sect"><h5>Choice</h5><div class="field" style="width:100%;height:22px;font-size:10px;color:var(--text-primary)">Concert Hall</div>+ <div class="seg seg--device" style="align-self:flex-start"><button aria-pressed="true">IR</button><button aria-pressed="false">Algo</button></div></div>+ <div class="sect"><h5>Work</h5>+ <div class="graph" style="height:96px"><span class="axis" style="left:4px;bottom:4px">0</span><span class="axis" style="right:4px;bottom:4px">2.6 s</span>+ <svg width="100%" height="96" viewBox="0 0 360 96" preserveAspectRatio="none" aria-hidden="true"><path d="M0 20 C40 22 80 40 140 58 S260 84 360 88" style="fill:none;stroke:var(--accent);stroke-width:1.8"/><path d="M0 34 C40 36 90 52 150 66 S260 86 360 90" style="fill:none;stroke:var(--chroma-teal);stroke-width:1.4"/></svg></div>+ <div class="row" style="gap:4px;margin:0;justify-content:space-around"><div class="cell"><svg class="knob" width="34" height="34" viewBox="0 0 52 52" aria-hidden="true"><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--bg-sunken);stroke-width:5;stroke-linecap:round" stroke-dasharray="99.0 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--accent);stroke-width:5;stroke-linecap:round" stroke-dasharray="29.7 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="14" style="fill:var(--surface-raised);stroke:var(--border-strong);stroke-width:1"/><line x1="26" y1="26" x2="19.0" y2="20.9" style="stroke:var(--accent-bright);stroke-width:2.4;stroke-linecap:round"/></svg><span class="cell__label">PRE-DELAY</span><span class="cell__value mono">20.0 ms</span></div><div class="cell cell--hot"><svg class="knob" width="34" height="34" viewBox="0 0 52 52" aria-hidden="true"><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--bg-sunken);stroke-width:5;stroke-linecap:round" stroke-dasharray="99.0 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--accent);stroke-width:5;stroke-linecap:round" stroke-dasharray="61.4 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="14" style="fill:var(--surface-raised);stroke:var(--border-strong);stroke-width:1"/><line x1="26" y1="26" x2="30.7" y2="18.7" style="stroke:var(--accent-bright);stroke-width:2.4;stroke-linecap:round"/></svg><span class="cell__label">SIZE</span><span class="cell__value mono">100 %</span></div><div class="cell"><svg class="knob" width="34" height="34" viewBox="0 0 52 52" aria-hidden="true"><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--bg-sunken);stroke-width:5;stroke-linecap:round" stroke-dasharray="99.0 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--accent);stroke-width:5;stroke-linecap:round" stroke-dasharray="19.8 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="14" style="fill:var(--surface-raised);stroke:var(--border-strong);stroke-width:1"/><line x1="26" y1="26" x2="17.4" y2="24.6" style="stroke:var(--accent-bright);stroke-width:2.4;stroke-linecap:round"/></svg><span class="cell__label">ATTACK</span><span class="cell__value mono">0.0 ms</span></div><div class="cell"><svg class="knob" width="34" height="34" viewBox="0 0 52 52" aria-hidden="true"><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--bg-sunken);stroke-width:5;stroke-linecap:round" stroke-dasharray="99.0 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--accent);stroke-width:5;stroke-linecap:round" stroke-dasharray="54.4 131.9" transform="rotate(135 26 26)"/><circle cx="26" cy="26" r="14" style="fill:var(--surface-raised);stroke:var(--border-strong);stroke-width:1"/><line x1="26" y1="26" x2="28.0" y2="17.6" style="stroke:var(--accent-bright);stroke-width:2.4;stroke-linecap:round"/></svg><span class="cell__label">DECAY</span><span class="cell__value mono">2.60 s</span></div></div></div>+ <div class="sect"><h5>Output</h5>+ <div class="slider" style="width:100%;grid-template-columns:34px 1fr 36px"><span>Conv</span><span class="track"><b style="width:60%"></b><u style="left:60%"></u></span><span>−3.0</span></div>+ <div class="slider" style="width:100%;grid-template-columns:34px 1fr 36px"><span>Dry</span><span class="track"><b style="width:80%"></b><u style="left:80%"></u></span><span>0.0</span></div>+ <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>+</section>++<section id="shell">+ <p class="eyebrow">09 · Shell</p>+ <h2>Header, transport, panels on the gutter</h2>+ <div class="shell">+ <div class="h">Northern Reverb Study</div>+ <div class="t">VIEW · STOP PLAY REC · POSITION · LOOP · BPM SIG GRID · SWITCHES · + TRACK</div>+ <div class="b"><div>BROWSER</div><div>CANVAS · ALWAYS SUNKEN</div></div>+ <div class="s">STATUS</div>+ </div>+ <p class="note" style="margin-top:10px">Header 36 · transport 42 under it (a departure from the almanac, which puts it at the bottom) · panels float on Gutter with 12 px gaps · status 22. List rows 26, one line: dot, name, mono metadata. Arrangement tracks 64, groups 26, header column 228.</p>+ <h3>Accepted departures</h3>+ <ul class="plain">+ <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>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></div>-<script>-(function () {- document.querySelectorAll(".sw").forEach(function (sw) {- sw.addEventListener("click", function () {- var paper = document.documentElement.getAttribute("data-variant") === "paper";- var hex = (paper ? sw.getAttribute("data-paper") : sw.getAttribute("data-hex")) || "";- var done = function () {- sw.classList.add("copied");- var el = sw.querySelector(".sw__hex");- if (!el) return;- var prev = el.textContent;- el.textContent = "copied";- setTimeout(function () { el.textContent = prev; sw.classList.remove("copied"); }, 900);- };- try {- if (navigator.clipboard && navigator.clipboard.writeText) {- navigator.clipboard.writeText(hex).then(done, function () {});- }- } catch (e) { /* clipboard unavailable — the swatch still shows its hex */ }- });- });-- // Variant toggle. Flipping data-variant re-tints every specimen through the- // tokens; the swatch labels carry both hexes and swap with it.- var root = document.documentElement;- function setVariant(name) {- if (name === "paper") root.setAttribute("data-variant", "paper");- else root.removeAttribute("data-variant");- document.querySelectorAll(".variant button").forEach(function (b) {- b.setAttribute("aria-pressed", String(b.getAttribute("data-set") === name));- });- document.querySelectorAll(".sw").forEach(function (sw) {- var hex = name === "paper" ? sw.getAttribute("data-paper") : sw.getAttribute("data-hex");- if (!hex) return;- var el = sw.querySelector(".sw__hex");- if (el) el.textContent = hex;- });+(() => {+ const root = document.documentElement;+ const buttons = document.querySelectorAll('.mast .seg button');+ function hexes() {+ const paper = root.dataset.variant === 'paper';+ document.querySelectorAll('.sw').forEach(s => { s.querySelector('.sw__hex').textContent = paper ? s.dataset.light : s.dataset.dark; });+ }+ function set(v) {+ if (v === 'paper') root.dataset.variant = 'paper'; else delete root.dataset.variant;+ buttons.forEach(b => b.setAttribute('aria-pressed', String(b.dataset.v === v)));+ hexes();+ try { localStorage.setItem('ember-variant', v); } catch (e) {}}- document.querySelectorAll(".variant button").forEach(function (b) {- b.addEventListener("click", function () { setVariant(b.getAttribute("data-set")); });- });+ buttons.forEach(b => b.addEventListener('click', () => set(b.dataset.v)));+ let saved = null; try { saved = localStorage.getItem('ember-variant'); } catch (e) {}+ const asked = new URLSearchParams(location.search).get('variant'); // ?variant=paper+ set((asked || saved) === 'paper' ? 'paper' : 'graphite');+ document.querySelectorAll('.sw').forEach(s => s.addEventListener('click', () => {+ const hex = s.querySelector('.sw__hex').textContent;+ const done = () => { s.classList.add('copied'); setTimeout(() => s.classList.remove('copied'), 900); };+ if (navigator.clipboard) navigator.clipboard.writeText(hex).then(done, () => {});+ }));})();</script>+</body>+</html>diff --git a/DESIGN.md b/DESIGN.mdindex c595718e..18685b8f 100644--- a/DESIGN.md+++ b/DESIGN.md@@ -3,333 +3,453 @@# Nota design guideline — Ember-Nota's UI runs on **Ember**, one system in two variants:+Nota's UI runs on **Ember**: warm neutrals (hue ~40°) lit by exactly one accent, brass.+It comes in two variants of one system:-- **Ember Graphite** (dark, the default) — warm graphite neutrals (hue ~40°) lit by a- single brass accent. A DAW is used in dark rooms for long sessions, so this is what- the app ships with.-- **Ember Paper** (light) — the same hue family and the same roles on a warm paper- ground. Brass darkens to bronze: against paper a mark needs *less* lightness, not- more, to carry the emphasis it had against graphite.+- **Ember Graphite** (dark, the default) — a DAW is used in dark rooms for long sessions.+- **Ember Paper** (light) — the same roles on a warm paper ground. Brass darkens to+ bronze: against paper a mark needs *less* lightness to carry the emphasis it had+ against graphite.-Preferences → Appearance offers Ember Graphite / Ember Paper / System. The choice applies-live — no restart — and System follows the OS appearance as it changes.+Preferences → Appearance offers Graphite / Paper / System; the switch is live.-**[→ Open `DESIGN.html`](DESIGN.html) for the visual reference.** That page renders every-swatch, control specimen and card layout at true size in the real palette, and is the-faster way to answer "what should this look like". This file is the text version: the-rules, the token values, and what to do when they disagree.+The system comes from the **Nota Design Almanac** (`Nota.html` in the sibling+`nota-design` folder, next to the mockups — it stays a design artifact there, not a second+requirement in this repo), which was distilled from the accepted designs — Consort, Pentad, Chamber, and+the Browser / Arrangement / Transport shell. The almanac describes Graphite only; this+file is the guideline the app is held to: the almanac's rules as implemented, the Paper+values, and the few places where the app deliberately departs from the almanac+(§ Accepted departures).++**[→ Open `DESIGN.html`](DESIGN.html)** for the visual reference — every swatch, the+control specimens and the card anatomy at true size, with a Graphite / Paper toggle.## Source of truth, in order| Rank | File | Authority ||---|---|---|-| 1 | `src/managed/Nota.App/Theme/NotaTheme.axaml` | **Definitive.** Colour, geometry and control styles. |-| 2 | `src/managed/Nota.App/Theme/NotaPalette.cs` | Mirror of (1) for custom-drawn views that cannot resolve XAML resources cheaply. Must stay in sync by hand. |-| 3 | `src/managed/Nota.App/Theme/NotaThemeService.cs` | Applies a variant to both layers and repaints. |-| 4 | `src/managed/Nota.App/DeviceCardKit.cs` | Palette aliases and the atomic builders for device cards. |+| 1 | `src/managed/Nota.App/Theme/NotaTheme.axaml` | **Definitive.** Colour (both variants), geometry, type classes, control styles. |+| 2 | `Theme/NotaPalette.cs` · `NotaGeometry.cs` · `NotaFonts.cs` · `NotaNum.cs` | The C# side for custom-drawn views: colour slots, radii/sizes/spacing, typefaces and type scale, number setting. |+| 3 | `DeviceCardKit.cs`, `Controls/` | The shared controls and card builders. |+| 4 | `tests/Nota.SmokeTest/DesignTokenCheck.cs` | Enforces (1) ↔ (2) sync and the bans below. || 5 | `DESIGN.html` / this file | Documentation. If these disagree with 1–4, **these are wrong** — fix them. |-**Never hardcode a colour or size in a view.** In XAML use `{DynamicResource Brush.*}` /-`{StaticResource Radius.*}`. In custom-drawn C# read from `NotaPalette` or `DeviceCardKit`.-A literal is not just off-palette — it is stuck in one variant.-## How theming works-The colour tokens in `NotaTheme.axaml` live in `ResourceDictionary.ThemeDictionaries`-under `Dark` and `Light`, so **`{DynamicResource Brush.*}` is mandatory** — a-`StaticResource` cannot follow the variant. Geometry, fonts and control heights are-variant-independent and stay in the shared dictionary as `StaticResource`.+Colour tokens live in `NotaTheme.axaml` under `ThemeDictionaries` → `Dark` / `Light`, so+XAML **must** use `{DynamicResource Brush.*}`; a `StaticResource` cannot follow the+variant. Geometry, fonts and sizes are variant-independent (`StaticResource`).-`NotaPalette` serves the custom-drawn layer. Each token is a **slot**: one long-lived-`SolidColorBrush` whose `Color` is re-pointed on a variant change. Views (and the private-`static readonly` fields that alias them) keep the same brush object, so nothing has to be-rebuilt. Three ways to get a colour:+`NotaPalette` serves the custom-drawn layer. Every token is a **slot**: one long-lived+`SolidColorBrush` whose `Color` is re-pointed when the variant changes, so views keep the+same brush object and nothing is rebuilt. Ways to get a colour:-| Call | For | Light value |-|---|---|---|-| `NotaPalette.SurfaceCard` | a named token | authored by hand |-| `NotaPalette.Wash(slot, 0x24)` | a translucent tint of a token | tracks its source slot |-| `NotaPalette.Ink("#D06FB0")` | the identity hue of one visualiser, band or stored tag | derived (same hue, lightness reflected), or pinned in `InkOverrides` |+| Call | For |+|---|---|+| `NotaPalette.Accent` (any named slot) | a token |+| `NotaPalette.Wash(slot, 0x28)` | a translucent tint of a token; cached, follows its slot |+| `NotaPalette.Ink("#6D8FB5")` | a one-off device hue or stored tag colour. A hex equal to a role token returns that token; any other gets a derived Paper value, or one pinned in `InkOverrides` |+| `NotaPalette.Derived(() => …)` | a colour a view computes from slots; register once and cache it |+| `ArrangementView.TrackBrush(index)` | a track colour |-Two shapes cannot ride a slot and need care:+**Nothing may snapshot a colour.** `new SolidColorBrush(slot.Color)`, a+`static readonly Color` taken from the palette, or a static array of palette colours all+freeze a view in the variant it was built in. Use the slot, a `Wash`, a property+(`static Color X => NotaPalette.Accent.Color;`), or read `.Color` inside `Render`.-- **`Color` values.** A `static readonly Color` snapshots the variant. Declare it as an- expression-bodied property (`static Color X => NotaPalette.Accent.Color;`).-- **Gradients.** `LinearGradientBrush` copies its stop colours. Build one with- `NotaPalette.VGradient(...)`, and only ever into a `static` field — the registration- that re-tints it is permanent.+### Changing a token-Anything a view derives itself — per-index clip brushes, alpha-blended track fills — must-be dropped on `NotaPalette.Changed`.+1. Edit **both** branches in `NotaTheme.axaml` — `Dark` and `Light`.+2. Mirror the pair into the `NotaPalette` slot (the smoke test fails until you do).+3. Run `python3 scripts/design-html.py` to regenerate `DESIGN.html`, and update the table here.+4. Look at it in both variants — the app (Preferences → Appearance) and `DESIGN.html`+ (the toggle in its masthead, or `DESIGN.html?variant=paper`).## The rules-- **Colour.** Warm graphite neutrals plus one accent, brass. The accent is spent on- primary actions, selection, focus, active state, and the time-domain data that is the- point of a DAW — playhead, MIDI notes, waveform. Rec and destructive are danger red.- Green / amber / red are for status only. Flat solid fills: **no gradients, no textures,- no background images.**-- **Type.** `Font.UI` (Inter, standing in for Geist) for everything a person reads;- `Font.Mono` for anything numeric that is compared or aligned — transport position, BPM,- sample counts, latency. Sentence case everywhere. No emoji.-- **Spacing.** 4px grid. Panels pad 16; cards and track rows pad 10. There are no- `Space.*` resources — this is convention only.-- **Geometry.** Radii scale with the element: clips 4, chips/wells/checkboxes 5, buttons- and menus 7, pills 8, cards and panels 10, dialogs 14.-- **Structure over shadows.** Panels separate with 1px `Brush.BorderDefault` lines.- Shadows belong only to floating layers — menus and dialogs.-- **States.** Hover `Brush.SurfaceHover`; pressed `Brush.SurfaceActive`; checked- `Brush.AccentSubtle` fill + `Brush.Accent` border + `Brush.AccentBright` text; selected- `Brush.SurfaceSelected`; focus a 1px `Brush.AccentBright` ring. **No scale or bounce- transforms.**-- **Motion.** 100–240ms, ease-out, opacity plus ≤6px translate. Motion that delays a click- is a bug.-- **Copy.** Calm, technical, precise. Imperative for actions, declarative for status- (`Playing · 128 BPM`). Middle dot `·` as the meta separator. Empty states get one short- line and one primary action.-- **Icons.** Lucide geometry, stroke ~1.75. No emoji, no unicode-as-icons except `·` and- the transport glyphs already in use.+1. **One accent.** Brass means exactly "active, selected, changed". Everything else is a+ surface, text or semantics. There is no second accent.+2. **Semantics only where they apply.** Red belongs to *active recording* (`Record`) and to+ overload (`Danger`/Alert). Green and yellow are meter zones and live signal.+3. **Role chromas live only inside graphs** — never on buttons, never as state.+4. **Flat material.** No gradients, no glow, no textures, no skeuomorphism. Depth is+ lightness plus a hairline; three levels at most.+5. **Two typefaces, one split.** Geist for names and words; Geist Mono for anything that is+ a measurement. Nothing smaller than 7 px.+6. **One implementation per control**, differing only in size. A control's value is+ always visible next to it — never only in a tooltip.+7. **State changes colour, never size, border width or position.** Nothing moves on hover.+8. **Real time is not animated.** Meters, playhead and spectra jump to the value.+9. **Muted is the next Ink step, not opacity.** Opacity is not a state.+10. **Numbers are set, not printed:** point decimal, U+2212 minus, thin space before the+ unit, fixed precision.## Tokens-### Surfaces--| Key | Graphite | Paper | Use |-|---|---|---|---|-| `Brush.SurfaceAbyss` | `#0A0908` | `#DCD6C5` | Deepest recess — meter troughs, transport console |-| `Brush.BgSunken` | `#100F0D` | `#E4DFD1` | Wells, lanes, graph grounds, chrome |-| `Brush.BgApp` | `#171613` | `#EFEADE` | App ground |-| `Brush.LaneB` | `#191814` | `#E9E4D6` | Lane alternation |-| `Brush.SurfaceCard` | `#1E1C18` | `#F8F5EC` | Panels, cards |-| `Brush.SurfaceRaised` | `#26231E` | `#FFFEF8` | Transport, chips, device cards |-| `Brush.SurfaceHover` | `#2E2B24` | `#E7E1D0` | Hover |-| `Brush.SurfaceActive` | `#332F27` | `#DBD4C0` | Pressed |-| `Brush.SurfaceSelected` | `#24D8A03D` | `#2EA87415` | Selection (accent wash) |--Forward still means lighter in both variants, and a well is still darker than the surface-it sits in. Hover is the one role that flips direction: it lifts on graphite and settles-on paper.--### Text and borders--| Key | Graphite | Paper | Use |-|---|---|---|---|-| `Brush.TextPrimary` | `#E9E4D8` | `#241F17` | Warm off-white / warm near-black |-| `Brush.TextSecondary` | `#A39D8F` | `#5E5849` | Labels, captions |-| `Brush.TextTertiary` | `#6E6A5E` | `#8A8474` | Section labels |-| `Brush.TextDisabled` | `#4A463D` | `#ADA694` | Disabled |-| `Brush.TextOnAccent` | `#171613` | `#FFFBF2` | Ink on the accent fill |-| `Brush.BorderDefault` | `#2C2923` | `#D5CEBB` | Panel separation |-| `Brush.BorderStrong` | `#3A362D` | `#BDB5A0` | Control outlines |-| `Brush.GridBeat` | `#1F1D18` | `#DED8C8` | Beat lines |-| `Brush.GridBar` | `#2A2721` | `#CFC8B4` | Bar lines |--### Accent and semantic--| Key | Graphite | Paper | Use |-|---|---|---|---|-| `Brush.Accent` | `#D8A03D` | `#A87415` | Brass / bronze — the audio path |-| `Brush.AccentHover` | `#E8B24C` | `#8F6110` | Hover on solid fills |-| `Brush.AccentBright` | `#F0C060` | `#744D07` | Focus ring, playhead, selected note |-| `Brush.AccentSubtle` | `#24D8A03D` | `#24A87415` | Toggle-on wash |-| `Brush.Success` | `#58B368` | `#2C7A3E` | Signal present, Session play |-| `Brush.Warning` | `#D9C34C` | `#837010` | Meter caution zone |-| `Brush.Danger` | `#D95F4C` | `#B03A28` | Record, destructive |-| `Brush.DangerHover` | `#E4715F` | `#C64A36` | Hover |--The accent ramp reads "more prominent" downward on paper and upward on graphite:-`AccentBright` is the hottest mark in both, which means the *lightest* on graphite and the-*darkest* on paper.--Fluent's `SystemAccentColor` and its six ramps are retinted to brass, so stock Avalonia-controls match instead of shipping default blue.--### Geometry--`Radius.Clip` 4 · `Radius.Sm` 5 · `Radius.Md` 7 · `Radius.Pill` 8 · `Radius.Lg` 10 ·-`Radius.Xl` 14-`Control.Sm` 22 · `Control.Md` 26 · `Control.Lg` 28--### Track palette--Assigned round-robin, muted and equal-weight so no track outranks another. A track inside-a group takes its group's hue instead, varied across the three shades so siblings stay-apart inside one family; an explicitly coloured track keeps its own colour. Paper keeps-the eight hues and darkens them, so a clip's full-strength content still reads over a 16%-fill of itself:--| | rust | amber | olive | sage | teal | slate | mauve | rose |+Values are Graphite / Paper. Paper values were derived from Graphite by lightness+reflection and pinned by hand where the reflection read poorly.++### Surfaces — nine steps, far to near++| Key | Almanac | Graphite | Paper | Use |+|---|---|---|---|---|+| `Brush.SurfaceAbyss` | Void | `#0A0908` | `#D8D1BE` | Deepest recess — the transport strip |+| `Brush.BgApp` | App | `#0B0A09` | `#DCD6C5` | Window ground, plugin body |+| `Brush.Gutter` | Gutter | `#0C0B09` | `#E0DAC9` | The gaps panels float in |+| `Brush.BgSunken` | Well | `#100F0D` | `#E4DFD1` | Graph windows, fields, slider tracks (`ChromeBg`, `SurfaceActive` alias it) |+| `Brush.Panel` | Panel | `#141310` | `#EAE5D7` | Browser, headers, inspector; disabled button |+| `Brush.SurfaceCard` | Card | `#171613` | `#EFEADE` | A section inside a device |+| `Brush.SurfaceRaised` | Raised | `#1C1A16` | `#F8F5EC` | Button at rest |+| `Brush.SurfaceHover` | Hover | `#252219` | `#E7E1D0` | Hovered button or row |+| `Brush.TrackOff` | Track off | `#26231E` | `#DBD4C0` | Track of an off switch |+| `Brush.LaneB` | — | `#131210` | `#E7E2D4` | Alternate arrangement lane |+| `Brush.SurfaceSelected` / `AccentSubtle` | Brass Wash | `#241F17` | `#F2E4C4` | Selected row, engaged button ground |++### Lines++| Key | Almanac | Graphite | Paper | Use |+|---|---|---|---|---|+| `Brush.Hairline` (`NotaPalette.GraphBorder`) | Hairline | `#221F1A` | `#D5CFBE` | Row dividers, graph frame |+| `Brush.BorderDefault` | Border | `#2C2923` | `#D5CEBB` | Panel, button, field |+| `Brush.BorderStrong` | Border strong | `#3A362D` | `#BDB5A0` | Knob cap, hovered border, inactive fill |+| `Brush.BorderBrass` | Border brass | `#6B5326` | `#C9A254` | Engaged button, focus |+| `Brush.GridBeat` | Grid | `#1E1C18` | `#DED8C8` | Grid inside graphs, zero axis |+| `Brush.GridBar` | — | `#2A2721` | `#CFC8B4` | Bar lines |++### Ink — eight steps, strictly by importance++| Key | Step | Graphite | Paper | Use |+|---|---|---|---|---|+| `Brush.TextHeading` | Ink 0 | `#F2EDE1` | `#1A150E` | Page title, project name. Rare. |+| `Brush.TextPrimary` | Ink 1 | `#E9E4D8` | `#241F17` | Device, track, preset names; values |+| `Brush.TextStrong` | Ink 2 | `#C7C0B0` | `#3E382C` | Button text, transport readouts |+| `Brush.TextSecondary` | Ink 3 | `#A39D8F` | `#5E5849` | Inactive but readable, metadata |+| `Brush.TextMuted` | Ink 4 | `#8D8779` | `#746D5C` | Explanations, units, hints |+| `Brush.TextTertiary` | Ink 5 | `#6E6A5E` | `#8A8474` | Caps labels over parameters; empty states |+| `Brush.TextDisabled` | Ink 6 | `#55514A` | `#9E9786` | Placeholder, disabled action |+| `Brush.TextAxis` | Ink 7 | `#4A463D` | `#ADA694` | Axis labels inside graphs only |+| `Brush.TextOnAccent` | — | `#171613` | `#FFFBF2` | Text on solid brass |++### Brass++| Key | Almanac | Graphite | Paper | Use |+|---|---|---|---|---|+| `Brush.Accent` | Brass | `#D8A03D` | `#A87415` | Arc, fill, playhead, the one solid button |+| `Brush.AccentBright` | Brass Light | `#F0C060` | `#744D07` | Knob pointer, modified label, handle |+| `Brush.AccentHover` | Brass Hover | `#E9BE6A` | `#8F6110` | Engaged text, brass link hover |+| `Brush.AccentDeep` | Brass Deep | `#B08536` | `#7A5008` | Pressed |+| `Brush.AccentDim` | Brass Dim | `#8A6B2E` | `#9C8034` | Eyebrows, mono section marks |+| `Brush.AccentEdge` | Brass Edge | `#5E4A22` | `#D3B173` | Brass chip border |++`AccentBright` is the hottest mark in both variants — the lightest on graphite, the darkest+on paper. Fluent's `SystemAccentColor` ramps are retinted to brass.++### Semantics++| Key | Almanac | Graphite | Paper | Use |+|---|---|---|---|---|+| `Brush.Record` | Record | `#C25B44` | `#B54A32` | Active recording — the only claim on red |+| `Brush.RecordInk` | — | `#F4E3DC` | `#FFF4EE` | The disc on an engaged record button |+| `Brush.Danger` | Alert | `#C2554A` | `#B13E33` | Overload, clipping |+| `Brush.DangerBright` | Alert Light | `#E08A72` | `#A3391B` | Overload readout text |+| `Brush.Warning` | Caution | `#D9C34C` | `#837010` | Meter −6…0 dB |+| `Brush.Success` | Signal | `#58B368` | `#2C7A3E` | Working meter zone, live signal |+| `Brush.SuccessDim` | Signal Dim | `#7FB069` | `#609548` | Transport input, metronome |++### Role chromas — inside graphs only++When two to four sources share a graph, each takes a chroma in this fixed order+(`NotaGraph.Chroma(n)`): **Brass** (primary: left channel, mid band, main signal) ·+**Teal** `#5B9E9C` / `#2F7472` (lows, early reflections, input, modulation) · **Rose**+`#B57286` / `#86465B` (right channel, highs, tail) · **Steel** `#6D8FB5` / `#3E6288` (rare).+Light pairs for text: `ChromaTealLight` `#7FC0BE`, `ChromaRoseLight` `#D79BAB`.++A modulated knob's arc takes the chroma of its source; its label stays neutral.++### Track palette — nine roles++| Drums | Perc | Bass | Keys | Texture | FX | Brass | Vox | Return ||---|---|---|---|---|---|---|---|---|-| Graphite | `#C4756A` | `#C99C55` | `#9BA65D` | `#6FA383` | `#5B9E9C` | `#6D8FB5` | `#9B7FA6` | `#B57286` |-| Paper | `#9A4A3E` | `#97682A` | `#646E32` | `#42765A` | `#2F7472` | `#3E6288` | `#6A5176` | `#86465B` |--Returns `#7C88A0` / `#A08A7C` (paper `#4D5972` / `#705B4E`); master reuses the accent.+| `#58B368` | `#4E9E7A` | `#3E8E8E` | `#5AA0B8` | `#C77F55` | `#7A6FB0` | `#B05A7A` | `#9AA64A` | `#7FA88E` |+| `#328140` | `#306F53` | `#256464` | `#317187` | `#985127` | `#4B4082` | `#7F3450` | `#6C752C` | `#4D7A5D` |-Track 5 (teal, `#5B9E9C`) doubles as the **modulation accent** — see below.+One lightness for all, so no track is louder than another. Each role has three shades+(base · light · dark) that tracks inside a group step through. Return buses draw from the+ninth role (`ReturnA/B`); master is brass. Old projects keep their stored index, which+now points at the new hue.-## Text roles+### Geometry-| Class | Spec | Colour |+| Radius (`Radius.*` / `NotaRadius`) | px | For ||---|---|---|-| `TextBlock.Heading` | 13px SemiBold | TextPrimary |-| default control text | 11px Medium | TextPrimary |-| `TextBlock.Caption` | 10px | TextSecondary |-| `TextBlock.SectionLabel` | 10px Bold | TextTertiary |-| `TextBlock.Mono` | `Font.Mono` | — |--Inside device cards the scale is tighter: knob captions 8px uppercase tertiary, knob-values 8px mono, card titles 11px SemiBold.--## Device cards--Every built-in device and instrument editor is a card of fixed height **260px**-(`DeviceCardKit.CardH`). Width is declared per kind by the body strategy.--**Vertical budget:** header 26 · LIVE strip 34 · body 200.--- **Header (26px)** — power dot, device name (11px SemiBold), type tag (9px bold- tertiary, .08em tracking), preset selector, A/B toggle, then right-aligned CPU %,- stereo meter, peak dB, close and drag glyphs.-- **LIVE strip (34px)** — the two or three parameters worth reaching for mid-take, as- inline 3px sliders with an 8×9 cap and a mono value.-- **Body (200px)** — optional 80px tab rail, main area, optional 100–150px output rail.--**Frame:** `Brush.SurfaceRaised` fill, 1px `Brush.BorderDefault`, radius 7, clipped.-Header has a 1px bottom border and 8px horizontal pad. Body inset is 10px unless the-strategy sets `FullBleed`.--### The two-colour rule--This carries the most meaning and is the easiest to get wrong:--- **Brass `Brush.Accent` = the audio path.** Anything the signal passes through — gain,- frequency, drive, mix. On a knob: `Accent = true`.-- **Teal `NotaPalette.Teal` = modulation and detection.** Anything that *controls* rather than- carries the signal — LFOs, envelopes, sidechain detectors, followers. Pass it as the- knob's `ArcColor`, and group those parameters behind a 2px teal left border with a teal- section label.-- **Output rail stays muted.** End-of-chain trim and pan fill with `Brush.BorderStrong`,- not brass — housekeeping, not the sound.-- **Active tab takes a 2px left border** — brass for signal pages, teal for modulation- pages.--## Control kit--Avalonia's stock controls are too chunky at this density, so the card layer is-custom-drawn. Builders live in `DeviceCardKit`; controls in `Controls/`.+| `Bar` | 1 | Spectrum bars, stop square |+| `Clip` | 2 | Clip, meter, slider track |+| `Badge` | 3 | Small segment, badge in a device |+| `Control` | 4 | Graph window, button, dropdown |+| `Tile` | 5 | Transport button, search, tile |+| `Panel` | 6 | Panel, device section, transport module |+| `Body` | 8 | Device body, window frame |+| `Pill` | ½ height | Filter chip, switch |++| Size (`Control.*` / `NotaSize`) | px |+|---|---|+| Device card | 700 × 260 |+| Transport strip (`Console`) | 42 · buttons 34 · Play 46 |+| Shell button / field (`Shell`) | 26 |+| Tab segment (`Seg`) in container (`SegGroup`) | 24 in 30 |+| Filter chip (`Chip`) | 20 |+| Switch | 18 × 10, knob 7, inset 1.5 |+| Knob (`KnobSecondary` / `KnobRegular` / `KnobMain`) | 34 / 36 / 44 |+| Parameter cell (`ParamCell`) | 53 tall |+| Slider track | 3, handle 6 × 7 |+| Meter | 11 wide, 5 between channels |+| List row | 26 |++| Spacing (`Space.*` / `NotaSpace`) | px |+|---|---|+| In a device: hair · gap · inset · section inset | 2 · 5 · 6 · 8 |+| In the shell: tile · gutter between panels · inside a panel | 8 · 12 · 20 |++**Depth, exactly three levels:** sunken — Well, Hairline, `Shadow.Sunken` (inner top line+`#80000000`) · flat — Card, Border, no shadow · raised — Raised, Border, `Shadow.Raised`+(inner top line `#08FFFFFF`). No drop shadows except a floating plugin window.++## Type++`Font.UI` = **Geist** 400/500/600/700, `Font.Mono` = **Geist Mono** 400/500, both bundled+(`assets/fonts`, SIL OFL). `NotaFonts` holds the typefaces for custom drawing — never name+a font family in a view. Geist lacks the thin space; it falls back to the system font.++**Shell scale** (`NotaType`, `TextBlock.*` classes)++| Class | Spec | For |+|---|---|---|+| `Title` | 600 · 26 | Section title |+| `Heading` | 600 · 13 | Project name in the header |+| `Name` | 500 · 12 | Track, preset, file name |+| default | 500 · 11 | Buttons, tabs, chips |+| `Caption` | 400 · 11, Ink 4 | Explanation, hint |+| `SectionLabel` / `GroupLabel` | 700 · 10 caps, .14em | Panel group header |+| `Readout` | Mono 500 · 13 | Position and tempo |+| `Value` | Mono 400 · 10 | Row values, metadata |+| `Eyebrow` | Mono 500 · 9 caps, .18em | Eyebrow, format badge |++**Device scale**++| Class | Spec | For |+|---|---|---|+| `DeviceName` | 600 · 12 | Device name in the header |+| `DeviceSection` | 700 · 9 caps, .12em | Section title |+| `RowLabel` | 700 · 8 caps, .1em | Slider-row label |+| `KnobLabel` | 700 · 7 caps, .08em | Label under a knob |+| `KnobValue` | Mono 400 · 7 | Parameter value |+| `Axis` | Mono 400 · 7 | Axis label inside a graph |++### Numbers++`NotaNum.Install()` (called in `App.Initialize`) makes the display culture the default:+invariant with U+2212 as the negative sign — so every implicit `{v:0.0}` prints `−3.3`+with a point on any OS locale; typed input still accepts a hyphen. Project and preset+files are JSON and never go through it.++- The unit follows a **thin space**: `4.6 s`, `−3.3 dB`, `72 %` (` ` in source).+- A plus only where the sign matters: `+0.8 dB`.+- Fixed precision: dB one decimal · tempo two (`120.00`) · percent whole · Hz whole up to+ 999, then `3.2 k`. Helpers: `NotaNum.Db`, `Hz`, `Pct`, `Bpm`, `Time`, `Unit`, `F`.+- Width must not jump across 10 or 100 — mono plus fixed precision.+- Axis labels in graphs and clip lengths in beats may use variable precision.++### Labels and copy++- Parameter labels: English caps, one word — `DECAY`, `PRE-DELAY`, `FEEDBACK`. No colons,+ no "Value", no vowel-dropped contractions (`FDBK`, `ATK`, `LVL`). The established+ truncations `FREQ`, `RESO`, `THRESH` are allowed: the full words do not fit a 53 px cell.+- Shell tooltips: short and verb-first — "Snap clips to the grid (hold Alt to drag+ freely)", "Clear the peak hold". Not "Click to…". The value stays on the control;+ a tooltip may add the unit or range.+- Browser category tags lowercase (`bass`, `analog`; acronyms stay `EQ`, `LFO`); the+ processing-type badge is mono caps (`CONVOLUTION`, `DYNAMICS`).+- Preset names describe a place or material (`Stone Vault`, `Tape Glue`), not an emotion.+ Device names are one word from the musical vocabulary (`Chamber`, `Prism`).+- Middle dot `·` separates meta. Sentence case. No emoji, no exclamation marks.++## Controls++Builders live in `DeviceCardKit`; controls in `Controls/`. Reuse before writing anything.### Interaction contract-Every value control behaves identically — match this exactly when adding one:--- **Vertical drag**, up increases; full range over ~140px.-- **Double-click** restores `Default` (`NaN` disables).-- **Left button only** — right-click bubbles so the CV-modulate menu still opens.-- **`GestureBegin` / `GestureEnd`** bracket `BeginAutomationWrite` / `EndAutomationWrite`,- so a move made while playing is recorded.+- **Vertical drag**, up increases, full range over ~140 px; Shift (or Ctrl/⌘) is fine.+ Cursor `ns-resize`. A click never jumps the value. No horizontal drag anywhere.+- **Double-click** restores the default where one is supplied.+- **Left button only** — right-click bubbles to the CV-modulate / MIDI Learn menu.+- **`GestureBegin` / `GestureEnd`** bracket `BeginAutomationWrite` / `EndAutomationWrite`.- **`MidiLearn.Bind`** registers the control with its display name.-- **Live follow** re-reads engine state each UI tick and **skips while `Dragging`**, so- automation never fights the hand.-- **Numeric readouts are mono**, so width does not jump as digits change.+- **Live follow** re-reads engine state each tick and skips while dragging.### Inventory-| Control | Size | Role |-|---|---|---|-| `Knob` | 38×38, 270° from 135° | The workhorse. Sunken groove, value arc, pointer at 0.66 r. |-| `KnobCell` | 58 wide | Knob + 8px mono value + 8px uppercase caption. Under 52 wide both drop to 7px. |-| `ValueBar` | h 18, min-w 46 | Sunken field, value text over a horizontal fill. |-| `MiniFader` | h 12, min-w 40 | 3px track, 8×9 cap. For the 64px track header. |-| `VFader` | w 30, 0–1.5 | Mixer strip fader. |-| `PanKnob` | 26×26, −1…1 | Radial pan, 1.5px ring, 2px indicator. |-| `PanBar` | bipolar | Track-header pan, fills centre-out, reads `50L … C … 50R`. |-| `DragNumber` | mono | Drag to nudge, double-click to type, commits on Enter/blur. |-| `MeterBar` | v w10 / h 12×80 | Peak+RMS, ~30 Hz, −60…0 dB, green/amber/red, peak-hold tick. |-| `StereoMeter` | two 3px bars | L over R, output rail and card header. |-| `GrMeter` | hangs from top | Gain reduction — more compression reads as more bar. |-| `MixBar` | h 6 | Proportional source levels as amber segments. |-| `ChipRow` | radius 4, 9px | Single-select; on = brass fill + `TextOnAccent`. |-| `Labeled` | 8px uppercase | Centred caption above any control. |-| `TextButton` | radius 5, 11px | In-card action. |-| `BypassTag` | 8px bold | The `BYPASSED` marker. |-| `NaBadge` | h 16, radius 8 | `N/A` / `M7+` — feature not built. The control stays visible but disabled so nothing shifts later. |-| `Glyph` / `Hint` | 10px / 11px | Clickable text glyph; quiet inline hint. |+| Control | Spec |+|---|---|+| `Knob` | 52-grid: groove r21 stroke 5, 270° from −135°, cap r14, pointer 2.4 Brass Light. Sizes snap to 34 / 36 / 44. `IsModified`, `IsDim`, `ArcColor` for a modulation source. |+| `DeviceCardKit.KnobCell` | Knob → label 7/700 caps → value mono 7, no gap; 53 tall under a 34 knob. Label and value go Brass Light when modified or `emphasised`. |+| `SwitchTrack` / `DeviceCardKit.Switch` | 18 × 10, knob 7, inset 1.5; on = brass + panel-coloured knob right, off = Track off + Ink 5 knob left. Word to the right, caps 7 in a device, 11 in the shell. |+| `DeviceCardKit.Segments` | Sunken container; selected = solid brass with dark text. 9 px in a device, 11 in the shell (`ToggleButton.seg` in `Border.segmented`). |+| `SliderTrack` / `DeviceCardKit.SliderRow` | Label · 3 px well track · 6 × 7 handle · fixed-width mono value right. Bipolar fills from centre. Inactive loses brass, keeps the number. |+| `MiniFader`, `PanBar`, `VFader` | Track-header gain and pan, mixer fader — same drag contract. |+| `DragNumber` | Mono field: drag, or double-click to type. |+| Buttons (`Button`, `.primary`, `.ghost`, `.cell`, `.chip`, `.tp-icon`, `.tp-play`) | 26 tall; raised at rest. **One** solid-brass action per context; every other engaged button is Brass Wash + `BorderBrass` + `AccentHover` text. |+| Fields (`TextBox.field`, `.search`) | 26, sunken; focus = `BorderBrass`, no ring. |+| Filter chips | 20, pill, 9 side pad, a category-colour dot instead of an icon; one line, overflow folds into `+N`. |+| `Glyph` | Icons drawn as geometry: stop 10 r1, record 11 disc, play 11 × 14 triangle; the rest a round stroke of ~15 % of the size (min 1.2). No icon font, no unicode glyphs. |+| `MeterBar`, `StereoMeter`, `GrMeter` | 11 wide, 5 apart, radius 2 on Well; Signal → −6 dB Caution → 0 Alert; −60…+6; peak hold stays until clicked. |+| `Inactive.Set(root, on, interactive)` | Puts a subtree into the disabled look by colour (Ink 6, brass → Border strong, controls `IsDim`). |+| `NaBadge` | Feature not built yet; the control stays so nothing shifts later. |++**Record:** at rest a neutral button with a red disc; engaged, solid `Record` with a+`RecordInk` disc. The same rule arms tracks in the arrangement, mixer and Session.++### States++| State | Ground · border · text |+|---|---|+| Rest | Raised · Border · Ink 2 |+| Hover | Hover · Border strong · Ink 1 (120 ms) |+| Pressed | Well · Brass Deep — no 1 px shift |+| Engaged | Brass Wash · Border brass · Brass Hover |+| Selected | Brass Wash + 2 px brass bar on the left; name Ink 1 |+| Focus | Border brass, no outline |+| Disabled | Panel · Hairline · Ink 6 — no opacity |+| Modified | label and value → Brass Light; no dot |++**Motion:** hover and colour 120 ms ease-out (`BrushTransition`); nothing real-time is+animated. **Empty state:** one line of Ink 5, centred, no illustration or call-to-action+button; details go in a tooltip; the area keeps its size and frame.## Visualisers-~40 custom-drawn views in `Controls/`. The rule: **a device draws the thing it does**, not-a generic graph. Shared ground is `Brush.BgSunken` with a `NotaPalette.GraphBorder` inner border.--Families: transfer curves (`AmpCurve`, `CompTransfer`, `VintageViz`) · frequency response-(`AutoFilterCurve`, `DynamicEqCurve`, `EqCurve`) · spectra (`AmpHarmonics`,-`OperatorSpectrumViz`) · scrolling history (`AutoGainViz`, `CompGrHistory`,-`CeilingScope`) · waveform (`GrainWaveViz`, `StrataWave`, `AuroraStack`) · grids-(`ArpGrid`, `VoltMatrix`, `DelayTaps`) · envelopes (`SynthViz`, `ReverbTail`) ·-instrument-as-itself (`PendulumViz`, `FluxVectorPad`, `ChordKeysViz`) · icons-(`WaveIcon`, `GrainShapeIcon`).--Where possible these are **real**: the reverb tail is an actual decaying impulse response,-and the amp harmonics come from pushing a unit sine through the same waveshaper the audio-takes — not a drawing that resembles one.--## Layout skeleton--`36px title bar → 60px transport → body (on Brush.BgApp) → 22px status bar.`-Panels are `Brush.SurfaceCard` with a 1px bottom border.--The transport is **one row**, not the transport + toolbar pair it used to be. It reads-left to right as which view · what plays · the numbers you set · the switches you flip ·-then, pinned right, what the machine is doing. Transport, position and loop share a-single `Border.console` recess on `Brush.SurfaceAbyss` so playback reads as one object;-tempo, signature, grid and launch quantize use one `.cell` shape — mono value over an 8px-`.CellLabel` — so the row scans as a strip of readouts rather than a queue of pills.-The four switches — metronome, follow playhead, snap, automation — are icon-only 28px-`tp-icon` toggles that draw the thing they do (a metronome, a playhead on its ruler, a-horseshoe magnet, a breakpoint envelope) and carry their name in a tooltip; none sets a Foreground, so the engaged state turns the-glyph brass through the base `ToggleButton:checked`. Controls that belong to one context-appear only there: launch quantize in Session, "Re-enable" only while a lane is-overridden.--The body holds **islands**: the browser, the arrangement and the modular canvas are-`Radius.Md` cards with a 1px `Brush.BorderDefault` edge, clipped to their bounds, floating-on `Brush.BgApp` with an 8px gutter. The splitter between two islands carries no line of-its own — it is a 2px transparent grab strip inside that gutter.--Arrangement rows are not one pitch. A **track** row is 64px and its header carries every-control (name + kind · mute/solo/arm + input · fader + dB + pan, with a level rail on the-right edge). A **group** row is a 26px titled bar — disclosure, name, mute/solo, a 4px-level rail, kind tag — and opens to a full 64px row only while it is the selected track.-Header column 228px. Every y↔row conversion goes through `ArrangementView.RowTop` /-`RowAtY`; nothing multiplies by a row constant.--A **clip** is a tinted body (`Radius.Clip`) under a 2px band in the track colour, with the-waveform or notes across its full height. The name is drawn over the body — not in a strip-of its own — and only where a run of clips begins.--Transport buttons set `IsTabStop` and `Focusable` to false, so global hotkeys (Space, R,-L, Return) always reach the window instead of a focused control.+About 45 custom-drawn views in `Controls/`. A device draws **the thing it does**, and where+possible draws it for real (the reverb tail is an actual impulse response; the amp+harmonics push a sine through the real waveshaper).++All live in one **graph window** (`Controls/NotaGraph.cs`):++- Well ground, 1 px Hairline frame, radius 4, grid in `GridBeat`.+- Axis labels mono 7–8 in Ink 7, **in the corners** — never full axes with ticks. A+ frequency graph is labelled only in its bottom corners (`20` · `20k Hz`).+- Title caps 8 top-left; the legend lives **inside** the window, a drawn sample next to a+ value (`NotaGraph.Legend`).+- Primary curve 1.8 px brass; secondary 1.2–1.6 px in their chroma. **No fills under+ curves, no gradients.**+- Nodes 7 px with a 2 px ground-coloured ring; active brass, the rest Ink 3.+- Waveforms: second channel at 70 %; the trimmed part darkened by 72 %, not hidden; the+ boundary a 1 px brass line with its value.+- Bars: 1–2 px gaps, radius 1, no outline; brass only for a selected range, else Border+ strong; updates are discrete.+- Timeline: a clip is a flat rectangle in its track colour, radius 2, no outline; the+ playhead is 1 px brass with a 7 × 5 flag and no glow.++## Device cards++Every built-in device is a **700 × 260** card (`DeviceCardKit.CardH`, width from+`IDeviceBody.Width`).++- **Header 22** (`HeaderH`): device name (12/600) on the left; the processing-type badge+ (mono caps; instruments add live voices, `SUBTRACTIVE · 3/16`) and the bypass switch on+ the right. **Nothing else.** Presets, A/B, move and delete live in the header's+ right-click menu; drag the card by its whole header; Delete removes it.+- **Body 238**, inset 6 (`NotaSpace.DeviceInset`) unless the body is `FullBleed`.+ Sections radius 6, gap 5, section inset 6–8; a knob row is 52–54 tall.+- **Three columns, left to right: choice → work → output** — source or preset on the left,+ graph and parameters in the middle, levels and mix on the right.+- **Brass** marks the audio path and active state; modulation shows its source chroma+ (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+them would be a redesign) and the host-plugin / parameter-list stubs (230, 190).++## Shell++```+┌ header 36 ─ project name, centred ─────────────────────────────────────┐+│ transport 42 ─ view switch · console · tempo · signature · grid · … CPU│+├─────────────┬──────────────────────────────────────────────────────────┤+│ browser │ canvas (arrangement · session · modular) │+├─────────────┴──────────────────────────────────────────────────────────┤+└ status 22 ─────────────────────────────────────────────────────────────┘+```++- **Header 36** — frameless; macOS traffic lights in a left inset, the project name+ (`Heading`) centred; Windows reserves 180 px for the caption buttons.+- **Transport 42, under the header** (`Border.transport` on Void, hairline below). It reads+ left to right: view switch (Arrangement · Session · Modular) · the console (stop / play /+ record, position, loop) · tempo `120.00`, signature, grid · the switches (metronome,+ follow, snap, automation) · `+ Track` — then, pinned right, MIDI, CPU and master. Launch+ quantize appears only in Session. Transport buttons are not focusable, so Space / R / L /+ Return always reach the window.+- **Body** — the browser on the left and the canvas float as panels on `Gutter` with 12 px+ gaps; the canvas is always sunken relative to panels. The splitter is a transparent grab+ strip inside the gap.+- **List rows** are 26 and one line: a colour dot or bar, the name, mono metadata right.+- **Arrangement:** track rows 64 (the header carries every control), group rows 26 (open to+ 64 while selected), header column 228, default zoom 28 px per beat. Every y ↔ row+ conversion goes through `ArrangementView.RowTop` / `RowAtY`.++## Enforced by tests++`tests/Nota.SmokeTest/DesignTokenCheck.cs` runs in the smoke test and fails the build on:++| Check | Holds |+|---|---|+| `Run` | Dark/Light key parity; every `NotaPalette` slot matches its XAML pair; `KeyMap` keys exist |+| `RunGeometry` | XAML ↔ `NotaGeometry` values; no undefined keys; no `CornerRadius` literals, drop shadows or gradients in views |+| `RunType` | Fonts bundled and matched; no font names in views; nothing under 7 px |+| `RunControls` | No unicode icons typed as text; Knob / Switch / Slider sizes |+| `RunVisualisers` | Graph windows via `NotaGraph`; no fills under curves; no meter ballistics; meter 11/5; playhead without glow |+| `RunLayout` | Header 22; cards 700 except the listed exceptions; transport 42 at the top; rows 26–28 |+| `RunNumbers` | Display culture installed; no hyphen minus; no invariant culture on readouts; thin space before units; no vowel-dropped labels |+| `RunBans` | No hex outside `Ink()` (bar three data tables), no RGB typed as numbers, no named system colours, `Opacity` only on drag ghosts, no brush snapshotting a theme colour |++When a check fails, fix the view — or, for a genuine exception, add it to the check's+allow-list with a comment saying why.++## Accepted departures from the almanac++Decisions taken while aligning the app, kept on purpose:++- **Transport at the top, view switch inside it.** The almanac puts the transport at the+ bottom and the modes in the header.+- **Shell language is English.** The almanac asks for Russian infinitive tooltips; the app+ is English throughout, so the rule became "short, verb-first".+- **Segments with more than four options** stay segments where the choice is frequent:+ Amp Model (7) and Cabinet (5), Compressor Character (5), Vintage Character (6), Delay+ Division (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).+- **Zoom 28 px per beat** by default, not a 16 px bar; the ruler labels every bar once a bar+ is wider than 40 px.+- **`FREQ`, `RESO`, `THRESH`** as labels (see § Labels and copy).+- **Hero readouts** larger than the device scale — Strata bar number, Shutter OPEN/SHUT,+ Auto Shift note, Level value.+- **Play turns green in Session** (`tp-play.session`) while clips run.+- **Data hues close to a chroma** — Strata layer `#C99C55`, tag swatch `#C8A24B`, Random+ `#D0603F`, Rhythm dot `#7FC9C6` — are data colours, not accents.## Known drift-Things that are true today and should not surprise you:--- **The hex literals are gone.** The custom-drawn layer used to carry ~970 of them; they- now route through `NotaPalette` (`#1B1916` → `SurfaceInset`, `#221F1A` → `GraphBorder`,- and so on). What remains as a literal is *data*: the tag-colour swatches in- `TagEditorWindow`, the layer hues in `StrataDeviceBody`, the kit-voice dots in- `RhythmInstrumentCard` — each resolved through `NotaPalette.Ink()` at use.-- **Ink light values are derived, not authored.** A one-off device hue gets its paper- counterpart from a lightness reflection. Most land well; pin the ones that don't in- `NotaPalette.InkOverrides` rather than reaching for a literal.-- **Black stays black.** Drop shadows and the black-key row tint are alpha-over-black in- both variants — that is correct, not drift.-- **The title bar is custom.** A 36px frameless bar (`Brush.ChromeBg`) with the macOS- traffic lights in a left inset and the document name centred; Windows reserves 180px on- the right for the native caption buttons.-- **Font substitution.** Mockups specify Geist / Geist Mono; the app ships Inter and the- Cascadia → Menlo → Consolas stack, so weights sit slightly differently.-- **No `Space.*` tokens.** The 4px grid is honoured by convention only.-- **Two palette files** must be edited together and nothing enforces it — and each token- now carries two values, so a change is four edits (`NotaTheme.axaml` Dark + Light,- `NotaPalette.cs`, this file).+True today, not yet fixed:++- **Column order** choice → work → output is applied in Utility; the other cards have not+ been audited card by card.+- **Panel expand** is not animated (the almanac asks for 180 ms).+- **`LOOKAHEAD`** in Compressor truncates with an ellipsis.+- **Slider reset** on double-click works only where the card passes a default.+- **Names:** presets with emotional names (Screaming Lead, VHS Fever, Gentle Master,+ Transparent Safety, Dive Bomb, Laser Zap…) and multi-word device names (Auto Filter,+ Beat Repeat, Dynamic EQ-8, EQ-3, the "Nota " prefix) remain; renaming touches MCP names,+ the browser and saved projects.+- **Paper values are derived**, not designed by the almanac; pin any that read poorly in+ `NotaPalette.InkOverrides` or the theme.+- **The "Add device" tile** at the end of a chain keeps a plus and two lines — it is a drop+ target rather than an empty state.diff --git a/LICENSES/OFL-1.1-Geist.txt b/LICENSES/OFL-1.1-Geist.txtnew file mode 100644index 00000000..8d003fec--- /dev/null+++ b/LICENSES/OFL-1.1-Geist.txt@@ -0,0 +1,92 @@+Copyright (c) 2023 Vercel, in collaboration with basement.studio++This Font Software is licensed under the SIL Open Font License, Version 1.1.+This license is copied below, and is also available with a FAQ at:+http://scripts.sil.org/OFL++-----------------------------------------------------------+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007+-----------------------------------------------------------++PREAMBLE+The goals of the Open Font License (OFL) are to stimulate worldwide+development of collaborative font projects, to support the font creation+efforts of academic and linguistic communities, and to provide a free and+open framework in which fonts may be shared and improved in partnership+with others.++The OFL allows the licensed fonts to be used, studied, modified and+redistributed freely as long as they are not sold by themselves. The+fonts, including any derivative works, can be bundled, embedded,+redistributed and/or sold with any software provided that any reserved+names are not used by derivative works. The fonts and derivatives,+however, cannot be released under any other type of license. The+requirement for fonts to remain under this license does not apply+to any document created using the fonts or their derivatives.++DEFINITIONS+"Font Software" refers to the set of files released by the Copyright+Holder(s) under this license and clearly marked as such. This may+include source files, build scripts and documentation.++"Reserved Font Name" refers to any names specified as such after the+copyright statement(s).++"Original Version" refers to the collection of Font Software components as+distributed by the Copyright Holder(s).++"Modified Version" refers to any derivative made by adding to, deleting,+or substituting -- in part or in whole -- any of the components of the+Original Version, by changing formats or by porting the Font Software to a+new environment.++"Author" refers to any designer, engineer, programmer, technical+writer or other person who contributed to the Font Software.++PERMISSION AND CONDITIONS+Permission is hereby granted, free of charge, to any person obtaining+a copy of the Font Software, to use, study, copy, merge, embed, modify,+redistribute, and sell modified and unmodified copies of the Font+Software, subject to the following conditions:++1) Neither the Font Software nor any of its individual components,+in Original or Modified Versions, may be sold by itself.++2) Original or Modified Versions of the Font Software may be bundled,+redistributed and/or sold with any software, provided that each copy+contains the above copyright notice and this license. These can be+included either as stand-alone text files, human-readable headers or+in the appropriate machine-readable metadata fields within text or+binary files as long as those fields can be easily viewed by the user.++3) No Modified Version of the Font Software may use the Reserved Font+Name(s) unless explicit written permission is granted by the corresponding+Copyright Holder. This restriction only applies to the primary font name as+presented to the users.++4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font+Software shall not be used to promote, endorse or advertise any+Modified Version, except to acknowledge the contribution(s) of the+Copyright Holder(s) and the Author(s) or with their explicit written+permission.++5) The Font Software, modified or unmodified, in part or in whole,+must be distributed entirely under this license, and must not be+distributed under any other license. The requirement for fonts to+remain under this license does not apply to any document created+using the Font Software.++TERMINATION+This license becomes null and void if any of the above conditions are+not met.++DISCLAIMER+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM+OTHER DEALINGS IN THE FONT SOFTWARE.diff --git a/LICENSES/THIRD-PARTY-NOTICES.md b/LICENSES/THIRD-PARTY-NOTICES.mdindex d0651483..32e41974 100644--- a/LICENSES/THIRD-PARTY-NOTICES.md+++ b/LICENSES/THIRD-PARTY-NOTICES.md@@ -29,6 +29,12 @@ Licensed under the **MIT License**. <https://avaloniaui.net>Copyright © .NET Foundation and Contributors.Licensed under the **MIT License**. <https://dotnet.microsoft.com>+## Geist and Geist Mono+Copyright © 2023 Vercel, in collaboration with basement.studio.+Licensed under the **SIL Open Font License, Version 1.1** (see+[`OFL-1.1-Geist.txt`](OFL-1.1-Geist.txt)). Bundled unmodified as the UI and numeric+typefaces. <https://github.com/vercel/geist-font>+## miniaudioCopyright © David Reid ([email protected]).Dual licensed — choice of **public domain (Unlicense)** or **MIT-0**. Used for audiodiff --git a/LICENSES/third-party.md b/LICENSES/third-party.mdindex bd1ae775..b179f5a4 100644--- a/LICENSES/third-party.md+++ b/LICENSES/third-party.md@@ -21,6 +21,7 @@ public domain, or AGPL-compatible copyleft.| signalsmith-linear | vendored | FFT / linear DSP primitives | MIT | ✅ in use || HIIR (Laurent de Soras) | 1.40 | Oversampling (polyphase halfband IIR) | WTFPL | ✅ in use — see note 4 || Apple CoreAudio / CoreMIDI / AudioToolbox | system | Audio + MIDI I/O (macOS) | system SDK | ✅ in use |+| Geist / Geist Mono (Vercel) | 1.7.2 | UI and numeric typefaces (`assets/fonts`) | **SIL OFL 1.1** | ✅ in use — see note 5 || Freeverb (algorithm only) | — | Built-in reverb | public domain | ✅ in use — own implementation of the Jezar algorithm; no vendored code (`src/native/nota.engine/src/Reverb.h`) |Status key: ✅ cleared · ⚠️ cleared with a condition · ⏳ planned · ❌ rejected (incompatible).@@ -48,6 +49,14 @@ patent-free. Re-confirm if targeting a jurisdiction with unusual patent terms.HIIR is released under the WTFPL, which some corporate legal reviews reject (it carriesno warranty disclaimer and its enforceability is debated). It is fine for the AGPL build.+**5 — Geist ships as bundled font files under the SIL Open Font License.** OFL 1.1+allows embedding and redistributing the fonts with any software, including AGPL software,+provided the fonts are not sold on their own and the license travels with them+(`LICENSES/OFL-1.1-Geist.txt`). The eight static weights we use (Regular, Medium,+SemiBold, Bold of each family) are copied unmodified from the `geist` npm package;+"Geist" is a Reserved Font Name, so a subset or other modification must be renamed.+They replace Inter, which came in through the `Avalonia.Fonts.Inter` package.+## Not shippedThe JUCE submodule (`src/native/nota.engine/vendor/JUCE`) is fetched at build time anddiff --git a/assets/fonts/Geist-Bold.ttf b/assets/fonts/Geist-Bold.ttfnew file mode 100644index 00000000..863b2868Binary files /dev/null and b/assets/fonts/Geist-Bold.ttf differdiff --git a/assets/fonts/Geist-Medium.ttf b/assets/fonts/Geist-Medium.ttfnew file mode 100644index 00000000..96cb22f8Binary files /dev/null and b/assets/fonts/Geist-Medium.ttf differdiff --git a/assets/fonts/Geist-Regular.ttf b/assets/fonts/Geist-Regular.ttfnew file mode 100644index 00000000..4da1b3a6Binary files /dev/null and b/assets/fonts/Geist-Regular.ttf differdiff --git a/assets/fonts/Geist-SemiBold.ttf b/assets/fonts/Geist-SemiBold.ttfnew file mode 100644index 00000000..b2b0618fBinary files /dev/null and b/assets/fonts/Geist-SemiBold.ttf differdiff --git a/assets/fonts/GeistMono-Bold.ttf b/assets/fonts/GeistMono-Bold.ttfnew file mode 100644index 00000000..90eb8a86Binary files /dev/null and b/assets/fonts/GeistMono-Bold.ttf differdiff --git a/assets/fonts/GeistMono-Medium.ttf b/assets/fonts/GeistMono-Medium.ttfnew file mode 100644index 00000000..ff49ece5Binary files /dev/null and b/assets/fonts/GeistMono-Medium.ttf differdiff --git a/assets/fonts/GeistMono-Regular.ttf b/assets/fonts/GeistMono-Regular.ttfnew file mode 100644index 00000000..50c9d5a6Binary files /dev/null and b/assets/fonts/GeistMono-Regular.ttf differdiff --git a/assets/fonts/GeistMono-SemiBold.ttf b/assets/fonts/GeistMono-SemiBold.ttfnew file mode 100644index 00000000..1b21724dBinary files /dev/null and b/assets/fonts/GeistMono-SemiBold.ttf differdiff --git a/scripts/design-html.py b/scripts/design-html.pynew file mode 100755index 00000000..bb62bdf3--- /dev/null+++ b/scripts/design-html.py@@ -0,0 +1,497 @@+#!/usr/bin/env python3+# SPDX-License-Identifier: AGPL-3.0-only+# Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+#+# Regenerates DESIGN.html from the theme: the colour variables for both variants are read+# from src/managed/Nota.App/Theme/NotaTheme.axaml, so the page can never show a value the+# app does not use. Run after changing a token: python3 scripts/design-html.py+import re, math, os+ROOT=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+t=open(ROOT+'/src/managed/Nota.App/Theme/NotaTheme.axaml',encoding='utf-8').read()+def branch(name):+ i=t.index('<ResourceDictionary x:Key="%s">'%name); j=t.index('</ResourceDictionary>',i); return t[i:j]+rx=r'<SolidColorBrush x:Key="Brush\.([\w.]+)">(#[0-9A-Fa-f]+)</SolidColorBrush>'+D=dict(re.findall(rx,branch('Dark'))); L=dict(re.findall(rx,branch('Light')))+def css(h):+ h=h.lstrip('#')+ if len(h)==8: a=int(h[:2],16)/255; r,g,b=(int(h[i:i+2],16) for i in (2,4,6)); return f'rgba({r},{g},{b},{a:.3f})'+ return '#'+h.upper()+def var(k): return '--'+re.sub(r'(?<!^)(?=[A-Z])','-',k).lower().replace('.','-')+root='\n'.join(f' {var(k)}: {css(v)};' for k,v in D.items())+paper='\n'.join(f' {var(k)}: {css(L[k])};' for k in D if k in L)+geo={m.group(1):m.group(2) for m in re.finditer(r'x:Key="((?:Radius|Control|Space)\.\w+)">([0-9.]+)<',t)}++def sw(key, name, use):+ return (f'<button class="sw" data-dark="{D[key]}" data-light="{L[key]}" title="Copy hex">'+ f'<span class="sw__chip" style="background:var({var(key)})"></span>'+ f'<span class="sw__name">{name}</span><code class="sw__key">Brush.{key}</code>'+ f'<span class="sw__hex mono"></span><span class="sw__use">{use}</span></button>')++surfaces=[('SurfaceAbyss','Void','Deepest recess — the transport strip'),('BgApp','App','Window ground, plugin body'),('Gutter','Gutter','The gaps panels float in'),('BgSunken','Well','Graph windows, fields, slider tracks'),('Panel','Panel','Browser, headers, inspector'),('SurfaceCard','Card','A section inside a device'),('SurfaceRaised','Raised','Button at rest'),('SurfaceHover','Hover','Hovered button or row'),('TrackOff','Track off','Track of an off switch'),('SurfaceSelected','Brass Wash','Selected row, engaged ground')]+lines=[('Hairline','Hairline','Row dividers, graph frame'),('BorderDefault','Border','Panel, button, field'),('BorderStrong','Border strong','Knob cap, hovered border'),('BorderBrass','Border brass','Engaged button, focus'),('GridBeat','Grid','Grid inside graphs'),('GridBar','Grid bar','Bar lines')]+inks=[('TextHeading','Ink 0','Page title, project name'),('TextPrimary','Ink 1','Names, values'),('TextStrong','Ink 2','Button text, readouts'),('TextSecondary','Ink 3','Inactive but readable'),('TextMuted','Ink 4','Explanations, units'),('TextTertiary','Ink 5','Caps labels, empty states'),('TextDisabled','Ink 6','Placeholder, disabled'),('TextAxis','Ink 7','Axis labels in graphs only')]+brass=[('Accent','Brass','Arc, fill, playhead, one solid button'),('AccentBright','Brass Light','Pointer, modified label'),('AccentHover','Brass Hover','Engaged text'),('AccentDeep','Brass Deep','Pressed'),('AccentDim','Brass Dim','Eyebrows, section marks'),('AccentEdge','Brass Edge','Brass chip border')]+sem=[('Record','Record','Active recording — the only red'),('RecordInk','Record ink','Disc on engaged record'),('Danger','Alert','Overload, clipping'),('DangerBright','Alert Light','Overload readout'),('Warning','Caution','Meter −6…0 dB'),('Success','Signal','Working zone, live signal'),('SuccessDim','Signal Dim','Input, metronome')]+chromas=[('Accent','1 · Brass','Primary: left, mid, main'),('ChromaTeal','2 · Teal','Lows, early, input, modulation'),('ChromaRose','3 · Rose','Right, highs, tail'),('ChromaSteel','4 · Steel','Rare fourth layer'),('ChromaTealLight','Teal light','Text on teal'),('ChromaRoseLight','Rose light','Text on rose')]+tracks=[(f'Track{i+1}',n,'') for i,n in enumerate(['Drums','Perc','Bass','Keys','Texture','FX','Brass','Vox','Return'])]+def grid(items): return '<div class="swatches">'+''.join(sw(*x) for x in items)+'</div>'++def knob(size, value, arc='var(--accent)', dim=False, label=None, val=None, hot=False):+ C=2*math.pi*21; sweep=C*0.75+ a=math.radians(135+270*value); px=26+14*math.cos(a)*0.62; py=26+14*math.sin(a)*0.62+ arc_col='var(--border-strong)' if dim else arc+ ptr='var(--text-disabled)' if dim else ('var(--chroma-teal-light)' if 'teal' in arc else 'var(--accent-bright)')+ svg=(f'<svg class="knob" width="{size}" height="{size}" viewBox="0 0 52 52" aria-hidden="true">'+ f'<circle cx="26" cy="26" r="21" style="fill:none;stroke:var(--bg-sunken);stroke-width:5;stroke-linecap:round" stroke-dasharray="{sweep:.1f} {C:.1f}" transform="rotate(135 26 26)"/>'+ f'<circle cx="26" cy="26" r="21" style="fill:none;stroke:{arc_col};stroke-width:5;stroke-linecap:round" stroke-dasharray="{sweep*value:.1f} {C:.1f}" transform="rotate(135 26 26)"/>'+ f'<circle cx="26" cy="26" r="14" style="fill:var(--surface-raised);stroke:var(--border-strong);stroke-width:1"/>'+ f'<line x1="26" y1="26" x2="{px:.1f}" y2="{py:.1f}" style="stroke:{ptr};stroke-width:2.4;stroke-linecap:round"/></svg>')+ if label is None: return svg+ cls='cell cell--hot' if hot else ('cell cell--dim' if dim else 'cell')+ return f'<div class="{cls}">{svg}<span class="cell__label">{label}</span><span class="cell__value mono">{val}</span></div>'++T=f'''<!-- SPDX-License-Identifier: AGPL-3.0-only -->+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->+<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8">+<title>Ember</title>+<meta name="viewport" content="width=device-width, initial-scale=1">+<link rel="preconnect" href="https://fonts.googleapis.com">+<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>+<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap">+<style>+/* ============================================================================+ Ember — Nota's design system, documented in its own palette.+ The colour variables below are generated from+ src/managed/Nota.App/Theme/NotaTheme.axaml (Dark → :root, Light → [data-variant=paper]).+ Generated by scripts/design-html.py — edit that, then rerun it. Every specimen on the page is painted+ through these variables — nothing uses a raw hex.+ ========================================================================= */+:root {{+{root}+ --r-bar: {geo['Radius.Bar']}px; --r-clip: {geo['Radius.Clip']}px; --r-badge: {geo['Radius.Badge']}px; --r-control: {geo['Radius.Control']}px;+ --r-tile: {geo['Radius.Tile']}px; --r-panel: {geo['Radius.Panel']}px; --r-body: {geo['Radius.Body']}px;+ --font-ui: "Geist", system-ui, sans-serif;+ --font-mono: "Geist Mono", ui-monospace, Menlo, monospace;+ --sunken: inset 0 1px 0 rgba(0,0,0,.5);+ --raised: inset 0 1px 0 rgba(255,255,255,.03);+ color-scheme: dark;+}}+:root[data-variant="paper"] {{+{paper}+ --sunken: inset 0 1px 0 rgba(0,0,0,.12);+ --raised: inset 0 1px 0 rgba(255,255,255,.4);+ color-scheme: light;+}}+*{{box-sizing:border-box}}+html,body{{margin:0;background:var(--gutter);color:var(--text-primary);font:400 13px/1.55 var(--font-ui);-webkit-font-smoothing:antialiased}}+.mono{{font-family:var(--font-mono);font-variant-numeric:tabular-nums}}+code{{font-family:var(--font-mono);font-size:11px;color:var(--text-secondary)}}+a{{color:var(--accent-hover)}}+.page{{max-width:1120px;margin:0 auto;padding:0 20px 80px}}+header.mast{{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:16px;padding:14px 20px;margin:0 -20px 12px;background:var(--gutter);border-bottom:1px solid var(--border-default)}}+.mast h1{{font:600 13px/1 var(--font-ui);color:var(--text-heading);margin:0}}+.mast .eyebrow{{margin:0}}+.mast nav{{display:flex;gap:14px;flex-wrap:wrap;margin-left:8px}}+.mast nav a{{color:var(--text-secondary);text-decoration:none;font-size:11px;font-weight:500}}+.mast nav a:hover{{color:var(--text-primary)}}+.spacer{{flex:1}}+.eyebrow{{font:500 9px/1 var(--font-mono);letter-spacing:.18em;text-transform:uppercase;color:var(--accent-dim);margin:0 0 8px}}+section{{background:var(--panel);border:1px solid var(--border-default);border-radius:var(--r-panel);padding:20px;margin:12px 0}}+h2{{font:600 26px/1.1 var(--font-ui);letter-spacing:-.015em;color:var(--text-heading);margin:0 0 8px}}+h3{{font:700 10px/1 var(--font-ui);letter-spacing:.14em;text-transform:uppercase;color:var(--text-tertiary);margin:22px 0 10px}}+p{{color:var(--text-secondary);max-width:72ch;margin:0 0 10px}}+.lead{{color:var(--text-muted)}}+/* segmented */+.seg{{display:inline-flex;gap:2px;padding:3px;height:30px;background:var(--bg-sunken);border:1px solid var(--hairline);border-radius:var(--r-tile);box-shadow:var(--sunken)}}+.seg button{{all:unset;cursor:pointer;height:22px;padding:0 10px;border-radius:var(--r-badge);font:500 11px/22px var(--font-ui);color:var(--text-secondary)}}+.seg button[aria-pressed="true"]{{background:var(--accent);color:var(--text-on-accent)}}+.seg--device button{{font-size:9px;height:18px;line-height:18px;padding:0 7px}}+.seg--device{{height:24px}}+/* rules */+.rules{{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:8px}}+.rule{{background:var(--surface-card);border:1px solid var(--border-default);border-radius:var(--r-tile);padding:12px 14px}}+.rule b{{display:block;color:var(--text-primary);font-weight:600;margin-bottom:4px}}+.rule span{{color:var(--text-secondary)}}+/* swatches */+.swatches{{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:8px}}+.sw{{all:unset;cursor:pointer;display:grid;grid-template-columns:36px 1fr auto;grid-template-areas:"chip name hex" "chip key key" "chip use use";column-gap:10px;padding:8px;border-radius:var(--r-tile);background:var(--surface-card);border:1px solid var(--border-default)}}+.sw:hover{{background:var(--surface-hover);border-color:var(--border-strong)}}+.sw__chip{{grid-area:chip;border-radius:var(--r-control);border:1px solid var(--border-strong);min-height:48px}}+.sw__name{{grid-area:name;font-weight:600;color:var(--text-primary)}}+.sw__key{{grid-area:key;font-size:10px;color:var(--text-muted)}}+.sw__hex{{grid-area:hex;font-size:10px;color:var(--text-secondary)}}+.sw__use{{grid-area:use;font-size:11px;color:var(--text-muted)}}+.sw.copied .sw__hex{{color:var(--accent-hover)}}+/* tables */+.tbl{{overflow-x:auto}}+table{{border-collapse:collapse;width:100%;font-size:12px}}+th{{text-align:left;font:700 9px/1 var(--font-ui);letter-spacing:.12em;text-transform:uppercase;color:var(--text-tertiary);padding:8px 10px;border-bottom:1px solid var(--border-default)}}+td{{padding:7px 10px;border-bottom:1px solid var(--hairline);color:var(--text-secondary);vertical-align:middle}}+td:first-child{{color:var(--text-primary)}}+/* type */+.spec{{display:grid;grid-template-columns:200px 1fr;gap:6px 16px;align-items:baseline}}+.spec .k{{font:400 10px/1.4 var(--font-mono);color:var(--text-muted)}}+/* geometry */+.radii{{display:flex;flex-wrap:wrap;gap:14px}}+.radius{{display:flex;flex-direction:column;align-items:center;gap:6px;font-size:11px;color:var(--text-secondary)}}+.radius i{{display:block;width:56px;height:40px;background:var(--surface-raised);border:1px solid var(--border-strong)}}+.depth{{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}}+.depth div{{height:84px;border-radius:var(--r-panel);padding:10px;font-size:11px;color:var(--text-secondary)}}+/* controls */+.row{{display:flex;flex-wrap:wrap;align-items:center;gap:16px;margin:6px 0}}+.demo{{background:var(--surface-card);border:1px solid var(--border-default);border-radius:var(--r-body);padding:16px}}+.knob{{display:block}}+.knobs{{display:flex;gap:22px;align-items:flex-end}}+.knobs figure{{margin:0;display:flex;flex-direction:column;align-items:center;gap:6px;font-size:10px;color:var(--text-muted)}}+.cell{{display:flex;flex-direction:column;align-items:center;width:53px}}+.cell__label{{font:700 7px/9px var(--font-ui);letter-spacing:.08em;text-transform:uppercase;color:var(--text-tertiary)}}+.cell__value{{font-size:7px;line-height:10px;color:var(--text-secondary)}}+.cell--hot .cell__label,.cell--hot .cell__value{{color:var(--accent-bright)}}+.cell--dim .cell__label,.cell--dim .cell__value{{color:var(--text-disabled)}}+.switch{{display:inline-flex;align-items:center;gap:6px;font:700 7px/1 var(--font-ui);letter-spacing:.08em;text-transform:uppercase;color:var(--text-tertiary)}}+.switch i{{position:relative;width:18px;height:10px;border-radius:5px;background:var(--track-off)}}+.switch i::after{{content:"";position:absolute;top:1.5px;left:1.5px;width:7px;height:7px;border-radius:50%;background:var(--text-tertiary)}}+.switch.on i{{background:var(--accent)}}+.switch.on i::after{{left:9.5px;background:var(--panel)}}+.switch.on{{color:var(--text-secondary)}}+.chip{{display:inline-flex;align-items:center;gap:6px;height:20px;padding:0 9px;border-radius:10px;border:1px solid var(--border-default);background:var(--surface-raised);font:500 11px/1 var(--font-ui);color:var(--text-strong)}}+.chip i{{width:6px;height:6px;border-radius:50%}}+.chip.on{{background:var(--accent-subtle);border-color:var(--border-brass);color:var(--accent-hover)}}+.slider{{display:grid;grid-template-columns:70px 1fr 42px;align-items:center;gap:8px;width:280px;height:18px}}+.slider span:first-child{{font:700 8px/1 var(--font-ui);letter-spacing:.1em;text-transform:uppercase;color:var(--text-tertiary)}}+.slider span:last-child{{font:400 9px/1 var(--font-mono);color:var(--text-primary);text-align:right}}+.track{{position:relative;height:3px;border-radius:var(--r-clip);background:var(--bg-sunken)}}+.track b{{position:absolute;left:0;top:0;bottom:0;border-radius:var(--r-clip);background:var(--accent)}}+.track u{{position:absolute;top:-2px;width:6px;height:7px;border-radius:var(--r-clip);background:var(--accent-bright);margin-left:-3px}}+.slider.dim .track b{{background:var(--border-strong)}} .slider.dim .track u{{background:var(--text-tertiary)}} .slider.dim span:first-child{{color:var(--text-disabled)}}+.btn{{display:inline-flex;align-items:center;height:26px;padding:0 12px;border-radius:var(--r-control);border:1px solid var(--border-default);background:var(--surface-raised);box-shadow:var(--raised);font:500 11px/1 var(--font-ui);color:var(--text-strong)}}+.btn.hover{{background:var(--surface-hover);border-color:var(--border-strong);color:var(--text-primary)}}+.btn.pressed{{background:var(--bg-sunken);box-shadow:none;color:var(--accent-deep)}}+.btn.on{{background:var(--accent-subtle);border-color:var(--border-brass);color:var(--accent-hover)}}+.btn.primary{{background:var(--accent);border-color:var(--accent);color:var(--text-on-accent);box-shadow:none}}+.btn.off{{background:var(--panel);border-color:var(--hairline);color:var(--text-disabled);box-shadow:none}}+.field{{display:inline-flex;align-items:center;gap:8px;height:26px;width:220px;padding:0 9px;border-radius:var(--r-tile);border:1px solid var(--hairline);background:var(--bg-sunken);box-shadow:var(--sunken);font-size:11px;color:var(--text-disabled)}}+.field.focus{{border-color:var(--border-brass);color:var(--text-primary)}}+.btn small,.states small{{display:block}}+.states{{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}}+.states figure{{margin:0;display:flex;flex-direction:column;gap:6px;font-size:10px;color:var(--text-muted)}}+.states figure .btn{{align-self:flex-start}}+.transport+.note{{margin-top:8px}}+/* transport */+.transport{{display:flex;align-items:center;gap:12px;height:42px;padding:0 10px;background:var(--surface-abyss);border:1px solid var(--border-default);border-radius:var(--r-panel);box-shadow:var(--sunken);overflow-x:auto}}+.tp{{flex:none;display:grid;place-items:center;width:34px;height:34px;border-radius:var(--r-tile);background:var(--surface-raised);border:1px solid var(--border-default);box-shadow:var(--raised)}}+.tp.play{{width:46px;background:var(--accent);border-color:var(--accent)}}+.tp .stop{{width:10px;height:10px;border-radius:1px;background:var(--text-strong)}}+.tp .play-tri{{width:0;height:0;border-left:11px solid var(--text-on-accent);border-top:7px solid transparent;border-bottom:7px solid transparent;margin-left:2px}}+.tp .rec{{width:11px;height:11px;border-radius:50%;background:var(--record)}}+.tp.rec-on{{background:var(--record);border-color:var(--record)}} .tp.rec-on .rec{{background:var(--record-ink)}}+.readout{{flex:none;display:flex;flex-direction:column;align-items:center;gap:2px}}+.readout b{{font:500 13px/1 var(--font-mono);color:var(--accent-bright)}}+.readout b.n{{color:var(--text-primary)}}+.readout span{{font:700 7px/1 var(--font-ui);letter-spacing:.12em;color:var(--text-tertiary)}}+.vr{{flex:none;width:1px;height:24px;background:var(--border-default)}}+/* graph window */+.graph{{background:var(--bg-sunken);border:1px solid var(--hairline);border-radius:var(--r-control);position:relative}}+.graph .axis{{position:absolute;font:400 7px/1 var(--font-mono);color:var(--text-axis)}}+.graph .title{{position:absolute;left:6px;top:5px;font:700 8px/1 var(--font-ui);letter-spacing:.08em;color:var(--text-tertiary)}}+.meters{{display:flex;gap:5px;align-items:flex-end;height:120px}}+.meter{{position:relative;width:11px;height:120px;border-radius:var(--r-clip);background:var(--bg-sunken);overflow:hidden}}+.meter i{{position:absolute;left:0;right:0;bottom:0}}+/* card */+.card{{width:700px;height:260px;background:var(--bg-app);border:1px solid var(--border-default);border-radius:var(--r-body);overflow:hidden;display:grid;grid-template-rows:22px 1fr}}+.card__head{{display:flex;align-items:center;gap:8px;padding:0 8px;border-bottom:1px solid var(--border-default);background:var(--panel)}}+.card__name{{font:600 12px/1 var(--font-ui);color:var(--text-primary)}}+.card__badge{{margin-left:auto;font:500 9px/1 var(--font-mono);letter-spacing:.12em;color:var(--text-tertiary)}}+.card__body{{display:grid;grid-template-columns:150px 1fr 150px;gap:5px;padding:6px}}+.sect{{background:var(--surface-card);border:1px solid var(--border-default);border-radius:var(--r-panel);padding:6px 8px;display:flex;flex-direction:column;gap:6px;min-width:0}}+.sect h5{{margin:0;font:700 9px/1 var(--font-ui);letter-spacing:.12em;text-transform:uppercase;color:var(--text-tertiary)}}+.anat{{position:relative;display:inline-block}}+.scroll{{overflow-x:auto;padding-bottom:4px}}+.note{{font-size:11px;color:var(--text-muted)}}+/* shell */+.shell{{display:grid;grid-template-rows:24px 30px 1fr 14px;gap:0;height:260px;border:1px solid var(--border-default);border-radius:var(--r-body);overflow:hidden;background:var(--gutter);font:700 9px/1 var(--font-ui);letter-spacing:.12em;color:var(--text-tertiary)}}+.shell>div{{display:flex;align-items:center;padding:0 10px}}+.shell .h{{background:var(--bg-sunken);justify-content:center;color:var(--text-heading);letter-spacing:0;font:600 11px/1 var(--font-ui);border-bottom:1px solid var(--border-default)}}+.shell .t{{background:var(--surface-abyss);border-bottom:1px solid var(--border-default)}}+.shell .b{{display:grid;grid-template-columns:180px 1fr;gap:12px;padding:12px;align-items:stretch}}+.shell .b div{{border-radius:var(--r-panel);border:1px solid var(--border-default);display:grid;place-items:center}}+.shell .b div:first-child{{background:var(--panel)}} .shell .b div:last-child{{background:var(--bg-sunken)}}+.shell .s{{background:var(--bg-sunken);border-top:1px solid var(--border-default)}}+ul.plain{{margin:0;padding-left:18px;color:var(--text-secondary)}} ul.plain li{{margin:3px 0}}+@media (max-width:760px){{.spec{{grid-template-columns:1fr}} .mast nav{{display:none}}}}+</style>+</head>+<body>+<div class="page">+<header class="mast">+ <div><p class="eyebrow">Nota · design</p><h1>Ember</h1></div>+ <nav><a href="#rules">Rules</a><a href="#colour">Colour</a><a href="#type">Type</a><a href="#geometry">Geometry</a><a href="#controls">Controls</a><a href="#states">States</a><a href="#graphs">Graphs</a><a href="#cards">Cards</a><a href="#shell">Shell</a></nav>+ <span class="spacer"></span>+ <div class="seg" role="group" aria-label="Variant"><button data-v="graphite" aria-pressed="true">Graphite</button><button data-v="paper" aria-pressed="false">Paper</button></div>+</header>++<section id="rules">+ <p class="eyebrow">01 · Foundation</p>+ <h2>Rules</h2>+ <p class="lead">The Nota Design Almanac, as the app implements it. <a href="DESIGN.md">DESIGN.md</a> is the text version with every value, the tests that enforce it and the accepted departures.</p>+ <div class="rules">+ <div class="rule"><b>One accent</b><span>Brass means “active, selected, changed”. There is no second accent.</span></div>+ <div class="rule"><b>Semantics only where they apply</b><span>Red is recording and overload. Green and yellow are meter zones and live signal.</span></div>+ <div class="rule"><b>Chromas live inside graphs</b><span>Teal, rose and steel separate sources in a visualisation — never on buttons, never as state.</span></div>+ <div class="rule"><b>Flat material</b><span>No gradients, glow or texture. Depth is lightness plus a hairline, three levels at most.</span></div>+ <div class="rule"><b>Two faces, one split</b><span>Geist for names and words, Geist Mono for measurements. Nothing under 7 px.</span></div>+ <div class="rule"><b>One control, many sizes</b><span>Each control has one implementation; its value is always visible next to it.</span></div>+ <div class="rule"><b>State changes colour only</b><span>Never size, border width or position. Nothing moves on hover.</span></div>+ <div class="rule"><b>Real time is not animated</b><span>Meters, playhead and spectra jump to the value.</span></div>+ <div class="rule"><b>Muted is an Ink step</b><span>Disabled and quiet text take the next Ink step. Opacity is not a state.</span></div>+ <div class="rule"><b>Numbers are set</b><span class="mono">−3.3 dB · 72 % · 3.2 k · 120.00</span></div>+ </div>+</section>++<section id="colour">+ <p class="eyebrow">02 · Colour</p>+ <h2>Palette</h2>+ <p>Click a swatch to copy its hex for the variant selected above. Values come straight from <code>NotaTheme.axaml</code>.</p>+ <h3>Surfaces · far to near</h3>{grid(surfaces)}+ <h3>Lines</h3>{grid(lines)}+ <h3>Ink · eight steps</h3>{grid(inks)}+ <h3>Brass · the only accent</h3>{grid(brass)}+ <h3>Semantics</h3>{grid(sem)}+ <h3>Role chromas · inside graphs only, in this order</h3>{grid(chromas)}+ <h3>Track palette · nine roles</h3>{grid(tracks)}+</section>++<section id="type">+ <p class="eyebrow">03 · Type</p>+ <h2>Geist and Geist Mono</h2>+ <p>A proportional face for names and words; mono for anything that is a measurement, so digits keep their width as a knob turns.</p>+ <h3>Shell scale</h3>+ <div class="spec">+ <span class="k">Title · 600 · 26</span><span style="font:600 26px/1.1 var(--font-ui);letter-spacing:-.015em;color:var(--text-heading)">Controls</span>+ <span class="k">Heading · 600 · 13</span><span style="font:600 13px var(--font-ui);color:var(--text-heading)">Northern Reverb Study</span>+ <span class="k">Name · 500 · 12</span><span style="font:500 12px var(--font-ui)">Stone Vault · Long Tail</span>+ <span class="k">default · 500 · 11</span><span style="font:500 11px var(--font-ui);color:var(--text-strong)">Arrangement · Session · Modular</span>+ <span class="k">Caption · 400 · 11 · Ink 4</span><span style="font:400 11px/1.65 var(--font-ui);color:var(--text-muted)">Load as an effect on the selected track</span>+ <span class="k">SectionLabel · 700 · 10 caps</span><span style="font:700 10px var(--font-ui);letter-spacing:.14em;color:var(--text-tertiary)">SURFACES</span>+ <span class="k">Readout · mono 500 · 13</span><span class="mono" style="font-weight:500;font-size:13px">12.3.04 · 120.00</span>+ <span class="k">Value · mono 400 · 10</span><span class="mono" style="font-size:10px;color:var(--text-secondary)">−3.3 dB · 48 k · 2.4 MB</span>+ <span class="k">Eyebrow · mono 500 · 9 caps</span><span class="mono" style="font-weight:500;font-size:9px;letter-spacing:.18em;color:var(--accent-dim)">NOTA · CONVOLUTION</span>+ </div>+ <h3>Device scale · inside a 700 × 260 card</h3>+ <div class="spec">+ <span class="k">DeviceName · 600 · 12</span><span style="font:600 12px var(--font-ui)">Nota Chamber</span>+ <span class="k">DeviceSection · 700 · 9 caps</span><span style="font:700 9px var(--font-ui);letter-spacing:.12em;color:var(--text-tertiary)">EARLY REFLECTIONS</span>+ <span class="k">RowLabel · 700 · 8 caps</span><span style="font:700 8px var(--font-ui);letter-spacing:.1em;color:var(--text-tertiary)">PRE-DELAY</span>+ <span class="k">KnobLabel · 700 · 7 caps</span><span style="font:700 7px var(--font-ui);letter-spacing:.08em;color:var(--text-tertiary)">DECAY</span>+ <span class="k">KnobValue · mono · 7</span><span class="mono" style="font-size:7px;color:var(--text-secondary)">4.6 s</span>+ <span class="k">Axis · mono · 7 · Ink 7</span><span class="mono" style="font-size:7px;color:var(--text-axis)">30 Hz — 18k</span>+ </div>+ <h3>Setting numbers</h3>+ <div class="tbl"><table>+ <tr><th>Rule</th><th>Yes</th><th>No</th></tr>+ <tr><td>Thin space before the unit</td><td class="mono">4.6 s · −3.3 dB · 72 %</td><td class="mono">4.6s · -3,3dB</td></tr>+ <tr><td>Typographic minus; plus only where the sign matters</td><td class="mono">−18.0 dB · +0.8 dB</td><td class="mono">-18.0 dB</td></tr>+ <tr><td>Fixed precision</td><td class="mono">dB 1 · tempo 2 · % 0 · 440 Hz · 3.2 k</td><td class="mono">3200 Hz · 72.4 %</td></tr>+ <tr><td>Labels: English caps, one word</td><td class="mono">FEEDBACK · PRE-DELAY · FREQ</td><td class="mono">Fdbk: · Value</td></tr>+ </table></div>+</section>++<section id="geometry">+ <p class="eyebrow">04 · Material</p>+ <h2>Radii, sizes, depth</h2>+ <h3>Radii · by size, not role</h3>+ <div class="radii">+ <div class="radius"><i style="border-radius:var(--r-bar)"></i>1 · bar</div>+ <div class="radius"><i style="border-radius:var(--r-clip)"></i>2 · clip, meter</div>+ <div class="radius"><i style="border-radius:var(--r-badge)"></i>3 · badge</div>+ <div class="radius"><i style="border-radius:var(--r-control)"></i>4 · graph, button</div>+ <div class="radius"><i style="border-radius:var(--r-tile)"></i>5 · tile, search</div>+ <div class="radius"><i style="border-radius:var(--r-panel)"></i>6 · panel, section</div>+ <div class="radius"><i style="border-radius:var(--r-body)"></i>8 · device body</div>+ <div class="radius"><i style="border-radius:20px"></i>pill · chip, switch</div>+ </div>+ <h3>Sizes and steps</h3>+ <div class="tbl"><table>+ <tr><th>Element</th><th>px</th><th>Token</th></tr>+ <tr><td>Device card</td><td class="mono">700 × 260</td><td><code>DeviceCardKit.CardH</code></td></tr>+ <tr><td>Transport strip · buttons · Play</td><td class="mono">42 · 34 · 46</td><td><code>Control.Console / Transport / Play</code></td></tr>+ <tr><td>Shell button, field</td><td class="mono">26</td><td><code>Control.Shell</code></td></tr>+ <tr><td>Tab segment in its container</td><td class="mono">24 in 30</td><td><code>Control.Seg / SegGroup</code></td></tr>+ <tr><td>Filter chip</td><td class="mono">20</td><td><code>Control.Chip</code></td></tr>+ <tr><td>Knob · secondary / regular / main</td><td class="mono">34 / 36 / 44</td><td><code>Control.Knob*</code></td></tr>+ <tr><td>Parameter cell</td><td class="mono">53</td><td><code>Control.ParamCell</code></td></tr>+ <tr><td>Switch · slider track · meter</td><td class="mono">18 × 10 · 3 · 11 / 5</td><td></td></tr>+ <tr><td>Device steps · hair / gap / inset / wide</td><td class="mono">2 · 5 · 6 · 8</td><td><code>Space.Device*</code></td></tr>+ <tr><td>Shell steps · tile / gutter / inset</td><td class="mono">8 · 12 · 20</td><td><code>Space.Tile / Gutter / Inset</code></td></tr>+ </table></div>+ <h3>Three levels of depth</h3>+ <div class="depth">+ <div style="background:var(--bg-sunken);border:1px solid var(--hairline);box-shadow:var(--sunken)">Sunken · Well · Hairline · inner top line</div>+ <div style="background:var(--surface-card);border:1px solid var(--border-default)">Flat · Card · Border · no shadow</div>+ <div style="background:var(--surface-raised);border:1px solid var(--border-default);box-shadow:var(--raised)">Raised · Raised · Border · inner highlight</div>+ </div>+</section>++<section id="controls">+ <p class="eyebrow">05 · Controls</p>+ <h2>One implementation each</h2>+ <p>Vertical drag, up increases, ~140 px for the full range; Shift for fine steps; double-click resets; left button only, so right-click reaches the modulation menu.</p>+ <h3>Knob · 34 / 36 / 44</h3>+ <div class="demo knobs">+ <figure>{knob(34,.55)}secondary</figure>+ <figure>{knob(36,.4)}regular</figure>+ <figure>{knob(44,.7)}main</figure>+ <figure>{knob(36,.62,'var(--chroma-teal)')}modulated</figure>+ <figure>{knob(36,.4,dim=True)}inactive</figure>+ </div>+ <h3>Parameter cell · 53 tall</h3>+ <div class="demo row" style="gap:6px">+ {knob(34,.6,label='DECAY',val='4.6 s',hot=True)}+ {knob(34,.35,label='SIZE',val='31 m')}+ {knob(34,.42,label='MIX',val='42 %')}+ {knob(34,.3,'var(--chroma-teal)',label='MOD',val='18 %')}+ {knob(34,.0,dim=True,label='WIDTH',val='off')}+ </div>+ <p class="note">Brass Light label and value: the parameter differs from its default. A modulated arc takes its source's chroma; the label stays neutral.</p>+ <h3>Switch · segments · chips</h3>+ <div class="demo">+ <div class="row"><span class="switch on"><i></i>True stereo</span><span class="switch"><i></i>Reverse IR</span>+ <div class="seg seg--device"><button aria-pressed="false">Eco</button><button aria-pressed="true">Mid</button><button aria-pressed="false">High</button></div>+ <div class="seg"><button aria-pressed="true">Arrangement</button><button aria-pressed="false">Session</button><button aria-pressed="false">Modular</button></div></div>+ <div class="row"><span class="chip on">Favorites</span><span class="chip"><i style="background:var(--danger)"></i>bass</span><span class="chip"><i style="background:var(--track4)"></i>analog</span><span class="chip"><i style="background:var(--track2)"></i>clean</span><span class="chip mono">+2</span></div>+ </div>+ <h3>Slider row</h3>+ <div class="demo">+ <div class="slider"><span>Pre-delay</span><span class="track"><b style="width:30%"></b><u style="left:30%"></u></span><span>24 ms</span></div>+ <div class="slider"><span>Diffusion</span><span class="track"><b style="width:72%"></b><u style="left:72%"></u></span><span>72 %</span></div>+ <div class="slider dim"><span>Damping</span><span class="track"><b style="width:55%"></b><u style="left:55%"></u></span><span>4.1 k</span></div>+ </div>+ <h3>Transport · shapes, not an icon font</h3>+ <div class="transport">+ <div class="seg"><button aria-pressed="true">Arrangement</button><button aria-pressed="false">Session</button><button aria-pressed="false">Modular</button></div>+ <span class="tp"><i class="stop"></i></span><span class="tp play"><i class="play-tri"></i></span><span class="tp"><i class="rec"></i></span><span class="tp rec-on"><i class="rec"></i></span>+ <span class="vr"></span>+ <span class="readout"><b>12.3.04</b><span>BARS</span></span>+ <span class="vr"></span>+ <span class="readout"><b class="n">120.00</b><span>BPM</span></span><span class="readout"><b class="n">4/4</b><span>SIG</span></span><span class="readout"><b class="n">1/4</b><span>GRID</span></span>+ </div>+ <p class="note">Play is 46 wide against 34 — found by hand, not by eye. Record at rest is neutral with a red disc; engaged it is solid Record with a pale disc.</p>+</section>++<section id="states">+ <p class="eyebrow">06 · States</p>+ <h2>Colour changes, nothing moves</h2>+ <div class="demo states">+ <figure><span class="btn">Rest</span>Raised · Border · Ink 2</figure>+ <figure><span class="btn hover">Hover</span>Hover · Border strong · Ink 1</figure>+ <figure><span class="btn pressed">Pressed</span>Well · Brass Deep</figure>+ <figure><span class="btn on">Engaged</span>Brass Wash · Border brass</figure>+ <figure><span class="btn primary">Export</span>One solid action per context</figure>+ <figure><span class="btn off">Disabled</span>Panel · Hairline · Ink 6</figure>+ </div>+ <div class="row" style="margin-top:12px"><span class="field">Search</span><span class="field focus">Stone Vault</span></div>+ <p class="note">Hover and colour 120 ms ease-out. Empty state: one Ink 5 line, centred, no illustration, no call-to-action button.</p>+</section>++<section id="graphs">+ <p class="eyebrow">07 · Visualisations</p>+ <h2>One graph window</h2>+ <p>Well ground, hairline frame, radius 4, grid lines, mono axis labels in the corners only. Primary curve 1.8 px brass, others 1.2–1.6 px in their chroma. No fills under curves.</p>+ <div class="row" style="align-items:stretch">+ <div class="graph" style="width:420px;height:150px">+ <span class="title">RESPONSE</span>+ <svg width="420" height="150" viewBox="0 0 420 150" aria-hidden="true">+ <g style="stroke:var(--grid-beat);stroke-width:1">{''.join(f'<line x1="{x}" y1="0" x2="{x}" y2="150"/>' for x in (70,140,210,280,350))}<line x1="0" y1="75" x2="420" y2="75"/></g>+ <path d="M0 75 C60 75 80 50 120 48 S170 75 210 75 S260 110 300 108 S360 75 420 75" style="fill:none;stroke:var(--chroma-teal);stroke-width:1.4"/>+ <path d="M0 75 C50 75 90 40 130 38 S190 75 230 80 S300 100 330 96 S390 75 420 75" style="fill:none;stroke:var(--accent);stroke-width:1.8;stroke-linecap:round"/>+ <circle cx="130" cy="38" r="4.5" style="fill:var(--accent);stroke:var(--bg-sunken);stroke-width:2"/>+ <circle cx="330" cy="96" r="4.5" style="fill:var(--text-secondary);stroke:var(--bg-sunken);stroke-width:2"/>+ </svg>+ <span class="axis" style="left:4px;bottom:4px">20</span><span class="axis" style="right:4px;bottom:4px">20k Hz</span>+ </div>+ <div class="graph" style="padding:12px 16px;display:flex;gap:18px;align-items:flex-end">+ <div class="meters">+ <div class="meter"><i style="height:62%;background:var(--success)"></i></div>+ <div class="meter"><i style="height:62%;background:var(--success)"></i><i style="bottom:62%;height:16%;background:var(--warning)"></i></div>+ </div>+ <div class="mono" style="font-size:9px;color:var(--text-secondary);line-height:1.8">L −6.4 dB<br>R <span style="color:var(--danger-bright)">+0.8 dB</span></div>+ </div>+ </div>+ <p class="note">Meters: 11 wide, 5 apart, zones Signal → −6 dB Caution → 0 Alert. Peak hold stays until clicked. Timeline clips: flat, radius 2, no outline; playhead 1 px brass with a 7 × 5 flag.</p>+</section>++<section id="cards">+ <p class="eyebrow">08 · Device cards</p>+ <h2>700 × 260, at true size</h2>+ <p>Header 22: name left; processing-type badge and bypass right — nothing else (presets, A/B, move and delete are in the right-click menu). Body inset 6, sections radius 6 with gap 5. Three columns: choice → work → output.</p>+ <div class="scroll"><div class="card">+ <div class="card__head"><span class="card__name">Nota Chamber</span><span class="card__badge">CONVOLUTION</span><span class="switch on" style="margin-left:6px"><i></i></span></div>+ <div class="card__body">+ <div class="sect"><h5>Choice</h5><div class="field" style="width:100%;height:22px;font-size:10px;color:var(--text-primary)">Concert Hall</div>+ <div class="seg seg--device" style="align-self:flex-start"><button aria-pressed="true">IR</button><button aria-pressed="false">Algo</button></div></div>+ <div class="sect"><h5>Work</h5>+ <div class="graph" style="height:96px"><span class="axis" style="left:4px;bottom:4px">0</span><span class="axis" style="right:4px;bottom:4px">2.6 s</span>+ <svg width="100%" height="96" viewBox="0 0 360 96" preserveAspectRatio="none" aria-hidden="true"><path d="M0 20 C40 22 80 40 140 58 S260 84 360 88" style="fill:none;stroke:var(--accent);stroke-width:1.8"/><path d="M0 34 C40 36 90 52 150 66 S260 86 360 90" style="fill:none;stroke:var(--chroma-teal);stroke-width:1.4"/></svg></div>+ <div class="row" style="gap:4px;margin:0;justify-content:space-around">{knob(34,.3,label='PRE-DELAY',val='20.0 ms')}{knob(34,.62,label='SIZE',val='100 %',hot=True)}{knob(34,.2,label='ATTACK',val='0.0 ms')}{knob(34,.55,label='DECAY',val='2.60 s')}</div></div>+ <div class="sect"><h5>Output</h5>+ <div class="slider" style="width:100%;grid-template-columns:34px 1fr 36px"><span>Conv</span><span class="track"><b style="width:60%"></b><u style="left:60%"></u></span><span>−3.0</span></div>+ <div class="slider" style="width:100%;grid-template-columns:34px 1fr 36px"><span>Dry</span><span class="track"><b style="width:80%"></b><u style="left:80%"></u></span><span>0.0</span></div>+ <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>+</section>++<section id="shell">+ <p class="eyebrow">09 · Shell</p>+ <h2>Header, transport, panels on the gutter</h2>+ <div class="shell">+ <div class="h">Northern Reverb Study</div>+ <div class="t">VIEW · STOP PLAY REC · POSITION · LOOP · BPM SIG GRID · SWITCHES · + TRACK</div>+ <div class="b"><div>BROWSER</div><div>CANVAS · ALWAYS SUNKEN</div></div>+ <div class="s">STATUS</div>+ </div>+ <p class="note" style="margin-top:10px">Header 36 · transport 42 under it (a departure from the almanac, which puts it at the bottom) · panels float on Gutter with 12 px gaps · status 22. List rows 26, one line: dot, name, mono metadata. Arrangement tracks 64, groups 26, header column 228.</p>+ <h3>Accepted departures</h3>+ <ul class="plain">+ <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>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>+</div>+<script>+(() => {{+ const root = document.documentElement;+ const buttons = document.querySelectorAll('.mast .seg button');+ function hexes() {{+ const paper = root.dataset.variant === 'paper';+ document.querySelectorAll('.sw').forEach(s => {{ s.querySelector('.sw__hex').textContent = paper ? s.dataset.light : s.dataset.dark; }});+ }}+ function set(v) {{+ if (v === 'paper') root.dataset.variant = 'paper'; else delete root.dataset.variant;+ buttons.forEach(b => b.setAttribute('aria-pressed', String(b.dataset.v === v)));+ hexes();+ try {{ localStorage.setItem('ember-variant', v); }} catch (e) {{}}+ }}+ buttons.forEach(b => b.addEventListener('click', () => set(b.dataset.v)));+ let saved = null; try {{ saved = localStorage.getItem('ember-variant'); }} catch (e) {{}}+ const asked = new URLSearchParams(location.search).get('variant'); // ?variant=paper+ set((asked || saved) === 'paper' ? 'paper' : 'graphite');+ document.querySelectorAll('.sw').forEach(s => s.addEventListener('click', () => {{+ const hex = s.querySelector('.sw__hex').textContent;+ const done = () => {{ s.classList.add('copied'); setTimeout(() => s.classList.remove('copied'), 900); }};+ if (navigator.clipboard) navigator.clipboard.writeText(hex).then(done, () => {{}});+ }}));+}})();+</script>+</body>+</html>+'''+open(ROOT+'/DESIGN.html','w',encoding='utf-8').write(T)+print(len(T.splitlines()))diff --git a/src/managed/Nota.App/AboutWindow.cs b/src/managed/Nota.App/AboutWindow.csindex a780e5bf..51d31518 100644--- a/src/managed/Nota.App/AboutWindow.cs+++ b/src/managed/Nota.App/AboutWindow.cs@@ -70,5 +70,5 @@ public sealed class AboutWindow : NotaWindow}private IBrush Brush(string key)- => (IBrush?)NotaPalette.ByKey(key) ?? Brushes.Magenta;+ => (IBrush?)NotaPalette.ByKey(key) ?? NotaPalette.TextPrimary;}diff --git a/src/managed/Nota.App/App.axaml.cs b/src/managed/Nota.App/App.axaml.csindex 05908fc1..a72cbf56 100644--- a/src/managed/Nota.App/App.axaml.cs+++ b/src/managed/Nota.App/App.axaml.cs@@ -19,6 +19,8 @@ public partial class App : Avalonia.Applicationpublic override void Initialize(){+ // Numbers read the same on every OS locale: a point, and U+2212 for the minus.+ NotaNum.Install();AvaloniaXamlLoader.Load(this);}diff --git a/src/managed/Nota.App/ArrangementView.Controls.cs b/src/managed/Nota.App/ArrangementView.Controls.csindex 97940571..467adf78 100644--- a/src/managed/Nota.App/ArrangementView.Controls.cs+++ b/src/managed/Nota.App/ArrangementView.Controls.cs@@ -70,7 +70,11 @@ public sealed partial class ArrangementView}}+ // Bar numbers in mono 7. The almanac labels every 4 bars at its base scale+ // (16px a bar); zoomed in far enough that a single bar has room, every bar is named.int firstBar = (int)Math.Floor(_o._scrollBeats / _o._beatsPerBar);+ double barPx = _o._pixelsPerBeat * _o._beatsPerBar;+ int labelEvery = barPx >= 40 ? 1 : 4;for (int bar = firstBar; ; bar++){double beat = bar * _o._beatsPerBar;@@ -78,21 +82,22 @@ public sealed partial class ArrangementViewif (x > w) break;if (x < 0) continue;ctx.DrawLine(BarPen, new Point(x, h - 7), new Point(x, h));+ if (bar % labelEvery != 0) continue;var ft = new FormattedText((bar + 1).ToString(), CultureInfo.InvariantCulture,- FlowDirection.LeftToRight, Typeface.Default, 9, RulerText);+ FlowDirection.LeftToRight, NotaFonts.Mono, NotaType.Axis, RulerText);ctx.DrawText(ft, new Point(x + 3, 3));}- // Playhead marker: a small brass triangle at the top of the ruler.+ // Playhead flag: a 7×5 brass triangle at the top of the ruler.double px = _o.BeatToX(_o._playheadBeats);if (px >= -5 && px <= w + 5){var tri = new StreamGeometry();using (var g = tri.Open()){- g.BeginFigure(new Point(px - 4, 0), true);- g.LineTo(new Point(px + 4, 0));- g.LineTo(new Point(px, 6));+ g.BeginFigure(new Point(px - 3.5, 0), true);+ g.LineTo(new Point(px + 3.5, 0));+ g.LineTo(new Point(px, 5));g.EndFigure(true);}ctx.DrawGeometry(PlayheadBrush, null, tri);@@ -247,11 +252,10 @@ public sealed partial class ArrangementView}}- // Playhead across the footer lanes (brass line + glow).+ // Playhead across the footer lanes: a 1px brass line.double px = _o.BeatToX(_o._playheadBeats);if (px >= 0 && px <= w){- ctx.DrawLine(PlayheadGlow, new Point(px, 0), new Point(px, h));ctx.DrawLine(PlayheadPen, new Point(px, 0), new Point(px, h));}}diff --git a/src/managed/Nota.App/ArrangementView.LaneControl.cs b/src/managed/Nota.App/ArrangementView.LaneControl.csindex 4d97c0e6..cc4df40e 100644--- a/src/managed/Nota.App/ArrangementView.LaneControl.cs+++ b/src/managed/Nota.App/ArrangementView.LaneControl.cs@@ -103,7 +103,7 @@ public sealed partial class ArrangementViewprivate static double PillWidth(string label){var ft = new FormattedText(label, CultureInfo.InvariantCulture, FlowDirection.LeftToRight,- Typeface.Default, 9, Brushes.White);+ Typeface.Default, 9, NotaPalette.TextPrimary);return Math.Clamp(Math.Ceiling(ft.Width) + 12, 34, 180);}private Rect PillRect(int i, double w) => new(4, RowTop(i) + 3, w, PillH);@@ -1100,9 +1100,10 @@ public sealed partial class ArrangementViewDrawRecPeaks(ctx, re, rr);if (rr.Width > 34){- var ft = new FormattedText("● REC", CultureInfo.InvariantCulture,- FlowDirection.LeftToRight, Typeface.Default, 9, RecText);- ctx.DrawText(ft, new Point(rr.X + 5, rr.Y + 3));+ var ft = new FormattedText("REC", CultureInfo.InvariantCulture,+ FlowDirection.LeftToRight, NotaFonts.SansBold, 9, RecText);+ Glyph.Draw(ctx, GlyphKind.Record, new Rect(rr.X + 5, rr.Y + 3 + (ft.Height - 7) / 2, 7, 7), RecText);+ ctx.DrawText(ft, new Point(rr.X + 16, rr.Y + 3));}break;}@@ -1296,9 +1297,10 @@ public sealed partial class ArrangementViewdouble x0 = _o.BeatToX(c.StartBeat);double x1 = _o.BeatToX(c.StartBeat + c.LengthBeats);if (x1 < 0 || x0 > w || c.LengthBeats <= 0) return;- var (fill, border, _, content) = ClipColors(colorIndex);+ var (fill, _, _, content) = ClipColors(colorIndex);var rect = new Rect(x0, y + 2, Math.Max(2, x1 - x0), rowH - 4);- ctx.DrawRectangle(fill, selected ? ClipSelBorder : border, rect, 4, 4);+ // A flat body in the track tint, radius 2, no outline; selection adds a 1px brass edge.+ ctx.DrawRectangle(fill, selected ? ClipSelBorder : null, rect, NotaRadius.ClipValue, NotaRadius.ClipValue);// Resize-edge affordance: a bright bar on the edge a drag would trim.if (edgeHi != Drag.None)@@ -1337,7 +1339,7 @@ public sealed partial class ArrangementView// Deactivated clip (key 0): grey it out with a dark scrim so it reads as "off"// while still showing its content/geometry. Inset so the (selection) border stays.if (!c.Active)- ctx.DrawRectangle(InactiveVeil, null, rect.Deflate(1), 3, 3);+ ctx.DrawRectangle(InactiveVeil, null, rect.Deflate(1), NotaRadius.ClipValue, NotaRadius.ClipValue);}private const double BandH = 2; // clip colour band along the top edge@@ -1551,7 +1553,6 @@ public sealed partial class ArrangementViewdouble px = _o.BeatToX(_o._playheadBeats);if (px >= 0 && px <= w){- ctx.DrawLine(PlayheadGlow, new Point(px, 0), new Point(px, h));ctx.DrawLine(PlayheadPen, new Point(px, 0), new Point(px, h));}}diff --git a/src/managed/Nota.App/ArrangementView.Sections.cs b/src/managed/Nota.App/ArrangementView.Sections.csindex 1d8c564a..690687a9 100644--- a/src/managed/Nota.App/ArrangementView.Sections.cs+++ b/src/managed/Nota.App/ArrangementView.Sections.cs@@ -109,7 +109,7 @@ public sealed partial class ArrangementView{for (int i = 1; ; i++){- string candidate = "Section " + i.ToString(CultureInfo.InvariantCulture);+ string candidate = "Section " + i.ToString(NotaNum.Culture);if (!_sections.Any(s => string.Equals(s.Name, candidate, StringComparison.Ordinal))) return candidate;}}diff --git a/src/managed/Nota.App/ArrangementView.cs b/src/managed/Nota.App/ArrangementView.csindex e161b4a9..68d9b9e5 100644--- a/src/managed/Nota.App/ArrangementView.cs+++ b/src/managed/Nota.App/ArrangementView.cs@@ -67,7 +67,7 @@ public sealed partial class ArrangementView : UserControlprivate readonly Dictionary<int, TextBlock> _volDb = new();// Per-track header card + its name label, so a selection change repaints just those two// properties instead of tearing down and rebuilding every header control (click latency).- private readonly Dictionary<int, (Border card, TextBlock name, bool isGroup)> _headerCards = new();+ private readonly Dictionary<int, (Border card, TextBlock name, bool isGroup, Border spine, IBrush spineIdle)> _headerCards = new();// Per-track chosen automation target, kept across Refresh (which rebuilds VMs).private readonly Dictionary<int, (AutomationTarget target, int dev, int param, string paramId)> _autoTargets = new();@@ -372,7 +372,7 @@ public sealed partial class ArrangementView : UserControlClipToBounds = true,Child = root,};- island.BindResource(Border.CornerRadiusProperty, "Radius.Md");+ island.BindResource(Border.CornerRadiusProperty, "Radius.Panel");island.BindResource(Border.BackgroundProperty, "Brush.SurfaceCard");island.BindResource(Border.BorderBrushProperty, "Brush.BorderDefault");Content = island;@@ -575,7 +575,7 @@ public sealed partial class ArrangementView : UserControl{f.Value = ti.Volume;if (_volDb.TryGetValue(ti.Id, out var db))- db.Text = ti.Volume <= 0.0011 ? "-∞" : AudioMath.LinToDb(ti.Volume).ToString("0.0");+ db.Text = ti.Volume <= 0.0011 ? "−∞" : AudioMath.LinToDb(ti.Volume).ToString("0.0");}if (_panBars.TryGetValue(ti.Id, out var p) && !p.Dragging && Math.Abs(p.Pan - ti.Pan) > 1e-3)p.Pan = ti.Pan;@@ -1373,10 +1373,12 @@ public sealed partial class ArrangementView : UserControl{foreach (var (id, h) in _headerCards){+ // Selected row (almanac § States): brass wash, the left stripe turns brass, name in Ink 1.bool selected = IsTrackMultiSelected(id);h.card.Background = selected ? SelHeaderBg: h.isGroup ? Brush("Brush.SurfaceRaised") : Brush("Brush.SurfaceCard");- h.name.Foreground = Brush(selected ? "Brush.AccentBright" : "Brush.TextPrimary");+ h.name.Foreground = Brush("Brush.TextPrimary");+ h.spine.Background = selected ? NotaPalette.Accent : h.spineIdle;}}@@ -1413,19 +1415,18 @@ public sealed partial class ArrangementView : UserControlbool selected = IsTrackMultiSelected(t.Id);var (_, _, _, spineBrush) = ClipColors(t.ColorIndex);- var tri = new TextBlock+ var tri = new Border{- Text = _collapsed.Contains(t.Id) ? "▸" : "▾", FontSize = 9,- Foreground = Brush("Brush.TextSecondary"), VerticalAlignment = VerticalAlignment.Center,- Cursor = new Cursor(StandardCursorType.Hand),- Background = Brushes.Transparent, Padding = new Thickness(2, 0),+ Background = Brushes.Transparent, Padding = new Thickness(2, 0), Cursor = new Cursor(StandardCursorType.Hand),+ VerticalAlignment = VerticalAlignment.Center,+ Child = new Glyph(_collapsed.Contains(t.Id) ? GlyphKind.ChevronRight : GlyphKind.ChevronDown, 8) { Foreground = Brush("Brush.TextSecondary") },};tri.PointerPressed += (_, e) => { e.Handled = true; ToggleCollapse(t.Id); };var name = new TextBlock{Text = t.Name, FontSize = 11, FontWeight = FontWeight.SemiBold,- Foreground = Brush(selected ? "Brush.AccentBright" : "Brush.TextPrimary"),+ Foreground = Brush("Brush.TextPrimary"),VerticalAlignment = VerticalAlignment.Center,TextTrimming = TextTrimming.CharacterEllipsis,Margin = new Thickness(4, 0, 0, 0),@@ -1477,7 +1478,8 @@ public sealed partial class ArrangementView : UserControlBorderThickness = new Thickness(0, 0, 1, 1),Child = grid,};- _headerCards[t.Id] = (card, name, true);+ _headerCards[t.Id] = (card, name, true, spine, spineBrush);+ if (selected) spine.Background = NotaPalette.Accent;AttachHeaderGestures(card, t);return card;}@@ -1491,7 +1493,7 @@ public sealed partial class ArrangementView : UserControlvar name = new TextBlock{Text = t.Name, FontSize = 11, FontWeight = FontWeight.SemiBold,- Foreground = Brush(selected ? "Brush.AccentBright" : "Brush.TextPrimary"),+ Foreground = Brush("Brush.TextPrimary"),VerticalAlignment = VerticalAlignment.Center,TextTrimming = TextTrimming.CharacterEllipsis,};@@ -1500,12 +1502,11 @@ public sealed partial class ArrangementView : UserControlif (t.IsGroup){// Collapse triangle — hides/shows the group's child rows.- var tri = new TextBlock+ var tri = new Border{- Text = _collapsed.Contains(t.Id) ? "▸" : "▾", FontSize = 9,- Foreground = Brush("Brush.TextSecondary"), VerticalAlignment = VerticalAlignment.Center,- Margin = new Thickness(0, 0, 4, 0), Cursor = new Cursor(StandardCursorType.Hand),- Background = Brushes.Transparent, Padding = new Thickness(2, 0),+ Background = Brushes.Transparent, Padding = new Thickness(2, 0), Margin = new Thickness(0, 0, 4, 0),+ Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,+ Child = new Glyph(_collapsed.Contains(t.Id) ? GlyphKind.ChevronRight : GlyphKind.ChevronDown, 8) { Foreground = Brush("Brush.TextSecondary") },};tri.PointerPressed += (_, e) => { e.Handled = true; ToggleCollapse(t.Id); };Grid.SetColumn(tri, 0);@@ -1514,7 +1515,7 @@ public sealed partial class ArrangementView : UserControlelse if (t.Frozen || t.LiveRole != 0){// Freeze badge: a drawn chain-link for a sleeping live-freeze source (1);- // a ❄ snowflake for an in-place frozen track or a linked frozen track (2).+ // a drawn snowflake for an in-place frozen track or a linked frozen track (2).Control badge = t.LiveRole == 1? new Avalonia.Controls.Shapes.Path{@@ -1523,11 +1524,7 @@ public sealed partial class ArrangementView : UserControlWidth = 14, Height = 14,VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 4, 0),}- : new TextBlock- {- Text = "❄", FontSize = 11, Foreground = FrozenAccent,- VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 4, 0),- };+ : new Glyph(GlyphKind.Freeze, 10) { Foreground = FrozenAccent, Margin = new Thickness(0, 0, 4, 0) };Grid.SetColumn(badge, 0);nameRow.Children.Add(badge);}@@ -1543,7 +1540,7 @@ public sealed partial class ArrangementView : UserControl// Record-arm applies to instrument (MIDI capture) + audio (input capture) tracks;// return and group tracks have no input, so they get no arm chip.if (!t.IsReturn && !t.IsGroup)- btnRow.Children.Add(ChipToggle("●", t.Armed, danger: true, v => _engine?.SetTrackArmed(t.Id, v)));+ btnRow.Children.Add(ArmToggle(t.Armed, v => _engine?.SetTrackArmed(t.Id, v)));// A compact routing selector sits with the arm button (the 64px row leaves no room// for a 4th row): audio tracks get record-input, instrument tracks get "MIDI To".@@ -1571,8 +1568,8 @@ public sealed partial class ArrangementView : UserControlVerticalAlignment = VerticalAlignment.Center, Width = 30, TextAlignment = TextAlignment.Right,Margin = new Thickness(6, 0, 0, 0),};- void ShowDb(double v) => db.Text = v <= 0.0011 ? "-∞"- : AudioMath.LinToDb(v).ToString("0.0", CultureInfo.InvariantCulture);+ void ShowDb(double v) => db.Text = v <= 0.0011 ? "−∞"+ : AudioMath.LinToDb(v).ToString("0.0", NotaNum.Culture);ShowDb(t.Volume);fader.ValueChanged += v => { _engine?.SetTrackVolume(volTrackId, (float)v); ShowDb(v); };fader.GestureBegin += () => _engine?.BeginAutomationWrite(volTrackId, AutomationTarget.Volume, -1, -1, "");@@ -1623,7 +1620,8 @@ public sealed partial class ArrangementView : UserControlBorderThickness = new Thickness(0, 0, 1, 1),Child = grid,};- _headerCards[t.Id] = (card, name, t.IsGroup); // for in-place selection repaint+ _headerCards[t.Id] = (card, name, t.IsGroup, spine, spineBrush); // for in-place selection repaint+ if (selected) spine.Background = NotaPalette.Accent;AttachHeaderGestures(card, t);return card;}@@ -1697,7 +1695,7 @@ public sealed partial class ArrangementView : UserControl// Track context menu (Duplicate / Delete). Both go through the engine's// snapshot ops, so undo/redo covers them; the whole view refreshes after.- private static readonly string[] TrackColorNames = { "Rust", "Amber", "Olive", "Sage", "Teal", "Slate", "Mauve", "Rose" };+ private static readonly string[] TrackColorNames = { "Drums", "Perc", "Bass", "Keys", "Texture", "FX", "Brass", "Vox", "Return" };private static readonly string[] ShadeNames = { "", " (light)", " (dark)" };// "Add …" entries shared by the arrangement's track-level menus. Return is left enabled@@ -1756,7 +1754,7 @@ public sealed partial class ArrangementView : UserControlrecInput = new MenuItem { Header = "Record input" };MenuItem Src(string label, int source){- var mi = new MenuItem { Header = (cur == source ? "✓ " : " ") + label };+ var mi = new MenuItem { Header = label, ToggleType = MenuItemToggleType.Radio, IsChecked = cur == source };mi.Click += (_, _) => _engine.SetTrackRecordInput(trackId, source);return mi;}@@ -1780,7 +1778,7 @@ public sealed partial class ArrangementView : UserControlmidiFrom = new MenuItem { Header = "MIDI from" };MenuItem Src(string label, int src){- var mi = new MenuItem { Header = (curSrc == src ? "✓ " : " ") + label };+ var mi = new MenuItem { Header = label, ToggleType = MenuItemToggleType.Radio, IsChecked = curSrc == src };mi.Click += (_, _) => _engine.SetTrackMidiSource(trackId, src);return mi;}@@ -1884,7 +1882,7 @@ public sealed partial class ArrangementView : UserControl// "In" pinned left (faded), the source name pinned right, so the name stands out.void Add(string value, int src){- var inTb = new TextBlock { Text = "In", FontSize = 9, Foreground = Brush("Brush.TextTertiary"), Opacity = 0.7, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(6, 0) };+ var inTb = new TextBlock { Text = "In", FontSize = 9, Foreground = Brush("Brush.TextDisabled"), VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(6, 0) };var valTb = new TextBlock { Text = value, FontSize = 9, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Right, TextTrimming = TextTrimming.CharacterEllipsis, Margin = new Thickness(6, 0) };// The closed box hoists this content out of its item, where it stops following the// theme foreground and keeps whatever it was built with — so on the paper variant@@ -1928,7 +1926,7 @@ public sealed partial class ArrangementView : UserControl// "In" pinned left (faded), the source name pinned right.void Add(string value, int src){- var inTb = new TextBlock { Text = "In", FontSize = 9, Foreground = Brush("Brush.TextTertiary"), Opacity = 0.7, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(6, 0) };+ var inTb = new TextBlock { Text = "In", FontSize = 9, Foreground = Brush("Brush.TextDisabled"), VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(6, 0) };var valTb = new TextBlock { Text = value, FontSize = 9, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Right, TextTrimming = TextTrimming.CharacterEllipsis, Margin = new Thickness(6, 0) };// The closed box hoists this content out of its item, where it stops following the// theme foreground and keeps whatever it was built with — so on the paper variant@@ -1979,8 +1977,8 @@ public sealed partial class ArrangementView : UserControl// A small rounded colour swatch for the given palette index (menu icon).private static Control Swatch(int colorIndex)- => new Border { Width = 13, Height = 13, CornerRadius = new CornerRadius(3),- Background = new SolidColorBrush(TrackColorForIndex(colorIndex)) };+ => new Border { Width = 13, Height = 13, CornerRadius = NotaRadius.Badge,+ Background = TrackBrush(colorIndex) };// Inline rename popup for a track header (Enter commits, Esc cancels).private void PromptRenameTrack(Control anchor, int trackId)@@ -2011,6 +2009,28 @@ public sealed partial class ArrangementView : UserControl}// A small 18×16 stateful chip toggle (M/S/●). Danger variant reds when active.+ // Record-arm, drawn to the almanac's record rule: at rest a neutral chip with a red+ // disc; armed, solid record red with a pale disc.+ private Control ArmToggle(bool initial, Action<bool> onChanged)+ {+ bool state = initial;+ var disc = new Glyph(GlyphKind.Record, 7);+ var chip = new Border { Width = 18, Height = 16, CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Child = disc, Cursor = new Cursor(StandardCursorType.Hand) };+ void Paint()+ {+ chip.Background = state ? NotaPalette.Record : NotaPalette.SurfaceRaised;+ chip.BorderBrush = state ? NotaPalette.Record : NotaPalette.BorderDefault;+ disc.Foreground = state ? NotaPalette.RecordInk : NotaPalette.Record;+ }+ Paint();+ chip.PointerPressed += (_, e) =>+ {+ if (!e.GetCurrentPoint(chip).Properties.IsLeftButtonPressed) return;+ e.Handled = true; state = !state; Paint(); onChanged(state);+ };+ return chip;+ }+private Control ChipToggle(string text, bool initial, bool danger, Action<bool> onChanged){bool state = initial;@@ -2021,22 +2041,23 @@ public sealed partial class ArrangementView : UserControl};var chip = new Border{- Width = 18, Height = 16, CornerRadius = new CornerRadius(4),+ Width = 18, Height = 16, CornerRadius = NotaRadius.Control,BorderThickness = new Thickness(1), Child = tb,};void Paint(){if (state){- chip.Background = Brush(danger ? "Brush.Danger" : "Brush.AccentSubtle");- chip.BorderBrush = Brush(danger ? "Brush.Danger" : "Brush.Accent");- tb.Foreground = Brush(danger ? "Brush.TextOnAccent" : "Brush.AccentBright");+ // Engaged (mute / solo): brass edge and brass ink on the wash.+ chip.Background = Brush(danger ? "Brush.Record" : "Brush.AccentSubtle");+ chip.BorderBrush = Brush(danger ? "Brush.Record" : "Brush.BorderBrass");+ tb.Foreground = Brush(danger ? "Brush.RecordInk" : "Brush.AccentHover");}else{chip.Background = Brush("Brush.SurfaceRaised");- chip.BorderBrush = Brush("Brush.BorderStrong");- tb.Foreground = Brush("Brush.TextSecondary");+ chip.BorderBrush = Brush("Brush.BorderDefault");+ tb.Foreground = Brush("Brush.TextStrong");}}Paint();@@ -2070,7 +2091,7 @@ public sealed partial class ArrangementView : UserControl{var spineBrush = masterSpine ? NotaPalette.Accent : ClipColors(colorIndex).content;var name = new TextBlock { Text = title, FontSize = 11, FontWeight = FontWeight.SemiBold, Foreground = Brush("Brush.TextPrimary"), VerticalAlignment = VerticalAlignment.Center };- var db = new TextBlock { Text = masterSpine ? "0.0" : "-inf", FontSize = 9, Classes = { "Mono" }, Foreground = Brush("Brush.TextTertiary"), VerticalAlignment = VerticalAlignment.Center };+ var db = new TextBlock { Text = masterSpine ? "0.0" : "−∞", FontSize = 9, Classes = { "Mono" }, Foreground = Brush("Brush.TextTertiary"), VerticalAlignment = VerticalAlignment.Center };var row = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto") };Grid.SetColumn(name, 0);Grid.SetColumn(db, 1);@@ -2086,7 +2107,7 @@ public sealed partial class ArrangementView : UserControlgrid.Children.Add(content);bool sel = trackId > 0 && trackId == SelTrackId;- if (sel) name.Foreground = Brush("Brush.AccentBright");+ if (sel) spine.Background = NotaPalette.Accent; // selected: brass stripe, name stays Ink 1var card = new Border{Width = HeaderW, Height = FooterRowH, ClipToBounds = true,@@ -2117,7 +2138,7 @@ public sealed partial class ArrangementView : UserControlflyout.ShowAt(anchor, showAtPointer: true);}- private static IBrush Brush(string key) => (IBrush?)NotaPalette.ByKey(key) ?? Brushes.Magenta;+ private static IBrush Brush(string key) => (IBrush?)NotaPalette.ByKey(key) ?? NotaPalette.TextPrimary;// Small bordered "−"/"+" zoom chip (HANDOFF 1b ruler: 11px, bordered, radius 4).private static Button ZoomChip(string text) => new()@@ -2142,16 +2163,18 @@ public sealed partial class ArrangementView : UserControl=> curve == 0f ? t : Math.Pow(t, Math.Pow(2.0, -curve * 4.0));// ---- data colours (mirror the "Ember Graphite" tokens in NotaTheme.axaml) --- private static readonly IBrush LaneBgA = NotaPalette.BgApp; // Brush.BgApp+ private static readonly IBrush LaneBgA = NotaPalette.BgSunken; // the canvas is sunken, not the app groundprivate static readonly IBrush LaneBgB = NotaPalette.LaneB; // Brush.LaneBprivate static readonly IBrush ChromeBg = NotaPalette.BgSunken; // Brush.BgSunkenprivate static readonly IPen BeatPen = new Pen(NotaPalette.GridBeat, 1); // Brush.GridBeatprivate static readonly IPen BarPen = new Pen(NotaPalette.GridBar, 1); // Brush.GridBar- private static readonly Color PlayheadColor = NotaPalette.AccentBrightColor; // Brush.AccentBright- private static readonly IBrush PlayheadBrush = new SolidColorBrush(PlayheadColor);- private static readonly IPen PlayheadPen = new Pen(PlayheadBrush, 1.5);- private static readonly IPen PlayheadGlow = new Pen(NotaPalette.Wash(NotaPalette.AccentBright, 0x40), 4);- private static readonly IPen ClipSelBorder = new Pen(PlayheadBrush, 2);+ // Playhead: a 1px brass line with a 7×5 flag on the ruler, no glow (almanac § timeline).+ // The brush is the palette slot itself — a SolidColorBrush built from its Color froze the+ // playhead in one theme.+ private static readonly IBrush PlayheadBrush = NotaPalette.Accent;+ private static readonly IPen PlayheadPen = new Pen(PlayheadBrush, 1);+ // Selection edges a clip with 1px brass — a state never thickens a border to 2px.+ private static readonly IPen ClipSelBorder = new Pen(NotaPalette.AccentBright, 1);private static readonly IBrush EdgeHighlight = NotaPalette.MarkerHot; // resize-edge affordanceprivate static readonly IBrush InactiveVeil = NotaPalette.Wash(NotaPalette.Veil, 0xB0); // deactivated-clip scrimprivate static readonly IBrush RulerText = NotaPalette.TextSecondary; // Brush.TextSecondary@@ -2171,12 +2194,12 @@ public sealed partial class ArrangementView : UserControlinternal int DropTrackIndex = -1; // -1 = no drag over; set by OnLaneDragOver, drawn by LaneControl// In-progress audio take (M-fix): audio clips only materialise on stop, so a// translucent red region grows from the take start to the playhead as feedback.- private static readonly IBrush RecFill = NotaPalette.Wash(NotaPalette.Danger, 0x33);- private static readonly IPen RecBorder = new Pen(NotaPalette.Wash(NotaPalette.Danger, 0xC0), 1.5);- private static readonly IBrush RecText = NotaPalette.DangerPale;+ private static readonly IBrush RecFill = NotaPalette.Wash(NotaPalette.Record, 0x33);+ private static readonly IPen RecBorder = new Pen(NotaPalette.Wash(NotaPalette.Record, 0xC0), 1.5);+ private static readonly IBrush RecText = NotaPalette.Record; // a take being recorded: the record red// Live capture waveform inside the growing take region — a brighter red so it// reads clearly against the translucent RecFill.- private static readonly IBrush RecWave = NotaPalette.Wash(NotaPalette.DangerPale, 0xE0);+ private static readonly IBrush RecWave = NotaPalette.Wash(NotaPalette.Record, 0xE0);// Marquee rubber-band (multi-select): accent wash + accent border.private static readonly IBrush MarqueeFill = NotaPalette.Wash(NotaPalette.Marker, 0x28);private static readonly IPen MarqueePen = new Pen(NotaPalette.Wash(NotaPalette.Marker, 0xC0), 1);@@ -2294,6 +2317,11 @@ public sealed partial class ArrangementView : UserControl_clipColors[idx] = v;return v;}+ /// <summary>The theme-following brush for a palette index. A view that wants a track's+ /// colour takes this; wrapping <see cref="TrackColorForIndex"/> in a new brush freezes it+ /// in the variant that was active when the view was built.</summary>+ public static SolidColorBrush TrackBrush(int idx) => (SolidColorBrush)ClipColors(idx).content;+/// <summary>A cached, theme-following tint of a palette index. Registers a derivation,/// so only call it behind a per-index cache — never per frame; <see cref="Alpha"/> is the/// throwaway form for a Render pass.</summary>diff --git a/src/managed/Nota.App/AudioClipEditorView.cs b/src/managed/Nota.App/AudioClipEditorView.csindex 7052eb20..ffb6b663 100644--- a/src/managed/Nota.App/AudioClipEditorView.cs+++ b/src/managed/Nota.App/AudioClipEditorView.cs@@ -100,18 +100,18 @@ public sealed class AudioClipEditorView : UserControl_onChanged();};_envToggleText = new TextBlock { Text = "Edit envelope: Off", FontSize = 10, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };- _envTargetText = new TextBlock { Text = "Volume ▾", FontSize = 10, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };+ _envTargetText = new TextBlock { Text = "Volume", FontSize = 10, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };_lengthText = Mono("—");- _pitchText = Mono("0 st");- _gainText = Mono("0.0 dB"); _gainText.Foreground = TextSecondary;+ _pitchText = Mono("0\u2009st");+ _gainText = Mono("0.0\u2009dB"); _gainText.Foreground = TextSecondary;_fileText = new TextBlock { Text = "—", FontSize = 9, Foreground = TextTertiary, TextWrapping = TextWrapping.Wrap };_gain = new MiniFader(1.0, 2.0) { VerticalAlignment = VerticalAlignment.Center };_gain.ValueChanged += v => { _engine.SetClipGain(TrackId, ClipIndex, (float)v); ShowGain(v); _wave.SetGain(v); _onChanged(); };_reverseToggleText = new TextBlock { Text = "Reverse: Off", FontSize = 10, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };_snapToggleText = new TextBlock { Text = "Grid snap: On", FontSize = 10, Foreground = AccentBright, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };_warpToggleText = new TextBlock { Text = "Warp: Off", FontSize = 10, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };- _warpModeText = new TextBlock { Text = "Complex ▾", FontSize = 10, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };+ _warpModeText = new TextBlock { Text = "Complex", FontSize = 10, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };_autoText = new TextBlock { Text = "Auto-warp to tempo", FontSize = 10, Foreground = AccentBright, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };_transientText = new TextBlock { Text = "Warp to transients", FontSize = 10, Foreground = AccentBright, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };_detectedText = new TextBlock { Text = "Detected: —", FontSize = 9, Foreground = TextTertiary };@@ -168,7 +168,7 @@ public sealed class AudioClipEditorView : UserControl// Warp: on/off + mode (time-stretch to project tempo, Signalsmith Stretch).var warpToggle = Chip(_warpToggleText);warpToggle.PointerPressed += (_, e) => { e.Handled = true; ToggleWarp(); };- var warpModeChip = Chip(_warpModeText);+ var warpModeChip = Chip(Glyph.WithChevron(_warpModeText));warpModeChip.PointerPressed += (_, e) => { e.Handled = true; CycleWarpMode(); };var warpRow = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), ColumnSpacing = 6 };warpToggle.MinWidth = 74;@@ -184,7 +184,7 @@ public sealed class AudioClipEditorView : UserControl// Clip envelopes: toggle edit mode on the waveform + pick Volume / Pan target.var envToggle = Chip(_envToggleText);envToggle.PointerPressed += (_, e) => { e.Handled = true; ToggleEnvMode(); };- var envTargetChip = Chip(_envTargetText);+ var envTargetChip = Chip(Glyph.WithChevron(_envTargetText));envTargetChip.PointerPressed += (_, e) => { e.Handled = true; CycleEnvTarget(); };var envRow = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), ColumnSpacing = 6 };envToggle.MinWidth = 96;@@ -273,7 +273,7 @@ public sealed class AudioClipEditorView : UserControlprivate void ShowBpmEditor(int seg, double bpm, double xCenter, double yTop){_bpmSeg = seg;- _bpmBox.Text = bpm.ToString("0.##", CultureInfo.InvariantCulture);+ _bpmBox.Text = bpm.ToString("0.##", NotaNum.Culture);Canvas.SetLeft(_bpmBox, Math.Max(0, xCenter - _bpmBox.Width / 2));Canvas.SetTop(_bpmBox, Math.Max(0, yTop - 2));_bpmBox.IsVisible = true;@@ -292,7 +292,7 @@ public sealed class AudioClipEditorView : UserControlif (!_bpmBox.IsVisible) return;int seg = _bpmSeg;HideBpm();- if (seg >= 0 && double.TryParse(_bpmBox.Text, NumberStyles.Any, CultureInfo.InvariantCulture, out var v) && v > 0)+ if (seg >= 0 && double.TryParse(_bpmBox.Text, NumberStyles.Any, NotaNum.Culture, out var v) && v > 0)_wave.SetSegmentBpm(seg, v); // → MarkersCommitted → engine + Reload}@@ -321,7 +321,7 @@ public sealed class AudioClipEditorView : UserControlif (_engine.TryGetAudioClipInfo(TrackId, ClipIndex, out var ai)){_pitch = (int)Math.Round(ai.PitchSemitones);- _pitchText.Text = $"{_pitch} st";+ _pitchText.Text = $"{_pitch}\u2009st";_gain.Value = ai.Gain;ShowGain(ai.Gain);_wave.SetGain(ai.Gain);@@ -333,13 +333,13 @@ public sealed class AudioClipEditorView : UserControl_warpMode = Math.Clamp(ai.WarpMode, 0, WarpModes.Length - 1);_warpToggleText.Text = _warpEnabled ? "Warp: On" : "Warp: Off";_warpToggleText.Foreground = _warpEnabled ? AccentBright : TextSecondary;- _warpModeText.Text = WarpModes[_warpMode] + " ▾";+ _warpModeText.Text = WarpModes[_warpMode];if (ai.SampleId != 0 && _engine.TryGetSampleInfo(ai.SampleId, out var si) && si.SampleRate > 0){double secs = si.Frames / si.SampleRate;string ch = si.Channels == 1 ? "Mono" : si.Channels == 2 ? "Stereo" : $"{si.Channels}ch";- _fileText.Text = string.Format(CultureInfo.InvariantCulture,- "{0} · {1:0.0} kHz · {2:0.00} s", ch, si.SampleRate / 1000.0, secs);+ _fileText.Text = string.Format(NotaNum.Culture,+ "{0} · {1:0.0}\u2009kHz · {2:0.00}\u2009s", ch, si.SampleRate / 1000.0, secs);}else _fileText.Text = "—";}@@ -460,7 +460,7 @@ public sealed class AudioClipEditorView : UserControlprivate void ShowDetected()=> _detectedText.Text = _detectedBpm > 0- ? string.Format(CultureInfo.InvariantCulture, "Detected: {0:0.0} BPM", _detectedBpm)+ ? string.Format(NotaNum.Culture, "Detected: {0:0.0}\u2009BPM", _detectedBpm): "Detected: —";private void ToggleEnvMode()@@ -474,7 +474,7 @@ public sealed class AudioClipEditorView : UserControlprivate void CycleEnvTarget(){_envTarget = _envTarget == 0 ? 1 : 0;- _envTargetText.Text = (_envTarget == 1 ? "Pan" : "Volume") + " ▾";+ _envTargetText.Text = _envTarget == 1 ? "Pan" : "Volume";LoadEnvelope();}@@ -498,7 +498,7 @@ public sealed class AudioClipEditorView : UserControl_onChanged();}- private void ShowGain(double v) => _gainText.Text = v <= 0.0011 ? "-∞" : $"{AudioMath.LinToDb(v):+0.0;-0.0} dB";+ private void ShowGain(double v) => _gainText.Text = v <= 0.0011 ? "−∞" : $"{AudioMath.LinToDb(v):+0.0;−0.0}\u2009dB";// --- helpers (mirror ClipPropsView) -----------------------------------@@ -507,7 +507,7 @@ public sealed class AudioClipEditorView : UserControlvar tab = new Border{Height = 22, Background = AccentSubtle, BorderBrush = Brass, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(5), Padding = new Thickness(10, 0), VerticalAlignment = VerticalAlignment.Center,+ CornerRadius = NotaRadius.Tile, Padding = new Thickness(10, 0), VerticalAlignment = VerticalAlignment.Center,Child = new TextBlock { Text = "Audio", FontSize = 11, Foreground = AccentBright, VerticalAlignment = VerticalAlignment.Center },};return new Border@@ -538,7 +538,7 @@ public sealed class AudioClipEditorView : UserControlprivate static Border FieldBox(double h) => new(){- Height = h, Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5),+ Height = h, Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile,};private static Border ReadoutBox(string text, IBrush fg, double h, double fs, bool mono)@@ -556,7 +556,7 @@ public sealed class AudioClipEditorView : UserControlprivate static Border Chip(Control child) => new(){Height = 22, Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(5), Cursor = new Cursor(StandardCursorType.Hand), Child = child,+ CornerRadius = NotaRadius.Tile, Cursor = new Cursor(StandardCursorType.Hand), Child = child,};private static Border StepBtn(string glyph, Action onClick)@@ -564,7 +564,7 @@ public sealed class AudioClipEditorView : UserControlvar b = new Border{Width = 22, Height = 22, Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(5), Cursor = new Cursor(StandardCursorType.Hand),+ CornerRadius = NotaRadius.Tile, Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = glyph, FontSize = 11, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center },};b.PointerPressed += (_, e) => { e.Handled = true; onClick(); };@@ -574,13 +574,13 @@ public sealed class AudioClipEditorView : UserControlprivate static string Position(double beat){int bar = (int)(beat / 4) + 1, be = (int)(beat % 4) + 1, six = (int)Math.Round(beat % 1 * 4) + 1;- return string.Format(CultureInfo.InvariantCulture, "{0}. {1}. {2}", bar, be, six);+ return string.Format(NotaNum.Culture, "{0}. {1}. {2}", bar, be, six);}private static string Duration(double beats){int bars = (int)(beats / 4), be = (int)(beats % 4), six = (int)Math.Round(beats % 1 * 4);- return string.Format(CultureInfo.InvariantCulture, "{0}. {1}. {2}", bars, be, six);+ return string.Format(NotaNum.Culture, "{0}. {1}. {2}", bars, be, six);}// ---- waveform + playback cursor + warp markers -----------------------@@ -591,18 +591,18 @@ public sealed class AudioClipEditorView : UserControl{private static readonly IBrush Bg = NotaPalette.BgSunken;private static readonly IBrush Mid = NotaPalette.Wash(NotaPalette.TextSecondary, 0x40);- private static readonly IBrush PlayheadCursor = NotaPalette.AccentBright;+ private static readonly IBrush PlayheadCursor = NotaPalette.Accent;private static readonly IBrush Marker = NotaPalette.Marker;private static readonly IBrush GridBeat = NotaPalette.Wash(NotaPalette.BorderStrong, 0x50);private static readonly IBrush GridBar = NotaPalette.Wash(NotaPalette.BorderStrong, 0xC0);private static readonly IBrush GridLabel = NotaPalette.TextTertiary;- private static readonly Typeface GridFace = new(FontFamily.Default);+ private static readonly Typeface GridFace = NotaFonts.Sans;// BPM chip on the warp bar (drag to scrub the segment tempo).private static readonly IBrush BpmChipBg = NotaPalette.Wash(NotaPalette.Ink("#12181B"), 0xDE);private static readonly IBrush BpmChipBgHot = NotaPalette.Wash(NotaPalette.Ink("#1A2B31"), 0xF2);private static readonly IBrush BpmSuffix = NotaPalette.Wash(NotaPalette.Marker, 0x99);private const int BeatsPerBar = 4; // matches the props-rail bar.beat readouts- private IBrush _wave = new SolidColorBrush(NotaPalette.TrackColors[1]);+ private IBrush _wave = NotaPalette.TrackBrushes[1];private float[]? _peaks;private int _count;private double _frac = -1;@@ -1177,7 +1177,7 @@ public sealed class AudioClipEditorView : UserControlbool hotChip = i == _bpmHoverSeg || i == _bpmScrubSeg;var txtBrush = hotChip ? BracketHot : Marker;var num = new FormattedText($"{bpm:0.0}", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, GridFace, 10, txtBrush);- var suf = new FormattedText("BPM", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, GridFace, 6.5, BpmSuffix);+ var suf = new FormattedText("BPM", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, GridFace, NotaType.Floor, BpmSuffix);double padX = 6, padY = 2.5, gap = 3;double cw = num.Width + gap + suf.Width + 2 * padX, chH = num.Height + 2 * padY;double cx = Math.Clamp((x0 + x1) / 2, cw / 2 + 2, w - cw / 2 - 2);@@ -1253,7 +1253,7 @@ public sealed class AudioClipEditorView : UserControldouble x = (_srcMode && _srcTotal > 0) ? SrcToX(_srcOff + pf * _srcLen, w): (_trimMode && _trimTotal > 0) ? BeatToX(_trimStart + pf * (_trimEnd - _trimStart), w): FracToX(pf, w);- ctx.DrawLine(new Pen(PlayheadCursor, 1.5), new Point(x, 0), new Point(x, h));+ ctx.DrawLine(new Pen(PlayheadCursor, 1), new Point(x, 0), new Point(x, h));}}diff --git a/src/managed/Nota.App/BrowserView.cs b/src/managed/Nota.App/BrowserView.csindex 7f423a81..96746e5b 100644--- a/src/managed/Nota.App/BrowserView.cs+++ b/src/managed/Nota.App/BrowserView.cs@@ -150,7 +150,7 @@ public sealed class BrowserView : UserControlprivate const int TabCount = 7; // Instr / FX / MIDI / Files / Preset / Proj / Mapprivate const int FilesTab = 3; // the only tab with a sample auditionerprivate const int MapTab = 6; // MIDI-learn mappings — hosts a MidiMapView, not a list- private const double RowH = 24; // single-line index row+ private const double RowH = 26; // single-line index row (almanac list row: 26–28, one line)private const double GroupRowH = 22;private readonly ListBox[] _pages;@@ -198,7 +198,7 @@ public sealed class BrowserView : UserControl/// and assign it to that device.</summary>public event Action<BrowserItem?>? EditTagsRequested;- // Header filter chips (★ Favorites + one per tag); rebuilt from the VM's tags.+ // Header filter chips (Favorites + one per tag); rebuilt from the VM's tags.private readonly Border _chipsHost;private readonly ChipStrip _chipsPanel;private readonly Border _overflowChip;@@ -268,13 +268,14 @@ public sealed class BrowserView : UserControl_searchWrap = new Border{Height = 26,- CornerRadius = new CornerRadius(5),+ CornerRadius = NotaRadius.Tile,BorderThickness = new Thickness(1),Padding = new Thickness(8, 0),Child = searchGrid,};_searchWrap.BindResource(Border.BackgroundProperty, "Brush.BgSunken");_searchWrap.BindResource(Border.BorderBrushProperty, "Brush.BorderDefault");+ _searchWrap.BindResource(Border.BoxShadowProperty, "Shadow.Sunken");// Sort & view options — the row's shape, sectioning and tag management._optionsBtn = BuildOptionsButton();@@ -288,7 +289,7 @@ public sealed class BrowserView : UserControlGrid.SetColumn(_optionsBtn, 1);headerRow.Children.Add(_optionsBtn);- // Filter chips (★ Favorites + tags). Populated from the VM in SetViewModel and+ // Filter chips (Favorites + tags). Populated from the VM in SetViewModel and// shown only on the device tabs (Instr / FX / MIDI). One line: the chips that// don't fit collapse into a "+N" that opens the rest._overflowText = new TextBlock { FontSize = 10, VerticalAlignment = VerticalAlignment.Center };@@ -296,11 +297,12 @@ public sealed class BrowserView : UserControl_overflowText.BindResource(TextBlock.ForegroundProperty, "Brush.TextTertiary");_overflowChip = new Border{- Height = 20,- Padding = new Thickness(4, 0),+ Height = NotaSize.Chip, CornerRadius = NotaRadius.Pill, Padding = new Thickness(9, 0),+ BorderThickness = new Thickness(1),Cursor = new Cursor(StandardCursorType.Hand),Child = _overflowText,};+ _overflowChip.BindResource(Border.BorderBrushProperty, "Brush.BorderDefault");_overflowChip.PointerPressed += (_, e) => { ShowOverflowChips(); e.Handled = true; };_chipsPanel = new ChipStrip(_overflowChip, _overflowText);_chipsHost = new Border { Margin = new Thickness(8, 0, 8, 7), Child = _chipsPanel };@@ -319,7 +321,7 @@ public sealed class BrowserView : UserControlBorderThickness = new Thickness(0, 1, 0, 0),Child = _statusText,};- _statusBar.BindResource(Border.BackgroundProperty, "Brush.BgApp");+ _statusBar.BindResource(Border.BackgroundProperty, "Brush.Panel");_statusBar.BindResource(Border.BorderBrushProperty, "Brush.BorderDefault");// Empty-state message, centered over the list when a tab has nothing to show.@@ -330,7 +332,7 @@ public sealed class BrowserView : UserControl_emptyText.BindResource(TextBlock.ForegroundProperty, "Brush.TextTertiary");_emptyWrap = new Border{- IsHitTestVisible = false,+ IsHitTestVisible = true, // so the one-line empty state can offer its how-to as a tooltipIsVisible = false,HorizontalAlignment = HorizontalAlignment.Center,VerticalAlignment = VerticalAlignment.Center,@@ -353,7 +355,7 @@ public sealed class BrowserView : UserControlright.Children.Add(contentHost);var railDivider = new Border { BorderThickness = new Thickness(0, 0, 1, 0), Child = rail };- railDivider.BindResource(Border.BackgroundProperty, "Brush.BgApp");+ railDivider.BindResource(Border.BackgroundProperty, "Brush.Panel");railDivider.BindResource(Border.BorderBrushProperty, "Brush.BorderDefault");var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*") };@@ -370,7 +372,7 @@ public sealed class BrowserView : UserControlClipToBounds = true,Child = grid,};- outer.BindResource(Border.CornerRadiusProperty, "Radius.Md");+ outer.BindResource(Border.CornerRadiusProperty, "Radius.Panel");outer.BindResource(Border.BackgroundProperty, "Brush.SurfaceCard");outer.BindResource(Border.BorderBrushProperty, "Brush.BorderDefault");Content = outer;@@ -498,22 +500,24 @@ public sealed class BrowserView : UserControlif (_active < 0) return;bool empty = VisibleCount(_active) == 0;_emptyWrap.IsVisible = empty;- if (empty) _emptyText.Text = EmptyMessage(_active);+ if (empty) { var (line, detail) = EmptyMessage(_active); _emptyText.Text = line; ToolTip.SetTip(_emptyText, detail); }}- private string EmptyMessage(int tab)+ // Empty state (almanac § States): one line in Ink 5, centred, no illustration and no+ // call to action. The how-to that used to follow it lives in the tooltip.+ private (string Line, string Detail) EmptyMessage(int tab){bool searching = !string.IsNullOrEmpty(_search.Text?.Trim());bool filtering = tab is 0 or 1 or 2 && _vm is not null && _vm.FilterMode != BrowserFilter.None;- if (searching || filtering) return "No matches — try a different search or clear the filters.";+ if (searching || filtering) return ("No matches", "Try a different search or clear the filters.");return tab switch{- 0 => "Instruments live here — Nota's built-in synths plus your VST/AU plug-ins.\n\nScan your plug-ins in Settings ▸ Plug-ins to add more.",- 1 => "Audio effects live here — Nota's built-in effects plus your VST/AU plug-ins.\n\nScan your plug-ins in Settings ▸ Plug-ins to add more.",- 2 => "MIDI effects live here — arpeggiator, chord, scale and more.\n\nThey process notes before an instrument; drop one to the left of an instrument in a track.",- 3 => "No samples yet.\n\nAdd audio files to your Samples folder (set it in Settings ▸ Folders), then browse them here as a folder tree. You can also drag files in from Finder.",- 4 => "No presets yet.\n\nSave a preset from any instrument or effect (the Save button on the device), and it appears here grouped by category and device.",- _ => "No projects yet.\n\nSave a project (⌘S) into your Projects folder (set it in Settings ▸ Folders) and it shows up here.",+ 0 => ("No instruments yet", "Nota's built-in synths plus your VST/AU plug-ins. Scan your plug-ins in Settings → Plug-ins to add more."),+ 1 => ("No audio effects yet", "Nota's built-in effects plus your VST/AU plug-ins. Scan your plug-ins in Settings → Plug-ins to add more."),+ 2 => ("No MIDI effects yet", "Arpeggiator, chord, scale and more — they process notes before an instrument; drop one to the left of an instrument in a track."),+ 3 => ("No samples yet", "Add audio files to your Samples folder (Settings → Folders), then browse them here as a folder tree. You can also drag files in from Finder."),+ 4 => ("No presets yet", "Right-click a device header and choose Save preset; it appears here grouped by category and device."),+ _ => ("No projects yet", "Save a project (⌘S) into your Projects folder (Settings → Folders) and it shows up here."),};}@@ -824,7 +828,7 @@ public sealed class BrowserView : UserControl// A tag colour comes from the library, not the palette — Ink() re-tints it for the// active theme instead of painting a graphite-tuned hue onto paper.try { return NotaPalette.Ink(hex); }- catch { return Brushes.Gray; }+ catch { return NotaPalette.TextTertiary; }}// --- view options ---------------------------------------------------------@@ -838,14 +842,14 @@ public sealed class BrowserView : UserControl{Width = 26, Height = 26,Margin = new Thickness(6, 0, 0, 0),- CornerRadius = new CornerRadius(5),+ CornerRadius = NotaRadius.Tile,BorderThickness = new Thickness(1),Cursor = new Cursor(StandardCursorType.Hand),Child = icon,};btn.BindResource(Border.BackgroundProperty, "Brush.BgSunken");btn.BindResource(Border.BorderBrushProperty, "Brush.BorderDefault");- ToolTip.SetTip(btn, "Sort & view options");+ ToolTip.SetTip(btn, "Sort and view");btn.PointerPressed += (_, e) => { ShowOptionsMenu(btn); e.Handled = true; };return btn;}@@ -883,7 +887,7 @@ public sealed class BrowserView : UserControl// its width in blanks) so the two menus read alike.private static MenuItem CheckItem(string label, bool on, Action<bool> set){- var mi = new MenuItem { Header = (on ? "✓ " : " ") + label };+ var mi = new MenuItem { Header = label, ToggleType = MenuItemToggleType.CheckBox, IsChecked = on };mi.Click += (_, _) => set(!on);return mi;}@@ -901,10 +905,11 @@ public sealed class BrowserView : UserControlsub.BindResource(TextBlock.ForegroundProperty, "Brush.TextTertiary");var infoRow = new StackPanel { Orientation = Orientation.Horizontal, Margin = new Thickness(0, 0, 0, 6), Children = { name, sub } };- // Row 2: solid brass play button + waveform strip.+ // Row 2: play button + waveform strip.playIcon = new Path { Data = Geometry.Parse(IconPlay), Stretch = Stretch.Uniform, Width = 10, Height = 10, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };- playIcon.BindResource(Shape.FillProperty, "Brush.TextOnAccent");- playBtn = new Button { Content = playIcon, Classes = { "primary" }, Width = 26, Height = 26, Padding = new Thickness(0), IsEnabled = false, VerticalAlignment = VerticalAlignment.Center };+ // A raised button with a brass glyph: the transport's Play is the main window's one solid brass action.+ playIcon.BindResource(Shape.FillProperty, "Brush.AccentBright");+ playBtn = new Button { Content = playIcon, Width = 26, Height = 26, Padding = new Thickness(0), IsEnabled = false, VerticalAlignment = VerticalAlignment.Center };var pb = playBtn;pb.Click += (_, _) => { if (_footerItem is { } it && it.Kind == BrowserItemKind.Sample) PreviewRequested?.Invoke(it); };wave = new PreviewWaveform { Height = 30, Margin = new Thickness(8, 0, 0, 0), VerticalAlignment = VerticalAlignment.Center };@@ -916,13 +921,13 @@ public sealed class BrowserView : UserControl// Row 3: Auto-audition chip + preview volume bar (decorative — not wired).auto = new ToggleButton { Content = "Auto-audition", FontSize = 9, Padding = new Thickness(6, 0), Height = 18, VerticalAlignment = VerticalAlignment.Center };- ToolTip.SetTip(auto, "Auto-audition the selected sample on selection");- var volFillOuter = new Border { Width = 50, Height = 3, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center };+ ToolTip.SetTip(auto, "Audition a sample when it is selected");+ var volFillOuter = new Border { Width = 50, Height = 3, CornerRadius = NotaRadius.Clip, VerticalAlignment = VerticalAlignment.Center };volFillOuter.BindResource(Border.BackgroundProperty, "Brush.BgSunken");- var volFill = new Border { Width = 32, Height = 3, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left };+ var volFill = new Border { Width = 32, Height = 3, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left };volFill.BindResource(Border.BackgroundProperty, "Brush.BorderStrong");volFillOuter.Child = volFill;- ToolTip.SetTip(volFillOuter, "Preview volume — not wired yet");+ ToolTip.SetTip(volFillOuter, "Set the preview volume (not available yet)");var row3 = new StackPanel{Orientation = Orientation.Horizontal, Spacing = 6, Margin = new Thickness(0, 6, 0, 0),@@ -935,7 +940,7 @@ public sealed class BrowserView : UserControlPadding = new Thickness(10, 8),Child = new StackPanel { Children = { infoRow, playRow, row3 } },};- footer.BindResource(Border.BackgroundProperty, "Brush.BgApp");+ footer.BindResource(Border.BackgroundProperty, "Brush.Panel");footer.BindResource(Border.BorderBrushProperty, "Brush.BorderDefault");return footer;}@@ -1041,7 +1046,7 @@ public sealed class BrowserView : UserControl{_chipsPanel.ClearChips(); // the "+N" is a permanent child, not one of the chipsif (_vm is null) return;- _chipsPanel.Children.Add(MakeChip("★ Favorites", null,+ _chipsPanel.Children.Add(MakeChip("Favorites", null,_vm.FilterMode == BrowserFilter.Favorites, () => ToggleFilter(BrowserFilter.Favorites, "")));foreach (var t in _vm.Tags){@@ -1060,7 +1065,7 @@ public sealed class BrowserView : UserControlforeach (var item in _chipsPanel.Hidden){var chip = item;- var mi = new MenuItem { Header = (chip.Active ? "✓ " : " ") + chip.Label };+ var mi = new MenuItem { Header = chip.Label, ToggleType = MenuItemToggleType.CheckBox, IsChecked = chip.Active };if (chip.ColorHex is not null)mi.Icon = new Ellipse { Width = 10, Height = 10, Fill = BrushFromHex(chip.ColorHex) };mi.Click += (_, _) => chip.OnClick();@@ -1078,25 +1083,32 @@ public sealed class BrowserView : UserControlRefreshCounts();}+ // A filter chip (almanac § Controls): 20 tall, pill, 9px sides, one line. A dot carries+ // the category colour in place of an icon. Engaged is a brass edge and brass text on the+ // brass wash — solid brass belongs to the one primary action in a context, not a filter.private ChipBorder MakeChip(string text, string? colorHex, bool active, Action onClick){var content = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center };if (colorHex is not null)- content.Children.Add(new Ellipse { Width = 7, Height = 7, VerticalAlignment = VerticalAlignment.Center, Fill = BrushFromHex(colorHex) });- var tb = new TextBlock { Text = text, FontSize = 10, VerticalAlignment = VerticalAlignment.Center };- tb.BindResource(TextBlock.ForegroundProperty, active ? "Brush.TextOnAccent" : "Brush.TextSecondary");+ content.Children.Add(new Ellipse { Width = 6, Height = 6, VerticalAlignment = VerticalAlignment.Center, Fill = BrushFromHex(colorHex) });+ var tb = new TextBlock { Text = text, FontSize = 11, VerticalAlignment = VerticalAlignment.Center };+ tb.BindResource(TextBlock.ForegroundProperty, active ? "Brush.AccentHover" : "Brush.TextStrong");content.Children.Add(tb);var chip = new ChipBorder{Label = text, ColorHex = colorHex, Active = active, OnClick = onClick,- Height = 20, CornerRadius = new CornerRadius(10), Padding = new Thickness(8, 0),+ Height = NotaSize.Chip, CornerRadius = NotaRadius.Pill, Padding = new Thickness(9, 0),BorderThickness = new Thickness(1),Cursor = new Cursor(StandardCursorType.Hand), Child = content,};- chip.BindResource(Border.BackgroundProperty, active ? "Brush.Accent" : "Brush.BgSunken");- chip.BindResource(Border.BorderBrushProperty, active ? "Brush.Accent" : "Brush.BorderDefault");- chip.PointerPressed += (_, e) => { onClick(); e.Handled = true; };+ chip.BindResource(Border.BackgroundProperty, active ? "Brush.AccentSubtle" : "Brush.SurfaceRaised");+ chip.BindResource(Border.BorderBrushProperty, active ? "Brush.BorderBrass" : "Brush.BorderDefault");+ chip.PointerPressed += (_, e) =>+ {+ if (!e.GetCurrentPoint(chip).Properties.IsLeftButtonPressed) return;+ onClick(); e.Handled = true;+ };return chip;}@@ -1234,7 +1246,7 @@ public sealed class BrowserView : UserControlbool assigned = _vm.IsTagAssigned(item, tag.Id);var mi = new MenuItem{- Header = (assigned ? "✓ " : " ") + tag.Title,+ Header = tag.Title, ToggleType = MenuItemToggleType.CheckBox, IsChecked = assigned,Icon = new Ellipse { Width = 10, Height = 10, Fill = BrushFromHex(tag.Color) },};mi.Click += (_, _) => _vm.AssignTag(item, tag.Id, !assigned);diff --git a/src/managed/Nota.App/ClipEditorView.cs b/src/managed/Nota.App/ClipEditorView.csindex 4d895d3f..090eb7f5 100644--- a/src/managed/Nota.App/ClipEditorView.cs+++ b/src/managed/Nota.App/ClipEditorView.cs@@ -107,9 +107,9 @@ public sealed class ClipEditorView : UserControl_envTab = Tab("Envelopes");_envTab.PointerPressed += (_, _) => ShowTab(true);_envTab.IsEnabled = _envPanel is not null;- _envTab.Opacity = _envPanel is not null ? 1 : 0.5;PaintTab(_notesTab, true);PaintTab(_envTab, false);+ Inactive.Set(_envTab, _envPanel is null);var tabs = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = { _notesTab, _envTab } };_toolsChip = Chip();SetChip(_toolsChip, "Tools", false);@@ -134,8 +134,8 @@ public sealed class ClipEditorView : UserControlprivate Control ScaleControls(){_scaleToggle = Chip();- _keyChip = Chip();- _scaleChip = Chip();+ _keyChip = Chip(dropdown: true);+ _scaleChip = Chip(dropdown: true);_scaleToggle.PointerPressed += (_, e) => { e.Handled = true; Roll.SetScale(!Roll.ScaleOn, Roll.ScaleRoot, Roll.ScaleIndex); UpdateScaleChips(); };_keyChip.PointerPressed += (_, e) => { e.Handled = true; ShowMenu(_keyChip, PianoRollView.KeyNames, Roll.ScaleRoot, i => { Roll.SetScale(true, i, Roll.ScaleIndex); UpdateScaleChips(); }); };_scaleChip.PointerPressed += (_, e) => { e.Handled = true; ShowMenu(_scaleChip, PianoRollView.ScaleNames, Roll.ScaleIndex, i => { Roll.SetScale(true, Roll.ScaleRoot, i); UpdateScaleChips(); }); };@@ -155,23 +155,27 @@ public sealed class ClipEditorView : UserControl{bool on = Roll.ScaleOn;SetChip(_scaleToggle, on ? "On" : "Off", on);- SetChip(_keyChip, PianoRollView.KeyNames[Roll.ScaleRoot] + " ▾", on);- SetChip(_scaleChip, PianoRollView.ScaleNames[Roll.ScaleIndex] + " ▾", on);- _keyChip.Opacity = on ? 1 : 0.5;- _scaleChip.Opacity = on ? 1 : 0.5;+ SetChip(_keyChip, PianoRollView.KeyNames[Roll.ScaleRoot], on);+ SetChip(_scaleChip, PianoRollView.ScaleNames[Roll.ScaleIndex], on);+ Inactive.Set(_keyChip, !on, interactive: true);+ Inactive.Set(_scaleChip, !on, interactive: true);}- private static Border Chip() => new()+ private static Border Chip(bool dropdown = false){- Height = 22, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5),- Background = NotaPalette.SurfaceRaised, BorderBrush = NotaPalette.BorderStrong,- Padding = new Thickness(9, 0), VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand),- Child = new TextBlock { FontSize = 10, VerticalAlignment = VerticalAlignment.Center, Foreground = TextSecondary },- };+ var tb = new TextBlock { FontSize = 10, VerticalAlignment = VerticalAlignment.Center, Foreground = TextSecondary };+ return new Border+ {+ Height = 22, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile,+ Background = NotaPalette.SurfaceRaised, BorderBrush = NotaPalette.BorderStrong,+ Padding = new Thickness(9, 0), VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand),+ Child = dropdown ? Glyph.WithChevron(tb) : tb,+ };+ }private static void SetChip(Border chip, string text, bool active){- var tb = (TextBlock)chip.Child!;+ var tb = chip.Child as TextBlock ?? (TextBlock)((StackPanel)chip.Child!).Children[0];tb.Text = text;tb.Foreground = active ? AccentBright : TextSecondary;chip.Background = active ? AccentSubtle : NotaPalette.SurfaceRaised;@@ -194,7 +198,7 @@ public sealed class ClipEditorView : UserControlprivate static Border Tab(string text) => new(){- Height = 22, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5),+ Height = 22, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile,Padding = new Thickness(10, 0), VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = text, FontSize = 11, VerticalAlignment = VerticalAlignment.Center },};@@ -212,13 +216,13 @@ public sealed class ClipEditorView : UserControl{_engine = engine; _trackId = trackId; _clipIndex = clipIndex;_canvas = new EnvCanvas(lengthBeats) { Committed = OnCommitted };- _targetText = new TextBlock { Text = "Velocity ▾", FontSize = 10, Foreground = AccentBright, VerticalAlignment = VerticalAlignment.Center };+ _targetText = new TextBlock { Text = "Velocity", FontSize = 10, Foreground = AccentBright, VerticalAlignment = VerticalAlignment.Center };var chip = new Border{Height = 22, Background = NotaPalette.SurfaceRaised, BorderBrush = NotaPalette.BorderStrong,- BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(10, 0),- Cursor = new Cursor(StandardCursorType.Hand), Child = _targetText,+ BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Padding = new Thickness(10, 0),+ Cursor = new Cursor(StandardCursorType.Hand), Child = Glyph.WithChevron(_targetText),};chip.PointerPressed += (_, e) => { e.Handled = true; CycleTarget(); };var hint = new TextBlock { Text = "click to add · drag to move · right-click to delete", FontSize = 9, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(10, 0, 0, 0) };@@ -240,7 +244,7 @@ public sealed class ClipEditorView : UserControlprivate void CycleTarget(){_target = _target == MidiClipEnvelope.Velocity ? MidiClipEnvelope.Volume : MidiClipEnvelope.Velocity;- _targetText.Text = (_target == MidiClipEnvelope.Volume ? "Volume" : "Velocity") + " ▾";+ _targetText.Text = _target == MidiClipEnvelope.Volume ? "Volume" : "Velocity";Load();}diff --git a/src/managed/Nota.App/ClipPropsView.cs b/src/managed/Nota.App/ClipPropsView.csindex bf048519..6e0729dc 100644--- a/src/managed/Nota.App/ClipPropsView.cs+++ b/src/managed/Nota.App/ClipPropsView.cs@@ -62,8 +62,8 @@ public sealed class ClipPropsView : UserControl_loopText = Mono($"{roll.LengthBeats:0.#}b");_loopText.Foreground = AccentBright;_selInfo = new TextBlock { Text = roll.SelectionInfo, FontSize = 9, Foreground = TextTertiary, TextWrapping = TextWrapping.Wrap };- _transposeText = Mono("0 st");- _gridText = new TextBlock { Text = GridLabels[_gridIndex] + " ▾", FontSize = 10, Foreground = TextPrimary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };+ _transposeText = Mono("0\u2009st");+ _gridText = new TextBlock { Text = GridLabels[_gridIndex], FontSize = 10, Foreground = TextPrimary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };var body = new StackPanel { Spacing = 10, Margin = new Thickness(10) };body.Children.Add(Section("CLIP", ReadoutBox(clipName, TextPrimary, 24, 11, false)));@@ -80,7 +80,7 @@ public sealed class ClipPropsView : UserControl// Loop chip (clips loop by default in this model).body.Children.Add(new Border{- Height = 26, Background = AccentSubtle, BorderBrush = Brass, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5),+ Height = 26, Background = AccentSubtle, BorderBrush = Brass, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile,Child = new StackPanel{Orientation = Orientation.Horizontal, Spacing = 6, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,@@ -89,7 +89,7 @@ public sealed class ClipPropsView : UserControl});// Grid + quantize.- var gridChip = Chip(_gridText);+ var gridChip = Chip(Glyph.WithChevron(_gridText));gridChip.PointerPressed += (_, e) =>{e.Handled = true;@@ -102,7 +102,7 @@ public sealed class ClipPropsView : UserControlmi.Click += (_, _) =>{_gridIndex = idx;- _gridText.Text = GridLabels[idx] + " ▾";+ _gridText.Text = GridLabels[idx];_roll.Grid = GridValues[idx];};f.Items.Add(mi);@@ -117,7 +117,7 @@ public sealed class ClipPropsView : UserControlvar strengthVal = Mono("80%"); strengthVal.Foreground = TextSecondary;var strengthBar = new MiniFader(_strength, 1.0) { VerticalAlignment = VerticalAlignment.Center };- strengthBar.ValueChanged += v => { _strength = v; strengthVal.Text = $"{v * 100:0}%"; };+ strengthBar.ValueChanged += v => { _strength = v; strengthVal.Text = $"{v * 100:0}\u2009%"; };var strengthRow = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), Margin = new Thickness(0, 2, 0, 0) };strengthRow.Children.Add(new TextBlock { Text = "STRENGTH", FontSize = 9, Foreground = TextTertiary, Width = 52, VerticalAlignment = VerticalAlignment.Center });Grid.SetColumn(strengthBar, 1); strengthRow.Children.Add(strengthBar);@@ -163,7 +163,7 @@ public sealed class ClipPropsView : UserControlprivate void Transpose(int d){_transpose += d;- _transposeText.Text = $"{_transpose} st";+ _transposeText.Text = $"{_transpose}\u2009st";_roll.TransposeBy(d);}@@ -194,7 +194,7 @@ public sealed class ClipPropsView : UserControlprivate static Border FieldBox(double h) => new(){- Height = h, Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5),+ Height = h, Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile,};private static Border ReadoutBox(string text, IBrush fg, double h, double fs, bool mono)@@ -208,7 +208,7 @@ public sealed class ClipPropsView : UserControlprivate static Border Chip(Control child) => new(){- Height = 22, Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5),+ Height = 22, Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile,Cursor = new Cursor(StandardCursorType.Hand), Child = child,};@@ -216,7 +216,7 @@ public sealed class ClipPropsView : UserControl{var b = new Border{- Width = 22, Height = 22, Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5),+ Width = 22, Height = 22, Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile,Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = glyph, FontSize = 11, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center },};@@ -228,13 +228,13 @@ public sealed class ClipPropsView : UserControlprivate static string Position(double beat){int bar = (int)(beat / 4) + 1, be = (int)(beat % 4) + 1, six = (int)Math.Round(beat % 1 * 4) + 1;- return string.Format(CultureInfo.InvariantCulture, "{0}. {1}. {2}", bar, be, six);+ return string.Format(NotaNum.Culture, "{0}. {1}. {2}", bar, be, six);}// bars.beats.16ths as a duration (0-based).private static string Duration(double beats){int bars = (int)(beats / 4), be = (int)(beats % 4), six = (int)Math.Round(beats % 1 * 4);- return string.Format(CultureInfo.InvariantCulture, "{0}. {1}. {2}", bars, be, six);+ return string.Format(NotaNum.Culture, "{0}. {1}. {2}", bars, be, six);}}diff --git a/src/managed/Nota.App/Controls/AmpCurve.cs b/src/managed/Nota.App/Controls/AmpCurve.csindex 38781587..40fd1982 100644--- a/src/managed/Nota.App/Controls/AmpCurve.cs+++ b/src/managed/Nota.App/Controls/AmpCurve.cs@@ -20,8 +20,8 @@ internal sealed class AmpCurve : Controlprivate static readonly IBrush BorderDef = NotaPalette.BorderDefault;private static readonly IBrush AccentBright = NotaPalette.AccentBright;private static readonly IBrush TextTertiary = NotaPalette.TextTertiary;- private static readonly IBrush Grid = NotaPalette.Wash(NotaPalette.BorderStrong, 0x50);- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush Grid = NotaGraph.Grid;+ private static readonly Typeface Face = NotaFonts.Mono;private float _drive = 1f, _bias;private int _stages = 1;@@ -44,7 +44,7 @@ internal sealed class AmpCurve : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 4, 4);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double pad = 7, x0 = pad, x1 = w - pad, top = pad + 10, bot = h - pad - 9;var gridPen = new Pen(Grid, 1);@@ -82,8 +82,8 @@ internal sealed class AmpCurve : Control}// input-drive axis (−40 dB … 0 dB).var axisB = NotaPalette.TextDisabled;- ctx.DrawText(new FormattedText("in −40 dB", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 7, axisB), new Point(x0, bot + 2));- var zt = new FormattedText("0 dB", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 7, axisB);+ ctx.DrawText(new FormattedText("in −40\u2009dB", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 7, axisB), new Point(x0, bot + 2));+ var zt = new FormattedText("0\u2009dB", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 7, axisB);ctx.DrawText(zt, new Point(x1 - zt.Width, bot + 2));}}diff --git a/src/managed/Nota.App/Controls/AmpHarmonics.cs b/src/managed/Nota.App/Controls/AmpHarmonics.csindex cadca1fa..078cbc51 100644--- a/src/managed/Nota.App/Controls/AmpHarmonics.cs+++ b/src/managed/Nota.App/Controls/AmpHarmonics.cs@@ -20,7 +20,7 @@ internal sealed class AmpHarmonics : Controlprivate static Color Amber => NotaPalette.Accent.Color;private static readonly IBrush Muted = NotaPalette.TextTertiary;private static readonly IBrush Sub = NotaPalette.TextSecondary;- private static readonly Typeface Mono = new(new FontFamily("Geist Mono, monospace"));+ private static readonly Typeface Mono = NotaFonts.Mono;private float _drive = 1, _bias;private int _stages = 1;@@ -66,10 +66,10 @@ internal sealed class AmpHarmonics : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Well, new Pen(BorderIn, 1), new Rect(0, 0, w, h), 5, 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double padX = 8, top = 13, bot = h - 11;- ctx.DrawText(new FormattedText("HARMONICS", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, new Typeface(FontFamily.Default, FontStyle.Normal, FontWeight.Bold), 8, Muted), new Point(padX, 2));- var thd = new FormattedText($"THD {_thd * 100:0.0} %", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, Sub);+ ctx.DrawText(new FormattedText("HARMONICS", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, NotaFonts.SansBold, 8, Muted), new Point(padX, 2));+ var thd = new FormattedText($"THD {_thd * 100:0}\u2009%", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, Sub);ctx.DrawText(thd, new Point(w - padX - thd.Width, 2));// Bars for harmonics 2..7, normalised to the fundamental.@@ -80,7 +80,7 @@ internal sealed class AmpHarmonics : Controldouble rel = Math.Clamp(_h[i + 1] / f, 0, 1);double bh = Math.Max(1, rel * (bot - top));double cx = padX + i * bw + bw / 2;- ctx.DrawRectangle(new SolidColorBrush(Amber, 0.4 + 0.6 * rel), null, new Rect(cx - 4, bot - bh, 8, bh), 1, 1);+ ctx.DrawRectangle(NotaPalette.Accent, null, new Rect(cx - 4, bot - bh, 8, bh), NotaRadius.BarValue, NotaRadius.BarValue); // height is the magnitude; no opacity rampvar lbl = new FormattedText((i + 2).ToString(), CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 7, Muted);ctx.DrawText(lbl, new Point(cx - lbl.Width / 2, bot + 1));}diff --git a/src/managed/Nota.App/Controls/AmpToneCurve.cs b/src/managed/Nota.App/Controls/AmpToneCurve.csindex eb96ea88..89d69fa3 100644--- a/src/managed/Nota.App/Controls/AmpToneCurve.cs+++ b/src/managed/Nota.App/Controls/AmpToneCurve.cs@@ -18,10 +18,10 @@ internal sealed class AmpToneCurve : Controlprivate static readonly IBrush Well = NotaPalette.BgSunken;private static readonly IBrush BorderIn = NotaPalette.GraphBorder;private static readonly IBrush Amber = NotaPalette.Accent;- private static readonly IBrush Grid = NotaPalette.SurfaceCard;+ private static readonly IBrush Grid = NotaGraph.Grid;private static readonly IBrush Ref = NotaPalette.SurfaceRaised;- private static readonly IBrush Axis = NotaPalette.TextDisabled;- private static readonly Typeface Mono = new(new FontFamily("Geist Mono, monospace"));+ private static readonly IBrush Axis = NotaPalette.TextAxis;+ private static readonly Typeface Mono = NotaFonts.Mono;private double _bass, _mid, _treb, _pres; // dBprivate const double Sr = 44100, FLo = 40, FHi = 12000, DbSpan = 15;@@ -47,7 +47,7 @@ internal sealed class AmpToneCurve : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Well, new Pen(BorderIn, 1), new Rect(0, 0, w, h), 5, 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double padB = 10, bot = h - padB, top = 3;double Y(double db) => top + (bot - top) * (0.5 - Math.Clamp(db / DbSpan, -1, 1) * 0.5);double X(double f) => w * (Math.Log(f / FLo) / Math.Log(FHi / FLo));@@ -72,7 +72,7 @@ internal sealed class AmpToneCurve : Control}g.EndFigure(false);}- ctx.DrawGeometry(null, new Pen(Amber, 1.6, lineJoin: PenLineJoin.Round), geo);+ ctx.DrawGeometry(null, new Pen(Amber, NotaGraph.PrimaryWidth, lineJoin: PenLineJoin.Round), geo);}// --- RBJ biquad coefficients + magnitude (mirrors Amp.h) ---diff --git a/src/managed/Nota.App/Controls/ArpGrid.cs b/src/managed/Nota.App/Controls/ArpGrid.csindex 3e5dad9c..14713613 100644--- a/src/managed/Nota.App/Controls/ArpGrid.cs+++ b/src/managed/Nota.App/Controls/ArpGrid.cs@@ -27,7 +27,7 @@ internal sealed class ArpGrid : Controlprivate static readonly IBrush Muted = NotaPalette.TextTertiary;private static readonly IBrush Txt = NotaPalette.TextSecondary;private static readonly IBrush AccentBright = NotaPalette.AccentBright;- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly Typeface Face = NotaFonts.Mono;private const int Vel = 13, Ratchet = 61, On = 93, Loop = 11, kSteps = 16, NumH = 15;private readonly IAudioEngine _e; private readonly int _t, _mi;@@ -78,7 +78,7 @@ internal sealed class ArpGrid : Controlpublic override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height; if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Bg, null, new Rect(0, 0, w, h), 4, 4);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double cw = w / kSteps, barH = BarH(), numY = h - NumH + 2;int loop = LoopLen();double zero = _min < 0 ? barH * (_max / (_max - _min)) : barH; // baseline for signed lanes@@ -100,7 +100,8 @@ internal sealed class ArpGrid : Control{double v = Get(_base + s), norm = (v - _min) / (_max - _min);byte a = (byte)(active ? (_vel ? 70 + norm * 175 : 210) : 70);- var brush = new SolidColorBrush(Color.FromArgb(a, 0xD8, 0xA0, 0x3D));+ var ac = NotaPalette.Accent.Color; // the live accent, so the light variant gets bronze+ var brush = new SolidColorBrush(Color.FromArgb(a, ac.R, ac.G, ac.B));if (_min < 0){double top = barH - norm * barH, y0 = Math.Min(top, zero), y1 = Math.Max(top, zero);diff --git a/src/managed/Nota.App/Controls/AuroraStack.cs b/src/managed/Nota.App/Controls/AuroraStack.csindex 094bbeca..41556674 100644--- a/src/managed/Nota.App/Controls/AuroraStack.cs+++ b/src/managed/Nota.App/Controls/AuroraStack.cs@@ -54,7 +54,7 @@ internal sealed class AuroraStack : Controlpublic override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height; if (w <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 5, 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));int active = Math.Clamp((int)Math.Round(_pos * (Frames - 1)), 0, Frames - 1);// Skewed stack sized so every frame (centre ± amplitude) stays inside the bounds:diff --git a/src/managed/Nota.App/Controls/AuroraViz.cs b/src/managed/Nota.App/Controls/AuroraViz.csindex 7f57f88f..3c5e5822 100644--- a/src/managed/Nota.App/Controls/AuroraViz.cs+++ b/src/managed/Nota.App/Controls/AuroraViz.cs@@ -21,8 +21,8 @@ namespace Nota.App;private static readonly IBrush TextTertiary = NotaPalette.TextTertiary;private static readonly IBrush TextSecondary = NotaPalette.TextSecondary;public enum K { Wave, Filter }- private static readonly IBrush Grid = NotaPalette.Wash(NotaPalette.BorderStrong, 0x50);- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush Grid = NotaGraph.Grid;+ private static readonly Typeface Face = NotaFonts.Mono;private readonly K _k;private int _bank;private double _pos, _warp, _cut, _res;@@ -71,7 +71,7 @@ namespace Nota.App;{double w = Bounds.Width, h = Bounds.Height;if (w <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 4, 4);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double pad = 6, x0 = pad, x1 = w - pad, top = pad + 11, bot = h - pad - 9;if (_k == K.Wave)@@ -108,7 +108,7 @@ namespace Nota.App;gc.LineTo(new Point(x0 + span * j / (samples - 1), mid - cur[j] * amp));}ctx.DrawGeometry(null, pen, fig);- Label(ctx, $"pos {(int)Math.Round(_pos * 100)}%", x0, bot + 1, TextSecondary);+ Label(ctx, $"pos {(int)Math.Round(_pos * 100)}\u2009%", x0, bot + 1, TextSecondary);}else{diff --git a/src/managed/Nota.App/Controls/AutoFilterCurve.cs b/src/managed/Nota.App/Controls/AutoFilterCurve.csindex b98ec09c..5ff30d33 100644--- a/src/managed/Nota.App/Controls/AutoFilterCurve.cs+++ b/src/managed/Nota.App/Controls/AutoFilterCurve.cs@@ -23,7 +23,7 @@ internal sealed class AutoFilterCurve : Control{private static readonly IBrush Bg = NotaPalette.BgSunken;private static readonly IBrush BorderB = NotaPalette.BorderDefault;- private static readonly IPen GridPen = new Pen(NotaPalette.Wash(NotaPalette.BorderStrong, 0x22));+ private static readonly IPen GridPen = NotaGraph.GridPen;private static readonly IPen CurvePen = new Pen(NotaPalette.Accent, 1.8); // solid brass = current responseprivate static readonly IBrush CurveFill = NotaPalette.Wash(NotaPalette.Accent, 0x18);private static readonly IBrush SpecFill = NotaPalette.Wash(NotaPalette.Ink("#8AA6C0"), 0x22);@@ -39,7 +39,7 @@ internal sealed class AutoFilterCurve : Control{ DashStyle = new DashStyle(new double[] { 3, 3 }, 0) };private static readonly IBrush AxisB = NotaPalette.TextTertiary;- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly Typeface Face = NotaFonts.Mono;private const double FMin = 30.0, FMax = 18000.0;private const double DbTop = 18.0, DbBot = -36.0;@@ -102,7 +102,7 @@ internal sealed class AutoFilterCurve : Controlvar n = _engine.DeviceScope(_track, _device, _scope, FftN);if (n < FftN){- for (var k = 1; k < Bins; k++) _specDb[k] = Math.Max(-120, _specDb[k] - 2.5);+ for (var k = 1; k < Bins; k++) _specDb[k] = -120;InvalidateVisual();return;}@@ -120,7 +120,7 @@ internal sealed class AutoFilterCurve : Control{var mag = Math.Sqrt(_re[k] * _re[k] + _im[k] * _im[k]);var db = 20 * Math.Log10(mag / refMag + 1e-9);- _specDb[k] = db > _specDb[k] ? db : Math.Max(db, _specDb[k] - 2.5);+ _specDb[k] = db; // no release ballistics: the spectrum shows this frame (almanac § no meter animation)}InvalidateVisual();@@ -191,7 +191,7 @@ internal sealed class AutoFilterCurve : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Bg, new Pen(BorderB), new Rect(0, 0, w, h), 5, 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double logMin = Math.Log10(FMin), logMax = Math.Log10(FMax), logSpan = logMax - logMin;@@ -226,7 +226,7 @@ internal sealed class AutoFilterCurve : Controlg.EndFigure(true);}- ctx.DrawGeometry(SpecFill, SpecPen, spec);+ ctx.DrawGeometry(null, SpecPen, spec);// --- teal sweep band: the range the modulation walks the cutoff over ---if (_sweepHi - _sweepLo > 0.004)@@ -256,13 +256,11 @@ internal sealed class AutoFilterCurve : Controlgc.LineTo(new Point(w, h));gc.EndFigure(true);}-- ctx.DrawGeometry(CurveFill, null, geo);for (var i = 1; i < n; i++) ctx.DrawLine(CurvePen, pts[i - 1], pts[i]);// handle at the base cutoff, sitting on the curve.double cx = _fcNorm * w, cy = YForDb(MagDb(baseFc, baseFc), h);- ctx.DrawEllipse(HandleB, new Pen(Bg, 2), new Point(cx, cy), 5, 5);+ NotaGraph.Node(ctx, new Point(cx, cy), active: true);// --- 3) dashed teal response at the live modulated cutoff (envelope + LFO) ---if (Math.Abs(_liveCut - _fcNorm) > 0.004)@@ -289,13 +287,17 @@ internal sealed class AutoFilterCurve : Control8, b), new Point(x, y));}- foreach (var (f, s) in new[] { (100.0, "100"), (1000.0, "1k"), (10000.0, "10k") })- Lbl(s, Math.Clamp(X(f) - 6, 2, w - 16), h - 11, AxisB);+ // The range, in the bottom corners only.+ NotaGraph.Axis(ctx, new Rect(0, 0, w, h), NotaGraph.Corner.BottomLeft, "30");+ NotaGraph.Axis(ctx, new Rect(0, 0, w, h), NotaGraph.Corner.BottomRight, "18k Hz");var hz = HzOf(_liveCut);- Lbl(hz >= 1000 ? $"{hz / 1000.0:0.00} kHz" : $"{hz:0} Hz", 4, 2, HandleB);- var leg = new FormattedText("┄ modulated", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 8,+ Lbl(hz >= 1000 ? $"{hz / 1000.0:0.0}\u2009k" : $"{hz:0}\u2009Hz", 4, 2, HandleB);+ // Legend inside the window: a dashed teal sample, then the word.+ var leg = new FormattedText("modulated", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 8,NotaPalette.Teal);- ctx.DrawText(leg, new Point(w - leg.Width - 4, 2));+ double lx = w - leg.Width - 4;+ ctx.DrawText(leg, new Point(lx, 2));+ ctx.DrawLine(new Pen(NotaPalette.Teal, 1.2, new DashStyle(new double[] { 2, 2 }, 0)), new Point(lx - 14, 2 + leg.Height / 2), new Point(lx - 4, 2 + leg.Height / 2));}// In-place iterative radix-2 Cooley–Tukey FFT.diff --git a/src/managed/Nota.App/Controls/AutoFilterIcons.cs b/src/managed/Nota.App/Controls/AutoFilterIcons.csindex 4d93d64c..3ae665b7 100644--- a/src/managed/Nota.App/Controls/AutoFilterIcons.cs+++ b/src/managed/Nota.App/Controls/AutoFilterIcons.cs@@ -95,25 +95,26 @@ internal sealed class EnvGlyph : Control}}-// A pill on/off switch (teal when on). Fires Changed with the new state.+// An on/off switch that owns its state and fires Changed — the same 18×10 brass pill as+// SwitchTrack (almanac § Controls), for call sites that want a self-toggling control.internal sealed class ToggleSwitch : Control{- private static readonly IBrush On = NotaPalette.Teal;- private static readonly IBrush OffBg = NotaPalette.SurfaceRaised;- private static readonly IBrush OffBorder = NotaPalette.BorderStrong;- private static readonly IBrush Dot = NotaPalette.BgSunken;- private static readonly IBrush DotOff = NotaPalette.TextTertiary;- private bool _on;+ private readonly SwitchTrack _track = new();public event Action<bool>? Changed;- public ToggleSwitch(bool on) { _on = on; Width = 22; Height = 12; Cursor = new Cursor(StandardCursorType.Hand); }- public bool IsOn { get => _on; set { _on = value; InvalidateVisual(); } }- protected override void OnPointerPressed(PointerPressedEventArgs e) { _on = !_on; Changed?.Invoke(_on); InvalidateVisual(); e.Handled = true; }- public override void Render(DrawingContext ctx)+ public ToggleSwitch(bool on){- double w = Bounds.Width, h = Bounds.Height;- ctx.DrawRectangle(_on ? On : OffBg, _on ? null : new Pen(OffBorder, 1), new Rect(0, 0, w, h), h / 2, h / 2);- double r = h / 2 - 2;- double cx = _on ? w - r - 2 : r + 2;- ctx.DrawEllipse(_on ? Dot : DotOff, null, new Point(cx, h / 2), r, r);+ _track.IsOn = on;+ Width = SwitchTrack.W; Height = SwitchTrack.H;+ Cursor = new Cursor(StandardCursorType.Hand);+ LogicalChildren.Add(_track); VisualChildren.Add(_track);+ }+ public bool IsOn { get => _track.IsOn; set => _track.IsOn = value; }+ protected override void OnPointerPressed(PointerPressedEventArgs e)+ {+ // Left button only — right-click bubbles to the CV-modulate / MIDI Learn menu.+ if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;+ _track.IsOn = !_track.IsOn; Changed?.Invoke(_track.IsOn); e.Handled = true;}+ protected override Size ArrangeOverride(Size finalSize) { _track.Arrange(new Rect(finalSize)); return finalSize; }+ protected override Size MeasureOverride(Size availableSize) { _track.Measure(availableSize); return new Size(SwitchTrack.W, SwitchTrack.H); }}diff --git a/src/managed/Nota.App/Controls/AutoGainViz.cs b/src/managed/Nota.App/Controls/AutoGainViz.csindex 0e4b1770..36a5e8f0 100644--- a/src/managed/Nota.App/Controls/AutoGainViz.cs+++ b/src/managed/Nota.App/Controls/AutoGainViz.cs@@ -24,7 +24,7 @@ internal sealed class AutoGainHistory : Controlprivate static readonly IBrush Bg = NotaPalette.BgSunken;private static readonly IBrush BorderB = NotaPalette.BorderDefault;- private static readonly IPen Grid = new Pen(NotaPalette.Wash(NotaPalette.SurfaceCard, 0x40), 1);+ private static readonly IPen Grid = NotaGraph.GridPen;private static readonly IBrush InFill = NotaPalette.Wash(NotaPalette.SignalInFill, 0x8C);private static readonly IPen InPen = new Pen(NotaPalette.Wash(NotaPalette.SignalIn, 0xB0), 1);private static readonly IPen OutPen = new Pen(NotaPalette.Accent, 1.8);@@ -33,7 +33,7 @@ internal sealed class AutoGainHistory : Controlprivate static readonly IBrush Correcting = NotaPalette.Ink("#C48A6A");private static readonly IBrush TealBright = NotaPalette.TealBright;private static readonly IBrush AxisB = NotaPalette.TextTertiary;- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly Typeface Face = NotaFonts.Mono;private readonly IAudioEngine _engine;private readonly int _track, _device;@@ -67,7 +67,7 @@ internal sealed class AutoGainHistory : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Bg, new Pen(BorderB, 1), new Rect(0, 0, w, h), 6, 6);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double gx = 6, gy = 14, gw = w - 12, gh = h - gy - 12;if (gw <= 0 || gh <= 0) return;@@ -86,7 +86,7 @@ internal sealed class AutoGainHistory : Controlfor (int i = 0; i < N; i++) g.LineTo(new Point(X(i), gy + Y(_in[Idx(i)], gh)));g.LineTo(new Point(gx + gw, gy + gh)); g.EndFigure(true);}- ctx.DrawGeometry(InFill, InPen, area);+ ctx.DrawGeometry(null, InPen, area);// target dashed teal (follows the reference when sidechained)Point tp = default; bool has = false;@@ -99,14 +99,13 @@ internal sealed class AutoGainHistory : Controlvoid Lbl(string s, double x, double y, IBrush b) => ctx.DrawText(new FormattedText(s, System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 8, b), new Point(x, y));Lbl("LOUDNESS", gx, 2, Muted);- Lbl("▩ input", gx + gw - 150, 2, NotaPalette.SignalIn);- Lbl("─ output", gx + gw - 96, 2, NotaPalette.Accent);- Lbl("┄ target", gx + gw - 44, 2, NotaPalette.Teal);+ NotaGraph.Legend(ctx, gx + gw - 2, 2, ("input", NotaPalette.SignalIn, NotaGraph.Mark.Area),+ ("output", NotaPalette.Accent, NotaGraph.Mark.Line), ("target", NotaPalette.Teal, NotaGraph.Mark.Dashed));if (_primed && Math.Abs(_desired - _applied) > 0.15f)- Lbl($"correcting {_desired:+0.0;-0.0;0.0} → {_applied:+0.0;-0.0;0.0} dB", gx + 2, gy + 1, Correcting);+ Lbl($"correcting {_desired:+0.0;−0.0;0.0} → {_applied:+0.0;−0.0;0.0}\u2009dB", gx + 2, gy + 1, Correcting);else if (_primed)Lbl(Math.Abs(_applied) < 0.05f ? "matched" : "locked", gx + gw - 44, gy + 1, TealBright);- Lbl("−8 s", gx, gy + gh + 1, AxisB);+ Lbl("−8\u2009s", gx, gy + gh + 1, AxisB);Lbl("now", gx + gw - 18, gy + gh + 1, AxisB);}}diff --git a/src/managed/Nota.App/Controls/AutoPanViz.cs b/src/managed/Nota.App/Controls/AutoPanViz.csindex e878b1ab..55391cc6 100644--- a/src/managed/Nota.App/Controls/AutoPanViz.cs+++ b/src/managed/Nota.App/Controls/AutoPanViz.cs@@ -22,8 +22,8 @@ internal sealed class AutoPanViz : Controlprivate static readonly IBrush AccentBright = NotaPalette.AccentBright;private static readonly IBrush Teal = NotaPalette.Teal;private static readonly IBrush TextTertiary = NotaPalette.TextTertiary;- private static readonly IBrush Grid = NotaPalette.Wash(NotaPalette.BorderStrong, 0x50);- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush Grid = NotaGraph.Grid;+ private static readonly Typeface Face = NotaFonts.Mono;private static readonly string[] WaveNames = { "SINE", "TRI", "SAW", "SQUARE", "S&H" };private int _wave;@@ -62,7 +62,7 @@ internal sealed class AutoPanViz : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 4, 4);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double pad = 7, x0 = pad, x1 = w - pad, top = pad + 11, bot = h - pad - 15;var gridPen = new Pen(Grid, 1);diff --git a/src/managed/Nota.App/Controls/AutoShiftViz.cs b/src/managed/Nota.App/Controls/AutoShiftViz.csindex f34b1d9d..84ca0d27 100644--- a/src/managed/Nota.App/Controls/AutoShiftViz.cs+++ b/src/managed/Nota.App/Controls/AutoShiftViz.cs@@ -23,13 +23,13 @@ internal sealed class AutoShiftViz : Controlprivate static readonly IBrush Teal = NotaPalette.Teal;private static readonly IBrush TealDim = NotaPalette.Wash(NotaPalette.Teal, 0x8C);private static readonly IBrush Muted = NotaPalette.TextTertiary;- private static readonly IBrush Faint = NotaPalette.TextDisabled;+ private static readonly IBrush Faint = NotaPalette.TextAxis;private static readonly IBrush LaneLine = NotaPalette.Wash(NotaPalette.BorderStrong, 0x2A);private static readonly IBrush WhiteLane = NotaPalette.Wash(NotaPalette.BorderStrong, 0x44);private static readonly IBrush TargetLine = NotaPalette.Wash(NotaPalette.AccentBright, 0x55);private static readonly IBrush TargetLabel = NotaPalette.AccentBright;- private static readonly Typeface Mono = new(new FontFamily("Geist Mono, monospace"));- private static readonly Typeface Bold = new(FontFamily.Default, FontStyle.Normal, FontWeight.Bold);+ private static readonly Typeface Mono = NotaFonts.Mono;+ private static readonly Typeface Bold = NotaFonts.SansBold;private static readonly string[] Names = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };private static bool IsWhite(int pc) => pc is 0 or 2 or 4 or 5 or 7 or 9 or 11;@@ -53,7 +53,7 @@ internal sealed class AutoShiftViz : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- g.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 6, 6);+ NotaGraph.Window(g, new Rect(0, 0, w, h));double pad = 6;double headY = pad + 1, plotTop = pad + 14, plotBot = h - pad - 11;@@ -61,10 +61,7 @@ internal sealed class AutoShiftViz : Control// Header + legend.g.DrawText(new FormattedText("PITCH TRACE", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Bold, 8, Muted), new Point(pad, headY));- var det = new FormattedText("┄ detected", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, Teal);- var cor = new FormattedText("— corrected", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, Brass);- g.DrawText(cor, new Point(x1 - cor.Width, headY));- g.DrawText(det, new Point(x1 - cor.Width - det.Width - 8, headY));+ NotaGraph.Legend(g, x1, headY, ("detected", Teal, NotaGraph.Mark.Dashed), ("corrected", Brass, NotaGraph.Mark.Line));// One-octave window centred on the (smoothed) corrected pitch.int lowMidi = (int)Math.Round(_center) - 6;@@ -100,7 +97,7 @@ internal sealed class AutoShiftViz : Controlfloat dv = _det[k];if (dv > 1e-4f) g.DrawEllipse(TealDim, null, new Point(X(k), Y(dv * 127.0)), 1.4, 1.4);}- var pen = new Pen(Brass, 1.6, lineCap: PenLineCap.Round, lineJoin: PenLineJoin.Round);+ var pen = new Pen(Brass, NotaGraph.PrimaryWidth, lineCap: PenLineCap.Round, lineJoin: PenLineJoin.Round);StreamGeometry? geo = null; StreamGeometryContext? gc = null; bool open = false;void Flush() { if (gc != null) { gc.Dispose(); g.DrawGeometry(null, pen, geo!); gc = null; geo = null; } open = false; }for (int k = 0; k < n; k++)@@ -115,7 +112,7 @@ internal sealed class AutoShiftViz : ControlFlush();// Time axis.- g.DrawText(new FormattedText("−2 s", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, Faint), new Point(x0, plotBot + 2));+ g.DrawText(new FormattedText("−2\u2009s", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, Faint), new Point(x0, plotBot + 2));if (targetNote != int.MinValue){int pc = ((targetNote % 12) + 12) % 12;diff --git a/src/managed/Nota.App/Controls/BeatRepeatViz.cs b/src/managed/Nota.App/Controls/BeatRepeatViz.csindex c4b84605..d03d455d 100644--- a/src/managed/Nota.App/Controls/BeatRepeatViz.cs+++ b/src/managed/Nota.App/Controls/BeatRepeatViz.cs@@ -21,13 +21,13 @@ internal sealed class BeatRepeatViz : Controlprivate static readonly IBrush Well = NotaPalette.SurfaceInset;private static readonly IBrush WellBd = NotaPalette.Wash(NotaPalette.BorderStrong, 0x40);private static readonly IBrush Muted = NotaPalette.TextTertiary;- private static readonly IBrush Faint = NotaPalette.TextDisabled;+ private static readonly IBrush Faint = NotaPalette.TextAxis;private static readonly IBrush AmberLit = NotaPalette.AccentBright;private static readonly IBrush Sub = NotaPalette.TextSecondary;- private static readonly IBrush BarLine = NotaPalette.TextDisabled;+ private static readonly IBrush BarLine = NotaPalette.TextAxis;private static Color Brass => NotaPalette.Accent.Color;- private static readonly Typeface Mono = new(new FontFamily("Geist Mono, monospace"));- private static readonly Typeface Bold = new(FontFamily.Default, FontStyle.Normal, FontWeight.Bold);+ private static readonly Typeface Mono = NotaFonts.Mono;+ private static readonly Typeface Bold = NotaFonts.SansBold;private float[] _slots = Array.Empty<float>();private int _n;@@ -44,7 +44,7 @@ internal sealed class BeatRepeatViz : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- g.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 6, 6);+ NotaGraph.Window(g, new Rect(0, 0, w, h));double pad = 6;double headY = pad, x0 = pad, x1 = w - pad;@@ -57,7 +57,7 @@ internal sealed class BeatRepeatViz : Controldouble bars = _intervalBeats / 4.0;string capBar = bars >= 1 ? $"{bars:0.#} bar" : $"1/{4.0 / _intervalBeats:0}";g.DrawText(new FormattedText($"capture {capBar} → {onsets} rep", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, AmberLit), new Point(x0 + 62, headY));- var bpm = new FormattedText($"{_bpm:0} BPM", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, Muted);+ var bpm = new FormattedText($"{_bpm:0}\u2009BPM", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, Muted);g.DrawText(bpm, new Point(x1 - bpm.Width, headY));// Slots.diff --git a/src/managed/Nota.App/Controls/CeilingScope.cs b/src/managed/Nota.App/Controls/CeilingScope.csindex 3ab0f853..42df9240 100644--- a/src/managed/Nota.App/Controls/CeilingScope.cs+++ b/src/managed/Nota.App/Controls/CeilingScope.cs@@ -41,8 +41,8 @@ internal sealed class CeilingLevelPlot : Controlprivate static readonly IBrush OutC = NotaPalette.Wash(NotaPalette.Accent, 0xD9);private static readonly IBrush OverC = NotaPalette.Wash(NotaPalette.Danger, 0x99);private static readonly IBrush CeilC = NotaPalette.AccentBright;- private static readonly IBrush Axis = NotaPalette.TextDisabled;- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush Axis = NotaPalette.TextAxis;+ private static readonly Typeface Face = NotaFonts.Mono;private const double Lo = -30, Hi = 3; // dBFS display rangeprivate readonly CeilingMeters _m;@@ -53,7 +53,7 @@ internal sealed class CeilingLevelPlot : Controlpublic override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height; if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(Border, 1), new Rect(0, 0, w, h), 6, 6);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double padT = 14, padB = 12, padX = 6;double x0 = padX, x1 = w - padX, top = padT, bot = h - padB;double plotH = Math.Max(1, bot - top), plotW = Math.Max(1, x1 - x0);@@ -74,10 +74,10 @@ internal sealed class CeilingLevelPlot : Controlvoid Txt(string t, double x, double y, IBrush b, double fs = 8) =>ctx.DrawText(new FormattedText(t, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, fs, b), new Point(x, y));- Txt("LEVEL — 4 s", x0 + 1, 2, NotaPalette.TextTertiary);+ Txt("LEVEL — 4\u2009s", x0 + 1, 2, NotaPalette.TextTertiary);Txt("input", x1 - 118, 2, InC); Txt("output", x1 - 78, 2, OutC); Txt("over", x1 - 30, 2, OverC);Txt($"ceiling {_m.Ceiling:0.0}", x1 - 54, ceilY - 9, CeilC, 7);- Txt("−4 s", 1, bot + 1, Axis); Txt("now", x1 - 18, bot + 1, Axis);+ Txt("−4\u2009s", 1, bot + 1, Axis); Txt("now", x1 - 18, bot + 1, Axis);}}@@ -87,7 +87,7 @@ internal sealed class CeilingGrLane : Controlprivate static readonly IBrush Border = NotaPalette.GraphBorder;private static readonly IBrush Teal = NotaPalette.Teal;private static readonly IBrush Amber = NotaPalette.Warning;- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly Typeface Face = NotaFonts.Mono;private const double MaxGr = 6.0;private readonly CeilingMeters _m;@@ -97,7 +97,7 @@ internal sealed class CeilingGrLane : Controlpublic override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height; if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(Border, 1), new Rect(0, 0, w, h), 6, 6);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double top = 13, bot = h - 3, padX = 6;double x0 = padX, x1 = w - padX, laneH = Math.Max(1, bot - top), plotW = Math.Max(1, x1 - x0);int n = CeilingMeters.N; double bw = plotW / n;@@ -111,6 +111,6 @@ internal sealed class CeilingGrLane : Controlvoid Txt(string t, double x, double y, IBrush b) =>ctx.DrawText(new FormattedText(t, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 8, b), new Point(x, y));Txt("GAIN REDUCTION", x0 + 1, 2, Teal);- Txt("0 … −6 dB", x1 - 48, 2, NotaPalette.TextDisabled);+ Txt("0 … −6\u2009dB", x1 - 48, 2, NotaPalette.TextDisabled);}}diff --git a/src/managed/Nota.App/Controls/ChamberViews.cs b/src/managed/Nota.App/Controls/ChamberViews.csindex 3628c93e..15fdfb7e 100644--- a/src/managed/Nota.App/Controls/ChamberViews.cs+++ b/src/managed/Nota.App/Controls/ChamberViews.cs@@ -22,12 +22,12 @@ internal static class ChamberInk{public static Color SlateColor => NotaPalette.InkColor("#6D8FB5"); // convolutionpublic static Color MauveColor => NotaPalette.InkColor("#B57286"); // shimmer / pitch, low band- public static readonly IBrush Slate = new SolidColorBrush(SlateColor);- public static readonly IBrush Mauve = new SolidColorBrush(MauveColor);+ public static IBrush Slate => NotaPalette.Ink("#6D8FB5");+ public static IBrush Mauve => NotaPalette.Ink("#B57286"); // a live slot, not a snapshot of its colourpublic static readonly IBrush Veil = NotaPalette.Wash(NotaPalette.SurfaceAbyss, 0xB8);public static readonly IBrush GridLine = NotaPalette.SurfaceCard;- private static readonly Typeface Mono = new("ui-monospace, Menlo, monospace");- private static readonly Typeface Sans = new("Inter, system-ui, sans-serif", FontStyle.Normal, FontWeight.Bold);+ private static readonly Typeface Mono = NotaFonts.Mono;+ private static readonly Typeface Sans = NotaFonts.SansBold;public static FormattedText Text(string s, double size, IBrush b) => new(s, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, size, b);public static FormattedText Caps(string s, double size, IBrush b) => new(s, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Sans, size, b);@@ -44,7 +44,7 @@ internal static class ChamberInkforeach (double r in Ranges) if (r >= need) return r;return Ranges[^1];}- public static string AxisLabel(double s) => s >= 1 ? FormattableString.Invariant($"{s:0.##} s") : FormattableString.Invariant($"{s * 1000:0} ms");+ public static string AxisLabel(double s) => s >= 1 ? NotaNum.F($"{s:0.##}\u2009s") : NotaNum.F($"{s * 1000:0}\u2009ms");// Normalised amplitude → 0..1 height on a −60 dB floor.public static double DbHeight(double v, double floorDb = 60) => Math.Clamp((20 * Math.Log10(Math.Max(v, 1e-9)) + floorDb) / floorDb, 0, 1);}@@ -186,7 +186,7 @@ internal sealed class ChamberIrView : Controlprotected override void OnPointerReleased(PointerReleasedEventArgs e){ base.OnPointerReleased(e); if (_drag != 0) { int d = _drag; _drag = 0; e.Pointer.Capture(null); DragEnded?.Invoke(d); } }- private static string Sec(double s) => s >= 1 ? FormattableString.Invariant($"{s:0.00} s") : FormattableString.Invariant($"{s * 1000:0} ms");+ private static string Sec(double s) => s >= 1 ? NotaNum.F($"{s:0.00}\u2009s") : NotaNum.F($"{s * 1000:0}\u2009ms");public override void Render(DrawingContext ctx){@@ -208,25 +208,21 @@ internal sealed class ChamberIrView : Controlvoid Env(float[] a, bool up, Color c, double alphaLine){int n = a.Length; if (n < 2) return;- var fill = new StreamGeometry(); var line = new StreamGeometry();- using (var f = fill.Open())+ var line = new StreamGeometry();using (var l = line.Open()){- f.BeginFigure(new Point(0, mid), true);for (int i = 0; i < n; i++){double x = i * w / (n - 1), v = Math.Sqrt(Math.Clamp(a[i], 0f, 1f)); // √ lifts the tail into viewvar p = new Point(x, up ? mid - v * amp : mid + v * amp);- f.LineTo(p);if (i == 0) l.BeginFigure(p, false); else l.LineTo(p);}- f.LineTo(new Point(w, mid));}- ctx.DrawGeometry(ChamberInk.Alpha(c, 0x30), null, fill);ctx.DrawGeometry(null, new Pen(ChamberInk.Alpha(c, (byte)(255 * alphaLine)), 1.1), line);}Env(_l, true, NotaPalette.AccentColor, 1.0);- Env(_r.Length > 0 ? _r : _l, false, ChamberInk.MauveColor, 0.7);+ // Left and right in the first two chromas; the second at 70% (almanac § oscillogram).+ Env(_r.Length > 0 ? _r : _l, false, NotaPalette.TealColor, 0.7);double xs = X(_start), xe = X(_end);// Attack: the fade-in shape across the head of the kept window.@@ -249,14 +245,16 @@ internal sealed class ChamberIrView : Controlctx.DrawRectangle(_drag == 1 ? NotaPalette.AccentBright : NotaPalette.Accent, null, new Rect(xs - 1.5, mid - 7, 3, 14), 1.5, 1.5);ctx.DrawRectangle(_drag == 2 ? NotaPalette.AccentBright : NotaPalette.Accent, null, new Rect(xe - 1.5, mid - 7, 3, 14), 1.5, 1.5);- var st = ChamberInk.Text(FormattableString.Invariant($"start {Sec(_start * _sec)}"), 7, NotaPalette.AccentBright);+ var st = ChamberInk.Text(NotaNum.F($"start {Sec(_start * _sec)}"), 7, NotaPalette.AccentBright);ctx.DrawText(st, new Point(Math.Min(xs + 4, w - st.Width - 2), 2));- var en = ChamberInk.Text(FormattableString.Invariant($"end {Sec(_end * _sec)}"), 7, NotaPalette.AccentBright);+ var en = ChamberInk.Text(NotaNum.F($"end {Sec(_end * _sec)}"), 7, NotaPalette.AccentBright);ctx.DrawText(en, new Point(Math.Max(2, xe - en.Width - 4), h - en.Height - 2));if (_reverse){- var rv = ChamberInk.Text("◀ REVERSED", 7, ChamberInk.Mauve);- ctx.DrawText(rv, new Point((xs + xe - rv.Width) / 2, 2));+ var rv = ChamberInk.Text("REVERSED", 7, ChamberInk.Mauve);+ double rx = (xs + xe - rv.Width - 9) / 2;+ Glyph.Draw(ctx, GlyphKind.StepLeft, new Rect(rx, 2 + (rv.Height - 6) / 2, 6, 6), ChamberInk.Mauve);+ ctx.DrawText(rv, new Point(rx + 9, 2));}clip.Dispose();RenderResult(ctx, w, h, full);@@ -299,21 +297,19 @@ internal sealed class ChamberIrView : Control}f.LineTo(new Point(Math.Min(w, X(_preSec + _resSec)), bot));}- ctx.DrawGeometry(ChamberInk.Alpha(NotaPalette.AccentColor, 0x3A), null, fill);ctx.DrawGeometry(null, new Pen(NotaPalette.Accent, 1), line);if (_preSec > 0.0005){ctx.DrawLine(new Pen(NotaPalette.Teal, 1, new DashStyle(new double[] { 2, 2 }, 0)), new Point(x0, top + 2), new Point(x0, full));- var pt = ChamberInk.Text(FormattableString.Invariant($"pre {_preSec * 1000:0} ms"), 7, NotaPalette.Teal);+ var pt = ChamberInk.Text(NotaNum.F($"pre {_preSec * 1000:0}\u2009ms"), 7, NotaPalette.Teal);ctx.DrawText(pt, new Point(Math.Min(x0 + 3, w - pt.Width - 2), bot - pt.Height));}if (_preSec + _resSec > axis * 1.001){- var more = ChamberInk.Text("▸", 8, NotaPalette.AccentBright);- ctx.DrawText(more, new Point(w - more.Width - 2, peakY - 2));+ Glyph.Draw(ctx, GlyphKind.ChevronRight, new Rect(w - 9, peakY - 1, 7, 7), NotaPalette.AccentBright);}}- var len = ChamberInk.Text(FormattableString.Invariant($"as heard · {_resSec:0.00} s · axis {ChamberInk.AxisLabel(axis)}"), 7, NotaPalette.TextDisabled);+ var len = ChamberInk.Text(NotaNum.F($"as heard · {_resSec:0.00}\u2009s · axis {ChamberInk.AxisLabel(axis)}"), 7, NotaPalette.TextDisabled);ctx.DrawText(len, new Point(w - len.Width - 4, top + 2));}}@@ -376,7 +372,7 @@ internal sealed class ChamberDecayGraph : Controlprotected override void OnPointerReleased(PointerReleasedEventArgs e){ base.OnPointerReleased(e); if (_drag >= 0) { int b = _drag; _drag = -1; e.Pointer.Capture(null); DragEnded?.Invoke(b); } }- private static string S(double s) => s >= 10 ? FormattableString.Invariant($"{s:0} s") : FormattableString.Invariant($"{s:0.0} s");+ private static string S(double s) => s >= 10 ? NotaNum.F($"{s:0}\u2009s") : NotaNum.F($"{s:0.0}\u2009s");public override void Render(DrawingContext ctx){@@ -412,7 +408,6 @@ internal sealed class ChamberDecayGraph : Control}f.LineTo(new Point(Math.Min(w, X(_pre + _echoSec)), bot));}- ctx.DrawGeometry(ChamberInk.Alpha(NotaPalette.AccentColor, 0x22), null, fill);ctx.DrawGeometry(null, new Pen(ChamberInk.Alpha(NotaPalette.AccentColor, 0x60), 0.8), line);}@@ -420,7 +415,7 @@ internal sealed class ChamberDecayGraph : Controldouble lx = w - 5;for (int b = 2; b >= 0; b--){- var t = ChamberInk.Text(FormattableString.Invariant($"{Names[b]} {(_freeze ? "∞" : S(_rt[b]))}"), 7, b == 1 ? NotaPalette.AccentBright : NotaPalette.TextSecondary);+ var t = ChamberInk.Text(NotaNum.F($"{Names[b]} {(_freeze ? "∞" : S(_rt[b]))}"), 7, b == 1 ? NotaPalette.AccentBright : NotaPalette.TextSecondary);lx -= t.Width; ctx.DrawText(t, new Point(lx, 3));lx -= 11; ctx.FillRectangle(Ink[b], new Rect(lx, 7, 8, 2));lx -= 8;@@ -560,8 +555,7 @@ internal sealed class ChamberEqCurve : Control}fc.LineTo(new Point(w, h / 2));}- ctx.DrawGeometry(ChamberInk.Alpha(NotaPalette.AccentColor, 0x1C), null, fill);- ctx.DrawGeometry(null, new Pen(NotaPalette.Accent, 1.6), line);+ ctx.DrawGeometry(null, new Pen(NotaPalette.Accent, NotaGraph.PrimaryWidth), line);var t0 = ChamberInk.Text("30", 7, NotaPalette.TextDisabled);ctx.DrawText(t0, new Point(4, h - t0.Height - 2));@@ -610,7 +604,7 @@ internal sealed class ChamberLfoView : Control}}ctx.DrawGeometry(null, new Pen(NotaPalette.Teal, 1.5), g);- var t = ChamberInk.Text(_rate >= 1 ? FormattableString.Invariant($"{_rate:0.0} Hz") : FormattableString.Invariant($"{_rate:0.00} Hz"), 7, NotaPalette.TextTertiary);+ var t = ChamberInk.Text(_rate >= 1 ? NotaNum.F($"{_rate:0.0}\u2009Hz") : NotaNum.F($"{_rate:0.00}\u2009Hz"), 7, NotaPalette.TextTertiary);ctx.DrawText(t, new Point(w - t.Width - 3, 1));}}diff --git a/src/managed/Nota.App/Controls/ChordKeysViz.cs b/src/managed/Nota.App/Controls/ChordKeysViz.csindex f293aee7..afc9893f 100644--- a/src/managed/Nota.App/Controls/ChordKeysViz.cs+++ b/src/managed/Nota.App/Controls/ChordKeysViz.cs@@ -42,7 +42,7 @@ internal sealed class ChordKeysViz : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Well, null, new Rect(0, 0, w, h), 3, 3);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double bw = w / Span;for (int s = 0; s < Span; s++){diff --git a/src/managed/Nota.App/Controls/CollisionViz.cs b/src/managed/Nota.App/Controls/CollisionViz.csindex 2fdf9d49..27c92e0a 100644--- a/src/managed/Nota.App/Controls/CollisionViz.cs+++ b/src/managed/Nota.App/Controls/CollisionViz.cs@@ -20,8 +20,8 @@ internal sealed class CollisionViz : Controlprivate static readonly IBrush BorderDef = NotaPalette.BorderDefault;private static readonly IBrush AccentBright = NotaPalette.AccentBright;private static readonly IBrush TextTertiary = NotaPalette.TextTertiary;- private static readonly IBrush Grid = NotaPalette.Wash(NotaPalette.BorderStrong, 0x50);- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush Grid = NotaGraph.Grid;+ private static readonly Typeface Face = NotaFonts.Mono;private static readonly string[] TypeNames = { "BEAM", "MARIMBA", "STRING", "MEMBRANE", "PLATE", "PIPE" };private const int Modes = 16;@@ -63,7 +63,7 @@ internal sealed class CollisionViz : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 4, 4);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));Label(ctx, "PARTIALS · " + TypeNames[_type], 6, 3, TextTertiary);double pad = 6, x0 = pad, x1 = w - pad, top = pad + 12, bot = h - pad - 8;@@ -101,7 +101,8 @@ internal sealed class CollisionViz : Controlif (x < x0 || x > x1) continue;double barH = (amp[m] / maxAmp) * (bot - top);byte a = (byte)Math.Clamp(90 + 165 * Math.Pow(matRoll, m), 40, 255);- var brush = new SolidColorBrush(Color.FromArgb(a, 0xF0, 0xC0, 0x60));+ var ab = NotaPalette.AccentBright.Color;+ var brush = new SolidColorBrush(Color.FromArgb(a, ab.R, ab.G, ab.B));ctx.DrawRectangle(brush, null, new Rect(x - 1.4, bot - barH, 2.8, barH), 1, 1);if (m == 0) ctx.DrawEllipse(AccentBright, null, new Point(x, bot - barH - 2.5), 1.6, 1.6);}diff --git a/src/managed/Nota.App/Controls/CompGrHistory.cs b/src/managed/Nota.App/Controls/CompGrHistory.csindex 0a41fc60..7f90dd55 100644--- a/src/managed/Nota.App/Controls/CompGrHistory.cs+++ b/src/managed/Nota.App/Controls/CompGrHistory.cs@@ -18,11 +18,11 @@ internal sealed class CompGrHistory : Control{private static readonly IBrush Sunken = NotaPalette.BgSunken;private static readonly IBrush BorderDef = NotaPalette.BorderDefault;- private static readonly IBrush Grid = NotaPalette.Wash(NotaPalette.BorderStrong, 0x30);- private static readonly IBrush Red = NotaPalette.Danger; // design-system red- private static readonly IBrush RedFill = NotaPalette.Wash(NotaPalette.Danger, 0x55);- private static readonly IBrush Axis = NotaPalette.TextDisabled;- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush Grid = NotaGraph.Grid;+ // Gain reduction is the device doing its job, not an alert: it is the primary data, so brass.+ private static readonly IBrush Red = NotaPalette.Accent;+ private static readonly IBrush Axis = NotaPalette.TextAxis;+ private static readonly Typeface Face = NotaFonts.Mono;private const int N = 220;private const double MaxDb = 24.0;@@ -35,16 +35,23 @@ internal sealed class CompGrHistory : Control{_h[_w % N] = grDb; _w++;Current = grDb;- Peak = Math.Max(grDb, Peak * 0.995);+ Peak = Math.Max(grDb, Peak); // the peak holds; it does not fall on its ownInvalidateVisual();}+ protected override void OnPointerPressed(Avalonia.Input.PointerPressedEventArgs e)+ {+ // Click clears the held peak back to the current reduction.+ if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;+ Peak = Current; InvalidateVisual(); e.Handled = true;+ }+private const double HeadH = 14.0; // reserved top band for the labels — the plot starts below itpublic override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height; if (w <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 5, 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));// The plot lives below a reserved header band so the labels stay readable when it fills.double top0 = HeadH, plotH = h - HeadH - 1;// Horizontal dB gridlines at −6/−12/−18.@@ -63,16 +70,15 @@ internal sealed class CompGrHistory : Control}var geo = new StreamGeometry();using (var gc = geo.Open()) { gc.BeginFigure(new Point(top[0].X, top0), true); foreach (var p in top) gc.LineTo(p); gc.LineTo(new Point(top[^1].X, top0)); gc.EndFigure(true); }- ctx.DrawGeometry(RedFill, null, geo);- var pen = new Pen(Red, 1.4, lineJoin: PenLineJoin.Round);+ var pen = new Pen(Red, NotaGraph.PrimaryWidth, lineJoin: PenLineJoin.Round);for (int i = 1; i < top.Count; i++) ctx.DrawLine(pen, top[i - 1], top[i]);}// Peak-hold line.- if (Peak > 0.05) { double py = top0 + Math.Clamp(Peak / MaxDb, 0, 1) * plotH; ctx.DrawLine(new Pen(NotaPalette.Wash(NotaPalette.Danger, 0x99), 1) { DashStyle = DashStyle.Dash }, new Point(2, py), new Point(w - 2, py)); }+ if (Peak > 0.05) { double py = top0 + Math.Clamp(Peak / MaxDb, 0, 1) * plotH; ctx.DrawLine(new Pen(NotaPalette.Wash(NotaPalette.AccentBright, 0x99), 1) { DashStyle = DashStyle.Dash }, new Point(2, py), new Point(w - 2, py)); }// Labels drawn in the reserved header band: title top-left, current · peak top-right (in red).ctx.DrawText(new FormattedText("GAIN REDUCTION", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 8, Axis), new Point(5, 2));string cur = Current <= 0.05 ? "0.0" : $"−{Current:0.0}", pk = Peak <= 0.05 ? "0.0" : $"−{Peak:0.0}";- var ft = new FormattedText($"{cur} dB · peak {pk}", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 8, Red);+ var ft = new FormattedText($"{cur}\u2009dB · peak {pk}", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 8, NotaPalette.AccentBright);ctx.DrawText(ft, new Point(w - ft.Width - 5, 2));}}diff --git a/src/managed/Nota.App/Controls/CompTransfer.cs b/src/managed/Nota.App/Controls/CompTransfer.csindex 106a1007..8d2ff956 100644--- a/src/managed/Nota.App/Controls/CompTransfer.cs+++ b/src/managed/Nota.App/Controls/CompTransfer.cs@@ -22,10 +22,10 @@ internal sealed class CompTransfer : Controlprivate static readonly IBrush Sunken = NotaPalette.BgSunken;private static readonly IBrush BorderDef = NotaPalette.BorderDefault;private static readonly IBrush Accent = NotaPalette.AccentBright;- private static readonly IBrush Grid = NotaPalette.Wash(NotaPalette.BorderStrong, 0x3C);- private static readonly IBrush Axis = NotaPalette.TextDisabled;+ private static readonly IBrush Grid = NotaGraph.Grid;+ private static readonly IBrush Axis = NotaPalette.TextAxis;private static readonly IBrush Fill = NotaPalette.Wash(NotaPalette.Accent, 0x16);- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly Typeface Face = NotaFonts.Mono;private const int Threshold = 0, Ratio = 1, Knee = 5;private const double Lo = -60, Hi = 0;@@ -69,7 +69,7 @@ internal sealed class CompTransfer : Controlpublic override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height; if (w <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 5, 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));var (x0, x1, top, bot) = Geo();for (int i = 1; i <= 3; i++) { double gx = x0 + (x1 - x0) * i / 4.0, gy = top + (bot - top) * i / 4.0; ctx.DrawLine(new Pen(Grid, 1), new Point(gx, top), new Point(gx, bot)); ctx.DrawLine(new Pen(Grid, 1), new Point(x0, gy), new Point(x1, gy)); }// Unity diagonal (dashed).@@ -85,17 +85,16 @@ internal sealed class CompTransfer : Controlvar pts = new System.Collections.Generic.List<Point>();for (double db = Lo; db <= Hi + 0.01; db += 1.5) pts.Add(new Point(X(db, x0, x1), Y(OutDb(db, thr, ratio, knee), top, bot)));using (var gc = geo.Open()) { gc.BeginFigure(new Point(pts[0].X, bot), true); foreach (var pt in pts) gc.LineTo(pt); gc.LineTo(new Point(pts[^1].X, bot)); gc.EndFigure(true); }- ctx.DrawGeometry(Fill, null, geo);var pen = new Pen(Accent, 1.8, lineJoin: PenLineJoin.Round);for (int i = 1; i < pts.Count; i++) ctx.DrawLine(pen, pts[i - 1], pts[i]);// Operating handle at the threshold knee point.- ctx.DrawEllipse(Accent, new Pen(Sunken, 2), new Point(tx, Y(OutDb(thr, thr, ratio, knee), top, bot)), 4.5, 4.5);+ NotaGraph.Node(ctx, new Point(tx, Y(OutDb(thr, thr, ratio, knee), top, bot)), active: true);void Txt(string t, double x, double y, IBrush b) => ctx.DrawText(new FormattedText(t, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 8, b), new Point(x, y));Txt("TRANSFER", x0 + 1, top - 1, Axis);Txt($"{ratio:0}:1 · knee {knee:0}", x1 - 68, top - 1, Accent);Txt("−60", 1, bot - 5, Axis);- Txt("0 dB in", x1 - 34, bot + 3, Axis);+ Txt("0\u2009dB in", x1 - 34, bot + 3, Axis);}}diff --git a/src/managed/Nota.App/Controls/CompViz.cs b/src/managed/Nota.App/Controls/CompViz.csindex 8fff5424..4e7d7941 100644--- a/src/managed/Nota.App/Controls/CompViz.cs+++ b/src/managed/Nota.App/Controls/CompViz.cs@@ -17,8 +17,8 @@ namespace Nota.App;private static readonly IBrush BorderDef = NotaPalette.BorderDefault;private static readonly IBrush AccentBright = NotaPalette.AccentBright;private static readonly IBrush TextTertiary = NotaPalette.TextTertiary;- private static readonly IBrush Grid = NotaPalette.Wash(NotaPalette.BorderStrong, 0x50);- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush Grid = NotaGraph.Grid;+ private static readonly Typeface Face = NotaFonts.Mono;private float _thr = -18f, _ratio = 3f, _makeup;public CompViz() { MinWidth = 120; MinHeight = 70; }public void Set(float thr, float ratio, float makeup)@@ -28,7 +28,7 @@ namespace Nota.App;{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 4, 4);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double pad = 7, x0 = pad, x1 = w - pad, top = pad + 10, bot = h - pad - 9;const double lo = -60, hi = 0; // dB range on both axesdouble X(double db) => x0 + (db - lo) / (hi - lo) * (x1 - x0);diff --git a/src/managed/Nota.App/Controls/ConsortViews.cs b/src/managed/Nota.App/Controls/ConsortViews.csindex 3225672e..35e51244 100644--- a/src/managed/Nota.App/Controls/ConsortViews.cs+++ b/src/managed/Nota.App/Controls/ConsortViews.cs@@ -47,9 +47,9 @@ internal static class ConsortJacksnew(true, 15, "vel", "Velocity", Tone.Mod),new(true, 16, "at", "Aftertouch", Tone.Mod),new(true, 17, "wh", "Mod wheel", Tone.Mod),- new(true, 18, "a1›", "Atten 1 out", Tone.Mod),- new(true, 19, "a2›", "Atten 2 out", Tone.Mod),- new(true, 20, "Σ›", "Sum out", Tone.Mod),+ new(true, 18, "a1→", "Atten 1 out", Tone.Mod),+ new(true, 19, "a2→", "Atten 2 out", Tone.Mod),+ new(true, 20, "Σ→", "Sum out", Tone.Mod),};// Destinations (inputs), index 1..22.public static readonly Jack[] Dests =@@ -166,7 +166,7 @@ internal sealed class ConsortJackDot : Control// ---- dual transistor-ladder response: L (slate) / R (brass) or the series HP→LP curve ----internal sealed class ConsortFilterCurve : Control{- private static readonly Typeface Mono = new("ui-monospace, Menlo, monospace");+ private static readonly Typeface Mono = NotaFonts.Mono;private double _cut = 0.5, _reso, _space, _comp;private int _mode = 1;private bool _drag;@@ -237,7 +237,7 @@ internal sealed class ConsortFilterCurve : Controlctx.DrawGeometry(null, new Pen(ChamberInk.Slate, 1.5), Curve(x => Db(Mag(Wr(x, _cut), _mode == 2))));ctx.DrawGeometry(null, new Pen(brass, 1.5), Curve(x => Db(Mag(Wr(x, cutB), false))));}- string Hz(double n) { double hz = 20 * Math.Pow(1000, n); return hz >= 1000 ? $"{hz / 1000:0.00} kHz" : $"{hz:0} Hz"; }+ string Hz(double n) { double hz = 20 * Math.Pow(1000, n); return hz >= 1000 ? $"{hz / 1000:0.0}\u2009k" : $"{hz:0}\u2009Hz"; }var lt = new FormattedText((_mode == 0 ? "HP " : "L ") + Hz(_cut), CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 7, _mode == 0 ? NotaPalette.TextSecondary : ChamberInk.Slate);var rt = new FormattedText((_mode == 0 ? "LP " : "R ") + Hz(cutB), CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 7, NotaPalette.AccentBright);ctx.DrawText(lt, new Point(4, 3));@@ -250,7 +250,7 @@ internal sealed class ConsortFilterCurve : Control// ---- BBD taps: the L lane on top, R below; bar height = level of each repeat ----internal sealed class ConsortDelayView : Control{- private static readonly Typeface Mono = new("ui-monospace, Menlo, monospace");+ private static readonly Typeface Mono = NotaFonts.Mono;private double _tl = 0.26, _tr = 0.39, _fb = 0.6, _mix = 0.4;private bool _ping = true, _digital;public ConsortDelayView() { ClipToBounds = true; }@@ -290,7 +290,7 @@ internal sealed class ConsortDelayView : Controlvar ll = new FormattedText("L", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 7, bl);var rl = new FormattedText("R", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 7, br);ctx.DrawText(ll, new Point(4, 2)); ctx.DrawText(rl, new Point(4, h - rl.Height - 1));- var info = new FormattedText($"fb {_fb * 100:0} % · {(_digital ? "digital" : "compander on")}", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 7, NotaPalette.TextSecondary);+ var info = new FormattedText($"fb {_fb * 100:0}\u2009% · {(_digital ? "digital" : "compander on")}", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 7, NotaPalette.TextSecondary);ctx.DrawText(info, new Point(w - info.Width - 4, 2));var ax = new FormattedText(ChamberInk.AxisLabel(span), CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 7, NotaPalette.TextDisabled);ctx.DrawText(ax, new Point(w - ax.Width - 4, h - ax.Height - 1));@@ -300,7 +300,7 @@ internal sealed class ConsortDelayView : Control// ---- the 16 step cells: type (note / ratchet / tie / rest), playhead, length. Click / drag paints ----internal sealed class ConsortStepGrid : Control{- private static readonly Typeface Mono = new("ui-monospace, Menlo, monospace");+ private static readonly Typeface Mono = NotaFonts.Mono;private readonly int[] _type = new int[16];private int _len = 16, _play = -1, _ratchet = 3;private bool _drag; private int _last = -1;@@ -346,7 +346,7 @@ internal sealed class ConsortStepGrid : Controlvar r = new Rect(i * (cw + gap) + 0.5, 0.5, cw - 1, h - 1);bool inLen = i < _len;int t = _type[i];- (Color c, string lbl) = t switch { 1 => (mv, $"×{_ratchet}"), 2 => (tl, "~"), 3 => (Colors.Transparent, "·"), _ => (ac, (i + 1).ToString(CultureInfo.InvariantCulture)) };+ (Color c, string lbl) = t switch { 1 => (mv, $"×{_ratchet}"), 2 => (tl, "~"), 3 => (Colors.Transparent, "·"), _ => (ac, (i + 1).ToString(NotaNum.Culture)) };IBrush fill = t == 3 ? NotaPalette.BgSunken : new SolidColorBrush(Color.FromArgb((byte)(inLen ? 0x40 : 0x14), c.R, c.G, c.B));IBrush stroke = t == 3 ? NotaPalette.BorderDefault : new SolidColorBrush(Color.FromArgb((byte)(inLen ? 0xE0 : 0x50), c.R, c.G, c.B));ctx.DrawRectangle(fill, new Pen(stroke, i == _play ? 2 : 1), r, 3, 3);@@ -360,8 +360,8 @@ internal sealed class ConsortStepGrid : Control// ---- step pitch lane: one bar per step at its pitch (±24 st); drag up/down to set ----internal sealed class ConsortPitchLane : Control{- private static readonly Typeface Sans = new("Inter, system-ui, sans-serif", FontStyle.Normal, FontWeight.Bold);- private static readonly Typeface Mono = new("ui-monospace, Menlo, monospace");+ private static readonly Typeface Sans = NotaFonts.SansBold;+ private static readonly Typeface Mono = NotaFonts.Mono;private readonly int[] _p = new int[16], _t = new int[16];private int _len = 16, _play = -1, _dragStep = -1;private bool _arp;@@ -427,7 +427,7 @@ internal sealed class ConsortPitchLane : Control}if (_dragStep >= 0){- var ft = new FormattedText(_p[_dragStep] == 0 ? "0 st" : $"{_p[_dragStep]:+0;-0} st", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, NotaPalette.AccentBright);+ var ft = new FormattedText(_p[_dragStep] == 0 ? "0\u2009st" : $"{_p[_dragStep]:+0;−0}\u2009st", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, NotaPalette.AccentBright);double x = Math.Clamp((_dragStep + 0.5) * cw - ft.Width / 2, 2, w - ft.Width - 2);ctx.DrawText(ft, new Point(x, Math.Max(Top, Y(_p[_dragStep]) - 16)));}@@ -439,9 +439,9 @@ internal sealed class ConsortPitchLane : Control// jack to pull its cables, right-click for its cable list. ----internal sealed class ConsortJackField : Control{- private static readonly Typeface Mono = new("ui-monospace, Menlo, monospace");- private static readonly Typeface Sans = new("Inter, system-ui, sans-serif");- private static readonly Typeface SansBold = new("Inter, system-ui, sans-serif", FontStyle.Normal, FontWeight.Bold);+ private static readonly Typeface Mono = NotaFonts.Mono;+ private static readonly Typeface Sans = NotaFonts.Sans;+ private static readonly Typeface SansBold = NotaFonts.SansBold;public readonly record struct Group(string Title, ConsortJacks.Jack[] Jacks);private readonly List<List<Group>> _rows; // strip mode: rows of groups; list mode: columns (one group each)@@ -599,7 +599,7 @@ internal sealed class ConsortJackField : Control}else{- var t = new FormattedText(j.Short, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 6.5, col != null ? NotaPalette.TextSecondary : NotaPalette.TextDisabled);+ var t = new FormattedText(j.Short, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, NotaType.Floor, col != null ? NotaPalette.TextSecondary : NotaPalette.TextDisabled);ctx.DrawText(t, new Point(p.X - t.Width / 2, p.Y + 7));}}@@ -635,9 +635,9 @@ internal sealed class ConsortJackField : Control// ---- source × destination matrix: rows = sources, columns = destinations, cell = depth ----internal sealed class ConsortPatchMatrix : Control{- private static readonly Typeface Mono = new("ui-monospace, Menlo, monospace");- private static readonly Typeface Sans = new("Inter, system-ui, sans-serif");- private static readonly Typeface SansBold = new("Inter, system-ui, sans-serif", FontStyle.Normal, FontWeight.Bold);+ private static readonly Typeface Mono = NotaFonts.Mono;+ private static readonly Typeface Sans = NotaFonts.Sans;+ private static readonly Typeface SansBold = NotaFonts.SansBold;private int[] _rows = Array.Empty<int>(), _cols = Array.Empty<int>();private IReadOnlyList<ConsortCable> _cables = Array.Empty<ConsortCable>();private const double HeadH = 16, RowHdrW = 78;@@ -725,7 +725,7 @@ internal sealed class ConsortPatchMatrix : Control// depth bar from the centredouble mid = cell.X + cell.Width / 2, bw = cell.Width / 2 * Math.Abs(cb.Depth);ctx.FillRectangle(new SolidColorBrush(Color.FromArgb(0x38, tc.R, tc.G, tc.B)), new Rect(cb.Depth >= 0 ? mid : mid - bw, cell.Bottom - 3, bw, 2));- var v = new FormattedText($"{cb.Depth * 100:+0;-0;0}", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, NotaPalette.TextPrimary);+ var v = new FormattedText($"{cb.Depth * 100:+0;−0;0}", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, NotaPalette.TextPrimary);ctx.DrawText(v, new Point(cell.X + (cell.Width - v.Width) / 2, cell.Y + (cell.Height - v.Height) / 2));}elsediff --git a/src/managed/Nota.App/Controls/DelayTaps.cs b/src/managed/Nota.App/Controls/DelayTaps.csindex 3b5c7b14..a347f554 100644--- a/src/managed/Nota.App/Controls/DelayTaps.cs+++ b/src/managed/Nota.App/Controls/DelayTaps.cs@@ -20,9 +20,9 @@ internal sealed class DelayTaps : Controlprivate static readonly IBrush BorderDef = NotaPalette.BorderDefault;private static readonly IBrush Accent = NotaPalette.Accent;private static readonly IBrush AccentBright = NotaPalette.AccentBright;- private static readonly IBrush GridB = NotaPalette.Wash(NotaPalette.BorderStrong, 0x40);- private static readonly IBrush Axis = NotaPalette.TextDisabled;- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush GridB = NotaGraph.Grid;+ private static readonly IBrush Axis = NotaPalette.TextAxis;+ private static readonly Typeface Face = NotaFonts.Mono;private double _fracL = 0.25, _fracR = 0.25;private float _fb = 0.4f;@@ -42,7 +42,7 @@ internal sealed class DelayTaps : Controlpublic override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height; if (w <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 5, 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double x0 = 8, x1 = w - 8, mid = h * 0.5, half = (h - 30) * 0.5;// Ruler ticks (0 / mid / end) + centre axis.diff --git a/src/managed/Nota.App/Controls/DistributionViz.cs b/src/managed/Nota.App/Controls/DistributionViz.csindex fd24336e..51a1de86 100644--- a/src/managed/Nota.App/Controls/DistributionViz.cs+++ b/src/managed/Nota.App/Controls/DistributionViz.cs@@ -28,7 +28,7 @@ internal sealed class DistributionViz : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Well, new Pen(BorderIn, 1), new Rect(0, 0, w, h), 5, 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double padX = 6, padY = 5;double x0 = padX, x1 = w - padX, top = padY, bot = h - padY;double bw = (x1 - x0) / N;@@ -44,7 +44,7 @@ internal sealed class DistributionViz : Control};double bh = Math.Max(1, hh * (bot - top));var rect = new Rect(x0 + k * bw + 0.5, bot - bh, Math.Max(1, bw - 1.4), bh);- ctx.DrawRectangle(new SolidColorBrush(Teal, 0.35 + 0.55 * hh), null, rect, 1, 1);+ ctx.DrawRectangle(NotaPalette.Teal, null, rect, NotaRadius.BarValue, NotaRadius.BarValue);}}}diff --git a/src/managed/Nota.App/Controls/DragNumber.cs b/src/managed/Nota.App/Controls/DragNumber.csindex c4959d1d..7a9ff7db 100644--- a/src/managed/Nota.App/Controls/DragNumber.cs+++ b/src/managed/Nota.App/Controls/DragNumber.cs@@ -57,7 +57,7 @@ public sealed class DragNumber : UserControlset { _value = Math.Clamp(value, _min, _max); Refresh(); }}- private void Refresh() => _display.Text = _value.ToString(_format, CultureInfo.InvariantCulture);+ private void Refresh() => _display.Text = _value.ToString(_format, NotaNum.Culture);protected override void OnPointerPressed(PointerPressedEventArgs e){@@ -88,7 +88,7 @@ public sealed class DragNumber : UserControlprivate void BeginEditor(){_editing = true;- _editor.Text = _value.ToString(_format, CultureInfo.InvariantCulture);+ _editor.Text = _value.ToString(_format, NotaNum.Culture);_editor.IsVisible = true;_display.IsVisible = false;_editor.Focus();@@ -101,7 +101,7 @@ public sealed class DragNumber : UserControl_editing = false;_editor.IsVisible = false;_display.IsVisible = true;- if (double.TryParse(_editor.Text, NumberStyles.Any, CultureInfo.InvariantCulture, out var v))+ if (double.TryParse(_editor.Text, NumberStyles.Any, NotaNum.Culture, out var v)){_value = Math.Clamp(v, _min, _max);Refresh();diff --git a/src/managed/Nota.App/Controls/DynamicEqCurve.cs b/src/managed/Nota.App/Controls/DynamicEqCurve.csindex 7e43c240..a6fd443b 100644--- a/src/managed/Nota.App/Controls/DynamicEqCurve.cs+++ b/src/managed/Nota.App/Controls/DynamicEqCurve.cs@@ -34,23 +34,23 @@ public sealed class DynamicEqCurve : Controlpublic const int HistLen = 120; // 2 s at 60 Hzprivate static readonly IBrush Bg = NotaPalette.BgSunken;- private static readonly IPen GridPen = new Pen(NotaPalette.WellGrid, 1);+ private static readonly IPen GridPen = NotaGraph.GridPen;private static readonly IPen GridPenFaint = new Pen(NotaPalette.Wash(NotaPalette.WellGrid, 0x60), 1);private static readonly IPen ZeroPen = new Pen(NotaPalette.BorderStrong, 1);- private static readonly IPen CurvePen = new Pen(NotaPalette.Accent, 1.7);+ private static readonly IPen CurvePen = new Pen(NotaPalette.Accent, NotaGraph.PrimaryWidth);private static readonly IBrush CurveFill = NotaPalette.Wash(NotaPalette.Accent, 0x1E);private static readonly IPen DynPen = new Pen(NotaPalette.Teal, 1.5) { DashStyle = new DashStyle(new double[] { 3, 3 }, 0) };private static readonly IPen ReachPen = new Pen(NotaPalette.Wash(NotaPalette.Teal, 0x88), 1) { DashStyle = new DashStyle(new double[] { 2, 3 }, 0) };private static readonly IBrush DotBrass = NotaPalette.AccentBright;private static readonly IBrush DotTeal = NotaPalette.Teal;- private static readonly IBrush DotOff = NotaPalette.TextDisabled;+ private static readonly IBrush DotOff = NotaPalette.TextAxis;private static readonly IBrush DotRing = NotaPalette.BgSunken;private static readonly IBrush SelRing = NotaPalette.AccentBright;private static readonly IBrush LabelDim = NotaPalette.TextTertiary;private static readonly IBrush LabelBright = NotaPalette.TextSecondary;private static readonly IBrush OnAccentText = NotaPalette.TextOnAccent;- private static readonly Typeface Mono = new("monospace");- private static readonly Typeface DotFont = new(FontFamily.Default, FontStyle.Normal, FontWeight.Bold);+ private static readonly Typeface Mono = NotaFonts.Mono;+ private static readonly Typeface DotFont = NotaFonts.SansBold;private readonly IAudioEngine _engine;private readonly int _track, _device;@@ -261,7 +261,7 @@ public sealed class DynamicEqCurve : Controlfor (int t = 0; t < TypeNames.Length; t++){int tt = t;- var mi = new MenuItem { Header = (t == curT ? "● " : " ") + TypeNames[t] };+ var mi = new MenuItem { Header = TypeNames[t], ToggleType = MenuItemToggleType.Radio, IsChecked = t == curT };mi.Click += (_, _) => { SetP(b, TypeF, tt); InvalidateVisual(); SelectionChanged?.Invoke(); };flyout.Items.Add(mi);}@@ -270,7 +270,7 @@ public sealed class DynamicEqCurve : Controlfor (int m = 0; m < ModeNames.Length; m++){int mm = m;- var mi = new MenuItem { Header = (m == curM ? "● " : " ") + ModeNames[m], IsEnabled = HasGain(curT) || m == 0 };+ var mi = new MenuItem { Header = ModeNames[m], ToggleType = MenuItemToggleType.Radio, IsChecked = m == curM, IsEnabled = HasGain(curT) || m == 0 };mi.Click += (_, _) =>{// Seed a working Range when engaging dynamics (default is 0 → no GR ever).@@ -299,7 +299,7 @@ public sealed class DynamicEqCurve : Control{double w = Bounds.Width, h = Bounds.Height, sr = Sr;if (w <= 0 || h <= 0) return;- ctx.FillRectangle(Bg, new Rect(0, 0, w, h), 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));// griddouble[] majors = { 100, 1000, 10000 };@@ -309,14 +309,15 @@ public sealed class DynamicEqCurve : Control{double x = FreqToX(f, w);ctx.DrawLine(GridPen, new Point(x, 0), new Point(x, h));- Label(ctx, f >= 1000 ? $"{f / 1000:0}k" : $"{f:0}", x + 2, h - 11, LabelDim);}for (int db = -12; db <= 12; db += 6){double y = GainToY(db, h);ctx.DrawLine(db == 0 ? ZeroPen : GridPen, new Point(0, y), new Point(w, y));- if (db != 0) Label(ctx, $"{(db > 0 ? "+" : "")}{db}", 2, y - 9, LabelDim);}+ // The range is labelled in the bottom corners and nowhere else — no full axes.+ NotaGraph.Axis(ctx, new Rect(0, 0, w, h), NotaGraph.Corner.BottomLeft, "20");+ NotaGraph.Axis(ctx, new Rect(0, 0, w, h), NotaGraph.Corner.BottomRight, "20k Hz");// reach lines for dynamic bands (how far each can travel)for (int b = 0; b < Bands; b++)@@ -328,7 +329,7 @@ public sealed class DynamicEqCurve : Controlctx.DrawLine(ReachPen, new Point(x, y0), new Point(x, y1));}- // static curve (brass) + fill+ // static curve (brass)DrawCurve(ctx, w, h, sr, false, CurveFill, CurvePen);// momentary curve (teal dashed) — only meaningful when something is engagedDrawCurve(ctx, w, h, sr, true, null, DynPen);@@ -340,13 +341,11 @@ public sealed class DynamicEqCurve : Controlint type = BandType(b);double x = FreqToX(P(b, FreqF), w);double y = GainToY(HasGain(type) ? P(b, GainF) : 0, h);+ // Almanac node: selected brass, the rest Ink 3; a dynamic band keeps its teal+ // (modulation) and an off band drops to Ink 6. The band number is in the readout.bool sel = b == _selected;- bool dyn = IsDyn(b);- double r = sel ? 8.5 : 7;- IBrush fill = !on ? DotOff : dyn ? DotTeal : DotBrass;- var ring = sel ? new Pen(SelRing, 2) : new Pen(DotRing, 1.5);- ctx.DrawEllipse(fill, ring, new Point(x, y), r, r);- DotLabel(ctx, (b + 1).ToString(), x, y, on ? OnAccentText : LabelDim, 9.5);+ IBrush? ink = !on ? NotaPalette.TextDisabled : sel ? null : IsDyn(b) ? NotaPalette.Teal : null;+ NotaGraph.Node(ctx, new Point(x, y), sel, ink);}// readout@@ -354,10 +353,10 @@ public sealed class DynamicEqCurve : Controlif (_selected >= 0 && BandOn(_selected)){int b = _selected, type = BandType(b);- string dynTxt = IsDyn(b) ? $" {(BandMode(b) == 1 ? "↓" : "↑")} {P(b, RangeF):+0.0;-0.0} dB · GR {_gr[b]:+0.0;-0.0;0.0}" : "";- txt = string.Format(CultureInfo.InvariantCulture, "B{0} {1} {2:0} Hz{3} Q {4:0.00}{5}",+ string dynTxt = IsDyn(b) ? $" {(BandMode(b) == 1 ? "↓" : "↑")} {P(b, RangeF):+0.0;−0.0}\u2009dB · GR {_gr[b]:+0.0;−0.0;0.0}" : "";+ txt = string.Format(NotaNum.Culture, "B{0} {1} {2:0} Hz{3} Q {4:0.00}{5}",b + 1, TypeNames[type], P(b, FreqF),- HasGain(type) ? $" {P(b, GainF):+0.0;-0.0} dB" : "", P(b, QF), dynTxt);+ HasGain(type) ? $" {P(b, GainF):+0.0;−0.0}\u2009dB" : "", P(b, QF), dynTxt);}else{@@ -386,7 +385,7 @@ public sealed class DynamicEqCurve : Control}if (gf != null) { gf.LineTo(new Point(w, h / 2)); gf.EndFigure(true); gf.Dispose(); }}- if (fill != null && fillGeo != null) ctx.DrawGeometry(fill, null, fillGeo);+ // No fill under the curve (almanac § Visualisations); the fill argument is ignored.ctx.DrawGeometry(null, pen, curve);}}diff --git a/src/managed/Nota.App/Controls/EqThreeCurve.cs b/src/managed/Nota.App/Controls/EqThreeCurve.csindex 542c5e52..6498cff5 100644--- a/src/managed/Nota.App/Controls/EqThreeCurve.cs+++ b/src/managed/Nota.App/Controls/EqThreeCurve.cs@@ -23,7 +23,7 @@ internal sealed class EqThreeCurve : Control{private static readonly IBrush Bg = NotaPalette.BgSunken;private static readonly IBrush BorderB = NotaPalette.BorderDefault;- private static readonly IPen GridPen = new Pen(NotaPalette.Wash(NotaPalette.BorderStrong, 0x22), 1);+ private static readonly IPen GridPen = NotaGraph.GridPen;private static readonly IPen CurvePen = new Pen(NotaPalette.Accent, 1.8);private static readonly IBrush CurveFill = NotaPalette.Wash(NotaPalette.Accent, 0x18);private static readonly IBrush SpecFill = NotaPalette.Wash(NotaPalette.SignalInFill, 0x22);@@ -33,8 +33,8 @@ internal sealed class EqThreeCurve : Controlprivate static readonly IBrush LowB = NotaPalette.Ink("#C4756A");private static readonly IBrush MidB = NotaPalette.Ink("#C99C55");private static readonly IBrush HighB = NotaPalette.Ink("#6D8FB5");- private static readonly IBrush KillB = NotaPalette.Danger;- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush KillB = NotaPalette.AccentHover; // a state, not an alert: red is kept for recording and overload+ private static readonly Typeface Face = NotaFonts.Mono;private const double FMin = 20.0, FMax = 20000.0;private const double DbTop = 18.0, DbBot = -24.0;@@ -78,7 +78,7 @@ internal sealed class EqThreeCurve : Controlpublic void Tick(){int n = _engine.DeviceScope(_track, _device, _scope, FftN);- if (n < FftN) { for (int k = 1; k < Bins; k++) _specDb[k] = Math.Max(-120, _specDb[k] - 2.5); InvalidateVisual(); return; }+ if (n < FftN) { for (int k = 1; k < Bins; k++) _specDb[k] = -120; InvalidateVisual(); return; }for (int i = 0; i < FftN; i++) { _re[i] = _scope[i] * _hann[i]; _im[i] = 0; }Fft(_re, _im);_sr = _engine.SampleRate > 0 ? _engine.SampleRate : 48000;@@ -87,7 +87,7 @@ internal sealed class EqThreeCurve : Control{double mag = Math.Sqrt(_re[k] * _re[k] + _im[k] * _im[k]);double db = 20 * Math.Log10(mag / refMag + 1e-9);- _specDb[k] = db > _specDb[k] ? db : Math.Max(db, _specDb[k] - 2.5);+ _specDb[k] = db; // no release ballistics: the spectrum shows this frame (almanac § no meter animation)}InvalidateVisual();}@@ -114,7 +114,7 @@ internal sealed class EqThreeCurve : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Bg, new Pen(BorderB, 1), new Rect(0, 0, w, h), 5, 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double logMin = Math.Log10(FMin), logMax = Math.Log10(FMax), logSpan = logMax - logMin;double X(double f) => (Math.Log10(f) - logMin) / logSpan * w;@@ -136,7 +136,7 @@ internal sealed class EqThreeCurve : Controlg.LineTo(new Point(w, h));g.EndFigure(true);}- ctx.DrawGeometry(SpecFill, SpecPen, spec);+ ctx.DrawGeometry(null, SpecPen, spec);// --- crossover markers ---ctx.DrawLine(XoverPen, new Point(X(_f1), 0), new Point(X(_f1), h));@@ -159,19 +159,18 @@ internal sealed class EqThreeCurve : Controlgc.LineTo(new Point(w, h));gc.EndFigure(true);}- ctx.DrawGeometry(CurveFill, null, geo);for (int i = 1; i < n; i++) ctx.DrawLine(CurvePen, pts[i - 1], pts[i]);// --- 3) band labels sitting in each band's frequency zone ---void Lbl(string t, double x, double y, IBrush b) => ctx.DrawText(new FormattedText(t, System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 8, b), new Point(x, y));double xLow = X(Math.Sqrt(FMin * _f1)), xMid = X(Math.Sqrt(_f1 * _f2)), xHigh = X(Math.Sqrt(_f2 * FMax));- Lbl(_kLow ? "LOW kill" : $"LOW {(_gLow > 0 ? 20 * Math.Log10(_gLow) : 0):+0.0;-0.0;0.0}", Math.Clamp(xLow - 14, 3, w - 40), 3, _kLow ? KillB : LowB);- Lbl(_kMid ? "MID kill" : $"MID {(_gMid > 0 ? 20 * Math.Log10(_gMid) : 0):+0.0;-0.0;0.0}", Math.Clamp(xMid - 14, 3, w - 40), 3, _kMid ? KillB : MidB);- Lbl(_kHigh ? "HIGH kill" : $"HIGH {(_gHigh > 0 ? 20 * Math.Log10(_gHigh) : 0):+0.0;-0.0;0.0}", Math.Clamp(xHigh - 14, 3, w - 44), 3, _kHigh ? KillB : HighB);+ Lbl(_kLow ? "LOW kill" : $"LOW {(_gLow > 0 ? 20 * Math.Log10(_gLow) : 0):+0.0;−0.0;0.0}", Math.Clamp(xLow - 14, 3, w - 40), 3, _kLow ? KillB : LowB);+ Lbl(_kMid ? "MID kill" : $"MID {(_gMid > 0 ? 20 * Math.Log10(_gMid) : 0):+0.0;−0.0;0.0}", Math.Clamp(xMid - 14, 3, w - 40), 3, _kMid ? KillB : MidB);+ Lbl(_kHigh ? "HIGH kill" : $"HIGH {(_gHigh > 0 ? 20 * Math.Log10(_gHigh) : 0):+0.0;−0.0;0.0}", Math.Clamp(xHigh - 14, 3, w - 44), 3, _kHigh ? KillB : HighB);- // frequency scale.- foreach (var (f, s) in new[] { (100.0, "100"), (1000.0, "1k"), (10000.0, "10k") })- Lbl(s, Math.Clamp(X(f) - 6, 2, w - 16), h - 11, AxisB);+ // The range, in the bottom corners only.+ NotaGraph.Axis(ctx, new Rect(0, 0, w, h), NotaGraph.Corner.BottomLeft, "20");+ NotaGraph.Axis(ctx, new Rect(0, 0, w, h), NotaGraph.Corner.BottomRight, "20k Hz");}private static void Fft(double[] re, double[] im)diff --git a/src/managed/Nota.App/Controls/FluxReactScope.cs b/src/managed/Nota.App/Controls/FluxReactScope.csindex a4db7e20..c3733acb 100644--- a/src/managed/Nota.App/Controls/FluxReactScope.cs+++ b/src/managed/Nota.App/Controls/FluxReactScope.cs@@ -105,13 +105,6 @@ internal sealed class FluxReactScope : Controldouble bx = w - barW;ctx.FillRectangle(NotaPalette.SurfaceAbyss, new Rect(bx, 3, barW, h - 6), 3);double fillH = (h - 6) * _tilt;- var grad = new LinearGradientBrush- {- StartPoint = new RelativePoint(0, 1, RelativeUnit.Relative),- EndPoint = new RelativePoint(0, 0, RelativeUnit.Relative),- };- grad.GradientStops.Add(new GradientStop(Teal, 0));- grad.GradientStops.Add(new GradientStop(TealBright, 1));- ctx.FillRectangle(grad, new Rect(bx, 3 + (h - 6 - fillH), barW, fillH), 3);+ ctx.FillRectangle(NotaPalette.Teal, new Rect(bx, 3 + (h - 6 - fillH), barW, fillH), (float)NotaRadius.ClipValue);}}diff --git a/src/managed/Nota.App/Controls/FluxVectorPad.cs b/src/managed/Nota.App/Controls/FluxVectorPad.csindex 2608469b..1850b1aa 100644--- a/src/managed/Nota.App/Controls/FluxVectorPad.cs+++ b/src/managed/Nota.App/Controls/FluxVectorPad.cs@@ -86,10 +86,6 @@ internal sealed class FluxVectorPad : Controlvar r = new Rect(Bounds.Size);// base + four-corner radial glows.ctx.FillRectangle(new SolidColorBrush(Inset), r, 8);- Corner(ctx, r, 0, 0, Warm);- Corner(ctx, r, 1, 0, Glass);- Corner(ctx, r, 0, 1, Moog);- Corner(ctx, r, 1, 1, Grain);// crosshair grid.var grid = new Pen(new SolidColorBrush(GridCol), 1);@@ -115,30 +111,17 @@ internal sealed class FluxVectorPad : Control// 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.BgApp, 1), new Point(bx, by), 6, 6);+ 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);}- private static void Corner(DrawingContext ctx, Rect r, double cx, double cy, Color col)- {- var glow = new RadialGradientBrush- {- Center = new RelativePoint(cx, cy, RelativeUnit.Relative),- GradientOrigin = new RelativePoint(cx, cy, RelativeUnit.Relative),- RadiusX = new RelativeScalar(0.62, RelativeUnit.Relative),- RadiusY = new RelativeScalar(0.72, RelativeUnit.Relative),- };- glow.GradientStops.Add(new GradientStop(Color.FromArgb(0x2A, col.R, col.G, col.B), 0));- glow.GradientStops.Add(new GradientStop(Color.FromArgb(0, col.R, col.G, col.B), 1));- ctx.FillRectangle(glow, r);- }private void Label(DrawingContext ctx, string text, Color col, double x, double y, bool rightAlign){var ft = new FormattedText(text, CultureInfo.InvariantCulture, FlowDirection.LeftToRight,- new Typeface(FontFamily.Default, FontStyle.Normal, FontWeight.Bold), 9, new SolidColorBrush(col));+ NotaFonts.SansBold, 9, new SolidColorBrush(col));double ox = rightAlign ? x - ft.Width : x;ctx.DrawText(ft, new Point(ox, y));}diff --git a/src/managed/Nota.App/Controls/ForgeViz.cs b/src/managed/Nota.App/Controls/ForgeViz.csindex 9b2ab2f6..470be495 100644--- a/src/managed/Nota.App/Controls/ForgeViz.cs+++ b/src/managed/Nota.App/Controls/ForgeViz.cs@@ -68,14 +68,14 @@ internal sealed class ForgeTransferCurve : Control{private static readonly IBrush Bg = NotaPalette.BgSunken;private static readonly IBrush BorderB = NotaPalette.BorderDefault;- private static readonly IPen Grid = new Pen(NotaPalette.Wash(NotaPalette.SurfaceCard, 0x30), 1);+ private static readonly IPen Grid = NotaGraph.GridPen;private static readonly IPen Diag = new Pen(NotaPalette.Wash(NotaPalette.SurfaceRaised, 0x40), 1) { DashStyle = new DashStyle(new double[] { 3, 3 }, 0) };private static readonly IPen CurvePen = new Pen(NotaPalette.Accent, 1.8);private static readonly IBrush CurveFill = NotaPalette.Wash(NotaPalette.Accent, 0x14);private static readonly IPen ModPen = new Pen(NotaPalette.Teal, 1.3) { DashStyle = new DashStyle(new double[] { 4, 3 }, 0) };private static readonly IBrush AxisB = NotaPalette.TextTertiary;private static readonly IBrush Muted = NotaPalette.TextTertiary;- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly Typeface Face = NotaFonts.Mono;private readonly IAudioEngine _engine;private readonly int _track, _device;@@ -94,7 +94,7 @@ internal sealed class ForgeTransferCurve : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Bg, new Pen(BorderB, 1), new Rect(0, 0, w, h), 6, 6);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double pad = 6, gx = pad, gy = 14, gw = w - pad * 2, gh = h - gy - 12;if (gw <= 0 || gh <= 0) return;@@ -125,7 +125,6 @@ internal sealed class ForgeTransferCurve : Controlg.LineTo(new Point(gx + gw, gy + gh));g.EndFigure(true);}- ctx.DrawGeometry(CurveFill, null, geo);}for (int i = 1; i < n; i++) ctx.DrawLine(pen, pts[i - 1], pts[i]);}@@ -138,10 +137,9 @@ internal sealed class ForgeTransferCurve : Controlvoid Lbl(string s, double x, double y, IBrush b) => ctx.DrawText(new FormattedText(s, System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 8, b), new Point(x, y));Lbl("TRANSFER", gx, 2, Muted);- Lbl("─ static", gx + gw - 78, 2, NotaPalette.Accent);- Lbl("┄ modulated", gx + gw - 44, 2, NotaPalette.Teal);+ NotaGraph.Legend(ctx, gx + gw - 2, 2, ("static", NotaPalette.Accent, NotaGraph.Mark.Line), ("modulated", NotaPalette.Teal, NotaGraph.Mark.Dashed));Lbl("in −60", gx, gy + gh + 1, AxisB);- Lbl("0 dB", gx + gw - 22, gy + gh + 1, AxisB);+ Lbl("0\u2009dB", gx + gw - 22, gy + gh + 1, AxisB);}}@@ -154,7 +152,7 @@ internal sealed class ForgeHarmonics : Controlprivate static readonly IBrush EvenB = NotaPalette.Wash(NotaPalette.Accent, 0x73); // 45%private static readonly IBrush Muted = NotaPalette.TextTertiary;private static readonly IBrush LabelC = NotaPalette.TextSecondary;- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly Typeface Face = NotaFonts.Mono;private readonly IAudioEngine _engine;private readonly int _track, _device;@@ -200,10 +198,10 @@ internal sealed class ForgeHarmonics : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Bg, new Pen(BorderB, 1), new Rect(0, 0, w, h), 6, 6);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));void Lbl(string s, double x, double y, IBrush b) => ctx.DrawText(new FormattedText(s, System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 8, b), new Point(x, y));Lbl("HARMONICS", 6, 3, Muted);- Lbl($"THD {_thd:0.0} % · {(_oddHeavy ? "odd-heavy" : "even-heavy")}", w - 116, 3, LabelC);+ Lbl($"THD {_thd:0}\u2009% · {(_oddHeavy ? "odd-heavy" : "even-heavy")}", w - 116, 3, LabelC);double gx = 6, gy = 15, gw = w - 12, gh = h - gy - 4;if (gh <= 0) return;diff --git a/src/managed/Nota.App/Controls/Glyph.cs b/src/managed/Nota.App/Controls/Glyph.csnew file mode 100644index 00000000..eb19abc7--- /dev/null+++ b/src/managed/Nota.App/Controls/Glyph.cs@@ -0,0 +1,246 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// Small UI glyphs drawn as geometry. The almanac bans emoji and icon fonts: a shape is+// built from geometry or a thin stroke, never typed as a character — a character takes+// whatever face the OS falls back to (Geist has no ■ ▾ ✓), so its size and weight drift+// from the text around it. Use Glyph as a control, or Glyph.Draw inside a Render.+//+// Transport shapes follow the almanac exactly: Stop a 10px square with radius 1, Record an+// 11px circle, Play an 11×14 triangle. Everything else is a 1.5px stroke on the same grid.++using System;+using Avalonia;+using Avalonia.Controls;+using Avalonia.Controls.Documents;+using Avalonia.Media;++namespace Nota.App;++internal enum GlyphKind+{+ Play, Stop, Record, RecordRing, Close, Check, Cross,+ ChevronDown, ChevronUp, ChevronLeft, ChevronRight,+ StepLeft, StepRight, // filled small triangles (◀ ▶ as "move")+ Edit, Freeze, PopOut, Cycle, Dot, Bypass, Plus, Grip,+}++internal sealed class Glyph : Control+{+ public static readonly StyledProperty<IBrush?> ForegroundProperty =+ TextElement.ForegroundProperty.AddOwner<Glyph>();++ private GlyphKind _kind;+ private readonly double _size;++ /// <summary>The shape. Setting it also sets the glyph's natural size (transport shapes+ /// have fixed almanac sizes; the rest are square at the size given).</summary>+ public GlyphKind Kind+ {+ get => _kind;+ set+ {+ _kind = value;+ (Width, Height) = _size > 0 ? (_size, _size) : value switch+ {+ GlyphKind.Play => (11, 14),+ GlyphKind.Stop => (10, 10),+ GlyphKind.Record or GlyphKind.RecordRing => (11, 11),+ _ => (10, 10),+ };+ InvalidateVisual();+ }+ }++ /// <summary>The ink. Inherits the text foreground, so a glyph inside a button follows its state.</summary>+ public IBrush? Foreground { get => GetValue(ForegroundProperty); set => SetValue(ForegroundProperty, value); }++ static Glyph() => AffectsRender<Glyph>(ForegroundProperty);++ public Glyph() : this(GlyphKind.Dot) { }++ /// <param name="size">0 = the natural (almanac) size; otherwise a square box of this size.</param>+ public Glyph(GlyphKind kind, double size = 0)+ {+ _size = size;+ Kind = kind;+ VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center;+ HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Center;+ IsHitTestVisible = false;+ }++ public override void Render(DrawingContext ctx)+ => Draw(ctx, Kind, new Rect(Bounds.Size), Foreground ?? NotaPalette.TextStrong);++ /// <summary>Draw <paramref name="kind"/> into <paramref name="r"/> — for custom-drawn views.</summary>+ public static void Draw(DrawingContext ctx, GlyphKind kind, Rect r, IBrush ink)+ {+ double w = r.Width, h = r.Height, x = r.X, y = r.Y, s = Math.Min(w, h);+ double cx = x + w / 2, cy = y + h / 2;+ var pen = new Pen(ink, Math.Max(1.2, s * 0.15), lineCap: PenLineCap.Round, lineJoin: PenLineJoin.Round);+ switch (kind)+ {+ case GlyphKind.Play:+ {+ // Keep the almanac's 11:14 proportion inside whatever box it is given.+ double ph = Math.Min(h, w * 14 / 11), pw = ph * 11 / 14, px = cx - pw / 2, py = cy - ph / 2;+ Fill(ctx, ink, new Point(px, py), new Point(px + pw, cy), new Point(px, py + ph));+ break;+ }+ case GlyphKind.Stop:+ {+ ctx.DrawRectangle(ink, null, new RoundedRect(new Rect(cx - s / 2, cy - s / 2, s, s), 1));+ break;+ }+ case GlyphKind.Record:+ ctx.DrawEllipse(ink, null, new Point(cx, cy), s / 2, s / 2);+ break;+ case GlyphKind.RecordRing:+ ctx.DrawEllipse(null, new Pen(ink, 1.2), new Point(cx, cy), s / 2 - 0.6, s / 2 - 0.6);+ break;+ case GlyphKind.Bypass:+ {+ // A ring with a slash: signal passes by.+ double rr = s * 0.36;+ ctx.DrawEllipse(null, pen, new Point(cx, cy), rr, rr);+ ctx.DrawLine(pen, new Point(cx - rr * 0.7, cy + rr * 0.7), new Point(cx + rr * 0.7, cy - rr * 0.7));+ break;+ }+ case GlyphKind.Plus:+ {+ double d = s * 0.36;+ ctx.DrawLine(pen, new Point(cx - d, cy), new Point(cx + d, cy));+ ctx.DrawLine(pen, new Point(cx, cy - d), new Point(cx, cy + d));+ break;+ }+ case GlyphKind.Grip:+ {+ // Two columns of three dots: a drag handle.+ double dr = Math.Max(0.8, s * 0.09), dx = s * 0.16, dy = s * 0.28;+ for (int i = -1; i <= 1; i++)+ for (int j = -1; j <= 1; j += 2)+ ctx.DrawEllipse(ink, null, new Point(cx + j * dx, cy + i * dy), dr, dr);+ break;+ }+ case GlyphKind.Dot:+ ctx.DrawEllipse(ink, null, new Point(cx, cy), s * 0.3, s * 0.3);+ break;+ case GlyphKind.Close:+ case GlyphKind.Cross:+ {+ double d = s * 0.32;+ ctx.DrawLine(pen, new Point(cx - d, cy - d), new Point(cx + d, cy + d));+ ctx.DrawLine(pen, new Point(cx + d, cy - d), new Point(cx - d, cy + d));+ break;+ }+ case GlyphKind.Check:+ Stroke(ctx, pen, new Point(cx - s * 0.36, cy + s * 0.02), new Point(cx - s * 0.1, cy + s * 0.28), new Point(cx + s * 0.38, cy - s * 0.28));+ break;+ case GlyphKind.ChevronDown:+ Stroke(ctx, pen, new Point(cx - s * 0.3, cy - s * 0.14), new Point(cx, cy + s * 0.16), new Point(cx + s * 0.3, cy - s * 0.14));+ break;+ case GlyphKind.ChevronUp:+ Stroke(ctx, pen, new Point(cx - s * 0.3, cy + s * 0.14), new Point(cx, cy - s * 0.16), new Point(cx + s * 0.3, cy + s * 0.14));+ break;+ case GlyphKind.ChevronRight:+ Stroke(ctx, pen, new Point(cx - s * 0.14, cy - s * 0.3), new Point(cx + s * 0.16, cy), new Point(cx - s * 0.14, cy + s * 0.3));+ break;+ case GlyphKind.ChevronLeft:+ Stroke(ctx, pen, new Point(cx + s * 0.14, cy - s * 0.3), new Point(cx - s * 0.16, cy), new Point(cx + s * 0.14, cy + s * 0.3));+ break;+ case GlyphKind.StepLeft:+ Fill(ctx, ink, new Point(cx + s * 0.28, cy - s * 0.34), new Point(cx - s * 0.3, cy), new Point(cx + s * 0.28, cy + s * 0.34));+ break;+ case GlyphKind.StepRight:+ Fill(ctx, ink, new Point(cx - s * 0.28, cy - s * 0.34), new Point(cx + s * 0.3, cy), new Point(cx - s * 0.28, cy + s * 0.34));+ break;+ case GlyphKind.Edit:+ {+ // A pencil: a slanted shaft and its tip.+ Stroke(ctx, pen, new Point(cx - s * 0.34, cy + s * 0.34), new Point(cx - s * 0.2, cy + s * 0.06), new Point(cx + s * 0.2, cy - s * 0.34),+ new Point(cx + s * 0.34, cy - s * 0.2), new Point(cx - s * 0.06, cy + s * 0.2), new Point(cx - s * 0.34, cy + s * 0.34));+ break;+ }+ case GlyphKind.Freeze:+ {+ // Three crossing strokes: frozen.+ double d = s * 0.4;+ for (int i = 0; i < 3; i++)+ {+ double a = Math.PI / 2 + i * Math.PI / 3;+ ctx.DrawLine(pen, new Point(cx + Math.Cos(a) * d, cy + Math.Sin(a) * d), new Point(cx - Math.Cos(a) * d, cy - Math.Sin(a) * d));+ }+ break;+ }+ case GlyphKind.PopOut:+ {+ double d = s * 0.36;+ ctx.DrawRectangle(null, pen, new RoundedRect(new Rect(cx - d, cy - d * 0.6, d * 1.4, d * 1.6), 1));+ Stroke(ctx, pen, new Point(cx, cy - d), new Point(cx + d, cy - d), new Point(cx + d, cy));+ ctx.DrawLine(pen, new Point(cx + d, cy - d), new Point(cx + d * 0.1, cy - d * 0.1));+ break;+ }+ case GlyphKind.Cycle:+ {+ double rr = s * 0.34;+ var g = new StreamGeometry();+ using (var c = g.Open())+ {+ c.BeginFigure(new Point(cx + rr, cy), false);+ c.ArcTo(new Point(cx, cy - rr), new Size(rr, rr), 0, true, SweepDirection.Clockwise);+ c.EndFigure(false);+ }+ ctx.DrawGeometry(null, pen, g);+ Stroke(ctx, pen, new Point(cx - s * 0.12, cy - rr - s * 0.14), new Point(cx, cy - rr), new Point(cx - s * 0.12, cy - rr + s * 0.14));+ break;+ }+ }+ }++ private static void Fill(DrawingContext ctx, IBrush ink, params Point[] pts)+ {+ var g = new StreamGeometry();+ using (var c = g.Open())+ {+ c.BeginFigure(pts[0], true);+ for (int i = 1; i < pts.Length; i++) c.LineTo(pts[i]);+ c.EndFigure(true);+ }+ ctx.DrawGeometry(ink, null, g);+ }++ private static void Stroke(DrawingContext ctx, IPen pen, params Point[] pts)+ {+ var g = new StreamGeometry();+ using (var c = g.Open())+ {+ c.BeginFigure(pts[0], false);+ for (int i = 1; i < pts.Length; i++) c.LineTo(pts[i]);+ c.EndFigure(false);+ }+ ctx.DrawGeometry(null, pen, g);+ }++ /// <summary>An existing caption followed by a drawn chevron whose ink follows the text's+ /// foreground — for dropdown captions that used to end in a typed "▾".</summary>+ public static StackPanel WithChevron(TextBlock text, double glyphSize = 8)+ {+ var chev = new Glyph(GlyphKind.ChevronDown, glyphSize);+ chev.Bind(ForegroundProperty, text.GetObservable(TextBlock.ForegroundProperty));+ return new StackPanel+ {+ Orientation = Avalonia.Layout.Orientation.Horizontal, Spacing = 5,+ HorizontalAlignment = text.HorizontalAlignment, VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center,+ Children = { text, chev },+ };+ }++ /// <summary>A label followed by a glyph (a "Volume ▾" style dropdown caption).</summary>+ public static StackPanel Labeled(string text, GlyphKind kind, double fontSize = 11, double glyphSize = 8, double spacing = 5)+ => new()+ {+ Orientation = Avalonia.Layout.Orientation.Horizontal, Spacing = spacing,+ VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center,+ Children = { new TextBlock { Text = text, FontSize = fontSize, VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center }, new Glyph(kind, glyphSize) },+ };+}diff --git a/src/managed/Nota.App/Controls/GrMeter.cs b/src/managed/Nota.App/Controls/GrMeter.csindex 62d48a92..b8dec880 100644--- a/src/managed/Nota.App/Controls/GrMeter.cs+++ b/src/managed/Nota.App/Controls/GrMeter.cs@@ -7,42 +7,46 @@ using Avalonia.Media;namespace Nota.App;- // Vertical gain-reduction meter (red bar from the top). Fed live GrDb (dB, >=0)- // on the UI tick; smooth attack + peak-hold decay so it reads like a hardware GR meter.+ // Vertical gain-reduction meter, hanging from the top: more compression reads as more+ // bar. Brass — reduction is the device's data, not an alert. No animation (the value is+ // set as it arrives) and the peak mark holds until clicked (almanac § level meters).internal sealed class GrMeter : Control{- private static readonly IBrush Sunken = NotaPalette.BgSunken;- private static readonly IBrush AccentBright = NotaPalette.AccentBright;+ private static readonly IBrush Ground = NotaPalette.BgSunken;+ private static readonly IBrush Bar = NotaPalette.Accent;+ private static readonly IBrush HoldInk = NotaPalette.AccentBright;private const double MaxDb = 24.0; // full-scale reduction- private static readonly IBrush Red = NotaPalette.Danger;- private double _shown; // smoothed displayed GR (dB)- private double _hold; private int _holdAge;+ private double _gr, _hold;++ public GrMeter() => ToolTip.SetTip(this, "Clear the peak hold");- private double _gr;public double GrDb{get => _gr;set{_gr = value < 0 ? 0 : value;- // Instant attack, slow release; short peak-hold on the max.- _shown = _gr > _shown ? _gr : _shown * 0.80 + _gr * 0.20;- if (_gr >= _hold) { _hold = _gr; _holdAge = 0; }- else if (++_holdAge > 12) { _hold = _hold * 0.85; }+ if (_gr > _hold) _hold = _gr;InvalidateVisual();}}+ protected override void OnPointerPressed(Avalonia.Input.PointerPressedEventArgs e)+ {+ if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;+ _hold = _gr; InvalidateVisual(); e.Handled = true;+ }+public override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Sunken, null, new Rect(0, 0, w, h), 3, 3);- double frac = System.Math.Clamp(_shown / MaxDb, 0, 1);+ ctx.DrawRectangle(Ground, null, new RoundedRect(new Rect(0, 0, w, h), NotaRadius.ClipValue));+ double frac = System.Math.Clamp(_gr / MaxDb, 0, 1);if (frac > 0.001)- ctx.DrawRectangle(Red, null, new Rect(0, 0, w, frac * h), 3, 3); // from the top down+ ctx.FillRectangle(Bar, new Rect(0, 0, w, frac * h));double hy = System.Math.Clamp(_hold / MaxDb, 0, 1) * h;if (hy > 1)- ctx.DrawLine(new Pen(AccentBright, 1), new Point(0, hy), new Point(w, hy)); // peak-hold tick+ ctx.FillRectangle(HoldInk, new Rect(0, hy - 1, w, 2));}}diff --git a/src/managed/Nota.App/Controls/GrainShapeIcon.cs b/src/managed/Nota.App/Controls/GrainShapeIcon.csindex 4afbe34d..98811470 100644--- a/src/managed/Nota.App/Controls/GrainShapeIcon.cs+++ b/src/managed/Nota.App/Controls/GrainShapeIcon.cs@@ -14,7 +14,7 @@ namespace Nota.App;internal sealed class GrainShapeIcon : Control{private readonly int _shape;- public IBrush Stroke { get; set; } = Brushes.Gray;+ public IBrush Stroke { get; set; } = NotaPalette.TextTertiary;public GrainShapeIcon(int shape) { _shape = shape; Width = 19; Height = 13; }private static double Win(int shape, double x) => shape switchdiff --git a/src/managed/Nota.App/Controls/GrainWaveViz.cs b/src/managed/Nota.App/Controls/GrainWaveViz.csindex af46c448..d970023e 100644--- a/src/managed/Nota.App/Controls/GrainWaveViz.cs+++ b/src/managed/Nota.App/Controls/GrainWaveViz.cs@@ -21,13 +21,13 @@ internal sealed class GrainWaveViz : Controlprivate static readonly IBrush Bg = NotaPalette.BgSunken;private static readonly IBrush Wave = NotaPalette.Accent;private static readonly IPen MidLine = new Pen(NotaPalette.GridBar, 1);- private static readonly IPen GridPen = new Pen(NotaPalette.Wash(NotaPalette.BorderStrong, 0x55), 1);+ private static readonly IPen GridPen = NotaGraph.GridPen;private static readonly IBrush SprayFill = NotaPalette.Wash(NotaPalette.Accent, 0x16);private static readonly IPen SprayEdge = new Pen(NotaPalette.Wash(NotaPalette.Accent, 0x55), 1);private static readonly IPen PosPen = new Pen(NotaPalette.Wash(NotaPalette.AccentBright, 0x9A), 1) { DashStyle = DashStyle.Dash };private static readonly IBrush PlayCol = NotaPalette.Success;private static readonly IBrush GridText = NotaPalette.TextTertiary;- private static readonly Typeface Mono = new("monospace");+ private static readonly Typeface Mono = NotaFonts.Mono;private float[] _peaks = Array.Empty<float>();private double _dur, _pos, _spray, _grPerSec;@@ -45,7 +45,7 @@ internal sealed class GrainWaveViz : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Bg, null, new Rect(0, 0, w, h), 4, 4);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double cy = h / 2;// Time grid + labels behind the waveform.@@ -56,7 +56,7 @@ internal sealed class GrainWaveViz : Control{double x = tt / _dur * w;ctx.DrawLine(GridPen, new Point(x, 0), new Point(x, h));- string lbl = _dur >= 1 ? $"{tt:0.##}s" : $"{(int)Math.Round(tt * 1000)}";+ string lbl = _dur >= 1 ? $"{tt:0.##}\u2009s" : $"{(int)Math.Round(tt * 1000)}";ctx.DrawText(new FormattedText(lbl, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, GridText), new Point(x + 2, h - 11));}}diff --git a/src/managed/Nota.App/Controls/Inactive.cs b/src/managed/Nota.App/Controls/Inactive.csnew file mode 100644index 00000000..3368a9b9--- /dev/null+++ b/src/managed/Nota.App/Controls/Inactive.cs@@ -0,0 +1,85 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// Inactive, drawn to the almanac (§ States): a section that is switched off loses its brass+// and its text drops to Ink 6 — its ground, geometry and numbers stay where they are, so the+// layout never jumps and a value stays readable. Opacity is never used for this: a faded+// control's contrast depends on whatever sits behind it.+//+// Set() recolours a subtree in place and remembers what it replaced, so switching back+// restores the exact colours. `interactive` keeps it usable — a bypassed device can still be+// tweaked — otherwise it also stops taking the pointer. Views that repaint a colour on every+// tick should call Set() again after their own paint.++using System.Collections.Generic;+using System.Linq;+using System.Runtime.CompilerServices;+using Avalonia;+using Avalonia.Controls;+using Avalonia.Controls.Shapes;+using Avalonia.Media;+using Avalonia.VisualTree;++namespace Nota.App;++internal static class Inactive+{+ private static readonly ConditionalWeakTable<AvaloniaObject, Dictionary<AvaloniaProperty, object?>> Saved = new();++ public static void Set(Control root, bool inactive, bool interactive = false)+ {+ if (!interactive) root.IsHitTestVisible = !inactive;+ foreach (var v in root.GetVisualDescendants().Prepend(root)) Visit(v, inactive);+ }++ private static bool IsBrass(object? brush)+ => ReferenceEquals(brush, NotaPalette.Accent) || ReferenceEquals(brush, NotaPalette.AccentBright)+ || ReferenceEquals(brush, NotaPalette.AccentHover) || ReferenceEquals(brush, NotaPalette.BorderBrass);++ private static void Visit(Visual v, bool inactive)+ {+ switch (v)+ {+ case TextBlock tb:+ Swap(tb, TextBlock.ForegroundProperty, inactive, NotaPalette.TextDisabled);+ break;+ case Glyph g:+ Swap(g, Glyph.ForegroundProperty, inactive, NotaPalette.TextDisabled);+ break;+ case Knob k:+ k.IsDim = inactive;+ break;+ case SliderTrack st:+ st.IsDim = inactive;+ break;+ case SwitchTrack sw:+ sw.IsDim = inactive;+ break;+ case Border b:+ if (inactive ? IsBrass(b.Background) : true) Swap(b, Border.BackgroundProperty, inactive, NotaPalette.BorderStrong, onlyIf: IsBrass);+ if (inactive ? IsBrass(b.BorderBrush) : true) Swap(b, Border.BorderBrushProperty, inactive, NotaPalette.BorderDefault, onlyIf: IsBrass);+ break;+ case Shape sh:+ Swap(sh, Shape.FillProperty, inactive, NotaPalette.BorderStrong, onlyIf: IsBrass);+ Swap(sh, Shape.StrokeProperty, inactive, NotaPalette.BorderStrong, onlyIf: IsBrass);+ break;+ }+ }++ private static void Swap(AvaloniaObject o, AvaloniaProperty p, bool inactive, object dim, System.Func<object?, bool>? onlyIf = null)+ {+ var saved = Saved.GetOrCreateValue(o);+ if (inactive)+ {+ var cur = o.GetValue(p);+ if (ReferenceEquals(cur, dim)) return;+ if (onlyIf is not null && !onlyIf(cur)) return;+ saved[p] = cur;+ o.SetValue(p, dim);+ }+ else if (saved.Remove(p, out var orig))+ {+ if (ReferenceEquals(o.GetValue(p), dim)) o.SetValue(p, orig);+ }+ }+}diff --git a/src/managed/Nota.App/Controls/Knob.cs b/src/managed/Nota.App/Controls/Knob.csindex 73e6a2b6..c522b045 100644--- a/src/managed/Nota.App/Controls/Knob.cs+++ b/src/managed/Nota.App/Controls/Knob.cs@@ -1,10 +1,16 @@// SPDX-License-Identifier: AGPL-3.0-only// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.//-// A rotary knob for device / instrument parameters (mockup style): a faint ring,-// a brass value arc over a 270° sweep, and a pointer line. Drag vertically to-// change (up = increase; Ctrl/⌘/Shift = fine), double-click resets. Same public API as MiniFader (Value / max / Accent /-// ValueChanged / GestureBegin / GestureEnd) so it drops into the plugin editors.+// A rotary knob for device / instrument parameters, drawn to the almanac: a 270° groove+// in the well colour, the value arc over it, a raised cap and a Brass Light pointer —+// all laid out on a 52-unit grid (groove r 21 · stroke 5, cap r 14, pointer 2.4 wide+// reaching the cap's edge) and scaled to the knob's size. Drag vertically to change+// (up = increase; Ctrl/⌘/Shift = fine), double-click resets. Same public API as+// MiniFader (Value / max / Accent / ValueChanged / GestureBegin / GestureEnd) so it+// drops into the plugin editors.+//+// A knob exists in exactly three sizes — 34 secondary · 36 regular · 44 main. Width and+// Height are coerced onto that scale, so a call site asking for 30 or 40 gets 34 or 44.using System;using Avalonia;@@ -16,20 +22,49 @@ namespace Nota.App;public sealed class Knob : Control{- private static readonly IBrush Groove = NotaPalette.BgSunken; // dark track groove- private static readonly IBrush TrackArc = NotaPalette.BorderStrong; // Brush.BorderStrong (neutral value arc)- private static readonly IBrush Brass = NotaPalette.Accent; // Brush.Accent- private static readonly IBrush Pointer = NotaPalette.TextPrimary; // Brush.TextPrimary+ private static readonly IBrush Groove = NotaPalette.BgSunken; // Well+ private static readonly IBrush NeutralArc = NotaPalette.BorderStrong; // a knob off the audio path, or disabled+ private static readonly IBrush Brass = NotaPalette.Accent;+ private static readonly IBrush Cap = NotaPalette.Panel;+ private static readonly IBrush CapEdge = NotaPalette.BorderStrong;+ private static readonly IBrush CapEdgeOff = NotaPalette.BorderDefault;+ private static readonly IBrush PointerBrass = NotaPalette.AccentBright; // Brass Light+ private static readonly IBrush PointerNeutral = NotaPalette.TextStrong;+ private static readonly IBrush PointerOff = NotaPalette.TextTertiary;private const double StartDeg = 135.0; // down-leftprivate const double SweepDeg = 270.0; // clockwise to down-right+ // The almanac draws the knob in a 52-unit box; everything scales from it.+ private const double Grid = 52, GrooveR = 21, GrooveStroke = 5, CapR = 14, PointerW = 2.4, PointerLen = 12;++ public const double SizeSecondary = NotaSize.KnobSecondary, SizeRegular = NotaSize.KnobRegular, SizeMain = NotaSize.KnobMain;++ static Knob()+ {+ WidthProperty.OverrideMetadata<Knob>(new StyledPropertyMetadata<double>(double.NaN, coerce: (_, v) => Snap(v)));+ HeightProperty.OverrideMetadata<Knob>(new StyledPropertyMetadata<double>(double.NaN, coerce: (_, v) => Snap(v)));+ }++ /// <summary>Onto the three-size scale: up to 34 is secondary, under 40 regular, else main.</summary>+ public static double Snap(double v) => double.IsNaN(v) ? v : v <= SizeSecondary ? SizeSecondary : v < 40 ? SizeRegular : SizeMain;++ /// <summary>The paired light tone of a role chroma, for the pointer on a chroma arc.</summary>+ private static IBrush PointerFor(IBrush arc)+ => ReferenceEquals(arc, NotaPalette.Teal) ? NotaPalette.TealBright+ : ReferenceEquals(arc, NotaPalette.Rose) ? NotaPalette.RoseBright+ : arc;+/// <summary>Brass value arc instead of neutral grey.</summary>public bool Accent { get; init; }/// <summary>Overrides the value-arc colour (e.g. teal for modulation knobs).</summary>public IBrush? ArcColor { get; init; }+ /// <summary>Drawn as inactive (no brass) while still taking input — see Inactive.</summary>+ public bool IsDim { get => _dim; set { if (_dim == value) return; _dim = value; InvalidateVisual(); } }+ private bool _dim;+/// <summary>Value restored on double-click (NaN = no reset).</summary>public double Default { get; set; } = double.NaN;@@ -48,15 +83,22 @@ public sealed class Knob : Controlpublic double Value{get => _value;- set { _value = Math.Clamp(value, 0, _max); InvalidateVisual(); }+ set { _value = Math.Clamp(value, 0, _max); InvalidateVisual(); ValueSet?.Invoke(); }}+ /// <summary>Raised whenever the value moves — by hand, by reset or by live follow — so+ /// a cell can re-evaluate <see cref="IsModified"/>.</summary>+ public event Action? ValueSet;++ /// <summary>The value differs from the parameter's default.</summary>+ public bool IsModified => !double.IsNaN(Default) && Math.Abs(_value - Math.Clamp(Default, 0, _max)) > 1e-4 * _max;+public Knob(double value = 1.0, double max = 1.0){_max = max <= 0 ? 1.0 : max;_value = Math.Clamp(value, 0, _max);- Width = 38;- Height = 38;+ Width = SizeRegular;+ Height = SizeRegular;Cursor = new Cursor(StandardCursorType.SizeNorthSouth);}@@ -74,6 +116,7 @@ public sealed class Knob : Control_value = d;InvalidateVisual();ValueChanged?.Invoke(_value);+ ValueSet?.Invoke();GestureEnd?.Invoke();}e.Handled = true;@@ -101,6 +144,7 @@ public sealed class Knob : Control_value = v;InvalidateVisual();ValueChanged?.Invoke(_value);+ ValueSet?.Invoke();}protected override void OnPointerReleased(PointerReleasedEventArgs e)@@ -110,45 +154,55 @@ public sealed class Knob : Controle.Pointer.Capture(null);}+ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)+ {+ base.OnPropertyChanged(change);+ if (change.Property == IsEffectivelyEnabledProperty) InvalidateVisual();+ }+public override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;// Transparent fill makes the whole knob area hit-testable (not just the arc).ctx.FillRectangle(Brushes.Transparent, new Rect(0, 0, w, h));+ double k = Math.Min(w, h) / Grid; // units → pxdouble cx = w / 2, cy = h / 2;- double r = Math.Min(w, h) / 2 - 3;- if (r <= 1) return;double frac = _max > 0 ? _value / _max : 0;+ bool on = IsEffectivelyEnabled && !_dim;++ var arcBrush = !on ? NeutralArc : ArcColor ?? (Accent ? Brass : NeutralArc);+ var pointer = !on ? PointerOff : ArcColor is { } c ? PointerFor(c) : Accent ? PointerBrass : PointerNeutral;- var arcBrush = ArcColor ?? (Accent ? Brass : TrackArc);- double aw = Math.Max(2.5, r * 0.22); // arc thickness scales with size (≈ mockup 4/17)+ // Groove, then the value arc over it — round caps, as in the almanac.+ double r = GrooveR * k, sw = GrooveStroke * k;+ ctx.DrawGeometry(null, new Pen(Groove, sw, lineCap: PenLineCap.Round), Arc(cx, cy, r, 0, 1));+ if (frac > 0.001)+ ctx.DrawGeometry(null, new Pen(arcBrush, sw, lineCap: PenLineCap.Round), Arc(cx, cy, r, 0, frac));- // Dark 270° track groove, then the value arc over it (gauge style).- DrawArc(ctx, cx, cy, r, 0, 1, new Pen(Groove, aw, lineCap: PenLineCap.Round));- if (frac > 0.001) DrawArc(ctx, cx, cy, r, 0, frac, new Pen(arcBrush, aw, lineCap: PenLineCap.Round));+ // Raised cap with a 1px edge.+ ctx.DrawEllipse(Cap, new Pen(on ? CapEdge : CapEdgeOff, 1), new Point(cx, cy), CapR * k, CapR * k);- // Pointer line from the centre out toward the rim at the value angle.+ // Pointer from the centre to the cap's edge.double a = (StartDeg + frac * SweepDeg) * Math.PI / 180.0;- double dx = Math.Cos(a), dy = Math.Sin(a);- ctx.DrawLine(new Pen(Pointer, 2, lineCap: PenLineCap.Round),- new Point(cx, cy),- new Point(cx + dx * r * 0.66, cy + dy * r * 0.66));+ double len = PointerLen * k;+ ctx.DrawLine(new Pen(pointer, PointerW * k, lineCap: PenLineCap.Round),+ new Point(cx, cy), new Point(cx + Math.Cos(a) * len, cy + Math.Sin(a) * len));}- // Draws the sweep arc from fraction t0..t1 as a short polyline (robust, cheap).- private static void DrawArc(DrawingContext ctx, double cx, double cy, double r, double t0, double t1, IPen pen)+ // The sweep from fraction t0..t1 as a true arc.+ private static StreamGeometry Arc(double cx, double cy, double r, double t0, double t1){- const int seg = 40;- int i0 = (int)Math.Floor(t0 * seg), i1 = (int)Math.Ceiling(t1 * seg);- Point? prev = null;- for (int i = i0; i <= i1; i++)+ double a0 = (StartDeg + t0 * SweepDeg) * Math.PI / 180.0;+ double a1 = (StartDeg + t1 * SweepDeg) * Math.PI / 180.0;+ var g = new StreamGeometry();+ using (var c = g.Open()){- double t = Math.Clamp((double)i / seg, t0, t1);- double a = (StartDeg + t * SweepDeg) * Math.PI / 180.0;- var p = new Point(cx + Math.Cos(a) * r, cy + Math.Sin(a) * r);- if (prev is { } pp) ctx.DrawLine(pen, pp, p);- prev = p;+ c.BeginFigure(new Point(cx + Math.Cos(a0) * r, cy + Math.Sin(a0) * r), false);+ c.ArcTo(new Point(cx + Math.Cos(a1) * r, cy + Math.Sin(a1) * r), new Size(r, r), 0,+ (t1 - t0) * SweepDeg > 180, SweepDirection.Clockwise);+ c.EndFigure(false);}+ return g;}}diff --git a/src/managed/Nota.App/Controls/LengthGateViz.cs b/src/managed/Nota.App/Controls/LengthGateViz.csindex 419beea1..2ead5a62 100644--- a/src/managed/Nota.App/Controls/LengthGateViz.cs+++ b/src/managed/Nota.App/Controls/LengthGateViz.cs@@ -17,13 +17,13 @@ internal sealed class LengthGateViz : Control{private static readonly IBrush Well = NotaPalette.BgSunken;private static readonly IBrush BorderIn = NotaPalette.GraphBorder;- private static readonly IBrush Track = NotaPalette.BgApp;+ private static readonly IBrush Track = NotaPalette.BgSunken;private static readonly IBrush Amber = NotaPalette.Accent;private static readonly IBrush AmberDim = NotaPalette.Wash(NotaPalette.Accent, 0x88);private static readonly IBrush Muted = NotaPalette.TextTertiary;- private static readonly IBrush Axis = NotaPalette.TextDisabled;+ private static readonly IBrush Axis = NotaPalette.TextAxis;private static readonly IBrush Sub = NotaPalette.TextSecondary;- private static readonly Typeface Mono = new(new FontFamily("Geist Mono, monospace"));+ private static readonly Typeface Mono = NotaFonts.Mono;private const double FullMs = 2000.0;private double _minMs, _maxMs, _bpm = 120;@@ -40,12 +40,12 @@ internal sealed class LengthGateViz : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Well, new Pen(BorderIn, 1), new Rect(0, 0, w, h), 6, 6);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double padX = 8, padTop = 6, padBot = 14;// Header.- ctx.DrawText(new FormattedText("GATE", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, new Typeface(FontFamily.Default, FontStyle.Normal, FontWeight.Bold), 8, Muted), new Point(padX, padTop));+ ctx.DrawText(new FormattedText("GATE", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, NotaFonts.SansBold, 8, Muted), new Point(padX, padTop));double bars = _bpm > 0 ? 4.0 * 60000.0 / _bpm : 2000; // one 4/4 bar in ms- var hdr = new FormattedText($"1 bar at {_bpm:0} BPM", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, Muted);+ var hdr = new FormattedText($"1 bar at {_bpm:0}\u2009BPM", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, Muted);ctx.DrawText(hdr, new Point(w - padX - hdr.Width, padTop));double labelW = 26;@@ -61,7 +61,7 @@ internal sealed class LengthGateViz : Controldouble frac = Math.Clamp(ms / FullMs, 0, 1);if (frac > 0.001)ctx.DrawRectangle(idx == 0 ? Amber : AmberDim, null, new Rect(x0, y, Math.Max(2, frac * (x1 - x0)), rowH), 3, 3);- var vt = new FormattedText(ms >= 1000 ? $"{ms / 1000:0.00} s" : $"{ms:0} ms", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, Sub);+ var vt = new FormattedText(ms >= 1000 ? $"{ms / 1000:0.00}\u2009s" : $"{ms:0}\u2009ms", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, Sub);double vx = x0 + frac * (x1 - x0) + 5; if (vx + vt.Width > x1) vx = x1 - vt.Width - 5;ctx.DrawText(vt, new Point(vx, y + rowH / 2 - vt.Height / 2));}@@ -71,6 +71,6 @@ internal sealed class LengthGateViz : Control// Axis ticks 0 / 500ms / 1.0s / 2.0s.void Tick(double ms, string lbl) { double tx = x0 + Math.Clamp(ms / FullMs, 0, 1) * (x1 - x0); var ft = new FormattedText(lbl, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 7, Axis); ctx.DrawText(ft, new Point(Math.Min(tx, x1 - ft.Width), bot + 2)); }- Tick(0, "0"); Tick(500, "500 ms"); Tick(1000, "1.0 s"); Tick(2000, "2.0 s");+ Tick(0, "0"); Tick(500, "500\u2009ms"); Tick(1000, "1.0\u2009s"); Tick(2000, "2.0\u2009s");}}diff --git a/src/managed/Nota.App/Controls/MeterBar.cs b/src/managed/Nota.App/Controls/MeterBar.csindex f327b10c..3612b2a8 100644--- a/src/managed/Nota.App/Controls/MeterBar.cs+++ b/src/managed/Nota.App/Controls/MeterBar.cs@@ -1,120 +1,135 @@// SPDX-License-Identifier: AGPL-3.0-only-using Nota.Application;// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.//-// M6-2: stereo peak/RMS level meter. Fed a NotaMeter each UI tick (~30 Hz);-// the bar rises instantly and falls with a fixed decay, with a slower peak-hold-// tick. dB-mapped (-60..0) with green/amber/red zones. Works vertical (track-// headers) or horizontal (master bus in the transport bar).+// Stereo level meter, drawn to the almanac (§ Visualisations · level meters):+// · each channel 11px wide with a 5px step between, radius 2, on the well ground —+// narrower hosts (a 64px track header) scale both down in the same proportion;+// · three zones, bottom to top: Signal up to −6 dB, Caution up to 0, Alert above 0;+// · no animation: the level is set the moment a reading arrives (a meter that eases+// lies about the sound), and the peak mark neither blinks nor falls on its own —+// it holds until the meter is clicked or reset.+// Works vertical (mixer strips, track headers) or horizontal (master in the transport).using System;using Avalonia;using Avalonia.Controls;+using Avalonia.Input;using Avalonia.Media;+using Nota.Application;namespace Nota.App;public sealed class MeterBar : Control{- // Ember Graphite meter colours (NotaTheme: Success / Warning / Danger, BgSunken).- private static readonly IBrush GreenBrush = NotaPalette.Success;- private static readonly IBrush AmberBrush = NotaPalette.Warning;- private static readonly IBrush RedBrush = NotaPalette.Danger;- private static readonly IBrush Sunken = NotaPalette.BgSunken;- private static readonly IBrush HoldBrush = NotaPalette.TextPrimary;-- private const double DbFloor = -60.0;- private const double AmberDb = (-6.0 - DbFloor) / (0.0 - DbFloor); // −6 dB, normalised- private const double FallPerTick = 0.05; // ~ full fall in ~0.7 s at 30 Hz- private const double HoldFallPerTick = 0.012; // peak-hold drifts down slowly+ private static readonly IBrush Ground = NotaPalette.BgSunken;private readonly bool _horizontal;- private double _levelL, _levelR; // displayed (decayed) 0..1- private double _holdL, _holdR; // peak-hold 0..1+ private double _levelL, _levelR; // 0..1 on the meter scale+ private double _holdL, _holdR; // peak hold, 0..1public MeterBar(bool horizontal = false){_horizontal = horizontal;if (horizontal) { Height = 12; MinWidth = 80; }- else { Width = 10; MinHeight = 40; }+ else { Width = MeterScale.StereoWidth; MinHeight = 40; }+ ToolTip.SetTip(this, "Clear the peak hold");}- /// <summary>Feed a fresh reading; the bar attacks up instantly and decays down.</summary>+ /// <summary>Feed a fresh reading. The bar takes the value at once; the hold keeps the maximum.</summary>public void Push(NotaMeter m){- _levelL = Step(_levelL, Norm(m.PeakL), FallPerTick);- _levelR = Step(_levelR, Norm(m.PeakR), FallPerTick);- _holdL = Math.Max(_levelL, _holdL - HoldFallPerTick);- _holdR = Math.Max(_levelR, _holdR - HoldFallPerTick);+ _levelL = MeterScale.Norm(m.PeakL);+ _levelR = MeterScale.Norm(m.PeakR);+ _holdL = Math.Max(_holdL, _levelL);+ _holdR = Math.Max(_holdR, _levelR);InvalidateVisual();}- /// <summary>Clears the meter to silence (e.g. on stop).</summary>+ /// <summary>Clears the meter and its peak hold (e.g. on stop).</summary>public void Reset(){_levelL = _levelR = _holdL = _holdR = 0;InvalidateVisual();}- private static double Step(double cur, double target, double fall)- => target >= cur ? target : Math.Max(target, cur - fall);-- private static double Norm(float amp)+ protected override void OnPointerPressed(PointerPressedEventArgs e){- if (amp <= 1e-5f) return 0;- double db = AudioMath.LinToDb(amp);- return Math.Clamp((db - DbFloor) / (0.0 - DbFloor), 0.0, 1.0);+ if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;+ _holdL = _levelL; _holdR = _levelR;+ InvalidateVisual();+ e.Handled = true;}public override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;+ double across = _horizontal ? h : w;+ var (ch, gap, off) = MeterScale.Channels(across);+ Rect A(double o) => _horizontal ? new Rect(0, o, w, ch) : new Rect(o, 0, ch, h);+ MeterScale.DrawChannel(ctx, A(off), _levelL, _holdL, _horizontal);+ MeterScale.DrawChannel(ctx, A(off + ch + gap), _levelR, _holdR, _horizontal);+ }+}- if (_horizontal)- {- double gap = 2, chH = (h - gap) / 2;- DrawChannel(ctx, new Rect(0, 0, w, chH), _levelL, _holdL);- DrawChannel(ctx, new Rect(0, chH + gap, w, chH), _levelR, _holdR);- }- else- {- double gap = 2, chW = (w - gap) / 2;- DrawChannel(ctx, new Rect(0, 0, chW, h), _levelL, _holdL);- DrawChannel(ctx, new Rect(chW + gap, 0, chW, h), _levelR, _holdR);- }+/// <summary>The shared meter scale and zones, so every level meter reads the same.</summary>+internal static class MeterScale+{+ public const double ChannelW = 11, Step = 5, StereoWidth = ChannelW * 2 + Step;+ public const double FloorDb = -60, CeilDb = 6;++ private static readonly IBrush Ground = NotaPalette.BgSunken;++ public static double Norm(float amp)+ {+ if (amp <= 1e-5f) return 0;+ double db = AudioMath.LinToDb(amp);+ return Math.Clamp((db - FloorDb) / (CeilDb - FloorDb), 0, 1);+ }++ public static double NormDb(double db) => Math.Clamp((db - FloorDb) / (CeilDb - FloorDb), 0, 1);++ public static readonly double CautionAt = NormDb(-6), AlertAt = NormDb(0);++ /// <summary>The zone colour at a point on the scale.</summary>+ public static IBrush Zone(double norm) => norm >= AlertAt ? NotaPalette.Danger : norm >= CautionAt ? NotaPalette.Warning : NotaPalette.Success;++ /// <summary>Channel width, gap and leading offset for a stereo meter <paramref name="across"/> wide.</summary>+ public static (double Ch, double Gap, double Offset) Channels(double across)+ {+ if (across >= StereoWidth) return (ChannelW, Step, (across - StereoWidth) / 2);+ double k = across / StereoWidth;+ double gap = Math.Max(1, Step * k);+ return ((across - gap) / 2, gap, 0);}- // Discrete LED segments (HANDOFF §4: "segments, not gradients"). Lit cells- // are green; the peak-hold tick turns amber ≥ −6 dB and red at clip (0 dB).- private void DrawChannel(DrawingContext ctx, Rect area, double level, double hold)+ /// <summary>One channel: ground, zone-coloured level, a 2px hold mark in its zone colour.</summary>+ public static void DrawChannel(DrawingContext ctx, Rect area, double level, double hold, bool horizontal){- ctx.DrawRectangle(Sunken, null, area, 2, 2);- double longLen = _horizontal ? area.Width : area.Height;- if (longLen <= 0) return;- const double gap = 1;- int cells = Math.Max(6, (int)(longLen / 4));- double cell = (longLen - (cells - 1) * gap) / cells;- if (cell <= 0) return;-- for (int i = 0; i < cells; i++)+ double r = Math.Min(NotaRadius.ClipValue, Math.Min(area.Width, area.Height) / 2);+ ctx.DrawRectangle(Ground, null, new RoundedRect(area, r));+ double len = horizontal ? area.Width : area.Height;+ if (len <= 0) return;++ void Seg(double from, double to, IBrush ink){- if ((i + 0.5) / cells > level) break; // lit up to the level- double off = i * (cell + gap);- Rect r = _horizontal- ? new Rect(area.X + off, area.Y, cell, area.Height)- : new Rect(area.X, area.Bottom - off - cell, area.Width, cell);- ctx.FillRectangle(GreenBrush, r);+ if (to <= from) return;+ var rect = horizontal+ ? new Rect(area.X + from * len, area.Y, (to - from) * len, area.Height)+ : new Rect(area.X, area.Bottom - to * len, area.Width, (to - from) * len);+ ctx.FillRectangle(ink, rect);}+ Seg(0, Math.Min(level, CautionAt), NotaPalette.Success);+ Seg(CautionAt, Math.Min(level, AlertAt), NotaPalette.Warning);+ Seg(AlertAt, level, NotaPalette.Danger);if (hold > 0.02){- var tick = hold >= AmberDb ? (hold >= 0.995 ? RedBrush : AmberBrush) : HoldBrush;const double t = 2;- Rect tr = _horizontal- ? new Rect(area.X + area.Width * hold - t, area.Y, t, area.Height)- : new Rect(area.X, area.Bottom - area.Height * hold - t, area.Width, t);- ctx.FillRectangle(tick, tr);+ var mark = horizontal+ ? new Rect(area.X + Math.Clamp(hold * len - t, 0, len - t), area.Y, t, area.Height)+ : new Rect(area.X, area.Bottom - Math.Clamp(hold * len, t, len), area.Width, t);+ ctx.FillRectangle(Zone(hold), mark);}}}diff --git a/src/managed/Nota.App/Controls/MiniFader.cs b/src/managed/Nota.App/Controls/MiniFader.csindex 1640b0f1..c1d009c8 100644--- a/src/managed/Nota.App/Controls/MiniFader.cs+++ b/src/managed/Nota.App/Controls/MiniFader.cs@@ -49,10 +49,15 @@ public sealed class MiniFader : Control_value = Math.Clamp(value, 0, max);Height = 12;MinWidth = 40;+ Cursor = new Cursor(StandardCursorType.SizeNorthSouth); // almanac: vertical drag for every value control}+ private double _lastY;+protected override void OnPointerPressed(PointerPressedEventArgs e){+ // Left button only — right-click bubbles to the CV-modulate / MIDI Learn menu.+ if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;// Double-click resets to the default value (e.g. 0 dB for a track volume).if (e.ClickCount == 2 && Default >= 0){@@ -62,15 +67,20 @@ public sealed class MiniFader : Controlreturn;}_drag = true;+ _lastY = e.GetPosition(this).Y;e.Pointer.Capture(this);GestureBegin?.Invoke();- SetFromX(e.GetPosition(this).X);e.Handled = true;}protected override void OnPointerMoved(PointerEventArgs e){- if (_drag) SetFromX(e.GetPosition(this).X);+ if (!_drag) return;+ double y = e.GetPosition(this).Y, dy = _lastY - y; // up = increase, ~140px full range+ _lastY = y;+ if (dy == 0) return;+ bool fine = (e.KeyModifiers & (KeyModifiers.Shift | KeyModifiers.Control | KeyModifiers.Meta)) != 0;+ SetValue(_value + dy / (fine ? 1400.0 : 140.0) * _max);}protected override void OnPointerReleased(PointerReleasedEventArgs e)@@ -80,11 +90,9 @@ public sealed class MiniFader : Controle.Pointer.Capture(null);}- private void SetFromX(double x)+ private void SetValue(double raw){- double w = Bounds.Width;- if (w <= 0) return;- double v = Math.Clamp(x / w, 0, 1) * _max;+ double v = Math.Clamp(raw, 0, _max);if (Math.Abs(v - _value) < 1e-4) return;_value = v;InvalidateVisual();@@ -99,8 +107,10 @@ public sealed class MiniFader : Controldouble frac = _max > 0 ? _value / _max : 0;double fx = frac * w;- ctx.DrawRectangle(Track, null, new Rect(0, cy - 1.5, w, 3), 2, 2);- if (fx > 0) ctx.DrawRectangle(Accent ? FillAccent : Fill, null, new Rect(0, cy - 1.5, fx, 3), 2, 2);- ctx.DrawRectangle(Accent ? CapAccent : Cap, null, new Rect(Math.Clamp(fx - 4, 0, w - 8), cy - 4.5, 8, 9), 2, 2);+ // Almanac slider: 3px well track, fill, 6×7 handle (SliderTrack draws the same).+ ctx.DrawRectangle(Track, null, new Rect(0, cy - SliderTrack.TrackH / 2, w, SliderTrack.TrackH), NotaRadius.ClipValue, NotaRadius.ClipValue);+ if (fx > 0) ctx.DrawRectangle(Accent ? FillAccent : Fill, null, new Rect(0, cy - SliderTrack.TrackH / 2, fx, SliderTrack.TrackH), NotaRadius.ClipValue, NotaRadius.ClipValue);+ double hw = SliderTrack.HandleW, hh = SliderTrack.HandleH;+ ctx.DrawRectangle(Accent ? CapAccent : Cap, null, new Rect(Math.Clamp(fx - hw / 2, 0, w - hw), cy - hh / 2, hw, hh), NotaRadius.ClipValue, NotaRadius.ClipValue);}}diff --git a/src/managed/Nota.App/Controls/MonolithViews.cs b/src/managed/Nota.App/Controls/MonolithViews.csindex 521d8def..df3d67cc 100644--- a/src/managed/Nota.App/Controls/MonolithViews.cs+++ b/src/managed/Nota.App/Controls/MonolithViews.cs@@ -19,7 +19,7 @@ namespace Nota.App;internal sealed class MonolithWaveIcon : Control{private readonly int _w; private readonly bool _osc3;- public IBrush Stroke { get; set; } = Brushes.Gray;+ public IBrush Stroke { get; set; } = NotaPalette.TextTertiary;public MonolithWaveIcon(int wave, bool osc3) { _w = wave; _osc3 = osc3; Width = 14; Height = 8; }public override void Render(DrawingContext ctx)@@ -72,9 +72,9 @@ internal sealed class MonolithFilterCurve : Controlprivate static readonly IBrush Amber = NotaPalette.Accent;private static readonly IBrush AmberLit = NotaPalette.AccentBright;private static readonly IBrush Inset = NotaPalette.BgSunken;- private static readonly IBrush Grid = NotaPalette.SurfaceCard;+ private static readonly IBrush Grid = NotaGraph.Grid;private static readonly IBrush Fill = NotaPalette.Wash(NotaPalette.Accent, 0x1E);- private static readonly Typeface Mono = new("ui-monospace, monospace");+ private static readonly Typeface Mono = NotaFonts.Mono;private double _cut = 0.5, _reso;private bool _drag;@@ -132,12 +132,11 @@ internal sealed class MonolithFilterCurve : Controlfor (double x = 0; x <= w; x += 2) { var p = new Point(x, Y(x, w, h)); lc.LineTo(p); fc.LineTo(p); }fc.LineTo(new Point(w, h));}- ctx.DrawGeometry(Fill, null, fill);- ctx.DrawGeometry(null, new Pen(Amber, 1.5), line);+ ctx.DrawGeometry(null, new Pen(Amber, NotaGraph.PrimaryWidth), line);// freq · Q readout (top-right)double hz = 16 * Math.Pow(1250, _cut), q = _reso * 10;- string txt = (hz >= 1000 ? $"{hz / 1000:0.0} kHz" : $"{hz:0} Hz") + $" · Q {q:0.0}";+ string txt = (hz >= 1000 ? $"{hz / 1000:0.0}\u2009k" : $"{hz:0}\u2009Hz") + $" · Q {q:0.0}";var ft = new FormattedText(txt, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, AmberLit);ctx.DrawText(ft, new Point(w - ft.Width - 4, 3));@@ -175,7 +174,6 @@ internal sealed class MonolithEnvCurve : Controlfc.LineTo(new Point(xa, top)); fc.LineTo(new Point(xd, ys)); fc.LineTo(new Point(xs, ys)); fc.LineTo(new Point(w, bot));}var col = ((SolidColorBrush)Accent).Color;- ctx.DrawGeometry(new SolidColorBrush(Color.FromArgb(0x22, col.R, col.G, col.B)), null, fill);ctx.DrawGeometry(null, new Pen(Accent, 1.5), line);}}diff --git a/src/managed/Nota.App/Controls/NaBadge.cs b/src/managed/Nota.App/Controls/NaBadge.csindex f7bd51d5..6ce22175 100644--- a/src/managed/Nota.App/Controls/NaBadge.cs+++ b/src/managed/Nota.App/Controls/NaBadge.cs@@ -37,7 +37,7 @@ public sealed class NaBadge : Borderpublic NaBadge(){- CornerRadius = new CornerRadius(8); // Radius.Pill+ CornerRadius = NotaRadius.Pill;Padding = new Thickness(6, 1);Height = 16;VerticalAlignment = VerticalAlignment.Center;@@ -57,16 +57,17 @@ public sealed class NaBadge : Borderif (Kind == NaBadgeKind.Future){_label.Text = "N/A";- this.BindResource(BackgroundProperty, "Brush.AccentSubtle");- _label.BindResource(TextBlock.ForegroundProperty, "Brush.Warning");- ToolTip.SetTip(this, "Coming in future");+ // Neutral: "not built yet" is not active, selected or changed, so it takes no brass.+ this.BindResource(BackgroundProperty, "Brush.SurfaceRaised");+ _label.BindResource(TextBlock.ForegroundProperty, "Brush.TextTertiary");+ ToolTip.SetTip(this, "Not available yet");}else{_label.Text = "N/A";this.BindResource(BackgroundProperty, "Brush.SurfaceRaised");_label.BindResource(TextBlock.ForegroundProperty, "Brush.TextTertiary");- ToolTip.SetTip(this, "Not implemented yet");+ ToolTip.SetTip(this, "Not available yet");}}}diff --git a/src/managed/Nota.App/Controls/NotaGraph.cs b/src/managed/Nota.App/Controls/NotaGraph.csnew file mode 100644index 00000000..4b33fb70--- /dev/null+++ b/src/managed/Nota.App/Controls/NotaGraph.cs@@ -0,0 +1,127 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// The graph window every visualiser lives in (almanac § Visualisations). One window, one+// set of rules, so forty devices read as one instrument:+//+// ground Well · 1px Hairline frame · radius 4 · grid lines in the Grid colour+// axis labels mono 7–8 in Ink 7, in the corners — never full axes with ticks+// a title in caps 8 at the top-left, a legend inside the window with values+// the primary curve 1.8px brass, secondary curves 1.2–1.6px in their chroma+// nodes 7px with a 2px ground-coloured ring; the active one brass, the rest Ink 3+// no fills under curves, no gradients+//+// Chromas are assigned in a fixed order when a graph carries several sources:+// brass (primary) · teal · rose · steel. They never mean state.++using System.Globalization;+using Avalonia;+using Avalonia.Media;++namespace Nota.App;++internal static class NotaGraph+{+ public const double Radius = NotaRadius.ControlValue; // 4+ public const double PrimaryWidth = 1.8, SecondaryWidth = 1.4;+ public const double NodeD = 7, NodeRing = 2;+ public const double AxisSize = 7, TitleSize = 8;++ public static IBrush Ground => NotaPalette.BgSunken;+ public static IBrush Frame => NotaPalette.GraphBorder;+ public static IBrush Grid => NotaPalette.GridBeat;+ public static IBrush AxisInk => NotaPalette.TextAxis;+ public static IBrush TitleInk => NotaPalette.TextTertiary;++ /// <summary>The chroma for the n-th source in a graph: brass, teal, rose, steel.</summary>+ public static IBrush Chroma(int n) => (n % 4) switch+ {+ 0 => NotaPalette.Accent,+ 1 => NotaPalette.Teal,+ 2 => NotaPalette.Rose,+ _ => NotaPalette.Steel,+ };++ public static readonly IPen GridPen = new Pen(NotaPalette.GridBeat, 1);+ public static readonly IPen FramePen = new Pen(NotaPalette.GraphBorder, 1);+ public static readonly IPen PrimaryPen = new Pen(NotaPalette.Accent, PrimaryWidth, lineCap: PenLineCap.Round, lineJoin: PenLineJoin.Round);++ /// <summary>A secondary curve in its chroma.</summary>+ public static IPen SecondaryPen(IBrush chroma, double width = SecondaryWidth)+ => new Pen(chroma, width, lineCap: PenLineCap.Round, lineJoin: PenLineJoin.Round);++ /// <summary>The window: well ground, hairline frame, radius 4.</summary>+ public static void Window(DrawingContext ctx, Rect r)+ {+ var inner = r.Deflate(0.5);+ ctx.DrawRectangle(Ground, FramePen, new RoundedRect(inner, Radius));+ }++ /// <summary>An axis label in mono 7, Ink 7.</summary>+ public static FormattedText AxisText(string text, IBrush? ink = null, double size = AxisSize)+ => new(text, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, NotaFonts.Mono, size, ink ?? AxisInk);++ public enum Corner { TopLeft, TopRight, BottomLeft, BottomRight }++ /// <summary>Place an axis label in a corner of <paramref name="r"/>, inset 4px.</summary>+ public static void Axis(DrawingContext ctx, Rect r, Corner corner, string text, IBrush? ink = null)+ {+ var ft = AxisText(text, ink);+ const double pad = 4;+ double x = corner is Corner.TopLeft or Corner.BottomLeft ? r.X + pad : r.Right - pad - ft.Width;+ double y = corner is Corner.TopLeft or Corner.TopRight ? r.Y + pad - 1 : r.Bottom - pad - ft.Height + 1;+ ctx.DrawText(ft, new Point(x, y));+ }++ /// <summary>The graph title: caps 8, top-left, inside the window.</summary>+ public static void Title(DrawingContext ctx, Rect r, string title)+ {+ var ft = new FormattedText(title.ToUpperInvariant(), CultureInfo.InvariantCulture, FlowDirection.LeftToRight,+ NotaFonts.SansBold, TitleSize, TitleInk) { };+ ctx.DrawText(ft, new Point(r.X + 6, r.Y + 4));+ }++ /// <summary>A curve node: 7px, ringed in the ground colour so the curve does not cut it.</summary>+ public static void Node(DrawingContext ctx, Point p, bool active, IBrush? ink = null)+ {+ var fill = ink ?? (active ? NotaPalette.Accent : NotaPalette.TextSecondary);+ ctx.DrawEllipse(fill, new Pen(Ground, NodeRing), p, NodeD / 2 + NodeRing / 2, NodeD / 2 + NodeRing / 2);+ }++ public enum Mark { Line, Dashed, Area }++ /// <summary>A legend inside the window, right-aligned at <paramref name="right"/>: each item is a+ /// drawn sample (solid line, dashed line or area swatch) followed by its word — never a typed+ /// ─ ┄ ▩ character.</summary>+ public static void Legend(DrawingContext ctx, double right, double y, params (string Label, IBrush Ink, Mark Mark)[] items)+ {+ double x = right;+ for (int i = items.Length - 1; i >= 0; i--)+ {+ var (label, ink, mark) = items[i];+ var ft = new FormattedText(label, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, NotaFonts.Mono, 8, ink);+ x -= ft.Width;+ ctx.DrawText(ft, new Point(x, y));+ double cy = y + ft.Height / 2;+ x -= 14;+ switch (mark)+ {+ case Mark.Line: ctx.DrawLine(new Pen(ink, 1.4), new Point(x, cy), new Point(x + 10, cy)); break;+ case Mark.Dashed: ctx.DrawLine(new Pen(ink, 1.2, new DashStyle(new double[] { 2, 2 }, 0)), new Point(x, cy), new Point(x + 10, cy)); break;+ default: ctx.DrawRectangle(ink, null, new RoundedRect(new Rect(x + 2, cy - 3, 6, 6), 1)); break;+ }+ x -= 8;+ }+ }++ /// <summary>A legend row drawn inside the window: a swatch, a caps name and its value.</summary>+ public static double LegendRow(DrawingContext ctx, Point at, IBrush swatch, string name, string value)+ {+ ctx.DrawRectangle(swatch, null, new RoundedRect(new Rect(at.X, at.Y + 3, 8, 2), 1));+ var n = new FormattedText(name.ToUpperInvariant(), CultureInfo.InvariantCulture, FlowDirection.LeftToRight, NotaFonts.SansBold, 7, TitleInk);+ var v = AxisText(value, NotaPalette.TextPrimary, 8);+ ctx.DrawText(n, new Point(at.X + 12, at.Y));+ ctx.DrawText(v, new Point(at.X + 12 + n.Width + 5, at.Y - 0.5));+ return n.Height + 2;+ }+}diff --git a/src/managed/Nota.App/Controls/OperatorAlgoViz.cs b/src/managed/Nota.App/Controls/OperatorAlgoViz.csindex eb32568e..378c7412 100644--- a/src/managed/Nota.App/Controls/OperatorAlgoViz.cs+++ b/src/managed/Nota.App/Controls/OperatorAlgoViz.cs@@ -75,7 +75,7 @@ internal sealed class OperatorAlgoMini : Controlprivate static readonly IBrush AccentBright = NotaPalette.AccentBright;private static readonly IBrush AccentSubtle = NotaPalette.AccentSubtle;private static readonly IBrush TextTertiary = NotaPalette.TextTertiary;- private static readonly Typeface Mono = new(new FontFamily("Geist Mono, monospace"));+ private static readonly Typeface Mono = NotaFonts.Mono;private readonly int _algo;private bool _active;@@ -128,8 +128,8 @@ internal sealed class OperatorRoutingViz : Controlprivate static readonly IBrush AccentSubtle = NotaPalette.AccentSubtle;private static readonly IBrush TealSubtle = NotaPalette.Wash(NotaPalette.Teal, 0x2E);private static readonly IBrush TextTertiary = NotaPalette.TextTertiary;- private static readonly Typeface Bold = new(FontFamily.Default, FontStyle.Normal, FontWeight.Bold);- private static readonly Typeface Mono = new(new FontFamily("Geist Mono, monospace"));+ private static readonly Typeface Bold = NotaFonts.SansBold;+ private static readonly Typeface Mono = NotaFonts.Mono;private int _algo;private double[] _x = new double[4], _y = new double[4];@@ -190,7 +190,7 @@ internal sealed class OperatorRoutingViz : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 6, 6);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));var tgt = OperatorTopo.Algo[_algo];double padX = 10, padT = 14, padB = 4;@@ -213,10 +213,10 @@ internal sealed class OperatorRoutingViz : Control{var a = Ctr(o);if (tgt[o] < 4) { var b = Ctr(tgt[o]); ctx.DrawLine(new Pen(Teal, 1.4), a, b); }- else ctx.DrawLine(new Pen(Brass, 1.5), new Point(a.X, a.Y + bh / 2), new Point(a.X, outY));+ else ctx.DrawLine(new Pen(Brass, NotaGraph.PrimaryWidth), new Point(a.X, a.Y + bh / 2), new Point(a.X, outY));}// OUT bus.- ctx.DrawLine(new Pen(Brass, 1.4), new Point(gx0 + 4, outY), new Point(gx1 - 4, outY));+ ctx.DrawLine(new Pen(Brass, NotaGraph.PrimaryWidth), new Point(gx0 + 4, outY), new Point(gx1 - 4, outY));ctx.DrawText(new FormattedText("OUT", CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 7, TextTertiary), new Point(gx1 - 22, outY + 1));// Boxes.diff --git a/src/managed/Nota.App/Controls/OperatorSpectrumViz.cs b/src/managed/Nota.App/Controls/OperatorSpectrumViz.csindex ddd2bec2..c32399e6 100644--- a/src/managed/Nota.App/Controls/OperatorSpectrumViz.cs+++ b/src/managed/Nota.App/Controls/OperatorSpectrumViz.cs@@ -18,11 +18,11 @@ internal sealed class OperatorSpectrumViz : Control{private static readonly IBrush Sunken = NotaPalette.BgSunken;private static readonly IBrush BorderDef = NotaPalette.BorderDefault;- private static readonly Color Brass = ((SolidColorBrush)NotaPalette.Accent).Color;- private static readonly Color BrassLit = ((SolidColorBrush)NotaPalette.AccentBright).Color;- private static readonly IBrush Axis = NotaPalette.TextDisabled;+ private static Color Brass => NotaPalette.Accent.Color;+ private static Color BrassLit => NotaPalette.AccentBright.Color;+ private static readonly IBrush Axis = NotaPalette.TextAxis;private static readonly IBrush Amber = NotaPalette.AccentBright;- private static readonly Typeface Mono = new(new FontFamily("Geist Mono, monospace"));+ private static readonly Typeface Mono = NotaFonts.Mono;private float[] _bins = Array.Empty<float>();private int _n;@@ -40,7 +40,7 @@ internal sealed class OperatorSpectrumViz : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 5, 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double padX = 5, padTop = 4, padBot = 13;double x0 = padX, x1 = w - padX, top = padTop, bot = h - padBot;@@ -58,7 +58,7 @@ internal sealed class OperatorSpectrumViz : Control(byte)(Brass.R + (BrassLit.R - Brass.R) * v),(byte)(Brass.G + (BrassLit.G - Brass.G) * v),(byte)(Brass.B + (BrassLit.B - Brass.B) * v));- ctx.DrawRectangle(new SolidColorBrush(col, 0.35 + 0.65 * v), null, rect, 1, 1);+ ctx.DrawRectangle(new SolidColorBrush(col), null, rect, NotaRadius.BarValue, NotaRadius.BarValue);}// Baseline + fundamental-relative axis ticks (f · 10f · 20f · 30f).diff --git a/src/managed/Nota.App/Controls/PanBar.cs b/src/managed/Nota.App/Controls/PanBar.csindex 2e84d6df..d700f0e7 100644--- a/src/managed/Nota.App/Controls/PanBar.cs+++ b/src/managed/Nota.App/Controls/PanBar.cs@@ -23,7 +23,7 @@ public sealed class PanBar : Controlprivate static readonly IBrush Fill = NotaPalette.Accent; // brassprivate static readonly IBrush CentreTick = NotaPalette.BorderStrong;private static readonly IBrush TextBrush = NotaPalette.TextSecondary;- private static readonly Typeface Mono = new("monospace");+ private static readonly Typeface Mono = NotaFonts.Mono;private double _pan; // -1 (full left) .. +1 (full right), 0 = centreprivate bool _drag;@@ -46,22 +46,32 @@ public sealed class PanBar : Control_pan = Math.Clamp(pan, -1, 1);Height = 13;MinWidth = 34;- Cursor = new Cursor(StandardCursorType.SizeWestEast);+ Cursor = new Cursor(StandardCursorType.SizeNorthSouth); // almanac: vertical drag for every value control}+ private double _lastY, _raw;+protected override void OnPointerPressed(PointerPressedEventArgs e){+ if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return; // right-click bubblesif (e.ClickCount == 2) { Apply(0); e.Handled = true; return; } // reset to centre_drag = true;+ _lastY = e.GetPosition(this).Y;+ _raw = _pan;e.Pointer.Capture(this);GestureBegin?.Invoke();- SetFromX(e.GetPosition(this).X);e.Handled = true;}protected override void OnPointerMoved(PointerEventArgs e){- if (_drag) SetFromX(e.GetPosition(this).X);+ if (!_drag) return;+ double y = e.GetPosition(this).Y, dy = _lastY - y; // up = pan right; full sweep over ~140px+ _lastY = y;+ if (dy == 0) return;+ bool fine = (e.KeyModifiers & (KeyModifiers.Shift | KeyModifiers.Control | KeyModifiers.Meta)) != 0;+ _raw = Math.Clamp(_raw + dy / (fine ? 700.0 : 70.0), -1, 1); // accumulate, so the centre detent cannot trap the drag+ Apply(_raw);}protected override void OnPointerReleased(PointerReleasedEventArgs e)@@ -71,13 +81,6 @@ public sealed class PanBar : Controle.Pointer.Capture(null);}- private void SetFromX(double x)- {- double w = Bounds.Width;- if (w <= 0) return;- Apply(Math.Clamp(x / w, 0, 1) * 2 - 1);- }-private void Apply(double p){p = Math.Clamp(p, -1, 1);diff --git a/src/managed/Nota.App/Controls/PendulumViz.cs b/src/managed/Nota.App/Controls/PendulumViz.csindex 3b56a2de..2e9d4c9f 100644--- a/src/managed/Nota.App/Controls/PendulumViz.cs+++ b/src/managed/Nota.App/Controls/PendulumViz.cs@@ -34,7 +34,7 @@ internal sealed class PendulumViz : Controlprivate static readonly IBrush RailDn = NotaPalette.Wash(NotaPalette.Teal, 0x8C); // ∨ dimmedprivate static readonly Pen TriggerPen = new(NotaPalette.Wash(NotaPalette.AccentBright, 0x47), 1) { DashStyle = DashStyle.Dash };private static readonly Pen ApexPen = new(NotaPalette.Wash(NotaPalette.AccentBright, 0x59), 1);- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly Typeface Face = NotaFonts.Mono;private const int MaxBalls = 6;private const int TrailLen = 14;@@ -112,7 +112,7 @@ internal sealed class PendulumViz : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(FieldBorder, 1), new Rect(0, 0, w, h), 6, 6);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double labelH = _mini ? 2 : 14, capH = _mini ? 2 : 12;double pad = 8, x0 = pad, x1 = w - pad;diff --git a/src/managed/Nota.App/Controls/PentadViews.cs b/src/managed/Nota.App/Controls/PentadViews.csindex 03340cd4..5772f4fa 100644--- a/src/managed/Nota.App/Controls/PentadViews.cs+++ b/src/managed/Nota.App/Controls/PentadViews.cs@@ -57,9 +57,9 @@ internal sealed class PentadWaveIcon : Control// CEM-style passband loss at high resonance (unless bass compensation is on). Drag to edit.internal sealed class PentadFilterCurve : Control{- private static readonly IBrush Grid = NotaPalette.SurfaceCard;+ private static readonly IBrush Grid = NotaGraph.Grid;private static readonly IBrush Fill = NotaPalette.Wash(NotaPalette.Accent, 0x1E);- private static readonly Typeface Mono = new("ui-monospace, monospace");+ private static readonly Typeface Mono = NotaFonts.Mono;private double _cut = 0.5, _reso, _comp;private bool _drag;@@ -121,11 +121,10 @@ internal sealed class PentadFilterCurve : Controlfor (double x = 1; x <= w; x += 1.5) { var p = new Point(x, Y(Db(x / w))); lc.LineTo(p); fc.LineTo(p); }fc.LineTo(new Point(w, h));}- ctx.DrawGeometry(Fill, null, fill);- ctx.DrawGeometry(null, new Pen(NotaPalette.Accent, 1.5), line);+ ctx.DrawGeometry(null, new Pen(NotaPalette.Accent, NotaGraph.PrimaryWidth), line);double hz0 = 20 * Math.Pow(1000, _cut);- string txt = (hz0 >= 1000 ? $"{hz0 / 1000:0.00} kHz" : $"{hz0:0} Hz") + $" · Q {_reso * 10:0.0}";+ string txt = (hz0 >= 1000 ? $"{hz0 / 1000:0.0}\u2009k" : $"{hz0:0}\u2009Hz") + $" · Q {_reso * 10:0.0}";var ft = new FormattedText(txt, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 7, NotaPalette.AccentBright);ctx.DrawText(ft, new Point(w - ft.Width - 4, 3));@@ -166,7 +165,6 @@ internal sealed class PentadEnvCurve : Controlusing (var lc = line.Open()) Path(lc, false);using (var fc = fill.Open()) Path(fc, true);var col = ((ISolidColorBrush)Accent).Color;- ctx.DrawGeometry(new SolidColorBrush(Color.FromArgb(0x1F, col.R, col.G, col.B)), null, fill);ctx.DrawGeometry(null, new Pen(Accent, 1.4), line);}}@@ -174,7 +172,7 @@ internal sealed class PentadEnvCurve : Control// N voice cells, lit (brass) while a voice sounds, brightness following its level.internal sealed class PentadVoiceStrip : Control{- private static readonly Typeface Mono = new("ui-monospace, monospace");+ private static readonly Typeface Mono = NotaFonts.Mono;private readonly float[] _lv = new float[16];private int _n = 5;@@ -204,7 +202,7 @@ internal sealed class PentadVoiceStrip : Controlctx.DrawRectangle(lit ? new SolidColorBrush(Color.FromArgb(a, ac.R, ac.G, ac.B)) : NotaPalette.BgSunken, lit ? on : off, r, 3, 3);if (cw >= 12){- var ft = new FormattedText((i + 1).ToString(CultureInfo.InvariantCulture), CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 7, lit ? NotaPalette.AccentBright : NotaPalette.TextDisabled);+ var ft = new FormattedText((i + 1).ToString(NotaNum.Culture), CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 7, lit ? NotaPalette.AccentBright : NotaPalette.TextDisabled);ctx.DrawText(ft, new Point(r.X + (r.Width - ft.Width) / 2, r.Y + (r.Height - ft.Height) / 2));}}@@ -222,7 +220,7 @@ internal sealed class PentadLevelBar : Control{double w = Bounds.Width, h = Bounds.Height;if (w < 2 || h < 2) return;- ctx.DrawRectangle(NotaPalette.BgSunken, null, new Rect(0, 0, w, h), 2, 2);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));static double Frac(double db) => Math.Clamp((db + 48) / 51.0, 0, 1);double f = Frac(_db), fw = Frac(-6);if (f <= 0) return;diff --git a/src/managed/Nota.App/Controls/PhysViz.cs b/src/managed/Nota.App/Controls/PhysViz.csindex cf0224b3..6745f4fb 100644--- a/src/managed/Nota.App/Controls/PhysViz.cs+++ b/src/managed/Nota.App/Controls/PhysViz.cs@@ -18,8 +18,8 @@ namespace Nota.App;private static readonly IBrush AccentBright = NotaPalette.AccentBright;private static readonly IBrush TextTertiary = NotaPalette.TextTertiary;public enum K { Glyph, Decay }- private static readonly IBrush Grid = NotaPalette.Wash(NotaPalette.BorderStrong, 0x50);- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush Grid = NotaGraph.Grid;+ private static readonly Typeface Face = NotaFonts.Mono;private readonly K _k;private int _st;private double _exc, _pos, _damp, _tone, _inh, _body;@@ -34,7 +34,7 @@ namespace Nota.App;{double w = Bounds.Width, h = Bounds.Height;if (w <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 4, 4);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double pad = 6, x0 = pad, x1 = w - pad, top = pad + 11, bot = h - pad - 9;var pen = new Pen(AccentBright, 1.6, lineCap: PenLineCap.Round, lineJoin: PenLineJoin.Round);diff --git a/src/managed/Nota.App/Controls/PrismViews.cs b/src/managed/Nota.App/Controls/PrismViews.csindex a310477e..ff47d50c 100644--- a/src/managed/Nota.App/Controls/PrismViews.cs+++ b/src/managed/Nota.App/Controls/PrismViews.cs@@ -25,21 +25,22 @@ namespace Nota.App;internal static class PrismInk{- public static readonly Color[] BandColor = { NotaPalette.TrackColors[7], NotaPalette.AccentColor, NotaPalette.TrackColors[4] };- public static readonly IBrush[] Band = { new SolidColorBrush(BandColor[0]), NotaPalette.Accent, NotaPalette.Teal };+ // Read per use: the colours follow the theme, so they must not be captured in a static array.+ public static Color[] BandColor => new[] { NotaPalette.TrackColors[7], NotaPalette.AccentColor, NotaPalette.TrackColors[4] };+ public static readonly IBrush[] Band = { NotaPalette.TrackBrushes[7], NotaPalette.Accent, NotaPalette.Teal };// Text / handle tint for the selected band (the brass band lights up to AccentBright).public static readonly IBrush[] BandLit = { Band[0], NotaPalette.AccentBright, Band[2] };public static readonly string[] Names = { "Low", "Mid", "High" };public static readonly IBrush InnerBorder = NotaPalette.GraphBorder;public static readonly IPen InnerPen = new Pen(InnerBorder, 1);- private static readonly Typeface Mono = new("ui-monospace, Menlo, monospace");- private static readonly Typeface Sans = new("Inter, system-ui, sans-serif", FontStyle.Normal, FontWeight.Bold);+ private static readonly Typeface Mono = NotaFonts.Mono;+ private static readonly Typeface Sans = NotaFonts.SansBold;public static IBrush Alpha(Color c, byte a) => new SolidColorBrush(Color.FromArgb(a, c.R, c.G, c.B));public static FormattedText Text(string s, double size, IBrush b) => new(s, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, size, b);public static FormattedText Caps(string s, double size, IBrush b) => new(s, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Sans, size, b);public static double Db(double lin) => lin > 1e-6 ? 20 * Math.Log10(lin) : -120;- public static string HzShort(double hz) => hz >= 1000 ? (hz >= 10000 ? FormattableString.Invariant($"{hz / 1000:0}k") : FormattableString.Invariant($"{hz / 1000:0.0}k")) : FormattableString.Invariant($"{hz:0}");+ public static string HzShort(double hz) => hz >= 1000 ? (hz >= 10000 ? NotaNum.F($"{hz / 1000:0}k") : NotaNum.F($"{hz / 1000:0.0}k")) : NotaNum.F($"{hz:0}");}// ---------------------------------------------------------------------------------------------@@ -198,7 +199,7 @@ internal sealed class PrismSpectrum : Controlg.LineTo(new Point(w, h));g.EndFigure(true);}- ctx.DrawGeometry(InFill, new Pen(NotaPalette.BorderStrong, 1), fill);+ ctx.DrawGeometry(null, new Pen(NotaPalette.BorderStrong, 1), fill);var line = new StreamGeometry();using (var g = line.Open()){@@ -362,9 +363,9 @@ internal sealed class PrismTransfer : Controlif (_below || _hover == 2) ctx.DrawEllipse(_below ? NotaPalette.TextSecondary : NotaPalette.TextDisabled, _hover == 2 ? new Pen(NotaPalette.TextPrimary, 1) : null, below, 3, 3);ctx.DrawEllipse(PrismInk.BandLit[_band], _hover == 1 ? new Pen(NotaPalette.TextPrimary, 1) : null, Pt(_thrA, Out(_thrA)), 3.5, 3.5);- var ta = PrismInk.Text(FormattableString.Invariant($"above {_thrA:0}"), 7, PrismInk.BandLit[_band]);+ var ta = PrismInk.Text(NotaNum.F($"above {_thrA:0}"), 7, PrismInk.BandLit[_band]);ctx.DrawText(ta, new Point(4, 3));- var tb = PrismInk.Text(_below ? FormattableString.Invariant($"below {_thrB:0}") : "below off", 7, _below ? NotaPalette.TextSecondary : NotaPalette.TextDisabled);+ var tb = PrismInk.Text(_below ? NotaNum.F($"below {_thrB:0}") : "below off", 7, _below ? NotaPalette.TextSecondary : NotaPalette.TextDisabled);ctx.DrawText(tb, new Point(4, h - tb.Height - 2));ctx.DrawRectangle(null, PrismInk.InnerPen, rect.Deflate(0.5), 4, 4);}diff --git a/src/managed/Nota.App/Controls/ReverbTail.cs b/src/managed/Nota.App/Controls/ReverbTail.csindex 7f005237..073dc7e6 100644--- a/src/managed/Nota.App/Controls/ReverbTail.cs+++ b/src/managed/Nota.App/Controls/ReverbTail.cs@@ -22,11 +22,11 @@ internal sealed class ReverbTail : Controlprivate static readonly IBrush BorderDef = NotaPalette.BorderDefault;private static readonly IBrush Accent = NotaPalette.AccentBright;private static readonly IBrush Teal = NotaPalette.Teal;- private static readonly IBrush GridB = NotaPalette.Wash(NotaPalette.BorderStrong, 0x40);+ private static readonly IBrush GridB = NotaGraph.Grid;private static readonly IBrush Fill = NotaPalette.Wash(NotaPalette.Accent, 0x20);private static readonly IBrush TealFill = NotaPalette.Wash(NotaPalette.Teal, 0x1E);- private static readonly IBrush Axis = NotaPalette.TextDisabled;- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush Axis = NotaPalette.TextAxis;+ private static readonly Typeface Face = NotaFonts.Mono;private readonly IAudioEngine _e;private readonly int _t, _di, _decayP, _preP;@@ -70,7 +70,7 @@ internal sealed class ReverbTail : Controlpublic override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height; if (w <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 5, 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));var (x0, x1, top, bot) = Geo();for (int i = 1; i <= 3; i++) { double gy = top + (bot - top) * i / 4.0; ctx.DrawLine(new Pen(GridB, 1), new Point(x0, gy), new Point(x1, gy)); }@@ -93,7 +93,6 @@ internal sealed class ReverbTail : Control}g.LineTo(new Point(x1, bot)); g.EndFigure(true);}- ctx.DrawGeometry(Fill, null, geo);var pen = new Pen(Accent, 1.6, lineJoin: PenLineJoin.Round);Point? prev = null;for (double x = gapX; x <= x1; x += 3)@@ -107,8 +106,8 @@ internal sealed class ReverbTail : Control}Txt(ctx, $"DECAY TAIL", x0 + 2, top - 1, Axis);- Txt(ctx, $"RT60 {rt60:0.00} s", x1 - 66, top - 1, Accent);- Txt(ctx, $"pre {P(_preP) * MaxPreMs:0} ms", gapX + 3, bot - 10, Teal);- Txt(ctx, "4 s", x1 - 16, bot + 2, Axis);+ Txt(ctx, $"RT60 {rt60:0.00}\u2009s", x1 - 66, top - 1, Accent);+ Txt(ctx, $"pre {P(_preP) * MaxPreMs:0}\u2009ms", gapX + 3, bot - 10, Teal);+ Txt(ctx, "4\u2009s", x1 - 16, bot + 2, Axis);}}diff --git a/src/managed/Nota.App/Controls/RhythmHitViz.cs b/src/managed/Nota.App/Controls/RhythmHitViz.csindex 068e0aba..d8042594 100644--- a/src/managed/Nota.App/Controls/RhythmHitViz.cs+++ b/src/managed/Nota.App/Controls/RhythmHitViz.cs@@ -16,7 +16,7 @@ internal sealed class RhythmHitViz : Control{private double _decay = 0.5, _tune = 0.4, _punch = 0.5, _flash;- private static readonly IBrush EnvBrush = NotaPalette.AccentTint;+ private static readonly IBrush EnvBrush = NotaPalette.AccentDim;private static Color Osc => NotaPalette.AccentBright.Color;private static readonly IPen ClickPen = new Pen(NotaPalette.Wash(NotaPalette.TealBright, 0x80), 1);diff --git a/src/managed/Nota.App/Controls/ShutterViz.cs b/src/managed/Nota.App/Controls/ShutterViz.csindex b8d95d87..dd10a617 100644--- a/src/managed/Nota.App/Controls/ShutterViz.cs+++ b/src/managed/Nota.App/Controls/ShutterViz.cs@@ -36,7 +36,7 @@ internal sealed class ShutterSignal : Controlprivate static readonly IBrush Muted = NotaPalette.TextTertiary;private static readonly IBrush ThrC = NotaPalette.Threshold;private static readonly IBrush AxisB = NotaPalette.TextTertiary;- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly Typeface Face = NotaFonts.Mono;private readonly IAudioEngine _engine;private readonly int _track, _device;@@ -72,7 +72,7 @@ internal sealed class ShutterSignal : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Bg, new Pen(BorderB, 1), new Rect(0, 0, w, h), 6, 6);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double gx = 6, gy = 14, gw = w - 12, gh = h - gy - 12;if (gw <= 0 || gh <= 0) return;@@ -90,7 +90,7 @@ internal sealed class ShutterSignal : Controlfor (int i = 0; i < N; i++) g.LineTo(new Point(X(i), YDb(_in[Idx(i)], gy, gh)));g.LineTo(new Point(gx + gw, gy + gh)); g.EndFigure(true);}- ctx.DrawGeometry(InFill, InPen, area);+ ctx.DrawGeometry(null, InPen, area);}// threshold + return lines@@ -107,18 +107,16 @@ internal sealed class ShutterSignal : Controlfor (int i = 0; i < N; i++) g.LineTo(new Point(X(i), GateY(_gate[Idx(i)])));g.LineTo(new Point(gx + gw, gy + gh)); g.EndFigure(true);}- ctx.DrawGeometry(GateFill, null, fill);Point gp = default; bool has = false;for (int i = 0; i < N; i++) { var p = new Point(X(i), GateY(_gate[Idx(i)])); if (has) ctx.DrawLine(GatePen, gp, p); gp = p; has = true; }}void Lbl(string s, double x, double y, IBrush b) => ctx.DrawText(new FormattedText(s, System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 8, b), new Point(x, y));Lbl("SIGNAL", gx, 2, Muted);- Lbl("▩ input", gx + gw - 154, 2, NotaPalette.SignalIn);- Lbl("─ gate gain", gx + gw - 108, 2, NotaPalette.Accent);- Lbl("┄ threshold", gx + gw - 48, 2, ThrC);+ NotaGraph.Legend(ctx, gx + gw - 2, 2, ("input", NotaPalette.SignalIn, NotaGraph.Mark.Area),+ ("gate gain", NotaPalette.Accent, NotaGraph.Mark.Line), ("threshold", ThrC, NotaGraph.Mark.Dashed));Lbl($"THRESHOLD {_thrDb:0}", gx + 2, YDb(_thrDb, gy, gh) - 10, ThrC);- Lbl("−250 ms", gx, gy + gh + 1, AxisB);+ Lbl("−250\u2009ms", gx, gy + gh + 1, AxisB);Lbl("now", gx + gw - 18, gy + gh + 1, AxisB);}}@@ -134,8 +132,8 @@ internal sealed class ShutterDetectorEQ : Controlprivate static readonly IPen CurvePen = new Pen(NotaPalette.Teal, 1.4);private static readonly IBrush CurveFill = NotaPalette.Wash(NotaPalette.Teal, 0x14);private static readonly IBrush Handle = NotaPalette.TealBright;- private static readonly IBrush Axis = NotaPalette.TextDisabled;- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush Axis = NotaPalette.TextAxis;+ private static readonly Typeface Face = NotaFonts.Mono;private double _hp = 0.301, _lp = 0.548; // normalized DetHP / DetLPprivate int _drag; // 0 none, 1 hp, 2 lp@@ -173,7 +171,7 @@ internal sealed class ShutterDetectorEQ : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Bg, new Pen(BorderB, 1), new Rect(0, 0, w, h), 5, 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double hpF = Exp(_hp, HpLo, HpHi), lpF = Exp(_lp, LpLo, LpHi);ctx.DrawLine(new Pen(NotaPalette.SurfaceCard, 1), new Point(0, h * 0.75), new Point(w, h * 0.75));@@ -196,7 +194,6 @@ internal sealed class ShutterDetectorEQ : Controlforeach (var p in pts) g.LineTo(p);g.LineTo(new Point(w, h)); g.EndFigure(true);}- ctx.DrawGeometry(CurveFill, null, geo);for (int i = 1; i < n; i++) ctx.DrawLine(CurvePen, pts[i - 1], pts[i]);double hx = XOf(hpF, w), lx = XOf(lpF, w);@@ -213,14 +210,14 @@ internal sealed class AHRGlyph : Control{private static readonly IBrush Bg = NotaPalette.BgSunken;private static readonly IBrush BorderB = NotaPalette.GraphBorder;- private static readonly IPen Line = new Pen(NotaPalette.Accent, 1.6) { LineJoin = PenLineJoin.Round };+ private static readonly IPen Line = new Pen(NotaPalette.Accent, NotaGraph.PrimaryWidth) { LineJoin = PenLineJoin.Round };private static readonly IPen Dash = new Pen(NotaPalette.BorderStrong, 1) { DashStyle = new DashStyle(new double[] { 2, 2 }, 0) };public override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Bg, new Pen(BorderB, 1), new Rect(0, 0, w, h), 5, 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double x0 = 5, x1 = w * 0.28, x2 = w * 0.6, x3 = w - 5, top = 5, bot = h - 6;ctx.DrawLine(Line, new Point(x0, bot), new Point(x1, top));ctx.DrawLine(Line, new Point(x1, top), new Point(x2, top));diff --git a/src/managed/Nota.App/Controls/SliderTrack.cs b/src/managed/Nota.App/Controls/SliderTrack.csnew file mode 100644index 00000000..9c789329--- /dev/null+++ b/src/managed/Nota.App/Controls/SliderTrack.cs@@ -0,0 +1,132 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// The horizontal slider from the almanac's slider row: a 3px track in the well colour, a+// brass fill, and a 6×7 Brass Light handle. Bipolar sliders fill from the centre and show+// a 1px centre mark. An inactive slider (IsDim) loses brass — fill Border strong, handle+// Ink 5 — but keeps its position, so the number next to it stays meaningful.+//+// It works in normalised 0..1; the caller maps to the parameter (linear, log, stepped).+// Interaction follows the almanac (§ States · cursors): ns-resize, a vertical drag — up+// increases, full range over ~140px, Shift (or Ctrl/⌘) for fine steps — so a slider and a+// knob handle the same; a click never jumps the value. Double-click resets when a reset is+// supplied; right-click bubbles to the CV-modulate / MIDI Learn menu.+// GestureBegin / GestureEnd bracket the drag so automation writes are recorded, and the+// row's live-follow refresher should skip while Dragging.++using System;+using Avalonia;+using Avalonia.Controls;+using Avalonia.Input;+using Avalonia.Media;++namespace Nota.App;++internal sealed class SliderTrack : Control+{+ private static readonly IBrush Groove = NotaPalette.BgSunken;+ private static readonly IBrush Fill = NotaPalette.Accent;+ private static readonly IBrush FillDim = NotaPalette.BorderStrong;+ private static readonly IBrush Handle = NotaPalette.AccentBright;+ private static readonly IBrush HandleDim = NotaPalette.TextTertiary;+ private static readonly IBrush Centre = NotaPalette.BorderStrong;++ public const double TrackH = 3, HandleW = 6, HandleH = 7, Height0 = 9;++ private double _norm;+ private bool _dim, _drag;+ private double _lastY;++ public bool Bipolar { get; init; }++ /// <summary>Double-click handler (restore the default). Null disables double-click.</summary>+ public Action? Reset { get; init; }++ public event Action<double>? Changed; // new normalised value, from the pointer+ public event Action? GestureBegin;+ public event Action? GestureEnd;++ public bool Dragging => _drag;++ public double Norm { get => _norm; set { var v = Math.Clamp(value, 0, 1); if (v == _norm) return; _norm = v; InvalidateVisual(); } }+ public bool IsDim { get => _dim; set { if (_dim == value) return; _dim = value; InvalidateVisual(); } }++ public SliderTrack()+ {+ Height = Height0;+ MinWidth = 24;+ Cursor = new Cursor(StandardCursorType.SizeNorthSouth);+ VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center;+ }++ protected override void OnPointerPressed(PointerPressedEventArgs e)+ {+ if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;+ if (e.ClickCount == 2 && Reset is not null)+ {+ if (_drag) { _drag = false; e.Pointer.Capture(null); GestureEnd?.Invoke(); }+ Reset();+ e.Handled = true;+ return;+ }+ _drag = true;+ _lastY = e.GetPosition(this).Y;+ e.Pointer.Capture(this);+ GestureBegin?.Invoke();+ e.Handled = true;+ }++ protected override void OnPointerMoved(PointerEventArgs e)+ {+ if (!_drag) return;+ double y = e.GetPosition(this).Y, dy = _lastY - y; // up = increase+ _lastY = y;+ if (dy == 0) return;+ bool fine = (e.KeyModifiers & (KeyModifiers.Shift | KeyModifiers.Control | KeyModifiers.Meta)) != 0;+ Nudge(dy / (fine ? 1400.0 : 140.0));+ }++ protected override void OnPointerReleased(PointerReleasedEventArgs e)+ {+ if (!_drag) return;+ _drag = false;+ e.Pointer.Capture(null);+ GestureEnd?.Invoke();+ }++ protected override void OnPointerCaptureLost(PointerCaptureLostEventArgs e)+ {+ // Never leave an automation session dangling.+ if (_drag) { _drag = false; GestureEnd?.Invoke(); }+ base.OnPointerCaptureLost(e);+ }++ private void Nudge(double delta)+ {+ double v = Math.Clamp(_norm + delta, 0, 1);+ if (Math.Abs(v - _norm) < 1e-6) return;+ _norm = v;+ InvalidateVisual();+ Changed?.Invoke(v);+ }++ public override void Render(DrawingContext ctx)+ {+ double w = Bounds.Width, h = Bounds.Height;+ if (w <= 0 || h <= 0) return;+ ctx.FillRectangle(Brushes.Transparent, new Rect(0, 0, w, h)); // whole row height hit-tests+ double cy = h / 2, ty = cy - TrackH / 2;+ ctx.DrawRectangle(Groove, null, new RoundedRect(new Rect(0, ty, w, TrackH), NotaRadius.ClipValue));++ double x = _norm * w;+ double a = Bipolar ? Math.Min(w / 2, x) : 0, b = Bipolar ? Math.Max(w / 2, x) : x;+ if (b - a > 0.5)+ ctx.DrawRectangle(_dim ? FillDim : Fill, null, new RoundedRect(new Rect(a, ty, b - a, TrackH), NotaRadius.ClipValue));+ if (Bipolar)+ ctx.FillRectangle(Centre, new Rect(Math.Round(w / 2) - 0.5, cy - 3, 1, 6));++ double hx = Math.Clamp(x, HandleW / 2, w - HandleW / 2) - HandleW / 2;+ ctx.DrawRectangle(_dim ? HandleDim : Handle, null,+ new RoundedRect(new Rect(hx, cy - HandleH / 2, HandleW, HandleH), NotaRadius.ClipValue));+ }+}diff --git a/src/managed/Nota.App/Controls/StereoMeter.cs b/src/managed/Nota.App/Controls/StereoMeter.csindex a0b7f951..34c49fef 100644--- a/src/managed/Nota.App/Controls/StereoMeter.cs+++ b/src/managed/Nota.App/Controls/StereoMeter.cs@@ -1,47 +1,44 @@// SPDX-License-Identifier: AGPL-3.0-only// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.//-// Horizontal stereo peak meter (mockup 2e output rail): two thin bars (L over R),-// each a green level fill with a yellow peak-hold cap on a dark inset track. Feed it-// linear peak amplitudes per block via Set(); it maps to dB and decays the peak hold.+// Horizontal stereo meter for a device card (output rail, card header): two thin bars,+// L over R, on the same scale and zones as MeterBar. No animation — the level is set at+// once and the peak mark holds until the meter is clicked (almanac § level meters).using System;using Avalonia;using Avalonia.Controls;+using Avalonia.Input;using Avalonia.Media;namespace Nota.App;internal sealed class StereoMeter : Control{- private static readonly IBrush Inset = NotaPalette.BgSunken;- private static readonly IBrush Green = NotaPalette.Success;- private static readonly IBrush Peak = NotaPalette.Warning;- private float _l, _r, _pkL, _pkR;+ private double _l, _r, _pkL, _pkR;- private static float Norm(float peak) => peak > 1e-4f ? (float)Math.Clamp((20 * Math.Log10(peak) + 60) / 60.0, 0, 1) : 0f;+ public StereoMeter() => ToolTip.SetTip(this, "Clear the peak hold");- // Push the block's linear peak amplitudes (0..1+). Green tracks the level, the- // yellow cap holds the recent maximum and decays toward it.+ // Push the block's linear peak amplitudes (0..1+).public void Set(float peakL, float peakR){- _l = Norm(peakL); _r = Norm(peakR);- _pkL = Math.Max(_pkL * 0.94f, _l);- _pkR = Math.Max(_pkR * 0.94f, _r);+ _l = MeterScale.Norm(peakL); _r = MeterScale.Norm(peakR);+ _pkL = Math.Max(_pkL, _l);+ _pkR = Math.Max(_pkR, _r);InvalidateVisual();}+ protected override void OnPointerPressed(PointerPressedEventArgs e)+ {+ if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;+ _pkL = _l; _pkR = _r; InvalidateVisual(); e.Handled = true;+ }+public override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height; if (w <= 0) return;double barH = Math.Min(4, (h - 2) / 2), gap = h - barH * 2;- void Bar(double y, float lvl, float pk)- {- ctx.DrawRectangle(Inset, null, new Rect(0, y, w, barH), 2, 2);- if (lvl > 0.001f) ctx.DrawRectangle(Green, null, new Rect(0, y, w * lvl, barH), 2, 2);- if (pk > 0.02f) { double px = Math.Clamp(w * pk - 2, 0, w - 2); ctx.FillRectangle(Peak, new Rect(px, y, 2, barH)); }- }- Bar(0, _l, _pkL);- Bar(barH + gap, _r, _pkR);+ MeterScale.DrawChannel(ctx, new Rect(0, 0, w, barH), _l, _pkL, horizontal: true);+ MeterScale.DrawChannel(ctx, new Rect(0, barH + gap, w, barH), _r, _pkR, horizontal: true);}}diff --git a/src/managed/Nota.App/Controls/StrataWave.cs b/src/managed/Nota.App/Controls/StrataWave.csindex c25ed4c1..c9744641 100644--- a/src/managed/Nota.App/Controls/StrataWave.cs+++ b/src/managed/Nota.App/Controls/StrataWave.cs@@ -32,7 +32,7 @@ internal sealed class StrataWave : Controldouble w = Bounds.Width, h = Bounds.Height; if (w <= 0 || h <= 0 || _env.Length == 0) return;int n = _env.Length; double bw = w / n, mid = h / 2;var full = _muted ? NotaPalette.BorderStrong- : new SolidColorBrush(_recording ? NotaPalette.Danger.Color : Color.FromArgb(0xCC, _color.R, _color.G, _color.B));+ : new SolidColorBrush(_recording ? NotaPalette.Record.Color : Color.FromArgb(0xCC, _color.R, _color.G, _color.B));var future = NotaPalette.GraphBorder;double cut = _recording ? _progress * n : n;for (int i = 0; i < n; i++)diff --git a/src/managed/Nota.App/Controls/SwitchTrack.cs b/src/managed/Nota.App/Controls/SwitchTrack.csnew file mode 100644index 00000000..fc64696b--- /dev/null+++ b/src/managed/Nota.App/Controls/SwitchTrack.cs@@ -0,0 +1,46 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// The on/off switch from the almanac: an 18×10 pill track with a 7px knob inset 1.5 on+// every side. On — a brass track, the knob in the panel colour, sitting right. Off — the+// Track off colour, an Ink 5 knob, sitting left. State reads from colour *and* position,+// never colour alone. It is always paired with a word to its right (DeviceCardKit.Switch);+// never with an icon. Brass only: role chromas do not go on controls.++using Avalonia;+using Avalonia.Controls;+using Avalonia.Media;++namespace Nota.App;++internal sealed class SwitchTrack : Control+{+ private static readonly IBrush TrackOn = NotaPalette.Accent;+ private static readonly IBrush TrackDim = NotaPalette.BorderStrong; // on, but its section is inactive+ private static readonly IBrush TrackOff = NotaPalette.TrackOff;+ private static readonly IBrush KnobOn = NotaPalette.Panel;+ private static readonly IBrush KnobOff = NotaPalette.TextTertiary;++ public const double W = 18, H = 10, KnobD = 7, Inset = 1.5;++ private bool _on, _dim;++ public bool IsOn { get => _on; set { if (_on == value) return; _on = value; InvalidateVisual(); } }++ /// <summary>On, but inert — the section it gates is switched off. Loses brass, keeps position.</summary>+ public bool IsDim { get => _dim; set { if (_dim == value) return; _dim = value; InvalidateVisual(); } }++ public SwitchTrack()+ {+ Width = W; Height = H;+ VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center;+ }++ public override void Render(DrawingContext ctx)+ {+ var track = _on ? (_dim || !IsEffectivelyEnabled ? TrackDim : TrackOn) : TrackOff;+ ctx.DrawRectangle(track, null, new RoundedRect(new Rect(0, 0, W, H), H / 2));+ double x = _on ? W - Inset - KnobD : Inset;+ ctx.DrawEllipse(_on ? KnobOn : KnobOff, null, new Point(x + KnobD / 2, H / 2), KnobD / 2, KnobD / 2);+ }+}diff --git a/src/managed/Nota.App/Controls/SynthViz.cs b/src/managed/Nota.App/Controls/SynthViz.csindex 79be8449..19c3ef64 100644--- a/src/managed/Nota.App/Controls/SynthViz.cs+++ b/src/managed/Nota.App/Controls/SynthViz.cs@@ -22,17 +22,15 @@ internal sealed class SynthViz : Controlprivate static readonly IBrush Sunken = NotaPalette.BgSunken;private static readonly IBrush BorderDef = NotaPalette.BorderDefault;private static readonly IBrush TextTertiary = NotaPalette.TextTertiary;- private static Color TealColor => NotaPalette.Teal.Color;- private static Color BrassColor => NotaPalette.Accent.Color;- private static readonly IBrush Teal = new SolidColorBrush(TealColor);- private static readonly IBrush TealFill = new SolidColorBrush(TealColor, 0.10);- private static readonly IBrush Brass = new SolidColorBrush(BrassColor);- private static readonly IBrush BrassFill = new SolidColorBrush(BrassColor, 0.09);+ private static readonly IBrush Teal = NotaPalette.Teal;+ private static readonly IBrush TealFill = NotaPalette.Wash(NotaPalette.Teal, 0x1A);+ private static readonly IBrush Brass = NotaPalette.Accent;+ private static readonly IBrush BrassFill = NotaPalette.Wash(NotaPalette.Accent, 0x17);private static readonly IBrush Handle = NotaPalette.AccentBright;- private static readonly IBrush DimMono = NotaPalette.TextDisabled;- private static readonly IBrush Grid = NotaPalette.Wash(NotaPalette.SurfaceCard, 0xFF);- private static readonly IBrush GridDash = NotaPalette.Wash(NotaPalette.SurfaceRaised, 0xFF);- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush DimMono = NotaPalette.TextAxis;+ private static readonly IBrush Grid = NotaGraph.Grid;+ private static readonly IBrush GridDash = NotaGraph.Grid;+ private static readonly Typeface Face = NotaFonts.Mono;private const double Pad = 8;@@ -47,18 +45,18 @@ internal sealed class SynthViz : Control// Engine's perceptual map (Synth.h): lo * (hi/lo)^v.private static double ExpMap(double v, double lo, double hi) => lo * Math.Pow(hi / lo, Math.Clamp(v, 0, 1));private static string Secs(double s) => s < 1.0- ? $"{(s * 1000).ToString("0", CultureInfo.InvariantCulture)} ms"- : $"{s.ToString("0.00", CultureInfo.InvariantCulture)} s";+ ? $"{(s * 1000).ToString("0", NotaNum.Culture)}\u2009ms"+ : $"{s.ToString("0.00", NotaNum.Culture)}\u2009s";private void Text(DrawingContext ctx, string t, double x, double y, IBrush brush, double size = 8, bool mono = false)=> ctx.DrawText(new FormattedText(t, CultureInfo.InvariantCulture, FlowDirection.LeftToRight,- mono ? new Typeface("Geist Mono, Consolas, monospace") : Face, size, brush), new Point(x, y));+ mono ? NotaFonts.Mono : Face, size, brush), new Point(x, y));public override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 6, 6);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double x0 = Pad, x1 = w - Pad, top = Pad + 12, bot = h - Pad - 9;if (_k == K.Adsr) RenderEnvelope(ctx, x0, x1, top, bot);@@ -75,7 +73,7 @@ internal sealed class SynthViz : Controldouble sy = top + (1 - _s) * (bot - top);double xa = x0 + aw, xd = Math.Min(x1, xa + dw), xh = Math.Min(x1, xd + hold), xr = Math.Min(x1, xh + rw);- // Filled area under the envelope, then the stroked curve on top.+ // The envelope as a stroked curve (almanac: no fills under curves).var fill = new StreamGeometry();using (var g = fill.Open()){@@ -83,7 +81,6 @@ internal sealed class SynthViz : Controlg.LineTo(new Point(xa, top)); g.LineTo(new Point(xd, sy)); g.LineTo(new Point(xh, sy)); g.LineTo(new Point(xr, bot));g.EndFigure(true);}- ctx.DrawGeometry(TealFill, null, fill);var pen = new Pen(Teal, 1.8, lineCap: PenLineCap.Round, lineJoin: PenLineJoin.Round);ctx.DrawLine(pen, new Point(x0, bot), new Point(xa, top));ctx.DrawLine(pen, new Point(xa, top), new Point(xd, sy));@@ -130,20 +127,19 @@ internal sealed class SynthViz : Controlg.LineTo(new Point(x1, bot)); g.LineTo(new Point(x0, bot));g.EndFigure(true);}- ctx.DrawGeometry(BrassFill, null, fill);var pen = new Pen(Brass, 1.8, lineJoin: PenLineJoin.Round);ctx.DrawLine(pen, new Point(x0, flatY), new Point(kx, flatY));ctx.DrawLine(pen, new Point(kx, flatY), new Point(cx, bumpY));ctx.DrawLine(pen, new Point(cx, bumpY), new Point(x1, bot));// Cutoff handle + guide line.- ctx.DrawLine(new Pen(new SolidColorBrush(NotaPalette.AccentBright.Color, 0.22), 1), new Point(cx, top - 6), new Point(cx, bot));- ctx.DrawEllipse(Handle, new Pen(Sunken, 2), new Point(cx, bumpY), 5.5, 5.5);+ ctx.DrawLine(new Pen(NotaPalette.Wash(NotaPalette.AccentBright, 0x38), 1), new Point(cx, top - 6), new Point(cx, bot));+ NotaGraph.Node(ctx, new Point(cx, bumpY), active: true);// Labels: title, cutoff/Q readout, evenly-spaced Hz axis captions.Text(ctx, "FILTER", x0, Pad - 2, TextTertiary);var inv = CultureInfo.InvariantCulture;- string hzTxt = cutHz >= 1000 ? $"{(cutHz / 1000).ToString("0.00", inv)} kHz" : $"{cutHz.ToString("0", inv)} Hz";+ string hzTxt = cutHz >= 1000 ? $"{(cutHz / 1000).ToString("0.0", inv)}\u2009k" : $"{cutHz.ToString("0", inv)}\u2009Hz";string readout = $"{hzTxt} Q {_res.ToString("0.00", inv)}";Text(ctx, readout, x1 - MeasureW(readout, 9, true), Pad - 2, Handle, 9, true);string[] ticks = { "20", "100", "1 k", "10 k", "20 k" };@@ -161,5 +157,5 @@ internal sealed class SynthViz : Controlprivate static double MeasureW(string t, double size, bool mono)=> new FormattedText(t, CultureInfo.InvariantCulture, FlowDirection.LeftToRight,- mono ? new Typeface("Geist Mono, Consolas, monospace") : Face, size, Brushes.White).Width;+ mono ? NotaFonts.Mono : Face, size, NotaPalette.TextPrimary).Width;}diff --git a/src/managed/Nota.App/Controls/VFader.cs b/src/managed/Nota.App/Controls/VFader.csindex 0a260e33..c035a8f9 100644--- a/src/managed/Nota.App/Controls/VFader.cs+++ b/src/managed/Nota.App/Controls/VFader.cs@@ -24,7 +24,7 @@ internal sealed class VFader : Controlpublic event Action? GestureBegin; // M9-C automation writepublic event Action? GestureEnd;- public VFader(double value, Color capLine) { _value = Math.Clamp(value, 0, Max); _capLine = new SolidColorBrush(capLine); Width = 30; }+ public VFader(double value, IBrush capLine) { _value = Math.Clamp(value, 0, Max); _capLine = capLine; Width = 30; }/// <summary>Sets the value without raising ValueChanged (external sync, e.g. dB field).</summary>public void SetValueExternal(double v) { _value = Math.Clamp(v, 0, Max); InvalidateVisual(); }diff --git a/src/managed/Nota.App/Controls/ValueBar.cs b/src/managed/Nota.App/Controls/ValueBar.csindex 2cfbf16b..6451fdda 100644--- a/src/managed/Nota.App/Controls/ValueBar.cs+++ b/src/managed/Nota.App/Controls/ValueBar.cs@@ -21,7 +21,7 @@ public sealed class ValueBar : Controlprivate static readonly IBrush FillAccent = NotaPalette.Teal;private static readonly IBrush FillBrass = NotaPalette.Accent;private static readonly IBrush TextBrush = NotaPalette.TextPrimary;- private static readonly Typeface Mono = new("monospace");+ private static readonly Typeface Mono = NotaFonts.Mono;private double _value; // normalized 0..1private readonly Func<double, string> _fmt; // formats the normalized value for displaydiff --git a/src/managed/Nota.App/Controls/VelocityCurveViz.cs b/src/managed/Nota.App/Controls/VelocityCurveViz.csindex 060a6c84..c961184d 100644--- a/src/managed/Nota.App/Controls/VelocityCurveViz.cs+++ b/src/managed/Nota.App/Controls/VelocityCurveViz.cs@@ -15,7 +15,7 @@ namespace Nota.App;internal sealed class VelocityCurveViz : Control{- private static readonly IBrush GridB = NotaPalette.SurfaceCard;+ private static readonly IBrush GridB = NotaGraph.Grid;private static readonly IBrush Ident = NotaPalette.SurfaceRaised;private static readonly IBrush Brass = NotaPalette.Accent;private static readonly IBrush Teal = NotaPalette.Wash(NotaPalette.Teal, 0x80);@@ -68,7 +68,7 @@ internal sealed class VelocityCurveViz : Controlif (_last is { } l && (l.x > 0 || l.y > 0)){var p = P(l.x, l.y);- ctx.DrawEllipse(new SolidColorBrush(NotaPalette.AccentBright.Color, 0.28), null, p, 7, 7);+ ctx.DrawEllipse(NotaPalette.Wash(NotaPalette.AccentBright, 0x47), null, p, 7, 7);ctx.DrawEllipse(Bright, new Pen(Ink, 2), p, 4.5, 4.5);}}diff --git a/src/managed/Nota.App/Controls/VintageViz.cs b/src/managed/Nota.App/Controls/VintageViz.csindex ca44afff..9711e746 100644--- a/src/managed/Nota.App/Controls/VintageViz.cs+++ b/src/managed/Nota.App/Controls/VintageViz.cs@@ -20,8 +20,8 @@ internal sealed class VintageViz : Controlprivate static readonly IBrush BorderDef = NotaPalette.BorderDefault;private static readonly IBrush AccentBright = NotaPalette.AccentBright;private static readonly IBrush TextTertiary = NotaPalette.TextTertiary;- private static readonly IBrush Grid = NotaPalette.Wash(NotaPalette.BorderStrong, 0x50);- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush Grid = NotaGraph.Grid;+ private static readonly Typeface Face = NotaFonts.Mono;private static readonly string[] ModeNames = { "VINYL", "CASSETTE", "REEL", "VHS", "TUBE", "ANALOG" };// Mirrors Vintage.h kMode: shape, driveMul, bias, bandHz.private static readonly int[] Shape = { 0, 2, 2, 0, 1, 0 };@@ -60,7 +60,7 @@ internal sealed class VintageViz : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 4, 4);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double pad = 7, x0 = pad, x1 = w - pad, top = pad + 10, bot = h - pad - 13;var gridPen = new Pen(Grid, 1);diff --git a/src/managed/Nota.App/Controls/VoltEnv.cs b/src/managed/Nota.App/Controls/VoltEnv.csindex be3b0046..3b135188 100644--- a/src/managed/Nota.App/Controls/VoltEnv.cs+++ b/src/managed/Nota.App/Controls/VoltEnv.cs@@ -21,8 +21,8 @@ namespace Nota.App;private static readonly IBrush BorderDef = NotaPalette.BorderDefault;private static readonly IBrush AccentBright = NotaPalette.AccentBright;private static readonly IBrush TextTertiary = NotaPalette.TextTertiary;- private static readonly IBrush GridB = NotaPalette.Wash(NotaPalette.BorderStrong, 0x50);- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush GridB = NotaGraph.Grid;+ private static readonly Typeface Face = NotaFonts.Mono;private readonly IAudioEngine _e;private readonly int _t;private (int i, string id) _a, _d, _s, _r;@@ -97,7 +97,7 @@ namespace Nota.App;public override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height; if (w <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 4, 4);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));var (x0, x1, top, bot) = Geo();var gp = new Pen(GridB, 1);for (int i = 1; i <= 3; i++) { double gy = top + (bot - top) * i / 4.0; ctx.DrawLine(gp, new Point(x0, gy), new Point(x1, gy)); }diff --git a/src/managed/Nota.App/Controls/VoltFilter.cs b/src/managed/Nota.App/Controls/VoltFilter.csindex 01edfc7e..08c192de 100644--- a/src/managed/Nota.App/Controls/VoltFilter.cs+++ b/src/managed/Nota.App/Controls/VoltFilter.cs@@ -20,8 +20,8 @@ namespace Nota.App;private static readonly IBrush Sunken = NotaPalette.BgSunken;private static readonly IBrush BorderDef = NotaPalette.BorderDefault;private static readonly IBrush AccentBright = NotaPalette.AccentBright;- private static readonly IBrush GridB = NotaPalette.Wash(NotaPalette.BorderStrong, 0x50);- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly IBrush GridB = NotaGraph.Grid;+ private static readonly Typeface Face = NotaFonts.Mono;private readonly IAudioEngine _e;private readonly int _t;private (int i, string id) _freq, _reso;@@ -58,7 +58,7 @@ namespace Nota.App;G1(_freq); G1(_reso);}private static readonly IBrush FillB = NotaPalette.Wash(NotaPalette.Accent, 0x18);- private static readonly IBrush AxisB = NotaPalette.TextDisabled;+ private static readonly IBrush AxisB = NotaPalette.TextAxis;private static readonly IBrush HandleB = NotaPalette.AccentBright;private (double x0, double x1, double top, double bot) Geo()@@ -99,7 +99,7 @@ namespace Nota.App;public override void Render(DrawingContext ctx){double w = Bounds.Width, h = Bounds.Height; if (w <= 0) return;- ctx.DrawRectangle(Sunken, new Pen(BorderDef, 1), new Rect(0, 0, w, h), 5, 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));var (x0, x1, top, bot) = Geo();// Grid: 3 horizontal (mid dashed) + 3 vertical.var gp = new Pen(GridB, 1);@@ -120,22 +120,22 @@ namespace Nota.App;gc.LineTo(new Point(pts[^1].X, bot));gc.EndFigure(true);}- ctx.DrawGeometry(FillB, null, geo);var pen = new Pen(AccentBright, 1.8, lineCap: PenLineCap.Round, lineJoin: PenLineJoin.Round);for (int i = 1; i < pts.Count; i++) ctx.DrawLine(pen, pts[i - 1], pts[i]);// Cutoff marker line + draggable handle at the curve's cutoff point.ctx.DrawLine(new Pen(NotaPalette.Wash(NotaPalette.AccentBright, 0x40), 1), new Point(cx, top), new Point(cx, bot));double hy = _type == 3 ? bot : Math.Max(top + 2, top + (bot - top) * 0.34 - res * ((bot - top) * 0.34) * 0.92);- ctx.DrawEllipse(HandleB, new Pen(Sunken, 2), new Point(cx, hy), 4.5, 4.5);+ NotaGraph.Node(ctx, new Point(cx, hy), active: true);// Axis labels: dB left, frequency scale along the bottom.void Lbl(string t, double x, double y, IBrush b) => ctx.DrawText(new FormattedText(t, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Face, 8, b), new Point(x, y));Lbl("+12", x0 + 1, top - 1, AxisB);- Lbl("−48 dB", x0 + 1, bot - 10, AxisB);+ Lbl("−48\u2009dB", x0 + 1, bot - 10, AxisB);string[] fq = { "20", "100", "1k", "10k", "20k" };for (int i = 0; i < 5; i++) { double lx = x0 + (x1 - x0) * i / 4.0; Lbl(fq[i], Math.Clamp(lx - 6, x0, x1 - 18), bot + 2, AxisB); }double hz = 20.0 * Math.Pow(900.0, cut);- Lbl(hz >= 1000 ? $"● {hz / 1000.0:0.0}k" : $"● {hz:0} Hz", x1 - 52, top - 1, AccentBright);+ Glyph.Draw(ctx, GlyphKind.Record, new Rect(x1 - 52, top + 2, 5, 5), AccentBright);+ Lbl(hz >= 1000 ? $"{hz / 1000.0:0.0}k" : $"{hz:0}\u2009Hz", x1 - 45, top - 1, AccentBright);}}diff --git a/src/managed/Nota.App/Controls/VoltMatrix.cs b/src/managed/Nota.App/Controls/VoltMatrix.csindex 5d009cce..8f5ec20b 100644--- a/src/managed/Nota.App/Controls/VoltMatrix.cs+++ b/src/managed/Nota.App/Controls/VoltMatrix.cs@@ -21,14 +21,14 @@ internal sealed class VoltMatrix : Control{private static readonly IBrush Sunken = NotaPalette.BgSunken;private static readonly IBrush BorderDef = NotaPalette.BorderDefault;- private static readonly IBrush GridB = NotaPalette.Wash(NotaPalette.BorderStrong, 0x40);+ private static readonly IBrush GridB = NotaGraph.Grid;private static readonly IBrush Teal = NotaPalette.Teal;private static readonly IBrush TealFill = NotaPalette.Wash(NotaPalette.Teal, 0x80);private static readonly IBrush AmberFill = NotaPalette.Wash(NotaPalette.Accent, 0x80);private static readonly IBrush TxtC = NotaPalette.TextPrimary;private static readonly IBrush MutedC = NotaPalette.TextTertiary;private static readonly IBrush CellBg = NotaPalette.BgSunken;- private static readonly Typeface Face = new(FontFamily.Default);+ private static readonly Typeface Face = NotaFonts.Mono;private readonly IAudioEngine _e;private readonly int _t;diff --git a/src/managed/Nota.App/DeviceCardKit.cs b/src/managed/Nota.App/DeviceCardKit.csindex 19f1c5fa..691a8259 100644--- a/src/managed/Nota.App/DeviceCardKit.cs+++ b/src/managed/Nota.App/DeviceCardKit.cs@@ -19,6 +19,7 @@ namespace Nota.App;internal static class DeviceCardKit{internal const double CardH = 260;+ internal const double HeaderH = 22; // almanac device header: 20–22internal static readonly IBrush Raised = NotaPalette.SurfaceRaised;internal static readonly IBrush Card2 = NotaPalette.SurfaceCard;@@ -37,7 +38,7 @@ internal static class DeviceCardKitinternal static readonly IBrush Teal = NotaPalette.Teal; // modulation accentinternal static readonly IBrush AccentSubtleB = NotaPalette.AccentSubtle;- internal static string Pct(float v) => $"{(int)Math.Round(v * 100)}%";+ internal static string Pct(float v) => $"{(int)Math.Round(v * 100)}\u2009%";private static readonly string[] NoteNames = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };@@ -46,28 +47,210 @@ internal static class DeviceCardKit// readout and the Drum Rack pad labels.internal static string NoteName(int note) => $"{NoteNames[((note % 12) + 12) % 12]}{note / 12 - 1}";- // A labeled rotary knob cell (mockup style): knob, value readout, caption below.- internal static Control KnobCell(string name, Knob knob, TextBlock value, double cellW = 58)+ // A parameter cell, as the almanac draws it: knob, then a caps label 7/700 over a mono+ // value 7, centred, no gap — line heights 9 and 10, so under a 34 knob the cell is+ // exactly 53px tall. Label and value turn Brass Light when the parameter is changed+ // from its default (or is what the current tab is about — pass `emphasised`). Under+ // modulation the arc takes its source's chroma and the label stays neutral.+ internal static Control KnobCell(string name, Knob knob, TextBlock value, double cellW = 58, bool emphasised = false, IBrush? labelInk = null){knob.HorizontalAlignment = HorizontalAlignment.Center;value.HorizontalAlignment = HorizontalAlignment.Center;value.TextAlignment = TextAlignment.Center;- if (cellW < 52) value.FontSize = 7;+ value.FontSize = NotaType.KnobValue;+ value.LineHeight = 10;+ value.FontFamily = NotaFonts.MonoFamily;var lbl = new TextBlock{- Text = name.ToUpperInvariant(), FontSize = cellW < 52 ? 7 : 8, Foreground = TextTertiary,+ Text = name.ToUpperInvariant(), FontSize = NotaType.KnobLabel, FontWeight = FontWeight.Bold,+ LetterSpacing = NotaType.KnobLabelTracking, LineHeight = 9, Foreground = labelInk ?? TextTertiary,HorizontalAlignment = HorizontalAlignment.Center, TextAlignment = TextAlignment.Center,TextTrimming = TextTrimming.CharacterEllipsis, MaxWidth = cellW - 2,};- return new StackPanel { Width = cellW, Spacing = 1, Children = { knob, value, lbl } };+ var valueInk = value.Foreground ?? TextPrimary;+ void Paint()+ {+ bool hot = knob.ArcColor is null && (emphasised || knob.IsModified);+ lbl.Foreground = hot ? NotaPalette.AccentBright : labelInk ?? TextTertiary;+ value.Foreground = hot ? NotaPalette.AccentBright : valueInk;+ }+ knob.ValueSet += Paint;+ Paint();+ return new StackPanel { Width = cellW, Spacing = 0, Children = { knob, lbl, value } };+ }++ // An on/off switch with its word to the right (almanac: always a word, never an icon;+ // 7px caps inside a device). Left button toggles; right-click bubbles to the CV menu.+ // `sync` repaints from `get` — register it with the card's live-follow refreshers.+ internal static Border Switch(string label, Func<bool> get, Action toggle, out Action sync, Func<bool>? dim = null, Func<string>? liveLabel = null)+ {+ var track = new SwitchTrack();+ var txt = new TextBlock+ {+ Text = label.ToUpperInvariant(), FontSize = NotaType.KnobLabel, FontWeight = FontWeight.Bold,+ LetterSpacing = NotaType.KnobLabelTracking, VerticalAlignment = VerticalAlignment.Center,+ };+ var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { track } };+ if (label.Length > 0 || liveLabel is not null) row.Children.Add(txt);+ var host = new Border { Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = row };+ void Paint()+ {+ bool on = get(), d = dim?.Invoke() ?? false;+ track.IsOn = on; track.IsDim = d;+ txt.Foreground = on && !d ? TextPrimary : TextTertiary;+ if (liveLabel is not null) txt.Text = liveLabel().ToUpperInvariant();+ }+ host.PointerPressed += (_, e) =>+ {+ if (!e.GetCurrentPoint(host).Properties.IsLeftButtonPressed) return;+ toggle(); Paint(); e.Handled = true;+ };+ sync = Paint;+ Paint();+ return host;+ }++ // Segments, as the almanac draws them: a recessed container, and the chosen segment in+ // solid brass with dark text — a fill, not an outline. 9px inside a device. Two to four+ // choices; more than four is a dropdown. `current` returns the lit index, or −1 when+ // the value sits between choices. `fill` spreads the segments over the full width.+ // Left button picks; right-click bubbles. `sync` repaints — register it with the card.+ internal static Border Segments(string[] names, Func<int> current, Action<int> pick, out Action sync,+ bool fill = false, double minSegWidth = 0, Func<bool>? dim = null)+ {+ int n = names.Length;+ var cells = new Border[n];+ var texts = new TextBlock[n];+ Panel row = fill ? new Grid { ColumnSpacing = 1 } : new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };+ for (int i = 0; i < n; i++)+ {+ int iv = i;+ var tb = new TextBlock+ {+ Text = names[i], FontSize = NotaType.DeviceSection, HorizontalAlignment = HorizontalAlignment.Center,+ VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis,+ };+ var c = new Border+ {+ CornerRadius = NotaRadius.Badge, Padding = new Thickness(6, 1), MinWidth = minSegWidth,+ Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent, Child = tb,+ };+ c.PointerPressed += (_, e) =>+ {+ if (!e.GetCurrentPoint(c).Properties.IsLeftButtonPressed) return;+ pick(iv); Paint(); e.Handled = true;+ };+ if (fill)+ {+ ((Grid)row).ColumnDefinitions.Add(new ColumnDefinition(1, GridUnitType.Star));+ Grid.SetColumn(c, i);+ }+ cells[i] = c; texts[i] = tb; row.Children.Add(c);+ }+ void Paint()+ {+ int cur = current();+ bool d = dim?.Invoke() ?? false;+ for (int i = 0; i < n; i++)+ {+ bool on = i == cur;+ cells[i].Background = on ? (d ? NotaPalette.BorderStrong : Brass) : Brushes.Transparent;+ texts[i].Foreground = on ? OnAccent : d ? TextDisabled : TextTertiary;+ texts[i].FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal;+ }+ }+ sync = Paint;+ Paint();+ var host = new Border+ {+ Background = NotaPalette.BgSunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1),+ CornerRadius = NotaRadius.Control, Padding = new Thickness(1),+ VerticalAlignment = VerticalAlignment.Center, Child = row,+ };+ if (!fill) host.HorizontalAlignment = HorizontalAlignment.Left;+ host.BindResource(Border.BoxShadowProperty, "Shadow.Sunken");+ return host;+ }++ /// <summary>The index of the nearest of <paramref name="values"/>, or −1 when none is within 0.02.</summary>+ internal static int NearestExact(float v, float[] values)+ {+ int best = 0;+ for (int i = 1; i < values.Length; i++) if (Math.Abs(values[i] - v) < Math.Abs(values[best] - v)) best = i;+ return Math.Abs(values[best] - v) < 0.02f ? best : -1;+ }++ // A slider row, as the almanac draws it: caps label 8/700 · a 3px track with a 6×7+ // Brass Light handle · a mono 9 value in a fixed-width right-aligned column, so values+ // stacked in a column line up on the right. An inactive row (`dim`) loses its brass+ // and its label and value drop to Ink 6 — but the number stays readable.+ //+ // Works in normalised 0..1: `norm` reads, `setNorm` writes (the caller maps to the+ // parameter and does its own follow-up); `text` formats the value for display.+ // `trackWidth` fixes the track, otherwise it stretches. An empty label drops the+ // label column. `sync` repaints from `norm` and skips while the hand is on the slider.+ internal static Grid SliderRow(string label, Func<double> norm, Action<double> setNorm, Func<string> text, out Action sync,+ Action? begin = null, Action? end = null, Action? reset = null, bool bipolar = false, Func<bool>? dim = null,+ double labelWidth = 0, double trackWidth = double.NaN, double valueWidth = 42)+ {+ Action repaint = () => { };+ var track = new SliderTrack { Bipolar = bipolar, Reset = reset is null ? null : () => { reset(); repaint(); } };+ if (!double.IsNaN(trackWidth)) track.Width = trackWidth;+ var val = new TextBlock+ {+ FontFamily = NotaFonts.MonoFamily, FontSize = 9, TextAlignment = TextAlignment.Right,+ VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.None,+ };+ if (valueWidth > 0) val.Width = valueWidth;+ TextBlock? lbl = null;+ if (label.Length > 0)+ {+ lbl = new TextBlock+ {+ Text = label.ToUpperInvariant(), FontSize = NotaType.RowLabel, FontWeight = FontWeight.Bold,+ LetterSpacing = NotaType.RowLabelTracking, VerticalAlignment = VerticalAlignment.Center,+ TextTrimming = TextTrimming.CharacterEllipsis,+ };+ if (labelWidth > 0) lbl.Width = labelWidth;+ }+ void Paint()+ {+ bool d = dim?.Invoke() ?? false;+ track.Norm = norm();+ track.IsDim = d;+ val.Text = text();+ val.Foreground = d ? TextDisabled : TextPrimary;+ if (lbl is not null) lbl.Foreground = d ? TextDisabled : TextTertiary;+ }+ repaint = Paint;+ track.Changed += v => { setNorm(v); val.Text = text(); };+ if (begin is not null) track.GestureBegin += begin;+ if (end is not null) track.GestureEnd += end;+ track.SizeChanged += (_, _) => track.InvalidateVisual();++ var g = new Grid { ColumnSpacing = 8, VerticalAlignment = VerticalAlignment.Center };+ int col = 0;+ if (lbl is not null)+ {+ g.ColumnDefinitions.Add(new ColumnDefinition(GridLength.Auto));+ Grid.SetColumn(lbl, col++); g.Children.Add(lbl);+ }+ g.ColumnDefinitions.Add(double.IsNaN(trackWidth) ? new ColumnDefinition(1, GridUnitType.Star) : new ColumnDefinition(GridLength.Auto));+ Grid.SetColumn(track, col++); g.Children.Add(track);+ g.ColumnDefinitions.Add(new ColumnDefinition(GridLength.Auto));+ Grid.SetColumn(val, col); g.Children.Add(val);++ sync = () => { if (!track.Dragging) Paint(); };+ Paint();+ return g;}internal static Border SimpleCard(string title, double width, Control body){var headerBar = new Border{- Height = 26, BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 0, 1), Padding = new Thickness(8, 0),- Child = new TextBlock { Text = title, FontSize = 11, FontWeight = FontWeight.SemiBold, Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center },+ Height = HeaderH, BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 0, 1), Padding = new Thickness(8, 0),+ Child = new TextBlock { Text = title, FontSize = NotaType.DeviceName, FontWeight = FontWeight.SemiBold, Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center },};var stack = new Grid { RowDefinitions = new RowDefinitions("Auto,*") };stack.Children.Add(headerBar);@@ -77,26 +260,31 @@ internal static class DeviceCardKitreturn new Border{Width = width, Height = CardH, Background = Raised, BorderBrush = BorderDef,- BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(7), ClipToBounds = true, Child = stack,+ BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Body, ClipToBounds = true, Child = stack,};}internal static Control Hint(string text) => new TextBlock{- Text = text, FontSize = 11, Foreground = TextTertiary,+ Text = text, FontSize = 9, Foreground = TextTertiary,VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(4, 0),};- internal static TextBlock Glyph(string glyph, bool enabled, Action onClick)+ // A clickable header glyph (move left / right, remove), drawn — not a typed character.+ internal static Border Glyph(GlyphKind glyph, bool enabled, Action onClick){- var t = new TextBlock+ var host = new Border{- Text = glyph, FontSize = 10, Foreground = enabled ? TextSecondary : TextDisabled,- VerticalAlignment = VerticalAlignment.Center,+ Width = 12, Height = 14, Background = Brushes.Transparent, VerticalAlignment = VerticalAlignment.Center,Cursor = enabled ? new Cursor(StandardCursorType.Hand) : Cursor.Default,+ Child = new Nota.App.Glyph(glyph, 8) { Foreground = enabled ? TextSecondary : TextDisabled },+ };+ if (enabled) host.PointerPressed += (_, e) =>+ {+ if (!e.GetCurrentPoint(host).Properties.IsLeftButtonPressed) return;+ e.Handled = true; onClick();};- if (enabled) t.PointerPressed += (_, e) => { e.Handled = true; onClick(); };- return t;+ return host;}internal static Border TextButton(string text)@@ -104,46 +292,28 @@ internal static class DeviceCardKitvar b = new Border{Background = Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(5), Padding = new Thickness(10, 4), HorizontalAlignment = HorizontalAlignment.Center,+ CornerRadius = NotaRadius.Tile, Padding = new Thickness(10, 4), HorizontalAlignment = HorizontalAlignment.Center,Cursor = new Cursor(StandardCursorType.Hand),- Child = new TextBlock { Text = text, FontSize = 11, Foreground = TextPrimary },+ Child = new TextBlock { Text = text, FontSize = 9, Foreground = TextPrimary },};return b;}internal static Control BypassTag() => new Border{- BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3),+ BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge,Padding = new Thickness(4, 0), VerticalAlignment = VerticalAlignment.Center,- Child = new TextBlock { Text = "BYPASSED", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = TextSecondary },+ Child = new TextBlock { Text = "BYPASSED", FontSize = NotaType.RowLabel, FontWeight = FontWeight.Bold, LetterSpacing = NotaType.RowLabelTracking, Foreground = TextSecondary },};// A caption above a control (centered, uppercase tertiary label).internal static Control Labeled(string label, Control c){- var lbl = new TextBlock { Text = label.ToUpperInvariant(), FontSize = 8, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center };+ var lbl = new TextBlock { Text = label.ToUpperInvariant(), FontSize = NotaType.RowLabel, FontWeight = FontWeight.Bold, LetterSpacing = NotaType.RowLabelTracking, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center };return new StackPanel { Spacing = 2, Children = { lbl, c } };}// A horizontal row of single-select chips over an integer choice (get/set).internal static Control ChipRow(string[] options, Func<int> get, Action<int> set)- {- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 3 };- var chips = new Border[options.Length];- void Sync() { int cur = Math.Clamp(get(), 0, options.Length - 1); for (int i = 0; i < chips.Length; i++) { bool on = i == cur; chips[i].Background = on ? Brass : Card2; ((TextBlock)chips[i].Child!).Foreground = on ? OnAccent : TextSecondary; } }- for (int i = 0; i < options.Length; i++)- {- int vi = i;- var chip = new Border- {- Background = Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4),- Padding = new Thickness(6, 2), Cursor = new Cursor(StandardCursorType.Hand),- Child = new TextBlock { Text = options[i], FontSize = 9, Foreground = TextSecondary },- };- chip.PointerPressed += (_, _) => { set(vi); Sync(); };- chips[i] = chip; row.Children.Add(chip);- }- Sync();- return row;- }+ => Segments(options, () => Math.Clamp(get(), 0, options.Length - 1), set, out _);}diff --git a/src/managed/Nota.App/DeviceCards/Bodies/AmpDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/AmpDeviceBody.csindex 06bfe4c7..6b76fb74 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/AmpDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/AmpDeviceBody.cs@@ -44,6 +44,8 @@ internal sealed class AmpDeviceBody : IDeviceBodyprivate static readonly IBrush AmberSubtle = NotaPalette.Wash(NotaPalette.Accent, 0x28);public double Width => 700;++ public string? Subtitle => "AMP SIM"; // the processing type, shown as the header badgepublic bool FullBleed => true;public Control Build(DeviceCardContext ctx, int index)@@ -77,94 +79,53 @@ internal sealed class AmpDeviceBody : IDeviceBody// ---- generic controls ----Control MiniSlider(string label, int p, double min, double max, Func<double, string> fmt, double w){- var val = Mono(fmt(G(p)), Txt); val.MinWidth = 28;- var fill = new Border { Height = 3, Background = Amber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 8, Height = 9, Background = Sub, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Width = w, Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent };- slot.Children.Add(new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center });- slot.Children.Add(fill); slot.Children.Add(handle);- void Vis(double v) { double n = (v - min) / (max - min); fill.Width = n * w; handle.Margin = new Thickness(Math.Clamp(n * w - 4, 0, w - 8), 0, 0, 0); }- bool drag = false;- void SetX(double x) { double n = Math.Clamp(x / w, 0, 1); double v = min + n * (max - min); S(p, v); Vis(v); val.Text = fmt(v); Sync(); }- slot.PointerPressed += (_, e) => { drag = true; Begin(p); e.Pointer.Capture(slot); SetX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); End(p); } };- MidiLearn.Bind(slot, MidiTarget.DeviceParam(track, di, p), label);- ctx.AddDeviceRefresher(() => { if (!drag) { double v = G(p); Vis(v); val.Text = fmt(v); } });- return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap(label), slot, val } };+ var row = DeviceCardKit.SliderRow(label, () => (G(p) - min) / (max - min), n => { S(p, min + n * (max - min)); Sync(); }, () => fmt(G(p)), out var sync,+ begin: () => Begin(p), end: () => End(p), trackWidth: w, valueWidth: 28);+ ctx.AddDeviceRefresher(sync);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), label);+ return row;}// Discrete chip group over a param (0..n-1).Control Chips(int p, string[] names, double fs = 9, double padX = 5, double minW = 0){- var arr = new Border[names.Length];- void Hi() { int cur = Math.Clamp(Gi(p), 0, names.Length - 1); for (int i = 0; i < names.Length; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Card; arr[i].BorderBrush = on ? Amber : Bd; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : Sub; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2 };- for (int i = 0; i < names.Length; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(padX, 1), MinWidth = minW, Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, FontWeight = FontWeight.SemiBold, Foreground = Sub, HorizontalAlignment = HorizontalAlignment.Center } }; c.PointerPressed += (_, _) => { S(p, iv); Hi(); Sync(); }; arr[i] = c; row.Children.Add(c); }- ctx.AddDeviceRefresher(Hi); Hi();- MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));- return row;+ var seg = DeviceCardKit.Segments(names, () => Math.Clamp(Gi(p), 0, names.Length - 1), iv => { S(p, iv); Sync(); }, out var sync, minSegWidth: minW);+ ctx.AddDeviceRefresher(sync);+ MidiLearn.Bind(seg, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));+ return seg;}// Oversampling quality chips (normalized param 0..1 → Off/2×/4×/8×).Control OsChips(){- var arr = new Border[4];- void Hi() { int cur = Math.Clamp((int)Math.Round(G(POs) * 3), 0, 3); for (int i = 0; i < 4; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Card; arr[i].BorderBrush = on ? Amber : Bd; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : Sub; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2 };- for (int i = 0; i < 4; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(4, 1), MinWidth = 22, Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = OsNames[i], FontSize = 8, FontWeight = FontWeight.SemiBold, Foreground = Sub, HorizontalAlignment = HorizontalAlignment.Center } }; c.PointerPressed += (_, _) => { S(POs, iv / 3f); Hi(); }; arr[i] = c; row.Children.Add(c); }- ctx.AddDeviceRefresher(Hi); Hi();- MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, POs), engine.DeviceParamName(track, di, POs));- return row;+ var seg = DeviceCardKit.Segments(OsNames, () => Math.Clamp((int)Math.Round(G(POs) * 3), 0, 3), i => S(POs, i / 3f), out var sync, minSegWidth: 22);+ ctx.AddDeviceRefresher(sync);+ MidiLearn.Bind(seg, MidiTarget.DeviceParam(track, di, POs), engine.DeviceParamName(track, di, POs));+ return seg;}// Segmented (inset frame) over a param.Control Seg(int p, string[] names){- var arr = new Border[names.Length];- void Hi() { int cur = Math.Clamp(Gi(p), 0, names.Length - 1); for (int i = 0; i < names.Length; i++) { bool on = i == cur; arr[i].Background = on ? Amber : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? Ink : Muted; } }- var row = new Grid { ColumnSpacing = 1 };- for (int i = 0; i < names.Length; i++) row.ColumnDefinitions.Add(new ColumnDefinition(1, GridUnitType.Star));- for (int i = 0; i < names.Length; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(2), Padding = new Thickness(4, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 8, FontWeight = FontWeight.SemiBold, Foreground = Muted, HorizontalAlignment = HorizontalAlignment.Center } }; c.PointerPressed += (_, _) => { S(p, iv); Hi(); }; arr[i] = c; Grid.SetColumn(c, i); row.Children.Add(c); }- ctx.AddDeviceRefresher(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(1), Child = row };+ var seg = DeviceCardKit.Segments(names, () => Math.Clamp(Gi(p), 0, names.Length - 1), iv => S(p, iv), out var sync, fill: true);+ ctx.AddDeviceRefresher(sync);MidiLearn.Bind(seg, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));return seg;}Control MiniRow(string label, int p, Func<double, string> fmt){- var lbl = Cap(label); lbl.Width = 26;- var val = Mono(fmt(G(p)), Txt); val.MinWidth = 34; val.TextAlignment = TextAlignment.Right;- var fill = new Border { Height = 3, Background = Amber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 7, Height = 9, Background = Sub, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent };- slot.Children.Add(new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center });- slot.Children.Add(fill); slot.Children.Add(handle);- void Vis(double v) { double W = slot.Bounds.Width; fill.Width = v * W; handle.Margin = new Thickness(Math.Clamp(v * W - 3.5, 0, Math.Max(0, W - 7)), 0, 0, 0); }- bool drag = false;- void SetX(double x) { double v = Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1); S(p, v); Vis(v); val.Text = fmt(v); }- slot.PointerPressed += (_, e) => { drag = true; Begin(p); e.Pointer.Capture(slot); SetX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); End(p); } };- slot.SizeChanged += (_, _) => Vis(G(p));- ctx.AddDeviceRefresher(() => { if (!drag) { Vis(G(p)); val.Text = fmt(G(p)); } });- var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center };- Grid.SetColumn(slot, 1); Grid.SetColumn(val, 2);- g.Children.Add(lbl); g.Children.Add(slot); g.Children.Add(val);- return g;+ var row = DeviceCardKit.SliderRow(label, () => G(p), n => S(p, n), () => fmt(G(p)), out var sync,+ begin: () => Begin(p), end: () => End(p), labelWidth: 26, valueWidth: 34);+ ctx.AddDeviceRefresher(sync);+ return row;}Control Toggle(int p){- var trk = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), Background = Inset };- var knob = new Avalonia.Controls.Shapes.Ellipse { Width = 6, Height = 6, Fill = Muted, HorizontalAlignment = HorizontalAlignment.Left, Margin = new Thickness(2, 0, 0, 0), VerticalAlignment = VerticalAlignment.Center };- trk.Child = knob;- void SyncT() { bool on = G(p) >= 0.5f; trk.Background = on ? Amber : Inset; knob.Fill = on ? Ink : Muted; knob.HorizontalAlignment = on ? HorizontalAlignment.Right : HorizontalAlignment.Left; knob.Margin = new Thickness(on ? 0 : 2, 0, on ? 2 : 0, 0); }- trk.Cursor = new Cursor(StandardCursorType.Hand);- trk.PointerPressed += (_, _) => { S(p, G(p) >= 0.5f ? 0 : 1); SyncT(); Sync(); };- ctx.AddDeviceRefresher(SyncT); SyncT();- return trk;+ var sw = DeviceCardKit.Switch("", () => G(p) >= 0.5f, () => { S(p, G(p) >= 0.5f ? 0 : 1); Sync(); }, out var syncT);+ ctx.AddDeviceRefresher(syncT);+ return sw;}// ---- LIVE strip ----var liveL = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center, Children = { Chips(PModel, Models, 9, 5, 34), MiniSlider("GAIN", PGain, 0, 10, v => $"{v:0.0}", 62) } };- var mix = MiniSlider("MIX", PMix, 0, 1, v => $"{v * 100:0} %", 44); mix.HorizontalAlignment = HorizontalAlignment.Right;+ var mix = MiniSlider("MIX", PMix, 0, 1, v => $"{v * 100:0}\u2009%", 44); mix.HorizontalAlignment = HorizontalAlignment.Right;var liveGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto") };Grid.SetColumn(mix, 1); liveGrid.Children.Add(liveL); liveGrid.Children.Add(mix);var liveStrip = new Border { Height = 34, Background = HdrBg, BorderBrush = Bd, BorderThickness = new Thickness(0, 0, 0, 1), Padding = new Thickness(9, 0), Child = liveGrid };@@ -190,8 +151,8 @@ internal sealed class AmpDeviceBody : IDeviceBodyvar cabGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,*,*"), RowDefinitions = new RowDefinitions("Auto,Auto"), ColumnSpacing = 2, RowSpacing = 2 };{var arr = new Border[Cabs.Length];- void Hi() { int cur = Math.Clamp(Gi(PCabType), 0, Cabs.Length - 1); for (int i = 0; i < Cabs.Length; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Card; arr[i].BorderBrush = on ? Amber : Bd; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : Sub; } }- for (int i = 0; i < Cabs.Length; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(0, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = Cabs[i], FontSize = 8, FontWeight = FontWeight.SemiBold, Foreground = Sub, HorizontalAlignment = HorizontalAlignment.Center } }; c.PointerPressed += (_, _) => { S(PCabType, iv); Hi(); Sync(); }; arr[i] = c; Grid.SetColumn(c, i % 3); Grid.SetRow(c, i / 3); cabGrid.Children.Add(c); }+ void Hi() { int cur = Math.Clamp(Gi(PCabType), 0, Cabs.Length - 1); for (int i = 0; i < Cabs.Length; i++) { bool on = i == cur; arr[i].Background = on ? Amber : Card; arr[i].BorderBrush = on ? Amber : Bd; ((TextBlock)arr[i].Child!).Foreground = on ? NotaPalette.TextOnAccent : Sub; } }+ for (int i = 0; i < Cabs.Length; i++) { int iv = i; var c = new Border { CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), Padding = new Thickness(0, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = Cabs[i], FontSize = 8, FontWeight = FontWeight.SemiBold, Foreground = Sub, HorizontalAlignment = HorizontalAlignment.Center } }; c.PointerPressed += (_, _) => { S(PCabType, iv); Hi(); Sync(); }; arr[i] = c; Grid.SetColumn(c, i % 3); Grid.SetRow(c, i / 3); cabGrid.Children.Add(c); }ctx.AddDeviceRefresher(Hi); Hi();}var micRow = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), ColumnSpacing = 4, VerticalAlignment = VerticalAlignment.Center };@@ -202,7 +163,7 @@ internal sealed class AmpDeviceBody : IDeviceBodycabHead, cabGrid, micRow,MiniRow("AXIS", PAxis, v => v <= 0.02 ? "on" : $"off {v * 100:0}"),new Border { Height = 1, Background = Card },- MiniRow("GATE", PGate, v => v <= 0.001 ? "off" : $"−{75 - v * 55:0} dB"),+ MiniRow("GATE", PGate, v => v <= 0.001 ? "off" : $"−{75 - v * 55:0.0}\u2009dB"),new Border { Height = 1, Background = Card },Cap("OVERSAMPLE"), OsChips(),} };diff --git a/src/managed/Nota.App/DeviceCards/Bodies/AutoFilterDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/AutoFilterDeviceBody.csindex 0841faca..35ffb5cf 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/AutoFilterDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/AutoFilterDeviceBody.cs@@ -45,6 +45,8 @@ internal sealed class AutoFilterDeviceBody : IDeviceBodyprivate static readonly IBrush RowLit = NotaPalette.SurfaceRaised;public double Width => 700;++ public string? Subtitle => "FILTER"; // the processing type, shown as the header badgepublic bool FullBleed => true;public Control Build(DeviceCardContext ctx, int index)@@ -66,14 +68,14 @@ internal sealed class AutoFilterDeviceBody : IDeviceBodyctx.AddDeviceRefresher(curve.Tick);// ---- formatters ----- string Hz(double v) { double f = Exp(v, 30, 18000); return f >= 1000 ? $"{f / 1000:0.00} kHz" : $"{(int)Math.Round(f)} Hz"; }- static string PctF(double v) => $"{v * 100:0}%";- static string Bip(double v) => $"{(v - 0.5) * 200:+0;-0;0}%";- static string GainF(double v) => $"{(v - 0.5) * 48:+0.0;-0.0;0.0}";- static string Ms(double v, double lo, double hi) { double m = lo * Math.Pow(hi / lo, v); return m >= 100 ? $"{m:0}ms" : $"{m:0.0}ms"; }+ string Hz(double v) { double f = Exp(v, 30, 18000); return f >= 1000 ? $"{f / 1000:0.0}\u2009k" : $"{(int)Math.Round(f)}\u2009Hz"; }+ static string PctF(double v) => $"{v * 100:0}\u2009%";+ static string Bip(double v) => $"{(v - 0.5) * 200:+0;−0;0}\u2009%";+ static string GainF(double v) => $"{(v - 0.5) * 48:+0.0;−0.0;0.0}";+ static string Ms(double v, double lo, double hi) { double m = lo * Math.Pow(hi / lo, v); return m >= 100 ? $"{m:0}\u2009ms" : $"{m:0.0}\u2009ms"; }string AttF(double v) => Ms(v, 0.1, 500);string RelF(double v) => Ms(v, 1, 2000);- string RateF(double v) => P(LfoSync) >= 0.5f ? DivNames[Math.Clamp((int)Math.Round(v * 7), 0, 7)] : $"{Exp(v, 0.01, 40):0.00}Hz";+ string RateF(double v) => P(LfoSync) >= 0.5f ? DivNames[Math.Clamp((int)Math.Round(v * 7), 0, 7)] : $"{Exp(v, 0.01, 40):0.00}\u2009Hz";var readouts = new List<Action>();@@ -95,12 +97,9 @@ internal sealed class AutoFilterDeviceBody : IDeviceBody// Segmented pill over a normalized param.Control Seg(int p, string[] opts, bool teal = false){- int n = opts.Length; var cells = new Border[n]; var texts = new TextBlock[n];- void Sync() { int cur = (int)Math.Round(P(p) * (n - 1)); for (int i = 0; i < n; i++) { bool on = i == cur; cells[i].Background = on ? (teal ? TealSubtle : AmberSubtle) : Brushes.Transparent; cells[i].BorderBrush = on ? (teal ? TealC : Amber) : Brushes.Transparent; texts[i].Foreground = on ? (teal ? TealC : AmberLit) : MutedC; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++) { int iv = i; var tb = new TextBlock { Text = opts[i], FontSize = 9, Foreground = MutedC }; var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(6, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = tb }; c.PointerPressed += (_, e) => { e.Handled = true; SetP(p, n > 1 ? iv / (float)(n - 1) : 0f); SyncCurve(); RefreshAll(); }; cells[i] = c; texts[i] = tb; row.Children.Add(c); }- readouts.Add(Sync);- var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ int n = opts.Length;+ var seg = DeviceCardKit.Segments(opts, () => Math.Clamp((int)Math.Round(P(p) * (n - 1)), 0, n - 1), iv => { SetP(p, n > 1 ? iv / (float)(n - 1) : 0f); SyncCurve(); RefreshAll(); }, out var sync);+ readouts.Add(sync);MidiLearn.Bind(seg, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));return seg;}@@ -108,33 +107,20 @@ internal sealed class AutoFilterDeviceBody : IDeviceBody// Horizontal param slider (LIVE strip + rails).Control HSlider(int p, string label, Func<double, string> fmt, double lw, double vw, bool bipolar = false){- var fill = new Border { Height = 3, Background = Amber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var track2 = new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center };- var center = bipolar ? new Border { Width = 1, Background = NotaPalette.BorderStrong, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Stretch, Margin = new Thickness(0, 1) } : null;- var handle = new Border { Width = 8, Height = 10, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Height = 11, MinWidth = 40 }; slot.Children.Add(track2); if (center != null) slot.Children.Add(center); slot.Children.Add(fill); slot.Children.Add(handle);- var val = new TextBlock { Text = fmt(P(p)), FontSize = 9, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center }; val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono"); if (vw > 0) { val.Width = vw; val.TextAlignment = TextAlignment.Right; }- bool drag = false;- void Upd() { double v = P(p); double W = slot.Bounds.Width; double hx = v * W; handle.Margin = new Thickness(Math.Clamp(hx - 4, 0, Math.Max(0, W - 8)), 0, 0, 0); if (bipolar) { double c = W * 0.5; double a = Math.Min(c, hx), b = Math.Max(c, hx); fill.Margin = new Thickness(a, 0, 0, 0); fill.Width = Math.Max(0, b - a); } else fill.Width = hx; val.Text = fmt(v); }- void SetFromX(double x) { double v = Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1); SetP(p, (float)v); SyncCurve(); Upd(); }- slot.PointerPressed += (_, e) => { drag = true; e.Pointer.Capture(slot); Begin(p); SetFromX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetFromX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); End(p); } };- readouts.Add(() => { if (!drag) Upd(); });- var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center };- if (lw > 0) { var lbl = Cap(label); ((TextBlock)lbl).Width = lw; g.Children.Add(lbl); }- Grid.SetColumn(slot, 1); g.Children.Add(slot); Grid.SetColumn(val, 2); g.Children.Add(val);- MidiLearn.Bind(g, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));- return g;+ var row = DeviceCardKit.SliderRow(lw > 0 ? label : "", () => P(p), n => { SetP(p, (float)n); SyncCurve(); }, () => fmt(P(p)), out var sync,+ begin: () => Begin(p), end: () => End(p), bipolar: bipolar, labelWidth: lw, valueWidth: vw);+ readouts.Add(sync);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));+ return row;}// Filter-type icons row (icon-only) for the LIVE strip.Control TypeRow(){var cells = new Border[4]; var icons = new IIconColor[4];- void Sync() { int cur = (int)Math.Round(P(Type) * 3); for (int i = 0; i < 4; i++) { bool on = i == cur; cells[i].Background = on ? AmberSubtle : Inset; cells[i].BorderBrush = on ? Amber : Border2; icons[i].Color = on ? AmberLit : MutedC; } }+ void Sync() { int cur = (int)Math.Round(P(Type) * 3); for (int i = 0; i < 4; i++) { bool on = i == cur; cells[i].Background = on ? Amber : Inset; cells[i].BorderBrush = on ? Amber : Border2; icons[i].Color = on ? NotaPalette.TextOnAccent : MutedC; } }var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 3 };- for (int i = 0; i < 4; i++) { int iv = i; var ic = new FilterTypeIcon(i, MutedC); var c = new Border { Width = 34, Height = 22, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Cursor = new Cursor(StandardCursorType.Hand), Child = new Border { Child = ic, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center } }; c.PointerPressed += (_, e) => { e.Handled = true; SetP(Type, iv / 3f); SyncCurve(); RefreshAll(); }; cells[i] = c; icons[i] = ic; row.Children.Add(c); }+ for (int i = 0; i < 4; i++) { int iv = i; var ic = new FilterTypeIcon(i, MutedC); var c = new Border { Width = 34, Height = 22, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Cursor = new Cursor(StandardCursorType.Hand), Child = new Border { Child = ic, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center } }; c.PointerPressed += (_, e) => { e.Handled = true; SetP(Type, iv / 3f); SyncCurve(); RefreshAll(); }; cells[i] = c; icons[i] = ic; row.Children.Add(c); }readouts.Add(Sync);MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, Type), engine.DeviceParamName(track, di, Type));return row;@@ -174,7 +160,7 @@ internal sealed class AutoFilterDeviceBody : IDeviceBodyvar c = new Border{BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(3),+ CornerRadius = NotaRadius.Badge,Padding = new Thickness(3, 2),Cursor = new Cursor(StandardCursorType.Hand),Child = new StackPanel@@ -223,8 +209,8 @@ internal sealed class AutoFilterDeviceBody : IDeviceBodyControl ToggleChip(int p, Func<double, string> fmt, bool cycle = false){var tb = new TextBlock { Text = fmt(P(p)), FontSize = 8, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center };- var b = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(5, 1), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = tb };- void Sync() { bool on = P(p) >= 0.5f; b.Background = on ? TealSubtle : Brushes.Transparent; b.BorderBrush = on ? TealC : Border2; tb.Foreground = on ? TealC : MutedC; tb.Text = fmt(P(p)); }+ var b = new Border { CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), Padding = new Thickness(5, 1), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = tb };+ void Sync() { bool on = P(p) >= 0.5f; b.Background = on ? NotaPalette.AccentSubtle : Brushes.Transparent; b.BorderBrush = on ? NotaPalette.BorderBrass : Border2; tb.Foreground = on ? NotaPalette.AccentHover : MutedC; tb.Text = fmt(P(p)); }b.PointerPressed += (_, e) => { e.Handled = true; if (cycle) { float nx = P(p) + 0.25f; if (nx > 1.001f) nx = 0f; SetP(p, nx); } else SetP(p, P(p) >= 0.5f ? 0f : 1f); Sync(); };readouts.Add(Sync);MidiLearn.Bind(b, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));@@ -238,11 +224,11 @@ internal sealed class AutoFilterDeviceBody : IDeviceBodyTypeRow(),Seg(Slope, new[] { "12", "24" }),new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Width = 150, Children = { Cap("FREQ"), HSlider(Freq, "", Hz, 0, 52) } },- new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Width = 116, Children = { Cap("RES"), HSlider(Res, "", PctF, 0, 34) } } } },+ new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Width = 116, Children = { Cap("RESO"), HSlider(Res, "", PctF, 0, 34) } } } },new StackPanel { [DockPanel.DockProperty] = Dock.Right, VerticalAlignment = VerticalAlignment.Center, Children = { Seg(Circuit, new[] { "Clean", "Analog" }) } } } } };// ================= graph =================- var graph = new Border { Padding = new Thickness(8, 7), Child = new Border { Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Child = curve, ClipToBounds = true } };+ var graph = new Border { Padding = new Thickness(8, 7), Child = new Border { Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Child = curve, ClipToBounds = true } };// ================= modulation column (ENV + LFO lanes) =================Control LaneHeader(int onParam, string name, params Control[] trailing)@@ -300,7 +286,7 @@ internal sealed class AutoFilterDeviceBody : IDeviceBodyChildren ={Cell("RATE", LfoRate, RateF),- Cell("AMT", LfoAmt, PctF, TealC),+ Cell("AMOUNT", LfoAmt, PctF, TealC),Cell("MORPH", LfoMorph, PctF, TealC),}};@@ -404,9 +390,9 @@ internal sealed class AutoFilterDeviceBody : IDeviceBody// Sidechain gain slider (dB, ±24, bipolar).var gVal = new TextBlock { Text = $"{engine.DeviceSidechainGain(track, di):0.0}", FontSize = 9, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center, TextAlignment = TextAlignment.Right, Width = 28 };gVal.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- var gFill = new Border { Height = 3, Background = NotaPalette.BorderStrong, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var gTrack = new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center };- var gHandle = new Border { Width = 8, Height = 9, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var gFill = new Border { Height = 3, Background = NotaPalette.BorderStrong, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var gTrack = new Border { Height = 3, Background = Inset, CornerRadius = NotaRadius.Clip, VerticalAlignment = VerticalAlignment.Center };+ var gHandle = new Border { Width = 8, Height = 9, Background = NotaPalette.TextSecondary, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };var gSlot = new Panel { Height = 10, MinWidth = 34, Children = { gTrack, gFill, gHandle } };void GUpd() { double db = engine.DeviceSidechainGain(track, di); double v = Math.Clamp((db + 24) / 48.0, 0, 1); double W = gSlot.Bounds.Width; gHandle.Margin = new Thickness(Math.Clamp(v * W - 4, 0, Math.Max(0, W - 8)), 0, 0, 0); gFill.Width = v * W; gVal.Text = $"{db:0.0}"; }bool gd = false;@@ -415,11 +401,11 @@ internal sealed class AutoFilterDeviceBody : IDeviceBodygSlot.PointerMoved += (_, e) => { if (gd) GSet(e.GetPosition(gSlot).X); };gSlot.PointerReleased += (_, e) => { if (gd) { gd = false; e.Pointer.Capture(null); } };- var body = new StackPanel { Spacing = 4, Opacity = sw.IsOn ? 1.0 : 0.45, Children = {+ var body = new StackPanel { Spacing = 4, Children = {combo,new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 4, Children = { Cap("GAIN", muted), WithCol(gSlot, 1), WithCol(gVal, 2) } } } };- void Reflect(int src) { bool on = src >= 0; body.Opacity = on ? 1.0 : 0.45; if (sw.IsOn != on) sw.IsOn = on; }+ void Reflect(int src) { bool on = src >= 0; Inactive.Set(body, !on, interactive: true); if (sw.IsOn != on) sw.IsOn = on; }combo.SelectionChanged += (_, _) => { int sel = combo.SelectedIndex; if (sel < 0 || sel >= ids.Count) return; engine.SetDeviceSidechainSource(track, di, ids[sel]); Reflect(ids[sel]); };sw.Changed += on => { int src = on ? (ids.Count > 1 ? ids[1] : -1) : -1; engine.SetDeviceSidechainSource(track, di, src); combo.SelectedIndex = Math.Max(0, ids.IndexOf(src)); Reflect(src); };Avalonia.Threading.Dispatcher.UIThread.Post(GUpd);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/AutoGainDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/AutoGainDeviceBody.csindex e4262ac5..6650168e 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/AutoGainDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/AutoGainDeviceBody.cs@@ -43,10 +43,11 @@ internal sealed class AutoGainDeviceBody : IDeviceBodyprivate static readonly IBrush Dim = NotaPalette.BorderStrong;private static readonly IBrush Green = NotaPalette.Success;private static readonly IBrush Yellow = NotaPalette.Warning;- private static readonly IBrush Red = NotaPalette.DangerDeep;private static readonly IBrush HandleC = NotaPalette.TextSecondary;public double Width => 700;++ public string? Subtitle => "LEVELER"; // the processing type, shown as the header badgepublic bool FullBleed => true;public Control Build(DeviceCardContext ctx, int index)@@ -67,45 +68,27 @@ internal sealed class AutoGainDeviceBody : IDeviceBodyctx.AddDeviceRefresher(hist.Tick);// ---- formatters ----- static string TargetF(double v) => $"{-36 + v * 36:0.0} LUFS";- static string TrimF(double v) => $"{(v - 0.5) * 24:+0.0;-0.0;0.0}";- static string WindowF(double v) => $"{0.4 * Math.Pow(25, v):0.0} s";+ static string TargetF(double v) => $"{-36 + v * 36:0.0}\u2009LUFS";+ static string TrimF(double v) => $"{(v - 0.5) * 24:+0.0;−0.0;0.0}";+ static string WindowF(double v) => $"{0.4 * Math.Pow(25, v):0.0}\u2009s";static string MaxF(double v) => $"{v * 24:0}";// ---- horizontal slider (label | slot | value) ----Control HRow(int p, string label, Func<double, string> fmt, double labW, double valW, bool teal = false, bool bipolar = false){- var accent = teal ? TealC : Amber;- var fill = new Border { Height = 3, Background = accent, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var trk = new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center };- var center = bipolar ? new Border { Width = 1, Background = Dim, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Stretch, Margin = new Thickness(0, 1) } : null;- var handle = new Border { Width = 8, Height = 9, Background = HandleC, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Height = 11, MinWidth = 30 }; slot.Children.Add(trk); if (center != null) slot.Children.Add(center); slot.Children.Add(fill); slot.Children.Add(handle);- var val = new TextBlock { Text = fmt(P(p)), FontSize = 9, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center }; val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono"); if (valW > 0) { val.Width = valW; val.TextAlignment = TextAlignment.Right; }- bool drag = false;- void Upd() { double v = P(p), W = slot.Bounds.Width, hx = v * W; handle.Margin = new Thickness(Math.Clamp(hx - 4, 0, Math.Max(0, W - 8)), 0, 0, 0); if (bipolar) { double c = W * 0.5, a = Math.Min(c, hx), b = Math.Max(c, hx); fill.Margin = new Thickness(a, 0, 0, 0); fill.Width = Math.Max(0, b - a); } else fill.Width = hx; val.Text = fmt(v); }- void SetX(double x) { SetP(p, (float)Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1)); Upd(); }- slot.PointerPressed += (_, e) => { drag = true; e.Pointer.Capture(slot); Begin(p); SetX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); End(p); } };- MidiLearn.Bind(slot, MidiTarget.DeviceParam(track, di, p), label);- readouts.Add(() => { if (!drag) Upd(); });- var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center };- if (labW > 0) g.Children.Add(Cap(label, teal ? TealC : MutedC, labW));- Grid.SetColumn(slot, 1); g.Children.Add(slot); Grid.SetColumn(val, 2); g.Children.Add(val);- return g;+ var row = DeviceCardKit.SliderRow(labW > 0 ? label : "", () => P(p), n => { SetP(p, (float)n); }, () => fmt(P(p)), out var sync,+ begin: () => Begin(p), end: () => End(p), bipolar: bipolar, labelWidth: labW, valueWidth: valW);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), label);+ readouts.Add(sync);+ return row;}// Segmented pill (n options over a normalized param). teal optional.Control Seg(int p, string[] opts, bool teal = false, Action? after = null){- int n = opts.Length; var cells = new Border[n]; var texts = new TextBlock[n];- var accent = teal ? TealC : Amber; var lit = teal ? TealBright : AmberLit; var sub = teal ? TealSubtle : AmberSubtle;- void Sync() { int cur = Math.Clamp((int)Math.Round(P(p) * (n - 1)), 0, n - 1); for (int i = 0; i < n; i++) { bool on = i == cur; cells[i].Background = on ? sub : Brushes.Transparent; cells[i].BorderBrush = on ? accent : Brushes.Transparent; texts[i].Foreground = on ? lit : MutedC; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++) { int iv = i; var tb = new TextBlock { Text = opts[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = MutedC }; var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(6, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = tb }; c.PointerPressed += (_, e) => { e.Handled = true; SetP(p, n > 1 ? iv / (float)(n - 1) : 0f); Sync(); after?.Invoke(); }; cells[i] = c; texts[i] = tb; row.Children.Add(c); }- readouts.Add(Sync);- var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ int n = opts.Length;+ var seg = DeviceCardKit.Segments(opts, () => Math.Clamp((int)Math.Round(P(p) * (n - 1)), 0, n - 1), iv => { SetP(p, n > 1 ? iv / (float)(n - 1) : 0f); after?.Invoke(); }, out var sync);+ readouts.Add(sync);MidiLearn.Bind(seg, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));return seg;}@@ -113,13 +96,8 @@ internal sealed class AutoGainDeviceBody : IDeviceBody// Teal toggle switch backed by a 0/1 param.Control Toggle(int p, string label){- var knob = new Border { Width = 6, Height = 6, CornerRadius = new CornerRadius(3), Background = HdrBg, VerticalAlignment = VerticalAlignment.Center };- var sw = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), Cursor = new Cursor(StandardCursorType.Hand), Padding = new Thickness(1.5, 0), Child = knob };- var tb = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = TealC, VerticalAlignment = VerticalAlignment.Center };- void Sync() { bool on = P(p) >= 0.5f; sw.Background = on ? TealC : Dim; knob.HorizontalAlignment = on ? HorizontalAlignment.Right : HorizontalAlignment.Left; }- sw.PointerPressed += (_, e) => { e.Handled = true; SetP(p, P(p) >= 0.5f ? 0f : 1f); Sync(); };- readouts.Add(Sync);- var host = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { sw, tb } };+ var host = Switch(label, () => P(p) >= 0.5f, () => SetP(p, P(p) >= 0.5f ? 0f : 1f), out var sync);+ readouts.Add(sync);MidiLearn.Bind(host, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));return host;}@@ -127,7 +105,7 @@ internal sealed class AutoGainDeviceBody : IDeviceBody// ---- reference (sidechain) source combo ----var scIds = new List<int> { -1 };var scCombo = new ComboBox { FontSize = 9, Height = 20, Width = 104, Padding = new Thickness(6, 0), VerticalAlignment = VerticalAlignment.Center };- scCombo.Items.Add("Target ▸ fixed");+ scCombo.Items.Add("Target → fixed");for (int i = 0; i < engine.TrackCount; i++){if (!engine.TryGetTrackInfo(i, out var ti) || ti.Id == track) continue;@@ -139,11 +117,11 @@ internal sealed class AutoGainDeviceBody : IDeviceBody// ---- LIVE strip ----var targetGroup = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Width = 210, Children = {Cap("TARGET", MutedC, 40), new Border { Child = HRow(Target, "", TargetF, 0, 66), Width = 150 } } };- scCombo.SelectionChanged += (_, _) => { int sel = scCombo.SelectedIndex; if (sel < 0 || sel >= scIds.Count) return; engine.SetDeviceSidechainSource(track, di, scIds[sel]); targetGroup.Opacity = scIds[sel] >= 0 ? 0.4 : 1.0; };- targetGroup.Opacity = engine.DeviceSidechainSource(track, di) >= 0 ? 0.4 : 1.0;+ scCombo.SelectionChanged += (_, _) => { int sel = scCombo.SelectedIndex; if (sel < 0 || sel >= scIds.Count) return; engine.SetDeviceSidechainSource(track, di, scIds[sel]); Inactive.Set(targetGroup, scIds[sel] >= 0, interactive: true); };+ Inactive.Set(targetGroup, engine.DeviceSidechainSource(track, di) >= 0, interactive: true);- var match = new Border { Background = Amber, CornerRadius = new CornerRadius(4), Padding = new Thickness(12, 3), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,- Child = new TextBlock { Text = "MATCH", FontSize = 10, FontWeight = FontWeight.SemiBold, Foreground = NotaPalette.TextOnAccent } };+ var match = new Border { Background = Amber, CornerRadius = NotaRadius.Control, Padding = new Thickness(12, 3), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,+ Child = new TextBlock { Text = "MATCH", FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = NotaPalette.TextOnAccent } };match.PointerPressed += (_, e) => { e.Handled = true; SetP(Auto, 0f); foreach (var a in readouts) a(); }; // freeze the current correctionvar live = new Border { Height = 34, Background = HdrBg, BorderBrush = Border2, BorderThickness = new Thickness(0, 0, 0, 1),@@ -159,10 +137,10 @@ internal sealed class AutoGainDeviceBody : IDeviceBodyvar applied = new TextBlock { Text = "0.0", FontSize = 22, FontWeight = FontWeight.SemiBold, Foreground = TealBright, LineHeight = 22 };applied.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");// vertical boost/cut indicator (0 dB at centre)- var bar = new Border { Width = 8, Background = Inset, CornerRadius = new CornerRadius(4), VerticalAlignment = VerticalAlignment.Stretch };+ var bar = new Border { Width = 8, Background = Inset, CornerRadius = NotaRadius.Control, VerticalAlignment = VerticalAlignment.Stretch };var barCenter = new Border { Height = 1, Background = Dim, VerticalAlignment = VerticalAlignment.Center };- var barFill = new Border { Width = 8, Background = TealC, CornerRadius = new CornerRadius(4), VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center, Height = 0 };- var barMarker = new Border { Width = 16, Height = 3, Background = TealBright, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Top };+ var barFill = new Border { Width = 8, Background = TealC, CornerRadius = NotaRadius.Control, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center, Height = 0 };+ var barMarker = new Border { Width = 16, Height = 3, Background = TealBright, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Top };var barSlot = new Panel { Width = 30, Children = { new Border { Width = 8, HorizontalAlignment = HorizontalAlignment.Center, Child = bar }, barCenter, barFill, barMarker } };var correction = new DockPanel { LastChildFill = true, Margin = new Thickness(9, 7) };@@ -176,7 +154,7 @@ internal sealed class AutoGainDeviceBody : IDeviceBodyapplied, new TextBlock { Text = "dB applied", FontSize = 9, Foreground = MutedC }.WithMono(),new Border { Height = 8 },new TextBlock { Text = "boost +12", FontSize = 8, Foreground = NotaPalette.TextDisabled }.WithMono(),- new TextBlock { Text = "0 dB", FontSize = 8, Foreground = NotaPalette.TextDisabled }.WithMono(),+ new TextBlock { Text = "0\u2009dB", FontSize = 8, Foreground = NotaPalette.TextDisabled }.WithMono(),new TextBlock { Text = "cut −12", FontSize = 8, Foreground = NotaPalette.TextDisabled }.WithMono() } };correction.Children.Add(new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), ColumnSpacing = 9, Children = { barSlot, WithCol(numCol, 1) } });var corrPanel = new Border { Width = 206, Child = correction };@@ -191,9 +169,9 @@ internal sealed class AutoGainDeviceBody : IDeviceBodyControl Meter(string label, out Action<float, string> set, IBrush baseCol, bool centered = false){var val = new TextBlock { FontSize = 9, Foreground = LabelC, Width = 40, TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Center }.WithMono();- var fill = new Border { Background = baseCol, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Stretch };+ var fill = new Border { Background = baseCol, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Stretch };var center = centered ? new Border { Width = 1, Background = Dim, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Stretch } : null;- var trk = new Panel { Height = 5, Children = { } }; trk.Children.Add(new Border { Background = Inset, CornerRadius = new CornerRadius(2) }); if (center != null) trk.Children.Add(center); trk.Children.Add(fill);+ var trk = new Panel { Height = 5, Children = { } }; trk.Children.Add(new Border { Background = Inset, CornerRadius = NotaRadius.Clip }); if (center != null) trk.Children.Add(center); trk.Children.Add(fill);set = (frac, text) => { double W = trk.Bounds.Width; if (centered) { double c = W * 0.5; double x = frac * c; fill.HorizontalAlignment = HorizontalAlignment.Left; fill.Margin = new Thickness(x >= 0 ? c : c + x, 0, 0, 0); fill.Width = Math.Abs(x); } else fill.Width = Math.Clamp(frac, 0, 1) * W; val.Text = text; };var g = new Grid { ColumnDefinitions = new ColumnDefinitions("22,*,Auto"), ColumnSpacing = 5, Height = 6, VerticalAlignment = VerticalAlignment.Center };g.Children.Add(Cap(label)); Grid.SetColumn(trk, 1); g.Children.Add(trk); Grid.SetColumn(val, 2); g.Children.Add(val);@@ -227,7 +205,7 @@ internal sealed class AutoGainDeviceBody : IDeviceBodyint n = engine.DeviceScope(track, di, scope, kScope);if (n < kScope) return;float ap = scope[S_Applied];- applied.Text = $"{ap:+0.0;-0.0;0.0}";+ applied.Text = $"{ap:+0.0;−0.0;0.0}";bool boost = ap >= 0;applied.Foreground = boost ? TealBright : AmberLit;// indicator: marker + fill from centre@@ -240,8 +218,8 @@ internal sealed class AutoGainDeviceBody : IDeviceBodysetIn(MeterFrac(scope[S_InLufs]), $"{scope[S_InLufs]:0.0}");setOut(MeterFrac(scope[S_OutLufs]), $"{scope[S_OutLufs]:0.0}");setTp(MeterFrac(scope[S_TruePeak]), $"{scope[S_TruePeak]:0.0}");- setCor(scope[S_Corr], $"{scope[S_Corr]:+0.00;-0.00;0.00}");- stats.Text = $"IN {scope[S_InLufs]:0.0} · OUT {scope[S_OutLufs]:0.0} · Δ {scope[S_OutLufs] - scope[S_InLufs]:+0.0;-0.0;0.0} LUFS · TP {scope[S_TruePeak]:0.0} dB";+ setCor(scope[S_Corr], $"{scope[S_Corr]:+0.00;−0.00;0.00}");+ stats.Text = $"IN {scope[S_InLufs]:0.0} · OUT {scope[S_OutLufs]:0.0} · Δ {scope[S_OutLufs] - scope[S_InLufs]:+0.0;−0.0;0.0}\u2009LUFS · TP {scope[S_TruePeak]:0.0}\u2009dB";});void RefreshAll() { foreach (var a in readouts) a(); }diff --git a/src/managed/Nota.App/DeviceCards/Bodies/AutoPanDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/AutoPanDeviceBody.csindex 540f8dff..ed1181d5 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/AutoPanDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/AutoPanDeviceBody.cs@@ -24,8 +24,9 @@ internal sealed class AutoPanDeviceBody : IDeviceBodyprivate const int Rate = 0, Amount = 1, Waveform = 2, Shape = 3, Phase = 4, Mix = 5;private static readonly string[] Waves = { "Sine", "Tri", "Saw", "Sqr", "S&H" };- public double Width => 560;- public bool AutoWidth => true; // fixed-width islands → card sizes to content+ public double Width => 700; // the almanac device format: 700 × 260; the viz column takes the slack++ public string? Subtitle => "PANNER"; // the processing type, shown as the header badgepublic Control Build(DeviceCardContext ctx, int index){@@ -37,7 +38,7 @@ internal sealed class AutoPanDeviceBody : IDeviceBodyvoid End(int p) => engine.EndAutomationWrite(track, AutomationTarget.DeviceParam, di, p, "");static double Exp(double v, double lo, double hi) => lo * Math.Pow(hi / lo, Math.Clamp(v, 0, 1));- var viz = new AutoPanViz { VerticalAlignment = VerticalAlignment.Stretch, Width = 220 };+ var viz = new AutoPanViz { VerticalAlignment = VerticalAlignment.Stretch, MinWidth = 200 };void SyncViz(){int wv = Math.Clamp((int)Math.Round(P(Waveform) * 4), 0, 4);@@ -46,8 +47,8 @@ internal sealed class AutoPanDeviceBody : IDeviceBodyctx.AddDeviceRefresher(SyncViz); // 60 Hz: also advances the live pan dot// ---- formatters ----- static string PctF(double v) => $"{v * 100:0}%";- string RateF(double v) => $"{Exp(v, 0.01, 40):0.00} Hz";+ static string PctF(double v) => $"{v * 100:0}\u2009%";+ string RateF(double v) => $"{Exp(v, 0.01, 40):0.00}\u2009Hz";static string DegF(double v) => $"{v * 360:0}°";// ---- gauge-knob cell ----@@ -72,7 +73,7 @@ internal sealed class AutoPanDeviceBody : IDeviceBodyBorder Panel(Control body) => new(){Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(7), Padding = new Thickness(9, 8), Child = body,+ CornerRadius = NotaRadius.Panel, Padding = new Thickness(9, 8), Child = body,};static TextBlock Head(string t) => new() { Text = t, FontSize = 9, FontWeight = FontWeight.Bold, Foreground = TextTertiary, Margin = new Thickness(0, 0, 0, 7) };@@ -85,7 +86,7 @@ internal sealed class AutoPanDeviceBody : IDeviceBodyint vi = i;var chip = new Border{- Background = Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4),+ Background = Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control,Padding = new Thickness(7, 2), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = Waves[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = TextSecondary },};@@ -122,7 +123,7 @@ internal sealed class AutoPanDeviceBody : IDeviceBodySyncViz();- var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,Auto"), ColumnSpacing = 6, HorizontalAlignment = HorizontalAlignment.Left };+ var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,*"), ColumnSpacing = 6 };grid.Children.Add(lfoPanel);Grid.SetColumn(motionPanel, 1); grid.Children.Add(motionPanel);Grid.SetColumn(vizPanel, 2); grid.Children.Add(vizPanel);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/AutoShiftDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/AutoShiftDeviceBody.csindex 2b06e24c..e498260f 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/AutoShiftDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/AutoShiftDeviceBody.cs@@ -40,11 +40,13 @@ internal sealed class AutoShiftDeviceBody : IDeviceBodyprivate static readonly IBrush Txt = NotaPalette.TextPrimary;private static readonly IBrush MutedB = NotaPalette.TextTertiary;private static readonly IBrush Sub = NotaPalette.TextSecondary;- private static readonly IBrush Red = NotaPalette.Danger;+ private static readonly IBrush Red = NotaPalette.Accent; // a state, not an alert: red is kept for recording and overloadprivate static readonly IBrush Hue = NotaPalette.BorderStrong;private static readonly IBrush Ink = NotaPalette.TextOnAccent;public double Width => 700;++ public string? Subtitle => "PITCH"; // the processing type, shown as the header badgepublic bool FullBleed => true;public Control Build(DeviceCardContext ctx, int index)@@ -84,9 +86,9 @@ internal sealed class AutoShiftDeviceBody : IDeviceBody// bipolar cents meter (fixed 96×8)var mCenter = new Border { Width = 1, Background = Hue, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Stretch };- var mBand = new Border { Background = NotaPalette.Wash(NotaPalette.Danger, 0x59), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Stretch };- var mMark = new Border { Width = 2, Background = Red, CornerRadius = new CornerRadius(1), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Stretch, Margin = new Thickness(0, 1) };- var centsMeter = new Panel { Width = 96, Height = 8, Children = { new Border { Background = Inset, CornerRadius = new CornerRadius(4) }, mCenter, mBand, mMark } };+ var mBand = new Border { Background = NotaPalette.Wash(NotaPalette.Accent, 0x59), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Stretch };+ var mMark = new Border { Width = 2, Background = Red, CornerRadius = NotaRadius.Bar, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Stretch, Margin = new Thickness(0, 1) };+ var centsMeter = new Panel { Width = 96, Height = 8, Children = { new Border { Background = Inset, CornerRadius = NotaRadius.Control }, mCenter, mBand, mMark } };void SetMeter(double cents){cents = Math.Clamp(cents, -50, 50);@@ -132,7 +134,7 @@ internal sealed class AutoShiftDeviceBody : IDeviceBodyint snapped = SnapMidi(dm, KeyOf(), Masks[ScaleOf()]);double cents = (dm - snapped) * 100.0;noteBig.Text = NoteName(snapped); noteBig.Foreground = AmberLit;- centsTb.Text = $"{cents:+0;-0;0} ¢";+ centsTb.Text = $"{cents:+0;−0;0}\u2009¢";corrTb.Text = $"→ corrected to {NoteName(snapped)}";SetMeter(cents);}@@ -145,60 +147,31 @@ internal sealed class AutoShiftDeviceBody : IDeviceBody// ---- horizontal slider (label · track · value) ----Control Slider(string label, int p, Func<double, string> fmt, IBrush fill, bool bipolar = false){- var lbl = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedB, Width = 46, VerticalAlignment = VerticalAlignment.Center };- var val = Mono(fmt(P(p)), Txt); val.Width = 34; val.TextAlignment = TextAlignment.Right;- var fillBar = new Border { Height = 3, Background = fill, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 8, Height = 9, Background = Sub, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent };- slot.Children.Add(new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center });- if (bipolar) slot.Children.Add(new Border { Width = 1, Background = Hue, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Stretch, Margin = new Thickness(0, 1) });- slot.Children.Add(fillBar); slot.Children.Add(handle);- void Vis(double v) { double W = slot.Bounds.Width; fillBar.Width = v * W; handle.Margin = new Thickness(Math.Clamp(v * W - 4, 0, Math.Max(0, W - 8)), 0, 0, 0); }- bool drag = false;- void SetX(double x) { double v = Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1); SetP(p, (float)v); Vis(v); val.Text = fmt(v); }- slot.PointerPressed += (_, e) => { drag = true; Begin(p); e.Pointer.Capture(slot); SetX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); End(p); } };- MidiLearn.Bind(slot, MidiTarget.DeviceParam(track, di, p), label);- ctx.AddDeviceRefresher(() => { if (!drag) { double v = P(p); Vis(v); val.Text = fmt(v); } });- var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center };- Grid.SetColumn(slot, 1); Grid.SetColumn(val, 2);- g.Children.Add(lbl); g.Children.Add(slot); g.Children.Add(val);- return g;+ var row = DeviceCardKit.SliderRow(label, () => P(p), n => SetP(p, (float)n), () => fmt(P(p)), out var sync,+ begin: () => Begin(p), end: () => End(p), bipolar: bipolar, labelWidth: 46, valueWidth: 34);+ ctx.AddDeviceRefresher(sync);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), label);+ return row;}// ---- segmented / toggle helpers ----Control Seg(string[] names, IBrush?[] accents, Func<int> get, Action<int> set){- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- var cells = new Border[names.Length]; var texts = new TextBlock[names.Length];- void Sync() { int cur = get(); for (int i = 0; i < names.Length; i++) { bool on = i == cur; IBrush ac = accents[i] ?? Amber; cells[i].Background = on ? ac : Brushes.Transparent; texts[i].Foreground = on ? (ac == TealB ? Ink : Ink) : (accents[i] ?? MutedB); texts[i].FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal; } }- for (int i = 0; i < names.Length; i++)- {- int iv = i;- var t = new TextBlock { Text = names[i], FontSize = 9, Foreground = MutedB, HorizontalAlignment = HorizontalAlignment.Center, Padding = new Thickness(6, 1) };- var c = new Border { CornerRadius = new CornerRadius(2), Cursor = new Cursor(StandardCursorType.Hand), Child = t };- c.PointerPressed += (_, e) => { e.Handled = true; set(iv); Sync(); };- cells[i] = c; texts[i] = t; row.Children.Add(c);- }- Sync(); ctx.AddDeviceRefresher(Sync);- return new Border { Background = Inset, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ // Role chromas stay inside the graphs; a chosen segment is brass.+ var seg = DeviceCardKit.Segments(names, get, set, out var sync);+ ctx.AddDeviceRefresher(sync);+ return seg;}Control PillToggle(string label, int p, IBrush accent){- var knob = new Border { Width = 6, Height = 6, CornerRadius = new CornerRadius(3), Background = NotaPalette.BgApp, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(1.5, 0) };- var pill = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), Background = CardBg, BorderBrush = Hue, BorderThickness = new Thickness(1), Child = knob };- var lbl = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedB, VerticalAlignment = VerticalAlignment.Center };- void Sync() { bool on = P(p) >= 0.5f; pill.Background = on ? accent : CardBg; pill.BorderBrush = on ? Brushes.Transparent : Hue; knob.Background = on ? Ink : MutedB; knob.HorizontalAlignment = on ? HorizontalAlignment.Right : HorizontalAlignment.Left; lbl.Foreground = on ? accent : MutedB; }- var b = new Border { Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent, Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { pill, lbl } } };- b.PointerPressed += (_, e) => { e.Handled = true; SetP(p, P(p) >= 0.5f ? 0f : 1f); Sync(); };- Sync(); ctx.AddDeviceRefresher(Sync);+ var b = Switch(label, () => P(p) >= 0.5f, () => SetP(p, P(p) >= 0.5f ? 0f : 1f), out var sync);+ ctx.AddDeviceRefresher(sync);MidiLearn.Bind(b, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));return b;}Control RailBtn(string label, Action onClick){- var b = new Border { BorderBrush = Hue, BorderThickness = new Thickness(1), Background = CardBg, CornerRadius = new CornerRadius(3), Padding = new Thickness(0, 2), Cursor = new Cursor(StandardCursorType.Hand),+ var b = new Border { BorderBrush = Hue, BorderThickness = new Thickness(1), Background = CardBg, CornerRadius = NotaRadius.Badge, Padding = new Thickness(0, 2), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = label, FontSize = 9, Foreground = Sub, HorizontalAlignment = HorizontalAlignment.Center } };b.PointerPressed += (_, e) => { e.Handled = true; onClick(); };return b;@@ -216,7 +189,7 @@ internal sealed class AutoShiftDeviceBody : IDeviceBody{int iv = i;var t = Mono(Keys[i], Sub); t.HorizontalAlignment = HorizontalAlignment.Center;- var c = new Border { Height = 17, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Cursor = new Cursor(StandardCursorType.Hand), Child = t };+ var c = new Border { Height = 17, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Cursor = new Cursor(StandardCursorType.Hand), Child = t };c.PointerPressed += (_, e) => { e.Handled = true; SetP(Key, iv / 11f); if (P(Follow) < 0.5f && Math.Round(P(KeySrc) * 2) == 0) SetP(KeySrc, 0.5f); Sync(); };cells[i] = c; texts[i] = t; Grid.SetColumn(c, i % 6); Grid.SetRow(c, i / 6); grid.Children.Add(c);}@@ -232,7 +205,7 @@ internal sealed class AutoShiftDeviceBody : IDeviceBody{int iv = i;var t = new TextBlock { Text = Scales[i], FontSize = 9, Foreground = Sub, VerticalAlignment = VerticalAlignment.Center };- var c = new Border { Height = 16, CornerRadius = new CornerRadius(3), Padding = new Thickness(7, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = t };+ var c = new Border { Height = 16, CornerRadius = NotaRadius.Badge, Padding = new Thickness(7, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = t };c.PointerPressed += (_, e) => { e.Handled = true; SetP(Scale, iv / (float)(Scales.Length - 1)); Sync(); };cells[i] = c; texts[i] = t; col.Children.Add(c);}@@ -256,7 +229,7 @@ internal sealed class AutoShiftDeviceBody : IDeviceBodyvar keyScalePanel = new Border { Width = 176, Background = Rail, BorderBrush = Bd, BorderThickness = new Thickness(0, 0, 1, 0), Padding = new Thickness(8, 6), Child = keyScaleInner };// ============ CORRECT / SHIFT rail (182) ============- string Pct(double v) => $"{v * 100:0}%";+ string Pct(double v) => $"{v * 100:0}\u2009%";var learnBypass = new Grid { ColumnDefinitions = new ColumnDefinitions("*,*"), ColumnSpacing = 4, [DockPanel.DockProperty] = Dock.Bottom, Children = {RailBtn("Learn key", () => { int ak = AutoKey(Masks[ScaleOf()]); if (ak >= 0) { SetP(Key, ak / 11f); SetP(KeySrc, 0.5f); } }),} };@@ -265,11 +238,11 @@ internal sealed class AutoShiftDeviceBody : IDeviceBodyvar railTop = new StackPanel { Spacing = 4, Children = {Cap("CORRECT", TealB),Slider("Amount", Amount, Pct, TealB),- Slider("Speed", Speed, v => $"{Exp(v, 1, 250):0} ms", TealB),- Slider("Range", Range, v => $"±{1 + v * 11:0} st", TealB),+ Slider("Speed", Speed, v => $"{Exp(v, 1, 250):0}\u2009ms", TealB),+ Slider("Range", Range, v => $"±{1 + v * 11:0}\u2009st", TealB),new Border { Height = 1, Background = CardBg, Margin = new Thickness(0, 2) },Cap("SHIFT"),- Slider("Shift", Shift, v => $"{(v - 0.5) * 24:+0;-0;0} st", Amber, bipolar: true),+ Slider("Shift", Shift, v => $"{(v - 0.5) * 24:+0;−0;0}\u2009st", Amber, bipolar: true),Slider("Formant", Formant, Pct, Amber),Slider("Mix", Mix, Pct, Amber),} };diff --git a/src/managed/Nota.App/DeviceCards/Bodies/BeatRepeatDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/BeatRepeatDeviceBody.csindex 29e9f1a1..0309bbc7 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/BeatRepeatDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/BeatRepeatDeviceBody.cs@@ -45,6 +45,8 @@ internal sealed class BeatRepeatDeviceBody : IDeviceBodyprivate static readonly IBrush Ink = NotaPalette.TextOnAccent;public double Width => 700;++ public string? Subtitle => "REPEATER"; // the processing type, shown as the header badgepublic bool FullBleed => true;public Control Build(DeviceCardContext ctx, int index)@@ -74,78 +76,39 @@ internal sealed class BeatRepeatDeviceBody : IDeviceBody// ---- horizontal slider (label · track · value) ----Control Slider(string label, int p, Func<double, string> fmt, IBrush fill, double labelW = 46, bool bipolar = false){- var lbl = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedB, Width = labelW, VerticalAlignment = VerticalAlignment.Center };- var val = Mono(fmt(P(p)), Txt); val.Width = 38; val.TextAlignment = TextAlignment.Right;- var fillBar = new Border { Height = 3, Background = fill, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 8, Height = 9, Background = Sub, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent };- slot.Children.Add(new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center });- if (bipolar) slot.Children.Add(new Border { Width = 1, Background = Hue, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Stretch, Margin = new Thickness(0, 1) });- slot.Children.Add(fillBar); slot.Children.Add(handle);- void Vis(double v) { double W = slot.Bounds.Width; fillBar.Width = v * W; handle.Margin = new Thickness(Math.Clamp(v * W - 4, 0, Math.Max(0, W - 8)), 0, 0, 0); }- bool drag = false;- void SetX(double x) { double v = Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1); SetP(p, (float)v); Vis(v); val.Text = fmt(v); SyncViz(); }- slot.PointerPressed += (_, e) => { drag = true; Begin(p); e.Pointer.Capture(slot); SetX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); End(p); } };- MidiLearn.Bind(slot, MidiTarget.DeviceParam(track, di, p), label);- ctx.AddDeviceRefresher(() => { if (!drag) { double v = P(p); Vis(v); val.Text = fmt(v); } });- var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center };- Grid.SetColumn(slot, 1); Grid.SetColumn(val, 2);- g.Children.Add(lbl); g.Children.Add(slot); g.Children.Add(val);- return g;+ var row = DeviceCardKit.SliderRow(label, () => P(p), n => { SetP(p, (float)n); SyncViz(); }, () => fmt(P(p)), out var sync,+ begin: () => Begin(p), end: () => End(p), bipolar: bipolar, labelWidth: labelW, valueWidth: 38);+ ctx.AddDeviceRefresher(sync);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), label);+ return row;}// Compact inline slider for the LIVE strip (fixed width, no flexible column).Control MiniSlider(string label, int p, Func<double, string> fmt, double w){- var val = Mono(fmt(P(p)), Txt); val.MinWidth = 24;- var fillBar = new Border { Height = 3, Background = Amber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 8, Height = 9, Background = Sub, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Width = w, Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent,- Children = { new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center }, fillBar, handle } };- void Vis(double v) { fillBar.Width = v * w; handle.Margin = new Thickness(Math.Clamp(v * w - 4, 0, Math.Max(0, w - 8)), 0, 0, 0); }- bool drag = false;- void SetX(double x) { double v = Math.Clamp(x / w, 0, 1); SetP(p, (float)v); Vis(v); val.Text = fmt(v); }- slot.PointerPressed += (_, e) => { drag = true; Begin(p); e.Pointer.Capture(slot); SetX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); End(p); } };- MidiLearn.Bind(slot, MidiTarget.DeviceParam(track, di, p), label);- ctx.AddDeviceRefresher(() => { if (!drag) { double v = P(p); Vis(v); val.Text = fmt(v); } });- return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap(label), slot, val } };+ var row = DeviceCardKit.SliderRow(label, () => P(p), n => SetP(p, (float)n), () => fmt(P(p)), out var sync,+ begin: () => Begin(p), end: () => End(p), trackWidth: w, valueWidth: 28);+ ctx.AddDeviceRefresher(sync);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), label);+ return row;}// ---- segmented / toggles / buttons ----Control Seg(string[] names, Func<int> get, Action<int> set){- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- var cells = new Border[names.Length]; var texts = new TextBlock[names.Length];- void Sync() { int cur = get(); for (int i = 0; i < names.Length; i++) { bool on = i == cur; cells[i].Background = on ? Amber : Brushes.Transparent; texts[i].Foreground = on ? Ink : MutedB; texts[i].FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal; } }- for (int i = 0; i < names.Length; i++)- {- int iv = i;- var t = new TextBlock { Text = names[i], FontSize = 9, Foreground = MutedB, HorizontalAlignment = HorizontalAlignment.Center, Padding = new Thickness(7, 1) };- var c = new Border { CornerRadius = new CornerRadius(2), Cursor = new Cursor(StandardCursorType.Hand), Child = t };- c.PointerPressed += (_, e) => { e.Handled = true; set(iv); Sync(); };- cells[i] = c; texts[i] = t; row.Children.Add(c);- }- Sync(); ctx.AddDeviceRefresher(Sync);- return new Border { Background = Inset, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ var seg = DeviceCardKit.Segments(names, get, set, out var sync);+ ctx.AddDeviceRefresher(sync);+ return seg;}Control PillToggle(string label, int p, IBrush accent, out Action sync){- var knob = new Border { Width = 6, Height = 6, CornerRadius = new CornerRadius(3), Background = NotaPalette.BgApp, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(1.5, 0) };- var pill = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), Background = CardBg, BorderBrush = Hue, BorderThickness = new Thickness(1), Child = knob };- var lbl = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedB, VerticalAlignment = VerticalAlignment.Center };- void Sync() { bool on = P(p) >= 0.5f; pill.Background = on ? accent : CardBg; pill.BorderBrush = on ? Brushes.Transparent : Hue; knob.Background = on ? Ink : MutedB; knob.HorizontalAlignment = on ? HorizontalAlignment.Right : HorizontalAlignment.Left; lbl.Foreground = on ? accent : MutedB; }- var b = new Border { Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent, Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { pill, lbl } } };- b.PointerPressed += (_, e) => { e.Handled = true; SetP(p, P(p) >= 0.5f ? 0f : 1f); Sync(); };- sync = Sync; Sync(); ctx.AddDeviceRefresher(Sync);+ var b = DeviceCardKit.Switch(label, () => P(p) >= 0.5f, () => SetP(p, P(p) >= 0.5f ? 0f : 1f), out sync);+ ctx.AddDeviceRefresher(sync);MidiLearn.Bind(b, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));return b;}Control TagBtn(string label, IBrush border, IBrush bg, IBrush fg, Action<bool> onPress){- var b = new Border { BorderBrush = border, BorderThickness = new Thickness(1), Background = bg, CornerRadius = new CornerRadius(4), Padding = new Thickness(9, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,+ var b = new Border { BorderBrush = border, BorderThickness = new Thickness(1), Background = bg, CornerRadius = NotaRadius.Control, Padding = new Thickness(9, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,Child = new TextBlock { Text = label, FontSize = 9, Foreground = fg } };b.PointerPressed += (_, e) => { e.Handled = true; onPress(true); };b.PointerReleased += (_, _) => onPress(false);@@ -166,7 +129,7 @@ internal sealed class BeatRepeatDeviceBody : IDeviceBody{int iv = i;var t = Mono(labels[i], Sub); t.HorizontalAlignment = HorizontalAlignment.Center;- var c = new Border { Height = 18, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Cursor = new Cursor(StandardCursorType.Hand), Child = t };+ var c = new Border { Height = 18, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Cursor = new Cursor(StandardCursorType.Hand), Child = t };c.PointerPressed += (_, e) => { e.Handled = true; SetP(p, iv / (float)(labels.Length - 1)); Sync(); SyncViz(); };cells[i] = c; texts[i] = t; Grid.SetColumn(c, i % 3); Grid.SetRow(c, i / 3); grid.Children.Add(c);}@@ -176,14 +139,14 @@ internal sealed class BeatRepeatDeviceBody : IDeviceBodystatic Control WithRight(Control c) { DockPanel.SetDock(c, Dock.Right); return c; }// ---- formatters ----- static string PctF(double v) => $"{v * 100:0}%";- static string StF(double v) => $"{(v - 0.5) * 24:+0;-0;0} st";- static string DbF(double v) => $"{(v - 0.5) * 24:+0.0;-0.0;0.0} dB";+ static string PctF(double v) => $"{v * 100:0}\u2009%";+ static string StF(double v) => $"{(v - 0.5) * 24:+0;−0;0}\u2009st";+ static string DbF(double v) => $"{(v - 0.5) * 24:+0.0;−0.0;0.0}\u2009dB";static string StepF(double v) => $"{(int)Math.Round(v * 16)}/16";- string HzF(double v) { double f = Exp(v, 50, 18000); return f >= 1000 ? $"{f / 1000:0.0}k" : $"{f:0} Hz"; }- static string OctF(double v) => $"{0.5 + v * 3:0.0} oct";- static string VarF(double v) => v <= 0.001 ? "off" : $"{v * 100:0}%";- string SliceF() { double spb = 60.0 / Math.Max(1e-3, engine.Bpm); return $"slice {Grids[Idx(GridP, 6)] * spb * 1000:0} ms"; }+ string HzF(double v) { double f = Exp(v, 50, 18000); return f >= 1000 ? $"{f / 1000:0.0}k" : $"{f:0}\u2009Hz"; }+ static string OctF(double v) => $"{0.5 + v * 3:0.0}\u2009oct";+ static string VarF(double v) => v <= 0.001 ? "off" : $"{v * 100:0}\u2009%";+ string SliceF() { double spb = 60.0 / Math.Max(1e-3, engine.Bpm); return $"slice {Grids[Idx(GridP, 6)] * spb * 1000:0}\u2009ms"; }// ============ LIVE strip ============var modeSeg = Seg(ModeLbl, () => Idx(Mode, 3), i => SetP(Mode, i / 2f));@@ -207,7 +170,7 @@ internal sealed class BeatRepeatDeviceBody : IDeviceBodyvar freqW = Slider("FREQ", FilterFreq, HzF, Amber, 40);var widthW = Slider("WIDTH", FilterWidth, OctF, Amber, 40);var filterBlock = new StackPanel { Spacing = 4, Children = { freqW, widthW } };- void FilterSync() { filterBlock.Opacity = P(FilterOn) >= 0.5f ? 1.0 : 0.4; filterBlock.IsHitTestVisible = P(FilterOn) >= 0.5f; }+ void FilterSync() => Inactive.Set(filterBlock, P(FilterOn) < 0.5f);var filterToggle = PillToggle("FILTER", FilterOn, Amber, out _);ctx.AddDeviceRefresher(FilterSync); FilterSync();var mix = Slider("MIX", MixP, PctF, Amber, 52);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/CeilingDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/CeilingDeviceBody.csindex afbebe72..1423091a 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/CeilingDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/CeilingDeviceBody.cs@@ -30,6 +30,8 @@ internal sealed class CeilingDeviceBody : IDeviceBody{ ("Clean", "transparent"), ("Punch", "lets transients through"), ("Glue", "slow, dense") };public double Width => 700;++ public string? Subtitle => "LIMITER"; // the processing type, shown as the header badgepublic bool FullBleed => true;public Control Build(DeviceCardContext ctx, int index)@@ -62,47 +64,34 @@ internal sealed class CeilingDeviceBody : IDeviceBodydouble lmn = log ? Math.Log(mn) : mn, lspan = (log ? Math.Log(mx) : mx) - lmn;double NormOf(double v) { double x = log ? Math.Log(Math.Clamp(v, mn, mx)) : Math.Clamp(v, mn, mx); return (x - lmn) / Math.Max(1e-9, lspan); }double ValOf(double n) { double x = lmn + Math.Clamp(n, 0, 1) * lspan; return log ? Math.Exp(x) : x; }- var trk = new Border { Width = tw, Height = 3, Background = Sunken, CornerRadius = new CornerRadius(2) };- var fill = new Border { Height = 3, Background = accent, CornerRadius = new CornerRadius(2) };- var handle = new Border { Width = 8, Height = 9, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2) };- var canvas = new Canvas { Width = tw, Height = 9, Background = Brushes.Transparent, VerticalAlignment = VerticalAlignment.Center };- Canvas.SetTop(trk, 3); Canvas.SetTop(fill, 3); Canvas.SetTop(handle, 0);- canvas.Children.Add(trk); canvas.Children.Add(fill); canvas.Children.Add(handle);- var val = new TextBlock { FontSize = 9, Foreground = TextPrimary, MinWidth = 40, VerticalAlignment = VerticalAlignment.Center };- val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- bool drag = false;- void Vis(double v) { double n = NormOf(v); fill.Width = Math.Max(0, n * tw); Canvas.SetLeft(handle, n * tw - 4); val.Text = fmt(v); }- void From(PointerEventArgs e) { double n = Math.Clamp(e.GetPosition(canvas).X / tw, 0, 1); float v = (float)ValOf(n); SetR(p, v); Vis(v); }- canvas.PointerPressed += (_, e) => { drag = true; engine.BeginAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""); e.Pointer.Capture(canvas); From(e); };- canvas.PointerMoved += (_, e) => { if (drag) From(e); };- canvas.PointerReleased += (_, e) => { if (drag) { drag = false; engine.EndAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""); e.Pointer.Capture(null); } };- MidiLearn.Bind(canvas, MidiTarget.DeviceParam(track, di, p), name);- readouts.Add(() => { if (!drag) Vis(P(p)); });- Vis(P(p));- var lbl = new TextBlock { Text = name, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = ReferenceEquals(accent, Teal) ? Teal : TextTertiary, VerticalAlignment = VerticalAlignment.Center };- if (lw > 0) lbl.Width = lw;- return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = { lbl, canvas, val } };+ var row = DeviceCardKit.SliderRow(name, () => NormOf(P(p)), n => { SetR(p, (float)ValOf(n)); }, () => fmt(P(p)), out var sync,+ begin: () => engine.BeginAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""),+ end: () => engine.EndAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""),+ labelWidth: lw, trackWidth: tw, valueWidth: 40);+ readouts.Add(sync);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), name);+ return row;}Control Toggle(int p, string label, IBrush tint){- var b = new Border { CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold } };- void Hi() { bool on = P(p) > 0.5f; b.Background = on ? AccentSubtleB : Sunken; b.BorderBrush = on ? tint : BorderDef; ((TextBlock)b.Child!).Foreground = on ? tint : TextTertiary; }+ var b = new Border { CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold } };+ void Hi() { bool on = P(p) > 0.5f; b.Background = on ? NotaPalette.AccentSubtle : Sunken; b.BorderBrush = on ? NotaPalette.BorderBrass : BorderDef; ((TextBlock)b.Child!).Foreground = on ? NotaPalette.AccentHover : TextTertiary; }b.PointerPressed += (_, _) => { SetR(p, P(p) > 0.5f ? 0f : 1f); Hi(); };MidiLearn.Bind(b, MidiTarget.DeviceParam(track, di, p), label);readouts.Add(Hi); Hi(); return b;}- string DbT(double v) => $"{v:0.0} dB";- string Db1(double v) => $"{v:+0.0;-0.0;0.0}";- string Ms(double v) => v < 10 ? $"{v:0.0} ms" : $"{v:0} ms";- string Pct(double v) => $"{v:0} %";- string MDb(double v) => v <= -119 ? "—" : $"{v:+0.0;-0.0;0.0}";+ string DbT(double v) => $"{v:0.0}\u2009dB";+ string Db1(double v) => $"{v:+0.0;−0.0;0.0}";+ string Ms(double v) => v < 10 ? $"{v:0.0}\u2009ms" : $"{v:0}\u2009ms";+ string Pct(double v) => $"{v:0}\u2009%";+ string MDb(double v) => v <= -119 ? "—" : $"{v:+0.0;−0.0;0.0}";// ---------- LIVE strip: GR readout + Ceiling/Gain/Release + auto-release ----------var grNum = new TextBlock { Text = "0.0", FontSize = 14, FontWeight = FontWeight.SemiBold, Foreground = Teal, VerticalAlignment = VerticalAlignment.Center };grNum.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- var grFill = new Border { Height = 8, Background = Teal, CornerRadius = new CornerRadius(4), HorizontalAlignment = HorizontalAlignment.Left };- var grBar = new Border { Width = 96, Height = 8, Background = Sunken, CornerRadius = new CornerRadius(4), ClipToBounds = true, VerticalAlignment = VerticalAlignment.Center, Child = grFill };+ var grFill = new Border { Height = 8, Background = Teal, CornerRadius = NotaRadius.Control, HorizontalAlignment = HorizontalAlignment.Left };+ var grBar = new Border { Width = 96, Height = 8, Background = Sunken, CornerRadius = NotaRadius.Control, ClipToBounds = true, VerticalAlignment = VerticalAlignment.Center, Child = grFill };var live = new Border { Height = 34, Background = NotaPalette.SurfaceCard, BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 0, 1),Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(9, 0), Children = {Lbl("GR", 8, TextTertiary), grNum, grBar,@@ -123,8 +112,8 @@ internal sealed class CeilingDeviceBody : IDeviceBodyvar sub = new TextBlock { Text = Chars[i].sub, FontSize = 8, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Right };var row = new DockPanel { LastChildFill = false, Children = { name } };DockPanel.SetDock(sub, Dock.Right); row.Children.Add(sub);- var b = new Border { Height = 16, CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(7, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = row };- void Hi() { bool on = Sel(Character, 3) == i; b.Background = on ? AccentSubtleB : Brushes.Transparent; b.BorderBrush = on ? Brass : BorderDef; name.Foreground = on ? AccentBright : TextSecondary; sub.Foreground = on ? TextSecondary : TextTertiary; }+ var b = new Border { Height = 16, CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), Padding = new Thickness(7, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = row };+ void Hi() { bool on = Sel(Character, 3) == i; b.Background = on ? Brass : Brushes.Transparent; b.BorderBrush = on ? Brass : BorderDef; name.Foreground = on ? NotaPalette.TextOnAccent : TextSecondary; sub.Foreground = on ? NotaPalette.TextOnAccent : TextTertiary; }b.PointerPressed += (_, _) => { SetR(Character, i); foreach (var a in charHi) a(); };charHi.Add(Hi); readouts.Add(Hi); Hi();MidiLearn.Bind(b, MidiTarget.DeviceParam(track, di, Character), engine.DeviceParamName(track, di, Character));@@ -161,7 +150,7 @@ internal sealed class CeilingDeviceBody : IDeviceBodyfor (int i = 0; i < engine.TrackCount; i++) { if (!engine.TryGetTrackInfo(i, out var ti) || ti.Id == track) continue; scIds.Add(ti.Id); scCombo.Items.Add($"SC: {i + 1} · {(ti.IsReturn ? "Ret" : ti.IsInstrument ? "Instr" : "Aud")}"); }scCombo.SelectedIndex = Math.Max(0, scIds.IndexOf(engine.DeviceSidechainSource(track, di)));scCombo.SelectionChanged += (_, _) => { int s = scCombo.SelectedIndex; if (s >= 0 && s < scIds.Count) { engine.SetDeviceSidechainSource(track, di, scIds[s]); ctx.NotifyChanged(); } };- var resetBtn = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), BorderBrush = BorderStrong, Background = Card2, Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,+ var resetBtn = new Border { CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), BorderBrush = BorderStrong, Background = Card2, Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,Child = new TextBlock { Text = "Reset peaks", FontSize = 9, Foreground = TextSecondary } };resetBtn.PointerPressed += (_, _) => { peakInHold = -120; peakOutHold = -120; maxGrHold = 0; truePeakHold = -120; };var bottomRow = new DockPanel { LastChildFill = false, Children = { scCombo } };diff --git a/src/managed/Nota.App/DeviceCards/Bodies/ChamberDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/ChamberDeviceBody.csindex 2d76db9d..d6ce077d 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/ChamberDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/ChamberDeviceBody.cs@@ -52,7 +52,7 @@ internal sealed class ChamberDeviceBody : IDeviceBody};private static readonly IBrush RailBg = NotaPalette.SurfaceInset;- private static readonly IBrush Panel = NotaPalette.BgApp;+ private static readonly IBrush Panel = NotaPalette.TextOnAccent; // dark ink over an engaged fillprivate static readonly IBrush Border2 = NotaPalette.BorderDefault;private static readonly IBrush BorderIn = NotaPalette.GraphBorder;private static readonly IBrush Inset = NotaPalette.BgSunken;@@ -100,12 +100,12 @@ internal sealed class ChamberDeviceBody : IDeviceBody// ---- formatters -------------------------------------------------------------static double Exp(double v, double lo, double hi) => lo * Math.Pow(hi / lo, Math.Clamp(v, 0, 1));- static string Secs(double s) => s >= 10 ? FormattableString.Invariant($"{s:0.0} s") : s >= 1 ? FormattableString.Invariant($"{s:0.00} s") : FormattableString.Invariant($"{s * 1000:0} ms");- static string Ms(double ms) => ms >= 100 ? FormattableString.Invariant($"{ms:0} ms") : ms >= 10 ? FormattableString.Invariant($"{ms:0.0} ms") : FormattableString.Invariant($"{ms:0.0} ms");- static string Hz(double hz) => hz >= 1000 ? FormattableString.Invariant($"{hz / 1000:0.0} kHz") : FormattableString.Invariant($"{hz:0} Hz");- static string Pct(double v) => FormattableString.Invariant($"{v * 100:0} %");- static string Db(double db) => db <= -99 ? "−∞" : FormattableString.Invariant($"{db:+0.0;−0.0;0.0} dB");- static string ShortDb(double db) => db <= -99 ? "−∞" : FormattableString.Invariant($"{db:0.0;−0.0;0.0}");+ static string Secs(double s) => s >= 10 ? NotaNum.F($"{s:0.0}\u2009s") : s >= 1 ? NotaNum.F($"{s:0.00}\u2009s") : NotaNum.F($"{s * 1000:0}\u2009ms");+ static string Ms(double ms) => ms >= 100 ? NotaNum.F($"{ms:0}\u2009ms") : ms >= 10 ? NotaNum.F($"{ms:0.0}\u2009ms") : NotaNum.F($"{ms:0.0}\u2009ms");+ static string Hz(double hz) => hz >= 1000 ? NotaNum.F($"{hz / 1000:0.0}\u2009k") : NotaNum.F($"{hz:0}\u2009Hz");+ static string Pct(double v) => NotaNum.F($"{v * 100:0}\u2009%");+ static string Db(double db) => db <= -99 ? "−∞" : NotaNum.F($"{db:+0.0;−0.0;0.0}\u2009dB");+ static string ShortDb(double db) => db <= -99 ? "−∞" : NotaNum.F($"{db:0.0;−0.0;0.0}");string Pre(int timeP, int syncP) => On(syncP) ? SyncNames[Sel(timeP, SyncNames.Length)] : Ms(500 * P(timeP) * P(timeP));double IrSecs() => Sc(S_IrSeconds);double RtMid() => Exp(P(AlgoDecay), 0.2, 20);@@ -120,10 +120,10 @@ internal sealed class ChamberDeviceBody : IDeviceBody}string LowCutF(double v) => v <= 0.001 ? "off" : Hz(Exp(v, 20, 2000));string HighCutF(double v) => v >= 0.999 ? "off" : Hz(Exp(v, 1000, 20000));- static string GainF(double v) { double db = (v - 0.5) * 36; return Math.Abs(db) < 0.05 ? "0 dB" : FormattableString.Invariant($"{db:+0.0;−0.0} dB"); }+ static string GainF(double v) { double db = (v - 0.5) * 36; return Math.Abs(db) < 0.05 ? "0\u2009dB" : NotaNum.F($"{db:+0.0;−0.0}\u2009dB"); }static double ShareDb(double share) => share <= 1e-4 ? -100 : 10 * Math.Log10(share); // equal-power blend gainstatic double DryDb(double v) { double g = 2 * v * v; return g <= 1e-5 ? -100 : 20 * Math.Log10(g); }- string Interval() => Sel(ShimmerPitch, 3) switch { 0 => "−12 st", 1 => "+7 st", _ => "+12 st" };+ string Interval() => Sel(ShimmerPitch, 3) switch { 0 => "−12\u2009st", 1 => "+7\u2009st", _ => "+12\u2009st" };// ---- small builders ---------------------------------------------------------static TextBlock Caps(string t, IBrush? c = null, double fs = 7) => new() { Text = t, FontSize = fs, FontWeight = FontWeight.Bold, Foreground = c ?? MutedC, LetterSpacing = 0.8, VerticalAlignment = VerticalAlignment.Center };@@ -135,7 +135,7 @@ internal sealed class ChamberDeviceBody : IDeviceBodystatic Control Col(Control c, int col) { Grid.SetColumn(c, col); return c; }static Control GRow(Control c, int row) { Grid.SetRow(c, row); return c; }static Border Divider(Control child, double top = 5) => new() { BorderBrush = BorderIn, BorderThickness = new Thickness(0, 1, 0, 0), Padding = new Thickness(0, top, 0, 0), Child = child };- static Border InsetBox(Control child) => new() { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), ClipToBounds = true, Child = child };+ static Border InsetBox(Control child) => new() { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, ClipToBounds = true, Child = child };// Gauge knob bound to a device param (automation gesture + MIDI learn + live follow).Control K(int p, string name, Func<double, string> fmt, double size = 34, double cellW = 48, IBrush? arc = null, Action? onChange = null)@@ -153,20 +153,8 @@ internal sealed class ChamberDeviceBody : IDeviceBody// On/off pill bound to a param (> 0.5 = on).Control Toggle(int p, string label, Func<bool>? dim = null){- var pill = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), VerticalAlignment = VerticalAlignment.Center };- var dot = new Border { Width = 7, Height = 7, CornerRadius = new CornerRadius(4) };- var host = new Canvas { Width = 18, Height = 10 }; Canvas.SetTop(dot, 1.5); host.Children.Add(dot); pill.Child = host;- var txt = new TextBlock { Text = label, FontSize = 8, VerticalAlignment = VerticalAlignment.Center };- void Hi()- {- bool on = On(p), d = dim?.Invoke() ?? false;- pill.Background = on ? (d ? NotaPalette.BorderStrong : Amber) : OffPill; dot.Background = on ? Panel : MutedC;- Canvas.SetLeft(dot, on ? 9.5 : 1.5); txt.Foreground = on && !d ? TxtC : Txt2;- }- var wrap = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Children = { pill } };- if (label.Length > 0) wrap.Children.Add(txt);- wrap.PointerPressed += (_, e) => { if (!e.GetCurrentPoint(wrap).Properties.IsLeftButtonPressed) return; SetP(p, On(p) ? 0f : 1f); Hi(); e.Handled = true; };- readouts.Add(Hi); Hi();+ var wrap = Switch(label, () => On(p), () => SetP(p, On(p) ? 0f : 1f), out var sync, dim);+ readouts.Add(sync);MidiLearn.Bind(wrap, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));return wrap;}@@ -174,28 +162,9 @@ internal sealed class ChamberDeviceBody : IDeviceBody// Segmented chips over a discrete param (n options spread over 0..1).Control Seg(int p, string[] names, double fs = 7, IBrush? accent = null){- int n = names.Length; var cells = new Border[n];- var acc = accent ?? Amber;- void Hi()- {- int cur = Sel(p, n);- for (int i = 0; i < n; i++)- {- bool on = i == cur;- cells[i].Background = on ? acc : Brushes.Transparent;- var tb = (TextBlock)cells[i].Child!; tb.Foreground = on ? Panel : MutedC; tb.FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal;- }- }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++)- {- int iv = i;- var c = new Border { CornerRadius = new CornerRadius(2), Padding = new Thickness(4, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, Foreground = MutedC } };- c.PointerPressed += (_, e) => { SetP(p, n > 1 ? iv / (float)(n - 1) : 0f); Hi(); e.Handled = true; };- cells[i] = c; row.Children.Add(c);- }- readouts.Add(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Left, Child = row };+ int n = names.Length;+ var seg = DeviceCardKit.Segments(names, () => Sel(p, n), iv => SetP(p, n > 1 ? iv / (float)(n - 1) : 0f), out var sync);+ readouts.Add(sync);MidiLearn.Bind(seg, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));return seg;}@@ -204,60 +173,44 @@ internal sealed class ChamberDeviceBody : IDeviceBody// (CONV / ALGO both drive Blend, from opposite ends).Control HBar(int p, Func<double> get, Action<double> set, Func<double, string> fmt, IBrush fillC, Func<bool>? dim = null, double valW = 26){- var fill = new Border { Height = 3, Background = fillC, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 6, Height = 7, Background = Txt2, CornerRadius = new CornerRadius(2) };- var lay = new Canvas { Height = 9 };- lay.Children.Add(handle); Canvas.SetTop(handle, 1);- var canvas = new Panel { Height = 11, MinWidth = 24, Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Children = {- new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center }, fill, lay } };- var val = Mono("", 8, TxtC); val.MinWidth = valW; val.TextAlignment = TextAlignment.Right;- bool drag = false;- void Vis()- {- double v = Math.Clamp(get(), 0, 1), w = canvas.Bounds.Width; if (w <= 0) w = 80;- fill.Width = Math.Max(0, v * w); Canvas.SetLeft(handle, v * w - 3); val.Text = fmt(v);- bool d = dim?.Invoke() ?? false;- fill.Background = d ? NotaPalette.BorderStrong : fillC; handle.Background = d ? MutedC : Txt2; val.Foreground = d ? Txt2 : TxtC;- }- void From(PointerEventArgs e) { double w = canvas.Bounds.Width; set(w > 0 ? Math.Clamp(e.GetPosition(canvas).X / w, 0, 1) : 0); Vis(); }- canvas.PointerPressed += (_, e) =>- {- if (!e.GetCurrentPoint(canvas).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { Begin(p); Raw(p, engine.DeviceParamDefault(track, di, p)); End(p); Vis(); e.Handled = true; return; }- drag = true; Begin(p); e.Pointer.Capture(canvas); From(e); e.Handled = true;- };- canvas.PointerMoved += (_, e) => { if (drag) From(e); };- canvas.PointerReleased += (_, e) => { if (drag) { drag = false; End(p); e.Pointer.Capture(null); } };- canvas.SizeChanged += (_, _) => Vis();- readouts.Add(() => { if (!drag) Vis(); });- var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center };- grid.Children.Add(canvas); grid.Children.Add(Col(val, 1));- MidiLearn.Bind(grid, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));- return grid;+ var row = DeviceCardKit.SliderRow("", () => Math.Clamp(get(), 0, 1), set, () => fmt(Math.Clamp(get(), 0, 1)), out var sync,+ begin: () => Begin(p), end: () => End(p),+ reset: () => { Begin(p); Raw(p, engine.DeviceParamDefault(track, di, p)); End(p); },+ dim: dim, valueWidth: valW);+ readouts.Add(sync);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));+ return row;}Control Bar(int p, Func<double, string> fmt, Func<bool>? dim = null, double valW = 26)=> HBar(p, () => P(p), v => Raw(p, (float)v), fmt, Amber, dim, valW);Control SliderRow(string label, int p, Func<double, string> fmt, double labW = 48, Func<bool>? dim = null, double valW = 26){- var g = new Grid { ColumnDefinitions = new ColumnDefinitions(FormattableString.Invariant($"{labW},*")), VerticalAlignment = VerticalAlignment.Center };+ var g = new Grid { ColumnDefinitions = new ColumnDefinitions(NotaNum.F($"{labW},*")), VerticalAlignment = VerticalAlignment.Center };g.Children.Add(Caps(label)); g.Children.Add(Col(Bar(p, fmt, dim, valW), 1));return g;}// A small text button.Border Btn(string text, Action click, string? tip = null){- var b = new Border { Height = 16, Padding = new Thickness(6, 0), CornerRadius = new CornerRadius(3), Background = OffPill, Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,+ var b = new Border { Height = 16, Padding = new Thickness(6, 0), CornerRadius = NotaRadius.Badge, Background = OffPill, Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,Child = new TextBlock { Text = text, FontSize = 8, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center } };b.PointerPressed += (_, e) => { if (!e.GetCurrentPoint(b).Properties.IsLeftButtonPressed) return; click(); e.Handled = true; };if (tip != null) ToolTip.SetTip(b, tip);return b;}+ // A small button carrying a drawn glyph instead of a typed character.+ Border GlyphBtn(GlyphKind kind, Action click, string tip)+ {+ var b = Btn("", click, tip);+ b.Child = new Glyph(kind, 8) { Foreground = TxtC };+ return b;+ }// A latching button over a toggle param (Freeze / Hold in).Border Latch(int p, string text, string tip){var tb = new TextBlock { Text = text, FontSize = 8, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center };- var b = new Border { Height = 16, CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand), Child = tb };- void Hi() { bool on = On(p); b.Background = on ? AmberSubtle : OffPill; b.BorderBrush = on ? Amber : Brushes.Transparent; tb.Foreground = on ? AmberLit : TxtC; tb.FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal; }+ var b = new Border { Height = 16, CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand), Child = tb };+ void Hi() { bool on = On(p); b.Background = on ? NotaPalette.AccentSubtle : OffPill; b.BorderBrush = on ? NotaPalette.BorderBrass : Brushes.Transparent; tb.Foreground = on ? NotaPalette.AccentHover : TxtC; tb.FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal; }b.PointerPressed += (_, e) => { if (!e.GetCurrentPoint(b).Properties.IsLeftButtonPressed) return; SetP(p, On(p) ? 0f : 1f); Hi(); e.Handled = true; };ToolTip.SetTip(b, tip);MidiLearn.Bind(b, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));@@ -327,15 +280,15 @@ internal sealed class ChamberDeviceBody : IDeviceBodyreadouts.Add(() =>{float b = P(Blend);- blendTxt.Text = FormattableString.Invariant($"{(1 - b) * 100:0} / {b * 100:0}");+ blendTxt.Text = NotaNum.F($"{(1 - b) * 100:0} / {b * 100:0}");bool wo = On(WetOnly);- wetTxt.Text = wo ? "SEND" : FormattableString.Invariant($"{P(DryWet) * 100:0} %");+ wetTxt.Text = wo ? "SEND" : NotaNum.F($"{P(DryWet) * 100:0}\u2009%");wetTxt.Foreground = wo || P(DryWet) > 0.995f ? AmberLit : TxtC;});var blendTitle = Caps("BLEND"); blendTitle.HorizontalAlignment = HorizontalAlignment.Center;var faders = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto"), ColumnSpacing = 9, HorizontalAlignment = HorizontalAlignment.Center, Margin = new Thickness(0, 4, 0, 3) };faders.Children.Add(Fader(Blend, true, "C/A")); faders.Children.Add(Col(Fader(DryWet, false, "WET"), 1));- var blendCol = new Border { Width = 56, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(0, 5, 0, 4),+ var blendCol = new Border { Width = 56, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Padding = new Thickness(0, 5, 0, 4),Child = new DockPanel { Children = { Docked(blendTitle, Dock.Top), Docked(wetTxt, Dock.Bottom), Docked(blendTxt, Dock.Bottom), faders } } };DockPanel.SetDock(blendCol, Dock.Left);@@ -347,8 +300,8 @@ internal sealed class ChamberDeviceBody : IDeviceBody// IR selector: ‹ [name · length · rate ▾] › + Load…var irName = new TextBlock { FontSize = 9, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis };var irInfo = Mono("", 7, MutedC);- var irBox = new Border { Height = 16, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(6, 0), Cursor = new Cursor(StandardCursorType.Hand),- Child = new DockPanel { Children = { Docked(new TextBlock { Text = "▾", FontSize = 8, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(6, 0, 0, 0) }, Dock.Right), Docked(irInfo, Dock.Right), irName } } };+ var irBox = new Border { Height = 16, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Padding = new Thickness(6, 0), Cursor = new Cursor(StandardCursorType.Hand),+ Child = new DockPanel { Children = { Docked(new Glyph(GlyphKind.ChevronDown, 8) { Foreground = MutedC, Margin = new Thickness(6, 0, 0, 0) }, Dock.Right), Docked(irInfo, Dock.Right), irName } } };ToolTip.SetTip(irBox, "Impulse response — built-in rooms, or your own file (drop it on the waveform)");MidiLearn.Bind(irBox, MidiTarget.DeviceParam(track, di, IrSelect), "IR");readouts.Add(() =>@@ -357,7 +310,7 @@ internal sealed class ChamberDeviceBody : IDeviceBodystring user = ir == IrCount - 1 ? engine.DeviceText(track, di, 2) : "";irName.Text = ir < irList.Count ? irList[ir].Name : user.Length > 0 ? user : "User IR — none loaded";double s = IrSecs(), sr = Sc(S_IrRate); int ch = (int)Sc(S_IrChannels);- irInfo.Text = s > 0 ? FormattableString.Invariant($"{s:0.0} s · {sr / 1000:0.#} kHz · {(ch >= 4 ? "4-ch" : ch == 2 ? "stereo" : "mono")} ") : "";+ irInfo.Text = s > 0 ? NotaNum.F($"{s:0.0}\u2009s · {sr / 1000:0.#}\u2009kHz · {(ch >= 4 ? "4-ch" : ch == 2 ? "stereo" : "mono")} ") : "";});void StepIr(int d) { int ir = Sel(IrSelect, IrCount); int max = engine.DeviceText(track, di, 2).Length > 0 ? IrCount - 1 : IrCount - 2; SetP(IrSelect, Math.Clamp(ir + d, 0, max) / (float)(IrCount - 1)); }irBox.PointerPressed += (_, e) =>@@ -375,14 +328,14 @@ internal sealed class ChamberDeviceBody : IDeviceBodylastCat = irList[i].Cat;}int iv = i;- var mi = new MenuItem { Header = FormattableString.Invariant($"{irList[i].Name} {irList[i].Len} s") };+ var mi = new MenuItem { Header = NotaNum.F($"{irList[i].Name} {irList[i].Len}\u2009s") };if (i == cur) mi.Icon = new Avalonia.Controls.Shapes.Ellipse { Width = 6, Height = 6, Fill = Amber };mi.Click += (_, _) => SetP(IrSelect, iv / (float)(IrCount - 1));fly.Items.Add(mi);}fly.Items.Add(new Separator());string userName = engine.DeviceText(track, di, 2);- var um = new MenuItem { Header = userName.Length > 0 ? FormattableString.Invariant($"User · {userName}") : "User IR (none loaded)", IsEnabled = userName.Length > 0 };+ var um = new MenuItem { Header = userName.Length > 0 ? NotaNum.F($"User · {userName}") : "User IR (none loaded)", IsEnabled = userName.Length > 0 };if (cur == IrCount - 1) um.Icon = new Avalonia.Controls.Shapes.Ellipse { Width = 6, Height = 6, Fill = Amber };um.Click += (_, _) => SetP(IrSelect, 1f);fly.Items.Add(um);@@ -394,9 +347,9 @@ internal sealed class ChamberDeviceBody : IDeviceBody};var irRow = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,*,Auto,Auto"), ColumnSpacing = 4, Height = 18 };irRow.Children.Add(Caps("IR"));- irRow.Children.Add(Col(Btn("‹", () => StepIr(-1), "Previous IR"), 1));+ irRow.Children.Add(Col(GlyphBtn(GlyphKind.ChevronLeft, () => StepIr(-1), "Previous IR"), 1));irRow.Children.Add(Col(irBox, 2));- irRow.Children.Add(Col(Btn("›", () => StepIr(1), "Next IR"), 3));+ irRow.Children.Add(Col(GlyphBtn(GlyphKind.ChevronRight, () => StepIr(1), "Next IR"), 3));irRow.Children.Add(Col(Btn("Load…", () => PickIr(irRow), "Load an impulse response (WAV / FLAC / MP3 — mono, stereo or 4-ch true stereo)"), 4));// IR view: trims drive IR Start / IR Decay.@@ -406,7 +359,7 @@ internal sealed class ChamberDeviceBody : IDeviceBodyToolTip.SetTip(irView, "Drag the brass lines to trim the IR (Start · Decay); double-click resets. Drop an audio file here to load it.");readouts.Add(() =>{- string sig = FormattableString.Invariant($"{Sel(IrSelect, IrCount)}|{Sc(S_IrSeconds):0.000}|{Sc(S_IrChannels)}|{Sc(S_UserIr)}");+ string sig = NotaNum.F($"{Sel(IrSelect, IrCount)}|{Sc(S_IrSeconds):0.000}|{Sc(S_IrChannels)}|{Sc(S_UserIr)}");if (sig != waveSig) { waveSig = sig; FetchWave(); }int ir = Sel(IrSelect, IrCount);bool noUser = ir == IrCount - 1 && Sc(S_UserIr) < 0.5;@@ -418,7 +371,7 @@ internal sealed class ChamberDeviceBody : IDeviceBodyvar knobs = new Grid { ColumnDefinitions = new ColumnDefinitions("*,*,*,*,Auto"), Height = 54 };knobs.Children.Add(K(ConvPredelay, "PREDELAY", _ => Pre(ConvPredelay, ConvSync)));- knobs.Children.Add(Col(K(IrSize, "SIZE", v => FormattableString.Invariant($"{Exp(v, 0.5, 2) * 100:0} %")), 1));+ knobs.Children.Add(Col(K(IrSize, "SIZE", v => NotaNum.F($"{Exp(v, 0.5, 2) * 100:0}\u2009%")), 1));knobs.Children.Add(Col(K(IrAttack, "ATTACK", v => Ms(500 * v * v)), 2));knobs.Children.Add(Col(K(IrDecay, "DECAY", v => IrSecs() > 0 ? Secs(v * IrSecs()) : Pct(v)), 3));var toggles = new StackPanel { Spacing = 3, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(6, 0, 0, 0), Children = {@@ -437,30 +390,11 @@ internal sealed class ChamberDeviceBody : IDeviceBodyControl AlgoTab(){// MODE chips + tail readout- var chips = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center };- var chipB = new Border[Modes.Length];- void HiModes()- {- int cur = Sel(AlgoMode, Modes.Length);- for (int i = 0; i < Modes.Length; i++)- {- bool on = i == cur;- chipB[i].BorderBrush = on ? Amber : NotaPalette.BorderStrong; chipB[i].Background = on ? AmberSubtle : Brushes.Transparent;- var t = (TextBlock)chipB[i].Child!; t.Foreground = on ? AmberLit : Txt2; t.FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal;- }- }- for (int i = 0; i < Modes.Length; i++)- {- int iv = i;- var c = new Border { Height = 18, Padding = new Thickness(8, 0), CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand),- Child = new TextBlock { Text = Modes[i], FontSize = 9, VerticalAlignment = VerticalAlignment.Center } };- c.PointerPressed += (_, e) => { SetP(AlgoMode, iv / 3f); HiModes(); e.Handled = true; };- chipB[i] = c; chips.Children.Add(c);- }+ var chips = DeviceCardKit.Segments(Modes, () => Sel(AlgoMode, Modes.Length), i => SetP(AlgoMode, i / 3f), out var hiModes);MidiLearn.Bind(chips, MidiTarget.DeviceParam(track, di, AlgoMode), "Algo Mode");- readouts.Add(HiModes); HiModes();+ readouts.Add(hiModes);var tail = Mono("", 7, MutedC);- readouts.Add(() => tail.Text = On(Freeze) ? "tail ∞ (frozen)" : FormattableString.Invariant($"tail {Secs(RtMid())}"));+ readouts.Add(() => tail.Text = On(Freeze) ? "tail ∞ (frozen)" : NotaNum.F($"tail {Secs(RtMid())}"));var modeRow = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,*"), ColumnSpacing = 5, Height = 20 };modeRow.Children.Add(Caps("MODE")); modeRow.Children.Add(Col(chips, 1));tail.HorizontalAlignment = HorizontalAlignment.Right; modeRow.Children.Add(Col(tail, 2));@@ -483,12 +417,12 @@ internal sealed class ChamberDeviceBody : IDeviceBody{FetchPreviews();graph.SetEchogram(echoEnv, Sc(S_PreviewSeconds));- graph.Set(PreSec(AlgoPredelay, AlgoSync), RtLow(), RtMid(), RtHigh(), On(Freeze), FormattableString.Invariant($"· hf ≥ {Hz(Exp(P(AlgoDamping), 500, 18000))}"));+ graph.Set(PreSec(AlgoPredelay, AlgoSync), RtLow(), RtMid(), RtHigh(), On(Freeze), NotaNum.F($"· hf ≥ {Hz(Exp(P(AlgoDamping), 500, 18000))}"));});var knobs = new Grid { ColumnDefinitions = new ColumnDefinitions("*,*,*,*,*,Auto"), Height = 56 };knobs.Children.Add(K(AlgoDecay, "DECAY", v => Secs(Exp(v, 0.2, 20)), 36, 50));- knobs.Children.Add(Col(K(AlgoSize, "SIZE", v => FormattableString.Invariant($"{Exp(v, 0.4, 2.5) * 100:0} %"), 36, 50), 1));+ knobs.Children.Add(Col(K(AlgoSize, "SIZE", v => NotaNum.F($"{Exp(v, 0.4, 2.5) * 100:0}\u2009%"), 36, 50), 1));knobs.Children.Add(Col(K(AlgoDiffusion, "DIFFUSE", v => Pct(v), 36, 50), 2));knobs.Children.Add(Col(K(AlgoDamping, "DAMPING", v => Hz(Exp(v, 500, 18000)), 36, 50), 3));knobs.Children.Add(Col(K(AlgoPredelay, "PREDELAY", _ => Pre(AlgoPredelay, AlgoSync), 36, 50), 4));@@ -518,10 +452,10 @@ internal sealed class ChamberDeviceBody : IDeviceBodyToolTip.SetTip(eq, "Brass handle: low cut (X) + low shelf (Y) · grey handle: high cut (X) + high shelf (Y)");readouts.Add(() => eq.Set(P(EqLowCut), P(EqLowGain), P(EqHighShelf), P(EqHighCut)));var eqKnobs = new Grid { ColumnDefinitions = new ColumnDefinitions("*,*,*,*"), Height = 50 };- eqKnobs.Children.Add(K(EqLowCut, "LOW CUT", LowCutF, 30, 48));- eqKnobs.Children.Add(Col(K(EqLowGain, "LOW GAIN", GainF, 30, 48), 1));- eqKnobs.Children.Add(Col(K(EqHighShelf, "HI SHELF", GainF, 30, 48), 2));- eqKnobs.Children.Add(Col(K(EqHighCut, "HI CUT", HighCutF, 30, 48), 3));+ eqKnobs.Children.Add(K(EqLowCut, "LOW-CUT", LowCutF, 30, 48));+ eqKnobs.Children.Add(Col(K(EqLowGain, "LOW", GainF, 30, 48), 1));+ eqKnobs.Children.Add(Col(K(EqHighShelf, "HIGH", GainF, 30, 48), 2));+ eqKnobs.Children.Add(Col(K(EqHighCut, "HIGH-CUT", HighCutF, 30, 48), 3));var eqCap = Caps("TAIL EQ"); eqCap.Margin = new Thickness(0, 0, 0, 3);var left = new Border { Width = 214, BorderBrush = BorderIn, BorderThickness = new Thickness(0, 0, 1, 0), Padding = new Thickness(7, 5),Child = new DockPanel { Children = { Docked(eqCap, Dock.Top), Docked(eqKnobs, Dock.Bottom), new Border { Margin = new Thickness(0, 0, 0, 2), Child = InsetBox(eq) } } } };@@ -530,7 +464,7 @@ internal sealed class ChamberDeviceBody : IDeviceBodyvar lfo = new ChamberLfoView { Height = 34 };readouts.Add(() => lfo.Tick(Exp(P(ModRate), 0.05, 8), P(ModDepth)));var modGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,*"), ColumnSpacing = 4 };- modGrid.Children.Add(K(ModRate, "RATE", v => { double hz = Exp(v, 0.05, 8); return hz >= 1 ? FormattableString.Invariant($"{hz:0.0} Hz") : FormattableString.Invariant($"{hz:0.00} Hz"); }, 28, 42, TealC));+ modGrid.Children.Add(K(ModRate, "RATE", v => { double hz = Exp(v, 0.05, 8); return hz >= 1 ? NotaNum.F($"{hz:0.0}\u2009Hz") : NotaNum.F($"{hz:0.00}\u2009Hz"); }, 28, 42, TealC));modGrid.Children.Add(Col(K(ModDepth, "DEPTH", v => Pct(v), 28, 42, TealC), 1));modGrid.Children.Add(Col(new Border { VerticalAlignment = VerticalAlignment.Top, Margin = new Thickness(2, 1, 0, 0), Child = InsetBox(lfo) }, 2));var mod = new StackPanel { Spacing = 2, Children = { Caps("MODULATION"), modGrid } };@@ -583,9 +517,9 @@ internal sealed class ChamberDeviceBody : IDeviceBodyvar dry = new Grid { ColumnDefinitions = new ColumnDefinitions("48,*"), VerticalAlignment = VerticalAlignment.Center };dry.Children.Add(Caps("DRY"));dry.Children.Add(Col(HBar(DryLevel, () => P(DryLevel), v => Raw(DryLevel, (float)v), v => ShortDb(DryDb(v)), NotaPalette.BorderStrong, () => On(WetOnly), 26), 1));- var duck = SliderRow("DUCKING", DuckAmount, v => FormattableString.Invariant($"{v * 24:0.0}"));- var rel = SliderRow("RELEASE", DuckRelease, v => FormattableString.Invariant($"{Exp(v, 20, 2000):0}"));- ToolTip.SetTip(duck, "Ducking — the wet dips (up to 24 dB) while the input plays");+ var duck = SliderRow("DUCKING", DuckAmount, v => NotaNum.F($"{v * 24:0.0}"));+ var rel = SliderRow("RELEASE", DuckRelease, v => NotaNum.F($"{Exp(v, 20, 2000):0}"));+ ToolTip.SetTip(duck, "Ducking — the wet dips (up to 24\u2009dB) while the input plays");var btns = new Grid { ColumnDefinitions = new ColumnDefinitions("*,*"), ColumnSpacing = 6, VerticalAlignment = VerticalAlignment.Center };btns.Children.Add(Latch(Freeze, "Freeze", "Freeze — hold the algorithm tail forever; the input is muted"));btns.Children.Add(Col(Latch(FreezeIn, "Hold in", "Hold in — keep feeding the input into the frozen tail (layering)"), 1));@@ -601,7 +535,7 @@ internal sealed class ChamberDeviceBody : IDeviceBodyvar wet = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 6, VerticalAlignment = VerticalAlignment.Center };wet.Children.Add(Caps("WET")); wet.Children.Add(Col(wetBar, 1)); wet.Children.Add(Col(wetDb, 2));var duckGr = Mono("", 7, MutedC);- readouts.Add(() => { double gr = Sc(S_DuckDb); duckGr.Text = gr > 0.05 ? FormattableString.Invariant($"−{gr:0.0}") : ""; });+ readouts.Add(() => { double gr = Sc(S_DuckDb); duckGr.Text = gr > 0.05 ? NotaNum.F($"−{gr:0.0}") : ""; });var g = new Grid { RowDefinitions = new RowDefinitions("*,*,*,*,Auto,*,*,Auto,*,*") };Control[] rows = { EngineRow(ConvOn, "CONV", true), EngineRow(AlgoOn, "ALGO", false), route, dry,@@ -627,13 +561,13 @@ internal sealed class ChamberDeviceBody : IDeviceBodyToolTip.SetTip(qseg, "Eco: IR up to 3 s · Mid: 6 s · High: 10 s + cubic-interpolated algorithm modulation");qual.Children.Add(Col(qseg, 1));var mid = new StackPanel { Spacing = 6, Children = {- SliderRow("WIDTH", WidthP, v => FormattableString.Invariant($"{v * 200:0}"), 48),- SliderRow("MONO f", BassMono, v => v <= 0.001 ? "off" : FormattableString.Invariant($"{Exp(v, 30, 500):0}"), 48),+ SliderRow("WIDTH", WidthP, v => NotaNum.F($"{v * 200:0}"), 48),+ SliderRow("MONO f", BassMono, v => v <= 0.001 ? "off" : NotaNum.F($"{Exp(v, 30, 500):0}"), 48),qual } };var wetOnly = Toggle(WetOnly, "Wet only (send)");- ToolTip.SetTip(wetOnly, "Wet only — 100 % wet, no dry: for a return / send track");+ ToolTip.SetTip(wetOnly, "Wet only — 100\u2009% wet, no dry: for a return / send track");var zl = Toggle(ZeroLatency, "Zero latency");- ToolTip.SetTip(zl, "On: exact convolution timing at 0 ms predelay (FIR head, more CPU). Off: lighter — the first block arrives late and is absorbed into the predelay.");+ ToolTip.SetTip(zl, "On: exact convolution timing at 0\u2009ms predelay (FIR head, more CPU). Off: lighter — the first block arrives late and is absorbed into the predelay.");var bottom = new StackPanel { Spacing = 5, Children = { wetOnly, zl } };var body = new DockPanel { LastChildFill = false, Children = {Docked(top, Dock.Top),@@ -657,7 +591,7 @@ internal sealed class ChamberDeviceBody : IDeviceBodycase 0:int ch = (int)Sc(S_IrChannels);string ts = !On(IrTrueStereo) || ch <= 1 ? "stereo" : ch >= 4 ? "true stereo" : "mono-in stereo";- extras.Text = Sc(S_KernelSeconds) > 0 ? FormattableString.Invariant($"{ts} · {Sc(S_KernelSeconds):0.0} s IR") : ts;+ extras.Text = Sc(S_KernelSeconds) > 0 ? NotaNum.F($"{ts} · {Sc(S_KernelSeconds):0.0}\u2009s IR") : ts;extras.Foreground = MutedC; break;case 1:extras.Text = On(Freeze) ? "FREEZE active" : On(Routing) && On(ConvOn) ? "fed by convolution" : "";@@ -671,9 +605,9 @@ internal sealed class ChamberDeviceBody : IDeviceBodyControl RightBody(int t) => rightBodies[t] ??= t == 1 ? OutputTab() : LevelsTab();var centre = TabFrame(new[] { "Convolution", "Algorithm", "EQ · Mod" }, centreHost, CentreBody, false, t => { centreTab = t; foreach (var a in readouts) a(); }, extras);var rightFrame = TabFrame(new[] { "Levels", "Output" }, rightHost, RightBody, true, _ => { foreach (var a in readouts) a(); }, null);- var right = new Border { Width = 186, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), ClipToBounds = true, Child = rightFrame };+ var right = new Border { Width = 186, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, ClipToBounds = true, Child = rightFrame };DockPanel.SetDock(right, Dock.Right);- var centreBox = new Border { Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Margin = new Thickness(5, 0), ClipToBounds = true, Child = centre };+ var centreBox = new Border { Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Margin = new Thickness(5, 0), ClipToBounds = true, Child = centre };// ======================================================================// Status strip@@ -683,21 +617,21 @@ internal sealed class ChamberDeviceBody : IDeviceBodystring StatusText(){float b = P(Blend);- string blend = FormattableString.Invariant($"blend {(1 - b) * 100:0} / {b * 100:0}");+ string blend = NotaNum.F($"blend {(1 - b) * 100:0} / {b * 100:0}");switch (centreTab){case 1:string mode = Modes[Sel(AlgoMode, 4)];- if (On(Freeze)) return On(FreezeIn) ? FormattableString.Invariant($"Freeze + hold in: the tail layers the input · {mode}") : FormattableString.Invariant($"Freeze: tail held, input muted · {mode} {Secs(RtMid())}");- return FormattableString.Invariant($"{mode} · decay {Secs(RtMid())} · size {Exp(P(AlgoSize), 0.4, 2.5) * 100:0} % · predelay {Pre(AlgoPredelay, AlgoSync)}{(On(Routing) ? " · serial" : "")}");+ if (On(Freeze)) return On(FreezeIn) ? NotaNum.F($"Freeze + hold in: the tail layers the input · {mode}") : NotaNum.F($"Freeze: tail held, input muted · {mode} {Secs(RtMid())}");+ return NotaNum.F($"{mode} · decay {Secs(RtMid())} · size {Exp(P(AlgoSize), 0.4, 2.5) * 100:0}\u2009% · predelay {Pre(AlgoPredelay, AlgoSync)}{(On(Routing) ? " · serial" : "")}");case 2:- string eqS = FormattableString.Invariant($"tail EQ {LowCutF(P(EqLowCut))} — {HighCutF(P(EqHighCut))}");- string shimS = Sel(AlgoMode, 4) == 3 ? FormattableString.Invariant($" · shimmer {Interval()}, {P(ShimmerAmount) * 100:0} %") : "";- return FormattableString.Invariant($"{(On(WetOnly) ? "Wet only · " : "")}{eqS}{shimS}");+ string eqS = NotaNum.F($"tail EQ {LowCutF(P(EqLowCut))} — {HighCutF(P(EqHighCut))}");+ string shimS = Sel(AlgoMode, 4) == 3 ? NotaNum.F($" · shimmer {Interval()}, {P(ShimmerAmount) * 100:0}\u2009%") : "";+ return NotaNum.F($"{(On(WetOnly) ? "Wet only · " : "")}{eqS}{shimS}");default:int ir = Sel(IrSelect, IrCount);string name = ir < irList.Count ? irList[ir].Name : engine.DeviceText(track, di, 2) is { Length: > 0 } u ? u : "no user IR";- return FormattableString.Invariant($"{name} · {blend} · predelay {Pre(ConvPredelay, ConvSync)}");+ return NotaNum.F($"{name} · {blend} · predelay {Pre(ConvPredelay, ConvSync)}");}}readouts.Add(() =>@@ -705,8 +639,8 @@ internal sealed class ChamberDeviceBody : IDeviceBodystatusLeft.Text = StatusText();statusLeft.Foreground = centreTab == 1 && On(Freeze) ? AmberLit : Txt2;double sr = Sc(S_SampleRate), lat = Sc(S_Latency);- string latS = lat > 0 ? FormattableString.Invariant($"conv +{lat:0} smp (in predelay)") : "latency 0 smp";- statusRight.Text = sr > 0 ? FormattableString.Invariant($"{sr / 1000:0.#} kHz · {latS} · CPU {Sc(S_Cpu) * 100:0.0} %") : "";+ string latS = lat > 0 ? NotaNum.F($"conv +{lat:0}\u2009smp (in predelay)") : "latency 0\u2009smp";+ statusRight.Text = sr > 0 ? NotaNum.F($"{sr / 1000:0.#}\u2009kHz · {latS} · CPU {Sc(S_Cpu) * 100:0}\u2009%") : "";});var statusGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), ColumnSpacing = 8 };statusGrid.Children.Add(statusLeft); statusGrid.Children.Add(Col(statusRight, 1));diff --git a/src/managed/Nota.App/DeviceCards/Bodies/CompressorDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/CompressorDeviceBody.csindex e7a283b9..08a9bcf2 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/CompressorDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/CompressorDeviceBody.cs@@ -25,6 +25,8 @@ internal sealed class CompressorDeviceBody : IDeviceBodyprivate static readonly string[] Chars = { "Clean", "Glue", "Punch", "Opto", "FET" };public double Width => 700;++ public string? Subtitle => "DYNAMICS"; // the processing type, shown as the header badgepublic bool FullBleed => true;public Control Build(DeviceCardContext ctx, int index)@@ -59,19 +61,16 @@ internal sealed class CompressorDeviceBody : IDeviceBody}Control Chips(int p, string[] names, IBrush? tint = null){- int n = names.Length; var arr = new Border[n];- void Hi() { int cur = Sel(p, n); for (int i = 0; i < n; i++) { bool on = i == cur; arr[i].Background = on ? AccentSubtleB : Brushes.Transparent; arr[i].BorderBrush = on ? (tint ?? Brass) : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? (tint ?? AccentBright) : TextTertiary; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(6, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 9, Foreground = TextTertiary } }; c.PointerPressed += (_, _) => { SetR(p, iv); Hi(); transfer.Tick(); }; arr[i] = c; row.Children.Add(c); }- readouts.Add(Hi); Hi();- var chipsHost = new Border { Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };- MidiLearn.Bind(chipsHost, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));- return chipsHost;+ int n = names.Length;+ var host = DeviceCardKit.Segments(names, () => Sel(p, n), iv => { SetR(p, iv); transfer.Tick(); }, out var sync);+ readouts.Add(sync);+ MidiLearn.Bind(host, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));+ return host;}Control Toggle(int p, string label){- var b = new Border { CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 9, FontWeight = FontWeight.SemiBold } };- void Hi() { bool on = P(p) > 0.5f; b.Background = on ? AccentSubtleB : Sunken; b.BorderBrush = on ? Brass : BorderDef; ((TextBlock)b.Child!).Foreground = on ? AccentBright : TextTertiary; }+ var b = new Border { CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 9, FontWeight = FontWeight.SemiBold } };+ void Hi() { bool on = P(p) > 0.5f; b.Background = on ? NotaPalette.AccentSubtle : Sunken; b.BorderBrush = on ? NotaPalette.BorderBrass : BorderDef; ((TextBlock)b.Child!).Foreground = on ? NotaPalette.AccentHover : TextTertiary; }b.PointerPressed += (_, _) => { SetR(p, P(p) > 0.5f ? 0f : 1f); Hi(); };readouts.Add(Hi); Hi();MidiLearn.Bind(b, MidiTarget.DeviceParam(track, di, p), label);@@ -84,34 +83,20 @@ internal sealed class CompressorDeviceBody : IDeviceBodydouble lmn = log ? Math.Log(mn) : mn, lspan = (log ? Math.Log(mx) : mx) - lmn;double NormOf(double v) { double x = log ? Math.Log(Math.Clamp(v, mn, mx)) : Math.Clamp(v, mn, mx); return (x - lmn) / Math.Max(1e-9, lspan); }double ValOf(double n) { double x = lmn + Math.Clamp(n, 0, 1) * lspan; return log ? Math.Exp(x) : x; }- var trk = new Border { Width = tw, Height = 3, Background = Sunken, CornerRadius = new CornerRadius(2) };- var fill = new Border { Height = 3, Background = accent, CornerRadius = new CornerRadius(2) };- var handle = new Border { Width = 8, Height = 9, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2) };- var canvas = new Canvas { Width = tw, Height = 9, Background = Brushes.Transparent, VerticalAlignment = VerticalAlignment.Center };- Canvas.SetTop(trk, 3); Canvas.SetTop(fill, 3); Canvas.SetTop(handle, 0);- canvas.Children.Add(trk); canvas.Children.Add(fill); canvas.Children.Add(handle);- var val = new TextBlock { FontSize = 9, Foreground = TextPrimary, Width = 44, VerticalAlignment = VerticalAlignment.Center };- val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- bool drag = false;- void Vis(double v) { double n = NormOf(v); fill.Width = Math.Max(0, n * tw); Canvas.SetLeft(handle, n * tw - 4); val.Text = fmt(v); }- void From(PointerEventArgs e) { double n = Math.Clamp(e.GetPosition(canvas).X / tw, 0, 1); float v = (float)ValOf(n); SetR(p, v); Vis(v); transfer.Tick(); }- canvas.PointerPressed += (_, e) => { drag = true; engine.BeginAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""); e.Pointer.Capture(canvas); From(e); };- canvas.PointerMoved += (_, e) => { if (drag) From(e); };- canvas.PointerReleased += (_, e) => { if (drag) { drag = false; engine.EndAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""); e.Pointer.Capture(null); } };- readouts.Add(() => { if (!drag) Vis(P(p)); });- Vis(P(p));- var lbl = new TextBlock { Text = name, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = accent == Teal ? Teal : TextTertiary, VerticalAlignment = VerticalAlignment.Center };- if (lw > 0) lbl.Width = lw;- var sl = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = { lbl, canvas, val } };- MidiLearn.Bind(sl, MidiTarget.DeviceParam(track, di, p), name);- return sl;+ var row = DeviceCardKit.SliderRow(name, () => NormOf(P(p)), n => { SetR(p, (float)ValOf(n)); transfer.Tick(); }, () => fmt(P(p)), out var sync,+ begin: () => engine.BeginAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""),+ end: () => engine.EndAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""),+ labelWidth: lw, trackWidth: tw, valueWidth: 44);+ readouts.Add(sync);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), name);+ return row;}- string Db1(double v) => $"{v:+0.0;-0.0;0.0}";- string DbT(double v) => $"{v:0.0} dB";+ string Db1(double v) => $"{v:+0.0;−0.0;0.0}";+ string DbT(double v) => $"{v:0.0}\u2009dB";string RatioF(double v) => $"{v:0}:1";- string Pct(double v) => $"{v:0}%";- string Ms(double v) => v < 10 ? $"{v:0.0} ms" : $"{v:0} ms";+ string Pct(double v) => $"{v:0}\u2009%";+ string Ms(double v) => v < 10 ? $"{v:0.0}\u2009ms" : $"{v:0}\u2009ms";string Hz(double v) => v >= 1000 ? $"{v / 1000:0.0}k" : $"{v:0}";// ---- top strip: character models + threshold/ratio/mix sliders ----@@ -126,7 +111,7 @@ internal sealed class CompressorDeviceBody : IDeviceBodygrHist.Height = 64; Grid.SetRow(grHist, 1); graphsCol.Children.Add(grHist);// ---- TIMING panel ----- Control Panel(string title, Control body) => new Border { Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(8, 6), Child = new StackPanel { Spacing = 5, Children = { Lbl(title, 8, TextTertiary), body } } };+ Control Panel(string title, Control body) => new Border { Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(8, 6), Child = new StackPanel { Spacing = 5, Children = { Lbl(title, 8, TextTertiary), body } } };var autoRel = Toggle(AutoRelease, "Auto-release"); DockPanel.SetDock(autoRel, Dock.Right);var detRow = new DockPanel { LastChildFill = false, Children = { Chips(Detection, new[] { "Peak", "RMS" }), autoRel } };var timing = Panel("TIMING", new StackPanel { Spacing = 6, Children = {@@ -137,16 +122,13 @@ internal sealed class CompressorDeviceBody : IDeviceBodyControl Sidechain(){var ids = new System.Collections.Generic.List<int> { -1 };- var combo = new ComboBox { FontSize = 10, Height = 22, MinWidth = 96 };+ var combo = new ComboBox { FontSize = 9, Height = 22, MinWidth = 96 };combo.Items.Add("Internal");for (int i = 0; i < engine.TrackCount; i++) { if (!engine.TryGetTrackInfo(i, out var ti) || ti.Id == track) continue; ids.Add(ti.Id); combo.Items.Add($"{i + 1} · {(ti.IsReturn ? "Return" : ti.IsInstrument ? "Instr" : "Audio")}"); }combo.SelectedIndex = Math.Max(0, ids.IndexOf(engine.DeviceSidechainSource(track, di)));combo.SelectionChanged += (_, _) => { int s = combo.SelectedIndex; if (s >= 0 && s < ids.Count) { engine.SetDeviceSidechainSource(track, di, ids[s]); ctx.NotifyChanged(); } };- var pre = new Border[2]; var preRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- void HiPre() { bool p = engine.DeviceSidechainTapPre(track, di); ((TextBlock)pre[0].Child!).Foreground = p ? AccentBright : TextTertiary; pre[0].Background = p ? AccentSubtleB : Brushes.Transparent; ((TextBlock)pre[1].Child!).Foreground = !p ? AccentBright : TextTertiary; pre[1].Background = !p ? AccentSubtleB : Brushes.Transparent; }- for (int i = 0; i < 2; i++) { bool preTap = i == 0; var c = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(6, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = preTap ? "Pre" : "Post", FontSize = 9, Foreground = TextTertiary } }; c.PointerPressed += (_, _) => { engine.SetDeviceSidechainTapPre(track, di, preTap); HiPre(); }; pre[i] = c; preRow.Children.Add(c); }- var preBox = new Border { Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = preRow };- HiPre();+ var preBox = DeviceCardKit.Segments(new[] { "Pre", "Post" }, () => engine.DeviceSidechainTapPre(track, di) ? 0 : 1,+ i => engine.SetDeviceSidechainTapPre(track, di, i == 0), out _);var listen = Toggle(ScListen, "Listen"); DockPanel.SetDock(listen, Dock.Right);var topRow = new DockPanel { LastChildFill = false, Children = { new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = { combo, preBox } }, listen } };// HP and LP side by side (2 columns) so the sliders line up on the grid.@@ -154,7 +136,7 @@ internal sealed class CompressorDeviceBody : IDeviceBodyvar hp = HSlider(ScHP, "HP", Hz, true, Teal, 68, lw: 16);var lp = HSlider(ScLP, "LP", Hz, true, Teal, 68, lw: 16);Grid.SetColumn(lp, 1); filters.Children.Add(hp); filters.Children.Add(lp);- return new Border { Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(8, 6),+ return new Border { Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(8, 6),Child = new StackPanel { Spacing = 5, Children = { Lbl("SIDECHAIN", 8, TextTertiary), topRow, filters } } };}var timingCol = new StackPanel { Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = { timing, Sidechain() } };diff --git a/src/managed/Nota.App/DeviceCards/Bodies/CrushDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/CrushDeviceBody.csindex e3b1bec0..7fd94d0e 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/CrushDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/CrushDeviceBody.cs@@ -51,6 +51,8 @@ internal sealed class CrushDeviceBody : IDeviceBodyinternal static readonly IBrush NyqLine = NotaPalette.Wash(NotaPalette.AccentBright, 0x73);public double Width => 700;++ public string? Subtitle => "BITCRUSHER"; // the processing type, shown as the header badgepublic bool FullBleed => true;public Control Build(DeviceCardContext ctx, int index)@@ -66,11 +68,11 @@ internal sealed class CrushDeviceBody : IDeviceBodyvar readouts = new List<Action>();// ---- formatters ----- string BitsF(double v) => $"{1 + v * 23:0.0} bit";- string RateF(double v) { double hz = Exp(v, 500, 44100 * 0.48); return hz >= 1000 ? $"{hz / 1000:0.0} kHz" : $"{(int)Math.Round(hz)} Hz"; }- static string PctF(double v) => $"{v * 100:0}%";- static string DriveF(double v) { double db = -12 + v * 36; return $"{(db >= 0 ? "+" : "")}{db:0.0} dB"; }- static string GainF(double v) { double db = (v - 0.5) * 24; return $"{(db >= 0 ? "+" : "")}{db:0.0} dB"; }+ string BitsF(double v) => $"{1 + v * 23:0.0}\u2009bit";+ string RateF(double v) { double hz = Exp(v, 500, 44100 * 0.48); return hz >= 1000 ? $"{hz / 1000:0.0}\u2009k" : $"{(int)Math.Round(hz)}\u2009Hz"; }+ static string PctF(double v) => $"{v * 100:0}\u2009%";+ static string DriveF(double v) { double db = -12 + v * 36; return $"{(db >= 0 ? "+" : "")}{db:0.0}\u2009dB"; }+ static string GainF(double v) { double db = (v - 0.5) * 24; return $"{(db >= 0 ? "+" : "")}{db:0.0}\u2009dB"; }// ---- quantiser viz ----var quantViz = new CrushQuantiserViz { VerticalAlignment = VerticalAlignment.Stretch };@@ -87,62 +89,35 @@ internal sealed class CrushDeviceBody : IDeviceBody// ---- horizontal param slider (LIVE strip + rails) ----Control HSlider(int p, string label, Func<double, string> fmt, double lw, double vw, bool bipolar = false){- var fill = new Border { Height = 3, Background = Amber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var track2 = new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center };- var center = bipolar ? new Border { Width = 1, Background = NotaPalette.BorderStrong, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Stretch, Margin = new Thickness(0, 1) } : null;- var handle = new Border { Width = 8, Height = 10, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Height = 11, MinWidth = 40 }; slot.Children.Add(track2); if (center != null) slot.Children.Add(center); slot.Children.Add(fill); slot.Children.Add(handle);- var val = new TextBlock { Text = fmt(P(p)), FontSize = 9, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center }; val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono"); if (vw > 0) { val.Width = vw; val.TextAlignment = TextAlignment.Right; }- bool drag = false;- void Upd() { double v = P(p); double W = slot.Bounds.Width; double hx = v * W; handle.Margin = new Thickness(Math.Clamp(hx - 4, 0, Math.Max(0, W - 8)), 0, 0, 0); if (bipolar) { double c = W * 0.5; double a = Math.Min(c, hx), b = Math.Max(c, hx); fill.Margin = new Thickness(a, 0, 0, 0); fill.Width = Math.Max(0, b - a); } else fill.Width = hx; val.Text = fmt(v); }- void SetFromX(double x) { double v = Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1); SetP(p, (float)v); SyncQuant(); SyncSpec(); Upd(); }- slot.PointerPressed += (_, e) => { drag = true; e.Pointer.Capture(slot); Begin(p); SetFromX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetFromX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); End(p); } };- MidiLearn.Bind(slot, MidiTarget.DeviceParam(track, di, p), label);- readouts.Add(() => { if (!drag) Upd(); });- var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center };- if (lw > 0) { var lbl = Cap(label); ((TextBlock)lbl).Width = lw; g.Children.Add(lbl); }- Grid.SetColumn(slot, 1); g.Children.Add(slot); Grid.SetColumn(val, 2); g.Children.Add(val);- return g;+ var row = DeviceCardKit.SliderRow(lw > 0 ? label : "", () => P(p), n => { SetP(p, (float)n); SyncQuant(); SyncSpec(); }, () => fmt(P(p)), out var sync,+ begin: () => Begin(p), end: () => End(p), bipolar: bipolar, labelWidth: lw, valueWidth: vw);+ readouts.Add(sync);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), label);+ return row;}// ---- rail slider (teal for GRIT) ----Control RailSlider(int p, string label, Func<double, string> fmt, IBrush? color = null){- var c = color ?? Amber;- var fill = new Border { Height = 3, Background = c, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var track2 = new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 8, Height = 9, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Height = 10, MinWidth = 40, Children = { track2, fill, handle } };- var val = new TextBlock { Text = fmt(P(p)), FontSize = 9, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center, Width = 48, TextAlignment = TextAlignment.Right };- val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- bool drag = false;- void Upd() { double v = P(p); double W = slot.Bounds.Width; double hx = v * W; handle.Margin = new Thickness(Math.Clamp(hx - 4, 0, Math.Max(0, W - 8)), 0, 0, 0); fill.Width = hx; val.Text = fmt(v); }- void SetFromX(double x) { double v = Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1); SetP(p, (float)v); SyncQuant(); SyncSpec(); Upd(); }- slot.PointerPressed += (_, e) => { drag = true; e.Pointer.Capture(slot); Begin(p); SetFromX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetFromX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); End(p); } };- MidiLearn.Bind(slot, MidiTarget.DeviceParam(track, di, p), label);- readouts.Add(() => { if (!drag) Upd(); });- var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center };- g.Children.Add(new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedC, Width = 38, VerticalAlignment = VerticalAlignment.Center });- Grid.SetColumn(slot, 1); g.Children.Add(slot); Grid.SetColumn(val, 2); g.Children.Add(val);- return g;+ var row = DeviceCardKit.SliderRow(label, () => P(p), n => { SetP(p, (float)n); SyncQuant(); SyncSpec(); }, () => fmt(P(p)), out var sync,+ begin: () => Begin(p), end: () => End(p), labelWidth: 38, valueWidth: 48);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), label);+ readouts.Add(sync);+ return row;}// ---- mode selector chips ----Control ModeSelector(){var chips = new Border[Modes.Length]; var texts = new TextBlock[Modes.Length]; var subs = new TextBlock[Modes.Length];- void Sync() { int cur = (int)Math.Round(P(Mode) * 2); for (int i = 0; i < Modes.Length; i++) { bool on = i == cur; chips[i].Background = on ? AmberSubtle : Inset; chips[i].BorderBrush = on ? Amber : Border2; texts[i].Foreground = on ? AmberLit : MutedC; subs[i].Foreground = on ? AmberLit : MutedC; } }+ void Sync() { int cur = (int)Math.Round(P(Mode) * 2); for (int i = 0; i < Modes.Length; i++) { bool on = i == cur; chips[i].Background = on ? Amber : Inset; chips[i].BorderBrush = on ? Amber : Border2; texts[i].Foreground = on ? NotaPalette.TextOnAccent : MutedC; subs[i].Foreground = on ? NotaPalette.TextOnAccent : MutedC; } }var col = new StackPanel { Spacing = 2 };for (int i = 0; i < Modes.Length; i++){int iv = i;var tb = new TextBlock { Text = Modes[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = MutedC };var sub = new TextBlock { Text = ModeSubs[i], FontSize = 8, Foreground = MutedC };- var c = new Border { Height = 15, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(7, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = { tb, new TextBlock { Text = ModeSubs[i], FontSize = 8, Foreground = MutedC, [DockPanel.DockProperty] = Dock.Right } } } };+ var c = new Border { Height = 15, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Padding = new Thickness(7, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = { tb, new TextBlock { Text = ModeSubs[i], FontSize = 8, Foreground = MutedC, [DockPanel.DockProperty] = Dock.Right } } } };c.PointerPressed += (_, e) => { e.Handled = true; SetP(Mode, iv / 2f); SyncQuant(); SyncSpec(); RefreshAll(); };chips[i] = c; texts[i] = tb; subs[i] = sub; col.Children.Add(c);}@@ -165,7 +140,7 @@ internal sealed class CrushDeviceBody : IDeviceBody// ---- rail button (Init / Bypass) ----Control RailBtn(string label, Action onClick){- var b = new Border { Background = RowLit, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(0, 2), HorizontalAlignment = HorizontalAlignment.Stretch, Cursor = new Cursor(StandardCursorType.Hand),+ var b = new Border { Background = RowLit, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Padding = new Thickness(0, 2), HorizontalAlignment = HorizontalAlignment.Stretch, Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = label, FontSize = 9, Foreground = MutedC, HorizontalAlignment = HorizontalAlignment.Center } };b.PointerPressed += (_, e) => { e.Handled = true; onClick(); };return b;@@ -186,30 +161,32 @@ internal sealed class CrushDeviceBody : IDeviceBodystatic TextBlock Tiny(string t, IBrush c) => new() { Text = t, FontSize = 8, Foreground = c, VerticalAlignment = VerticalAlignment.Center };TextBlock TinyMono(string t, IBrush c) { var b = Tiny(t, c); b.BindResource(TextBlock.FontFamilyProperty, "Font.Mono"); return b; }- var quantSpec = TinyMono("", Amber); // "6.0-bit @ 11.0 kHz"+ var quantSpec = TinyMono("", Amber); // "6.0-bit @ 11.0\u2009kHz"var quantHdr = new DockPanel { LastChildFill = false, Height = 11, Children = {WithDock(new TextBlock { Text = "QUANTISER", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center }, Dock.Left),WithDock(quantSpec, Dock.Right),- WithDock(new TextBlock { Text = "┄ source ", FontSize = 8, Foreground = Dim, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0,0,6,0) }, Dock.Right) } };+ WithDock(new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 6, 0), Children = {+ new Avalonia.Controls.Shapes.Line { StartPoint = new Point(0, 0), EndPoint = new Point(10, 0), Stroke = Dim, StrokeThickness = 1.2, StrokeDashArray = new Avalonia.Collections.AvaloniaList<double> { 2, 2 }, VerticalAlignment = VerticalAlignment.Center },+ new TextBlock { Text = "source", FontSize = 8, Foreground = Dim, VerticalAlignment = VerticalAlignment.Center } } }, Dock.Right) } };var quantLevels = TinyMono("", Dim); // "64 levels"- var quantHold = TinyMono("", Dim); // "hold 3 smp"+ var quantHold = TinyMono("", Dim); // "hold 3\u2009smp"var quantFooter = new DockPanel { LastChildFill = false, Height = 10, Children = {WithDock(quantLevels, Dock.Left), WithDock(quantHold, Dock.Right) } };readouts.Add(() => {double bits = 1 + P(Bits) * 23; double lv = Math.Pow(2, bits);string lvS = lv >= 1e6 ? $"{lv / 1e6:0.0} M" : lv >= 1e3 ? $"{lv / 1e3:0.0} k" : $"{(long)Math.Round(lv)}";double hz = Exp(P(Rate), 500, 44100 * 0.48); int hold = Math.Max(1, (int)Math.Round(44100.0 / hz));- quantSpec.Text = $"▮ {bits:0.0}-bit @ {(hz >= 1000 ? $"{hz / 1000:0.0} kHz" : $"{(int)hz} Hz")}";- quantLevels.Text = $"{lvS} levels"; quantHold.Text = $"hold {hold} smp";+ quantSpec.Text = $"▮ {bits:0.0}-bit @ {(hz >= 1000 ? $"{hz / 1000:0.0}\u2009k" : $"{(int)hz}\u2009Hz")}";+ quantLevels.Text = $"{lvS} levels"; quantHold.Text = $"hold {hold}\u2009smp";});- var quantPanel = new Border { Padding = new Thickness(8, 4), Child = new Border { Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(8, 4), Child = new DockPanel { LastChildFill = true, Children = { WithDock(quantHdr, Dock.Top), WithDock(quantFooter, Dock.Bottom), quantViz } } } };+ var quantPanel = new Border { Padding = new Thickness(8, 4), Child = new Border { Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(8, 4), Child = new DockPanel { LastChildFill = true, Children = { WithDock(quantHdr, Dock.Top), WithDock(quantFooter, Dock.Bottom), quantViz } } } };// ================= spectrum panel =================var specHdr = new DockPanel { LastChildFill = false, Height = 10, Children = {WithDock(new TextBlock { Text = "SPECTRUM", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center }, Dock.Left),WithDock(Tiny("▮ aliased images", TealC), Dock.Right),WithDock(new TextBlock { Text = "▮ signal ", FontSize = 8, Foreground = Amber, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0,0,6,0) }, Dock.Right) } };- var specPanel = new Border { Height = 66, Padding = new Thickness(8, 0, 8, 4), Child = new Border { Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(8, 4), Child = new DockPanel { LastChildFill = true, Children = { WithDock(specHdr, Dock.Top), specViz } } } };+ var specPanel = new Border { Height = 66, Padding = new Thickness(8, 0, 8, 4), Child = new Border { Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(8, 4), Child = new DockPanel { LastChildFill = true, Children = { WithDock(specHdr, Dock.Top), specViz } } } };// ================= left column (quantiser fills, spectrum fixed at bottom) =================var leftCol = new DockPanel { LastChildFill = true, Children = { WithDock(specPanel, Dock.Bottom), quantPanel } };diff --git a/src/managed/Nota.App/DeviceCards/Bodies/DelayDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/DelayDeviceBody.csindex 02a1515c..14f3f199 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/DelayDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/DelayDeviceBody.cs@@ -25,6 +25,8 @@ internal sealed class DelayDeviceBody : IDeviceBodyprivate static readonly double[] DivBeats = { 0.25, 1.0 / 3, 0.5, 0.75, 2.0 / 3, 1.0, 1.5, 2.0 };public double Width => 700;++ public string? Subtitle => "DELAY"; // the processing type, shown as the header badgepublic bool FullBleed => true;public Control Build(DeviceCardContext ctx, int index)@@ -44,17 +46,17 @@ internal sealed class DelayDeviceBody : IDeviceBodyint dL = Sel(DivL, 8), dR = link ? dL : Sel(DivR, 8);double fracL, fracR; string label; string[] ruler;if (sync) { fracL = DivBeats[dL] / 8; fracR = DivBeats[dR] / 8; label = $"L {DivNames[dL]} · R {DivNames[dR]}"; ruler = new[] { "0", "1 bar", "2 bars" }; }- else { double msL = P(TimeL) * 2000, msR = link ? msL : P(TimeR) * 2000; fracL = msL / 2000; fracR = msR / 2000; label = $"L {msL:0} · R {msR:0} ms"; ruler = new[] { "0", "1 s", "2 s" }; }+ else { double msL = P(TimeL) * 2000, msR = link ? msL : P(TimeR) * 2000; fracL = msL / 2000; fracR = msR / 2000; label = $"L {msL:0} · R {msR:0}\u2009ms"; ruler = new[] { "0", "1\u2009s", "2\u2009s" }; }taps.Set(fracL, fracR, P(Feedback), P(PingPong) > 0.5f, label, ruler);tapsLbl.Text = label;}ctx.AddDeviceRefresher(SyncGraph);- string Pct(double v) => $"{v * 100:0}%";- string SpreadF(double v) => $"{v * 50:0} ms";- string RateF(double v) => $"{Exp(v, 0.05, 8):0.00} Hz";- string DbF(double v) => v <= 0.001 ? "−∞" : $"{20 * Math.Log10(v * 2):+0.0;-0.0;0.0}";- string MsF(double v) => $"{v * 2000:0} ms";+ string Pct(double v) => $"{v * 100:0}\u2009%";+ string SpreadF(double v) => $"{v * 50:0}\u2009ms";+ string RateF(double v) => $"{Exp(v, 0.05, 8):0.00}\u2009Hz";+ string DbF(double v) => v <= 0.001 ? "−∞" : $"{20 * Math.Log10(v * 2):+0.0;−0.0;0.0}";+ string MsF(double v) => $"{v * 2000:0}\u2009ms";Control Cell(string name, int p, Func<double, string> fmt, IBrush? arc = null, double size = 34){@@ -72,28 +74,18 @@ internal sealed class DelayDeviceBody : IDeviceBodyControl Slider(int p, string name, Func<double, string> fmt, double w){- var bg = new Border { Width = w, Height = 3, Background = Sunken, CornerRadius = new CornerRadius(2) };- var fill = new Border { Height = 3, Background = Brass, CornerRadius = new CornerRadius(2) };- var handle = new Border { Width = 8, Height = 9, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2) };- var canvas = new Canvas { Width = w, Height = 9, Background = Brushes.Transparent, VerticalAlignment = VerticalAlignment.Center };- Canvas.SetTop(bg, 3); Canvas.SetTop(fill, 3); Canvas.SetTop(handle, 0);- canvas.Children.Add(bg); canvas.Children.Add(fill); canvas.Children.Add(handle);- var val = new TextBlock { FontSize = 9, Foreground = TextPrimary, Width = 44, VerticalAlignment = VerticalAlignment.Center };- val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- bool drag = false;- void Vis(double v) { fill.Width = Math.Max(0, v * w); Canvas.SetLeft(handle, v * w - 4); val.Text = fmt(v); }- void From(PointerEventArgs e) { double v = Math.Clamp(e.GetPosition(canvas).X / w, 0, 1); SetP(p, (float)v); Vis(v); SyncGraph(); }- canvas.PointerPressed += (_, e) => { drag = true; engine.BeginAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""); e.Pointer.Capture(canvas); From(e); };- canvas.PointerMoved += (_, e) => { if (drag) From(e); };- canvas.PointerReleased += (_, e) => { if (drag) { drag = false; engine.EndAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""); e.Pointer.Capture(null); } };- ctx.AddDeviceRefresher(() => { if (!drag) Vis(P(p)); });- Vis(P(p));- return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = { new TextBlock { Text = name, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center }, canvas, val } };+ var row = DeviceCardKit.SliderRow(name, () => P(p), n => { SetP(p, (float)n); SyncGraph(); }, () => fmt(P(p)), out var sync,+ begin: () => engine.BeginAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""),+ end: () => engine.EndAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""),+ trackWidth: w, valueWidth: 44);+ ctx.AddDeviceRefresher(sync);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), name);+ return row;}Control Toggle(int p, string label){- var b = new Border { CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 9, FontWeight = FontWeight.SemiBold } };- void Hi() { bool on = P(p) > 0.5f; b.Background = on ? AccentSubtleB : Sunken; b.BorderBrush = on ? Brass : BorderDef; ((TextBlock)b.Child!).Foreground = on ? AccentBright : TextTertiary; }+ var b = new Border { CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 9, FontWeight = FontWeight.SemiBold } };+ void Hi() { bool on = P(p) > 0.5f; b.Background = on ? NotaPalette.AccentSubtle : Sunken; b.BorderBrush = on ? NotaPalette.BorderBrass : BorderDef; ((TextBlock)b.Child!).Foreground = on ? NotaPalette.AccentHover : TextTertiary; }b.PointerPressed += (_, _) => { SetP(p, P(p) > 0.5f ? 0f : 1f); Hi(); SyncGraph(); };ctx.AddDeviceRefresher(Hi); Hi();MidiLearn.Bind(b, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));@@ -102,23 +94,17 @@ internal sealed class DelayDeviceBody : IDeviceBody// Division chip row over a param (8 steps).Control DivChips(int p){- var arr = new Border[8];- void Hi() { int cur = Sel(p, 8); for (int i = 0; i < 8; i++) { bool on = i == cur; arr[i].Background = on ? AccentSubtleB : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AccentBright : TextTertiary; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < 8; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(3, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = DivNames[i], FontSize = 8, Foreground = TextTertiary } }; c.PointerPressed += (_, _) => { SetP(p, iv / 7f); Hi(); SyncGraph(); }; arr[i] = c; row.Children.Add(c); }- ctx.AddDeviceRefresher(Hi); Hi();- var divSeg = new Border { Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };- MidiLearn.Bind(divSeg, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));- return divSeg;+ // Eight divisions: past the almanac's four-choice limit for segments — an accepted exception, see DESIGN.md § Accepted departures.+ var seg = DeviceCardKit.Segments(DivNames, () => Sel(p, 8), i => { SetP(p, i / 7f); SyncGraph(); }, out var sync);+ ctx.AddDeviceRefresher(sync);+ MidiLearn.Bind(seg, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));+ return seg;}Control Seg(int p, string[] opts){- int n = opts.Length; var arr = new Border[n];- void Hi() { int cur = Sel(p, n); for (int i = 0; i < n; i++) { bool on = i == cur; arr[i].Background = on ? AccentSubtleB : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AccentBright : TextTertiary; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = opts[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = TextTertiary } }; c.PointerPressed += (_, _) => { SetP(p, n > 1 ? iv / (float)(n - 1) : 0f); Hi(); SyncGraph(); RebuildTime(); }; arr[i] = c; row.Children.Add(c); }- ctx.AddDeviceRefresher(Hi); Hi();- var seg = new Border { Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ int n = opts.Length;+ var seg = DeviceCardKit.Segments(opts, () => Sel(p, n), iv => { SetP(p, n > 1 ? iv / (float)(n - 1) : 0f); SyncGraph(); RebuildTime(); }, out var sync);+ ctx.AddDeviceRefresher(sync);MidiLearn.Bind(seg, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));return seg;}@@ -138,7 +124,7 @@ internal sealed class DelayDeviceBody : IDeviceBodyControl Band(string title, Control body){var head = new TextBlock { Text = title, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = TextTertiary, Margin = new Thickness(0, 0, 0, 3) };- return new Border { Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(7, 5), Child = new StackPanel { Children = { head, body } } };+ return new Border { Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(7, 5), Child = new StackPanel { Children = { head, body } } };}var timePanel = Band("TIME", new StackPanel { Spacing = 6, Children = {new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, Children = { Seg(SyncMode, new[] { "ms", "Sync" }), Toggle(LinkLR, "Link"), Toggle(PingPong, "Ping") } },diff --git a/src/managed/Nota.App/DeviceCards/Bodies/DynamicEqDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/DynamicEqDeviceBody.csindex b443b3e6..7fba9ea2 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/DynamicEqDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/DynamicEqDeviceBody.cs@@ -31,6 +31,8 @@ internal sealed class DynamicEqDeviceBody : IDeviceBodyprivate static readonly string[] TypeAbbr = { "HP", "LS", "Bell", "Notch", "HS", "LP" };public double Width => 700;++ public string? Subtitle => "DYNAMIC EQ"; // the processing type, shown as the header badgepublic bool FullBleed => true; // manage our own padding so the tall band table fits the cardpublic Control Build(DeviceCardContext ctx, int index)@@ -76,14 +78,14 @@ internal sealed class DynamicEqDeviceBody : IDeviceBodyreturn cell;}- static string HzF(double v) => v >= 1000 ? $"{v / 1000:0.0}k" : $"{v:0} Hz";- static string QF2(double v) => v.ToString("0.00", CultureInfo.InvariantCulture);- static string DbF(double v) => $"{v:+0.0;-0.0;0} dB";- static string MsF(double v) => v >= 100 ? $"{v:0} ms" : $"{v:0.0} ms";+ static string HzF(double v) => v >= 1000 ? $"{v / 1000:0.0}k" : $"{v:0}\u2009Hz";+ static string QF2(double v) => v.ToString("0.00", NotaNum.Culture);+ static string DbF(double v) => $"{v:+0.0;−0.0;0}\u2009dB";+ static string MsF(double v) => v >= 100 ? $"{v:0}\u2009ms" : $"{v:0.0}\u2009ms";var kFreq = DevKnob("FREQ", FreqF, HzF, true, Brass);var kQ = DevKnob("Q", QF, QF2, false, Brass);- var kThr = DevKnob("THRESH", ThrF, v => $"{v:0} dB", false, Teal);+ var kThr = DevKnob("THRESH", ThrF, v => $"{v:0.0}\u2009dB", false, Teal);var kRange = DevKnob("RANGE", RangeF, DbF, false, Teal);var kAtk = DevKnob("ATTACK", AtkF, MsF, true, Teal);var kRel = DevKnob("RELEASE", RelF, MsF, true, Teal);@@ -99,11 +101,11 @@ internal sealed class DynamicEqDeviceBody : IDeviceBody{bool onc = i == cur;modeChips[i].Background = onc ? (i == 0 ? Brass : Teal) : Card2;- modeChips[i].Opacity = (canDyn || i == 0) ? 1 : 0.4;((TextBlock)modeChips[i].Child!).Foreground = onc ? OnAccent : TextSecondary;+ Inactive.Set(modeChips[i], !(canDyn || i == 0));}- double dynOp = IsDyn(Cur()) ? 1 : 0.5;- kThr.Opacity = kRange.Opacity = kAtk.Opacity = kRel.Opacity = dynOp;+ bool dyn = IsDyn(Cur());+ foreach (var k in new[] { kThr, kRange, kAtk, kRel }) Inactive.Set(k, !dyn, interactive: true);}var modeRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 3 };for (int i = 0; i < 3; i++)@@ -111,7 +113,7 @@ internal sealed class DynamicEqDeviceBody : IDeviceBodyint vi = i;var chip = new Border{- Background = Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4),+ Background = Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control,Padding = new Thickness(7, 3), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = modeLbl[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = TextSecondary },};@@ -128,7 +130,7 @@ internal sealed class DynamicEqDeviceBody : IDeviceBody// Sidechain + Solo togglesBorder Toggle(string text, Func<bool> get, Action<bool> set){- var b = new Border { BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(8, 4), Cursor = new Cursor(StandardCursorType.Hand),+ var b = new Border { BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(8, 4), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = text, FontSize = 9, FontWeight = FontWeight.SemiBold } };void Sync() { bool on = get(); b.Background = on ? Teal : Card2; ((TextBlock)b.Child!).Foreground = on ? OnAccent : TextSecondary; }b.PointerPressed += (_, e) => { e.Handled = true; set(!get()); Sync(); };@@ -151,7 +153,7 @@ internal sealed class DynamicEqDeviceBody : IDeviceBodyscCombo.SelectedIndex = Math.Max(0, scIds.IndexOf(engine.DeviceSidechainSource(track, di)));scCombo.SelectionChanged += (_, _) => { int s = scCombo.SelectedIndex; if (s >= 0 && s < scIds.Count) { engine.SetDeviceSidechainSource(track, di, scIds[s]); ctx.NotifyChanged(); } };- var bandTitle = new TextBlock { FontSize = 10, FontWeight = FontWeight.Bold, Foreground = AccentBright, VerticalAlignment = VerticalAlignment.Center, MinWidth = 96 };+ var bandTitle = new TextBlock { FontSize = 9, FontWeight = FontWeight.Bold, Foreground = AccentBright, VerticalAlignment = VerticalAlignment.Center, MinWidth = 96 };void SyncTitle() { int b = Cur(); int ty = (int)Math.Round(P(b * PerBand + TypeF)); bandTitle.Text = $"BAND {b + 1} · {TypeAbbr[Math.Clamp(ty, 0, 5)]}"; }ctx.AddDeviceRefresher(SyncTitle); ctx.AddDeviceRefresher(SyncMode);curve.SelectionChanged += () => { SyncTitle(); SyncMode(); };@@ -159,7 +161,7 @@ internal sealed class DynamicEqDeviceBody : IDeviceBodyBorder VSep() => new() { Width = 1, Background = BorderDef, Margin = new Thickness(3, 4) };var liveStrip = new Border{- Height = 60, Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6),+ Height = 60, Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel,Padding = new Thickness(9, 3), Margin = new Thickness(0, 0, 0, 4),Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children ={@@ -183,8 +185,8 @@ internal sealed class DynamicEqDeviceBody : IDeviceBodyvar type = new TextBlock { FontSize = 9 };var hz = new TextBlock { FontSize = 9 }; hz.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");var dyn = new TextBlock { FontSize = 9 }; dyn.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- var grBar = new Border { Height = 6, CornerRadius = new CornerRadius(3), Background = NotaPalette.BorderDefault, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var grFill = new Border { Height = 6, CornerRadius = new CornerRadius(3), Background = Teal, HorizontalAlignment = HorizontalAlignment.Left };+ var grBar = new Border { Height = 6, CornerRadius = NotaRadius.Badge, Background = NotaPalette.BorderDefault, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var grFill = new Border { Height = 6, CornerRadius = NotaRadius.Badge, Background = Teal, HorizontalAlignment = HorizontalAlignment.Left };var grWrap = new Grid { Margin = new Thickness(0, 0, 4, 0) }; grWrap.Children.Add(grBar); grWrap.Children.Add(grFill);void SyncRow()@@ -196,7 +198,7 @@ internal sealed class DynamicEqDeviceBody : IDeviceBodynum.Foreground = on ? (dynB ? Teal : Brass) : TextDisabled;type.Text = TypeAbbr[ty]; type.Foreground = tc;hz.Text = HzF(P(bb * PerBand + FreqF)); hz.Foreground = tc;- if (dynB) { int m = (int)Math.Round(P(bb * PerBand + ModeF)); dyn.Text = $"{(m == 1 ? "↓" : "↑")}{P(bb * PerBand + RangeF):+0;-0;0}"; dyn.Foreground = Teal; }+ if (dynB) { int m = (int)Math.Round(P(bb * PerBand + ModeF)); dyn.Text = $"{(m == 1 ? "↓" : "↑")}{P(bb * PerBand + RangeF):+0;−0;0}"; dyn.Foreground = Teal; }else if (HasGain(bb)) { dyn.Text = "—"; dyn.Foreground = TextTertiary; }else { dyn.Text = ""; }double gr = Math.Min(1, Math.Abs(curve.Gr(bb)) / 12);@@ -209,7 +211,7 @@ internal sealed class DynamicEqDeviceBody : IDeviceBodyGrid.SetColumn(num, 0); Grid.SetColumn(type, 1); Grid.SetColumn(hz, 2); Grid.SetColumn(dyn, 3); Grid.SetColumn(grWrap, 4);var rowGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("16,30,44,44,*"), Height = 11 };rowGrid.Children.Add(num); rowGrid.Children.Add(type); rowGrid.Children.Add(hz); rowGrid.Children.Add(dyn); rowGrid.Children.Add(grWrap);- var rb = new Border { Child = rowGrid, CornerRadius = new CornerRadius(3), Cursor = new Cursor(StandardCursorType.Hand), Padding = new Thickness(2, 0) };+ var rb = new Border { Child = rowGrid, CornerRadius = NotaRadius.Badge, Cursor = new Cursor(StandardCursorType.Hand), Padding = new Thickness(2, 0) };rb.PointerPressed += (_, e) => { e.Handled = true; curve.Select(bb); };rowBorders[b] = rb;Grid.SetRow(rb, b); table.Children.Add(rb);@@ -223,12 +225,12 @@ internal sealed class DynamicEqDeviceBody : IDeviceBody{new TextBlock { Text = "BANDS", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = TextTertiary },table,- new TextBlock { Text = "GR HISTORY · 2 s", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = TextTertiary, Margin = new Thickness(0, 1, 0, 0) },+ new TextBlock { Text = "GR HISTORY · 2\u2009s", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = TextTertiary, Margin = new Thickness(0, 1, 0, 0) },hist,} };- var graphPanel = new Border { Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(7), Padding = new Thickness(6), Child = curve, HorizontalAlignment = HorizontalAlignment.Stretch };- var tablePanel = new Border { Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(7), Padding = new Thickness(8, 6), Child = rightCol };+ var graphPanel = new Border { Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(6), Child = curve, HorizontalAlignment = HorizontalAlignment.Stretch };+ var tablePanel = new Border { Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(8, 6), Child = rightCol };var mainRow = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), ColumnSpacing = 6, Height = 154 };Grid.SetColumn(graphPanel, 0); Grid.SetColumn(tablePanel, 1);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/Eq3DeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/Eq3DeviceBody.csindex 1d4b9d4a..e97b6e96 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/Eq3DeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/Eq3DeviceBody.cs@@ -37,19 +37,21 @@ internal sealed class Eq3DeviceBody : IDeviceBodyprivate static readonly IBrush TxtC = NotaPalette.TextPrimary;private static readonly IBrush MutedC = NotaPalette.TextTertiary;private static readonly IBrush LabelC = NotaPalette.TextSecondary;- private static readonly IBrush KillC = NotaPalette.Danger;- private static readonly IBrush KillSubtle = NotaPalette.Wash(NotaPalette.Danger, 0x2E);+ private static readonly IBrush KillC = NotaPalette.AccentHover; // a state, not an alert: red is kept for recording and overload+ private static readonly IBrush KillSubtle = NotaPalette.AccentSubtle;private static readonly IBrush DetentC = NotaPalette.BorderStrong;private static readonly IBrush HandleC = NotaPalette.TextSecondary;private static readonly (string name, string span, IBrush hue)[] Bands ={- ("LOW", "20 – 250 Hz", NotaPalette.Ink("#C4756A")),- ("MID", "250 Hz – 2.5 k", NotaPalette.Ink("#C99C55")),- ("HIGH", "2.5 – 20 kHz", NotaPalette.Ink("#6D8FB5")),+ ("LOW", "20 – 250\u2009Hz", NotaPalette.Ink("#C4756A")),+ ("MID", "250\u2009Hz – 2.5 k", NotaPalette.Ink("#C99C55")),+ ("HIGH", "2.5 – 20\u2009kHz", NotaPalette.Ink("#6D8FB5")),};public double Width => 700;++ public string? Subtitle => "EQ"; // the processing type, shown as the header badgepublic bool FullBleed => true;public Control Build(DeviceCardContext ctx, int index)@@ -72,17 +74,17 @@ internal sealed class Eq3DeviceBody : IDeviceBodyctx.AddDeviceRefresher(curve.Tick);// ---- formatters ----- static string BandDb(double v) => $"{(v - 0.5) * 30:+0.0;-0.0;0.0}";- string HzLo(double v) { double f = Exp(v, 50, 2000); return f >= 1000 ? $"{f / 1000:0.00} kHz" : $"{(int)Math.Round(f)} Hz"; }- string HzHi(double v) { double f = Exp(v, 500, 18000); return f >= 1000 ? $"{f / 1000:0.00} kHz" : $"{(int)Math.Round(f)} Hz"; }+ static string BandDb(double v) => $"{(v - 0.5) * 30:+0.0;−0.0;0.0}";+ string HzLo(double v) { double f = Exp(v, 50, 2000); return f >= 1000 ? $"{f / 1000:0.0}\u2009k" : $"{(int)Math.Round(f)}\u2009Hz"; }+ string HzHi(double v) { double f = Exp(v, 500, 18000); return f >= 1000 ? $"{f / 1000:0.0}\u2009k" : $"{(int)Math.Round(f)}\u2009Hz"; }// ---- vertical band fader with a centre (0 dB) detent ----Control VFader(int p, IBrush hue){- var trackBar = new Border { Width = 4, Background = Inset, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Stretch };+ var trackBar = new Border { Width = 4, Background = Inset, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Stretch };var detent = new Border { Height = 1, Background = DetentC, HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 22, Height = 9, Background = NotaPalette.SurfaceHover, BorderBrush = NotaPalette.TextDisabled, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Top,- Child = new Border { Height = 2, Background = hue, CornerRadius = new CornerRadius(1), Margin = new Thickness(3, 2.5, 3, 0), VerticalAlignment = VerticalAlignment.Top } };+ var handle = new Border { Width = 22, Height = 9, Background = NotaPalette.SurfaceHover, BorderBrush = NotaPalette.TextDisabled, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Top,+ Child = new Border { Height = 2, Background = hue, CornerRadius = NotaRadius.Bar, Margin = new Thickness(3, 2.5, 3, 0), VerticalAlignment = VerticalAlignment.Top } };var slot = new Panel { Width = 26, Children = { trackBar, detent, handle } };bool drag = false;void Upd() { double v = P(p); double H = slot.Bounds.Height; double y = (1 - v) * (H - 9); handle.Margin = new Thickness(0, Math.Clamp(y, 0, Math.Max(0, H - 9)), 0, 0); }@@ -99,8 +101,8 @@ internal sealed class Eq3DeviceBody : IDeviceBodyControl KillBtn(int p){var tb = new TextBlock { Text = "KILL", FontSize = 8, FontWeight = FontWeight.Bold, HorizontalAlignment = HorizontalAlignment.Center };- var b = new Border { BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(0, 1), HorizontalAlignment = HorizontalAlignment.Stretch, Cursor = new Cursor(StandardCursorType.Hand), Child = tb };- void Sync() { bool on = P(p) >= 0.5f; b.Background = on ? KillSubtle : Brushes.Transparent; b.BorderBrush = on ? KillC : DetentC; tb.Foreground = on ? KillC : MutedC; }+ var b = new Border { BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Padding = new Thickness(0, 1), HorizontalAlignment = HorizontalAlignment.Stretch, Cursor = new Cursor(StandardCursorType.Hand), Child = tb };+ void Sync() { bool on = P(p) >= 0.5f; b.Background = on ? KillSubtle : Brushes.Transparent; b.BorderBrush = on ? NotaPalette.BorderBrass : DetentC; tb.Foreground = on ? KillC : MutedC; }b.PointerPressed += (_, e) => { e.Handled = true; Begin(p); SetP(p, P(p) >= 0.5f ? 0f : 1f); End(p); Sync(); SyncCurve(); };MidiLearn.Bind(b, MidiTarget.DeviceParam(track, di, p), "KILL");readouts.Add(Sync);@@ -111,7 +113,7 @@ internal sealed class Eq3DeviceBody : IDeviceBodyControl BandStrip(int idx, int gainP, int killP){var (name, span, hue) = Bands[idx];- var db = new TextBlock { Text = BandDb(P(gainP)), FontSize = 10, Foreground = TxtC, HorizontalAlignment = HorizontalAlignment.Center };+ var db = new TextBlock { Text = BandDb(P(gainP)), FontSize = 9, Foreground = TxtC, HorizontalAlignment = HorizontalAlignment.Center };db.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");readouts.Add(() => db.Text = BandDb(P(gainP)));var span2 = new TextBlock { Text = span, FontSize = 8, Foreground = MutedC, HorizontalAlignment = HorizontalAlignment.Center };@@ -122,41 +124,25 @@ internal sealed class Eq3DeviceBody : IDeviceBodycol.AddDock(KillBtn(killP), Dock.Bottom);col.AddDock(db, Dock.Bottom);col.Children.Add(new Border { Child = VFader(gainP, hue), Margin = new Thickness(0, 4) });- return new Border { Background = HdrBg, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Width = 84,- Child = new Border { BorderBrush = hue, BorderThickness = new Thickness(0, 2, 0, 0), CornerRadius = new CornerRadius(6, 6, 0, 0), Child = col } };+ return new Border { Background = HdrBg, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Width = 84,+ Child = new Border { BorderBrush = hue, BorderThickness = new Thickness(0, 2, 0, 0), CornerRadius = NotaRadius.Top(NotaRadius.PanelValue), Child = col } };}// Crossover slider (label + slider + Hz) for the CROSSOVER strip.Control Xover(int p, string label, IBrush hue, Func<double, string> fmt){- var fill = new Border { Height = 3, Background = Amber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var track2 = new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 8, Height = 9, Background = HandleC, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Height = 11, Width = 64, Children = { track2, fill, handle } };- var val = new TextBlock { Text = fmt(P(p)), FontSize = 9, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center, Width = 52, TextAlignment = TextAlignment.Right };- val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- bool drag = false;- void Upd() { double v = P(p); double W = slot.Bounds.Width; double hx = v * W; handle.Margin = new Thickness(Math.Clamp(hx - 4, 0, Math.Max(0, W - 8)), 0, 0, 0); fill.Width = hx; val.Text = fmt(v); }- void SetFromX(double x) { double v = Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1); SetP(p, (float)v); SyncCurve(); Upd(); }- slot.PointerPressed += (_, e) => { drag = true; e.Pointer.Capture(slot); Begin(p); SetFromX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetFromX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); End(p); } };- readouts.Add(() => { if (!drag) Upd(); });- var lab = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = hue, VerticalAlignment = VerticalAlignment.Center };- var host = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { lab, slot, val } };- MidiLearn.Bind(host, MidiTarget.DeviceParam(track, di, p), label);- return host;+ var row = DeviceCardKit.SliderRow(label, () => P(p), n => { SetP(p, (float)n); SyncCurve(); }, () => fmt(P(p)), out var sync,+ begin: () => Begin(p), end: () => End(p), trackWidth: 64, valueWidth: 52);+ readouts.Add(sync);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), label);+ return row;}// Slope segmented toggle (24 / 48 dB).Control SlopeSeg(){- var opts = new[] { "24 dB", "48 dB" }; var cells = new Border[2]; var texts = new TextBlock[2];- void Sync() { bool hi = P(Slope) >= 0.5f; for (int i = 0; i < 2; i++) { bool on = (i == 1) == hi; cells[i].Background = on ? AmberSubtle : Brushes.Transparent; cells[i].BorderBrush = on ? Amber : Brushes.Transparent; texts[i].Foreground = on ? AmberLit : MutedC; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < 2; i++) { int iv = i; var tb = new TextBlock { Text = opts[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = MutedC }; var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = tb }; c.PointerPressed += (_, e) => { e.Handled = true; SetP(Slope, iv == 1 ? 1f : 0f); SyncCurve(); Sync(); }; cells[i] = c; texts[i] = tb; row.Children.Add(c); }- readouts.Add(Sync);- var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ var seg = DeviceCardKit.Segments(new[] { "24\u2009dB", "48\u2009dB" }, () => P(Slope) >= 0.5f ? 1 : 0, i => { SetP(Slope, i == 1 ? 1f : 0f); SyncCurve(); }, out var sync);+ readouts.Add(sync);MidiLearn.Bind(seg, MidiTarget.DeviceParam(track, di, Slope), engine.DeviceParamName(track, di, Slope));return seg;}@@ -178,7 +164,7 @@ internal sealed class Eq3DeviceBody : IDeviceBodyvar stripsPanel = new Border { Width = 276, Child = strips };// ================= graph =================- var graph = new Border { Padding = new Thickness(0, 7, 8, 7), Child = new Border { Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Child = curve, ClipToBounds = true } };+ var graph = new Border { Padding = new Thickness(0, 7, 8, 7), Child = new Border { Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Child = curve, ClipToBounds = true } };// ================= assemble =================DockPanel.SetDock(stripsPanel, Dock.Left);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/EqDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/EqDeviceBody.csindex e9ef100d..5123de63 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/EqDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/EqDeviceBody.cs@@ -10,7 +10,8 @@ namespace Nota.App;internal sealed class EqDeviceBody : IDeviceBody{- public double Width => 520;+ public double Width => 700; // the almanac device format: 700 × 260+ public string? Subtitle => "EQUALIZER"; // the processing type, shown as the header badgepublic Control Build(DeviceCardContext ctx, int deviceIndex){diff --git a/src/managed/Nota.App/DeviceCards/Bodies/ForgeDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/ForgeDeviceBody.csindex e952d878..55fa8471 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/ForgeDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/ForgeDeviceBody.cs@@ -45,6 +45,8 @@ internal sealed class ForgeDeviceBody : IDeviceBodyprivate static readonly IBrush HandleC = NotaPalette.TextSecondary;public double Width => 700;++ public string? Subtitle => "SATURATION"; // the processing type, shown as the header badgepublic bool FullBleed => true;public Control Build(DeviceCardContext ctx, int index)@@ -66,24 +68,24 @@ internal sealed class ForgeDeviceBody : IDeviceBodyctx.AddDeviceRefresher(transfer.Tick);// ---- formatters ----- static string AmtF(double v) => $"+{v * 30:0.0} dB";- static string ToneF(double v) => $"{(v - 0.5) * 24:+0.0;-0.0;0.0} dB";- static string WetF(double v) => $"{v * 100:0} %";- static string BiasF(double v) => $"{(v - 0.5) * 200:+0;-0;0} %";- static string WidthF(double v) => $"{v * 200:0} %";- static string OutF(double v) => $"{(v - 0.5) * 24:+0.0;-0.0;0.0}";- static string PctF(double v) => $"{v * 100:0} %";- static string FbF(double v) => v < 0.005 ? "—" : $"{v * 100:0} %";- string RateF(double v) => P(LfoSync) >= 0.5f ? DivNames[Math.Clamp((int)Math.Round(v * 7), 0, 7)] + " sync" : $"{0.05 * Math.Pow(20 / 0.05, v):0.0} Hz";+ static string AmtF(double v) => $"+{v * 30:0.0}\u2009dB";+ static string ToneF(double v) => $"{(v - 0.5) * 24:+0.0;−0.0;0.0}\u2009dB";+ static string WetF(double v) => $"{v * 100:0}\u2009%";+ static string BiasF(double v) => $"{(v - 0.5) * 200:+0;−0;0}\u2009%";+ static string WidthF(double v) => $"{v * 200:0}\u2009%";+ static string OutF(double v) => $"{(v - 0.5) * 24:+0.0;−0.0;0.0}";+ static string PctF(double v) => $"{v * 100:0}\u2009%";+ static string FbF(double v) => v < 0.005 ? "—" : $"{v * 100:0}\u2009%";+ string RateF(double v) => P(LfoSync) >= 0.5f ? DivNames[Math.Clamp((int)Math.Round(v * 7), 0, 7)] + " sync" : $"{0.05 * Math.Pow(20 / 0.05, v):0.0}\u2009Hz";// ---- horizontal slider (label | slot | value) ----Control HRow(int p, string label, Func<double, string> fmt, double labW, double valW, bool teal = false, bool bipolar = false){var accent = teal ? TealC : Amber;- var fill = new Border { Height = 3, Background = accent, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var track2 = new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center };+ var fill = new Border { Height = 3, Background = accent, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var track2 = new Border { Height = 3, Background = Inset, CornerRadius = NotaRadius.Clip, VerticalAlignment = VerticalAlignment.Center };var center = bipolar ? new Border { Width = 1, Background = Dim, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Stretch, Margin = new Thickness(0, 1) } : null;- var handle = new Border { Width = 8, Height = 9, Background = HandleC, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var handle = new Border { Width = 8, Height = 9, Background = HandleC, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };var slot = new Panel { Height = 11, MinWidth = 30 }; slot.Children.Add(track2); if (center != null) slot.Children.Add(center); slot.Children.Add(fill); slot.Children.Add(handle);var val = new TextBlock { Text = fmt(P(p)), FontSize = 9, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center }; val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono"); if (valW > 0) { val.Width = valW; val.TextAlignment = TextAlignment.Right; }bool drag = false;@@ -104,9 +106,9 @@ internal sealed class ForgeDeviceBody : IDeviceBodyControl RoutingChips(){var cells = new Border[4]; var icons = new RoutingIcon[4]; var texts = new TextBlock[4];- void Sync() { int cur = Math.Clamp((int)Math.Round(P(Routing) * 3), 0, 3); for (int i = 0; i < 4; i++) { bool on = i == cur; cells[i].Background = on ? AmberSubtle : Brushes.Transparent; cells[i].BorderBrush = on ? Amber : Dim; icons[i].Color = on ? AmberLit : LabelC; texts[i].Foreground = on ? AmberLit : LabelC; } }+ void Sync() { int cur = Math.Clamp((int)Math.Round(P(Routing) * 3), 0, 3); for (int i = 0; i < 4; i++) { bool on = i == cur; cells[i].Background = on ? Amber : Brushes.Transparent; cells[i].BorderBrush = on ? Amber : Dim; icons[i].Color = on ? NotaPalette.TextOnAccent : LabelC; texts[i].Foreground = on ? NotaPalette.TextOnAccent : LabelC; } }var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2, VerticalAlignment = VerticalAlignment.Center };- for (int i = 0; i < 4; i++) { int iv = i; var ic = new RoutingIcon(i) { Width = 18, Height = 13, VerticalAlignment = VerticalAlignment.Center }; var tb = new TextBlock { Text = RouteNames[i], FontSize = 9, Foreground = LabelC, VerticalAlignment = VerticalAlignment.Center }; var c = new Border { Height = 22, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(5, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, VerticalAlignment = VerticalAlignment.Center, Children = { ic, tb } } }; c.PointerPressed += (_, e) => { e.Handled = true; SetP(Routing, iv / 3f); SyncViz(); Sync(); }; cells[i] = c; icons[i] = ic; texts[i] = tb; row.Children.Add(c); }+ for (int i = 0; i < 4; i++) { int iv = i; var ic = new RoutingIcon(i) { Width = 18, Height = 13, VerticalAlignment = VerticalAlignment.Center }; var tb = new TextBlock { Text = RouteNames[i], FontSize = 9, Foreground = LabelC, VerticalAlignment = VerticalAlignment.Center }; var c = new Border { Height = 22, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(5, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, VerticalAlignment = VerticalAlignment.Center, Children = { ic, tb } } }; c.PointerPressed += (_, e) => { e.Handled = true; SetP(Routing, iv / 3f); SyncViz(); Sync(); }; cells[i] = c; icons[i] = ic; texts[i] = tb; row.Children.Add(c); }readouts.Add(Sync);MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, Routing), engine.DeviceParamName(track, di, Routing));return row;@@ -115,27 +117,17 @@ internal sealed class ForgeDeviceBody : IDeviceBody// ---- oversampling quality selector (Off / 2× / 4× / 8×) ----Control OsChips(){- var cells = new Border[4]; var texts = new TextBlock[4];- void Sync() { int cur = Math.Clamp((int)Math.Round(P(OS) * 3), 0, 3); for (int i = 0; i < 4; i++) { bool on = i == cur; cells[i].Background = on ? AmberSubtle : Brushes.Transparent; cells[i].BorderBrush = on ? Amber : Dim; texts[i].Foreground = on ? AmberLit : LabelC; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2, VerticalAlignment = VerticalAlignment.Center };- for (int i = 0; i < 4; i++)- {- int iv = i;- var tb = new TextBlock { Text = OsNames[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = LabelC, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };- var c = new Border { Height = 20, MinWidth = 34, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Cursor = new Cursor(StandardCursorType.Hand), Child = tb };- c.PointerPressed += (_, e) => { e.Handled = true; Begin(OS); SetP(OS, iv / 3f); End(OS); Sync(); };- cells[i] = c; texts[i] = tb; row.Children.Add(c);- }- readouts.Add(Sync);- MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, OS), engine.DeviceParamName(track, di, OS));- return row;+ var seg = DeviceCardKit.Segments(OsNames, () => Math.Clamp((int)Math.Round(P(OS) * 3), 0, 3), i => { Begin(OS); SetP(OS, i / 3f); End(OS); }, out var sync, minSegWidth: 30);+ readouts.Add(sync);+ MidiLearn.Bind(seg, MidiTarget.DeviceParam(track, di, OS), engine.DeviceParamName(track, di, OS));+ return seg;}// ---- one stage row ----Control StageRow(int s){int baseP = S1Type + s * 5, typeP = baseP, driveP = baseP + 1, outP = baseP + 2, fbP = baseP + 3, onP = baseP + 4;- var dot = new Border { Width = 6, Height = 6, CornerRadius = new CornerRadius(3), VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand) };+ var dot = new Border { Width = 6, Height = 6, CornerRadius = NotaRadius.Badge, VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand) };var idx = new TextBlock { Text = (s + 1).ToString(), FontSize = 9, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center }; idx.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");var name = new TextBlock { FontSize = 9, FontWeight = FontWeight.SemiBold, VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand) };var outVal = new TextBlock { FontSize = 9, Foreground = LabelC, VerticalAlignment = VerticalAlignment.Center, TextAlignment = TextAlignment.Right, Width = 34 }; outVal.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");@@ -147,19 +139,19 @@ internal sealed class ForgeDeviceBody : IDeviceBodyvar line2 = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = {Cap("DRIVE", MutedC, 30),- new Border { Child = HRow(driveP, "", PctF, 0, 0), Width = 78, VerticalAlignment = VerticalAlignment.Center },- Cap("FB", TealC, 14),- new Border { Child = HRow(fbP, "", FbF, 0, 0, teal: true), Width = 40, VerticalAlignment = VerticalAlignment.Center },+ new Border { Child = HRow(driveP, "", PctF, 0, 0), Width = 58, VerticalAlignment = VerticalAlignment.Center },+ Cap("FEEDBACK", TealC, 42),+ new Border { Child = HRow(fbP, "", FbF, 0, 0, teal: true), Width = 32, VerticalAlignment = VerticalAlignment.Center },fbVal } };- var border = new Border { BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(7, 4), Background = RailBg, BorderBrush = Border2,+ var border = new Border { BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Padding = new Thickness(7, 4), Background = RailBg, BorderBrush = Border2,Child = new StackPanel { Spacing = 3, VerticalAlignment = VerticalAlignment.Center, Children = { headRow, line2 } } };// out trim: drag on the out value (vertical) — quick, keeps line1 compact.bool od = false; double oy = 0;outVal.Cursor = new Cursor(StandardCursorType.SizeNorthSouth);outVal.PointerPressed += (_, e) => { od = true; oy = e.GetPosition(outVal).Y; Begin(outP); e.Pointer.Capture(outVal); e.Handled = true; };- outVal.PointerMoved += (_, e) => { if (od) { double dy = oy - e.GetPosition(outVal).Y; oy = e.GetPosition(outVal).Y; SetP(outP, (float)Math.Clamp(P(outP) + dy * 0.01, 0, 1)); SyncViz(); outVal.Text = OutF(P(outP)) + " dB"; } };+ outVal.PointerMoved += (_, e) => { if (od) { double dy = oy - e.GetPosition(outVal).Y; oy = e.GetPosition(outVal).Y; SetP(outP, (float)Math.Clamp(P(outP) + dy * 0.01, 0, 1)); SyncViz(); outVal.Text = OutF(P(outP)) + "\u2009dB"; } };outVal.PointerReleased += (_, e) => { if (od) { od = false; End(outP); e.Pointer.Capture(null); } };dot.PointerPressed += (_, e) => { e.Handled = true; Begin(onP); SetP(onP, P(onP) >= 0.5f ? 0f : 1f); End(onP); SyncViz(); };@@ -168,11 +160,11 @@ internal sealed class ForgeDeviceBody : IDeviceBodyreadouts.Add(() =>{bool on = P(onP) >= 0.5f;- border.Opacity = on ? 1.0 : 0.5;dot.Background = on ? Amber : Dim;+ Inactive.Set(border, !on, interactive: true);int t = Math.Clamp((int)Math.Round(P(typeP) * (ForgeMath.Algos - 1)), 0, ForgeMath.Algos - 1);name.Text = ForgeMath.AlgoNames[t]; name.Foreground = on ? TxtC : MutedC;- outVal.Text = OutF(P(outP)) + " dB";+ outVal.Text = OutF(P(outP)) + "\u2009dB";fbVal.Text = FbF(P(fbP));});// Stage algorithm (click the name to cycle) and on/off dot are discrete params too.@@ -183,13 +175,8 @@ internal sealed class ForgeDeviceBody : IDeviceBodyControl MiniToggle(int p, string label){- var knob = new Border { Width = 6, Height = 6, CornerRadius = new CornerRadius(3), Background = HdrBg, HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 1.5, 0) };- var sw = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), Cursor = new Cursor(StandardCursorType.Hand), Child = knob };- var tb = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = TealC, VerticalAlignment = VerticalAlignment.Center };- void Sync() { bool on = P(p) >= 0.5f; sw.Background = on ? TealC : Dim; knob.HorizontalAlignment = on ? HorizontalAlignment.Right : HorizontalAlignment.Left; knob.Margin = on ? new Thickness(0, 0, 1.5, 0) : new Thickness(1.5, 0, 0, 0); tb.Text = P(LfoSync) >= 0.5f ? "SYNC" : "FREE"; }- sw.PointerPressed += (_, e) => { e.Handled = true; SetP(p, P(p) >= 0.5f ? 0f : 1f); Sync(); };- readouts.Add(Sync);- var host = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { sw, tb } };+ var host = Switch(label, () => P(p) >= 0.5f, () => SetP(p, P(p) >= 0.5f ? 0f : 1f), out var sync);+ readouts.Add(sync);MidiLearn.Bind(host, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));return host;}@@ -229,8 +216,8 @@ internal sealed class ForgeDeviceBody : IDeviceBodyvar mod = new Border { BorderBrush = TealC, BorderThickness = new Thickness(2, 0, 0, 0), Padding = new Thickness(6, 0, 0, 0), Margin = new Thickness(0, 2, 0, 0),Child = new StackPanel { Spacing = 4, Children = {Cap("MODULATION", TealC),- HRow(LfoDrive, "LFO → DRV", PctF, 52, 40, teal: true),- HRow(EnvTone, "ENV → TONE", PctF, 52, 40, teal: true),+ HRow(LfoDrive, "LFO → DRIVE", PctF, 60, 32, teal: true),+ HRow(EnvTone, "ENV → TONE", PctF, 60, 32, teal: true),HRow(LfoRate, "RATE", RateF, 34, 52, teal: true),MiniToggle(LfoSync, "SYNC") } } };var quality = new StackPanel { Spacing = 4, Children = {@@ -261,7 +248,7 @@ internal sealed class ForgeDeviceBody : IDeviceBodyinternal sealed class RoutingIcon : Control{private readonly int _kind;- private IBrush _color = Brushes.Gray;+ private IBrush _color = NotaPalette.TextTertiary;public IBrush Color { get => _color; set { _color = value; InvalidateVisual(); } }public RoutingIcon(int kind) { _kind = kind; }diff --git a/src/managed/Nota.App/DeviceCards/Bodies/PluginDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/PluginDeviceBody.csindex 55abab68..d6d335c5 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/PluginDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/PluginDeviceBody.cs@@ -25,14 +25,14 @@ internal sealed class PluginDeviceBody : IDeviceBodyvar open = new Border{Background = Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(5), Padding = new Thickness(12, 4), HorizontalAlignment = HorizontalAlignment.Center,+ CornerRadius = NotaRadius.Tile, Padding = new Thickness(12, 4), HorizontalAlignment = HorizontalAlignment.Center,Cursor = new Cursor(StandardCursorType.Hand),- Child = new TextBlock { Text = "Open editor ↗", FontSize = 11, Foreground = TextPrimary },+ Child = new TextBlock { Text = "Open editor ↗", FontSize = 9, Foreground = TextPrimary },};open.PointerPressed += (_, _) => { try { engine.OpenPluginEditor(track, index); } catch { /* no-op */ } };double ms = engine.SampleRate > 0 ? engine.TrackLatencySamples(track) / engine.SampleRate * 1000.0 : 0;- var latency = new TextBlock { Text = $"latency {ms:0.0} ms — compensated", FontSize = 9, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center };+ var latency = new TextBlock { Text = $"latency {ms:0.0}\u2009ms — compensated", FontSize = 9, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center };latency.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");var body = new StackPanel@@ -40,7 +40,7 @@ internal sealed class PluginDeviceBody : IDeviceBodySpacing = 8, VerticalAlignment = VerticalAlignment.Center,Children ={- new TextBlock { Text = "Hosted plug-in — native GUI in own window", FontSize = 10, Foreground = TextTertiary, TextWrapping = TextWrapping.Wrap, TextAlignment = TextAlignment.Center },+ new TextBlock { Text = "Hosted plug-in — native GUI in own window", FontSize = 9, Foreground = TextTertiary, TextWrapping = TextWrapping.Wrap, TextAlignment = TextAlignment.Center },open, latency,},};diff --git a/src/managed/Nota.App/DeviceCards/Bodies/PrismDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/PrismDeviceBody.csindex d8c3cb6f..e404eded 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/PrismDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/PrismDeviceBody.cs@@ -37,7 +37,7 @@ internal sealed class PrismDeviceBody : IDeviceBodyprivate const int TraceLen = 256;private static readonly IBrush RailBg = NotaPalette.SurfaceInset;- private static readonly IBrush Panel = NotaPalette.BgApp;+ private static readonly IBrush Panel = NotaPalette.TextOnAccent; // dark ink over an engaged fillprivate static readonly IBrush Border2 = NotaPalette.BorderDefault;private static readonly IBrush BorderIn = PrismInk.InnerBorder;private static readonly IBrush Inset = NotaPalette.BgSunken;@@ -98,21 +98,21 @@ internal sealed class PrismDeviceBody : IDeviceBodystatic double ThrB(double v) => -80 + 80 * v;static double RatioB(double v) => Math.Pow(4, (v - 0.5) * 2);static double XHz(double v) => Exp(v, 20, 20000);- static string Inv(FormattableString f) => FormattableString.Invariant(f);- static string DbF(double db) => Math.Abs(db) < 0.05 ? "0.0 dB" : Inv($"{db:+0.0;−0.0} dB");+ static string Inv(FormattableString f) => NotaNum.F(f);+ static string DbF(double db) => Math.Abs(db) < 0.05 ? "0.0\u2009dB" : Inv($"{db:+0.0;−0.0}\u2009dB");static string DbShort(double db) => Math.Abs(db) < 0.05 ? "0.0" : Inv($"{db:+0.0;−0.0}");- static string ThrF(double db) => Inv($"{db:0;−0} dB");+ static string ThrF(double db) => Inv($"{db:0.0}\u2009dB");static string RatioAF(double v) { if (v >= 0.999) return "∞ : 1"; double r = 1 / (1 - v); return r < 10 ? Inv($"{r:0.0#} : 1") : Inv($"{r:0} : 1"); }static string RatioAShort(double v) { if (v >= 0.999) return "∞:1"; double r = 1 / (1 - v); return r < 10 ? Inv($"{r:0.#}:1") : Inv($"{r:0}:1"); }static string RatioBF(double v) { double r = RatioB(v); return Math.Abs(r - 1) < 0.01 ? "1 : 1" : r > 1 ? Inv($"{r:0.0#} : 1") : Inv($"↑ {1 / r:0.0#} : 1"); }static string RatioBShort(double v) { double r = RatioB(v); return Math.Abs(r - 1) < 0.01 ? "1:1" : r > 1 ? Inv($"{r:0.0#}") : Inv($"↑{1 / r:0.0}"); }- static string Ms(double ms) => ms >= 1000 ? Inv($"{ms / 1000:0.00} s") : ms >= 10 ? Inv($"{ms:0} ms") : Inv($"{ms:0.0} ms");+ static string Ms(double ms) => ms >= 1000 ? Inv($"{ms / 1000:0.00}\u2009s") : ms >= 10 ? Inv($"{ms:0}\u2009ms") : Inv($"{ms:0.0}\u2009ms");static string AtkF(double v) => Ms(Exp(v, 0.1, 300));static string RelF(double v) => Ms(Exp(v, 5, 3000));static string GainF(double v) => DbF((v - 0.5) * 48);- static string HzF(double hz) => hz >= 1000 ? Inv($"{hz / 1000:0.0#} kHz") : Inv($"{hz:0} Hz");- static string Pct(double v) => Inv($"{v * 100:0} %");- string FloorF(int b) => RatioB(P(BP(b, BelowRatio))) < 1 ? Inv($"+{P(BP(b, Floor)) * 48:0} dB") : Inv($"−{P(BP(b, Floor)) * 48:0} dB");+ static string HzF(double hz) => hz >= 1000 ? Inv($"{hz / 1000:0.0}\u2009k") : Inv($"{hz:0}\u2009Hz");+ static string Pct(double v) => Inv($"{v * 100:0}\u2009%");+ string FloorF(int b) => RatioB(P(BP(b, BelowRatio))) < 1 ? Inv($"+{P(BP(b, Floor)) * 48:0.0}\u2009dB") : Inv($"−{P(BP(b, Floor)) * 48:0.0}\u2009dB");// ---- small builders ---------------------------------------------------------static TextBlock Caps(string t, IBrush? c = null, double fs = 7) => new() { Text = t, FontSize = fs, FontWeight = FontWeight.Bold, Foreground = c ?? MutedC, LetterSpacing = 0.8, VerticalAlignment = VerticalAlignment.Center };@@ -140,21 +140,8 @@ internal sealed class PrismDeviceBody : IDeviceBody// On/off pill bound to a param (> 0.5 = on).Control Toggle(int p, string label, Func<string>? dynLabel = null){- var pill = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), VerticalAlignment = VerticalAlignment.Center };- var dot = new Border { Width = 7, Height = 7, CornerRadius = new CornerRadius(4) };- var host = new Canvas { Width = 18, Height = 10 }; Canvas.SetTop(dot, 1.5); host.Children.Add(dot); pill.Child = host;- var txt = new TextBlock { Text = label, FontSize = 8, VerticalAlignment = VerticalAlignment.Center };- void Hi()- {- bool on = On(p);- pill.Background = on ? Amber : OffPill; dot.Background = on ? Panel : MutedC;- Canvas.SetLeft(dot, on ? 9.5 : 1.5); txt.Foreground = on ? TxtC : Txt2;- if (dynLabel != null) txt.Text = dynLabel();- }- var wrap = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Children = { pill } };- if (label.Length > 0 || dynLabel != null) wrap.Children.Add(txt);- wrap.PointerPressed += (_, e) => { if (!e.GetCurrentPoint(wrap).Properties.IsLeftButtonPressed) return; SetP(p, On(p) ? 0f : 1f); Hi(); e.Handled = true; };- readouts.Add(Hi); Hi();+ var wrap = Switch(label, () => On(p), () => SetP(p, On(p) ? 0f : 1f), out var sync, liveLabel: dynLabel);+ readouts.Add(sync);Learn(wrap, p);return wrap;}@@ -162,27 +149,9 @@ internal sealed class PrismDeviceBody : IDeviceBody// Segmented chips over a discrete param (n options spread over 0..1).Control Seg(int p, string[] names, Action? changed = null){- int n = names.Length; var cells = new Border[n];- void Hi()- {- int cur = Sel(p, n);- for (int i = 0; i < n; i++)- {- bool on = i == cur;- cells[i].Background = on ? Amber : Brushes.Transparent;- var tb = (TextBlock)cells[i].Child!; tb.Foreground = on ? Panel : MutedC; tb.FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal;- }- }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++)- {- int iv = i;- var c = new Border { CornerRadius = new CornerRadius(2), Padding = new Thickness(4, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 7, Foreground = MutedC } };- c.PointerPressed += (_, e) => { SetP(p, n > 1 ? iv / (float)(n - 1) : 0f); Hi(); changed?.Invoke(); e.Handled = true; };- cells[i] = c; row.Children.Add(c);- }- readouts.Add(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Left, Child = row };+ int n = names.Length;+ var seg = DeviceCardKit.Segments(names, () => Sel(p, n), iv => { SetP(p, n > 1 ? iv / (float)(n - 1) : 0f); changed?.Invoke(); }, out var sync);+ readouts.Add(sync);Learn(seg, p);return seg;}@@ -190,37 +159,12 @@ internal sealed class PrismDeviceBody : IDeviceBody// Horizontal bar slider over a param, with a mono readout on the right.Control Bar(int p, Func<double, string> fmt, Func<IBrush> fillC, Func<bool>? dim = null, double valW = 30, Func<IBrush>? valC = null){- var fill = new Border { Height = 3, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 6, Height = 7, CornerRadius = new CornerRadius(2) };- var lay = new Canvas { Height = 9 };- lay.Children.Add(handle); Canvas.SetTop(handle, 1);- var canvas = new Avalonia.Controls.Panel { Height = 11, MinWidth = 20, Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Children = {- new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center }, fill, lay } };- var val = Mono("", 8, TxtC); val.Width = valW; val.TextAlignment = TextAlignment.Right; val.TextTrimming = TextTrimming.None;- bool drag = false;- void Vis()- {- double v = Math.Clamp(P(p), 0, 1), w = canvas.Bounds.Width; if (w <= 0) w = 60;- fill.Width = Math.Max(0, v * w); Canvas.SetLeft(handle, v * w - 3); val.Text = fmt(v);- bool d = dim?.Invoke() ?? false;- fill.Background = d ? NotaPalette.BorderStrong : fillC(); handle.Background = d ? MutedC : Txt2;- val.Foreground = d ? MutedC : valC?.Invoke() ?? TxtC;- }- void From(PointerEventArgs e) { double w = canvas.Bounds.Width; Raw(p, (float)(w > 0 ? Math.Clamp(e.GetPosition(canvas).X / w, 0, 1) : 0)); Vis(); }- canvas.PointerPressed += (_, e) =>- {- if (!e.GetCurrentPoint(canvas).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { SetP(p, Def(p)); Vis(); e.Handled = true; return; }- drag = true; Begin(p); e.Pointer.Capture(canvas); From(e); e.Handled = true;- };- canvas.PointerMoved += (_, e) => { if (drag) From(e); };- canvas.PointerReleased += (_, e) => { if (drag) { drag = false; End(p); e.Pointer.Capture(null); } };- canvas.SizeChanged += (_, _) => Vis();- readouts.Add(() => { if (!drag && canvas.IsEffectivelyVisible) Vis(); });- var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center };- grid.Children.Add(canvas); grid.Children.Add(Col(val, 1));- Learn(grid, p);- return grid;+ var row = DeviceCardKit.SliderRow("", () => Math.Clamp(P(p), 0, 1), n => Raw(p, (float)n), () => fmt(Math.Clamp(P(p), 0, 1)), out var sync,+ begin: () => Begin(p), end: () => End(p), reset: () => SetP(p, Def(p)),+ dim: dim, valueWidth: valW);+ readouts.Add(() => { if (row.IsEffectivelyVisible) sync(); });+ Learn(row, p);+ return row;}Control SliderRow(string label, int p, Func<double, string> fmt, double labW = 50, double valW = 30){@@ -254,7 +198,7 @@ internal sealed class PrismDeviceBody : IDeviceBodyvar name = new TextBlock { Text = PrismInk.Names[b], FontSize = 9, VerticalAlignment = VerticalAlignment.Center };readouts.Add(() => { bool s = band == b; name.Foreground = s ? PrismInk.BandLit[b] : TxtC; name.FontWeight = s ? FontWeight.SemiBold : FontWeight.Normal; });return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = {- new Border { Width = 3, Height = barH, CornerRadius = new CornerRadius(2), Background = PrismInk.Band[b] }, name } };+ new Border { Width = 3, Height = barH, CornerRadius = NotaRadius.Clip, Background = PrismInk.Band[b] }, name } };}// A clickable table row for band b: selects the band; dimmed + inert when the band is off.@@ -267,7 +211,7 @@ internal sealed class PrismDeviceBody : IDeviceBody{bool act = BandActive(b);row.Background = band == b && act ? RowSel : Brushes.Transparent;- row.Opacity = act ? 1 : 0.32; row.IsHitTestVisible = act;+ Inactive.Set(row, !act);});return row;}@@ -292,9 +236,9 @@ internal sealed class PrismDeviceBody : IDeviceBodyreadouts.Add(() => { amtTxt.Text = Pct(P(Amount)); outTxt.Text = DbShort((P(Output) - 0.5) * 48); });var globTitle = Caps("GLOBAL"); globTitle.HorizontalAlignment = HorizontalAlignment.Center;var faders = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto"), ColumnSpacing = 9, HorizontalAlignment = HorizontalAlignment.Center, Margin = new Thickness(0, 4, 0, 3) };- faders.Children.Add(Fader(Amount, "AMT", "Amount — scales every band's compression and expansion (0 % = none). Double-click: 100 %"));- faders.Children.Add(Col(Fader(Output, "OUT", "Output gain ±24 dB — double-click: 0 dB"), 1));- var globCol = new Border { Width = 56, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(0, 5, 0, 4),+ faders.Children.Add(Fader(Amount, "AMOUNT", "Amount — scales every band's compression and expansion (0\u2009% = none). Double-click: 100\u2009%"));+ faders.Children.Add(Col(Fader(Output, "OUT", "Output gain ±24\u2009dB — double-click: 0\u2009dB"), 1));+ var globCol = new Border { Width = 56, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Padding = new Thickness(0, 5, 0, 4),Child = new DockPanel { Children = { Docked(globTitle, Dock.Top), Docked(outTxt, Dock.Bottom), Docked(amtTxt, Dock.Bottom), faders } } };DockPanel.SetDock(globCol, Dock.Left);@@ -339,9 +283,9 @@ internal sealed class PrismDeviceBody : IDeviceBodyToolTip.SetTip(below, "Expansion / upward-compression threshold · ratio — click the readout to switch it on or off");g.Children.Add(Col(below, 2));var gain = DragVal(BP(bb, Gain), v => DbShort((v - 0.5) * 48), () => Math.Abs(P(BP(bb, Gain)) - 0.5f) < 0.001f ? Txt2 : TxtC);- ToolTip.SetTip(gain, "Band gain ±24 dB — drag up / down, double-click resets");+ ToolTip.SetTip(gain, "Band gain ±24\u2009dB — drag up / down, double-click resets");g.Children.Add(Col(gain, 3));- var grTrack = new Border { Width = 32, Height = 4, CornerRadius = new CornerRadius(2), Background = Inset, HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center, ClipToBounds = true };+ var grTrack = new Border { Width = 32, Height = 4, CornerRadius = NotaRadius.Clip, Background = Inset, HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center, ClipToBounds = true };var grFill = new Border { Background = PrismInk.Band[bb], HorizontalAlignment = HorizontalAlignment.Right };grTrack.Child = grFill;readouts.Add(() => grFill.Width = 32 * Math.Clamp(Sc(S_Gr0 + bb) / 12, 0, 1));@@ -391,14 +335,14 @@ internal sealed class PrismDeviceBody : IDeviceBodyvar trCap = Caps("TRANSFER · " + PrismInk.Names[b].ToUpperInvariant());var kneeRow = new Grid { ColumnDefinitions = new ColumnDefinitions("32,*"), Margin = new Thickness(0, 4, 0, 0) };kneeRow.Children.Add(Caps("KNEE"));- kneeRow.Children.Add(Col(Bar(BP(b, Knee), v => Inv($"{v * 24:0.#} dB"), () => PrismInk.Band[b], null, 32), 1));+ kneeRow.Children.Add(Col(Bar(BP(b, Knee), v => Inv($"{v * 24:0.0}\u2009dB"), () => PrismInk.Band[b], null, 32), 1));var left = new Border { Width = 150, BorderBrush = BorderIn, BorderThickness = new Thickness(0, 0, 1, 0), Padding = new Thickness(7, 5),Child = new DockPanel { Children = { Docked(trCap, Dock.Top), Docked(kneeRow, Dock.Bottom), new Border { Margin = new Thickness(0, 4, 0, 0), Child = tr } } } };// ABOVE — compressionvar aCap = Caps("ABOVE — COMPRESSION", PrismInk.BandLit[b]);var aGr = Mono("", 7, Txt2); aGr.HorizontalAlignment = HorizontalAlignment.Right;- readouts.Add(() => { double gr = Sc(S_Gr0 + b); aGr.Text = gr > 0.05 ? Inv($"GR −{gr:0.0} dB") : "GR 0.0 dB"; });+ readouts.Add(() => { double gr = Sc(S_Gr0 + b); aGr.Text = gr > 0.05 ? Inv($"GR −{gr:0.0}\u2009dB") : "GR 0.0\u2009dB"; });var aHead = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), Height = 11 };aHead.Children.Add(aCap); aHead.Children.Add(Col(aGr, 1));var aKnobs = new UniformGrid { Rows = 1, VerticalAlignment = VerticalAlignment.Center };@@ -421,7 +365,7 @@ internal sealed class PrismDeviceBody : IDeviceBodybKnobs.Children.Add(K(BP(b, BelowAttack), "ATTACK", AtkF, 36, 52, Mauve));bKnobs.Children.Add(K(BP(b, BelowRelease), "RELEASE", RelF, 36, 52, Mauve));bKnobs.Children.Add(K(BP(b, Floor), "FLOOR", _ => FloorF(b), 36, 52, Mauve));- readouts.Add(() => bKnobs.Opacity = On(BP(b, BelowOn)) ? 1 : 0.45);+ readouts.Add(() => Inactive.Set(bKnobs, !On(BP(b, BelowOn)), interactive: true));ToolTip.SetTip(bKnobs, "Ratio above 1 : 1 expands (quiet parts get quieter); below 1 : 1 (↑) compresses upward (quiet parts are lifted). Floor limits either to ± that many dB.");var bSec = Divider(new DockPanel { Children = { Docked(bHead, Dock.Top), bKnobs } }, 4);@@ -455,7 +399,7 @@ internal sealed class PrismDeviceBody : IDeviceBodyint m = engine.DeviceLayerWave(track, di, 3 + band * 2, tDet, TraceLen);trace.Set(tIn, tDet, Math.Min(n, m), band, ThrA(P(BP(band, AboveThresh))), On(BP(band, BelowOn)), ThrB(P(BP(band, BelowThresh))));});- ToolTip.SetTip(trace, "The selected band's input peaks (grey) and what its compressor's detector makes of them (the last ~1.5 s), against the threshold.");+ ToolTip.SetTip(trace, "The selected band's input peaks (grey) and what its compressor's detector makes of them (the last ~1.5\u2009s), against the threshold.");const string cols = "50,*,*,40";var head = new Grid { ColumnDefinitions = new ColumnDefinitions(cols), Height = 11 };var hA = Caps("ATTACK", DimC); hA.HorizontalAlignment = HorizontalAlignment.Center;@@ -504,7 +448,7 @@ internal sealed class PrismDeviceBody : IDeviceBodyval.Text = !act ? "—" : bo > gr + 0.05 ? Inv($"+{bo:0.0}") : gr > 0.05 ? Inv($"−{gr:0.0}") : "0.0";val.Foreground = band == bb ? PrismInk.BandLit[bb] : PrismInk.Band[bb];nm.Foreground = band == bb ? PrismInk.BandLit[bb] : MutedC;- m.Opacity = act ? 1 : 0.3;+ Inactive.Set(m, !act, interactive: true);});var col = new DockPanel { Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Children = { Docked(nm, Dock.Bottom), Docked(val, Dock.Bottom), m } };((Control)val).Margin = new Thickness(0, 3, 0, 1);@@ -524,8 +468,8 @@ internal sealed class PrismDeviceBody : IDeviceBodyfor (int i = 0; i < 3; i++){bool on = s == i, act = BandActive(i);- soloCells[i].Background = on ? AmberSubtle : OffPill; soloCells[i].BorderBrush = on ? Amber : Brushes.Transparent;- var t = (TextBlock)soloCells[i].Child!; t.Foreground = on ? AmberLit : act ? Txt2 : DimC; t.FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal;+ soloCells[i].Background = on ? Amber : OffPill; soloCells[i].BorderBrush = on ? Amber : Brushes.Transparent;+ var t = (TextBlock)soloCells[i].Child!; t.Foreground = on ? NotaPalette.TextOnAccent : act ? Txt2 : DimC; t.FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal;}soloTxt.Text = s >= 0 && BandActive(s) ? PrismInk.Names[s].ToLowerInvariant() : "none"; soloTxt.Foreground = s >= 0 ? AmberLit : MutedC;}@@ -534,7 +478,7 @@ internal sealed class PrismDeviceBody : IDeviceBodyfor (int i = 0; i < 3; i++){int iv = i;- var c = new Border { Height = 15, Padding = new Thickness(6, 0), CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand),+ var c = new Border { Height = 15, Padding = new Thickness(6, 0), CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = sl[i], FontSize = 8, VerticalAlignment = VerticalAlignment.Center } };c.PointerPressed += (_, e) =>{@@ -580,9 +524,9 @@ internal sealed class PrismDeviceBody : IDeviceBodyscName.Text = !scOk ? "n/a in a rack" : src < 0 ? "None — own input" : SrcName(src);scName.Foreground = src >= 0 ? TxtC : Txt2;});- var scBox = new Border { Height = 16, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(6, 0),+ var scBox = new Border { Height = 16, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Padding = new Thickness(6, 0),Cursor = new Cursor(StandardCursorType.Hand), IsEnabled = scOk,- Child = new DockPanel { Children = { Docked(new TextBlock { Text = "▾", FontSize = 8, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(5, 0, 0, 0) }, Dock.Right), scName } } };+ Child = new DockPanel { Children = { Docked(new Glyph(GlyphKind.ChevronDown, 8) { Foreground = MutedC, Margin = new Thickness(5, 0, 0, 0) }, Dock.Right), scName } } };ToolTip.SetTip(scBox, "Sidechain — key every band's detector from another track (split into the same bands)");scBox.PointerPressed += (_, e) =>{@@ -608,23 +552,23 @@ internal sealed class PrismDeviceBody : IDeviceBodyvar listen = Toggle(ScListen, "Listen");ToolTip.SetTip(listen, "Listen — hear the detector's key signal (the sidechain, or the input), per solo band");var mk = Toggle(AutoMakeup, "Auto makeup");- ToolTip.SetTip(mk, "Auto makeup — each band gets back about half of its compression at 0 dBFS");+ ToolTip.SetTip(mk, "Auto makeup — each band gets back about half of its compression at 0\u2009dBFS");var toggles = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), ColumnSpacing = 10 };toggles.Children.Add(listen); toggles.Children.Add(Col(mk, 1));var mid = new StackPanel { Spacing = 5, Children = {- SliderRow("LOOKAHEAD", Lookahead, v => Inv($"{v * 10:0.0} ms")),+ SliderRow("LOOKAHEAD", Lookahead, v => Inv($"{v * 10:0.0}\u2009ms")),SliderRow("MIX", Mix, Pct), scRow, toggles } };var clipTxt = Mono("", 7, TxtC); clipTxt.HorizontalAlignment = HorizontalAlignment.Right;readouts.Add(() =>{double c = Sc(S_ClipDb);- clipTxt.Text = On(SoftClip) && c > 0.05 ? Inv($"−0.3 dBFS · {c:0.0}") : "−0.3 dBFS";+ clipTxt.Text = On(SoftClip) && c > 0.05 ? Inv($"−0.3\u2009dBFS · {c:0.0}") : "−0.3\u2009dBFS";clipTxt.Foreground = On(SoftClip) ? (c > 0.05 ? NotaPalette.Warning : TxtC) : MutedC;});var clipRow = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,*"), ColumnSpacing = 6 };var clipSeg = Seg(SoftClip, new[] { "Off", "On" });- ToolTip.SetTip(clipSeg, "Soft clip — a smooth ceiling at −0.3 dBFS after the output gain");+ ToolTip.SetTip(clipSeg, "Soft clip — a smooth ceiling at −0.3\u2009dBFS after the output gain");clipRow.Children.Add(Caps("SOFT CLIP")); clipRow.Children.Add(Col(clipSeg, 1)); clipRow.Children.Add(Col(clipTxt, 2));var midB = Divider(mid); midB.Margin = new Thickness(0, 4, 0, 0);return new DockPanel { LastChildFill = false, Margin = new Thickness(8, 5, 8, 5), Children = {@@ -641,7 +585,7 @@ internal sealed class PrismDeviceBody : IDeviceBodyControl ModeExtras(){var seg = Seg(BandsP, new[] { "3", "2", "1" }, () => { if (!BandActive(band)) SelectBand(1); foreach (var a in readouts) a(); });- ToolTip.SetTip(seg, "Bands — 3: Low / Mid / High · 2: Low + Mid (Mid runs to 20 kHz) · 1: Mid, full band");+ ToolTip.SetTip(seg, "Bands — 3: Low / Mid / High · 2: Low + Mid (Mid runs to 20\u2009kHz) · 1: Mid, full band");return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, Children = { Caps("MODE"), seg } };}Control BandChips()@@ -661,7 +605,7 @@ internal sealed class PrismDeviceBody : IDeviceBodyfor (int i = 0; i < 3; i++){int iv = i;- var c = new Border { Height = 15, Padding = new Thickness(6, 0), CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand),+ var c = new Border { Height = 15, Padding = new Thickness(6, 0), CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = PrismInk.Names[i], FontSize = 8, VerticalAlignment = VerticalAlignment.Center } };c.PointerPressed += (_, e) => { SelectBand(iv); e.Handled = true; };cells[i] = c; chips.Children.Add(c);@@ -672,7 +616,7 @@ internal sealed class PrismDeviceBody : IDeviceBodyControl DetectExtras(){var seg = Seg(Detect, new[] { "Peak", "RMS" });- ToolTip.SetTip(seg, "Detector — Peak follows every transient; RMS (10 ms) follows loudness, smoother");+ ToolTip.SetTip(seg, "Detector — Peak follows every transient; RMS (10\u2009ms) follows loudness, smoother");return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, Children = { Caps("DETECT"), seg } };}var extrasBodies = new Control?[3];@@ -688,9 +632,9 @@ internal sealed class PrismDeviceBody : IDeviceBody{view = (band, view.Centre, t); ViewState[(track, di)] = view; foreach (var a in readouts) a();}, null);- var right = new Border { Width = 186, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), ClipToBounds = true, Child = rightFrame };+ var right = new Border { Width = 186, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, ClipToBounds = true, Child = rightFrame };DockPanel.SetDock(right, Dock.Right);- var centreBox = new Border { Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Margin = new Thickness(5, 0), ClipToBounds = true, Child = centre };+ var centreBox = new Border { Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Margin = new Thickness(5, 0), ClipToBounds = true, Child = centre };// ======================================================================// Status strip@@ -708,8 +652,8 @@ internal sealed class PrismDeviceBody : IDeviceBody{int b = band;string head = solo == b ? Inv($"{PrismInk.Names[b]} solo") : PrismInk.Names[b];- string below = On(BP(b, BelowOn)) ? Inv($"below {ThrB(P(BP(b, BelowThresh))):0;−0} dB {RatioBF(P(BP(b, BelowRatio))).Replace(" ", "")}") : "below off";- return Inv($"{head} · above {ThrA(P(BP(b, AboveThresh))):0;−0} dB {RatioAF(P(BP(b, AboveRatio))).Replace(" ", "")} · {below} · knee {P(BP(b, Knee)) * 24:0.#} dB");+ string below = On(BP(b, BelowOn)) ? Inv($"below {ThrB(P(BP(b, BelowThresh))):0;−0}\u2009dB {RatioBF(P(BP(b, BelowRatio))).Replace(" ", "")}") : "below off";+ return Inv($"{head} · above {ThrA(P(BP(b, AboveThresh))):0;−0}\u2009dB {RatioAF(P(BP(b, AboveRatio))).Replace(" ", "")} · {below} · knee {P(BP(b, Knee)) * 24:0.#}\u2009dB");}case 2:{@@ -728,9 +672,9 @@ internal sealed class PrismDeviceBody : IDeviceBodystatusLeft.Text = StatusText();statusLeft.Foreground = (centreTab == 1 && Sel(Solo, 4) - 1 == band) || On(ScListen) ? AmberLit : Txt2;double sr = Sc(S_SampleRate), lat = Sc(S_Latency);- string la = lat > 0 && sr > 0 ? Inv($"lookahead {lat * 1000 / sr:0.#} ms") : "no lookahead";+ string la = lat > 0 && sr > 0 ? Inv($"lookahead {lat * 1000 / sr:0.#}\u2009ms") : "no lookahead";string sc = Sc(S_ScActive) > 0.5 ? " · SC" : "";- statusRight.Text = sr > 0 ? Inv($"{sr / 1000:0.#} kHz · {la}{sc} · CPU {Sc(S_Cpu) * 100:0.0} %") : "";+ statusRight.Text = sr > 0 ? Inv($"{sr / 1000:0.#}\u2009kHz · {la}{sc} · CPU {Sc(S_Cpu) * 100:0}\u2009%") : "";});var statusGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), ColumnSpacing = 8 };statusGrid.Children.Add(statusLeft); statusGrid.Children.Add(Col(statusRight, 1));diff --git a/src/managed/Nota.App/DeviceCards/Bodies/ReverbDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/ReverbDeviceBody.csindex f9905be9..cd2d9e88 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/ReverbDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/ReverbDeviceBody.cs@@ -48,6 +48,8 @@ internal sealed class ReverbDeviceBody : IDeviceBodyprivate static readonly IBrush SliderHandleBg = NotaPalette.TextSecondary;public double Width => 700;++ public string? Subtitle => "REVERB"; // the processing type, shown as the header badgepublic bool FullBleed => true;public Control Build(DeviceCardContext ctx, int index)@@ -70,16 +72,16 @@ internal sealed class ReverbDeviceBody : IDeviceBodyctx.AddDeviceRefresher(tail.Tick);// ── Value formatters ─────────────────────────────────────────────────- string Sec(double v) => $"{Exp(v, DecayMinSec, DecayMaxSec):0.00} s";- string Pct(double v) => $"{v * 100:0}%";+ string Sec(double v) => $"{Exp(v, DecayMinSec, DecayMaxSec):0.00}\u2009s";+ string Pct(double v) => $"{v * 100:0}\u2009%";string Hz(double v){double f = Exp(v, FreqMinHz, FreqMaxHz);return f >= 1000 ? $"{f / 1000:0.0}k" : $"{f:0}";}- string PreMs(double v) => $"{v * PreDelayMaxMs:0} ms";- string RateF(double v) => $"{Exp(v, RateMinHz, RateMaxHz):0.00} Hz";- string DbF(double v) => v <= 0.001 ? "−∞" : $"{20 * Math.Log10(v * 2):+0.0;-0.0;0.0}";+ string PreMs(double v) => $"{v * PreDelayMaxMs:0}\u2009ms";+ string RateF(double v) => $"{Exp(v, RateMinHz, RateMaxHz):0.00}\u2009Hz";+ string DbF(double v) => v <= 0.001 ? "−∞" : $"{20 * Math.Log10(v * 2):+0.0;−0.0;0.0}";// ── Widget factories ─────────────────────────────────────────────────@@ -147,7 +149,7 @@ internal sealed class ReverbDeviceBody : IDeviceBodyBackground = Card2,BorderBrush = BorderDef,BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(6),+ CornerRadius = NotaRadius.Panel,Padding = new Thickness(7, 5),Child = new StackPanel { Children = { BandHeader(title), Row(knobs) } },};@@ -182,7 +184,7 @@ internal sealed class ReverbDeviceBody : IDeviceBodyBackground = Card2,BorderBrush = BorderDef,BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(6),+ CornerRadius = NotaRadius.Panel,Padding = new Thickness(7, 5),VerticalAlignment = VerticalAlignment.Stretch,Child = grid,@@ -192,146 +194,19 @@ internal sealed class ReverbDeviceBody : IDeviceBody// Compact horizontal slider for the LIVE strip.Control Slider(int p, string name, Func<double, string> fmt, double w){- var bg = new Border { Width = w, Height = 3, Background = Sunken, CornerRadius = new CornerRadius(2) };- var fill = new Border { Height = 3, Background = Brass, CornerRadius = new CornerRadius(2) };- var handle = new Border { Width = 8, Height = 9, Background = SliderHandleBg, CornerRadius = new CornerRadius(2) };-- var canvas = new Canvas- {- Width = w,- Height = 9,- Background = Brushes.Transparent,- VerticalAlignment = VerticalAlignment.Center,- };- Canvas.SetTop(bg, 3);- Canvas.SetTop(fill, 3);- Canvas.SetTop(handle, 0);- canvas.Children.Add(bg);- canvas.Children.Add(fill);- canvas.Children.Add(handle);-- var val = new TextBlock- {- FontSize = 9,- Foreground = TextPrimary,- Width = 46,- VerticalAlignment = VerticalAlignment.Center,- };- val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");-- bool drag = false;-- void UpdateVisual(double v)- {- fill.Width = Math.Max(0, v * w);- Canvas.SetLeft(handle, v * w - handle.Width / 2);- val.Text = fmt(v);- }-- void ApplyPointer(PointerEventArgs e)- {- double v = Math.Clamp(e.GetPosition(canvas).X / w, 0, 1);- SetP(p, (float)v);- UpdateVisual(v);- tail.Tick();- }-- void EndDrag()- {- if (!drag) return;- drag = false;- EndWrite(p);- }-- canvas.PointerPressed += (_, e) =>- {- drag = true;- BeginWrite(p);- e.Pointer.Capture(canvas);- ApplyPointer(e);- };- canvas.PointerMoved += (_, e) => { if (drag) ApplyPointer(e); };- canvas.PointerReleased += (_, e) => { EndDrag(); e.Pointer.Capture(null); };- canvas.PointerCaptureLost += (_, _) => EndDrag(); // don't leave a dangling automation session-- ctx.AddDeviceRefresher(() => { if (!drag) UpdateVisual(P(p)); });- UpdateVisual(P(p));-- var root = new StackPanel- {- Orientation = Orientation.Horizontal,- Spacing = 6,- VerticalAlignment = VerticalAlignment.Center,- Children =- {- new TextBlock- {- Text = name,- FontSize = 8,- FontWeight = FontWeight.Bold,- Foreground = TextTertiary,- VerticalAlignment = VerticalAlignment.Center,- },- canvas,- val,- },- };- MidiLearn.Bind(root, MidiTarget.DeviceParam(track, di, p), name);- return root;+ var row = DeviceCardKit.SliderRow(name, () => P(p), n => { SetP(p, (float)n); tail.Tick(); }, () => fmt(P(p)), out var sync,+ begin: () => BeginWrite(p), end: () => EndWrite(p), trackWidth: w, valueWidth: 46);+ ctx.AddDeviceRefresher(sync);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), name);+ return row;}// Discrete selector rendered as a chip row (Algorithm).Control Chips(int p, string[] names){int n = names.Length;- var chips = new Border[n];-- void SyncVisual()- {- int cur = Math.Clamp((int)Math.Round(P(p) * (n - 1)), 0, n - 1);- for (int i = 0; i < n; i++)- {- bool on = i == cur;- chips[i].Background = on ? AccentSubtleB : Brushes.Transparent;- ((TextBlock)chips[i].Child!).Foreground = on ? AccentBright : TextTertiary;- }- }-- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++)- {- int iv = i;- var chip = new Border- {- CornerRadius = new CornerRadius(3),- Padding = new Thickness(6, 1),- Cursor = new Cursor(StandardCursorType.Hand),- Child = new TextBlock { Text = names[i], FontSize = 9, Foreground = TextTertiary },- };- chip.PointerPressed += (_, _) =>- {- BeginWrite(p);- SetP(p, iv / (float)(n - 1));- EndWrite(p);- SyncVisual();- };- chips[i] = chip;- row.Children.Add(chip);- }-- ctx.AddDeviceRefresher(SyncVisual);- SyncVisual();-- var host = new Border- {- Background = Sunken,- BorderBrush = BorderDef,- BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(4),- Padding = new Thickness(1),- VerticalAlignment = VerticalAlignment.Center,- Child = row,- };+ var host = DeviceCardKit.Segments(names, () => Math.Clamp((int)Math.Round(P(p) * (n - 1)), 0, n - 1), iv => { BeginWrite(p); SetP(p, iv / (float)(n - 1)); EndWrite(p); }, out var sync);+ ctx.AddDeviceRefresher(sync);MidiLearn.Bind(host, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));return host;}@@ -340,7 +215,7 @@ internal sealed class ReverbDeviceBody : IDeviceBody{var b = new Border{- CornerRadius = new CornerRadius(4),+ CornerRadius = NotaRadius.Control,BorderThickness = new Thickness(1),Padding = new Thickness(8, 2),Cursor = new Cursor(StandardCursorType.Hand),diff --git a/src/managed/Nota.App/DeviceCards/Bodies/ShutterDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/ShutterDeviceBody.csindex 5dcbd112..f7372a7d 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/ShutterDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/ShutterDeviceBody.cs@@ -40,11 +40,15 @@ internal sealed class ShutterDeviceBody : IDeviceBodyprivate static readonly IBrush LabelC = NotaPalette.TextSecondary;private static readonly IBrush Dim = NotaPalette.BorderStrong;private static readonly IBrush Green = NotaPalette.Success;- private static readonly IBrush Red = NotaPalette.DangerDeep;+ // Gate reduction and the shut state are the device working, not an alert: red belongs to+ // recording and overload, so shut reads as quiet ink and reduction as brass data.+ private static readonly IBrush Red = NotaPalette.Accent;private static readonly IBrush ThrC = NotaPalette.Threshold;private static readonly IBrush HandleC = NotaPalette.TextSecondary;public double Width => 700;++ public string? Subtitle => "GATE"; // the processing type, shown as the header badgepublic bool FullBleed => true;public Control Build(DeviceCardContext ctx, int index)@@ -69,48 +73,30 @@ internal sealed class ShutterDeviceBody : IDeviceBodyctx.AddDeviceRefresher(signal.Tick);// ---- formatters ----- static string ThrF(double v) => $"{-70 + v * 70:0.0} dB";- static string RetF(double v) => $"{v * 24:0.0} dB";- static string Ms(double v, double lo, double hi) { double m = Exp(v, lo, hi); return m >= 100 ? $"{m:0} ms" : m >= 10 ? $"{m:0.0} ms" : $"{m:0.00} ms"; }+ static string ThrF(double v) => $"{-70 + v * 70:0.0}\u2009dB";+ static string RetF(double v) => $"{v * 24:0.0}\u2009dB";+ static string Ms(double v, double lo, double hi) { double m = Exp(v, lo, hi); return m >= 100 ? $"{m:0}\u2009ms" : m >= 10 ? $"{m:0.0}\u2009ms" : $"{m:0.00}\u2009ms"; }static string AttF(double v) => Ms(v, 0.01, 100);static string HoldF(double v) => Ms(v, 0.1, 500);static string RelF(double v) => Ms(v, 1, 2000);- static string FloorF(double v) => v <= 0.001 ? "−∞ dB" : $"{-70 + v * 70:0} dB";+ static string FloorF(double v) => v <= 0.001 ? "−∞\u2009dB" : $"{-70 + v * 70:0.0}\u2009dB";// ---- horizontal slider ----Control HRow(int p, string label, Func<double, string> fmt, double labW, double valW, bool teal = false, bool bipolar = false){- var accent = teal ? TealC : Amber;- var fill = new Border { Height = 3, Background = accent, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var trk = new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center };- var center = bipolar ? new Border { Width = 1, Background = Dim, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Stretch, Margin = new Thickness(0, 1) } : null;- var handle = new Border { Width = 8, Height = 9, Background = HandleC, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Height = 11, MinWidth = 30 }; slot.Children.Add(trk); if (center != null) slot.Children.Add(center); slot.Children.Add(fill); slot.Children.Add(handle);- var val = new TextBlock { Text = fmt(P(p)), FontSize = 9, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center }; val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono"); if (valW > 0) { val.Width = valW; val.TextAlignment = TextAlignment.Right; }- bool drag = false;- void Upd() { double v = P(p), W = slot.Bounds.Width, hx = v * W; handle.Margin = new Thickness(Math.Clamp(hx - 4, 0, Math.Max(0, W - 8)), 0, 0, 0); fill.Width = hx; val.Text = fmt(v); }- void SetX(double x) { SetP(p, (float)Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1)); SyncLines(); Upd(); }- slot.PointerPressed += (_, e) => { drag = true; e.Pointer.Capture(slot); Begin(p); SetX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); End(p); } };- MidiLearn.Bind(slot, MidiTarget.DeviceParam(track, di, p), label);- readouts.Add(() => { if (!drag) Upd(); });- var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center };- if (labW > 0) g.Children.Add(Cap(label, teal ? TealC : MutedC, labW));- Grid.SetColumn(slot, 1); g.Children.Add(slot); Grid.SetColumn(val, 2); g.Children.Add(val);- return g;+ var row = DeviceCardKit.SliderRow(labW > 0 ? label : "", () => P(p), n => { SetP(p, (float)n); SyncLines(); }, () => fmt(P(p)), out var sync,+ begin: () => Begin(p), end: () => End(p), bipolar: bipolar, labelWidth: labW, valueWidth: valW);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, p), label);+ readouts.Add(sync);+ return row;}// Segmented pill over a normalized param.Control Seg(int p, string[] opts, bool teal = false){- int n = opts.Length; var cells = new Border[n]; var texts = new TextBlock[n];- var accent = teal ? TealC : Amber; var lit = teal ? TealC : AmberLit; var sub = teal ? TealSubtle : AmberSubtle;- void Sync() { int cur = Math.Clamp((int)Math.Round(P(p) * (n - 1)), 0, n - 1); for (int i = 0; i < n; i++) { bool on = i == cur; cells[i].Background = on ? sub : Brushes.Transparent; cells[i].BorderBrush = on ? accent : Brushes.Transparent; texts[i].Foreground = on ? lit : MutedC; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++) { int iv = i; var tb = new TextBlock { Text = opts[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = MutedC }; var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(6, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = tb }; c.PointerPressed += (_, e) => { e.Handled = true; SetP(p, n > 1 ? iv / (float)(n - 1) : 0f); Sync(); }; cells[i] = c; texts[i] = tb; row.Children.Add(c); }- readouts.Add(Sync);- var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ int n = opts.Length;+ var seg = DeviceCardKit.Segments(opts, () => Math.Clamp((int)Math.Round(P(p) * (n - 1)), 0, n - 1), iv => SetP(p, n > 1 ? iv / (float)(n - 1) : 0f), out var sync);+ readouts.Add(sync);MidiLearn.Bind(seg, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));return seg;}@@ -120,15 +106,15 @@ internal sealed class ShutterDeviceBody : IDeviceBodyChild = new DockPanel { LastChildFill = false, Margin = new Thickness(9, 0), Children = {WithDock(new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center, Children = {Cap("LIVE"),- new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Width = 210, Children = { Cap("THRESHOLD", MutedC, 56), new Border { Child = HRow(Threshold, "", ThrF, 0, 58), Width = 140 } } },+ new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Width = 210, Children = { Cap("THRESH", MutedC, 56), new Border { Child = HRow(Threshold, "", ThrF, 0, 58), Width = 140 } } },new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Width = 130, Children = { Cap("RETURN", MutedC, 38), new Border { Child = HRow(Return, "", RetF, 0, 48), Width = 80 } } } } }, Dock.Left),WithDock(new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center, Children = {new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("FLIP"), Seg(Flip, new[] { "Gate", "Duck" }) } },- new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("LOOK"), Seg(Lookahead, new[] { "0", "1", "5 ms" }) } } } }, Dock.Right) } } };+ new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("LOOK"), Seg(Lookahead, new[] { "0", "1", "5\u2009ms" }) } } } }, Dock.Right) } } };// ================= ENVELOPE column =================var state = new TextBlock { Text = "OPEN", FontSize = 20, FontWeight = FontWeight.SemiBold, Foreground = Green, LineHeight = 20 }.WithMono();- var stateSub = new TextBlock { Text = "gate · GR 0.0 dB", FontSize = 9, Foreground = MutedC }.WithMono();+ var stateSub = new TextBlock { Text = "gate · GR 0.0\u2009dB", FontSize = 9, Foreground = MutedC }.WithMono();var envTop = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), Children = {new StackPanel { VerticalAlignment = VerticalAlignment.Center, Spacing = 1, Children = { state, stateSub } },WithCol(new Border { Width = 64, Height = 38, Child = new AHRGlyph(), VerticalAlignment = VerticalAlignment.Center }, 1) } };@@ -150,9 +136,9 @@ internal sealed class ShutterDeviceBody : IDeviceBodyControl Meter(string label, out Border fill, out TextBlock val, IBrush baseCol, out Border tick){val = new TextBlock { FontSize = 9, Foreground = LabelC, Width = 38, TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Center }.WithMono();- fill = new Border { Background = baseCol, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Stretch, Width = 0 };+ fill = new Border { Background = baseCol, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Stretch, Width = 0 };tick = new Border { Width = 1, Background = ThrC, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Stretch, IsVisible = false };- var trk = new Panel { Height = 5, Children = { new Border { Background = Inset, CornerRadius = new CornerRadius(2) }, fill, tick } };+ var trk = new Panel { Height = 5, Children = { new Border { Background = Inset, CornerRadius = NotaRadius.Clip }, fill, tick } };var g = new Grid { ColumnDefinitions = new ColumnDefinitions("22,*,Auto"), ColumnSpacing = 5, Height = 6, VerticalAlignment = VerticalAlignment.Center };g.Children.Add(Cap(label)); Grid.SetColumn(trk, 1); g.Children.Add(trk); Grid.SetColumn(val, 2); g.Children.Add(val);g.Tag = trk; // so refresher can read the track width@@ -162,7 +148,7 @@ internal sealed class ShutterDeviceBody : IDeviceBodyvar grRow = Meter("GR", out var grFill, out var grVal, Red, out var _);var inTrk = (Panel)((Grid)inRow).Tag!; var grTrk = (Panel)((Grid)grRow).Tag!;- var led = new Border { Width = 8, Height = 8, CornerRadius = new CornerRadius(4), Background = Green, VerticalAlignment = VerticalAlignment.Center };+ var led = new Border { Width = 8, Height = 8, CornerRadius = NotaRadius.Control, Background = Green, VerticalAlignment = VerticalAlignment.Center };var ledTxt = new TextBlock { Text = "OPEN", FontSize = 9, FontWeight = FontWeight.Bold, Foreground = Green, VerticalAlignment = VerticalAlignment.Center };var duty = new TextBlock { Text = "", FontSize = 8, Foreground = MutedC, HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center }.WithMono();var ledRow = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,*"), ColumnSpacing = 6, Children = { led, WithCol(ledTxt, 1), WithCol(duty, 2) } };@@ -190,13 +176,13 @@ internal sealed class ShutterDeviceBody : IDeviceBodydetEq.LpChanged += v => { Begin(DetLP); SetP(DetLP, (float)v); End(DetLP); };readouts.Add(() => detEq.Set(P(DetHP), P(DetLP)));- var listenChip = new Border { BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(5, 0), Cursor = new Cursor(StandardCursorType.Hand),+ var listenChip = new Border { BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Padding = new Thickness(5, 0), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = "LISTEN", FontSize = 8, FontWeight = FontWeight.Bold, VerticalAlignment = VerticalAlignment.Center } };- void ListenSync() { bool on = P(Listen) >= 0.5f; listenChip.Background = on ? TealSubtle : Brushes.Transparent; listenChip.BorderBrush = on ? TealC : Dim; ((TextBlock)listenChip.Child!).Foreground = on ? TealC : MutedC; }+ void ListenSync() { bool on = P(Listen) >= 0.5f; listenChip.Background = on ? NotaPalette.AccentSubtle : Brushes.Transparent; listenChip.BorderBrush = on ? NotaPalette.BorderBrass : Dim; ((TextBlock)listenChip.Child!).Foreground = on ? NotaPalette.AccentHover : MutedC; }listenChip.PointerPressed += (_, e) => { e.Handled = true; SetP(Listen, P(Listen) >= 0.5f ? 0f : 1f); ListenSync(); };readouts.Add(ListenSync);- var scEqBox = new Border { Background = Inset, BorderBrush = NotaPalette.GraphBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(4), Child =+ var scEqBox = new Border { Background = Inset, BorderBrush = NotaPalette.GraphBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Padding = new Thickness(4), Child =new DockPanel { LastChildFill = true, Children = {new Grid { Height = 11, [DockPanel.DockProperty] = Dock.Top, ColumnDefinitions = new ColumnDefinitions("*,Auto"), Children = { Cap("SC EQ", MutedC), WithCol(listenChip, 1) } },detEq } } };@@ -225,10 +211,10 @@ internal sealed class ShutterDeviceBody : IDeviceBodyint n = engine.DeviceScope(track, di, scope, kScope);if (n < kScope) return;bool open = scope[S_Open] >= 0.5f && scope[S_GateGain] > 0.5f;- state.Text = open ? "OPEN" : "SHUT"; state.Foreground = open ? Green : Red;- stateSub.Text = $"gate · GR {scope[S_GrDb]:0.0} dB";+ state.Text = open ? "OPEN" : "SHUT"; state.Foreground = open ? Green : NotaPalette.TextSecondary;+ stateSub.Text = $"gate · GR {scope[S_GrDb]:0.0}\u2009dB";led.Background = open ? Green : Dim; ledTxt.Text = open ? "OPEN" : "SHUT"; ledTxt.Foreground = open ? Green : MutedC;- duty.Text = $"{scope[S_GateGain] * 100:0}% open";+ duty.Text = $"{scope[S_GateGain] * 100:0}\u2009% open";double inW = inTrk.Bounds.Width, grW = grTrk.Bounds.Width;inFill.Width = Math.Clamp((scope[S_InDb] + 60) / 60, 0, 1) * inW;inVal.Text = $"{scope[S_InDb]:0.0}";@@ -250,13 +236,9 @@ internal sealed class ShutterDeviceBody : IDeviceBody// Small teal toggle with a state getter/setter, registered to the refresher list.private static Control MakeToggle(Func<bool> get, Action<bool> set, string label, List<Action> readouts){- var knob = new Border { Width = 6, Height = 6, CornerRadius = new CornerRadius(3), Background = NotaPalette.BgApp, VerticalAlignment = VerticalAlignment.Center };- var sw = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), Cursor = new Cursor(StandardCursorType.Hand), Padding = new Thickness(1.5, 0), Child = knob };- var tb = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = NotaPalette.Teal, VerticalAlignment = VerticalAlignment.Center };- void Sync() { bool on = get(); sw.Background = on ? NotaPalette.Teal : NotaPalette.BorderStrong; knob.HorizontalAlignment = on ? HorizontalAlignment.Right : HorizontalAlignment.Left; }- sw.PointerPressed += (_, e) => { e.Handled = true; set(!get()); Sync(); };- readouts.Add(Sync);- return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { sw, tb } };+ var b = DeviceCardKit.Switch(label, get, () => set(!get()), out var sync);+ readouts.Add(sync);+ return b;}}diff --git a/src/managed/Nota.App/DeviceCards/Bodies/StrataDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/StrataDeviceBody.csindex 101cee2f..c9451646 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/StrataDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/StrataDeviceBody.cs@@ -38,6 +38,8 @@ internal sealed class StrataDeviceBody : IDeviceBody};public double Width => 700;++ public string? Subtitle => "LOOPER"; // the processing type, shown as the header badgepublic bool FullBleed => true;public Control Build(DeviceCardContext ctx, int index)@@ -60,22 +62,22 @@ internal sealed class StrataDeviceBody : IDeviceBodybarNum.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");var ticks = new Border[16];var tickRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2, VerticalAlignment = VerticalAlignment.Center };- for (int i = 0; i < 16; i++) { ticks[i] = new Border { Width = i % 4 == 0 ? 2 : 1, Height = 14, Background = Sunken, CornerRadius = new CornerRadius(1) }; tickRow.Children.Add(ticks[i]); }+ for (int i = 0; i < 16; i++) { ticks[i] = new Border { Width = i % 4 == 0 ? 2 : 1, Height = 14, Background = Sunken, CornerRadius = NotaRadius.Bar }; tickRow.Children.Add(ticks[i]); }var ofBars = new TextBlock { Text = "of – bars", FontSize = 8, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center };// Transport actions. Each button is captioned with what it does next; the// active mode's button lights in its colour.var actNames = new[] { "Record", "Overdub", "Play", "Stop" };var actCmds = new[] { C_Record, C_Overdub, C_Play, C_Stop };- var actColors = new[] { NotaPalette.Danger.Color, NotaPalette.Accent.Color, NotaPalette.Success.Color, NotaPalette.TextSecondary.Color };+ var actInks = new[] { NotaPalette.Record, NotaPalette.Accent, NotaPalette.Success, NotaPalette.TextSecondary };var actBtn = new Border[4]; var actSub = new TextBlock[4]; var actName = new TextBlock[4];var actRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 3, VerticalAlignment = VerticalAlignment.Center };for (int i = 0; i < 4; i++){int iv = i;- actName[i] = new TextBlock { Text = actNames[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = new SolidColorBrush(actColors[i]) };+ actName[i] = new TextBlock { Text = actNames[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = actInks[i] };actSub[i] = new TextBlock { Text = "", FontSize = 7, Foreground = TextTertiary };- actBtn[i] = new Border { Height = 24, MinWidth = 62, CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), BorderBrush = BorderStrong, Background = Card2, Padding = new Thickness(9, 0), Cursor = new Cursor(StandardCursorType.Hand),+ actBtn[i] = new Border { Height = 24, MinWidth = 62, CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), BorderBrush = BorderStrong, Background = Card2, Padding = new Thickness(9, 0), Cursor = new Cursor(StandardCursorType.Hand),Child = new StackPanel { VerticalAlignment = VerticalAlignment.Center, Children = { actName[i], actSub[i] } } };actBtn[i].PointerPressed += (_, _) => Act(actCmds[iv]);actRow.Children.Add(actBtn[i]);@@ -87,7 +89,7 @@ internal sealed class StrataDeviceBody : IDeviceBodynew StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, VerticalAlignment = VerticalAlignment.Center, Children = { barNum, tickRow, ofBars } } } } };// ---------- layer stack ----------- var layerHint = new TextBlock { Text = "Press Record to lay down the first loop", FontSize = 10, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };+ var layerHint = new TextBlock { Text = "Press Record to lay down the first loop", FontSize = 9, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };var layerRows = new Border[MaxLayers]; var waves = new StrataWave[MaxLayers];var stateTxts = new TextBlock[MaxLayers]; var dbTxts = new TextBlock[MaxLayers]; var muteBtns = new Border[MaxLayers]; var idxTxts = new TextBlock[MaxLayers];var layerStack = new StackPanel { Spacing = 3 };@@ -105,9 +107,9 @@ internal sealed class StrataDeviceBody : IDeviceBody// Vertical drag on the dB readout sets that layer's level.bool drag = false; double startY = 0, startDb = 0;dbTxts[i].PointerPressed += (_, e) => { drag = true; startY = e.GetPosition(dbTxts[iv]).Y; startDb = scope[7 + iv * 3]; e.Pointer.Capture(dbTxts[iv]); };- dbTxts[i].PointerMoved += (_, e) => { if (drag) { double db = Math.Clamp(startDb + (startY - e.GetPosition(dbTxts[iv]).Y) * 0.15, -24, 12); Act(A_LayerGain, iv, (float)db); dbTxts[iv].Text = $"{db:+0.0;-0.0;0.0}"; } };+ dbTxts[i].PointerMoved += (_, e) => { if (drag) { double db = Math.Clamp(startDb + (startY - e.GetPosition(dbTxts[iv]).Y) * 0.15, -24, 12); Act(A_LayerGain, iv, (float)db); dbTxts[iv].Text = $"{db:+0.0;−0.0;0.0}"; } };dbTxts[i].PointerReleased += (_, e) => { drag = false; e.Pointer.Capture(null); };- muteBtns[i] = new Border { Width = 16, Height = 14, CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), BorderBrush = BorderDef, Background = Sunken, Cursor = new Cursor(StandardCursorType.Hand),+ muteBtns[i] = new Border { Width = 16, Height = 14, CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), BorderBrush = BorderDef, Background = Sunken, Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = "M", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center } };muteBtns[i].PointerPressed += (_, _) => { bool nowMuted = scope[8 + iv * 3] <= 0.5f; Act(A_LayerMute, iv, nowMuted ? 1f : 0f); };var row = new DockPanel { LastChildFill = true, Children = { } };@@ -115,7 +117,7 @@ internal sealed class StrataDeviceBody : IDeviceBodyvar right = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 7, VerticalAlignment = VerticalAlignment.Center, Children = { stateTxts[i], dbTxts[i], muteBtns[i] } };DockPanel.SetDock(left, Dock.Left); DockPanel.SetDock(right, Dock.Right);row.Children.Add(left); row.Children.Add(right); row.Children.Add(new Border { Margin = new Thickness(7, 0), Child = waves[i] });- layerRows[i] = new Border { Height = 36, CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1, 1, 1, 1), Padding = new Thickness(7, 0), IsVisible = false, Child = row };+ layerRows[i] = new Border { Height = 36, CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1, 1, 1, 1), Padding = new Thickness(7, 0), IsVisible = false, Child = row };layerStack.Children.Add(layerRows[i]);}var layerHead = new DockPanel { LastChildFill = false, Children = { Lbl("LAYERS", 8, TextTertiary) } };@@ -132,62 +134,46 @@ internal sealed class StrataDeviceBody : IDeviceBodydouble lmn = log ? Math.Log(mn) : mn, lspan = (log ? Math.Log(mx) : mx) - lmn;double NormOf(double v) { double x = log ? Math.Log(Math.Clamp(v, mn, mx)) : Math.Clamp(v, mn, mx); return (x - lmn) / Math.Max(1e-9, lspan); }double ValOf(double n) { double x = lmn + Math.Clamp(n, 0, 1) * lspan; return log ? Math.Exp(x) : x; }- double tw = 84;- var trk = new Border { Width = tw, Height = 3, Background = Sunken, CornerRadius = new CornerRadius(2) };- var fill = new Border { Height = 3, Background = accent, CornerRadius = new CornerRadius(2) };- var handle = new Border { Width = 8, Height = 9, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2) };- var canvas = new Canvas { Width = tw, Height = 9, Background = Brushes.Transparent, VerticalAlignment = VerticalAlignment.Center };- Canvas.SetTop(trk, 3); Canvas.SetTop(fill, 3); Canvas.SetTop(handle, 0);- canvas.Children.Add(trk); canvas.Children.Add(fill); canvas.Children.Add(handle);- var val = new TextBlock { FontSize = 8, Foreground = TextSecondary, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Right };- val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- bool drag = false;- void Vis(double v) { double nn = NormOf(v); fill.Width = Math.Max(0, nn * tw); Canvas.SetLeft(handle, nn * tw - 4); val.Text = fmt(v); }- void From(PointerEventArgs e) { double nn = Math.Clamp(e.GetPosition(canvas).X / tw, 0, 1); float v = (float)ValOf(nn); SetR(p, v); Vis(v); }- canvas.PointerPressed += (_, e) => { drag = true; engine.BeginAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""); e.Pointer.Capture(canvas); From(e); };- canvas.PointerMoved += (_, e) => { if (drag) From(e); };- canvas.PointerReleased += (_, e) => { if (drag) { drag = false; engine.EndAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""); e.Pointer.Capture(null); } };- MidiLearn.Bind(canvas, MidiTarget.DeviceParam(track, di, p), name);- readouts.Add(() => { if (!drag) Vis(P(p)); });- Vis(P(p));- var lbl = new TextBlock { Text = name, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = ReferenceEquals(accent, Teal) ? Teal : TextTertiary, Width = 52, VerticalAlignment = VerticalAlignment.Center };+ var slider = new SliderTrack { Width = 84 };+ var val = new TextBlock { FontFamily = NotaFonts.MonoFamily, FontSize = 9, Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center };+ void Vis() { slider.Norm = NormOf(P(p)); val.Text = fmt(P(p)); }+ slider.Changed += n => { SetR(p, (float)ValOf(n)); val.Text = fmt(P(p)); };+ slider.GestureBegin += () => engine.BeginAutomationWrite(track, AutomationTarget.DeviceParam, di, p, "");+ slider.GestureEnd += () => engine.EndAutomationWrite(track, AutomationTarget.DeviceParam, di, p, "");+ MidiLearn.Bind(slider, MidiTarget.DeviceParam(track, di, p), name);+ readouts.Add(() => { if (!slider.Dragging) Vis(); });+ Vis();+ var lbl = new TextBlock { Text = name.ToUpperInvariant(), FontSize = NotaType.RowLabel, FontWeight = FontWeight.Bold, LetterSpacing = NotaType.RowLabelTracking, Foreground = TextTertiary, Width = 52, VerticalAlignment = VerticalAlignment.Center };var head = new DockPanel { LastChildFill = false, Children = { lbl } };DockPanel.SetDock(val, Dock.Right); head.Children.Add(val);- return new StackPanel { Spacing = 2, Children = { head, canvas } };+ return new StackPanel { Spacing = 2, Children = { head, slider } };}Control Seg(int p, string[] names){- int n = names.Length; var arr = new Border[n];- void Hi() { int cur = Math.Clamp((int)Math.Round(P(p)), 0, n - 1); for (int i = 0; i < n; i++) { bool on = i == cur; arr[i].Background = on ? Brass : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? OnAccent : TextTertiary; ((TextBlock)arr[i].Child!).FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1, HorizontalAlignment = HorizontalAlignment.Stretch };- for (int i = 0; i < n; i++) { int iv = i; arr[i] = new Border { CornerRadius = new CornerRadius(2), Padding = new Thickness(0, 1), MinWidth = 26, Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 8, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center } }; arr[i].PointerPressed += (_, _) => { SetR(p, iv); Hi(); }; row.Children.Add(arr[i]); }- readouts.Add(Hi); Hi();- var seg = new Border { Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(1), Child = row };+ int n = names.Length;+ var seg = DeviceCardKit.Segments(names, () => Math.Clamp((int)Math.Round(P(p)), 0, n - 1), iv => SetR(p, iv), out var sync, minSegWidth: 26);+ readouts.Add(sync);MidiLearn.Bind(seg, MidiTarget.DeviceParam(track, di, p), engine.DeviceParamName(track, di, p));return seg;}Control Toggle(int p, string label, IBrush tint){- var dot = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), Background = Sunken, Child = new Border { Width = 6, Height = 6, CornerRadius = new CornerRadius(3), Background = TextTertiary, HorizontalAlignment = HorizontalAlignment.Left, Margin = new Thickness(2, 0, 0, 0), VerticalAlignment = VerticalAlignment.Center } };- var txt = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center };- void Hi() { bool on = P(p) > 0.5f; var inner = (Border)dot.Child!; dot.Background = on ? tint : Sunken; inner.Background = on ? (IBrush)NotaPalette.BgApp : TextTertiary; inner.HorizontalAlignment = on ? HorizontalAlignment.Right : HorizontalAlignment.Left; inner.Margin = on ? new Thickness(0, 0, 2, 0) : new Thickness(2, 0, 0, 0); txt.Foreground = on ? tint : TextTertiary; }- var b = new Border { Cursor = new Cursor(StandardCursorType.Hand), Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, Children = { dot, txt } } };- b.PointerPressed += (_, _) => { SetR(p, P(p) > 0.5f ? 0f : 1f); Hi(); };+ var b = Switch(label, () => P(p) > 0.5f, () => SetR(p, P(p) > 0.5f ? 0f : 1f), out var sync);MidiLearn.Bind(b, MidiTarget.DeviceParam(track, di, p), label);- readouts.Add(Hi); Hi(); return b;+ readouts.Add(sync); return b;}Control ActionBtn(string label, IBrush color, Action onClick){- var b = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), BorderBrush = BorderStrong, Background = Card2, Padding = new Thickness(0, 2), Cursor = new Cursor(StandardCursorType.Hand),+ var b = new Border { CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), BorderBrush = BorderStrong, Background = Card2, Padding = new Thickness(0, 2), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = label, FontSize = 9, Foreground = color, HorizontalAlignment = HorizontalAlignment.Center } };b.PointerPressed += (_, _) => onClick();return b;}- string PctF(double v) => $"{v:0} %"; string DbF(double v) => $"{v:+0.0;-0.0;0.0}"; string SpeedF(double v) => $"{v:0.00}×";+ string PctF(double v) => $"{v:0}\u2009%"; string DbF(double v) => $"{v:+0.0;−0.0;0.0}"; string SpeedF(double v) => $"{v:0.00}×";var undo = ActionBtn("Undo", TextSecondary, () => Act(C_Undo));var export = ActionBtn("Export", TextSecondary, () => ctx.NotifyChanged());- var clear = ActionBtn("Clear", NotaPalette.Danger, () => Act(C_Clear));+ var clear = ActionBtn("Clear", NotaPalette.TextSecondary, () => Act(C_Clear));var bottomActions = new Grid { ColumnDefinitions = new ColumnDefinitions("*,*,*"), ColumnSpacing = 4, Margin = new Thickness(0, 4, 0, 0) };Grid.SetColumn(undo, 0); Grid.SetColumn(export, 1); Grid.SetColumn(clear, 2);bottomActions.Children.Add(undo); bottomActions.Children.Add(export); bottomActions.Children.Add(clear);@@ -238,8 +224,8 @@ internal sealed class StrataDeviceBody : IDeviceBodyfor (int i = 0; i < 4; i++){bool on = i == active;- actBtn[i].Background = on ? new SolidColorBrush(Color.FromArgb(0x28, actColors[i].R, actColors[i].G, actColors[i].B)) : Card2;- actBtn[i].BorderBrush = on ? new SolidColorBrush(actColors[i]) : BorderStrong;+ actBtn[i].Background = on ? NotaPalette.Wash(actInks[i], 0x28) : Card2;+ actBtn[i].BorderBrush = on ? actInks[i] : BorderStrong;}layerHint.IsVisible = layers == 0;@@ -251,15 +237,15 @@ internal sealed class StrataDeviceBody : IDeviceBodyint st = (int)scope[6 + k * 3]; float gainDb = scope[7 + k * 3]; bool muted = scope[8 + k * 3] > 0.5f;bool rec = recL == k;stateTxts[k].Text = rec ? "REC" : muted ? "MUTED" : "PLAY";- stateTxts[k].Foreground = rec ? NotaPalette.Danger : muted ? TextTertiary : Success;- dbTxts[k].Text = $"{gainDb:+0.0;-0.0;0.0}";+ stateTxts[k].Foreground = rec ? NotaPalette.Record : muted ? TextTertiary : Success;+ dbTxts[k].Text = $"{gainDb:+0.0;−0.0;0.0}";var mtxt = (TextBlock)muteBtns[k].Child!;muteBtns[k].Background = muted ? NotaPalette.MuteTint : Sunken;- muteBtns[k].BorderBrush = muted ? NotaPalette.Danger : BorderDef;- mtxt.Foreground = muted ? NotaPalette.Danger : TextTertiary;+ muteBtns[k].BorderBrush = muted ? NotaPalette.BorderBrass : BorderDef;+ mtxt.Foreground = muted ? NotaPalette.AccentHover : TextTertiary;var col = NotaPalette.InkColor(Palette[k % Palette.Length]);- layerRows[k].Background = rec ? NotaPalette.Wash(NotaPalette.Danger, 0x1A) : muted ? NotaPalette.SurfaceInset : NotaPalette.Wash(NotaPalette.Accent, 0x0D);- layerRows[k].BorderBrush = rec ? NotaPalette.Danger : muted ? BorderDef : new SolidColorBrush(Color.FromArgb(0x73, col.R, col.G, col.B));+ layerRows[k].Background = rec ? NotaPalette.Wash(NotaPalette.Record, 0x1A) : muted ? NotaPalette.SurfaceInset : NotaPalette.Wash(NotaPalette.Accent, 0x0D);+ layerRows[k].BorderBrush = rec ? NotaPalette.Record : muted ? BorderDef : new SolidColorBrush(Color.FromArgb(0x73, col.R, col.G, col.B));int wn = engine.DeviceLayerWave(track, di, k, waveBuf, waveBuf.Length);var env = new float[Math.Max(1, wn)];for (int i = 0; i < wn; i++) env[i] = Math.Clamp(waveBuf[i], 0f, 1f);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/UtilityDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/UtilityDeviceBody.csindex 44cd3587..bc55fca7 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/UtilityDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/UtilityDeviceBody.cs@@ -27,7 +27,9 @@ internal sealed class UtilityDeviceBody : IDeviceBody// Packed scope layout (Utility::scopeRead): meters then kScopePairs (L,R) pairs.private const int S_InL = 0, S_InR = 1, S_OutL = 2, S_OutR = 3, S_Corr = 4, kMeters = 5, kPairs = 48, kScope = kMeters + kPairs * 2;- public double Width => 622;+ public double Width => 700; // the almanac device format: 700 × 260++ public string? Subtitle => "UTILITY"; // the processing type, shown as the header badgepublic Control Build(DeviceCardContext ctx, int index){@@ -42,9 +44,9 @@ internal sealed class UtilityDeviceBody : IDeviceBody// ---- shared small controls (mirroring the Ceiling body) --------------Control Toggle(int p, string label, IBrush tint){- var b = new Border { CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), Padding = new Thickness(7, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,+ var b = new Border { CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Padding = new Thickness(7, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,Child = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold } };- void Hi() { bool on = P(p) > 0.5f; b.Background = on ? AccentSubtleB : Sunken; b.BorderBrush = on ? tint : BorderDef; ((TextBlock)b.Child!).Foreground = on ? tint : TextTertiary; }+ void Hi() { bool on = P(p) > 0.5f; b.Background = on ? NotaPalette.AccentSubtle : Sunken; b.BorderBrush = on ? NotaPalette.BorderBrass : BorderDef; ((TextBlock)b.Child!).Foreground = on ? NotaPalette.AccentHover : TextTertiary; }b.PointerPressed += (_, _) => { SetR(p, P(p) > 0.5f ? 0f : 1f); Hi(); };MidiLearn.Bind(b, MidiTarget.DeviceParam(track, di, p), label);readouts.Add(Hi); Hi(); return b;@@ -55,29 +57,18 @@ internal sealed class UtilityDeviceBody : IDeviceBodydouble mn = 20, mx = 2000, lmn = Math.Log(mn), lspan = Math.Log(mx) - lmn;double Norm(double v) => (Math.Log(Math.Clamp(v, mn, mx)) - lmn) / lspan;double Val(double n) => Math.Exp(lmn + Math.Clamp(n, 0, 1) * lspan);- var trk = new Border { Width = tw, Height = 3, Background = Sunken, CornerRadius = new CornerRadius(2) };- var fill = new Border { Height = 3, Background = Brass, CornerRadius = new CornerRadius(2) };- var handle = new Border { Width = 8, Height = 9, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2) };- var canvas = new Canvas { Width = tw, Height = 9, Background = Brushes.Transparent, VerticalAlignment = VerticalAlignment.Center };- Canvas.SetTop(trk, 3); Canvas.SetTop(fill, 3); Canvas.SetTop(handle, 0);- canvas.Children.Add(trk); canvas.Children.Add(fill); canvas.Children.Add(handle);- var val = new TextBlock { FontSize = 9, Foreground = TextPrimary, MinWidth = 44, VerticalAlignment = VerticalAlignment.Center };- val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- bool drag = false;- void Vis(double v) { double n = Norm(v); fill.Width = Math.Max(0, n * tw); Canvas.SetLeft(handle, n * tw - 4); val.Text = $"{v:0} Hz"; }- void From(PointerEventArgs e) { double n = Math.Clamp(e.GetPosition(canvas).X / tw, 0, 1); float v = (float)Val(n); SetR(MonoFreq, v); Vis(v); }- canvas.PointerPressed += (_, e) => { drag = true; engine.BeginAutomationWrite(track, AutomationTarget.DeviceParam, di, MonoFreq, ""); e.Pointer.Capture(canvas); From(e); };- canvas.PointerMoved += (_, e) => { if (drag) From(e); };- canvas.PointerReleased += (_, e) => { if (drag) { drag = false; engine.EndAutomationWrite(track, AutomationTarget.DeviceParam, di, MonoFreq, ""); e.Pointer.Capture(null); } };- MidiLearn.Bind(canvas, MidiTarget.DeviceParam(track, di, MonoFreq), engine.DeviceParamName(track, di, MonoFreq));- readouts.Add(() => { if (!drag) Vis(P(MonoFreq)); });- Vis(P(MonoFreq));- return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = { canvas, val } };+ var row = DeviceCardKit.SliderRow("", () => Norm(P(MonoFreq)), n => SetR(MonoFreq, (float)Val(n)), () => $"{P(MonoFreq):0}\u2009Hz", out var sync,+ begin: () => engine.BeginAutomationWrite(track, AutomationTarget.DeviceParam, di, MonoFreq, ""),+ end: () => engine.EndAutomationWrite(track, AutomationTarget.DeviceParam, di, MonoFreq, ""),+ trackWidth: tw, valueWidth: 44);+ MidiLearn.Bind(row, MidiTarget.DeviceParam(track, di, MonoFreq), engine.DeviceParamName(track, di, MonoFreq));+ readouts.Add(sync);+ return row;}static TextBlock Cap(string t) => new() { Text = t, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = TextTertiary };Border Button(string text, Action onClick){- var b = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), BorderBrush = BorderStrong, Background = Card2, Padding = new Thickness(8, 3), Cursor = new Cursor(StandardCursorType.Hand),+ var b = new Border { CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), BorderBrush = BorderStrong, Background = Card2, Padding = new Thickness(8, 3), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = text, FontSize = 9, Foreground = TextSecondary } };b.PointerPressed += (_, _) => onClick();return b;@@ -120,7 +111,7 @@ internal sealed class UtilityDeviceBody : IDeviceBodyDockPanel.SetDock(fieldHead, Dock.Top); fieldStack.Children.Add(fieldHead);DockPanel.SetDock(corrRow, Dock.Bottom); fieldStack.Children.Add(corrRow);fieldStack.Children.Add(new Border { Child = gonio, Margin = new Thickness(0, 6, 0, 0) });- var field = Island("", 206, fieldStack, headerless: true, custom: fieldStack);+ var field = Island("", double.NaN, fieldStack, headerless: true, custom: fieldStack); // the work column takes the rest// ---------- LEVELS island --------------------------------------------Action<float> inL, inR, outL, outR;@@ -136,7 +127,11 @@ internal sealed class UtilityDeviceBody : IDeviceBodyvar levels = Island("LEVELS", 172, new StackPanel { Spacing = 2, Children = { knobRow, metersRow } });// ---------- assemble + live refresh ----------------------------------- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, Children = { routing, field, levels } };+ // Three columns, the almanac order: choice (routing) → work (stereo field) → output (levels).+ var row = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 8 };+ row.Children.Add(routing);+ Grid.SetColumn(field, 1); row.Children.Add(field);+ Grid.SetColumn(levels, 2); row.Children.Add(levels);var rootBody = new Border { Padding = new Thickness(8), Child = row };void GainMatch()@@ -160,11 +155,11 @@ internal sealed class UtilityDeviceBody : IDeviceBodygonio.Set(pairs, kPairs);float c = scope[S_Corr];corr.Set(c);- corrVal.Text = $"{c:+0.00;-0.00;0.00}";+ corrVal.Text = $"{c:+0.00;−0.00;0.00}";corrVal.Foreground = c < 0 ? Danger : c < 0.3f ? Brass : TextPrimary;inL(scope[S_InL]); inR(scope[S_InR]); outL(scope[S_OutL]); outR(scope[S_OutR]);}- widthVal.Text = $"width {P(Width_):0} %";+ widthVal.Text = $"width {P(Width_):0}\u2009%";foreach (var a in readouts) a();}ctx.AddDeviceRefresher(Refresh);@@ -181,7 +176,7 @@ internal sealed class UtilityDeviceBody : IDeviceBodyControl inner = headerless ? custom! : new StackPanel { Spacing = 6, Children = {new TextBlock { Text = title, FontSize = 9, FontWeight = FontWeight.Bold, Foreground = TextSecondary }, body } };return new Border { Width = width, Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(7), Padding = new Thickness(9, 8), Child = inner };+ CornerRadius = NotaRadius.Panel, Padding = new Thickness(9, 8), Child = inner };}// IN/OUT peak meter: two vertical bars (L/R) with peak-hold + a caption. Returns@@ -191,8 +186,8 @@ internal sealed class UtilityDeviceBody : IDeviceBodyBorder Bar(out Action<float> set){const double H = 96;- var fill = new Border { Background = Success, CornerRadius = new CornerRadius(1), VerticalAlignment = VerticalAlignment.Bottom, Height = 0 };- var track = new Border { Width = 9, Height = H, Background = Sunken, CornerRadius = new CornerRadius(2), ClipToBounds = true, Child = fill };+ var fill = new Border { Background = Success, CornerRadius = NotaRadius.Bar, VerticalAlignment = VerticalAlignment.Bottom, Height = 0 };+ var track = new Border { Width = 9, Height = H, Background = Sunken, CornerRadius = NotaRadius.Clip, ClipToBounds = true, Child = fill };float hold = -120;set = peak =>{diff --git a/src/managed/Nota.App/DeviceCards/Bodies/VintageDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/VintageDeviceBody.csindex 483b4f21..c979bba7 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/VintageDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/VintageDeviceBody.cs@@ -25,8 +25,9 @@ internal sealed class VintageDeviceBody : IDeviceBodyprivate static readonly string[] OsNames = { "Off", "2×", "4×", "8×" };private static readonly string[] Modes = { "Vinyl", "Cassette", "Reel", "VHS", "Tube", "Analog" };- public double Width => 660;- public bool AutoWidth => true; // fixed-width islands → card sizes to content, always fits+ public double Width => 700; // the almanac device format: 700 × 260; the viz column takes the slack++ public string? Subtitle => "CHARACTER"; // the processing type, shown as the header badgepublic Control Build(DeviceCardContext ctx, int index){@@ -47,9 +48,9 @@ internal sealed class VintageDeviceBody : IDeviceBodyctx.AddDeviceRefresher(viz.Tick);// ---- formatters ----- static string PctF(double v) => $"{v * 100:0}%";- static string Bip(double v) => $"{(v - 0.5) * 200:+0;-0;0}%";- static string GainF(double v) => $"{(v - 0.5) * 24:+0.0;-0.0;0.0} dB";+ static string PctF(double v) => $"{v * 100:0}\u2009%";+ static string Bip(double v) => $"{(v - 0.5) * 200:+0;−0;0}\u2009%";+ static string GainF(double v) => $"{(v - 0.5) * 24:+0.0;−0.0;0.0}\u2009dB";// ---- gauge-knob cell (shared Knob + value + caption) ----Control Cell(string name, int p, Func<double, string> fmt, IBrush? arc = null, double size = 40)@@ -74,7 +75,7 @@ internal sealed class VintageDeviceBody : IDeviceBody{Background = Card2, BorderBrush = teal ? Teal : BorderDef,BorderThickness = teal ? new Thickness(2, 1, 1, 1) : new Thickness(1),- CornerRadius = new CornerRadius(7), Padding = new Thickness(9, 8), Child = body,+ CornerRadius = NotaRadius.Panel, Padding = new Thickness(9, 8), Child = body,};static TextBlock Head(string t, IBrush? c = null) => new() { Text = t, FontSize = 9, FontWeight = FontWeight.Bold, Foreground = c ?? TextTertiary, Margin = new Thickness(0, 0, 0, 7) };@@ -87,7 +88,7 @@ internal sealed class VintageDeviceBody : IDeviceBodyint vi = i;var chip = new Border{- Background = Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4),+ Background = Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control,Padding = new Thickness(0, 3), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = Modes[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center },};@@ -106,7 +107,7 @@ internal sealed class VintageDeviceBody : IDeviceBodyfor (int i = 0; i < 4; i++){int vi = i;- var chip = new Border { Background = Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(7, 2), Cursor = new Cursor(StandardCursorType.Hand),+ var chip = new Border { Background = Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(7, 2), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = OsNames[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center } };chip.PointerPressed += (_, e) => { e.Handled = true; SetP(OS, vi / 3f); SyncOs(); };osChips[i] = chip; osRow.Children.Add(chip);@@ -134,14 +135,13 @@ internal sealed class VintageDeviceBody : IDeviceBody} });// ---- SHAPE panel: the character viz as its own island ----- viz.Width = 220;var vizPanel = Panel(viz);vizPanel.VerticalAlignment = VerticalAlignment.Stretch;SyncViz();ctx.AddDeviceRefresher(SyncViz);- var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,Auto"), ColumnSpacing = 6, HorizontalAlignment = HorizontalAlignment.Left };+ var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,*"), ColumnSpacing = 6 };grid.Children.Add(charPanel);Grid.SetColumn(wearPanel, 1); grid.Children.Add(wearPanel);Grid.SetColumn(vizPanel, 2); grid.Children.Add(vizPanel);diff --git a/src/managed/Nota.App/DeviceCards/DeviceParamControls.cs b/src/managed/Nota.App/DeviceCards/DeviceParamControls.csindex c8eee306..3baf59fa 100644--- a/src/managed/Nota.App/DeviceCards/DeviceParamControls.cs+++ b/src/managed/Nota.App/DeviceCards/DeviceParamControls.cs@@ -21,7 +21,7 @@ namespace Nota.App;internal static class DeviceParamControls{- internal static string Fmt(float v) => Math.Abs(v) >= 100 ? v.ToString("0", CultureInfo.InvariantCulture) : v.ToString("0.0", CultureInfo.InvariantCulture);+ internal static string Fmt(float v) => Math.Abs(v) >= 100 ? v.ToString("0", NotaNum.Culture) : v.ToString("0.0", NotaNum.Culture);internal static Control ParamBars(DeviceCardContext ctx, int index){@@ -77,7 +77,7 @@ internal static class DeviceParamControls// Source: "None" first, then every track except this one.var ids = new List<int> { -1 };- var combo = new ComboBox { HorizontalAlignment = HorizontalAlignment.Stretch, FontSize = 10 };+ var combo = new ComboBox { HorizontalAlignment = HorizontalAlignment.Stretch, FontSize = 9 };combo.Items.Add("None");int n = engine.TrackCount;for (int i = 0; i < n; i++)@@ -103,7 +103,7 @@ internal static class DeviceParamControlsvar tap = new Border{Background = Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(5), Padding = new Thickness(6, 3), Cursor = new Cursor(StandardCursorType.Hand),+ CornerRadius = NotaRadius.Tile, Padding = new Thickness(6, 3), Cursor = new Cursor(StandardCursorType.Hand),HorizontalAlignment = HorizontalAlignment.Stretch, Child = tapText,};tap.PointerPressed += (_, _) =>@@ -114,10 +114,10 @@ internal static class DeviceParamControls// Gain (−24..+24 dB) and Mix (0..100%) sliders.var gain = ScFaderRow("GAIN", (engine.DeviceSidechainGain(track, di) + 24f) / 48f,- g => $"{g * 48f - 24f:+0.0;-0.0;0.0} dB",+ g => $"{g * 48f - 24f:+0.0;−0.0;0.0}\u2009dB",g => engine.SetDeviceSidechainGain(track, di, (float)(g * 48.0 - 24.0)));var mix = ScFaderRow("MIX", engine.DeviceSidechainMix(track, di),- m => $"{m * 100f:0} %",+ m => $"{m * 100f:0}\u2009%",m => engine.SetDeviceSidechainMix(track, di, (float)m));return new StackPanel { Spacing = 5, Children = { label, combo, tap, gain, mix } };diff --git a/src/managed/Nota.App/DeviceCards/IDeviceBody.cs b/src/managed/Nota.App/DeviceCards/IDeviceBody.csindex 9bda3741..56b33d4a 100644--- a/src/managed/Nota.App/DeviceCards/IDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/IDeviceBody.cs@@ -21,11 +21,11 @@ internal interface IDeviceBodybool AutoWidth => false;/// <summary>When true, the body manages its own padding (e.g. a full-width LIVE strip)- /// and the shell wraps it with no inset. Default false = the shell pads the body 8px.</summary>+ /// and the shell wraps it with no inset. Default false = the shell pads the body 6px (NotaSpace.DeviceInset).</summary>bool FullBleed => false;- /// <summary>Tag shown after the device name in the shared header (e.g. "HYBRID");- /// null = the default "BUILT-IN".</summary>+ /// <summary>The processing type, shown as the mono caps badge on the right of the header+ /// (e.g. "HYBRID", "DYNAMICS"); null shows no badge.</summary>string? Subtitle => null;Control Build(DeviceCardContext ctx, int deviceIndex);diff --git a/src/managed/Nota.App/DeviceCards/Instruments/AuroraInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/AuroraInstrumentCard.csindex 4c5636c1..5bd398ad 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/AuroraInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/AuroraInstrumentCard.cs@@ -80,30 +80,23 @@ internal sealed class AuroraInstrumentCard : IInstrumentCardControl Chips(string id, string[] names, double fs = 9){- int n = names.Length; var arr = new Border[n];- void Hi() { int cur = Sel(id, n); for (int i = 0; i < n; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Brushes.Transparent; arr[i].BorderBrush = on ? Amber : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : MutedC; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(4, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, Foreground = MutedC } }; c.PointerPressed += (_, _) => { SetP(id, iv / (float)(n - 1)); Hi(); Refresh(); }; arr[i] = c; row.Children.Add(c); }- readouts.Add(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ int n = names.Length;+ var seg = DeviceCardKit.Segments(names, () => Sel(id, n), iv => { SetP(id, iv / (float)(n - 1)); Refresh(); }, out var sync);+ readouts.Add(sync);if (I(id) is var pi and >= 0) MidiLearn.Bind(seg, MidiTarget.PluginParam(track, -1, pi), id);return seg;}// Local segmented toggle (not a param).Control Seg(string[] names, int initial, Action<int> onPick, double fs = 9){- var arr = new Border[names.Length]; int cur = initial;- void Hi() { for (int i = 0; i < arr.Length; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : MutedC; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < names.Length; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, FontWeight = FontWeight.SemiBold, Foreground = MutedC } }; c.PointerPressed += (_, _) => { cur = iv; Hi(); onPick(iv); }; arr[i] = c; row.Children.Add(c); }- Hi();- return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ int cur = initial;+ return DeviceCardKit.Segments(names, () => cur, iv => { cur = iv; onPick(iv); }, out _);}// Param-backed on/off pill.Control Toggle(string id, string label){- var b = new Border { CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.SemiBold } };- void Hi() { bool on = G(id) > 0.5f; b.Background = on ? AmberSubtle : Inset; b.BorderBrush = on ? Amber : Border2; ((TextBlock)b.Child!).Foreground = on ? AmberLit : MutedC; }+ var b = new Border { CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.SemiBold } };+ void Hi() { bool on = G(id) > 0.5f; b.Background = on ? NotaPalette.AccentSubtle : Inset; b.BorderBrush = on ? NotaPalette.BorderBrass : Border2; ((TextBlock)b.Child!).Foreground = on ? NotaPalette.AccentHover : MutedC; }b.PointerPressed += (_, _) => { SetP(id, G(id) > 0.5f ? 0f : 1f); Hi(); Refresh(); };readouts.Add(Hi); Hi();if (I(id) is var pi and >= 0) MidiLearn.Bind(b, MidiTarget.PluginParam(track, -1, pi), label);@@ -112,29 +105,17 @@ internal sealed class AuroraInstrumentCard : IInstrumentCardControl Slider(string id, string name, Func<double, string> fmt, double w){int pi = I(id);- var bg = new Border { Width = w, Height = 3, Background = Inset, CornerRadius = new CornerRadius(2) };- var fill = new Border { Height = 3, Background = Amber, CornerRadius = new CornerRadius(2) };- var handle = new Border { Width = 8, Height = 9, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2) };- var canvas = new Canvas { Width = w, Height = 9, Background = Brushes.Transparent, VerticalAlignment = VerticalAlignment.Center };- Canvas.SetTop(bg, 3); Canvas.SetTop(fill, 3); Canvas.SetTop(handle, 0);- canvas.Children.Add(bg); canvas.Children.Add(fill); canvas.Children.Add(handle);- var val = new TextBlock { FontSize = 9, Foreground = TxtC, Width = 54, VerticalAlignment = VerticalAlignment.Center };- val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- bool drag = false;- void Vis(double v) { fill.Width = Math.Max(0, v * w); Canvas.SetLeft(handle, v * w - 4); val.Text = fmt(v); }- void From(PointerEventArgs e) { double v = Math.Clamp(e.GetPosition(canvas).X / w, 0, 1); if (pi >= 0) engine.PluginParamSet(track, -1, pi, (float)v); Vis(v); Refresh(); }- canvas.PointerPressed += (_, e) => { drag = true; if (pi >= 0) engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); e.Pointer.Capture(canvas); From(e); };- canvas.PointerMoved += (_, e) => { if (drag) From(e); };- canvas.PointerReleased += (_, e) => { if (drag) { drag = false; if (pi >= 0) engine.EndAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); e.Pointer.Capture(null); } };- readouts.Add(() => { if (!drag) Vis(G(id)); });- Vis(G(id));- var host = Row(6, Lbl(name, 8, MutedC), canvas, val);- if (pi >= 0) MidiLearn.Bind(host, MidiTarget.PluginParam(track, -1, pi), name);- return host;+ var row = DeviceCardKit.SliderRow(name, () => G(id), n => { if (pi >= 0) engine.PluginParamSet(track, -1, pi, (float)n); Refresh(); }, () => fmt(G(id)), out var sync,+ begin: () => { if (pi >= 0) engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); },+ end: () => { if (pi >= 0) engine.EndAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); },+ trackWidth: w, valueWidth: 54);+ readouts.Add(sync);+ if (pi >= 0) MidiLearn.Bind(row, MidiTarget.PluginParam(track, -1, pi), name);+ return row;}// ---- LIVE strip ----- string Hz(double v) { double f = 20 * Math.Pow(900, v); return f >= 1000 ? $"{f / 1000:0.00} kHz" : $"{f:0} Hz"; }+ string Hz(double v) { double f = 20 * Math.Pow(900, v); return f >= 1000 ? $"{f / 1000:0.0}\u2009k" : $"{f:0}\u2009Hz"; }var monoSeg = Seg(new[] { "Poly", "Mono" }, G("mono") > 0.5f ? 1 : 0, i => { SetP("mono", i); }, 9);DockPanel.SetDock(monoSeg, Dock.Right);var liveStrip = new Border { Height = 34, Background = HdrBg, BorderBrush = Border2, BorderThickness = new Thickness(0, 0, 0, 1),@@ -142,13 +123,13 @@ internal sealed class AuroraInstrumentCard : IInstrumentCardnew StackPanel { Orientation = Orientation.Horizontal, Spacing = 12, VerticalAlignment = VerticalAlignment.Center, Children = {Slider("position", "POS 1", v => $"frame {1 + (int)Math.Round(v * 15)}/16", 76),Slider("cutoff", "CUTOFF", Hz, 76),- Slider("unidetune", "UNISON", v => $"{v * 50:0} c", 56) } } } } };+ Slider("unidetune", "UNISON", v => $"{v * 50:0}\u2009c", 56) } } } } };// ---- Osc tab ----// Clickable label that cycles through an n-way selector param (for osc2's bank).Control Cycle(string id, string[] names){- var b = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), BorderBrush = Border2, Background = Inset, Padding = new Thickness(5, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { FontSize = 8, Foreground = AmberLit } };+ var b = new Border { CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), BorderBrush = Border2, Background = Inset, Padding = new Thickness(5, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { FontSize = 8, Foreground = AmberLit } };void Hi() => ((TextBlock)b.Child!).Text = names[Sel(id, names.Length)];b.PointerPressed += (_, _) => { SetP(id, (float)((Sel(id, names.Length) + 1) % names.Length) / (names.Length - 1)); Hi(); Refresh(); };readouts.Add(Hi); Hi(); return b;@@ -158,9 +139,9 @@ internal sealed class AuroraInstrumentCard : IInstrumentCardControl DragCell(string id, string name, Func<double, string> fmt){int pi = I(id);- var val = new TextBlock { Text = fmt(G(id)), FontSize = 10, Foreground = TxtC, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };+ var val = new TextBlock { Text = fmt(G(id)), FontSize = 9, Foreground = TxtC, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- var field = new Border { MinWidth = 40, Height = 17, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(3, 0), Cursor = new Cursor(StandardCursorType.SizeWestEast), Child = val };+ var field = new Border { MinWidth = 40, Height = 17, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(3, 0), Cursor = new Cursor(StandardCursorType.SizeWestEast), Child = val };bool drag = false; double sx = 0, sv = 0;field.PointerPressed += (_, e) =>{@@ -189,26 +170,26 @@ internal sealed class AuroraInstrumentCard : IInstrumentCardstack.Margin = new Thickness(2);var overlay = new StackPanel { Margin = new Thickness(9, 7), VerticalAlignment = VerticalAlignment.Top, HorizontalAlignment = HorizontalAlignment.Left, Spacing = 1, IsHitTestVisible = false,Children = { tableCap, frameCap, new TextBlock { Text = "env1 → pos", FontSize = 8, Foreground = TealC } } };- var view = new Border { Width = 238, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Child = new Panel { Children = { stack, overlay } } };+ var view = new Border { Width = 238, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Child = new Panel { Children = { stack, overlay } } };var bankWarp = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 12, Children = {Chips("table", Banks),new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Lbl("WARP", 8, MutedC), Chips("osc1warpmode", WarpModes, 8) } } } };- string OctF(double v) { int o = (int)Math.Round((v - 0.5) * 4) - 1; return $"{o:+0;-0;0} oct"; }+ string OctF(double v) { int o = (int)Math.Round((v - 0.5) * 4) - 1; return $"{o:+0;−0;0}\u2009oct"; }var subUni = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = {Lbl("SUB", 9, TxtC), Chips("subwave", new[] { "sin", "sqr", "tri" }, 8),- DragCell("sublevel", "LVL", v => $"{v * 100:0}%"), DragCell("suboct", "OCT", OctF),+ DragCell("sublevel", "LEVEL", v => $"{v * 100:0}\u2009%"), DragCell("suboct", "OCT", OctF),new Border { Width = 1, Height = 30, Background = Border2, Margin = new Thickness(3, 0) },Lbl("UNI", 9, TxtC),DragCell("unison", "VC", v => $"{1 + (int)Math.Round(v * 6)}"),- DragCell("unidetune", "DET", v => $"{v * 50:0}c"),- DragCell("unispread", "SPR", v => $"{v * 100:0}%") } };+ DragCell("unidetune", "DETUNE", v => $"{v * 50:0}c"),+ DragCell("unispread", "SPREAD", v => $"{v * 100:0}\u2009%") } };Control Kb(string id, string name) => K(id, name, false, 32, 54);var rightCol = new StackPanel { Spacing = 2, VerticalAlignment = VerticalAlignment.Center, Children = {bankWarp,- OscRow("OSC 1", Toggle("osc1on", "on"), Kb("position", "POS"), Kb("warp", "WARP"), Kb("osc1level", "LEVEL"), Kb("osc1semi", "PITCH")),+ OscRow("OSC 1", Toggle("osc1on", "on"), Kb("position", "POSITION"), Kb("warp", "WARP"), Kb("osc1level", "LEVEL"), Kb("osc1semi", "PITCH")),HDiv(),- OscRow("OSC 2", Cycle("osc2table", Banks), Kb("osc2position", "POS"), Kb("osc2warp", "WARP"), Kb("osc2level", "LEVEL"), Kb("osc2semi", "PITCH")),+ OscRow("OSC 2", Cycle("osc2table", Banks), Kb("osc2position", "POSITION"), Kb("osc2warp", "WARP"), Kb("osc2level", "LEVEL"), Kb("osc2semi", "PITCH")),HDiv(),subUni } };var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), ColumnSpacing = 8, VerticalAlignment = VerticalAlignment.Stretch };@@ -222,13 +203,13 @@ internal sealed class AuroraInstrumentCard : IInstrumentCardvar filtKnobsHost = new ContentControl { VerticalAlignment = VerticalAlignment.Center };var filtCap = new TextBlock { FontSize = 8, Foreground = TealC, VerticalAlignment = VerticalAlignment.Center };filtCap.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- readouts.Add(() => { string pre = fsel == 0 ? "fil1" : "fil2"; int en = (int)Math.Round((G(pre + "env") - 0.5) * 200); int lf = (int)Math.Round((G(pre + "lfo") - 0.5) * 200); filtCap.Text = $"← env2 {en:+0;-0;0} · lfo1 {lf:+0;-0;0}"; });+ readouts.Add(() => { string pre = fsel == 0 ? "fil1" : "fil2"; int en = (int)Math.Round((G(pre + "env") - 0.5) * 200); int lf = (int)Math.Round((G(pre + "lfo") - 0.5) * 200); filtCap.Text = $"← env2 {en:+0;−0;0} · lfo1 {lf:+0;−0;0}"; });void ApplyFilterSel(){string pre = fsel == 0 ? "fil1" : "fil2"; string freq = fsel == 0 ? "cutoff" : "fil2freq", res = fsel == 0 ? "resonance" : "fil2reso";filtTypeHost.Content = Chips(pre + "type", FiltTypes);- filtSlopeHost.Content = Seg(new[] { "12 dB", "24 dB" }, G(pre + "slope") > 0.5f ? 1 : 0, i => { SetP(pre + "slope", i); }, 8);- filtKnobsHost.Content = Row(2, K(freq, "FREQ"), K(res, "RES"), K(pre + "env", "ENV", true), K(pre + "lfo", "LFO", true));+ filtSlopeHost.Content = Seg(new[] { "12\u2009dB", "24\u2009dB" }, G(pre + "slope") > 0.5f ? 1 : 0, i => { SetP(pre + "slope", i); }, 8);+ filtKnobsHost.Content = Row(2, K(freq, "FREQ"), K(res, "RESO"), K(pre + "env", "ENV", true), K(pre + "lfo", "LFO", true));Refresh();}Control RouteRow(string title, string id) => new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { new TextBlock { Text = title, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedC, Width = 30, VerticalAlignment = VerticalAlignment.Center }, Chips(id, Routes, 8) } };@@ -255,11 +236,11 @@ internal sealed class AuroraInstrumentCard : IInstrumentCardgv.Target(title, P(ids[0]), P(ids[1]), P(ids[2]), P(ids[3])); gv.VerticalAlignment = VerticalAlignment.Stretch;string[] lbl = { "A", "D", "S", "R" };var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,*,*,*"), ColumnSpacing = 4, Margin = new Thickness(0, 5, 0, 0) };- for (int k = 0; k < 4; k++) { var v = new TextBlock { Text = Pct(G(ids[k])), FontSize = 9, Foreground = TxtC, HorizontalAlignment = HorizontalAlignment.Center }; v.BindResource(TextBlock.FontFamilyProperty, "Font.Mono"); string pid = ids[k]; readouts.Add(() => v.Text = Pct(G(pid))); var cell = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(2, 2), Child = new StackPanel { Children = { new TextBlock { Text = lbl[k], FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedC, HorizontalAlignment = HorizontalAlignment.Center }, v } } }; Grid.SetColumn(cell, k); grid.Children.Add(cell); }+ for (int k = 0; k < 4; k++) { var v = new TextBlock { Text = Pct(G(ids[k])), FontSize = 9, Foreground = TxtC, HorizontalAlignment = HorizontalAlignment.Center }; v.BindResource(TextBlock.FontFamilyProperty, "Font.Mono"); string pid = ids[k]; readouts.Add(() => v.Text = Pct(G(pid))); var cell = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(2, 2), Child = new StackPanel { Children = { new TextBlock { Text = lbl[k], FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedC, HorizontalAlignment = HorizontalAlignment.Center }, v } } }; Grid.SetColumn(cell, k); grid.Children.Add(cell); }DockPanel.SetDock(grid, Dock.Bottom);var head = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, Children = { Lbl(title, 9, TxtC), new TextBlock { Text = route, FontSize = 8, Foreground = TealC, VerticalAlignment = VerticalAlignment.Center } } };DockPanel.SetDock(head, Dock.Top);- return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(8, 6), Child = new DockPanel { LastChildFill = true, Children = { head, grid, gv } } };+ return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(8, 6), Child = new DockPanel { LastChildFill = true, Children = { head, grid, gv } } };}Control EnvTab(){@@ -275,7 +256,7 @@ internal sealed class AuroraInstrumentCard : IInstrumentCard{var head = new StackPanel { Width = 116, Spacing = 3, VerticalAlignment = VerticalAlignment.Center, Children = { Lbl(title, 9, TxtC) } };if (extra != null) head.Children.Add(extra);- return new Border { Height = 64, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(8, 2), Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center, Children = { head, Row(2, knobs) } } };+ return new Border { Height = 64, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(8, 2), Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center, Children = { head, Row(2, knobs) } } };}Control LfoTab() => new StackPanel { Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = {LfoLane("LFO 1", Chips("lfo1shape", new[] { "sin", "tri", "sqr", "S&H" }, 8), K("lfo1rate", "RATE"), K("lfo1depth", "DEPTH", true), K("lfo1sync", "SYNC")),@@ -292,13 +273,13 @@ internal sealed class AuroraInstrumentCard : IInstrumentCardvoid SyncDest() => dest.Text = "→ " + DestNames[Sel($"mac{m}dest", 7)];dest.PointerPressed += (_, _) => { SetP($"mac{m}dest", ((Sel($"mac{m}dest", 7) + 1) % 7) / 6f); SyncDest(); };readouts.Add(SyncDest); SyncDest();- return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(4, 4), Child = new StackPanel { Spacing = 1, HorizontalAlignment = HorizontalAlignment.Center, Children = { Row(2, K($"mac{m}val", $"M{m + 1}"), K($"mac{m}amt", "AMT", true)), dest } } };+ return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(4, 4), Child = new StackPanel { Spacing = 1, HorizontalAlignment = HorizontalAlignment.Center, Children = { Row(2, K($"mac{m}val", $"M{m + 1}"), K($"mac{m}amt", "AMOUNT", true)), dest } } };}Control ModTab(){var macros = new StackPanel { Width = 130, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Lbl("MACROS", 8, TxtC) } };for (int m = 0; m < 4; m++) macros.Children.Add(MacroCell(m));- var clear = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = "Clear all", FontSize = 9, Foreground = MutedC } };+ var clear = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = "Clear all", FontSize = 9, Foreground = MutedC } };clear.PointerPressed += (_, _) => matrix.ClearAll();var head = new DockPanel { Margin = new Thickness(0, 0, 0, 4), LastChildFill = false, Children = { clear, Lbl("MOD MATRIX", 9, TxtC) } };DockPanel.SetDock(clear, Dock.Right); DockPanel.SetDock(head, Dock.Top);@@ -310,9 +291,9 @@ internal sealed class AuroraInstrumentCard : IInstrumentCard// ---- FX tab ----Control FxTab() => new StackPanel { Orientation = Orientation.Horizontal, Spacing = 16, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Children = {- new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(10, 8), Child = new StackPanel { Children = { Lbl("DRIVE", 8, TxtC), Row(2, K("fxdrive", "AMOUNT", false, 44, 60)) } } },- new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(10, 8), Child = new StackPanel { Children = { Lbl("CHORUS", 8, TxtC), Row(2, K("fxchorus", "AMOUNT", false, 44, 60), K("fxchorusrate", "RATE", false, 44, 60)) } } },- new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(10, 8), Child = new StackPanel { Children = { Lbl("REVERB", 8, TxtC), Row(2, K("fxreverb", "AMOUNT", false, 44, 60)) } } } } };+ new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(10, 8), Child = new StackPanel { Children = { Lbl("DRIVE", 8, TxtC), Row(2, K("fxdrive", "AMOUNT", false, 44, 60)) } } },+ new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(10, 8), Child = new StackPanel { Children = { Lbl("CHORUS", 8, TxtC), Row(2, K("fxchorus", "AMOUNT", false, 44, 60), K("fxchorusrate", "RATE", false, 44, 60)) } } },+ new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(10, 8), Child = new StackPanel { Children = { Lbl("REVERB", 8, TxtC), Row(2, K("fxreverb", "AMOUNT", false, 44, 60)) } } } } };// ---- tab rail + body ----var tabHost = new ContentControl { VerticalAlignment = VerticalAlignment.Stretch };@@ -326,7 +307,7 @@ internal sealed class AuroraInstrumentCard : IInstrumentCardfor (int i = 0; i < tabs.Length; i++){int iv = i;- var b = new Border { Height = 22, CornerRadius = new CornerRadius(4), Padding = new Thickness(8, 0), BorderThickness = new Thickness(2, 0, 0, 0), BorderBrush = Brushes.Transparent, Child = new TextBlock { Text = tabs[i], FontSize = 10, FontWeight = FontWeight.Medium, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center } };+ var b = new Border { Height = 22, CornerRadius = NotaRadius.Control, Padding = new Thickness(8, 0), BorderThickness = new Thickness(2, 0, 0, 0), BorderBrush = Brushes.Transparent, Child = new TextBlock { Text = tabs[i], FontSize = 9, FontWeight = FontWeight.Medium, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center } };b.PointerPressed += (_, _) => { tabSel = iv; HiTabs(); tabHost.Content = TabBody(iv); };tabBtns[i] = b; railCol.Children.Add(b);}diff --git a/src/managed/Nota.App/DeviceCards/Instruments/BassInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/BassInstrumentCard.csindex b3b40665..58c32852 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/BassInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/BassInstrumentCard.cs@@ -76,18 +76,14 @@ internal sealed class BassInstrumentCard : IInstrumentCard{ var sp = new StackPanel { Orientation = Orientation.Horizontal, Spacing = spacing, VerticalAlignment = VerticalAlignment.Center }; foreach (var c in cs) sp.Children.Add(c); return sp; }Control Lbl(string t, double fs, IBrush c) => new TextBlock { Text = t, FontSize = fs, FontWeight = FontWeight.Bold, Foreground = c, VerticalAlignment = VerticalAlignment.Center };Control Cap(string t, IBrush? c = null) => new TextBlock { Text = t, FontSize = 9, Foreground = c ?? MutedC, VerticalAlignment = VerticalAlignment.Center };- Control Arrow() => new TextBlock { Text = "▸", FontSize = 12, Foreground = ArrowC, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(1, 0) };+ Control Arrow() => new Glyph(GlyphKind.ChevronRight, 9) { Foreground = ArrowC, Margin = new Thickness(1, 0) };// Param-backed chip strip.Control Chips(string id, string[] names, double fs = 9){- int n = names.Length; var arr = new Border[n];- void Hi() { int cur = Sel(id, n); for (int i = 0; i < n; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Brushes.Transparent; arr[i].BorderBrush = on ? Amber : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : MutedC; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++)- { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(6, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, Foreground = MutedC } }; c.PointerPressed += (_, _) => { SetP(id, iv / (float)(n - 1)); Hi(); Refresh(); }; arr[i] = c; row.Children.Add(c); }- readouts.Add(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ int n = names.Length;+ var seg = DeviceCardKit.Segments(names, () => Sel(id, n), iv => { SetP(id, iv / (float)(n - 1)); Refresh(); }, out var sync);+ readouts.Add(sync);if (I(id) is var pi and >= 0) MidiLearn.Bind(seg, MidiTarget.PluginParam(track, -1, pi), id);return seg;}@@ -96,10 +92,10 @@ internal sealed class BassInstrumentCard : IInstrumentCardControl SubWaveChips(){int[] waveIcon = { 3, 1, 2 }; int n = 3; var arr = new Border[n]; var ic = new WaveIcon[n];- void Hi() { int cur = Sel("subwave", 3); for (int i = 0; i < n; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Inset; arr[i].BorderBrush = on ? Amber : Border2; ic[i].Stroke = on ? AmberLit : MutedC; ic[i].InvalidateVisual(); } }+ void Hi() { int cur = Sel("subwave", 3); for (int i = 0; i < n; i++) { bool on = i == cur; arr[i].Background = on ? Amber : Inset; arr[i].BorderBrush = on ? Amber : Border2; ic[i].Stroke = on ? NotaPalette.TextOnAccent : MutedC; ic[i].InvalidateVisual(); } }var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 3, VerticalAlignment = VerticalAlignment.Center };for (int i = 0; i < n; i++)- { int iv = i; var wi = new WaveIcon(waveIcon[i]) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }; var b = new Border { Width = 30, Height = 22, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Cursor = new Cursor(StandardCursorType.Hand), Child = wi }; b.PointerPressed += (_, _) => { SetP("subwave", iv / 2f); Hi(); Refresh(); }; arr[i] = b; ic[i] = wi; row.Children.Add(b); }+ { int iv = i; var wi = new WaveIcon(waveIcon[i]) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }; var b = new Border { Width = 30, Height = 22, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Cursor = new Cursor(StandardCursorType.Hand), Child = wi }; b.PointerPressed += (_, _) => { SetP("subwave", iv / 2f); Hi(); Refresh(); }; arr[i] = b; ic[i] = wi; row.Children.Add(b); }readouts.Add(Hi); Hi();if (I("subwave") is var pi and >= 0) MidiLearn.Bind(row, MidiTarget.PluginParam(track, -1, pi), "subwave");return row;@@ -108,13 +104,8 @@ internal sealed class BassInstrumentCard : IInstrumentCard// Local (non-param) segmented toggle.Control Seg(string[] names, int initial, Action<int> onPick, double fs = 9){- var arr = new Border[names.Length]; int cur = initial;- void Hi() { for (int i = 0; i < arr.Length; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : MutedC; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < names.Length; i++)- { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, FontWeight = FontWeight.SemiBold, Foreground = MutedC } }; c.PointerPressed += (_, _) => { cur = iv; Hi(); onPick(iv); }; arr[i] = c; row.Children.Add(c); }- Hi();- return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ int cur = initial;+ return DeviceCardKit.Segments(names, () => cur, iv => { cur = iv; onPick(iv); }, out _);}// Panel frame: header + body in a bordered box. Set stretchBody=true when the@@ -126,19 +117,19 @@ internal sealed class BassInstrumentCard : IInstrumentCardvar host = new Border { Child = body };if (!stretchBody) { host.VerticalAlignment = VerticalAlignment.Center; host.HorizontalAlignment = HorizontalAlignment.Center; }Grid.SetRow(host, 1); grid.Children.Add(host);- return new Border { Width = width, Background = HdrBg, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(7), Padding = new Thickness(9, 8), Child = grid };+ return new Border { Width = width, Background = HdrBg, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(9, 8), Child = grid };}// ---- readout formatters ----string ShapeName(float s) => s < 0.17f ? "sine" : s < 0.42f ? "tri" : s < 0.75f ? "saw" : "pulse";- string OctLabel(float v) { int o = (int)Math.Round((v - 0.5f) * 4f); return o.ToString("+0;-0;0"); }- string ModLabel(float v) { int m = (int)Math.Round((v - 0.5f) * 200f); return m.ToString("+0;-0;0"); }+ string OctLabel(float v) { int o = (int)Math.Round((v - 0.5f) * 4f); return o.ToString("+0;−0;0"); }+ string ModLabel(float v) { int m = (int)Math.Round((v - 0.5f) * 200f); return m.ToString("+0;−0;0"); }// ---- SIGNAL PATH tab ----// OSC: continuous Shape + PW + tuning + level.var oscCap = new TextBlock { FontSize = 9, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Right };oscCap.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- readouts.Add(() => oscCap.Text = ShapeName(G("oscshape")) + " · " + OctLabel(G("oscoctave")) + " oct");+ readouts.Add(() => oscCap.Text = ShapeName(G("oscshape")) + " · " + OctLabel(G("oscoctave")) + "\u2009oct");var oscHead = new DockPanel { Children = { oscCap, Lbl("OSC", 10, TxtC) } };DockPanel.SetDock(oscCap, Dock.Right);var oscBody = Row(2, K("oscshape", "SHAPE"), K("oscpw", "PW"), K("oscoctave", "OCTAVE"), K("oscsemi", "SEMI"), K("osclevel", "LEVEL"));@@ -169,11 +160,11 @@ internal sealed class BassInstrumentCard : IInstrumentCardDockPanel.SetDock(filtCap, Dock.Right);var filterHeader = new DockPanel { Margin = new Thickness(0, 0, 0, 6), Children = { filtCap, filtHeadLeft } };DockPanel.SetDock(filterHeader, Dock.Top);- var filterBox = new Border { Width = 404, Background = HdrBg, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(7), Padding = new Thickness(9, 8), Child = new DockPanel { LastChildFill = true, Children = { filterHeader, filterBody } } };+ var filterBox = new Border { Width = 404, Background = HdrBg, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(9, 8), Child = new DockPanel { LastChildFill = true, Children = { filterHeader, filterBody } } };// OUTPUT: drive + volume.var outBody = new StackPanel { Spacing = 8, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Children = { K("drive", "DRIVE"), K("volume", "VOLUME") } };- var outBox = Panel(90, new TextBlock { Text = "OUTPUT", FontSize = 10, FontWeight = FontWeight.Bold, Foreground = TxtC, HorizontalAlignment = HorizontalAlignment.Center }, outBody);+ var outBox = Panel(90, new TextBlock { Text = "OUTPUT", FontSize = 9, FontWeight = FontWeight.Bold, Foreground = TxtC, HorizontalAlignment = HorizontalAlignment.Center }, outBody);var signalPath = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Stretch,Children = { oscBox, Arrow(), subBox, Arrow(), filterBox, Arrow(), outBox } };@@ -192,7 +183,7 @@ internal sealed class BassInstrumentCard : IInstrumentCardvar v = new TextBlock { Text = Pct(G(ids[k])), FontSize = 9, Foreground = TxtC, HorizontalAlignment = HorizontalAlignment.Center };v.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");string pid = ids[k]; var tv = v; readouts.Add(() => tv.Text = Pct(G(pid)));- var cell = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(2, 2),+ var cell = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(2, 2),Child = new StackPanel { Children = { new TextBlock { Text = lbl[k], FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedC, HorizontalAlignment = HorizontalAlignment.Center }, v } } };Grid.SetColumn(cell, k); grid.Children.Add(cell);}@@ -200,7 +191,7 @@ internal sealed class BassInstrumentCard : IInstrumentCardvar head = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, Children = { Lbl(title, 10, TxtC), new TextBlock { Text = route, FontSize = 9, Foreground = TealC, VerticalAlignment = VerticalAlignment.Center } } };DockPanel.SetDock(head, Dock.Top);var body = new DockPanel { LastChildFill = true, Children = { head, grid, gView } };- return new Border { Width = 300, Background = HdrBg, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(7), Padding = new Thickness(9, 8), Child = body };+ return new Border { Width = 300, Background = HdrBg, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(9, 8), Child = body };}var ampEnvBox = EnvPanel("AMP ENV", "→ Level", ampEnv, new[] { "attack", "decay", "sustain", "release" }, AmberLit);diff --git a/src/managed/Nota.App/DeviceCards/Instruments/ConsortInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/ConsortInstrumentCard.csindex ff8564a1..0422eb5a 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/ConsortInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/ConsortInstrumentCard.cs@@ -29,7 +29,7 @@ namespace Nota.App;internal sealed class ConsortInstrumentCard : IInstrumentCard{private static readonly IBrush RailBg = NotaPalette.SurfaceInset;- private static readonly IBrush Panel = NotaPalette.BgApp;+ private static readonly IBrush Panel = NotaPalette.TextOnAccent; // dark ink over an engaged fillprivate static readonly IBrush Border2 = NotaPalette.BorderDefault;private static readonly IBrush BorderIn = NotaPalette.GraphBorder;private static readonly IBrush Inset = NotaPalette.BgSunken;@@ -147,20 +147,8 @@ internal sealed class ConsortInstrumentCard : IInstrumentCard// On/off pill toggle backed by a param (> 0.5 = on).Control Toggle(string id, string label, Func<bool>? dim = null){- var pill = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), VerticalAlignment = VerticalAlignment.Center };- var dot = new Border { Width = 7, Height = 7, CornerRadius = new CornerRadius(4) };- var host = new Canvas { Width = 18, Height = 10 }; Canvas.SetTop(dot, 1.5); host.Children.Add(dot); pill.Child = host;- var txt = new TextBlock { Text = label, FontSize = 8, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center };- void Hi()- {- bool on = On(id), d = dim?.Invoke() ?? false;- pill.Background = on ? (d ? NotaPalette.BorderStrong : Amber) : OffPill; dot.Background = on ? Panel : MutedC; Canvas.SetLeft(dot, on ? 9.5 : 1.5);- txt.Foreground = d ? DimC : on ? TxtC : Txt2;- }- var wrap = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Children = { pill } };- if (label.Length > 0) wrap.Children.Add(txt);- wrap.PointerPressed += (_, e) => { if (!e.GetCurrentPoint(wrap).Properties.IsLeftButtonPressed) return; SetP(id, On(id) ? 0f : 1f); Refresh(); e.Handled = true; };- cur.Add(Hi); Hi();+ var wrap = Switch(label, () => On(id), () => { SetP(id, On(id) ? 0f : 1f); Refresh(); }, out var sync, dim);+ cur.Add(sync);if (I(id) is var pi and >= 0) MidiLearn.Bind(wrap, MidiTarget.PluginParam(track, -1, pi), label.Length > 0 ? label : id);return wrap;}@@ -168,31 +156,9 @@ internal sealed class ConsortInstrumentCard : IInstrumentCard// Segmented chips. values[i] is written on click; the lit chip is the nearest value.Control Chips(string id, string[] names, float[]? values = null, double fs = 7, Func<bool>? dim = null){- int n = names.Length;- values ??= BuildValues(n);- var arr = new Border[n];- void Hi()- {- float c0 = G(id); int best = 0;- for (int i = 1; i < n; i++) if (Math.Abs(values[i] - c0) < Math.Abs(values[best] - c0)) best = i;- bool exact = Math.Abs(values[best] - c0) < 0.02f, d = dim?.Invoke() ?? false;- for (int i = 0; i < n; i++)- {- bool on = i == best && exact;- arr[i].Background = on ? (d ? NotaPalette.BorderStrong : Amber) : Brushes.Transparent;- var tb = (TextBlock)arr[i].Child!; tb.Foreground = on ? Panel : d ? DimC : MutedC; tb.FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal;- }- }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++)- {- int iv = i;- var c = new Border { CornerRadius = new CornerRadius(2), Padding = new Thickness(4, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, Foreground = MutedC } };- c.PointerPressed += (_, e) => { SetP(id, values[iv]); Refresh(); e.Handled = true; };- arr[i] = c; row.Children.Add(c);- }- cur.Add(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Left, Child = row };+ var vals = values ?? BuildValues(names.Length);+ var seg = DeviceCardKit.Segments(names, () => DeviceCardKit.NearestExact(G(id), vals), iv => { SetP(id, vals[iv]); Refresh(); }, out var sync, dim: dim);+ cur.Add(sync);if (I(id) is var pi and >= 0) MidiLearn.Bind(seg, MidiTarget.PluginParam(track, -1, pi), id);return seg;}@@ -207,50 +173,25 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardfor (int i = 0; i < names.Length; i++){int iv = i;- var c = new Border { CornerRadius = new CornerRadius(2), Padding = new Thickness(5, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 7.5 } };+ var c = new Border { CornerRadius = NotaRadius.Clip, Padding = new Thickness(5, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 8 } };c.PointerPressed += (_, e) => { set(iv); Hi(); e.Handled = true; };arr[i] = c; row.Children.Add(c);}Hi();- return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };}// Horizontal fill slider bound to a param; `dim` greys it out.Control HSlider(string id, Func<double, string> fmt, double valW = 24, Func<bool>? dim = null, bool bipolar = false){int pi = I(id);- var fill = new Border { Height = 3, Background = Amber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 6, Height = 7, Background = Handle, CornerRadius = new CornerRadius(2) };- var lay = new Canvas { Height = 9 };- lay.Children.Add(handle); Canvas.SetTop(handle, 1);- var canvas = new Panel { Height = 11, MinWidth = 24, Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Children = {- new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center }, fill, lay } };- var val = MonoText("", 8, TxtC); val.MinWidth = valW; val.TextAlignment = TextAlignment.Right;- bool drag = false;- void Vis(double v)- {- double w = canvas.Bounds.Width; if (w <= 0) w = 80;- double a = bipolar ? Math.Min(v, 0.5) : 0, b = bipolar ? Math.Max(v, 0.5) : v;- fill.Margin = new Thickness(a * w, 0, 0, 0); fill.Width = Math.Max(0, (b - a) * w);- Canvas.SetLeft(handle, v * w - 3); val.Text = fmt(v);- bool d = dim?.Invoke() ?? false;- fill.Background = d ? NotaPalette.BorderStrong : Amber; handle.Background = d ? MutedC : Handle; val.Foreground = d ? Txt2 : TxtC;- }- void From(PointerEventArgs e) { double w = canvas.Bounds.Width; double v = w > 0 ? Math.Clamp(e.GetPosition(canvas).X / w, 0, 1) : 0; if (pi >= 0) engine.PluginParamSet(track, -1, pi, (float)v); Vis(v); Refresh(); }- canvas.PointerPressed += (_, e) =>- {- if (!e.GetCurrentPoint(canvas).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2 && pi >= 0) { SetP(id, engine.InstrumentParamDefault(track, pi)); Refresh(); e.Handled = true; return; }- drag = true; if (pi >= 0) Begin(id); e.Pointer.Capture(canvas); From(e); e.Handled = true;- };- canvas.PointerMoved += (_, e) => { if (drag) From(e); };- canvas.PointerReleased += (_, e) => { if (drag) { drag = false; if (pi >= 0) End(id); e.Pointer.Capture(null); } };- canvas.SizeChanged += (_, _) => Vis(G(id));- cur.Add(() => { if (!drag) Vis(G(id)); });- var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center };- grid.Children.Add(canvas); grid.Children.Add(Col(val, 1));- if (pi >= 0) MidiLearn.Bind(grid, MidiTarget.PluginParam(track, -1, pi), id);- return grid;+ var row = DeviceCardKit.SliderRow("", () => G(id), n => { if (pi >= 0) engine.PluginParamSet(track, -1, pi, (float)n); Refresh(); }, () => fmt(G(id)), out var sync,+ begin: () => { if (pi >= 0) Begin(id); }, end: () => { if (pi >= 0) End(id); },+ reset: pi >= 0 ? () => { SetP(id, engine.InstrumentParamDefault(track, pi)); Refresh(); } : null,+ bipolar: bipolar, dim: dim, valueWidth: valW);+ cur.Add(sync);+ if (pi >= 0) MidiLearn.Bind(row, MidiTarget.PluginParam(track, -1, pi), id);+ return row;}Control SliderRow(string label, string id, Func<double, string> fmt, double labW = 40, double valW = 26, Func<bool>? dim = null, bool bipolar = false){@@ -263,10 +204,9 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardControl VWheel(string id, string name, IBrush lit, bool spring){int pi = I(id);- var grad = new LinearGradientBrush { StartPoint = new RelativePoint(0, 0, RelativeUnit.Relative), EndPoint = new RelativePoint(0, 1, RelativeUnit.Relative),- GradientStops = { new GradientStop(NotaPalette.SurfaceRaised.Color, 0), new GradientStop(NotaPalette.BgSunken.Color, 0.5), new GradientStop(NotaPalette.SurfaceRaised.Color, 1) } };- var bar = new Border { Width = 16, Background = grad, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(8), VerticalAlignment = VerticalAlignment.Stretch };- var mark = new Border { Height = 2, Width = 12, Background = lit, CornerRadius = new CornerRadius(1) };+ IBrush grad = NotaPalette.BgSunken;+ var bar = new Border { Width = 16, Background = grad, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Pill, VerticalAlignment = VerticalAlignment.Stretch };+ var mark = new Border { Height = 2, Width = 12, Background = lit, CornerRadius = NotaRadius.Bar };var lay = new Canvas { Width = 16 };lay.Children.Add(mark); Canvas.SetLeft(mark, 2);var host = new Panel { Width = 16, VerticalAlignment = VerticalAlignment.Stretch, Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.SizeNorthSouth), Children = { bar, lay } };@@ -300,30 +240,30 @@ internal sealed class ConsortInstrumentCard : IInstrumentCard// ---- formatters -------------------------------------------------------------static double Exp(double lo, double hi, double v) => lo * Math.Pow(hi / lo, Math.Clamp(v, 0, 1));- static string Time(double s) => s >= 1 ? $"{s:0.0} s" : s >= 0.0995 ? $"{s * 1000:0} ms" : $"{s * 1000:0.#} ms";- static string ShortTime(double s) => s >= 1 ? $"{s:0.0}s" : $"{s * 1000:0}ms";- static string Pct(double v) => $"{v * 100:0} %";+ static string Time(double s) => s >= 1 ? $"{s:0.0}\u2009s" : s >= 0.0995 ? $"{s * 1000:0}\u2009ms" : $"{s * 1000:0.#}\u2009ms";+ static string ShortTime(double s) => s >= 1 ? $"{s:0.0}\u2009s" : $"{s * 1000:0}\u2009ms";+ static string Pct(double v) => $"{v * 100:0}\u2009%";static string Tenths(double v) => $"{v * 10:0.0}";- static string HzFmt(double hz) => hz >= 1000 ? $"{hz / 1000:0.00} kHz" : $"{hz:0} Hz";+ static string HzFmt(double hz) => hz >= 1000 ? $"{hz / 1000:0.0}\u2009k" : $"{hz:0}\u2009Hz";static string Signed(double v, string f) => Math.Abs(v) < 0.005 ? (0.0).ToString(f) : v.ToString("+" + f + ";-" + f);string Foot(float v) => Feet[Math.Clamp((int)Math.Round(v * 4), 0, 4)];string Freq(float v) => Signed((v - 0.5) * 14, "0.00");string Cut(float v) => HzFmt(20 * Math.Pow(1000, v));- string Space(float v) => Signed((v - 0.5) * 6, "0.0") + " oct";+ string Space(float v) => Signed((v - 0.5) * 6, "0.0") + "\u2009oct";string EnvAmt(float v) => Signed((v - 0.5) * 20, "0.0");string Atk(float v) => ShortTime(Exp(0.001, 10, v));string Dec(float v) => ShortTime(Exp(0.003, 15, v));string GlideF(double v) => v < 0.002 ? "off" : Time(Exp(0.005, 5, v));- string LfoRate(float v) => On("lfosync") ? SyncNames[Math.Clamp((int)Math.Round(v * 13), 0, 13)] : $"{Exp(0.05, 30, v):0.0#} Hz";+ string LfoRate(float v) => On("lfosync") ? SyncNames[Math.Clamp((int)Math.Round(v * 13), 0, 13)] : $"{Exp(0.05, 30, v):0.0#}\u2009Hz";static double LfoCentsOf(double v) { double b = (v - 0.5) * 2; return b * Math.Abs(b) * 1200; }- string LfoCents(float v) { double c = LfoCentsOf(v); return Math.Abs(c) < 0.5 ? "0 c" : $"{c:+0;-0} c"; }+ string LfoCents(float v) { double c = LfoCentsOf(v); return Math.Abs(c) < 0.5 ? "0\u2009c" : $"{c:+0;−0}\u2009c"; }static double DlySec(double v) => Exp(0.02, 1.5, v);- string DlyMs(float v) => $"{DlySec(v) * 1000:0} ms";- string DlySpc(float v) => $"{(v - 0.5) * 1000:+0;-0;0} ms";- string VolDb(float v) { double g = 2 * v * v; return g <= 1e-4 ? "−∞" : $"{20 * Math.Log10(g):0.0} dB"; }- string Tune(double v) => Signed((v - 0.5) * 4, "0.0") + " st";+ string DlyMs(float v) => $"{DlySec(v) * 1000:0}\u2009ms";+ string DlySpc(float v) => $"{(v - 0.5) * 1000:+0;−0;0}\u2009ms";+ string VolDb(float v) { double g = 2 * v * v; return g <= 1e-4 ? "−∞" : $"{20 * Math.Log10(g):0.0}\u2009dB"; }+ string Tune(double v) => Signed((v - 0.5) * 4, "0.0") + "\u2009st";int BendSt() => 1 + Math.Clamp((int)Math.Round(G("bendrange") * 11), 0, 11);- string Depth(double v) => $"{(v - 0.5) * 200:+0;-0;0}";+ string Depth(double v) => $"{(v - 0.5) * 200:+0;−0;0}";// ======================================================================// Patch-bay model: 12 cable slots of (source, destination, depth) params@@ -377,7 +317,7 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardvar mine = CableList().Where(c => j.Out ? c.Src == j.Index : c.Dst == j.Index).ToList();foreach (var c in mine){- var mi = new MenuItem { Header = $"Remove {CableName(c)} {c.Depth * 100:+0;-0;0}" };+ var mi = new MenuItem { Header = $"Remove {CableName(c)} {c.Depth * 100:+0;−0;0}" };int slot = c.Slot; mi.Click += (_, _) => RemoveSlot(slot);f.Items.Add(mi);}@@ -399,16 +339,16 @@ internal sealed class ConsortInstrumentCard : IInstrumentCard// ======================================================================var bendTxt = MonoText("", 7, AmberLit); var modTxt = MonoText("", 7, MutedC);bendTxt.HorizontalAlignment = HorizontalAlignment.Center; modTxt.HorizontalAlignment = HorizontalAlignment.Center;- common.Add(() => { bendTxt.Text = $"±{BendSt()} st"; modTxt.Text = $"{G("modwheel") * 100:0} %"; modTxt.Foreground = G("modwheel") > 0.01f ? AmberLit : MutedC; });+ common.Add(() => { bendTxt.Text = $"±{BendSt()}\u2009st"; modTxt.Text = $"{G("modwheel") * 100:0}\u2009%"; modTxt.Foreground = G("modwheel") > 0.01f ? AmberLit : MutedC; });var wheelsBody = new DockPanel { LastChildFill = true };var wTitle = Caps("WHEELS"); wTitle.HorizontalAlignment = HorizontalAlignment.Center; wTitle.Margin = new Thickness(0, 0, 0, 4);wheelsBody.Children.Add(Docked(wTitle, Avalonia.Controls.Dock.Top));wheelsBody.Children.Add(Docked(modTxt, Avalonia.Controls.Dock.Bottom));wheelsBody.Children.Add(Docked(bendTxt, Avalonia.Controls.Dock.Bottom));wheelsBody.Children.Add(new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, HorizontalAlignment = HorizontalAlignment.Center, Margin = new Thickness(0, 0, 0, 3), Children = {- VWheel("bend", "PIT", Amber, spring: true),+ VWheel("bend", "PITCH", Amber, spring: true),VWheel("modwheel", "MOD", AmberLit, spring: false) } });- var wheels = new Border { Width = 52, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(0, 5), Child = wheelsBody };+ var wheels = new Border { Width = 52, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Padding = new Thickness(0, 5), Child = wheelsBody };DockPanel.SetDock(wheels, Avalonia.Controls.Dock.Left);// ======================================================================@@ -426,7 +366,7 @@ internal sealed class ConsortInstrumentCard : IInstrumentCard{int wv = w;var ic = new PentadWaveIcon(icon[w]) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };- var b = new Border { Width = 24, Height = 16, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Cursor = new Cursor(StandardCursorType.Hand), Child = ic };+ var b = new Border { Width = 24, Height = 16, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Cursor = new Cursor(StandardCursorType.Hand), Child = ic };ToolTip.SetTip(b, tip[w]);b.PointerPressed += (_, e) => { SetP(id, wv / 3f); Refresh(); e.Handled = true; };chips[w] = b; icons[w] = ic; row.Children.Add(b);@@ -434,7 +374,7 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardcur.Add(() =>{int s = Sel(id, 4);- for (int w = 0; w < 4; w++) { bool on = w == s; chips[w].Background = on ? AmberSubtle : Brushes.Transparent; chips[w].BorderBrush = on ? Amber : NotaPalette.BorderStrong; icons[w].Stroke = on ? AmberLit : MutedC; icons[w].InvalidateVisual(); }+ for (int w = 0; w < 4; w++) { bool on = w == s; chips[w].Background = on ? Amber : Brushes.Transparent; chips[w].BorderBrush = on ? Amber : NotaPalette.BorderStrong; icons[w].Stroke = on ? NotaPalette.TextOnAccent : MutedC; icons[w].InvalidateVisual(); }});if (I(id) is var pi and >= 0) MidiLearn.Bind(row, MidiTarget.PluginParam(track, -1, pi), id);return row;@@ -442,10 +382,10 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardControl SyncChip(string id, string text){var tb = MonoText(text, 8, MutedC);- var b = new Border { Padding = new Thickness(4, 1), CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand), Child = tb };+ var b = new Border { Padding = new Thickness(4, 1), CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand), Child = tb };ToolTip.SetTip(b, "Hard sync");b.PointerPressed += (_, e) => { SetP(id, On(id) ? 0f : 1f); Refresh(); e.Handled = true; };- cur.Add(() => { bool on = On(id); tb.Foreground = on ? AmberLit : DimC; b.BorderBrush = on ? NotaPalette.AccentSubtle : Brushes.Transparent; b.Background = on ? AmberSubtle : Brushes.Transparent; });+ cur.Add(() => { bool on = On(id); tb.Foreground = on ? NotaPalette.AccentHover : DimC; b.BorderBrush = on ? NotaPalette.BorderBrass : Brushes.Transparent; b.Background = on ? NotaPalette.AccentSubtle : Brushes.Transparent; });if (I(id) is var pi and >= 0) MidiLearn.Bind(b, MidiTarget.PluginParam(track, -1, pi), id);return b;}@@ -506,18 +446,18 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardcurve.DragStarted += () => { Begin("cutoff"); Begin("reso"); };curve.DragEnded += () => { End("cutoff"); End("reso"); };cur.Add(() => curve.Set(G("cutoff"), G("reso"), (G("spacing") - 0.5) * 6, Sel("filtmode", 3), On("basscomp")));- var graph = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Margin = new Thickness(0, 3, 0, 2), Child = curve };- var head = new DockPanel { Height = 12, LastChildFill = false, Children = { Docked(Caps("DUAL LADDER"), Avalonia.Controls.Dock.Left), Docked(MonoText("24 dB/oct", 7, Txt2), Avalonia.Controls.Dock.Right) } };+ var graph = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Margin = new Thickness(0, 3, 0, 2), Child = curve };+ var head = new DockPanel { Height = 12, LastChildFill = false, Children = { Docked(Caps("DUAL LADDER"), Avalonia.Controls.Dock.Left), Docked(MonoText("24\u2009dB/oct", 7, Txt2), Avalonia.Controls.Dock.Right) } };var knobs = new Grid { ColumnDefinitions = new ColumnDefinitions("*,*,*,*") };knobs.Children.Add(K("cutoff", "CUTOFF", Cut, false, 28, 50));- knobs.Children.Add(Col(K("reso", "RESON", v => Tenths(v), false, 28, 46), 1));+ knobs.Children.Add(Col(K("reso", "RESO", v => Tenths(v), false, 28, 46), 1));knobs.Children.Add(Col(K("spacing", "SPACING", Space, false, 28, 50), 2));- knobs.Children.Add(Col(K("fenvamt", "ENV AMT", EnvAmt, true, 28, 46), 3));+ knobs.Children.Add(Col(K("fenvamt", "ENVELOPE", EnvAmt, true, 28, 46), 3));var j1 = new ConsortJackDot(11); var j2 = new ConsortJackDot(11);ToolTip.SetTip(j1, "Filt 1 cutoff input"); ToolTip.SetTip(j2, "Filt 2 cutoff input");cur.Add(() => { j1.Set(PatchedAt(false, 10)); j2.Set(PatchedAt(false, 11)); });var bottom = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,*,Auto"), ColumnSpacing = 8, Height = 18 };- bottom.Children.Add(Row(5, Caps("KBD TRK"), Chips("kbdtrk", new[] { "0", "½", "1" })));+ bottom.Children.Add(Row(5, Caps("KEYTRACK"), Chips("kbdtrk", new[] { "0", "½", "1" })));bottom.Children.Add(Col(Toggle("basscomp", "Bass comp"), 1));bottom.Children.Add(Col(Row(4, j1, j2), 3));var body = new DockPanel { LastChildFill = true, Children = { Docked(head, Avalonia.Controls.Dock.Top), Docked(bottom, Avalonia.Controls.Dock.Bottom), Docked(knobs, Avalonia.Controls.Dock.Bottom), graph } };@@ -530,12 +470,12 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardcur.Add(() =>{curve.Set(G(pre + "attack"), G(pre + "decay"), G(pre + "sustain"), G(pre + "release")); curve.InvalidateVisual();- times.Text = $"{Atk(G(pre + "attack"))} · {Dec(G(pre + "decay"))} · {G(pre + "sustain") * 100:0}% · {Dec(G(pre + "release"))}";+ times.Text = $"{Atk(G(pre + "attack"))} · {Dec(G(pre + "decay"))} · {G(pre + "sustain") * 100:0}\u2009% · {Dec(G(pre + "release"))}";});var head = new DockPanel { Height = 12, LastChildFill = false, Margin = new Thickness(0, 0, 0, 2) };head.Children.Add(Docked(Caps(title), Avalonia.Controls.Dock.Left));head.Children.Add(Docked(times, Avalonia.Controls.Dock.Right));- var graph = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Child = curve };+ var graph = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Child = curve };var knobs = Row(0, K(pre + "attack", "A", Atk, amp, 22, 27), K(pre + "decay", "D", Dec, amp, 22, 27), K(pre + "sustain", "S", v => Pct(v), amp, 22, 27), K(pre + "release", "R", Dec, amp, 22, 27));knobs.Margin = new Thickness(4, 0, 0, 0);return new DockPanel { LastChildFill = true, Children = { Docked(head, Avalonia.Controls.Dock.Top), Docked(knobs, Avalonia.Controls.Dock.Right), graph } };@@ -562,12 +502,12 @@ internal sealed class ConsortInstrumentCard : IInstrumentCard{int sv = s;var ic = new ConsortLfoIcon(s) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };- var b = new Border { Width = 26, Height = 17, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Cursor = new Cursor(StandardCursorType.Hand), Child = ic };+ var b = new Border { Width = 26, Height = 17, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Cursor = new Cursor(StandardCursorType.Hand), Child = ic };ToolTip.SetTip(b, LfoNames[s]);b.PointerPressed += (_, e) => { SetP("lfowave", sv / 5f); Refresh(); e.Handled = true; };chips[s] = b; icons[s] = ic; shapes.Children.Add(b);}- cur.Add(() => { int s = Sel("lfowave", 6); for (int i = 0; i < 6; i++) { bool on = i == s; chips[i].Background = on ? AmberSubtle : Brushes.Transparent; chips[i].BorderBrush = on ? Amber : NotaPalette.BorderStrong; icons[i].Stroke = on ? AmberLit : MutedC; icons[i].InvalidateVisual(); } });+ cur.Add(() => { int s = Sel("lfowave", 6); for (int i = 0; i < 6; i++) { bool on = i == s; chips[i].Background = on ? Amber : Brushes.Transparent; chips[i].BorderBrush = on ? Amber : NotaPalette.BorderStrong; icons[i].Stroke = on ? NotaPalette.TextOnAccent : MutedC; icons[i].InvalidateVisual(); } });if (I("lfowave") is var pw and >= 0) MidiLearn.Bind(shapes, MidiTarget.PluginParam(track, -1, pw), "lfowave");var jo = new ConsortJackDot(12); var jr = new ConsortJackDot(12);ToolTip.SetTip(jo, "LFO out (patch bay)"); ToolTip.SetTip(jr, "LFO rate input (patch bay)");@@ -595,12 +535,12 @@ internal sealed class ConsortInstrumentCard : IInstrumentCard{double tl = DlySec(G("dlytime")), tr = Math.Clamp(tl + (G("dlyspacing") - 0.5), 0.005, 2.0);view.Set(tl, tr, G("dlyfb"), G("dlymix"), On("dlyping"), On("dlydigital"));- times.Text = $"L {tl * 1000:0} · R {tr * 1000:0} ms";+ times.Text = $"L {tl * 1000:0} · R {tr * 1000:0}\u2009ms";});var head = new DockPanel { Height = 14, LastChildFill = false, Children = { Docked(Caps(""), Avalonia.Controls.Dock.Left), Docked(times, Avalonia.Controls.Dock.Right) } };var title = (TextBlock)head.Children[0];cur.Add(() => title.Text = On("dlydigital") ? "DELAY · DIGITAL" : "ANALOG DELAY · BBD");- var graph = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Margin = new Thickness(0, 2, 0, 3), Child = view };+ var graph = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Margin = new Thickness(0, 2, 0, 3), Child = view };var knobs = Row(0, K("dlytime", "TIME", DlyMs, false, 28, 44), K("dlyspacing", "SPACING", DlySpc, false, 28, 44), K("dlyfb", "FEEDBACK", v => Pct(v), false, 28, 46), K("dlymix", "MIX", v => Pct(v), false, 28, 40));var opts = new StackPanel { Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = { Chips("dlyping", new[] { "Ping", "Stereo" }, new[] { 1f, 0f }), Toggle("dlydigital", "Digital") } };var bottom = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*") };@@ -641,8 +581,8 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardfor (int b = 0; b < 4; b++){int bv = b;- var sw = new Border { Width = 9, Height = 9, CornerRadius = new CornerRadius(2), BorderBrush = cols[b], BorderThickness = new Thickness(1), Background = b == 3 ? Inset : new SolidColorBrush(((ISolidColorBrush)cols[b]).Color, 0.35) };- var it = new Border { Background = Brushes.Transparent, Padding = new Thickness(3, 1), CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand), Child = Row(3, sw, new TextBlock { Text = names[b], FontSize = 8, Foreground = Txt2, VerticalAlignment = VerticalAlignment.Center }) };+ var sw = new Border { Width = 9, Height = 9, CornerRadius = NotaRadius.Clip, BorderBrush = cols[b], BorderThickness = new Thickness(1), Background = b == 3 ? Inset : new SolidColorBrush(((ISolidColorBrush)cols[b]).Color, 0.35) };+ var it = new Border { Background = Brushes.Transparent, Padding = new Thickness(3, 1), CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand), Child = Row(3, sw, new TextBlock { Text = names[b], FontSize = 8, Foreground = Txt2, VerticalAlignment = VerticalAlignment.Center }) };ToolTip.SetTip(it, $"Paint {names[b]} steps (Alt-click a step: rest)");it.PointerPressed += (_, e) => { vs.Brush = bv; Refresh(); e.Handled = true; };legItems[b] = it; legend.Children.Add(it);@@ -676,16 +616,16 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardgrid.Set(types, SeqLen(), PlayStep(), Ratchet());lane.Set(StepPitches(), types, SeqLen(), PlayStep(), Sel("seqmode", 3) == 2);});- var laneBox = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Child = lane };+ var laneBox = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Child = lane };var clkDot = new ConsortJackDot(12); var gateDot = new ConsortJackDot(12);ToolTip.SetTip(clkDot, "Clock out (patch bay)"); ToolTip.SetTip(gateDot, "Seq gate out (patch bay)");tabReadouts[3].Add(() => { clkDot.Set(PatchedAt(true, 12)); gateDot.Set(PatchedAt(true, 11, 10)); });- var swingSl = HSlider("seqswing", v => $"{50 + v * 25:0} %", 28); swingSl.Width = 84;+ var swingSl = HSlider("seqswing", v => $"{50 + v * 25:0}\u2009%", 28); swingSl.Width = 84;var rateTxt = MonoText("", 9, AmberLit);- var rateBox = new Border { Background = Brushes.Transparent, Padding = new Thickness(2, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = rateTxt };+ var rateBox = new Border { Background = Brushes.Transparent, Padding = new Thickness(2, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = Glyph.WithChevron(rateTxt, 7) };ToolTip.SetTip(rateBox, "Step rate (synced to the host tempo)");- tabReadouts[3].Add(() => rateTxt.Text = SeqRates[Sel("seqrate", SeqRates.Length)] + " ▾");+ tabReadouts[3].Add(() => rateTxt.Text = SeqRates[Sel("seqrate", SeqRates.Length)]);rateBox.PointerPressed += (_, e) =>{var f = new MenuFlyout();@@ -775,10 +715,10 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardforeach (var c in cs){int slot = c.Slot;- var dot = new Border { Width = 6, Height = 6, CornerRadius = new CornerRadius(3), Background = ConsortJacks.ToneBrush(ConsortJacks.Src(c.Src).Tone), VerticalAlignment = VerticalAlignment.Center };- var x = new TextBlock { Text = "✕", FontSize = 8, Foreground = MutedC, Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center };+ var dot = new Border { Width = 6, Height = 6, CornerRadius = NotaRadius.Badge, Background = ConsortJacks.ToneBrush(ConsortJacks.Src(c.Src).Tone), VerticalAlignment = VerticalAlignment.Center };+ var x = new Border { Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new Glyph(GlyphKind.Close, 8) { Foreground = MutedC } };x.PointerPressed += (_, e) => { RemoveSlot(slot); e.Handled = true; };- var name = new TextBlock { Text = $"{ConsortJacks.ShortName(ConsortJacks.Src(c.Src).Name)} → {ConsortJacks.ShortName(ConsortJacks.Dst(c.Dst).Name)}", FontSize = 8.5, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis };+ var name = new TextBlock { Text = $"{ConsortJacks.ShortName(ConsortJacks.Src(c.Src).Name)} → {ConsortJacks.ShortName(ConsortJacks.Dst(c.Dst).Name)}", FontSize = 9, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis };var hdr = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 5 };hdr.Children.Add(dot); hdr.Children.Add(Col(name, 1)); hdr.Children.Add(Col(x, 2));List<Action> saved = cur; cur = rowReadouts;@@ -818,7 +758,7 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardvar field = StripField();tabReadouts[4].Add(() => field.SetCables(CableList()));var list = CableListView(tabReadouts[4]);- var hint = new TextBlock { Text = "Drag jack to jack · Alt-click to pull · right-click for a list", FontSize = 7.5, Foreground = DimC, TextWrapping = TextWrapping.Wrap };+ var hint = new TextBlock { Text = "Drag jack to jack · Alt-click to pull · right-click for a list", FontSize = 8, Foreground = DimC, TextWrapping = TextWrapping.Wrap };var side = new DockPanel { LastChildFill = true, Children = { Docked(new Border { Margin = new Thickness(0, 0, 0, 3), Child = Caps("CABLES") }, Avalonia.Controls.Dock.Top), Docked(hint, Avalonia.Controls.Dock.Bottom), list } };var g = new Grid { ColumnDefinitions = new ColumnDefinitions("*,144") };g.Children.Add(new Border { Padding = new Thickness(2, 2, 4, 0), Child = field });@@ -846,7 +786,7 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardfor (int i = 0; i < 4; i++){txt[i] = MonoText("—", 8, DimC); txt[i].HorizontalAlignment = HorizontalAlignment.Center;- cells[i] = new Border { Height = 18, Margin = new Thickness(1.5, 0), CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Child = txt[i] };+ cells[i] = new Border { Height = 18, Margin = new Thickness(1.5, 0), CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), Child = txt[i] };ToolTip.SetTip(cells[i], $"Oscillator {i + 1}'s note (paraphonic) · the latest voices in true poly");cellRow.Children.Add(cells[i]);}@@ -900,7 +840,7 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardDocked(top, Avalonia.Controls.Dock.Top),Docked(Divider(new StackPanel { Spacing = 4, Children = {SliderRow("TUNE", "tune", v => Tune(v), 40, 34, null, true),- SliderRow("BEND", "bendrange", v => $"±{1 + Math.Clamp((int)Math.Round(v * 11), 0, 11)} st", 40, 34),+ SliderRow("BEND", "bendrange", v => $"±{1 + Math.Clamp((int)Math.Round(v * 11), 0, 11)}\u2009st", 40, 34),Toggle("velvca", "Velocity → VCA"),Toggle("atcut", "Aftertouch → cut") } }), Avalonia.Controls.Dock.Top),Docked(Divider(Row(8, Caps("OVERSAMPLE"), Chips("oversample", new[] { "×1", "×2", "×4" }))), Avalonia.Controls.Dock.Bottom) } };@@ -922,7 +862,7 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardcur = tabReadouts[0];var pwSl = HSlider("pw", v => Pct(v), 26); pwSl.Width = 84;extras[0] = Row(6, Caps("PWM"), pwSl);- ToolTip.SetTip(extras[0], "Pulse width of the pulse wave (square stays 50 %)");+ ToolTip.SetTip(extras[0], "Pulse width of the pulse wave (square stays 50\u2009%)");cur = tabReadouts[1];extras[1] = Chips("filtmode", new[] { "HP/LP ser", "LP/LP st", "HP/LP st" });cur = tabReadouts[2];@@ -956,9 +896,9 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardvar (centre, selectCentre) = TabFrame(new[] { "Osc · Mix", "Filters · Env", "LFO · Delay", "Seq", "Patch" }, centreHost, CentreBody, false, vs.Centre,t => { vs.Centre = t; if (t != 4) vs.LastNonPatch = t; extrasHost.Content = extras[t]; Refresh(); }, extrasHost);var (rightFrame, _) = TabFrame(new[] { "Voices", "Output" }, rightHost, RightBody, true, vs.Right, t => { vs.Right = t; Refresh(); }, null);- var right = new Border { Width = 172, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Child = rightFrame };+ var right = new Border { Width = 172, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Child = rightFrame };DockPanel.SetDock(right, Avalonia.Controls.Dock.Right);- var centreBox = new Border { Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Margin = new Thickness(5, 0), Child = centre };+ var centreBox = new Border { Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Margin = new Thickness(5, 0), Child = centre };// ======================================================================// Patch-bay row (collapsed) + overlay@@ -968,7 +908,7 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardvar chipsHost = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 9, VerticalAlignment = VerticalAlignment.Center, ClipToBounds = true };var countTxt = MonoText("", 8, AmberLit);var openTxt = new TextBlock { FontSize = 8, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center };- var openBtn = new Border { Height = 13, Padding = new Thickness(6, 0), CornerRadius = new CornerRadius(3), Background = OffPill, BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = openTxt };+ var openBtn = new Border { Height = 13, Padding = new Thickness(6, 0), CornerRadius = NotaRadius.Badge, Background = OffPill, BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = openTxt };ToolTip.SetTip(openBtn, "Open the full patch bay (all 42 points) · on the Patch tab: back to the last panel");openBtn.PointerPressed += (_, e) =>{@@ -987,10 +927,10 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardchipsHost.Children.Clear();foreach (var c in cs){- var chip = Row(3, new Border { Width = 6, Height = 6, CornerRadius = new CornerRadius(3), Background = ConsortJacks.ToneBrush(ConsortJacks.Src(c.Src).Tone), VerticalAlignment = VerticalAlignment.Center },+ var chip = Row(3, new Border { Width = 6, Height = 6, CornerRadius = NotaRadius.Badge, Background = ConsortJacks.ToneBrush(ConsortJacks.Src(c.Src).Tone), VerticalAlignment = VerticalAlignment.Center },MonoText(CableChip(c), 8, Txt2));chip.Background = Brushes.Transparent; chip.Cursor = new Cursor(StandardCursorType.Hand);- ToolTip.SetTip(chip, $"{CableName(c)} · depth {c.Depth * 100:+0;-0;0}");+ ToolTip.SetTip(chip, $"{CableName(c)} · depth {c.Depth * 100:+0;−0;0}");chip.PointerPressed += (_, e) => { selectCentre(4); e.Handled = true; };chipsHost.Children.Add(chip);}@@ -1027,7 +967,7 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardoverlayReadouts.Add(() => info.Text = $"{CableList().Count} cables · {ConsortJacks.Points} points");Border Btn(string t, Action a){- var b = new Border { Height = 16, Padding = new Thickness(7, 0), CornerRadius = new CornerRadius(3), Background = OffPill, Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = t, FontSize = 8.5, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center } };+ var b = new Border { Height = 16, Padding = new Thickness(7, 0), CornerRadius = NotaRadius.Badge, Background = OffPill, Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = t, FontSize = 9, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center } };b.PointerPressed += (_, e) => { a(); e.Handled = true; };return b;}@@ -1035,7 +975,7 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardvar topGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,Auto,*,Auto,Auto"), ColumnSpacing = 10 };topGrid.Children.Add(Lbl("Patch bay", 10, AmberLit, FontWeight.SemiBold));topGrid.Children.Add(Col(info, 1)); topGrid.Children.Add(Col(view, 2));- topGrid.Children.Add(Col(Btn("Clear all", ClearAll), 4)); topGrid.Children.Add(Col(Btn("Esc ✕", () => OpenOverlay(false)), 5));+ topGrid.Children.Add(Col(Btn("Clear all", ClearAll), 4)); topGrid.Children.Add(Col(Btn("Close", () => OpenOverlay(false)), 5));var top = new Border { Height = 26, BorderBrush = Border2, BorderThickness = new Thickness(0, 0, 0, 1), Padding = new Thickness(10, 0), Child = topGrid };// bottom: cable list with draggable depthsvar bottomHost = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 12, VerticalAlignment = VerticalAlignment.Center };@@ -1050,7 +990,7 @@ internal sealed class ConsortInstrumentCard : IInstrumentCard{int slot = c.Slot;var tone = ConsortJacks.ToneBrush(ConsortJacks.Src(c.Src).Tone);- var dep = MonoText($"{c.Depth * 100:+0;-0;0}", 8, tone);+ var dep = MonoText($"{c.Depth * 100:+0;−0;0}", 8, tone);var depBox = new Border { Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.SizeNorthSouth), Child = dep };ToolTip.SetTip(depBox, "Depth — drag up / down (double-click: +50)");bool drag = false; double y0 = 0; float v0 = 0;@@ -1060,13 +1000,13 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardif (e.ClickCount == 2) { SetP(AmtId(slot), 0.75f); Refresh(); e.Handled = true; return; }drag = true; y0 = e.GetPosition(depBox).Y; v0 = G(AmtId(slot)); Begin(AmtId(slot)); e.Pointer.Capture(depBox); e.Handled = true;};- depBox.PointerMoved += (_, e) => { if (!drag) return; float v = Math.Clamp(v0 + (float)(y0 - e.GetPosition(depBox).Y) / 200f, 0, 1); Raw(AmtId(slot), v); dep.Text = $"{(v - 0.5f) * 200:+0;-0;0}"; };+ depBox.PointerMoved += (_, e) => { if (!drag) return; float v = Math.Clamp(v0 + (float)(y0 - e.GetPosition(depBox).Y) / 200f, 0, 1); Raw(AmtId(slot), v); dep.Text = $"{(v - 0.5f) * 200:+0;−0;0}"; };depBox.PointerReleased += (_, e) => { if (drag) { drag = false; End(AmtId(slot)); e.Pointer.Capture(null); Refresh(); } };- bottomHost.Children.Add(Row(4, new Border { Width = 7, Height = 7, CornerRadius = new CornerRadius(4), Background = tone, VerticalAlignment = VerticalAlignment.Center },- new TextBlock { Text = CableName(c), FontSize = 8.5, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center }, depBox));+ bottomHost.Children.Add(Row(4, new Border { Width = 7, Height = 7, CornerRadius = NotaRadius.Control, Background = tone, VerticalAlignment = VerticalAlignment.Center },+ new TextBlock { Text = CableName(c), FontSize = 9, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center }, depBox));}});- var note = new TextBlock { Text = "A cable breaks the normal at Gate / Filt in / VCA in / Ext in · loops run with a one-sample delay", FontSize = 7.5, Foreground = DimC, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis };+ var note = new TextBlock { Text = "A cable breaks the normal at Gate / Filt in / VCA in / Ext in · loops run with a one-sample delay", FontSize = 8, Foreground = DimC, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis };var botGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*") , ColumnSpacing = 12 };botGrid.Children.Add(new ScrollViewer { HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden, VerticalScrollBarVisibility = ScrollBarVisibility.Disabled, MaxWidth = 470, Content = bottomHost });botGrid.Children.Add(Col(Right(note), 1));@@ -1091,7 +1031,7 @@ internal sealed class ConsortInstrumentCard : IInstrumentCard{string rate = On("lfosync") ? $"sync {LfoRate(G("lforate"))}" : LfoRate(G("lforate"));string dest = On("lfodest") ? "osc 2 + 4" : "all osc";- return $"LFO {LfoNames[Sel("lfowave", 6)]} {rate} → {dest} · {(On("dlydigital") ? "digital delay" : "BBD")} {(On("dlyping") ? "ping-pong" : "stereo")}, mix {G("dlymix") * 100:0} %";+ return $"LFO {LfoNames[Sel("lfowave", 6)]} {rate} → {dest} · {(On("dlydigital") ? "digital delay" : "BBD")} {(On("dlyping") ? "ping-pong" : "stereo")}, mix {G("dlymix") * 100:0}\u2009%";}case 3:{@@ -1099,10 +1039,10 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardif (m == 0) return "Sequencer off · pick SEQ or ARP, then hold a key";var types = StepTypes(); int len = SeqLen();int rat = types.Take(len).Count(t => t == 1), ties = types.Take(len).Count(t => t == 2);- string swing = $"swing {50 + G("seqswing") * 25:0} %";+ string swing = $"swing {50 + G("seqswing") * 25:0}\u2009%";return m == 1? $"{len} steps · {rat} ratchet{(rat == 1 ? "" : "s")} ×{Ratchet()} · {ties} tie{(ties == 1 ? "" : "s")} · {swing} · transposed from the keyboard"- : $"Arp {new[] { "up", "down", "random" }[Sel("seqorder", 3)]} over {1 + Sel("arpoct", 3)} oct · {SeqRates[Sel("seqrate", 6)]} · {swing}{(On("seqlatch") ? " · latched" : "")}";+ : $"Arp {new[] { "up", "down", "random" }[Sel("seqorder", 3)]} over {1 + Sel("arpoct", 3)}\u2009oct · {SeqRates[Sel("seqrate", 6)]} · {swing}{(On("seqlatch") ? " · latched" : "")}";}case 4:{@@ -1114,7 +1054,7 @@ internal sealed class ConsortInstrumentCard : IInstrumentCard{var sync = new List<string>();if (On("o2sync")) sync.Add("osc 2 sync → 1"); if (On("o4sync")) sync.Add("osc 4 sync → 3");- return $"{ModeName()} · {busy} {(Poly() ? "voice" : "note")}{(busy == 1 ? "" : "s")}{(sync.Count > 0 ? " · " + string.Join(", ", sync) : "")} · drift {G("drift") * 100:0} %";+ return $"{ModeName()} · {busy} {(Poly() ? "voice" : "note")}{(busy == 1 ? "" : "s")}{(sync.Count > 0 ? " · " + string.Join(", ", sync) : "")} · drift {G("drift") * 100:0}\u2009%";}}}@@ -1125,9 +1065,9 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardstatusLeft.Text = StatusText();if (scN > 8){- string rate = $"{scope[6] / 1000:0.#} kHz";- statusRight.Text = vs.Centre == 3 ? $"{rate} · sync to host {scope[8]:0} BPM · CPU {scope[4] * 100:0.0} %"- : $"{rate} · ×{(int)scope[5]} OS · 0 smp · CPU {scope[4] * 100:0.0} %";+ string rate = $"{scope[6] / 1000:0.#}\u2009kHz";+ statusRight.Text = vs.Centre == 3 ? $"{rate} · sync to host {scope[8]:0}\u2009BPM · CPU {scope[4] * 100:0}\u2009%"+ : $"{rate} · ×{(int)scope[5]} OS · 0 smp · CPU {scope[4] * 100:0}\u2009%";}});var statusGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), ColumnSpacing = 8 };diff --git a/src/managed/Nota.App/DeviceCards/Instruments/FluxInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/FluxInstrumentCard.csindex 5b116935..7ceda014 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/FluxInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/FluxInstrumentCard.cs@@ -114,22 +114,22 @@ internal sealed class FluxInstrumentCard : IInstrumentCardvar 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 = new CornerRadius(6), Padding = new Thickness(6, 4), Child = scopeDock };+ 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} %", 40, 56, TealB);+ 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 = new CornerRadius(4), 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 } };+ 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);}readouts.Add(SyncTarget);- var targetBox = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(2), Child = targetRow };+ 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,@@ -165,10 +165,10 @@ internal sealed class FluxInstrumentCard : IInstrumentCardvar 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}%", MakeRateCycler),- Macro("filter", "FILTER", v => $"{60 * Math.Pow(300, v):0} Hz"),+ 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} %"),+ Macro("space", "SPACE", v => $"{v * 100:0}\u2009%"),} };var macroHead = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), Height = 12 };macroHead.Children.Add(Sec("MACROS"));diff --git a/src/managed/Nota.App/DeviceCards/Instruments/GrainInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/GrainInstrumentCard.csindex 8812534b..a3aa0eaa 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/GrainInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/GrainInstrumentCard.cs@@ -34,7 +34,7 @@ internal sealed class GrainInstrumentCard : IInstrumentCardprivate static readonly IBrush MutedC = NotaPalette.TextTertiary;private static readonly IBrush Handle = NotaPalette.TextSecondary;private static readonly IBrush AmberSubtle = NotaPalette.Wash(NotaPalette.Accent, 0x28);- private static readonly Typeface Mono = new("Geist Mono");+ private static readonly Typeface Mono = NotaFonts.Mono;public bool BodyOnly => true;public string Subtitle => "GRANULAR";@@ -86,45 +86,30 @@ internal sealed class GrainInstrumentCard : IInstrumentCardControl Slider(string id, double trackW, Func<double, string> fmt){int pi = I(id);- var bg = new Border { Width = trackW, Height = 3, Background = Inset, CornerRadius = new CornerRadius(2) };- var fill = new Border { Height = 3, Background = Amber, CornerRadius = new CornerRadius(2) };- var handle = new Border { Width = 8, Height = 9, Background = Handle, CornerRadius = new CornerRadius(2) };- var canvas = new Canvas { Width = trackW, Height = 9, Background = Brushes.Transparent, VerticalAlignment = VerticalAlignment.Center };- Canvas.SetTop(bg, 3); Canvas.SetLeft(bg, 0);- Canvas.SetTop(fill, 3); Canvas.SetLeft(fill, 0);- Canvas.SetTop(handle, 0);- canvas.Children.Add(bg); canvas.Children.Add(fill); canvas.Children.Add(handle);- var val = new TextBlock { FontSize = 9, Foreground = TxtC, Width = 40, VerticalAlignment = VerticalAlignment.Center };- val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- bool drag = false;- void ApplyVisual(double v) { fill.Width = Math.Max(0, v * trackW); Canvas.SetLeft(handle, v * trackW - 4); val.Text = fmt(v); }- void FromPointer(PointerEventArgs e) { double v = Math.Clamp(e.GetPosition(canvas).X / trackW, 0, 1); if (pi >= 0) engine.PluginParamSet(track, -1, pi, (float)v); ApplyVisual(v); Refresh(); }- canvas.PointerPressed += (_, e) => { drag = true; e.Pointer.Capture(canvas); FromPointer(e); };- canvas.PointerMoved += (_, e) => { if (drag) FromPointer(e); };- canvas.PointerReleased += (_, e) => { drag = false; e.Pointer.Capture(null); };- readouts.Add(() => { if (!drag) ApplyVisual(G(id)); });- ApplyVisual(G(id));- var lbl = new TextBlock { Text = id == "position" ? "POSITION" : id == "scan" ? "SCAN" : "SPRAY", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center };- return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = { lbl, canvas, val } };+ string label = id == "position" ? "POSITION" : id == "scan" ? "SCAN" : "SPRAY";+ var row = DeviceCardKit.SliderRow(label, () => G(id), n => { if (pi >= 0) engine.PluginParamSet(track, -1, pi, (float)n); Refresh(); }, () => fmt(G(id)), out var sync,+ trackWidth: trackW, valueWidth: 40);+ readouts.Add(sync);+ return row;}// Scan-mode segmented (param-backed).Control ScanSeg(){string[] names = { "Scan", "Freeze", "Key" }; var arr = new Border[3];- void Hi() { int cur = Math.Clamp((int)Math.Round(G("scanmode") * 2), 0, 2); for (int i = 0; i < 3; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : MutedC; } }+ void Hi() { int cur = Math.Clamp((int)Math.Round(G("scanmode") * 2), 0, 2); for (int i = 0; i < 3; i++) { bool on = i == cur; arr[i].Background = on ? NotaPalette.Accent : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? NotaPalette.TextOnAccent : MutedC; } }var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < 3; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = MutedC } }; c.PointerPressed += (_, _) => { SetP("scanmode", iv / 2f); Hi(); Refresh(); }; arr[i] = c; row.Children.Add(c); }+ for (int i = 0; i < 3; i++) { int iv = i; var c = new Border { CornerRadius = NotaRadius.Badge, Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = MutedC } }; c.PointerPressed += (_, _) => { SetP("scanmode", iv / 2f); Hi(); Refresh(); }; arr[i] = c; row.Children.Add(c); }readouts.Add(Hi); Hi();- return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };}var strip = new Border { Height = 30, Background = HdrBg, BorderBrush = Border2, BorderThickness = new Thickness(0, 0, 0, 1),Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(9, 0), Children = {ScanSeg(),- Slider("position", 74, v => $"{v * 100:0.0} %"),- Slider("scan", 60, v => $"{(v - 0.5) * 8:+0.0;-0.0;0.0}×"),- Slider("spray", 52, v => $"{v * 100:0} %") } } };+ Slider("position", 74, v => $"{v * 100:0}\u2009%"),+ Slider("scan", 60, v => $"{(v - 0.5) * 8:+0.0;−0.0;0.0}×"),+ Slider("spray", 52, v => $"{v * 100:0}\u2009%") } } };// ---- knobs (gauge) ----Control K(string id, string name, bool mod = false) => InstrumentControls.InstKnob(ctx, idx, id, name, Refresh, 40, 62, mod ? Teal : null);@@ -134,12 +119,12 @@ internal sealed class GrainInstrumentCard : IInstrumentCardControl ShapeIcons(){var boxes = new Border[4]; var icons = new GrainShapeIcon[4];- void Hi() { int cur = Math.Clamp((int)Math.Round(G("grainshape") * 3), 0, 3); for (int i = 0; i < 4; i++) { bool on = i == cur; boxes[i].Background = on ? AmberSubtle : Inset; boxes[i].BorderBrush = on ? Amber : Border2; icons[i].Stroke = on ? AmberLit : MutedC; icons[i].InvalidateVisual(); } }+ void Hi() { int cur = Math.Clamp((int)Math.Round(G("grainshape") * 3), 0, 3); for (int i = 0; i < 4; i++) { bool on = i == cur; boxes[i].Background = on ? NotaPalette.Accent : Inset; boxes[i].BorderBrush = on ? NotaPalette.Accent : Border2; icons[i].Stroke = on ? NotaPalette.TextOnAccent : MutedC; icons[i].InvalidateVisual(); } }var col = new StackPanel { Spacing = 3, VerticalAlignment = VerticalAlignment.Center };for (int i = 0; i < 4; i++){int iv = i; var ic = new GrainShapeIcon(i) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };- var b = new Border { Width = 34, Height = 22, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Cursor = new Cursor(StandardCursorType.Hand), Child = ic };+ var b = new Border { Width = 34, Height = 22, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Cursor = new Cursor(StandardCursorType.Hand), Child = ic };b.PointerPressed += (_, _) => { SetP("grainshape", iv / 3f); Hi(); };boxes[i] = b; icons[i] = ic; col.Children.Add(b);}@@ -154,7 +139,7 @@ internal sealed class GrainInstrumentCard : IInstrumentCardControl TabBody(int t) => t switch{1 => KnobRow(K("coarse", "COARSE"), K("fine", "FINE")),- 2 => KnobRow(K("posrand", "POS RND", true), K("pitchrand", "PITCH RND", true), K("panrand", "PAN RND", true)),+ 2 => KnobRow(K("posrand", "POSITION", true), K("pitchrand", "PITCH", true), K("panrand", "PAN", true)),3 => new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center, Children = { FilterTypeChips(), KnobRow(K("filfreq", "FREQ"), K("filreso", "RESO")) } },4 => KnobRow(K("attack", "ATTACK"), K("decay", "DECAY"), K("sustain", "SUSTAIN"), K("release", "RELEASE")),_ => new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center, Children = { ShapeIcons(), KnobRow(K("grainsize", "SIZE"), K("density", "DENSITY"), K("spread", "SPREAD", true)) } },@@ -162,11 +147,11 @@ internal sealed class GrainInstrumentCard : IInstrumentCardControl FilterTypeChips(){string[] names = { "LP", "HP", "BP" }; var arr = new Border[3];- void Hi() { int cur = Math.Clamp((int)Math.Round(G("filtype") * 2), 0, 2); for (int i = 0; i < 3; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : MutedC; } }+ void Hi() { int cur = Math.Clamp((int)Math.Round(G("filtype") * 2), 0, 2); for (int i = 0; i < 3; i++) { bool on = i == cur; arr[i].Background = on ? NotaPalette.Accent : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? NotaPalette.TextOnAccent : MutedC; } }var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < 3; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(7, 2), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 9, Foreground = MutedC } }; c.PointerPressed += (_, _) => { SetP("filtype", iv / 2f); Hi(); }; arr[i] = c; row.Children.Add(c); }+ for (int i = 0; i < 3; i++) { int iv = i; var c = new Border { CornerRadius = NotaRadius.Badge, Padding = new Thickness(7, 2), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 9, Foreground = MutedC } }; c.PointerPressed += (_, _) => { SetP("filtype", iv / 2f); Hi(); }; arr[i] = c; row.Children.Add(c); }readouts.Add(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };if (I("filtype") is var pi and >= 0) MidiLearn.Bind(seg, MidiTarget.PluginParam(track, -1, pi), "filtype");return seg;}@@ -176,7 +161,7 @@ internal sealed class GrainInstrumentCard : IInstrumentCardvar railCol = new StackPanel { Spacing = 2 };for (int i = 0; i < tabs.Length; i++){- int iv = i; var b = new Border { Height = 20, CornerRadius = new CornerRadius(4), Padding = new Thickness(7, 0), BorderThickness = new Thickness(2, 0, 0, 0), BorderBrush = Brushes.Transparent, Child = new TextBlock { Text = tabs[i], FontSize = 10, FontWeight = FontWeight.Medium, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center } };+ int iv = i; var b = new Border { Height = 20, CornerRadius = NotaRadius.Control, Padding = new Thickness(7, 0), BorderThickness = new Thickness(2, 0, 0, 0), BorderBrush = Brushes.Transparent, Child = new TextBlock { Text = tabs[i], FontSize = 9, FontWeight = FontWeight.Medium, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center } };b.PointerPressed += (_, _) => { tabSel = iv; HiTabs(); tabHost.Content = TabBody(iv); };tabBtns[i] = b; railCol.Children.Add(b);}diff --git a/src/managed/Nota.App/DeviceCards/Instruments/MonolithInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/MonolithInstrumentCard.csindex a5abbad5..b9590e78 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/MonolithInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/MonolithInstrumentCard.cs@@ -26,7 +26,7 @@ internal sealed class MonolithInstrumentCard : IInstrumentCard{private static readonly IBrush CardBg = NotaPalette.BgApp;private static readonly IBrush RailBg = NotaPalette.SurfaceInset;- private static readonly IBrush Panel = NotaPalette.BgApp;+ private static readonly IBrush Panel = NotaPalette.TextOnAccent; // dark ink over an engaged fillprivate static readonly IBrush Border2 = NotaPalette.BorderDefault;private static readonly IBrush BorderIn = NotaPalette.GraphBorder;private static readonly IBrush Inset = NotaPalette.BgSunken;@@ -34,7 +34,7 @@ internal sealed class MonolithInstrumentCard : IInstrumentCardprivate static readonly IBrush Amber = NotaPalette.Accent;private static readonly IBrush AmberLit = NotaPalette.AccentBright;private static readonly IBrush TealC = NotaPalette.Teal;- private static readonly IBrush RedC = NotaPalette.Danger;+ private static readonly IBrush RedC = NotaPalette.Accent; // a state, not an alert: red is kept for recording and overloadprivate static readonly IBrush TxtC = NotaPalette.TextPrimary;private static readonly IBrush MutedC = NotaPalette.TextTertiary;private static readonly IBrush Handle = NotaPalette.TextSecondary;@@ -82,14 +82,8 @@ internal sealed class MonolithInstrumentCard : IInstrumentCard// On/off pill toggle backed by a param (>0.5 = on).Control Toggle(string id, string label){- var knob = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), VerticalAlignment = VerticalAlignment.Center };- var dot = new Border { Width = 7, Height = 7, CornerRadius = new CornerRadius(4) };- var host = new Canvas { Width = 18, Height = 10 }; Canvas.SetTop(dot, 1.5); host.Children.Add(dot); knob.Child = host;- var txt = new TextBlock { Text = label, FontSize = 8, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center };- void Hi() { bool on = G(id) > 0.5f; knob.Background = on ? Amber : NotaPalette.SurfaceRaised; dot.Background = on ? CardBg : MutedC; Canvas.SetLeft(dot, on ? 9 : 1.5); txt.Foreground = on ? TxtC : MutedC; }- var wrap = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand), Children = { knob, txt } };- wrap.PointerPressed += (_, _) => { SetP(id, G(id) > 0.5f ? 0f : 1f); Hi(); Refresh(); };- readouts.Add(Hi); Hi();+ var wrap = Switch(label, () => G(id) > 0.5f, () => { SetP(id, G(id) > 0.5f ? 0f : 1f); Refresh(); }, out var sync);+ readouts.Add(sync);if (I(id) is var pi and >= 0) MidiLearn.Bind(wrap, MidiTarget.PluginParam(track, -1, pi), label);return wrap;}@@ -97,13 +91,9 @@ internal sealed class MonolithInstrumentCard : IInstrumentCard// Param-backed chip strip (writes id = pick/(n-1)).Control Chips(string id, string[] names, double fs = 7){- int n = names.Length; var arr = new Border[n];- void Hi() { int cur = Sel(id, n); for (int i = 0; i < n; i++) { bool on = i == cur; arr[i].Background = on ? Amber : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? CardBg : MutedC; ((TextBlock)arr[i].Child!).FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++)- { int iv = i; var c = new Border { CornerRadius = new CornerRadius(2), Padding = new Thickness(4, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, Foreground = MutedC } }; c.PointerPressed += (_, _) => { SetP(id, iv / (float)(n - 1)); Hi(); Refresh(); }; arr[i] = c; row.Children.Add(c); }- readouts.Add(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ int n = names.Length;+ var seg = DeviceCardKit.Segments(names, () => Sel(id, n), iv => { SetP(id, iv / (float)(n - 1)); Refresh(); }, out var sync);+ readouts.Add(sync);if (I(id) is var pi and >= 0) MidiLearn.Bind(seg, MidiTarget.PluginParam(track, -1, pi), id);return seg;}@@ -112,10 +102,10 @@ internal sealed class MonolithInstrumentCard : IInstrumentCardControl WaveChips(string id, bool osc3){var arr = new Border[6]; var ic = new MonolithWaveIcon[6];- void Hi() { int cur = Sel(id, 6); for (int i = 0; i < 6; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Brushes.Transparent; arr[i].BorderBrush = on ? Amber : Border2; ic[i].Stroke = on ? AmberLit : MutedC; ic[i].InvalidateVisual(); } }+ void Hi() { int cur = Sel(id, 6); for (int i = 0; i < 6; i++) { bool on = i == cur; arr[i].Background = on ? NotaPalette.Accent : Brushes.Transparent; arr[i].BorderBrush = on ? NotaPalette.Accent : Border2; ic[i].Stroke = on ? NotaPalette.TextOnAccent : MutedC; ic[i].InvalidateVisual(); } }var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2, VerticalAlignment = VerticalAlignment.Center };for (int i = 0; i < 6; i++)- { int iv = i; var wi = new MonolithWaveIcon(i, osc3) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }; var b = new Border { Width = 22, Height = 16, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Cursor = new Cursor(StandardCursorType.Hand), Child = wi }; b.PointerPressed += (_, _) => { SetP(id, iv / 5f); Hi(); Refresh(); }; arr[i] = b; ic[i] = wi; row.Children.Add(b); }+ { int iv = i; var wi = new MonolithWaveIcon(i, osc3) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }; var b = new Border { Width = 22, Height = 16, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Cursor = new Cursor(StandardCursorType.Hand), Child = wi }; b.PointerPressed += (_, _) => { SetP(id, iv / 5f); Hi(); Refresh(); }; arr[i] = b; ic[i] = wi; row.Children.Add(b); }readouts.Add(Hi); Hi();if (I(id) is var pi and >= 0) MidiLearn.Bind(row, MidiTarget.PluginParam(track, -1, pi), id);return row;@@ -124,41 +114,23 @@ internal sealed class MonolithInstrumentCard : IInstrumentCard// Horizontal fill slider bound to a param.Control HSlider(string id, string name, Func<double, string> fmt, double nameW = 30, double valW = 20, IBrush? col = null){- int pi = I(id); var fillC = col ?? Amber;- var bg = new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Stretch };- var fill = new Border { Height = 3, Background = fillC, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left };- var handle = new Border { Width = 6, Height = 7, Background = Handle, CornerRadius = new CornerRadius(2) };- var canvas = new Panel { Height = 9, HorizontalAlignment = HorizontalAlignment.Stretch, Background = Brushes.Transparent };- var lay = new Canvas { Height = 9, HorizontalAlignment = HorizontalAlignment.Stretch };- canvas.Children.Add(new Panel { Children = { new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center } } });- canvas.Children.Add(fill); canvas.Children.Add(lay); lay.Children.Add(handle);- fill.VerticalAlignment = VerticalAlignment.Center; Canvas.SetTop(handle, 1);- var val = new TextBlock { FontSize = 8, Foreground = TxtC, MinWidth = valW, TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Center };- val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- bool drag = false;- void Vis(double v) { double w = canvas.Bounds.Width; if (w <= 0) w = 90; fill.Width = Math.Max(0, v * w); Canvas.SetLeft(handle, v * w - 3); val.Text = fmt(v); }- void From(PointerEventArgs e) { double w = canvas.Bounds.Width; double v = w > 0 ? Math.Clamp(e.GetPosition(canvas).X / w, 0, 1) : 0; if (pi >= 0) engine.PluginParamSet(track, -1, pi, (float)v); Vis(v); Refresh(); }- canvas.PointerPressed += (_, e) => { drag = true; if (pi >= 0) engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); e.Pointer.Capture(canvas); From(e); };- canvas.PointerMoved += (_, e) => { if (drag) From(e); };- canvas.PointerReleased += (_, e) => { if (drag) { drag = false; if (pi >= 0) engine.EndAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); e.Pointer.Capture(null); } };- canvas.SizeChanged += (_, _) => Vis(G(id));- readouts.Add(() => { if (!drag) Vis(G(id)); });- var grid = new Grid { ColumnDefinitions = new ColumnDefinitions($"{nameW},*,Auto"), ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center };- var nm = new TextBlock { Text = name, FontSize = 7, FontWeight = FontWeight.Bold, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center };- Grid.SetColumn(nm, 0); Grid.SetColumn(canvas, 1); Grid.SetColumn(val, 2);- grid.Children.Add(nm); grid.Children.Add(canvas); grid.Children.Add(val);- if (pi >= 0) MidiLearn.Bind(grid, MidiTarget.PluginParam(track, -1, pi), name);- return grid;+ int pi = I(id);+ var row = DeviceCardKit.SliderRow(name, () => G(id), n => { if (pi >= 0) engine.PluginParamSet(track, -1, pi, (float)n); Refresh(); }, () => fmt(G(id)), out var sync,+ begin: () => { if (pi >= 0) engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); },+ end: () => { if (pi >= 0) engine.EndAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); },+ labelWidth: nameW, valueWidth: valW);+ readouts.Add(sync);+ if (pi >= 0) MidiLearn.Bind(row, MidiTarget.PluginParam(track, -1, pi), name);+ return row;}// Vertical wheel slider bound to a param (pitch / mod). spring = auto-return to centre.Control VWheel(string id, string name, Func<double, string> fmt, IBrush? col = null, bool spring = false){int pi = I(id); var lit = col ?? Amber;- var grad = new LinearGradientBrush { StartPoint = new RelativePoint(0, 0, RelativeUnit.Relative), EndPoint = new RelativePoint(0, 1, RelativeUnit.Relative),- GradientStops = { new GradientStop(NotaPalette.SurfaceRaised.Color, 0), new GradientStop(NotaPalette.BgSunken.Color, 0.5), new GradientStop(NotaPalette.SurfaceRaised.Color, 1) } };- var trackBar = new Border { Width = 16, Background = grad, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(8), VerticalAlignment = VerticalAlignment.Stretch };- var mark = new Border { Height = 2, Background = lit, CornerRadius = new CornerRadius(1), Margin = new Thickness(2, 0) };+ IBrush grad = NotaPalette.BgSunken;+ var trackBar = new Border { Width = 16, Background = grad, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Pill, VerticalAlignment = VerticalAlignment.Stretch };+ var mark = new Border { Height = 2, Background = lit, CornerRadius = NotaRadius.Bar, Margin = new Thickness(2, 0) };var lay = new Canvas { Width = 16, VerticalAlignment = VerticalAlignment.Stretch };var host = new Panel { Width = 16, VerticalAlignment = VerticalAlignment.Stretch, Children = { trackBar, lay } };lay.Children.Add(mark); mark.Width = 12;@@ -193,24 +165,24 @@ internal sealed class MonolithInstrumentCard : IInstrumentCard}// ---- formatters -------------------------------------------------------- string StFmt(float v) => $"{(v - 0.5f) * 5f:+0.0;-0.0;0.0} st";- string GlideFmt(float v) => v <= 0.001f ? "off" : (Sec(0.002, 10, v) is var s && s >= 1 ? $"{s:0.0} s" : $"{s * 1000:0} ms");- string DetFmt(float v) => $"{(v - 0.5f) * 14f:+0.00;-0.00;0.00}";+ string StFmt(float v) => $"{(v - 0.5f) * 5f:+0.0;−0.0;0.0}\u2009st";+ string GlideFmt(float v) => v <= 0.001f ? "off" : (Sec(0.002, 10, v) is var s && s >= 1 ? $"{s:0.0}\u2009s" : $"{s * 1000:0}\u2009ms");+ string DetFmt(float v) => $"{(v - 0.5f) * 14f:+0.00;−0.00;0.00}";string HzFmt(float v) { double hz = 16 * Math.Pow(1250, v); return hz >= 1000 ? $"{hz / 1000:0.0}k" : $"{hz:0}"; }string EmphFmt(float v) => $"{v * 10f:0.0}";- string TimeFmt(double lo, double hi, float v) { double s = Sec(lo, hi, v); return s >= 1 ? $"{s:0.0}s" : $"{s * 1000:0}ms"; }- string VolFmt(float v) => v <= 0.001f ? "−∞" : $"{20 * Math.Log10(v):0.0}dB";+ string TimeFmt(double lo, double hi, float v) { double s = Sec(lo, hi, v); return s >= 1 ? $"{s:0.0}\u2009s" : $"{s * 1000:0}\u2009ms"; }+ string VolFmt(float v) => v <= 0.001f ? "−∞" : $"{20 * Math.Log10(v):0.0}\u2009dB";static double Sec(double lo, double hi, double v) => lo * Math.Pow(hi / lo, Math.Clamp(v, 0, 1));// ======================================================================// LEFT — wheels column (always visible)// ======================================================================- var wheels = new Border { Width = 56, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(0, 5),+ var wheels = new Border { Width = 56, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Padding = new Thickness(0, 5),Child = new DockPanel { LastChildFill = true, Children = {Head(Lbl("WHEELS", 7, MutedC)),new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, HorizontalAlignment = HorizontalAlignment.Center, Margin = new Thickness(0, 4, 0, 0), Children = {- VWheel("bend", "PITCH", v => $"{(v - 0.5) * 2 * (2 + G("bendrange") * 10):+0.0;-0.0;0.0}", null, spring: true),- VWheel("modwheel", "MOD", v => $"{v * 100:0}%", AmberLit) } } } } };+ VWheel("bend", "PITCH", v => $"{(v - 0.5) * 2 * (2 + G("bendrange") * 10):+0.0;−0.0;0.0}", null, spring: true),+ VWheel("modwheel", "MOD", v => $"{v * 100:0}\u2009%", AmberLit) } } } } };DockPanel.SetDock(wheels, Dock.Left);Control Head(Control c) { DockPanel.SetDock(c, Dock.Top); ((Control)c).HorizontalAlignment = HorizontalAlignment.Center; return c; }@@ -225,7 +197,7 @@ internal sealed class MonolithInstrumentCard : IInstrumentCardT("glideon", "Glide", 0, 0); T("legato", "Legato", 0, 1);T("decayon", "Decay", 1, 0); T("oscmodon", "Osc mod", 1, 1);T("filtmodon", "Filter mod", 2, 0); T("osc3kbd", "Osc 3 kbd", 2, 1);- var knobs = Row(6, K("tune", "TUNE", StFmt, false, 32, 40), K("glide", "GLIDE", GlideFmt, false, 32, 40), K("modmix", "MOD MIX", v => $"{v * 100:0}%", false, 32, 40));+ var knobs = Row(6, K("tune", "TUNE", StFmt, false, 32, 40), K("glide", "GLIDE", GlideFmt, false, 32, 40), K("modmix", "MOD MIX", v => $"{v * 100:0}\u2009%", false, 32, 40));var strip = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), ColumnSpacing = 10, Height = 56 };Grid.SetColumn((Control)knobs, 0); Grid.SetColumn(toggles, 1);strip.Children.Add((Control)knobs); strip.Children.Add(toggles);@@ -273,12 +245,12 @@ internal sealed class MonolithInstrumentCard : IInstrumentCard};filtCurve.DragStarted += () => { engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, "cutoff"); };filtCurve.DragEnded += () => { engine.EndAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, "cutoff"); };- var graph = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Child = filtCurve, Margin = new Thickness(0, 3, 0, 4) };+ var graph = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Child = filtCurve, Margin = new Thickness(0, 3, 0, 4) };var knobs = new Grid { ColumnDefinitions = new ColumnDefinitions("*,*,*,Auto"), ColumnSpacing = 2, VerticalAlignment = VerticalAlignment.Bottom };void C(Control c, int col) { Grid.SetColumn(c, col); knobs.Children.Add(c); }C(K("cutoff", "CUTOFF", HzFmt, false, 32, 44), 0);- C(K("emph", "EMPH", EmphFmt, false, 32, 40), 1);- C(K("contour", "CONTOUR", v => $"{v * 100:0}%", true, 32, 44), 2);+ C(K("emph", "EMPHASIS", EmphFmt, false, 32, 40), 1);+ C(K("contour", "CONTOUR", v => $"{v * 100:0}\u2009%", true, 32, 44), 2);var kbd = new StackPanel { Spacing = 2, VerticalAlignment = VerticalAlignment.Center, Children = {new TextBlock { Text = "KBD CTRL", FontSize = 7, FontWeight = FontWeight.Bold, Foreground = MutedC },Row(3, Toggle("kbd1", "1/3"), Toggle("kbd2", "2/3")) } };@@ -289,8 +261,8 @@ internal sealed class MonolithInstrumentCard : IInstrumentCardControl ContourPanel(string title, string route, MonolithEnvCurve curve, string pre, IBrush col){curve.VerticalAlignment = VerticalAlignment.Stretch;- var graph = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Child = curve };- var knobs = Row(1, K($"{pre}attack", "A", v => TimeFmt(0.001, 10, v), false, 26, 34), K($"{pre}decay", "D", v => TimeFmt(0.004, 20, v), false, 26, 34), K($"{pre}sustain", "S", v => $"{v * 100:0}%", false, 26, 34));+ var graph = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Child = curve };+ var knobs = Row(1, K($"{pre}attack", "A", v => TimeFmt(0.001, 10, v), false, 26, 34), K($"{pre}decay", "D", v => TimeFmt(0.004, 20, v), false, 26, 34), K($"{pre}sustain", "S", v => $"{v * 100:0}\u2009%", false, 26, 34));DockPanel.SetDock((Control)knobs, Dock.Right);((Control)knobs).Margin = new Thickness(6, 0, 0, 0);var head = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, Height = 11, Margin = new Thickness(0, 0, 0, 3), Children = { Lbl(title, 7, MutedC), new TextBlock { Text = route, FontSize = 7, Foreground = col, VerticalAlignment = VerticalAlignment.Center } } };@@ -335,7 +307,7 @@ internal sealed class MonolithInstrumentCard : IInstrumentCardvar ext = HSlider("extlvl", "EXT", v => $"{v * 10:0.0}", 26, 22); ext.HorizontalAlignment = HorizontalAlignment.Stretch; Grid.SetColumn(ext, 1);nrow.Children.Add(chips); nrow.Children.Add(ext);R(nrow, 4);- var fb = new Border { BorderBrush = BorderIn, BorderThickness = new Thickness(0, 1, 0, 0), Padding = new Thickness(0, 6, 0, 0), Child = MixRow("exton", "feedback", "FEEDB", RedC) };+ var fb = new Border { BorderBrush = BorderIn, BorderThickness = new Thickness(0, 1, 0, 0), Padding = new Thickness(0, 6, 0, 0), Child = MixRow("exton", "feedback", "FEEDBACK", RedC) };R(fb, 5);return g;}@@ -361,10 +333,10 @@ internal sealed class MonolithInstrumentCard : IInstrumentCardControl CentreBody(int t) => t == 1 ? (modTabC ??= ModifiersTab()) : (oscTabC ??= OscTab());Control RightBody(int t) => t == 1 ? (outTabC ??= OutputTab()) : (mixTabC ??= MixerTab());- var drift = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, VerticalAlignment = VerticalAlignment.Center, Width = 96, Children = { new TextBlock { Text = "DRIFT", FontSize = 7, FontWeight = FontWeight.Bold, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center }, WithStretch(HSlider("drift", "", v => $"{v * 100:0}%", 0, 22)) } };+ var drift = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, VerticalAlignment = VerticalAlignment.Center, Width = 96, Children = { new TextBlock { Text = "DRIFT", FontSize = 7, FontWeight = FontWeight.Bold, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center }, WithStretch(HSlider("drift", "", v => $"{v * 100:0}\u2009%", 0, 22)) } };var centre = TabPanel(new[] { "Controllers · Osc Bank", "Modifiers" }, drift, centreHost, CentreBody);- var right = new Border { Width = 186, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Child = TabInner(new[] { "Mixer", "Output" }, null, rightHost, RightBody, true) };+ var right = new Border { Width = 186, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Child = TabInner(new[] { "Mixer", "Output" }, null, rightHost, RightBody, true) };DockPanel.SetDock(right, Dock.Right);// ---- assemble ---------------------------------------------------------@@ -377,7 +349,7 @@ internal sealed class MonolithInstrumentCard : IInstrumentCard// local: build the centre tab panel (flex) with an extras control in the tab barControl TabPanel(string[] tabs, Control? extras, ContentControl host, Func<int, Control> body)- => new Border { Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Margin = new Thickness(5, 0), Child = TabInner(tabs, extras, host, body, false) };+ => new Border { Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Margin = new Thickness(5, 0), Child = TabInner(tabs, extras, host, body, false) };Control TabInner(string[] tabs, Control? extras, ContentControl host, Func<int, Control> body, bool centered){int sel = 0; var btns = new Border[tabs.Length];diff --git a/src/managed/Nota.App/DeviceCards/Instruments/OperatorInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/OperatorInstrumentCard.csindex e20b271f..664fbd5e 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/OperatorInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/OperatorInstrumentCard.cs@@ -93,70 +93,31 @@ internal sealed class OperatorInstrumentCard : IInstrumentCard// ---- generic building blocks ----------------------------------------Control MiniSlider(string label, string id, Func<double, string> fmt, double w){- var val = Mono(fmt(G(id)), TextPrimary); val.MinWidth = 22;- var fill = new Border { Height = 3, Background = Brass, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 7, Height = 9, Background = TextSecondary, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Width = w, Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent };- slot.Children.Add(new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center });- slot.Children.Add(fill); slot.Children.Add(handle);- void Vis(double v) { fill.Width = v * w; handle.Margin = new Thickness(Math.Clamp(v * w - 3.5, 0, w - 7), 0, 0, 0); }- bool drag = false;- void SetX(double x) { double v = Math.Clamp(x / w, 0, 1); SetId(id, (float)v); Vis(v); val.Text = fmt(v); Refresh(); }- slot.PointerPressed += (_, e) => { drag = true; Begin(id); e.Pointer.Capture(slot); SetX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); End(id); } };- readouts.Add(() => { if (!drag) { double v = G(id); Vis(v); val.Text = fmt(v); } });- return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap(label), slot, val } };+ var row = DeviceCardKit.SliderRow(label, () => G(id), n => { SetId(id, (float)n); Refresh(); }, () => fmt(G(id)), out var sync,+ begin: () => Begin(id), end: () => End(id), trackWidth: w, valueWidth: 22);+ readouts.Add(sync);+ return row;}Control Slider(string label, string id, IBrush fillB, Func<double, string>? fmt = null, double labelW = 44){- fmt ??= v => $"{v * 100:0}%";- var lbl = Cap(label); lbl.Width = labelW;- var val = Mono(fmt(G(id)), TextPrimary); val.Width = 44; val.TextAlignment = TextAlignment.Right;- var fill = new Border { Height = 3, Background = fillB, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 8, Height = 9, Background = TextSecondary, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent };- slot.Children.Add(new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center });- slot.Children.Add(fill); slot.Children.Add(handle);- void Vis(double v) { double W = slot.Bounds.Width; fill.Width = v * W; handle.Margin = new Thickness(Math.Clamp(v * W - 4, 0, Math.Max(0, W - 8)), 0, 0, 0); }- bool drag = false;- void SetX(double x) { double v = Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1); SetId(id, (float)v); Vis(v); val.Text = fmt(v); Refresh(); }- slot.PointerPressed += (_, e) => { drag = true; Begin(id); e.Pointer.Capture(slot); SetX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); End(id); } };- readouts.Add(() => { if (!drag) { double v = G(id); Vis(v); val.Text = fmt(v); } });- var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center };- Grid.SetColumn(slot, 1); Grid.SetColumn(val, 2);- g.Children.Add(lbl); g.Children.Add(slot); g.Children.Add(val);- return g;+ var f = fmt ?? (v => $"{v * 100:0}\u2009%");+ var row = DeviceCardKit.SliderRow(label, () => G(id), n => { SetId(id, (float)n); Refresh(); }, () => f(G(id)), out var sync,+ begin: () => Begin(id), end: () => End(id), labelWidth: labelW, valueWidth: 44);+ readouts.Add(sync);+ return row;}Control Chips(string id, string[] names, double fs = 9){- int n = names.Length; var arr = new Border[n];- void Hi() { int cur = Math.Clamp((int)Math.Round(G(id) * (n - 1)), 0, n - 1); for (int i = 0; i < n; i++) { bool on = i == cur; arr[i].Background = on ? AccentSubtleB : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AccentBright : TextSecondary; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2 };- for (int i = 0; i < n; i++)- {- int iv = i;- var chip = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(6, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, Foreground = TextSecondary } };- chip.PointerPressed += (_, _) => { if (n > 1) { SetId(id, iv / (float)(n - 1)); Refresh(); } };- arr[i] = chip; row.Children.Add(chip);- }- readouts.Add(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(2), Child = row };+ int n = names.Length;+ var seg = DeviceCardKit.Segments(names, () => Math.Clamp((int)Math.Round(G(id) * (n - 1)), 0, n - 1), iv => { if (n > 1) { SetId(id, iv / (float)(n - 1)); Refresh(); } }, out var sync);+ readouts.Add(sync);if (I(id) is var pi and >= 0) MidiLearn.Bind(seg, MidiTarget.PluginParam(track, -1, pi), id);return seg;}Control Toggle(string label, string id, IBrush accent){- var trk = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), Background = Inset };- var knob = new Ellipse { Width = 6, Height = 6, Fill = TextTertiary, HorizontalAlignment = HorizontalAlignment.Left, Margin = new Thickness(2, 0, 0, 0), VerticalAlignment = VerticalAlignment.Center };- trk.Child = knob;- var lbl = Cap(label, accent);- void Sync() { bool on = G(id) >= 0.5f; trk.Background = on ? accent : Inset; knob.Fill = on ? Ink : TextTertiary; knob.HorizontalAlignment = on ? HorizontalAlignment.Right : HorizontalAlignment.Left; knob.Margin = new Thickness(on ? 0 : 2, 0, on ? 2 : 0, 0); lbl.Foreground = on ? accent : TextTertiary; }- var host = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand), Children = { lbl, trk } };- host.PointerPressed += (_, _) => { SetId(id, G(id) >= 0.5f ? 0f : 1f); Refresh(); };- readouts.Add(Sync); Sync();+ var host = Switch(label, () => G(id) >= 0.5f, () => { SetId(id, G(id) >= 0.5f ? 0f : 1f); Refresh(); }, out var sync);+ readouts.Add(sync);if (I(id) is var pi and >= 0) MidiLearn.Bind(host, MidiTarget.PluginParam(track, -1, pi), label);return host;}@@ -176,32 +137,27 @@ internal sealed class OperatorInstrumentCard : IInstrumentCardBorder OpRow(int op){string pre = OpId[op];- var letter = new TextBlock { Text = OperatorTopo.Names[op], FontSize = 10, FontWeight = FontWeight.Bold, Foreground = Teal, Width = 12, VerticalAlignment = VerticalAlignment.Center };+ var letter = new TextBlock { Text = OperatorTopo.Names[op], FontSize = 9, FontWeight = FontWeight.Bold, Foreground = Teal, Width = 12, VerticalAlignment = VerticalAlignment.Center };var role = new TextBlock { FontSize = 8, FontWeight = FontWeight.Bold, Width = 58, VerticalAlignment = VerticalAlignment.Center };var wave = Chips(pre + "wave", WaveShort, 8);var coarse = DragVal(pre + "coarse", v => { int i = Math.Clamp((int)Math.Round(v * 15), 0, 15); return "×" + Ratios[i].ToString(Ratios[i] < 1 ? "0.0#" : "0"); }, 30);var fine = DragVal(pre + "fine", v => { int c = (int)Math.Round((v - 0.5) * 100); return (c >= 0 ? "+" : "") + c; }, 24);var accentBar = new Border { Width = 2, Background = Teal };- var lvlFill = new Border { Height = 3, Background = Teal, Opacity = 0.75, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var lvlSlot = new Panel { Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent };- lvlSlot.Children.Add(new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center });- lvlSlot.Children.Add(lvlFill);- var lvlVal = Mono("", TextPrimary); lvlVal.Width = 44; lvlVal.TextAlignment = TextAlignment.Right;string LvlF(double v) => v <= 1e-3 ? "−∞" : $"{20 * Math.Log10(v):0.0}";- void LvlVis(double v) { lvlFill.Width = v * lvlSlot.Bounds.Width; }- bool ld = false; string lid = pre + "level";- void LvlX(double x) { double v = Math.Clamp(x / Math.Max(1, lvlSlot.Bounds.Width), 0, 1); SetId(lid, (float)v); LvlVis(v); lvlVal.Text = LvlF(v); Refresh(); }- lvlSlot.PointerPressed += (_, e) => { ld = true; Begin(lid); e.Pointer.Capture(lvlSlot); LvlX(e.GetPosition(lvlSlot).X); };- lvlSlot.PointerMoved += (_, e) => { if (ld) LvlX(e.GetPosition(lvlSlot).X); };- lvlSlot.PointerReleased += (_, e) => { if (ld) { ld = false; e.Pointer.Capture(null); End(lid); } };+ string lid = pre + "level";+ var lvlVal = Mono("", TextPrimary); lvlVal.Width = 44; lvlVal.TextAlignment = TextAlignment.Right;+ var lvlSlot = new SliderTrack();+ lvlSlot.Changed += v => { SetId(lid, (float)v); lvlVal.Text = LvlF(v); Refresh(); };+ lvlSlot.GestureBegin += () => Begin(lid);+ lvlSlot.GestureEnd += () => End(lid);readouts.Add(() =>{var tgt = OperatorTopo.Algo[AlgoIdx()];bool carr = tgt[op] == 4;role.Text = carr ? "CARRIER" : "MOD → " + OperatorTopo.Names[tgt[op]];var rc = carr ? Brass : Teal;- role.Foreground = rc; letter.Foreground = rc; accentBar.Background = rc; lvlFill.Background = rc;- if (!ld) { double v = G(lid); LvlVis(v); lvlVal.Text = LvlF(v); }+ role.Foreground = rc; letter.Foreground = rc; accentBar.Background = rc;+ if (!lvlSlot.Dragging) { double v = G(lid); lvlSlot.Norm = v; lvlVal.Text = LvlF(v); }});var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,Auto,Auto,Auto,*,Auto"), ColumnSpacing = 7, VerticalAlignment = VerticalAlignment.Center };@@ -210,7 +166,7 @@ internal sealed class OperatorInstrumentCard : IInstrumentCardvar inner = new DockPanel { LastChildFill = true };DockPanel.SetDock(accentBar, Dock.Left); inner.Children.Add(accentBar);inner.Children.Add(new Border { Padding = new Thickness(6, 0), Child = g });- return new Border { Background = NotaPalette.BgApp, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), ClipToBounds = true, Height = 34, Child = inner };+ return new Border { Background = NotaPalette.BgApp, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, ClipToBounds = true, Height = 34, Child = inner };}var opsHeader = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), Height = 11 };@@ -261,17 +217,17 @@ internal sealed class OperatorInstrumentCard : IInstrumentCardControl EnvSelector(Func<int> get, Action<int> set){var arr = new Border[4];- void Hi() { int cur = get(); for (int i = 0; i < 4; i++) { bool on = i == cur; arr[i].Background = on ? AccentSubtleB : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? OpColor[i] : TextTertiary; } }+ void Hi() { int cur = get(); for (int i = 0; i < 4; i++) { bool on = i == cur; arr[i].Background = on ? NotaPalette.Accent : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? OpColor[i] : TextTertiary; } }var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };for (int i = 0; i < 4; i++){int iv = i;- var chip = new Border { CornerRadius = new CornerRadius(2), Padding = new Thickness(5, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = OperatorTopo.Names[i], FontSize = 8, FontWeight = FontWeight.Bold, Foreground = TextTertiary } };+ var chip = new Border { CornerRadius = NotaRadius.Clip, Padding = new Thickness(5, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = OperatorTopo.Names[i], FontSize = 8, FontWeight = FontWeight.Bold, Foreground = TextTertiary } };chip.PointerPressed += (_, _) => { set(iv); applyEnv(); Refresh(); };arr[i] = chip; row.Children.Add(chip);}readouts.Add(Hi); Hi();- return new Border { Background = Inset, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), HorizontalAlignment = HorizontalAlignment.Left, Child = row };+ return new Border { Background = Inset, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(1), HorizontalAlignment = HorizontalAlignment.Left, Child = row };}var slotA = new DockPanel { LastChildFill = true, Height = 62 };var selA = EnvSelector(() => envAop, v => envAop = v); DockPanel.SetDock(selA, Dock.Top); slotA.Children.Add(selA); slotA.Children.Add(envA);@@ -288,7 +244,7 @@ internal sealed class OperatorInstrumentCard : IInstrumentCardvar filtLeft = new StackPanel { Spacing = 7, Width = 210, VerticalAlignment = VerticalAlignment.Top, Children ={Cap("FILTER"), Chips("filtype", new[] { "LP", "HP", "BP" }),- Slider("FREQ", "filfreq", Brass, v => $"{60 * Math.Pow(300, v):0} Hz"), Slider("RESO", "filreso", Brass),+ Slider("FREQ", "filfreq", Brass, v => $"{60 * Math.Pow(300, v):0}\u2009Hz"), Slider("RESO", "filreso", Brass),new Border { Height = 6 }, Cap("OUTPUT"), Slider("VOLUME", "volume", Brass),} };var filtRight = new DockPanel { LastChildFill = true };@@ -304,10 +260,10 @@ internal sealed class OperatorInstrumentCard : IInstrumentCardvar host = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 12, VerticalAlignment = VerticalAlignment.Center, Children ={Cap("LIVE", TextTertiary),- MiniSlider("FM", "fmdepth", v => $"{v * 200:0}%", 46),- MiniSlider("FDBK", "feedback", v => $"{v * 100:0}%", 40),+ MiniSlider("FM", "fmdepth", v => $"{v * 200:0}\u2009%", 46),+ MiniSlider("FEEDBACK", "feedback", v => $"{v * 100:0}\u2009%", 40),MiniSlider("TONE", "filfreq", v => $"{60 * Math.Pow(300, v):0}", 42),- MiniSlider("GLIDE", "glide", v => v <= 0 ? "off" : $"{5 * Math.Pow(240, v):0}ms", 42),+ MiniSlider("GLIDE", "glide", v => v <= 0 ? "off" : $"{5 * Math.Pow(240, v):0}\u2009ms", 42),} };var mode = Toggle("MONO", "mono", Brass); mode.HorizontalAlignment = HorizontalAlignment.Right;var wrap = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto") };@@ -320,7 +276,7 @@ internal sealed class OperatorInstrumentCard : IInstrumentCardvar desc = Cap("", TextTertiary); desc.Margin = new Thickness(8, 0, 0, 0);readouts.Add(() => { int a = AlgoIdx(); num.Text = $"{a + 1} of {OperatorTopo.Count}"; desc.Text = OperatorTopo.Desc[a]; });var host = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 0, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("ALGORITHM", TextTertiary), num, desc } };- var fbSlider = MiniSlider("FEEDBACK", "feedback", v => $"{v * 100:0}%", 46); fbSlider.HorizontalAlignment = HorizontalAlignment.Right;+ var fbSlider = MiniSlider("FEEDBACK", "feedback", v => $"{v * 100:0}\u2009%", 46); fbSlider.HorizontalAlignment = HorizontalAlignment.Right;var wrap = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto") };Grid.SetColumn(fbSlider, 1); wrap.Children.Add(host); wrap.Children.Add(fbSlider);return new Border { Height = 34, Background = Strip, BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 0, 1), Padding = new Thickness(9, 0), Child = wrap };@@ -352,7 +308,7 @@ internal sealed class OperatorInstrumentCard : IInstrumentCardfor (int i = 0; i < 3; i++){int iv = i;- var b = new Border { Height = 22, CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(2, 0, 0, 0), Padding = new Thickness(8, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = tabNames[i], FontSize = 10, FontWeight = FontWeight.SemiBold, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center } };+ var b = new Border { Height = 22, CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(2, 0, 0, 0), Padding = new Thickness(8, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = tabNames[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center } };b.PointerPressed += (_, _) => SelectTab(iv);tabBtns[i] = b; railStack.Children.Add(b);}diff --git a/src/managed/Nota.App/DeviceCards/Instruments/PendulumInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/PendulumInstrumentCard.csindex 05db4b01..7a26da2c 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/PendulumInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/PendulumInstrumentCard.cs@@ -93,18 +93,9 @@ internal sealed class PendulumInstrumentCard : IInstrumentCard// Param-backed segmented control (fill = active choice), writing i/(n-1).Control Seg(string id, string[] names, double fs = 9, double padX = 6){- int n = names.Length; var arr = new Border[n];- void Hi() { int cur = GI(id, n); for (int i = 0; i < n; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Brushes.Transparent; arr[i].BorderBrush = on ? Amber : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : MutedC; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++)- {- int iv = i;- var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(padX, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, Foreground = MutedC } };- c.PointerPressed += (_, _) => { SetId(id, n > 1 ? iv / (double)(n - 1) : 0); Refresh(); };- arr[i] = c; row.Children.Add(c);- }- readouts.Add(Hi);- var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ int n = names.Length;+ var seg = DeviceCardKit.Segments(names, () => GI(id, n), iv => { SetId(id, n > 1 ? iv / (double)(n - 1) : 0); Refresh(); }, out var sync);+ readouts.Add(sync);if (I(id) is var pi and >= 0) MidiLearn.Bind(seg, MidiTarget.PluginParam(track, -1, pi), id);return seg;}@@ -115,7 +106,7 @@ internal sealed class PendulumInstrumentCard : IInstrumentCardvar accent = teal ? TealC : Amber;var accentLit = teal ? TealC : AmberLit;var fillOn = teal ? NotaPalette.Wash(NotaPalette.Teal, 0x24) : AmberSubtle;- var b = new Border { CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 9, FontWeight = FontWeight.SemiBold } };+ var b = new Border { CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 9, FontWeight = FontWeight.SemiBold } };void Hi() { bool on = G(id) > 0.5f; b.Background = on ? fillOn : Brushes.Transparent; b.BorderBrush = on ? accent : Border2; ((TextBlock)b.Child!).Foreground = on ? accentLit : MutedC; }b.PointerPressed += (_, _) => { SetId(id, G(id) > 0.5f ? 0 : 1); Refresh(); };readouts.Add(Hi);@@ -126,7 +117,7 @@ internal sealed class PendulumInstrumentCard : IInstrumentCard// Momentary action button (writes 1 → the engine self-clears it).Control ActionBtn(string label, Action click){- var b = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), BorderBrush = Border2, Background = RowLit, Padding = new Thickness(0, 2), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = label, FontSize = 9, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center } };+ var b = new Border { CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), BorderBrush = Border2, Background = RowLit, Padding = new Thickness(0, 2), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = label, FontSize = 9, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center } };b.PointerPressed += (_, _) => click();return b;}@@ -150,39 +141,28 @@ internal sealed class PendulumInstrumentCard : IInstrumentCardControl HSlider(string id, string label, Func<double, string> fmt, bool teal = false, double lw = 38){if (!idx.TryGetValue(id, out var pi)) return new Panel();- var fill = new Border { Height = 3, Background = teal ? TealC : Amber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var track2 = new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Height = 12, Children = { track2, fill } };- var val = new TextBlock { Text = fmt(G(id)), FontSize = 9, Foreground = TxtC, Width = 34, TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Center };- val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- bool drag = false;- void SetFromX(double x) { double v = Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1); engine.PluginParamSet(track, -1, pi, (float)v); val.Text = fmt(v); fill.Width = v * slot.Bounds.Width; }- slot.PointerPressed += (_, e) => { drag = true; e.Pointer.Capture(slot); engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); SetFromX(e.GetPosition(slot).X); Refresh(); };- slot.PointerMoved += (_, e) => { if (drag) SetFromX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); engine.EndAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); } };- MidiLearn.Bind(slot, MidiTarget.PluginParam(track, -1, pi), label);- readouts.Add(() => { if (!drag) { double v = G(id); val.Text = fmt(v); fill.Width = v * slot.Bounds.Width; } });- var lbl = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = teal ? TealC : MutedC, Width = lw, VerticalAlignment = VerticalAlignment.Center };- var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 5 };- g.Children.Add(lbl);- Grid.SetColumn(slot, 1); g.Children.Add(slot);- Grid.SetColumn(val, 2); g.Children.Add(val);- return g;+ var row = DeviceCardKit.SliderRow(label, () => G(id), n => engine.PluginParamSet(track, -1, pi, (float)n), () => fmt(G(id)), out var sync,+ begin: () => { engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); Refresh(); },+ end: () => engine.EndAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id),+ labelWidth: lw, valueWidth: 34);+ MidiLearn.Bind(row, MidiTarget.PluginParam(track, -1, pi), label);+ readouts.Add(sync);+ return row;}// Bipolar Rate slider: centre detent, fills from the middle, signed %, reverse hint.Control RateBipolar(){const double TW = 84;- var basec = new Border { Height = 5, Background = Inset, CornerRadius = new CornerRadius(3), VerticalAlignment = VerticalAlignment.Center };+ var basec = new Border { Height = 5, Background = Inset, CornerRadius = NotaRadius.Badge, VerticalAlignment = VerticalAlignment.Center };var center = new Border { Width = 1, Background = NotaPalette.BorderStrong, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Stretch, Margin = new Thickness(4, 1) };- var fill = new Border { Height = 5, Background = Amber, CornerRadius = new CornerRadius(3), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 8, Height = 11, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var fill = new Border { Height = 5, Background = Amber, CornerRadius = NotaRadius.Badge, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var handle = new Border { Width = 8, Height = 11, Background = NotaPalette.TextSecondary, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };var slot = new Panel { Width = TW, Height = 11, Children = { basec, center, fill, handle } };var val = new TextBlock { Text = "", FontSize = 9, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center };val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");bool drag = false;- void Upd() { double v = G("rate"); double cxp = TW * 0.5, hx = v * TW; handle.Margin = new Thickness(Math.Clamp(hx - 4, 0, TW - 8), 0, 0, 0); double a = Math.Min(cxp, hx), b = Math.Max(cxp, hx); fill.Margin = new Thickness(a + 4, 0, 0, 0); fill.Width = Math.Max(0, b - a - 4); val.Text = $"{(v - 0.5) * 2 * 100:+0;-0;0} %"; }+ void Upd() { double v = G("rate"); double cxp = TW * 0.5, hx = v * TW; handle.Margin = new Thickness(Math.Clamp(hx - 4, 0, TW - 8), 0, 0, 0); double a = Math.Min(cxp, hx), b = Math.Max(cxp, hx); fill.Margin = new Thickness(a + 4, 0, 0, 0); fill.Width = Math.Max(0, b - a - 4); val.Text = $"{(v - 0.5) * 2 * 100:+0;−0;0}\u2009%"; }void SetFromX(double x) { SetId("rate", Math.Clamp(x / TW, 0, 1)); Upd(); }slot.PointerPressed += (_, e) => { drag = true; e.Pointer.Capture(slot); engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, "rate"); SetFromX(e.GetPosition(slot).X); Refresh(); };slot.PointerMoved += (_, e) => { if (drag) SetFromX(e.GetPosition(slot).X); };@@ -192,10 +172,10 @@ internal sealed class PendulumInstrumentCard : IInstrumentCardCap("RATE"), slot, val, new TextBlock { Text = "← reverse", FontSize = 8, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center } } };}- string Pct(double v) => $"{v * 100:0} %";- string Ms(double v, double lo, double hi) { double s = Exp(v, lo, hi); return s < 1.0 ? $"{s * 1000:0} ms" : $"{s:0.00} s"; }- string Db(double v) => v <= 0.001 ? "−∞ dB" : $"{20 * Math.Log10(v):+0.0;−0.0;0.0} dB";- string Cents(double v) => $"{v * 14:0} c";+ string Pct(double v) => $"{v * 100:0}\u2009%";+ string Ms(double v, double lo, double hi) { double s = Exp(v, lo, hi); return s < 1.0 ? $"{s * 1000:0}\u2009ms" : $"{s:0.00}\u2009s"; }+ string Db(double v) => v <= 0.001 ? "−∞\u2009dB" : $"{20 * Math.Log10(v):+0.0;−0.0;0.0}\u2009dB";+ string Cents(double v) => $"{v * 14:0}\u2009c";string Tone(double v) => v < 0.34 ? "dark" : v < 0.67 ? "warm" : "bright";// ---------- LIVE strip ----------@@ -222,7 +202,7 @@ internal sealed class PendulumInstrumentCard : IInstrumentCardfor (int i = 0; i < tabNames.Length; i++){int ti = i;- var b = new Border { Height = 20, CornerRadius = new CornerRadius(4), Padding = new Thickness(7, 0), BorderThickness = new Thickness(2, 0, 0, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = tabNames[i], FontSize = 10, FontWeight = FontWeight.Medium, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center } };+ var b = new Border { Height = 20, CornerRadius = NotaRadius.Control, Padding = new Thickness(7, 0), BorderThickness = new Thickness(2, 0, 0, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = tabNames[i], FontSize = 9, FontWeight = FontWeight.Medium, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center } };b.PointerPressed += (_, _) => SelectTab(ti);tabBtns[i] = b; railCol.Children.Add(b);}@@ -230,7 +210,7 @@ internal sealed class PendulumInstrumentCard : IInstrumentCardvar ballsNum = new TextBlock { Text = "3", FontSize = 9, Foreground = TxtC, [DockPanel.DockProperty] = Dock.Right };ballsNum.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");void StepBalls(int d) { int c = Math.Clamp(2 + (int)Math.Round(G("balls") * 4) + d, 2, MaxBalls); SetId("balls", (c - 2) / 4.0); Refresh(); }- Border StepBtn(string t, int d) { var b = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), BorderBrush = NotaPalette.BorderStrong, Background = RowLit, Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = t, FontSize = 9, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center } }; b.PointerPressed += (_, _) => StepBalls(d); return b; }+ Border StepBtn(string t, int d) { var b = new Border { CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), BorderBrush = NotaPalette.BorderStrong, Background = RowLit, Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = t, FontSize = 9, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center } }; b.PointerPressed += (_, _) => StepBalls(d); return b; }var stepGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,*"), ColumnSpacing = 3 };var sm = StepBtn("−", -1); var sp = StepBtn("+", +1); Grid.SetColumn(sp, 1); stepGrid.Children.Add(sm); stepGrid.Children.Add(sp);var ballsBox = new StackPanel { Spacing = 3, Children = {@@ -254,16 +234,16 @@ internal sealed class PendulumInstrumentCard : IInstrumentCardrNote[i] = new TextBlock { FontSize = 9, Foreground = TxtC, HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center, [DockPanel.DockProperty] = Dock.Right };rNote[i].BindResource(TextBlock.FontFamilyProperty, "Font.Mono");var inner = new DockPanel { LastChildFill = false, Children = { new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, Children = { dot, rDiv[i], rRate[i], rPhase[i], rDir[i] } }, rNote[i] } };- rowBorder[i] = new Border { BorderThickness = new Thickness(1), BorderBrush = Border2, Background = RailBg, CornerRadius = new CornerRadius(4), Padding = new Thickness(6, 3), Child = inner };+ rowBorder[i] = new Border { BorderThickness = new Thickness(1), BorderBrush = Border2, Background = RailBg, CornerRadius = NotaRadius.Control, Padding = new Thickness(6, 3), Child = inner };ballList.Children.Add(rowBorder[i]);}- void rDot(int i, out Border dot) => dot = new Border { Width = 7, Height = 7, CornerRadius = new CornerRadius(4), Background = Amber, VerticalAlignment = VerticalAlignment.Center };+ void rDot(int i, out Border dot) => dot = new Border { Width = 7, Height = 7, CornerRadius = NotaRadius.Control, Background = Amber, VerticalAlignment = VerticalAlignment.Center };var listHeader = new DockPanel { LastChildFill = false, Children = {Cap("BALLS"), new TextBlock { Text = "rate · phase · note", FontSize = 8, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center, [DockPanel.DockProperty] = Dock.Right } } };var sortRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = {Cap("SORT"), Seg("chordsort", new[] { "Up", "Down" }, 8, 6),- new TextBlock { Text = "QNT", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(6, 0, 0, 0) }, Seg("quantize", QuantNames, 8, 5) } };+ new TextBlock { Text = "QUANTIZE", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(6, 0, 0, 0) }, Seg("quantize", QuantNames, 8, 5) } };var actionRow = new Grid { ColumnDefinitions = new ColumnDefinitions("*,*,*"), ColumnSpacing = 4 };var holdBtn = OutToggle("hold", "Hold"); var firstBtn = OutToggle("firstnote", "First note"); var resetBtn = ActionBtn("Reset", () => { SetId("reset", 1); });Grid.SetColumn((Control)firstBtn, 1); Grid.SetColumn((Control)resetBtn, 2);@@ -293,8 +273,8 @@ internal sealed class PendulumInstrumentCard : IInstrumentCardbool near = heldN > 0 && (frac < 0.14 || frac > 0.86);int deg = fieldFull.BallDegree(i);rDiv[i].Text = DivNames[GI("division", 5)];- rRate[i].Text = $"{rr * 100:+0;-0;0}%";- rPhase[i].Text = $"{ph * 100:0}%";+ rRate[i].Text = $"{rr * 100:+0;−0;0}\u2009%";+ rPhase[i].Text = $"{ph * 100:0}\u2009%";rDir[i].Text = baseRate >= 0 ? "→" : "←";rNote[i].Text = (deg >= 0 && heldN > 0) ? NoteName(heldBuf[Math.Clamp(sortDown ? heldN - 1 - deg : deg, 0, heldN - 1)]) : "—";rowDot[i].Background = near ? AccentBright : Amber;@@ -308,7 +288,7 @@ internal sealed class PendulumInstrumentCard : IInstrumentCardvar miniStrip = new Border { Height = 62, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(0, 0, 0, 1), Child = new Panel { Children = {fieldMini,new TextBlock { Text = "FIELD", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedC, Margin = new Thickness(8, 4, 0, 0), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top },- new TextBlock { Text = "▴ Balls tab", FontSize = 8, Foreground = MutedC, Margin = new Thickness(0, 0, 8, 3), HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Bottom } } } };+ new TextBlock { Text = "Balls tab above", FontSize = 8, Foreground = MutedC, Margin = new Thickness(0, 0, 8, 3), HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Bottom } } } };var wavesRow = Seg("wave", WaveNames, 9, 9);var voiceKnobs = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2, HorizontalAlignment = HorizontalAlignment.Center, Children = {KUnit("tone", "TONE", Tone), KUnit("bright", "BRIGHT", Pct), KUnit("fm", "FM", Pct, mod: true) } };@@ -324,11 +304,11 @@ internal sealed class PendulumInstrumentCard : IInstrumentCardvoiceCenter.Children.Add(wavesRow); voiceCenter.Children.Add(vRow); voiceCenter.Children.Add(vDiv); voiceCenter.Children.Add(eRow);// scale root + mode cyclers- var rootBox = new Border { Height = 18, MinWidth = 30, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(6, 0), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center };+ var rootBox = new Border { Height = 18, MinWidth = 30, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Padding = new Thickness(6, 0), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center };var rootTx = new TextBlock { FontSize = 9, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center }; rootTx.BindResource(TextBlock.FontFamilyProperty, "Font.Mono"); rootBox.Child = rootTx;rootBox.PointerPressed += (_, _) => { int r = (GI("root", 12) + 1) % 12; SetId("root", r / 11.0); Refresh(); };- var modeBox = new Border { Height = 18, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(6, 0), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center };- var modeTx = new TextBlock { FontSize = 9, Foreground = TextSecondary, VerticalAlignment = VerticalAlignment.Center }; modeBox.Child = new DockPanel { Children = { new TextBlock { Text = "▾", FontSize = 8, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center, [DockPanel.DockProperty] = Dock.Right, Margin = new Thickness(6, 0, 0, 0) }, modeTx } };+ var modeBox = new Border { Height = 18, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Padding = new Thickness(6, 0), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center };+ var modeTx = new TextBlock { FontSize = 9, Foreground = TextSecondary, VerticalAlignment = VerticalAlignment.Center }; modeBox.Child = new DockPanel { Children = { new Glyph(GlyphKind.ChevronDown, 8) { Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center, [DockPanel.DockProperty] = Dock.Right, Margin = new Thickness(6, 0, 0, 0) }, modeTx } };modeBox.PointerPressed += (_, _) => { int m = (GI("scalemode", 6) + 1) % 6; SetId("scalemode", m / 5.0); Refresh(); };readouts.Add(() => { rootTx.Text = RootNames[GI("root", 12)]; modeTx.Text = ModeNames[GI("scalemode", 6)]; });var spreadRail = new Border { Width = 104, Background = RailBg, BorderBrush = Border2, BorderThickness = new Thickness(1, 0, 0, 0), Padding = new Thickness(8, 6), Child =diff --git a/src/managed/Nota.App/DeviceCards/Instruments/PentadInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/PentadInstrumentCard.csindex b3101752..0f3dde90 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/PentadInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/PentadInstrumentCard.cs@@ -28,7 +28,7 @@ namespace Nota.App;internal sealed class PentadInstrumentCard : IInstrumentCard{private static readonly IBrush RailBg = NotaPalette.SurfaceInset;- private static readonly IBrush Panel = NotaPalette.BgApp;+ private static readonly IBrush Panel = NotaPalette.TextOnAccent; // dark ink over an engaged fillprivate static readonly IBrush Border2 = NotaPalette.BorderDefault;private static readonly IBrush BorderIn = NotaPalette.GraphBorder;private static readonly IBrush Inset = NotaPalette.BgSunken;@@ -130,15 +130,8 @@ internal sealed class PentadInstrumentCard : IInstrumentCard// On/off pill toggle backed by a param (> 0.5 = on).Control Toggle(string id, string label, List<Action>? into = null){- var pill = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), VerticalAlignment = VerticalAlignment.Center };- var dot = new Border { Width = 7, Height = 7, CornerRadius = new CornerRadius(4) };- var host = new Canvas { Width = 18, Height = 10 }; Canvas.SetTop(dot, 1.5); host.Children.Add(dot); pill.Child = host;- var txt = new TextBlock { Text = label, FontSize = 8, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center };- void Hi() { bool on = On(id); pill.Background = on ? Amber : OffPill; dot.Background = on ? Panel : MutedC; Canvas.SetLeft(dot, on ? 9.5 : 1.5); txt.Foreground = on ? TxtC : Txt2; }- var wrap = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Children = { pill } };- if (label.Length > 0) wrap.Children.Add(txt);- wrap.PointerPressed += (_, e) => { if (!e.GetCurrentPoint(wrap).Properties.IsLeftButtonPressed) return; SetP(id, On(id) ? 0f : 1f); Refresh(); e.Handled = true; };- (into ?? readouts).Add(Hi); Hi();+ var wrap = Switch(label, () => On(id), () => { SetP(id, On(id) ? 0f : 1f); Refresh(); }, out var sync);+ (into ?? readouts).Add(sync);if (I(id) is var pi and >= 0) MidiLearn.Bind(wrap, MidiTarget.PluginParam(track, -1, pi), label.Length > 0 ? label : id);return wrap;}@@ -146,31 +139,9 @@ internal sealed class PentadInstrumentCard : IInstrumentCard// Segmented chips. values[i] is written on click; the lit chip is the nearest value.Control Chips(string id, string[] names, float[]? values = null, List<Action>? into = null, double fs = 7){- int n = names.Length;- values ??= BuildValues(n);- var arr = new Border[n];- void Hi()- {- float cur = G(id); int best = 0;- for (int i = 1; i < n; i++) if (Math.Abs(values[i] - cur) < Math.Abs(values[best] - cur)) best = i;- bool exact = Math.Abs(values[best] - cur) < 0.02f;- for (int i = 0; i < n; i++)- {- bool on = i == best && exact;- arr[i].Background = on ? Amber : Brushes.Transparent;- var tb = (TextBlock)arr[i].Child!; tb.Foreground = on ? Panel : MutedC; tb.FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal;- }- }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++)- {- int iv = i;- var c = new Border { CornerRadius = new CornerRadius(2), Padding = new Thickness(4, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, Foreground = MutedC } };- c.PointerPressed += (_, e) => { SetP(id, values[iv]); Refresh(); e.Handled = true; };- arr[i] = c; row.Children.Add(c);- }- (into ?? readouts).Add(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Left, Child = row };+ var vals = values ?? BuildValues(names.Length);+ var seg = DeviceCardKit.Segments(names, () => DeviceCardKit.NearestExact(G(id), vals), iv => { SetP(id, vals[iv]); Refresh(); }, out var sync);+ (into ?? readouts).Add(sync);if (I(id) is var pi and >= 0) MidiLearn.Bind(seg, MidiTarget.PluginParam(track, -1, pi), id);return seg;}@@ -180,8 +151,8 @@ internal sealed class PentadInstrumentCard : IInstrumentCardControl WaveChip(string id, int wave, double w = 22, double h = 16){var ic = new PentadWaveIcon(wave) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };- var b = new Border { Width = w, Height = h, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Cursor = new Cursor(StandardCursorType.Hand), Child = ic };- void Hi() { bool on = On(id); b.Background = on ? AmberSubtle : Brushes.Transparent; b.BorderBrush = on ? Amber : NotaPalette.BorderStrong; ic.Stroke = on ? AmberLit : MutedC; ic.InvalidateVisual(); }+ var b = new Border { Width = w, Height = h, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Cursor = new Cursor(StandardCursorType.Hand), Child = ic };+ void Hi() { bool on = On(id); b.Background = on ? NotaPalette.AccentSubtle : Brushes.Transparent; b.BorderBrush = on ? NotaPalette.BorderBrass : NotaPalette.BorderStrong; ic.Stroke = on ? NotaPalette.AccentHover : MutedC; ic.InvalidateVisual(); }b.PointerPressed += (_, e) => { SetP(id, On(id) ? 0f : 1f); Refresh(); e.Handled = true; };readouts.Add(Hi); Hi();if (I(id) is var pi and >= 0) MidiLearn.Bind(b, MidiTarget.PluginParam(track, -1, pi), id);@@ -192,36 +163,14 @@ internal sealed class PentadInstrumentCard : IInstrumentCardControl HSlider(string id, Func<double, string> fmt, double valW = 24, Func<bool>? dim = null, List<Action>? into = null){int pi = I(id);- var fill = new Border { Height = 3, Background = Amber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 6, Height = 7, Background = Handle, CornerRadius = new CornerRadius(2) };- var lay = new Canvas { Height = 9 };- lay.Children.Add(handle); Canvas.SetTop(handle, 1);- var canvas = new Panel { Height = 11, MinWidth = 24, Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Children = {- new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center }, fill, lay } };- var val = MonoText("", 8, TxtC); val.MinWidth = valW; val.TextAlignment = TextAlignment.Right;- bool drag = false;- void Vis(double v)- {- double w = canvas.Bounds.Width; if (w <= 0) w = 80;- fill.Width = Math.Max(0, v * w); Canvas.SetLeft(handle, v * w - 3); val.Text = fmt(v);- bool d = dim?.Invoke() ?? false;- fill.Background = d ? NotaPalette.BorderStrong : Amber; handle.Background = d ? MutedC : Handle; val.Foreground = d ? Txt2 : TxtC;- }- void From(PointerEventArgs e) { double w = canvas.Bounds.Width; double v = w > 0 ? Math.Clamp(e.GetPosition(canvas).X / w, 0, 1) : 0; if (pi >= 0) engine.PluginParamSet(track, -1, pi, (float)v); Vis(v); Refresh(); }- canvas.PointerPressed += (_, e) =>- {- if (!e.GetCurrentPoint(canvas).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2 && pi >= 0) { SetP(id, engine.InstrumentParamDefault(track, pi)); Refresh(); e.Handled = true; return; }- drag = true; if (pi >= 0) engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); e.Pointer.Capture(canvas); From(e); e.Handled = true;- };- canvas.PointerMoved += (_, e) => { if (drag) From(e); };- canvas.PointerReleased += (_, e) => { if (drag) { drag = false; if (pi >= 0) engine.EndAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); e.Pointer.Capture(null); } };- canvas.SizeChanged += (_, _) => Vis(G(id));- (into ?? readouts).Add(() => { if (!drag) Vis(G(id)); });- var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center };- grid.Children.Add(canvas); grid.Children.Add(Col(val, 1));- if (pi >= 0) MidiLearn.Bind(grid, MidiTarget.PluginParam(track, -1, pi), id);- return grid;+ var row = DeviceCardKit.SliderRow("", () => G(id), n => { if (pi >= 0) engine.PluginParamSet(track, -1, pi, (float)n); Refresh(); }, () => fmt(G(id)), out var sync,+ begin: () => { if (pi >= 0) engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); },+ end: () => { if (pi >= 0) engine.EndAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); },+ reset: pi >= 0 ? () => { SetP(id, engine.InstrumentParamDefault(track, pi)); Refresh(); } : null,+ dim: dim, valueWidth: valW);+ (into ?? readouts).Add(sync);+ if (pi >= 0) MidiLearn.Bind(row, MidiTarget.PluginParam(track, -1, pi), id);+ return row;}// Label + slider on one grid row.Control SliderRow(string label, string id, Func<double, string> fmt, double labW = 38, double valW = 24, Func<bool>? dim = null, List<Action>? into = null)@@ -235,10 +184,9 @@ internal sealed class PentadInstrumentCard : IInstrumentCardControl VWheel(string id, string name, Func<double, string> fmt, IBrush lit, bool spring){int pi = I(id);- var grad = new LinearGradientBrush { StartPoint = new RelativePoint(0, 0, RelativeUnit.Relative), EndPoint = new RelativePoint(0, 1, RelativeUnit.Relative),- GradientStops = { new GradientStop(NotaPalette.SurfaceRaised.Color, 0), new GradientStop(NotaPalette.BgSunken.Color, 0.5), new GradientStop(NotaPalette.SurfaceRaised.Color, 1) } };- var bar = new Border { Width = 16, Background = grad, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(8), VerticalAlignment = VerticalAlignment.Stretch };- var mark = new Border { Height = 2, Width = 12, Background = lit, CornerRadius = new CornerRadius(1) };+ IBrush grad = NotaPalette.BgSunken;+ var bar = new Border { Width = 16, Background = grad, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Pill, VerticalAlignment = VerticalAlignment.Stretch };+ var mark = new Border { Height = 2, Width = 12, Background = lit, CornerRadius = NotaRadius.Bar };var lay = new Canvas { Width = 16 };lay.Children.Add(mark); Canvas.SetLeft(mark, 2);var host = new Panel { Width = 16, VerticalAlignment = VerticalAlignment.Stretch, Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.SizeNorthSouth), Children = { bar, lay } };@@ -272,17 +220,17 @@ internal sealed class PentadInstrumentCard : IInstrumentCard// ---- formatters -------------------------------------------------------------static double Exp(double lo, double hi, double v) => lo * Math.Pow(hi / lo, Math.Clamp(v, 0, 1));- static string Time(double s) => s >= 1 ? $"{s:0.0} s" : s >= 0.0995 ? $"{s * 1000:0} ms" : $"{s * 1000:0.#} ms";- static string ShortTime(double s) => s >= 1 ? $"{s:0.0}s" : $"{s * 1000:0}ms";+ static string Time(double s) => s >= 1 ? $"{s:0.0}\u2009s" : s >= 0.0995 ? $"{s * 1000:0}\u2009ms" : $"{s * 1000:0.#}\u2009ms";+ static string ShortTime(double s) => s >= 1 ? $"{s:0.0}\u2009s" : $"{s * 1000:0}\u2009ms";string Atk(float v) => ShortTime(Exp(0.0005, 10, v));string Dec(float v) => ShortTime(Exp(0.002, 15, v));string Glide(double v) => v < 0.002 ? "off" : Time(Exp(0.005, 10, v));string HzFmt(double hz) => hz >= 1000 ? $"{hz / 1000:0.00}k" : $"{hz:0}";string Cut(float v) => HzFmt(20 * Math.Pow(1000, v));- static string Pct(double v) => $"{v * 100:0} %";+ static string Pct(double v) => $"{v * 100:0}\u2009%";static string Tenths(double v) => $"{v * 10:0.0}";- string LfoRate(float v) => On("lfosync") ? SyncNames[Math.Clamp((int)Math.Round(v * 13), 0, 13)] : $"{Exp(0.05, 20, v):0.0#} Hz";- string VolDb(float v) { double g = 2 * v * v; return g <= 1e-4 ? "−∞" : $"{20 * Math.Log10(g):0.0} dB"; }+ string LfoRate(float v) => On("lfosync") ? SyncNames[Math.Clamp((int)Math.Round(v * 13), 0, 13)] : $"{Exp(0.05, 20, v):0.0#}\u2009Hz";+ string VolDb(float v) { double g = 2 * v * v; return g <= 1e-4 ? "−∞" : $"{20 * Math.Log10(g):0.0}\u2009dB"; }int BendSt() => 1 + Math.Clamp((int)Math.Round(G("bendrange") * 11), 0, 11);// ======================================================================@@ -290,7 +238,7 @@ internal sealed class PentadInstrumentCard : IInstrumentCard// ======================================================================var bendTxt = MonoText("", 7, AmberLit); var modTxt = MonoText("", 7, MutedC);bendTxt.HorizontalAlignment = HorizontalAlignment.Center; modTxt.HorizontalAlignment = HorizontalAlignment.Center;- readouts.Add(() => { bendTxt.Text = $"±{BendSt()} st"; modTxt.Text = $"{G("modwheel") * 100:0} %"; modTxt.Foreground = G("modwheel") > 0.01f ? AmberLit : MutedC; });+ readouts.Add(() => { bendTxt.Text = $"±{BendSt()}\u2009st"; modTxt.Text = $"{G("modwheel") * 100:0}\u2009%"; modTxt.Foreground = G("modwheel") > 0.01f ? AmberLit : MutedC; });var wheelsBody = new DockPanel { LastChildFill = true };var wTitle = Caps("WHEELS"); wTitle.HorizontalAlignment = HorizontalAlignment.Center; wTitle.Margin = new Thickness(0, 0, 0, 4);wheelsBody.Children.Add(Docked(wTitle, Avalonia.Controls.Dock.Top));@@ -299,7 +247,7 @@ internal sealed class PentadInstrumentCard : IInstrumentCardwheelsBody.Children.Add(new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, HorizontalAlignment = HorizontalAlignment.Center, Margin = new Thickness(0, 0, 0, 3), Children = {VWheel("bend", "PITCH", v => "", Amber, spring: true),VWheel("modwheel", "MOD", v => "", AmberLit, spring: false) } });- var wheels = new Border { Width = 56, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(0, 5), Child = wheelsBody };+ var wheels = new Border { Width = 56, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Padding = new Thickness(0, 5), Child = wheelsBody };DockPanel.SetDock(wheels, Avalonia.Controls.Dock.Left);// ======================================================================@@ -314,8 +262,8 @@ internal sealed class PentadInstrumentCard : IInstrumentCardvar g = new Grid { ColumnDefinitions = new ColumnDefinitions(OscCols) };g.Children.Add(Cell(Lbl(isA ? "A" : "B", 10, TxtC, FontWeight.SemiBold), 0, HorizontalAlignment.Left));g.Children.Add(Cell(K($"{p}oct", "", v => Feet[Math.Clamp((int)Math.Round(v * 3), 0, 3)], false, 26, 40), 1));- g.Children.Add(Cell(K($"{p}semi", "", v => { int s = (int)Math.Round((v - 0.5f) * 24); return s == 0 ? "0 st" : $"{s:+0;-0} st"; }, false, 26, 40), 2));- g.Children.Add(Cell(K($"{p}fine", "", v => { double c = (v - 0.5) * 100; return Math.Abs(c) < 0.5 ? "0 c" : $"{c:+0;-0} c"; }, false, 26, 40), 3));+ g.Children.Add(Cell(K($"{p}semi", "", v => { int s = (int)Math.Round((v - 0.5f) * 24); return s == 0 ? "0\u2009st" : $"{s:+0;−0}\u2009st"; }, false, 26, 40), 2));+ g.Children.Add(Cell(K($"{p}fine", "", v => { double c = (v - 0.5) * 100; return Math.Abs(c) < 0.5 ? "0\u2009c" : $"{c:+0;−0}\u2009c"; }, false, 26, 40), 3));var chips = isA ? Row(3, WaveChip("oasaw", 0), WaveChip("oapulse", 1)) : Row(3, WaveChip("obsaw", 0), WaveChip("obtri", 2), WaveChip("obpulse", 1));var pw = HSlider($"{p}pw", v => Pct(v), 30, () => !On($"{p}pulse"));pw.Width = 110;@@ -364,14 +312,14 @@ internal sealed class PentadInstrumentCard : IInstrumentCard};filtCurve.DragStarted += () => { engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, "cutoff"); engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, "reso"); };filtCurve.DragEnded += () => { engine.EndAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, "cutoff"); engine.EndAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, "reso"); };- var graph = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Margin = new Thickness(0, 3, 0, 3), Child = filtCurve };+ var graph = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Margin = new Thickness(0, 3, 0, 3), Child = filtCurve };var keyPct = MonoText("", 7, Txt2);readouts.Add(() => keyPct.Text = Pct(G("keytrk")));- var key = new StackPanel { Spacing = 3, VerticalAlignment = VerticalAlignment.Center, Children = { Caps("KEY TRK"), Chips("keytrk", new[] { "0", "½", "1" }), keyPct } };+ var key = new StackPanel { Spacing = 3, VerticalAlignment = VerticalAlignment.Center, Children = { Caps("KEYTRACK"), Chips("keytrk", new[] { "0", "½", "1" }), keyPct } };var knobs = new Grid { ColumnDefinitions = new ColumnDefinitions("*,*,*,Auto") };knobs.Children.Add(K("cutoff", "CUTOFF", Cut, false, 32, 44));- knobs.Children.Add(Col(K("reso", "RESON", v => Tenths(v), false, 32, 44), 1));- knobs.Children.Add(Col(K("fenvamt", "ENV AMT", v => Tenths(v), true, 32, 44), 2));+ knobs.Children.Add(Col(K("reso", "RESO", v => Tenths(v), false, 32, 44), 1));+ knobs.Children.Add(Col(K("fenvamt", "ENVELOPE", v => Tenths(v), true, 32, 44), 2));knobs.Children.Add(Col(key, 3));var body = new DockPanel { LastChildFill = true, Children = { Docked(Caps("FILTER"), Avalonia.Controls.Dock.Top), Docked(knobs, Avalonia.Controls.Dock.Bottom), graph } };return new Border { Width = 196, BorderBrush = BorderIn, BorderThickness = new Thickness(0, 0, 1, 0), Padding = new Thickness(7, 4), Child = body };@@ -379,12 +327,12 @@ internal sealed class PentadInstrumentCard : IInstrumentCardControl EnvPanel(string title, string pre, PentadEnvCurve curve, bool amp){var times = MonoText("", 7, Txt2);- readouts.Add(() => times.Text = $"{Atk(G(pre + "attack"))} · {Dec(G(pre + "decay"))} · {G(pre + "sustain") * 100:0}% · {(On("releaseon") ? Dec(G(pre + "release")) : "min")}");+ readouts.Add(() => times.Text = $"{Atk(G(pre + "attack"))} · {Dec(G(pre + "decay"))} · {G(pre + "sustain") * 100:0}\u2009% · {(On("releaseon") ? Dec(G(pre + "release")) : "min")}");var head = new DockPanel { Height = 12, LastChildFill = false, Margin = new Thickness(0, 0, 0, 2) };head.Children.Add(Docked(Caps(title), Avalonia.Controls.Dock.Left));- if (amp) head.Children.Add(Docked(Toggle("releaseon", "Rel"), Avalonia.Controls.Dock.Right));+ if (amp) head.Children.Add(Docked(Toggle("releaseon", "Release"), Avalonia.Controls.Dock.Right));head.Children.Add(Docked(new Border { Margin = new Thickness(6, 0), Child = times }, Avalonia.Controls.Dock.Right));- var graph = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Child = curve };+ var graph = new Border { Background = Inset, BorderBrush = BorderIn, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Child = curve };var knobs = Row(0, K(pre + "attack", "A", Atk, amp, 24, 29), K(pre + "decay", "D", Dec, amp, 24, 29), K(pre + "sustain", "S", v => Pct(v), amp, 24, 29), K(pre + "release", "R", Dec, amp, 24, 29));knobs.Margin = new Thickness(4, 0, 0, 0);return new DockPanel { LastChildFill = true, Children = { Docked(head, Avalonia.Controls.Dock.Top), Docked(knobs, Avalonia.Controls.Dock.Right), graph } };@@ -481,7 +429,7 @@ internal sealed class PentadInstrumentCard : IInstrumentCardbool UniOff() => G("voicemode") < 0.25f && G("unison") < 0.25f;var noiseType = Chips("noisecolor", new[] { "White", "Pink" }); noiseType.Margin = new Thickness(24, 0, 0, 0);var uni = Row(6, new TextBlock { Text = "UNISON", FontSize = 7, FontWeight = FontWeight.Bold, Foreground = MutedC, Width = 38, VerticalAlignment = VerticalAlignment.Center }, Chips("unison", new[] { "Off", "×2", "×5" }));- var det = SliderRow("DETUNE", "unidetune", v => $"{v * 50:0} c", 38, 26, UniOff);+ var det = SliderRow("DETUNE", "unidetune", v => $"{v * 50:0}\u2009c", 38, 26, UniOff);var sum = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 6, Children = { Caps("SUM"), Col(sumBar, 1), Col(sumTxt, 2) } };var g = new Grid { RowDefinitions = new RowDefinitions("*,*,*,*,Auto,*,*,*") };Control[] rows = { MixRow("mixaon", "mixa", "OSC A"), MixRow("mixbon", "mixb", "OSC B"), MixRow("mixnoiseon", "mixnoise", "NOISE"), noiseType,@@ -499,17 +447,9 @@ internal sealed class PentadInstrumentCard : IInstrumentCardvar top = Row(10, K("volume", "VOLUME", VolDb, false, 40, 54), meters);var bend = Row(6, new TextBlock { Text = "BEND", FontSize = 7, FontWeight = FontWeight.Bold, Foreground = MutedC, Width = 38, VerticalAlignment = VerticalAlignment.Center },Chips("bendrange", new[] { "2", "5", "7", "12" }, new[] { 1 / 11f, 4 / 11f, 6 / 11f, 1f }), Lbl("st", 7, MutedC, FontWeight.Normal));- var velF = new Border { Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand) };- { // Velocity → filter: a quick switch over the Velocity Filter amount (0 ↔ 50 %).- var pill = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5) };- var dot = new Border { Width = 7, Height = 7, CornerRadius = new CornerRadius(4) };- var host = new Canvas { Width = 18, Height = 10 }; Canvas.SetTop(dot, 1.5); host.Children.Add(dot); pill.Child = host;- var tx = new TextBlock { Text = "Velocity → filter", FontSize = 8, VerticalAlignment = VerticalAlignment.Center };- velF.Child = Row(5, pill, tx);- void Hi() { bool on = G("velfilt") > 0.001f; pill.Background = on ? Amber : OffPill; dot.Background = on ? Panel : MutedC; Canvas.SetLeft(dot, on ? 9.5 : 1.5); tx.Foreground = on ? TxtC : Txt2; }- velF.PointerPressed += (_, e) => { SetP("velfilt", G("velfilt") > 0.001f ? 0f : 0.5f); Refresh(); e.Handled = true; };- readouts.Add(Hi); Hi();- }+ // Velocity → filter: a quick switch over the Velocity Filter amount (0 ↔ 50 %).+ var velF = Switch("Vel → filter", () => G("velfilt") > 0.001f, () => { SetP("velfilt", G("velfilt") > 0.001f ? 0f : 0.5f); Refresh(); }, out var velSync);+ readouts.Add(velSync);var strip = new PentadVoiceStrip { Width = 90, Height = 14 }; voiceStrips.Add(strip);var voices = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,*"), ColumnSpacing = 6, Children = { Caps("VOICES"), Col(strip, 1), Col(Right(voiceCountTxt), 2) } };var body = new DockPanel { LastChildFill = false, Children = {@@ -533,14 +473,14 @@ internal sealed class PentadInstrumentCard : IInstrumentCardint centreTab = 0;// Drift slider + seed re-roll (Oscillators tab bar)- var reroll = new Border { Padding = new Thickness(3, 0), CornerRadius = new CornerRadius(3), Background = OffPill, Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,- Child = new TextBlock { Text = "⟳", FontSize = 9, Foreground = Txt2 } };+ var reroll = new Border { Padding = new Thickness(3, 0), CornerRadius = NotaRadius.Badge, Background = OffPill, Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,+ Child = new Glyph(GlyphKind.Cycle, 9) { Foreground = Txt2 } };ToolTip.SetTip(reroll, "Re-roll the vintage seed (new per-voice spread)");reroll.PointerPressed += (_, e) => { SetP("seed", (float)Random.Shared.NextDouble()); Refresh(); e.Handled = true; };- var driftSl = HSlider("drift", v => $"{v * 100:0}%", 22); driftSl.Width = 76;+ var driftSl = HSlider("drift", v => $"{v * 100:0}\u2009%", 22); driftSl.Width = 76;Control[] extras = {Row(5, Caps("DRIFT"), driftSl, reroll),- MonoText("4-pole LP · 24 dB/oct", 7, MutedC),+ MonoText("4-pole LP · 24\u2009dB/oct", 7, MutedC),MonoText("", 7, MutedC) };readouts.Add(() => { if (extras[2] is TextBlock t) { int n = ActiveRoutes(); t.Text = $"per voice · {n} active route{(n == 1 ? "" : "s")}"; } });@@ -550,9 +490,9 @@ internal sealed class PentadInstrumentCard : IInstrumentCardvar statusLeft = new TextBlock { FontSize = 8, Foreground = Txt2, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis };var centre = TabFrame(new[] { "Oscillators", "Filter · Amp", "Poly Mod" }, centreHost, CentreBody, false, t => { centreTab = t; extrasHost.Content = extras[t]; Refresh(); }, extrasHost);var rightFrame = TabFrame(new[] { "Mixer", "Output" }, rightHost, RightBody, true, null, null);- var right = new Border { Width = 186, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Child = rightFrame };+ var right = new Border { Width = 186, Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Child = rightFrame };DockPanel.SetDock(right, Avalonia.Controls.Dock.Right);- var centreBox = new Border { Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Margin = new Thickness(5, 0), Child = centre };+ var centreBox = new Border { Background = Panel, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Margin = new Thickness(5, 0), Child = centre };// ======================================================================// Status strip + Voice setup flyout@@ -565,11 +505,11 @@ internal sealed class PentadInstrumentCard : IInstrumentCardreturn centreTab switch{1 => $"Filter env → cutoff {G("fenvamt") * 10:0.0} · key tracking {KeyName(G("keytrk"))}{(G("velfilt") > 0.001f ? " · velocity → filter" : "")}{(On("lowcomp") ? " · bass comp" : "")}",- 2 => $"Poly Mod: {ActiveRoutes()} route{(ActiveRoutes() == 1 ? "" : "s")} · LFO {LfoRate(G("lforate"))} {LfoShape()} · unison {(G("unison") < 0.25f ? "off" : G("unison") < 0.75f ? "×2" : "×5")}, detune {G("unidetune") * 50:0} c",- _ => $"{modeS} · {busy} voice{(busy == 1 ? "" : "s")} busy · glide {Glide(G("glide"))} · drift {G("drift") * 100:0} %",+ 2 => $"Poly Mod: {ActiveRoutes()} route{(ActiveRoutes() == 1 ? "" : "s")} · LFO {LfoRate(G("lforate"))} {LfoShape()} · unison {(G("unison") < 0.25f ? "off" : G("unison") < 0.75f ? "×2" : "×5")}, detune {G("unidetune") * 50:0}\u2009c",+ _ => $"{modeS} · {busy} voice{(busy == 1 ? "" : "s")} busy · glide {Glide(G("glide"))} · drift {G("drift") * 100:0}\u2009%",};}- static string KeyName(float v) => Math.Abs(v - 0.5f) < 0.02f ? "½" : Math.Abs(v - 1f) < 0.02f ? "full" : v < 0.02f ? "off" : $"{v * 100:0} %";+ static string KeyName(float v) => Math.Abs(v - 0.5f) < 0.02f ? "½" : Math.Abs(v - 1f) < 0.02f ? "full" : v < 0.02f ? "off" : $"{v * 100:0}\u2009%";string LfoShape(){var s = new List<string>();@@ -580,7 +520,7 @@ internal sealed class PentadInstrumentCard : IInstrumentCardreadouts.Add(() =>{statusLeft.Text = StatusText();- if (scN >= 8) statusRight.Text = $"{scope[7] / 1000:0.#} kHz · ×{(int)scope[6]} OS · CPU {scope[5] * 100:0.0} %";+ if (scN >= 8) statusRight.Text = $"{scope[7] / 1000:0.#}\u2009kHz · ×{(int)scope[6]} OS · CPU {scope[5] * 100:0}\u2009%";});var flyReadouts = new List<Action>();@@ -589,10 +529,10 @@ internal sealed class PentadInstrumentCard : IInstrumentCard{var seedTxt = MonoText("", 8, TxtC);flyReadouts.Add(() => seedTxt.Text = $"#{(int)Math.Round(G("seed") * 16777215):X6}");- var rr = new Border { Padding = new Thickness(6, 1), CornerRadius = new CornerRadius(3), Background = OffPill, Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = "Re-roll", FontSize = 8, Foreground = TxtC } };+ var rr = new Border { Padding = new Thickness(6, 1), CornerRadius = NotaRadius.Badge, Background = OffPill, Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = "Re-roll", FontSize = 8, Foreground = TxtC } };rr.PointerPressed += (_, e) => { SetP("seed", (float)Random.Shared.NextDouble()); Refresh(); foreach (var a in flyReadouts) a(); e.Handled = true; };Control R(string label, Control c) { var g = new Grid { ColumnDefinitions = new ColumnDefinitions("92,*"), Height = 20 }; g.Children.Add(Caps(label)); c.HorizontalAlignment = HorizontalAlignment.Left; g.Children.Add(Col(c, 1)); return g; }- var tune = HSlider("tune", v => { double c = (v - 0.5) * 200; return Math.Abs(c) < 0.5 ? "0 c" : $"{c:+0;-0} c"; }, 30, null, flyReadouts); tune.Width = 130;+ var tune = HSlider("tune", v => { double c = (v - 0.5) * 200; return Math.Abs(c) < 0.5 ? "0\u2009c" : $"{c:+0;−0}\u2009c"; }, 30, null, flyReadouts); tune.Width = 130;var at = HSlider("aftertouch", v => Pct(v), 30, null, flyReadouts); at.Width = 130;var p = new StackPanel { Spacing = 2, Width = 250, Children = {Lbl("VOICE SETUP", 9, TxtC),@@ -603,14 +543,14 @@ internal sealed class PentadInstrumentCard : IInstrumentCardR("RELEASE", Toggle("releaseon", "Release switch", flyReadouts)),R("OVERSAMPLING", Chips("oversample", new[] { "×2", "×4" }, null, flyReadouts, 8)),R("BASS COMP", Toggle("lowcomp", "Restore lows at high Q", flyReadouts)),- R("NOISE FLOOR", Toggle("noisefloor", "−100 dBFS hiss", flyReadouts)),+ R("NOISE FLOOR", Toggle("noisefloor", "−100\u2009dBFS hiss", flyReadouts)),R("VINTAGE SEED", Row(8, seedTxt, rr)),R("MASTER TUNE", tune),R("AFTERTOUCH", at) } };return new Border { Padding = new Thickness(4, 2), Child = p };}- var voiceBtn = new Border { Height = 14, Padding = new Thickness(6, 0), CornerRadius = new CornerRadius(3), Background = OffPill, Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,- Child = new TextBlock { Text = "Voice ▾", FontSize = 8, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center } };+ var voiceBtn = new Border { Height = 14, Padding = new Thickness(6, 0), CornerRadius = NotaRadius.Badge, Background = OffPill, Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,+ Child = Glyph.WithChevron(new TextBlock { Text = "Voice", FontSize = 8, Foreground = TxtC, VerticalAlignment = VerticalAlignment.Center }, 7) };ToolTip.SetTip(voiceBtn, "Voice setup: polyphony, allocation, glide mode, oversampling, vintage seed");voiceBtn.PointerPressed += (_, e) =>{diff --git a/src/managed/Nota.App/DeviceCards/Instruments/PhysicalInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/PhysicalInstrumentCard.csindex 79b7d079..f104b8c3 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/PhysicalInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/PhysicalInstrumentCard.cs@@ -64,24 +64,24 @@ internal sealed class PhysicalInstrumentCard : IInstrumentCard}return col;}- Control Arrow() => new TextBlock { Text = "▸", FontSize = 12, Foreground = NotaPalette.BorderStrong, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(1, 0) };+ Control Arrow() => new Glyph(GlyphKind.ChevronRight, 9) { Foreground = NotaPalette.BorderStrong, Margin = new Thickness(1, 0) };Control Cap(string t, IBrush? c = null) => new TextBlock { Text = t, FontSize = 9, Foreground = c ?? TextTertiary, VerticalAlignment = VerticalAlignment.Center };Control Head(string title, params Control[] extras){var sp = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center };- sp.Children.Add(new TextBlock { Text = title, FontSize = 10, FontWeight = FontWeight.Bold, Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center });+ sp.Children.Add(new TextBlock { Text = title, FontSize = 9, FontWeight = FontWeight.Bold, Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center });foreach (var e in extras) sp.Children.Add(e);return sp;}Border Panel(double width, Control header, Control body)- => new Border { Width = width, Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(7), Padding = new Thickness(9, 8),+ => new Border { Width = width, Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(9, 8),Child = new StackPanel { Spacing = 8, VerticalAlignment = VerticalAlignment.Center, Children = { header, body } } };// A panel whose body fills the remaining height (for graphs / viz).Border GraphPanel(double width, Control header, Control body){DockPanel.SetDock(header, Dock.Top);header.Margin = new Thickness(0, 0, 0, 8);- return new Border { Width = width, Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(7), Padding = new Thickness(9, 8),+ return new Border { Width = width, Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(9, 8),Child = new DockPanel { LastChildFill = true, Children = { header, body } } };}@@ -89,16 +89,16 @@ internal sealed class PhysicalInstrumentCard : IInstrumentCardControl TextChips(string id, string[] names){int n = names.Length; var arr = new Border[n];- void Hi() { int cur = Math.Clamp((int)Math.Round(G(id) * (n - 1)), 0, n - 1); for (int i = 0; i < n; i++) { bool on = i == cur; arr[i].Background = on ? AccentSubtleB : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AccentBright : TextSecondary; } }+ void Hi() { int cur = Math.Clamp((int)Math.Round(G(id) * (n - 1)), 0, n - 1); for (int i = 0; i < n; i++) { bool on = i == cur; arr[i].Background = on ? NotaPalette.Accent : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? NotaPalette.TextOnAccent : TextSecondary; } }var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2 };for (int i = 0; i < n; i++){int iv = i;- var chip = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 9, Foreground = TextSecondary } };+ var chip = new Border { CornerRadius = NotaRadius.Badge, Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 9, Foreground = TextSecondary } };chip.PointerPressed += (_, _) => { if (I(id) is var ci and >= 0 && n > 1) { engine.PluginParamSet(track, -1, ci, iv / (float)(n - 1)); Hi(); Refresh(); } };arr[i] = chip; row.Children.Add(chip);}- var container = new Border { Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(2), Child = row };+ var container = new Border { Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Padding = new Thickness(2), Child = row };Hi(); readouts.Add(Hi);if (I(id) is var pi and >= 0) MidiLearn.Bind(container, MidiTarget.PluginParam(track, -1, pi), id);return container;@@ -107,34 +107,24 @@ internal sealed class PhysicalInstrumentCard : IInstrumentCard// Local (non-param) segmented toggle.Control Seg(string[] names, int initial, Action<int> onPick, double fs = 10){- var arr = new Border[names.Length]; int cur = initial;- void Hi() { for (int i = 0; i < arr.Length; i++) { bool on = i == cur; arr[i].Background = on ? AccentSubtleB : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AccentBright : TextTertiary; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2 };- for (int i = 0; i < names.Length; i++)- {- int iv = i;- var chip = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(9, 2), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, Foreground = TextTertiary } };- chip.PointerPressed += (_, _) => { cur = iv; Hi(); onPick(iv); };- arr[i] = chip; row.Children.Add(chip);- }- var container = new Border { Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(2), Child = row };- Hi(); return container;+ int cur = initial;+ return DeviceCardKit.Segments(names, () => cur, iv => { cur = iv; onPick(iv); }, out _);}// ===== EXCITER tab: Mallet → Noise ==================================var malletBox = Panel(132, Head("MALLET"),- KnobGrid(2, K("malletvol", "VOL"), K("malletstiff", "STIFF"), K("malletnoise", "NOISE"), K("malletcolor", "COLOR")));+ KnobGrid(2, K("malletvol", "VOLUME"), K("malletstiff", "STIFF"), K("malletnoise", "NOISE"), K("malletcolor", "COLOR")));noiseEnv.VerticalAlignment = VerticalAlignment.Stretch; noiseEnv.MinHeight = 96;var noiseCap = new TextBlock { FontSize = 9, Foreground = Teal, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Right };noiseCap.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- readouts.Add(() => { int en = (int)Math.Round((G("noiseenv") - 0.5) * 200); noiseCap.Text = "env " + en.ToString("+0;-0;0"); });+ readouts.Add(() => { int en = (int)Math.Round((G("noiseenv") - 0.5) * 200); noiseCap.Text = "env " + en.ToString("+0;−0;0"); });var noiseHeadLeft = Head("NOISE", TextChips("noisetype", new[] { "LP", "BP", "HP" }));DockPanel.SetDock(noiseCap, Dock.Right);var noiseHeader = new DockPanel { Children = { noiseCap, noiseHeadLeft } };var noiseBody = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), ColumnSpacing = 8, VerticalAlignment = VerticalAlignment.Stretch };noiseBody.Children.Add(noiseEnv);- var noiseKnobs = KnobGrid(2, K("noisevol", "VOL"), K("noiseenv", "ENV", true), K("noisefreq", "FREQ"), K("noisereso", "RESO"));+ var noiseKnobs = KnobGrid(2, K("noisevol", "VOLUME"), K("noiseenv", "ENV", true), K("noisefreq", "FREQ"), K("noisereso", "RESO"));Grid.SetColumn(noiseKnobs, 1); noiseBody.Children.Add(noiseKnobs);var noiseBox = GraphPanel(356, noiseHeader, noiseBody);@@ -167,7 +157,7 @@ internal sealed class PhysicalInstrumentCard : IInstrumentCardvar onChips = TextChips("r2on", new[] { "Off", "On" });var resHeadLeft = Head("RESONATOR", Seg(new[] { "1", "2" }, 0, i => { rsel = i; ApplyResSel(); }), onChips);- var structChips = TextChips("structure", new[] { "1▸2", "1+2" });+ var structChips = TextChips("structure", new[] { "1→2", "1+2" });var structWrap = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Right,Children = { Cap("STRUCTURE"), structChips } };DockPanel.SetDock(structWrap, Dock.Right);diff --git a/src/managed/Nota.App/DeviceCards/Instruments/RhythmInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/RhythmInstrumentCard.csindex c29440c9..96354ace 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/RhythmInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/RhythmInstrumentCard.cs@@ -49,12 +49,12 @@ internal sealed class RhythmInstrumentCard : IInstrumentCardprivate static readonly IBrush SeqBg = NotaPalette.SurfaceDeep;private static readonly IBrush Border2 = NotaPalette.BorderDefault;private static readonly IBrush StepOff = NotaPalette.BgSunken;- private static readonly IBrush StepOn = NotaPalette.VGradient((NotaPalette.Accent, 0), (NotaPalette.AccentDeep, 1));- private static readonly IBrush StepAcc = NotaPalette.VGradient((NotaPalette.AccentGlow, 0), (NotaPalette.Accent, 1));+ private static readonly IBrush StepOn = NotaPalette.Accent;+ private static readonly IBrush StepAcc = NotaPalette.AccentBright; // accented step: the hotter brass, still flatprivate static readonly IBrush TealB = NotaPalette.Teal;private static readonly IBrush TealBright = NotaPalette.TealBright;private static readonly IBrush Muted = NotaPalette.TextTertiary;- private static readonly IBrush VelFill = NotaPalette.VGradient((NotaPalette.Ink("#A7B58A"), 0), (NotaPalette.Ink("#7E8A6A"), 1));+ private static readonly IBrush VelFill = NotaPalette.Ink("#A7B58A");public Control Build(DeviceCardContext ctx){@@ -89,19 +89,19 @@ internal sealed class RhythmInstrumentCard : IInstrumentCardbool isSmp = engine.RhythmVoiceSource(track, v) == 1;var dot = new Ellipse { Width = 7, Height = 7, Fill = NotaPalette.Ink(Dots[v]), VerticalAlignment = VerticalAlignment.Center };kitDots[v] = dot;- var nm = new TextBlock { Text = Names[v], FontSize = 10, Foreground = selRow ? NotaPalette.AccentBright : NotaPalette.TextStrong, VerticalAlignment = VerticalAlignment.Center };+ var nm = new TextBlock { Text = Names[v], FontSize = 9, Foreground = selRow ? NotaPalette.AccentBright : NotaPalette.TextStrong, VerticalAlignment = VerticalAlignment.Center };var tag = new TextBlock { Text = isSmp ? "SMP" : "SYN", FontSize = 7, FontWeight = FontWeight.Bold, Foreground = isSmp ? TealB : selRow ? Brass : Muted, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Right };var row = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), Height = 15, Margin = new Thickness(6, 0) };Grid.SetColumn(dot, 0); Grid.SetColumn(nm, 1); Grid.SetColumn(tag, 2);nm.Margin = new Thickness(6, 0, 0, 0);- var rowBox = new Border { CornerRadius = new CornerRadius(4), Cursor = new Cursor(StandardCursorType.Hand), Child = row, Background = selRow ? NotaPalette.Wash(NotaPalette.Accent, 0x24) : Brushes.Transparent, BorderBrush = selRow ? NotaPalette.AccentTint : Brushes.Transparent, BorderThickness = new Thickness(1) };+ var rowBox = new Border { CornerRadius = NotaRadius.Control, Cursor = new Cursor(StandardCursorType.Hand), Child = row, Background = selRow ? NotaPalette.Wash(NotaPalette.Accent, 0x24) : Brushes.Transparent, BorderBrush = selRow ? NotaPalette.BorderBrass : Brushes.Transparent, BorderThickness = new Thickness(1) };row.Children.Add(dot); row.Children.Add(nm); row.Children.Add(tag);rowBox.PointerPressed += (_, _) => { Act(A_SelectVoice, vv); ctx.RequestRebuild(); };// Drop an audio file (browser or Finder) onto a voice → load it as that voice's sample.ToolTip.SetTip(rowBox, "Drop a sample to load it into this voice");DragDrop.SetAllowDrop(rowBox, true);DragDrop.AddDragOverHandler(rowBox, (_, e) => { if (BrowserView.IsAcceptableDrag(e)) { e.DragEffects = DragDropEffects.Copy; rowBox.BorderBrush = TealB; ctx.HideDropGlow(); } });- DragDrop.AddDragLeaveHandler(rowBox, (_, _) => rowBox.BorderBrush = selRow ? NotaPalette.AccentTint : Brushes.Transparent);+ DragDrop.AddDragLeaveHandler(rowBox, (_, _) => rowBox.BorderBrush = selRow ? NotaPalette.BorderBrass : Brushes.Transparent);DragDrop.AddDropHandler(rowBox, (_, e) =>{foreach (var it in BrowserView.DroppedItems(e))@@ -132,10 +132,10 @@ internal sealed class RhythmInstrumentCard : IInstrumentCardint voiceSrc = engine.RhythmVoiceSource(track, sel);long voiceSid = engine.TryGetRhythmVoiceInfo(track, sel, out var vinfo) ? vinfo.SampleId : 0;bool sampleMode = voiceSrc == 1 && voiceSid != 0;- var srcSeg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(1), HorizontalAlignment = HorizontalAlignment.Right };+ var srcSeg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Padding = new Thickness(1), HorizontalAlignment = HorizontalAlignment.Right };Border SrcChip(string text, bool on, IBrush onBg)- => new() { Background = on ? onBg : Brushes.Transparent, CornerRadius = new CornerRadius(4), Padding = new Thickness(9, 2), Cursor = new Cursor(StandardCursorType.Hand),- Child = new TextBlock { Text = text, FontSize = 9, FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal, Foreground = on ? NotaPalette.BgApp : Muted } };+ => new() { Background = on ? onBg : Brushes.Transparent, CornerRadius = NotaRadius.Control, Padding = new Thickness(9, 2), Cursor = new Cursor(StandardCursorType.Hand),+ Child = new TextBlock { Text = text, FontSize = 9, FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal, Foreground = on ? NotaPalette.TextOnAccent : Muted } };var synthChip = SrcChip("Synth", !sampleMode, Brass);var sampleChip = SrcChip("Sample", sampleMode, TealB);synthChip.PointerPressed += (_, _) => { Act(A_SetSource, sel, 0f); ctx.RequestRebuild(); };@@ -153,7 +153,7 @@ internal sealed class RhythmInstrumentCard : IInstrumentCardsampleChip.PointerPressed += (_, _) => { if (voiceSid != 0) { Act(A_SetSource, sel, 1f); ctx.RequestRebuild(); } else LoadSampleDialog(sampleChip); };ToolTip.SetTip(sampleChip, "Load a one-shot sample for this voice (or drop a file on the voice)");srcSeg.Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1, Children = { synthChip, sampleChip } };- var engBox = new Border { Height = 17, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(6, 0), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = sampleMode ? "Sample" : Engines[sel], FontSize = 9, Foreground = NotaPalette.TextStrong, VerticalAlignment = VerticalAlignment.Center } };+ var engBox = new Border { Height = 17, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(6, 0), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = sampleMode ? "Sample" : Engines[sel], FontSize = 9, Foreground = NotaPalette.TextStrong, VerticalAlignment = VerticalAlignment.Center } };var voiceHeadRow = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto,Auto"), ColumnSpacing = 8 };Grid.SetColumn(voiceHead, 0); Grid.SetColumn(srcSeg, 1); Grid.SetColumn(engBox, 2);voiceHeadRow.Children.Add(voiceHead); voiceHeadRow.Children.Add(srcSeg); voiceHeadRow.Children.Add(engBox);@@ -176,7 +176,7 @@ internal sealed class RhythmInstrumentCard : IInstrumentCardvar hitDock = new DockPanel { LastChildFill = true };DockPanel.SetDock(hitHead, Dock.Top); hitDock.Children.Add(hitHead);hitDock.Children.Add(new Border { Margin = new Thickness(0, 2, 0, 0), Child = hitInner });- var hitBox = new Border { Width = 148, Background = Inset, BorderBrush = NotaPalette.GraphBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(5, 4), Child = hitDock };+ var hitBox = new Border { Width = 148, Background = Inset, BorderBrush = NotaPalette.GraphBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(5, 4), Child = hitDock };if (sampleMode) { hitBox.Cursor = new Cursor(StandardCursorType.Hand); hitBox.PointerPressed += (_, _) => LoadSampleDialog(hitBox); }// engine knobs of the selected voice.@@ -240,7 +240,7 @@ internal sealed class RhythmInstrumentCard : IInstrumentCard{int s = grp * 4 + k;var beat = new TextBlock { Text = (s % 4 == 0) ? (s + 1).ToString() : "", FontSize = 7, Foreground = Muted, Margin = new Thickness(4, 3, 0, 0), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top, IsHitTestVisible = false };- var btn = new Border { Height = 24, CornerRadius = new CornerRadius(5), Child = beat, Cursor = new Cursor(StandardCursorType.Hand) };+ var btn = new Border { Height = 24, CornerRadius = NotaRadius.Tile, Child = beat, Cursor = new Cursor(StandardCursorType.Hand) };stepBtns[s] = btn; StyleStep(s);int ss = s;btn.PointerPressed += (_, e) =>@@ -252,9 +252,9 @@ internal sealed class RhythmInstrumentCard : IInstrumentCard};Grid.SetColumn(btn, k); gG.Children.Add(btn);- var fill = new Border { VerticalAlignment = VerticalAlignment.Bottom, Background = VelFill, CornerRadius = new CornerRadius(2) };+ var fill = new Border { VerticalAlignment = VerticalAlignment.Bottom, Background = VelFill, CornerRadius = NotaRadius.Clip };velFills[s] = fill; SyncVel(s);- var vb = new Border { Background = NotaPalette.SurfaceAbyss, CornerRadius = new CornerRadius(2), Child = fill, Cursor = new Cursor(StandardCursorType.SizeNorthSouth), ClipToBounds = true };+ var vb = new Border { Background = NotaPalette.SurfaceAbyss, CornerRadius = NotaRadius.Clip, Child = fill, Cursor = new Cursor(StandardCursorType.SizeNorthSouth), ClipToBounds = true };void SetVelFromY(PointerEventArgs pe){double h = Math.Max(1, vb.Bounds.Height);@@ -281,12 +281,12 @@ internal sealed class RhythmInstrumentCard : IInstrumentCardfor (int b = 0; b < 4; b++){int bb = b; bool cur = b == bank;- var chip = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(6, 1), Cursor = new Cursor(StandardCursorType.Hand), Background = cur ? TealB : Brushes.Transparent, Child = new TextBlock { Text = ((char)('A' + b)).ToString(), FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = cur ? NotaPalette.BgApp : Muted } };+ var chip = new Border { CornerRadius = NotaRadius.Badge, Padding = new Thickness(6, 1), Cursor = new Cursor(StandardCursorType.Hand), Background = cur ? TealB : Brushes.Transparent, Child = new TextBlock { Text = ((char)('A' + b)).ToString(), FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = cur ? NotaPalette.TextOnAccent : Muted } };chip.PointerPressed += (_, _) => { Act(A_SelectBank, bb); ctx.RequestRebuild(); };banks.Children.Add(chip);}stepHead.Children.Add(banks);- var playText = Mono("▶ –", TealB, 8); playText.HorizontalAlignment = HorizontalAlignment.Right;+ var playText = Mono("step –", TealB, 8); playText.HorizontalAlignment = HorizontalAlignment.Right;var stepHeadRow = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*") };stepHeadRow.Children.Add(stepHead); Grid.SetColumn(playText, 1); stepHeadRow.Children.Add(playText);@@ -312,14 +312,16 @@ internal sealed class RhythmInstrumentCard : IInstrumentCardif (head != lastHead){if (lastHead >= 0 && lastHead < Steps) StyleStep(lastHead);- if (head >= 0 && head < Steps) { stepBtns[head].BorderBrush = TealBright; stepBtns[head].BorderThickness = new Thickness(2); }+ if (head >= 0 && head < Steps) { stepBtns[head].BorderBrush = TealBright; } // colour only: a state never thickens a borderlastHead = head;- playText.Text = head >= 0 ? $"▶ step {head + 1} / 16" : "▶ –";+ playText.Text = head >= 0 ? $"step {head + 1} / 16" : "step –";}float flash = (n > 1 + sel) ? scope[1 + sel] : 0f;if (!sampleMode) hit.Set(G(P("decay")), G(P("tune")), G(P("punch")), flash);// kit dot flashes- for (int v = 0; v < Voices && 1 + v < n; v++) kitDots[v].Opacity = 0.55 + 0.45 * Math.Clamp(scope[1 + v], 0f, 1f);+ // A voice that just fired lights its dot at full hue; otherwise the dot rests one step+ // down. Discrete, not an opacity ramp (almanac: no opacity for state, no meter easing).+ for (int v = 0; v < Voices && 1 + v < n; v++) kitDots[v].Fill = scope[1 + v] > 0.1f ? NotaPalette.Ink(Dots[v]) : NotaPalette.Wash(NotaPalette.Ink(Dots[v]), 0x8C);}ctx.SetInstLiveViz(Refresh);DoRefresh();diff --git a/src/managed/Nota.App/DeviceCards/Instruments/SamplerInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/SamplerInstrumentCard.csindex c909436c..9f6e13ea 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/SamplerInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/SamplerInstrumentCard.cs@@ -39,7 +39,7 @@ internal sealed class SamplerInstrumentCard : IInstrumentCardprivate static readonly IBrush TxtC = NotaPalette.TextPrimary;private static readonly IBrush MutedC = NotaPalette.TextTertiary;private static readonly IBrush GreenC = NotaPalette.Success;- private static readonly IBrush RedC = NotaPalette.Danger;+ private static readonly IBrush RedC = NotaPalette.TextSecondary; // a state, not an alert: red is kept for recording and overloadprivate static readonly IBrush AmberSubtle = NotaPalette.Wash(NotaPalette.Accent, 0x28);private static readonly IBrush RowLit = NotaPalette.SurfaceRaised;private static readonly IBrush TealSubtle = NotaPalette.Wash(NotaPalette.Teal, 0x24);@@ -68,10 +68,9 @@ internal sealed class SamplerInstrumentCard : IInstrumentCardbool hasSample = acc.Info(out long sampleId, out int root) && sampleId != 0;if (!hasSample){- var prompt = new StackPanel { Spacing = 4, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Children = {- new TextBlock { Text = "↓", FontSize = 22, Foreground = MutedC, HorizontalAlignment = HorizontalAlignment.Center },- new TextBlock { Text = "Drop a sample here", FontSize = 11, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center },- new TextBlock { Text = "drag from the Files tab or the browser", FontSize = 9, Foreground = MutedC, HorizontalAlignment = HorizontalAlignment.Center } } };+ // Empty state: one line in Ink 5, centred, no illustration (almanac § States).+ var prompt = new TextBlock { Text = "Drop a sample here", FontSize = 9, Foreground = NotaPalette.TextTertiary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };+ ToolTip.SetTip(prompt, "Drag from the Files tab or the browser");return new Border { Background = NotaPalette.BgApp, Child = prompt };}@@ -115,12 +114,10 @@ internal sealed class SamplerInstrumentCard : IInstrumentCardControl Seg(string id, string[] names, double fs = 9, double padX = 6){- int n = names.Length; var arr = new Border[n];- void Hi() { int cur = GI(id, n); for (int i = 0; i < n; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Brushes.Transparent; arr[i].BorderBrush = on ? Amber : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : MutedC; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(padX, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, Foreground = MutedC } }; c.PointerPressed += (_, _) => { SetId(id, n > 1 ? iv / (double)(n - 1) : 0); RefreshAll(); }; arr[i] = c; row.Children.Add(c); }- readouts.Add(Hi);- return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ int n = names.Length;+ var seg = DeviceCardKit.Segments(names, () => GI(id, n), iv => { SetId(id, n > 1 ? iv / (double)(n - 1) : 0); RefreshAll(); }, out var sync);+ readouts.Add(sync);+ return seg;}// Loop segmented (Off/Fwd/Ping/Rev) — maps to loopmode + reverse (append-safe).@@ -129,16 +126,16 @@ internal sealed class SamplerInstrumentCard : IInstrumentCardvar names = new[] { "Off", "Fwd", "Ping", "Rev" }; var arr = new Border[4];int Cur() { int lm = (int)Math.Round(G("loopmode") * 2); bool rev = G("reverse") > 0.5f; return lm == 2 ? 2 : lm == 1 ? (rev ? 3 : 1) : 0; }void Set(int i) { SetId("loopmode", i == 2 ? 1.0 : i == 0 ? 0.0 : 0.5); SetId("reverse", i == 3 ? 1 : 0); }- void Hi() { int cur = Cur(); for (int i = 0; i < 4; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Brushes.Transparent; arr[i].BorderBrush = on ? Amber : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : MutedC; } }+ void Hi() { int cur = Cur(); for (int i = 0; i < 4; i++) { bool on = i == cur; arr[i].Background = on ? NotaPalette.Accent : Brushes.Transparent; arr[i].BorderBrush = on ? NotaPalette.Accent : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? NotaPalette.TextOnAccent : MutedC; } }var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < 4; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 9, Foreground = MutedC } }; c.PointerPressed += (_, _) => { Set(iv); SyncWave(); RefreshAll(); }; arr[i] = c; row.Children.Add(c); }+ for (int i = 0; i < 4; i++) { int iv = i; var c = new Border { CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 9, Foreground = MutedC } }; c.PointerPressed += (_, _) => { Set(iv); SyncWave(); RefreshAll(); }; arr[i] = c; row.Children.Add(c); }readouts.Add(Hi);- return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };}Control OutToggle(string id, string label, bool teal = false){- var b = new Border { CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), Padding = new Thickness(7, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold } };+ var b = new Border { CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Padding = new Thickness(7, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold } };void Hi() { bool on = G(id) > 0.5f; b.Background = on ? (teal ? TealSubtle : AmberSubtle) : Brushes.Transparent; b.BorderBrush = on ? (teal ? TealC : Amber) : Border2; ((TextBlock)b.Child!).Foreground = on ? (teal ? TealC : AmberLit) : MutedC; }b.PointerPressed += (_, _) => { SetId(id, G(id) > 0.5f ? 0 : 1); RefreshAll(); };readouts.Add(Hi);@@ -147,7 +144,7 @@ internal sealed class SamplerInstrumentCard : IInstrumentCardControl ActionBtn(string label, Action click){- var b = new Border { CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), BorderBrush = NotaPalette.BorderStrong, Background = RowLit, Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 9, Foreground = NotaPalette.TextSecondary } };+ var b = new Border { CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), BorderBrush = NotaPalette.BorderStrong, Background = RowLit, Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 9, Foreground = NotaPalette.TextSecondary } };b.PointerPressed += (_, _) => click();return b;}@@ -167,42 +164,30 @@ internal sealed class SamplerInstrumentCard : IInstrumentCardControl HSlider(string id, string label, Func<double, string> fmt, bool bipolar = false, double lw = 44, double vw = 52){if (!idx.TryGetValue(id, out var pi)) return new Panel();- var fill = new Border { Height = 3, Background = Amber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var track2 = new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center };- var center = bipolar ? new Border { Width = 1, Background = NotaPalette.BorderStrong, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Stretch, Margin = new Thickness(0, 1) } : null;- var handle = new Border { Width = 8, Height = 10, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Height = 11, MinWidth = 46 }; slot.Children.Add(track2); if (center != null) slot.Children.Add(center); slot.Children.Add(fill); slot.Children.Add(handle);- var val = MonoTx(fmt(G(id)), TxtC, 9); val.Width = vw; val.TextAlignment = TextAlignment.Right;- bool drag = false;- void Upd() { double v = G(id); double W = slot.Bounds.Width; double hx = v * W; handle.Margin = new Thickness(Math.Clamp(hx - 4, 0, Math.Max(0, W - 8)), 0, 0, 0); if (bipolar) { double c = W * 0.5; double a = Math.Min(c, hx), b = Math.Max(c, hx); fill.Margin = new Thickness(a, 0, 0, 0); fill.Width = Math.Max(0, b - a); } else { fill.Margin = new Thickness(0); fill.Width = hx; } val.Text = fmt(v); }- void SetFromX(double x) { double v = Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1); acc.ParamSet(pi, (float)v); Upd(); }- slot.PointerPressed += (_, e) => { drag = true; e.Pointer.Capture(slot); acc.BeginGesture(id); SetFromX(e.GetPosition(slot).X); RefreshAll(); };- slot.PointerMoved += (_, e) => { if (drag) SetFromX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); acc.EndGesture(id); } };- readouts.Add(() => { if (!drag) Upd(); });- var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center };- var lbl = Cap(label); ((TextBlock)lbl).Width = lw;- g.Children.Add(lbl); Grid.SetColumn(slot, 1); g.Children.Add(slot); Grid.SetColumn(val, 2); g.Children.Add(val);- return g;+ var row = DeviceCardKit.SliderRow(label, () => G(id), n => acc.ParamSet(pi, (float)n), () => fmt(G(id)), out var sync,+ begin: () => { acc.BeginGesture(id); RefreshAll(); }, end: () => acc.EndGesture(id),+ bipolar: bipolar, labelWidth: lw, valueWidth: vw);+ readouts.Add(sync);+ return row;}int rootv = root;Control RootStepper(){var lbl = MonoTx(NoteName(rootv), TxtC, 10); lbl.Width = 26; lbl.TextAlignment = TextAlignment.Center;- Border Btn(string t, int d) { var b = new Border { Width = 16, Height = 16, CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), BorderBrush = NotaPalette.BorderStrong, Background = RowLit, Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = t, FontSize = 9, Foreground = NotaPalette.TextSecondary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center } }; b.PointerPressed += (_, _) => { rootv = Math.Clamp(rootv + d, 0, 127); acc.SetRoot(rootv); lbl.Text = NoteName(rootv); RefreshAll(); }; return b; }+ Border Btn(string t, int d) { var b = new Border { Width = 16, Height = 16, CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), BorderBrush = NotaPalette.BorderStrong, Background = RowLit, Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = t, FontSize = 9, Foreground = NotaPalette.TextSecondary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center } }; b.PointerPressed += (_, _) => { rootv = Math.Clamp(rootv + d, 0, 127); acc.SetRoot(rootv); lbl.Text = NoteName(rootv); RefreshAll(); }; return b; }return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, VerticalAlignment = VerticalAlignment.Center, Children = { Btn("−", -1), lbl, Btn("+", +1) } };}// ---- formatters (real units) ----- string Db(double v) => v <= 0.0011 ? "−∞ dB" : $"{20 * Math.Log10(v):+0.0;−0.0;0.0} dB";+ string Db(double v) => v <= 0.0011 ? "−∞\u2009dB" : $"{20 * Math.Log10(v):+0.0;−0.0;0.0}\u2009dB";string Pan(double v) { double p = (v - 0.5) * 2; return Math.Abs(p) < 0.03 ? "C" : p < 0 ? $"L{Math.Abs(p) * 100:0}" : $"R{p * 100:0}"; }- string Hz(double v) { double fc = Exp(v, 20, 20000); return fc >= 1000 ? $"{fc / 1000:0.0} kHz" : $"{fc:0} Hz"; }- string St(double v) => $"{(v - 0.5) * 48:+0;-0;0} st";- string Cent(double v) => $"{(v - 0.5) * 100:+0;-0;0} c";- string Ms(double v, double lo, double hi) { double s = Exp(v, lo, hi); return s < 1 ? $"{s * 1000:0} ms" : $"{s:0.00} s"; }- string SusDb(double v) => v <= 0.0011 ? "−∞" : $"{20 * Math.Log10(v):0.0} dB";- string Pct(double v) => $"{v * 100:0}%";+ string Hz(double v) { double fc = Exp(v, 20, 20000); return fc >= 1000 ? $"{fc / 1000:0.0}\u2009k" : $"{fc:0}\u2009Hz"; }+ string St(double v) => $"{(v - 0.5) * 48:+0;−0;0}\u2009st";+ string Cent(double v) => $"{(v - 0.5) * 100:+0;−0;0}\u2009c";+ string Ms(double v, double lo, double hi) { double s = Exp(v, lo, hi); return s < 1 ? $"{s * 1000:0}\u2009ms" : $"{s:0.00}\u2009s"; }+ string SusDb(double v) => v <= 0.0011 ? "−∞" : $"{20 * Math.Log10(v):0.0}\u2009dB";+ string Pct(double v) => $"{v * 100:0}\u2009%";// ================= LIVE strip =================var voiceSeg = Seg("voicemode", new[] { "Poly 16", "Mono", "Choke" }, 9, 7);@@ -210,7 +195,7 @@ internal sealed class SamplerInstrumentCard : IInstrumentCardChild = new DockPanel { LastChildFill = false, Margin = new Thickness(9, 0), Children = {new StackPanel { Orientation = Orientation.Horizontal, Spacing = 12, VerticalAlignment = VerticalAlignment.Center, Children = {Cap("LIVE", MutedC),- HSlider("volume", "VOL", Db, lw: 26, vw: 52),+ HSlider("volume", "VOLUME", Db, lw: 26, vw: 52),HSlider("pan", "PAN", Pan, bipolar: true, lw: 26, vw: 26),HSlider("cutoff", "CUTOFF", Hz, lw: 40, vw: 52) } },new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, [DockPanel.DockProperty] = Dock.Right, Children = {@@ -227,7 +212,7 @@ internal sealed class SamplerInstrumentCard : IInstrumentCardfor (int i = 0; i < tabBtns.Length; i++) { bool on = i == t; tabBtns[i].Background = on ? RowLit : Brushes.Transparent; tabBtns[i].BorderBrush = on ? Amber : Brushes.Transparent; ((TextBlock)tabBtns[i].Child!).Foreground = on ? TxtC : MutedC; }}var railCol = new StackPanel { Spacing = 2 };- for (int i = 0; i < tabNames.Length; i++) { int ti = i; var b = new Border { Height = 20, CornerRadius = new CornerRadius(4), Padding = new Thickness(7, 0), BorderThickness = new Thickness(2, 0, 0, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = tabNames[i], FontSize = 10, FontWeight = FontWeight.Medium, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center } }; b.PointerPressed += (_, _) => SelectTab(ti); tabBtns[i] = b; railCol.Children.Add(b); }+ for (int i = 0; i < tabNames.Length; i++) { int ti = i; var b = new Border { Height = 20, CornerRadius = NotaRadius.Control, Padding = new Thickness(7, 0), BorderThickness = new Thickness(2, 0, 0, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = tabNames[i], FontSize = 9, FontWeight = FontWeight.Medium, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center } }; b.PointerPressed += (_, _) => SelectTab(ti); tabBtns[i] = b; railCol.Children.Add(b); }var tabRail = new Border { Width = 70, Background = RailBg, BorderBrush = Border2, BorderThickness = new Thickness(0, 0, 1, 0), Padding = new Thickness(5), Child = railCol };// ================= Sample tab =================@@ -241,11 +226,11 @@ internal sealed class SamplerInstrumentCard : IInstrumentCardreadouts.Add(() => { startFoot.Text = $"start {G("start") * durSec:0.00}"; endFoot.Text = $"end {G("end") * durSec:0.00}"; });var waveFoot = new DockPanel { LastChildFill = false, Height = 11, Children = { startFoot, endFoot } };DockPanel.SetDock(endFoot, Dock.Right);- var waveIsland = new Border { Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(8, 4), Child =+ var waveIsland = new Border { Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(8, 4), Child =new DockPanel { LastChildFill = true, Children = { WithDock(fileHdr, Dock.Top), WithDock(waveFoot, Dock.Bottom), wave } } };var loopRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center, Height = 40, Children = {new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("LOOP"), LoopSeg() } },- new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Width = 150, Children = { Cap("XFADE"), HSlider("loopxfade", "", v => $"{v * 200:0} ms", lw: 0, vw: 46) } },+ new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Width = 150, Children = { Cap("CROSSFADE"), HSlider("loopxfade", "", v => $"{v * 200:0}\u2009ms", lw: 0, vw: 46) } },ActionSnap() } };Control ActionSnap(){@@ -265,7 +250,7 @@ internal sealed class SamplerInstrumentCard : IInstrumentCardKUnit("transpose", "TRANSPOSE", St), KUnit("detune", "DETUNE", Cent, mod: true) } };var rootRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("ROOT"), RootStepper() } };pages[1] = new DockPanel { LastChildFill = true, Margin = new Thickness(10, 8), Children = {- WithDock(new Border { Height = 40, Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(4), Child = keys, Margin = new Thickness(0, 6, 0, 0) }, Dock.Bottom),+ WithDock(new Border { Height = 40, Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(4), Child = keys, Margin = new Thickness(0, 6, 0, 0) }, Dock.Bottom),WithDock(rootRow, Dock.Bottom),pitchKnobs } };@@ -277,17 +262,17 @@ internal sealed class SamplerInstrumentCard : IInstrumentCardKUnit("sustain", "SUSTAIN", SusDb), KUnit("release", "RELEASE", v => Ms(v, 0.002, 6.0)) } };pages[2] = new DockPanel { LastChildFill = true, Margin = new Thickness(10, 8), Children = {WithDock(new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, HorizontalAlignment = HorizontalAlignment.Center, Margin = new Thickness(0, 6, 0, 0), [DockPanel.DockProperty] = Dock.Bottom, Children = { envKnobs, OutToggle("velamount", "VEL→VOL", teal: true) } }, Dock.Bottom),- new Border { Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(6), Child = envBig } } };+ new Border { Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(6), Child = envBig } } };// ================= Filter tab =================var filtViz = new SamplerFilter { Height = 92 };readouts.Add(() => filtViz.Set(GI("filtertype", 4), G("cutoff"), G("resonance")));var filtKnobs = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, HorizontalAlignment = HorizontalAlignment.Center, Children = {- KUnit("cutoff", "CUTOFF", Hz), KUnit("resonance", "RESO", Pct), KUnit("keytrack", "KEY TRACK", Pct, mod: true) } };+ KUnit("cutoff", "CUTOFF", Hz), KUnit("resonance", "RESO", Pct), KUnit("keytrack", "KEYTRACK", Pct, mod: true) } };pages[3] = new DockPanel { LastChildFill = true, Margin = new Thickness(10, 8), Children = {WithDock(new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, HorizontalAlignment = HorizontalAlignment.Center, Children = { Cap("TYPE"), Seg("filtertype", new[] { "Off", "LP", "HP", "BP" }, 9, 8) } }, Dock.Top),WithDock(filtKnobs, Dock.Bottom),- new Border { Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(6), Margin = new Thickness(0, 5), Child = filtViz } } };+ new Border { Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(6), Margin = new Thickness(0, 5), Child = filtViz } } };// ================= assemble =================DockPanel.SetDock(tabRail, Dock.Left);@@ -319,19 +304,19 @@ internal sealed class SamplerInstrumentCard : IInstrumentCardnew DockPanel { LastChildFill = false, Children = {WithDock(new StackPanel { Spacing = 5, Children = {new TextBlock { Text = "AMP ENV", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = TealC },- new Border { Height = 42, Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(2), Child = env },- Row("ATK", () => G("attack"), v => Ms(v, 0.0005, 4.0)),- Row("DEC", () => G("decay"), v => Ms(v, 0.002, 6.0)),- Row("SUS", () => G("sustain"), SusDb),- Row("REL", () => G("release"), v => Ms(v, 0.002, 6.0)) } }, Dock.Top),+ new Border { Height = 42, Background = Inset, BorderBrush = FieldBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Padding = new Thickness(2), Child = env },+ Row("ATTACK", () => G("attack"), v => Ms(v, 0.0005, 4.0)),+ Row("DECAY", () => G("decay"), v => Ms(v, 0.002, 6.0)),+ Row("SUSTAIN", () => G("sustain"), SusDb),+ Row("RELEASE", () => G("release"), v => Ms(v, 0.002, 6.0)) } }, Dock.Top),WithDock(OutToggle("velamount", "VEL → VOL", true), Dock.Bottom) } } };}private static Control WithDock(Control c, Dock d) { DockPanel.SetDock(c, d); return c; }- private static string sinfoLabel(double sr, double dur, int root) => $"{sr / 1000:0.#} k · {dur:0.00} s · root {NoteName(root)}";+ private static string sinfoLabel(double sr, double dur, int root) => $"{sr / 1000:0.#} k · {dur:0.00}\u2009s · root {NoteName(root)}";- private static string LoopReadout(double ls, double le, double dur, int mode) => mode <= 0 ? "no loop" : $"loop {ls * dur:0.00} – {le * dur:0.00} s";+ private static string LoopReadout(double ls, double le, double dur, int mode) => mode <= 0 ? "no loop" : $"loop {ls * dur:0.00} – {le * dur:0.00}\u2009s";// Downsample interleaved float samples to min/max pairs per bucket (mono sum).private static float[] BuildPeaks(float[] samples, int channels, long frames, int buckets)diff --git a/src/managed/Nota.App/DeviceCards/Instruments/SynthInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/SynthInstrumentCard.csindex 4ece9f32..28b3f686 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/SynthInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/SynthInstrumentCard.cs@@ -38,10 +38,10 @@ internal sealed class SynthInstrumentCard : IInstrumentCard// Engine's perceptual map (Synth.h): lo * (hi/lo)^v.private static double ExpMap(float v, double lo, double hi) => lo * Math.Pow(hi / lo, Math.Clamp(v, 0f, 1f));private static string Secs(float v, double lo, double hi)- { double s = ExpMap(v, lo, hi); return s < 1.0 ? $"{(s * 1000).ToString("0", Inv)} ms" : $"{s.ToString("0.00", Inv)} s"; }- private static string Db(float v) => v <= 1e-4f ? "−∞ dB" : $"{(20.0 * Math.Log10(v)).ToString("0.0", Inv).Replace("-", "−")} dB";+ { double s = ExpMap(v, lo, hi); return s < 1.0 ? $"{(s * 1000).ToString("0", Inv)}\u2009ms" : $"{s.ToString("0.00", Inv)}\u2009s"; }+ private static string Db(float v) => v <= 1e-4f ? "−∞\u2009dB" : $"{(20.0 * Math.Log10(v)).ToString("0.0", Inv).Replace("-", "−")}\u2009dB";private static string KHz(float v)- { double hz = ExpMap(v, 20, 18000); return hz >= 1000 ? $"{(hz / 1000).ToString("0.00", Inv)} kHz" : $"{hz.ToString("0", Inv)} Hz"; }+ { double hz = ExpMap(v, 20, 18000); return hz >= 1000 ? $"{(hz / 1000).ToString("0.0", Inv)}\u2009k" : $"{hz.ToString("0", Inv)}\u2009Hz"; }public Control Build(DeviceCardContext ctx){@@ -93,7 +93,7 @@ internal sealed class SynthInstrumentCard : IInstrumentCard};var box = new Border{- Height = 28, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4),+ Height = 28, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control,Cursor = new Cursor(StandardCursorType.Hand), Child = inner,};box.PointerPressed += (_, _) => { if (idx.TryGetValue("wave", out var wi)) { engine.PluginParamSet(track, -1, wi, wv / 3f); SyncWave(); } };@@ -114,7 +114,7 @@ internal sealed class SynthInstrumentCard : IInstrumentCardvar fltRow = SpreadRow(Knob("cutoff", "Cutoff", KHz),- Knob("resonance", "Reso", v => v.ToString("0.00", CultureInfo.InvariantCulture)),+ Knob("resonance", "Reso", v => v.ToString("0.00", NotaNum.Culture)),Knob("gain", "Gain", Db));var left = new StackPanel { Width = 358, Spacing = 5, Children =diff --git a/src/managed/Nota.App/DeviceCards/Instruments/VoltInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/VoltInstrumentCard.csindex e5a73c79..89ce775b 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/VoltInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/VoltInstrumentCard.cs@@ -80,13 +80,9 @@ internal sealed class VoltInstrumentCard : IInstrumentCard// Param-backed chip strip (writes id = pick/(n-1)); optional per-index tint.Control Chips(string id, string[] names, double fs = 9){- int n = names.Length; var arr = new Border[n];- void Hi() { int cur = Sel(id, n); for (int i = 0; i < n; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Brushes.Transparent; arr[i].BorderBrush = on ? Amber : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : MutedC; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < n; i++)- { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(6, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, Foreground = MutedC } }; c.PointerPressed += (_, _) => { SetP(id, iv / (float)(n - 1)); Hi(); Refresh(); }; arr[i] = c; row.Children.Add(c); }- readouts.Add(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ int n = names.Length;+ var seg = DeviceCardKit.Segments(names, () => Sel(id, n), iv => { SetP(id, iv / (float)(n - 1)); Refresh(); }, out var sync);+ readouts.Add(sync);if (I(id) is var pi and >= 0) MidiLearn.Bind(seg, MidiTarget.PluginParam(track, -1, pi), id);return seg;}@@ -95,10 +91,10 @@ internal sealed class VoltInstrumentCard : IInstrumentCardControl WaveChips(string id){var arr = new Border[4]; var ic = new WaveIcon[4];- void Hi() { int cur = Sel(id, 4); for (int i = 0; i < 4; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Inset; arr[i].BorderBrush = on ? Amber : Border2; ic[i].Stroke = on ? AmberLit : MutedC; ic[i].InvalidateVisual(); } }+ void Hi() { int cur = Sel(id, 4); for (int i = 0; i < 4; i++) { bool on = i == cur; arr[i].Background = on ? NotaPalette.Accent : Inset; arr[i].BorderBrush = on ? NotaPalette.Accent : Border2; ic[i].Stroke = on ? NotaPalette.TextOnAccent : MutedC; ic[i].InvalidateVisual(); } }var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2, VerticalAlignment = VerticalAlignment.Center };for (int i = 0; i < 4; i++)- { int iv = i; var wi = new WaveIcon(i) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }; var b = new Border { Width = 26, Height = 18, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Cursor = new Cursor(StandardCursorType.Hand), Child = wi }; b.PointerPressed += (_, _) => { SetP(id, iv / 3f); Hi(); Refresh(); }; arr[i] = b; ic[i] = wi; row.Children.Add(b); }+ { int iv = i; var wi = new WaveIcon(i) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }; var b = new Border { Width = 26, Height = 18, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Cursor = new Cursor(StandardCursorType.Hand), Child = wi }; b.PointerPressed += (_, _) => { SetP(id, iv / 3f); Hi(); Refresh(); }; arr[i] = b; ic[i] = wi; row.Children.Add(b); }readouts.Add(Hi); Hi();if (I(id) is var pi and >= 0) MidiLearn.Bind(row, MidiTarget.PluginParam(track, -1, pi), id);return row;@@ -107,13 +103,8 @@ internal sealed class VoltInstrumentCard : IInstrumentCard// Local (non-param) segmented toggle.Control Seg(string[] names, int initial, Action<int> onPick, double fs = 9){- var arr = new Border[names.Length]; int cur = initial;- void Hi() { for (int i = 0; i < arr.Length; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : MutedC; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < names.Length; i++)- { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, FontWeight = FontWeight.SemiBold, Foreground = MutedC } }; c.PointerPressed += (_, _) => { cur = iv; Hi(); onPick(iv); }; arr[i] = c; row.Children.Add(c); }- Hi();- return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ int cur = initial;+ return DeviceCardKit.Segments(names, () => cur, iv => { cur = iv; onPick(iv); }, out _);}// Header (dot / name / subtitle / voice count) is provided by the shared shell.@@ -122,34 +113,22 @@ internal sealed class VoltInstrumentCard : IInstrumentCardControl Slider(string id, double trackW, string name, Func<double, string> fmt){int pi = I(id);- var bg = new Border { Width = trackW, Height = 3, Background = Inset, CornerRadius = new CornerRadius(2) };- var fill = new Border { Height = 3, Background = Amber, CornerRadius = new CornerRadius(2) };- var handle = new Border { Width = 8, Height = 9, Background = Handle, CornerRadius = new CornerRadius(2) };- var canvas = new Canvas { Width = trackW, Height = 9, Background = Brushes.Transparent, VerticalAlignment = VerticalAlignment.Center };- Canvas.SetTop(bg, 3); Canvas.SetTop(fill, 3); Canvas.SetTop(handle, 0);- canvas.Children.Add(bg); canvas.Children.Add(fill); canvas.Children.Add(handle);- var val = new TextBlock { FontSize = 9, Foreground = TxtC, Width = 46, VerticalAlignment = VerticalAlignment.Center };- val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- bool drag = false;- void Vis(double v) { fill.Width = Math.Max(0, v * trackW); Canvas.SetLeft(handle, v * trackW - 4); val.Text = fmt(v); }- void From(PointerEventArgs e) { double v = Math.Clamp(e.GetPosition(canvas).X / trackW, 0, 1); if (pi >= 0) engine.PluginParamSet(track, -1, pi, (float)v); Vis(v); Refresh(); }- canvas.PointerPressed += (_, e) => { drag = true; if (pi >= 0) engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); e.Pointer.Capture(canvas); From(e); };- canvas.PointerMoved += (_, e) => { if (drag) From(e); };- canvas.PointerReleased += (_, e) => { if (drag) { drag = false; if (pi >= 0) engine.EndAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); e.Pointer.Capture(null); } };- readouts.Add(() => { if (!drag) Vis(G(id)); });- Vis(G(id));- var host = Row(6, Lbl(name, 8, MutedC), canvas, val);- if (pi >= 0) MidiLearn.Bind(host, MidiTarget.PluginParam(track, -1, pi), name);- return host;+ var row = DeviceCardKit.SliderRow(name, () => G(id), n => { if (pi >= 0) engine.PluginParamSet(track, -1, pi, (float)n); Refresh(); }, () => fmt(G(id)), out var sync,+ begin: () => { if (pi >= 0) engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); },+ end: () => { if (pi >= 0) engine.EndAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id); },+ trackWidth: trackW, valueWidth: 46);+ readouts.Add(sync);+ if (pi >= 0) MidiLearn.Bind(row, MidiTarget.PluginParam(track, -1, pi), name);+ return row;}- string GlideFmt(double v) => v <= 0.001 ? "off" : $"{20 * Math.Pow(120, v):0} ms";+ string GlideFmt(double v) => v <= 0.001 ? "off" : $"{20 * Math.Pow(120, v):0}\u2009ms";var monoSeg = Seg(new[] { "Poly", "Mono" }, G("mono") > 0.5f ? 1 : 0, i => { SetP("mono", i); Refresh(); }, 9);DockPanel.SetDock(monoSeg, Dock.Right);var liveStrip = new Border { Height = 34, Background = HdrBg, BorderBrush = Border2, BorderThickness = new Thickness(0, 0, 0, 1),Child = new DockPanel { Margin = new Thickness(9, 0), LastChildFill = false, Children = { monoSeg,new StackPanel { Orientation = Orientation.Horizontal, Spacing = 12, VerticalAlignment = VerticalAlignment.Center, Children = {- Slider("fil1freq", 88, "CUTOFF", v => { double hz = 20 * Math.Pow(900, v); return hz >= 1000 ? $"{hz / 1000:0.0} kHz" : $"{hz:0} Hz"; }),- Slider("fil1reso", 66, "RES", v => $"{v:0.00}"),+ Slider("fil1freq", 88, "CUTOFF", v => { double hz = 20 * Math.Pow(900, v); return hz >= 1000 ? $"{hz / 1000:0.0}\u2009k" : $"{hz:0}\u2009Hz"; }),+ Slider("fil1reso", 66, "RESO", v => $"{v:0.00}"),Slider("glide", 60, "GLIDE", GlideFmt) } } } } };// ---- tab bodies ----@@ -158,7 +137,7 @@ internal sealed class VoltInstrumentCard : IInstrumentCard{var head = new StackPanel { Width = 96, Spacing = 3, VerticalAlignment = VerticalAlignment.Center, Children = { Lbl(title, 9, TxtC), picker } };var kr = Row(2, knobs);- var lane = new Border { Height = 62, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(8, 2),+ var lane = new Border { Height = 62, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(8, 2),Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center, Children = { head, kr } } };return lane;}@@ -178,7 +157,7 @@ internal sealed class VoltInstrumentCard : IInstrumentCardstring pre = fsel == 0 ? "fil1" : "fil2";filtRight.Children.Clear();filtRight.Children.Add(Chips(pre + "type", new[] { "LP", "HP", "BP", "Notch" }));- filtRight.Children.Add(Seg(new[] { "12 dB", "24 dB" }, G(pre + "slope") > 0.5f ? 1 : 0, i => { SetP(pre + "slope", i); Refresh(); }, 8));+ filtRight.Children.Add(Seg(new[] { "12\u2009dB", "24\u2009dB" }, G(pre + "slope") > 0.5f ? 1 : 0, i => { SetP(pre + "slope", i); Refresh(); }, 8));filtRight.Children.Add(Row(2, K(pre + "freq", "CUTOFF"), K(pre + "reso", "RESO")));filtRight.Children.Add(Row(2, K(pre + "env", "ENV", true), K(pre + "key", "KEY", true)));}@@ -207,7 +186,7 @@ internal sealed class VoltInstrumentCard : IInstrumentCardvar v = new TextBlock { Text = Pct(G(ids[k])), FontSize = 9, Foreground = TxtC, HorizontalAlignment = HorizontalAlignment.Center };v.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");string pid = ids[k]; var tv = v; readouts.Add(() => tv.Text = Pct(G(pid)));- var cell = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(2, 2),+ var cell = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(2, 2),Child = new StackPanel { Children = { new TextBlock { Text = lbl[k], FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedC, HorizontalAlignment = HorizontalAlignment.Center }, v } } };Grid.SetColumn(cell, k); grid.Children.Add(cell);}@@ -215,7 +194,7 @@ internal sealed class VoltInstrumentCard : IInstrumentCardvar head = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, Children = { Lbl(title, 9, TxtC), new TextBlock { Text = route, FontSize = 8, Foreground = TealC, VerticalAlignment = VerticalAlignment.Center } } };DockPanel.SetDock(head, Dock.Top);var body = new DockPanel { LastChildFill = true, Children = { head, grid, gView } };- return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(8, 6), Child = body };+ return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(8, 6), Child = body };}Control EnvTab(){@@ -231,7 +210,7 @@ internal sealed class VoltInstrumentCard : IInstrumentCard{var head = new StackPanel { Width = 116, Spacing = 3, VerticalAlignment = VerticalAlignment.Center, Children = { Lbl(title, 9, TxtC) } };if (extras != null) head.Children.Add(extras);- var lane = new Border { Height = 62, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(8, 2),+ var lane = new Border { Height = 62, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(8, 2),Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center, Children = { head, Row(2, knobs) } } };return lane;}@@ -247,7 +226,7 @@ internal sealed class VoltInstrumentCard : IInstrumentCardreadouts.Add(matrix.Refresh);Control ModTab(){- var clear = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = "Clear all", FontSize = 9, Foreground = MutedC } };+ var clear = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = "Clear all", FontSize = 9, Foreground = MutedC } };clear.PointerPressed += (_, _) => matrix.ClearAll();var head = new DockPanel { Margin = new Thickness(0, 0, 0, 4), LastChildFill = false, Children = { clear,new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = { Lbl("MOD MATRIX", 9, TxtC), new TextBlock { Text = "drag a cell · up +, down −", FontSize = 8, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center } } } } };@@ -264,8 +243,8 @@ internal sealed class VoltInstrumentCard : IInstrumentCarddest.PointerPressed += (_, _) => { SetP($"mac{m}dest", ((Sel($"mac{m}dest", 6) + 1) % 6) / 5f); SyncDest(); };readouts.Add(SyncDest); SyncDest();var body = new StackPanel { Width = 116, Spacing = 1, HorizontalAlignment = HorizontalAlignment.Center, Children = {- Row(2, K($"mac{m}val", $"MACRO {m + 1}"), K($"mac{m}amt", "AMT", true)), dest } };- return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(4, 4), Child = body };+ Row(2, K($"mac{m}val", $"MACRO {m + 1}"), K($"mac{m}amt", "AMOUNT", true)), dest } };+ return new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(4, 4), Child = body };}Control MacroTab(){@@ -295,8 +274,8 @@ internal sealed class VoltInstrumentCard : IInstrumentCardfor (int i = 0; i < tabs.Length; i++){int iv = i;- var b = new Border { Height = 22, CornerRadius = new CornerRadius(4), Padding = new Thickness(8, 0), BorderThickness = new Thickness(2, 0, 0, 0), BorderBrush = Brushes.Transparent,- Child = new TextBlock { Text = tabs[i], FontSize = 10, FontWeight = FontWeight.Medium, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center } };+ var b = new Border { Height = 22, CornerRadius = NotaRadius.Control, Padding = new Thickness(8, 0), BorderThickness = new Thickness(2, 0, 0, 0), BorderBrush = Brushes.Transparent,+ Child = new TextBlock { Text = tabs[i], FontSize = 9, FontWeight = FontWeight.Medium, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center } };b.PointerPressed += (_, _) => { tabSel = iv; HiTabs(); tabHost.Content = TabBody(iv); };tabBtns[i] = b; railCol.Children.Add(b);}diff --git a/src/managed/Nota.App/DeviceCards/Midi/ArpMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/ArpMidiBody.csindex 126efaca..93f36800 100644--- a/src/managed/Nota.App/DeviceCards/Midi/ArpMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/ArpMidiBody.cs@@ -57,20 +57,16 @@ internal sealed class ArpMidiBody : IMidiDeviceBody// Param-backed segmented control (fill = active choice).Control Seg(int p, string[] names, double fs = 9, double padX = 6, int off = 0){- var arr = new Border[names.Length];- void Hi() { int cur = Math.Clamp(GI(p) - off, 0, names.Length - 1); for (int i = 0; i < names.Length; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Brushes.Transparent; arr[i].BorderBrush = on ? Amber : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : MutedC; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < names.Length; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(padX, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, Foreground = MutedC } }; c.PointerPressed += (_, _) => { S(p, iv + off); Hi(); }; arr[i] = c; row.Children.Add(c); }- readouts.Add(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ var seg = DeviceCardKit.Segments(names, () => Math.Clamp(GI(p) - off, 0, names.Length - 1), iv => S(p, iv + off), out var sync);+ readouts.Add(sync);MidiLearn.Bind(seg, MidiTarget.MidiDeviceParam(track, mi, p), engine.MidiEffectParamName(track, mi, p));return seg;}// Outlined toggle: filled only when on.Control OutToggle(int p, string label){- var b = new Border { CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), Padding = new Thickness(9, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 9, FontWeight = FontWeight.SemiBold } };- void Hi() { bool on = G(p) > 0.5f; b.Background = on ? AmberSubtle : Brushes.Transparent; b.BorderBrush = on ? Amber : Border2; ((TextBlock)b.Child!).Foreground = on ? AmberLit : MutedC; }+ var b = new Border { CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Padding = new Thickness(9, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 9, FontWeight = FontWeight.SemiBold } };+ void Hi() { bool on = G(p) > 0.5f; b.Background = on ? NotaPalette.AccentSubtle : Brushes.Transparent; b.BorderBrush = on ? NotaPalette.BorderBrass : Border2; ((TextBlock)b.Child!).Foreground = on ? NotaPalette.AccentHover : MutedC; }b.PointerPressed += (_, _) => { S(p, G(p) > 0.5f ? 0 : 1); Hi(); };readouts.Add(Hi); Hi();MidiLearn.Bind(b, MidiTarget.MidiDeviceParam(track, mi, p), label);@@ -79,9 +75,9 @@ internal sealed class ArpMidiBody : IMidiDeviceBody// Compact drag value (label above a field you drag; double-click resets).Control DragVal(int p, string name, double min, double max, Func<double, string> fmt){- var val = new TextBlock { Text = fmt(G(p)), FontSize = 10, Foreground = TxtC, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };+ var val = new TextBlock { Text = fmt(G(p)), FontSize = 9, Foreground = TxtC, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- var field = new Border { MinWidth = 44, Height = 17, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(3, 0), Cursor = new Cursor(StandardCursorType.SizeWestEast), Child = val };+ var field = new Border { MinWidth = 44, Height = 17, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(3, 0), Cursor = new Cursor(StandardCursorType.SizeWestEast), Child = val };bool drag = false; double sx = 0, sv = 0;field.PointerPressed += (_, e) =>{@@ -96,15 +92,15 @@ internal sealed class ArpMidiBody : IMidiDeviceBody}Control Stepper(int p, int min, int max){- var val = new TextBlock { Text = GI(p).ToString(), FontSize = 11, Foreground = TxtC, MinWidth = 18, TextAlignment = TextAlignment.Center, VerticalAlignment = VerticalAlignment.Center };+ var val = new TextBlock { Text = GI(p).ToString(), FontSize = 9, Foreground = TxtC, MinWidth = 18, TextAlignment = TextAlignment.Center, VerticalAlignment = VerticalAlignment.Center };val.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- Border Btn(string t, int d) { var b = new Border { Width = 18, Height = 18, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = t, FontSize = 11, Foreground = TxtC, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center } }; b.PointerPressed += (_, _) => { int v = Math.Clamp(GI(p) + d, min, max); S(p, v); val.Text = v.ToString(); }; return b; }+ Border Btn(string t, int d) { var b = new Border { Width = 18, Height = 18, Background = Inset, BorderBrush = Border2, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = t, FontSize = 9, Foreground = TxtC, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center } }; b.PointerPressed += (_, _) => { int v = Math.Clamp(GI(p) + d, min, max); S(p, v); val.Text = v.ToString(); }; return b; }readouts.Add(() => val.Text = GI(p).ToString());return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Children = { Btn("−", -1), val, Btn("+", +1) } };}// ---- LIVE strip ----- string Pct(double v) => $"{v * 100:0}%";+ string Pct(double v) => $"{v * 100:0}\u2009%";var live = new Border { Height = 34, Background = HdrBg, BorderBrush = Border2, BorderThickness = new Thickness(0, 0, 0, 1),Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(9, 0), Children = {Seg(GSync, new[] { "Free", "Sync" }, 9, 7),@@ -135,7 +131,7 @@ internal sealed class ArpMidiBody : IMidiDeviceBodyfor (int i = 0; i < lanes.Length; i++){int li = i;- var b = new Border { Height = 22, CornerRadius = new CornerRadius(4), Padding = new Thickness(7, 0), BorderThickness = new Thickness(2, 0, 0, 0), BorderBrush = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = lanes[i].name, FontSize = 10, FontWeight = FontWeight.Medium, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center } };+ var b = new Border { Height = 22, CornerRadius = NotaRadius.Control, Padding = new Thickness(7, 0), BorderThickness = new Thickness(2, 0, 0, 0), BorderBrush = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = lanes[i].name, FontSize = 9, FontWeight = FontWeight.Medium, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center } };b.PointerPressed += (_, _) => SelectLane(li);laneBtns[i] = b; railCol.Children.Add(b);}@@ -155,10 +151,10 @@ internal sealed class ArpMidiBody : IMidiDeviceBodyvar orderGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,*"), ColumnSpacing = 2, RowSpacing = 2 };for (int i = 0; i < 4; i++) orderGrid.RowDefinitions.Add(new RowDefinition(GridLength.Auto));var orderChips = new Border[OrderNames.Length];- void HiOrder() { int cur = Math.Clamp(GI(GOrder), 0, OrderNames.Length - 1); for (int i = 0; i < OrderNames.Length; i++) { bool on = i == cur; orderChips[i].Background = on ? AmberSubtle : Inset; orderChips[i].BorderBrush = on ? Amber : Border2; ((TextBlock)orderChips[i].Child!).Foreground = on ? AmberLit : MutedC; } }+ void HiOrder() { int cur = Math.Clamp(GI(GOrder), 0, OrderNames.Length - 1); for (int i = 0; i < OrderNames.Length; i++) { bool on = i == cur; orderChips[i].Background = on ? Amber : Inset; orderChips[i].BorderBrush = on ? Amber : Border2; ((TextBlock)orderChips[i].Child!).Foreground = on ? NotaPalette.TextOnAccent : MutedC; } }for (int i = 0; i < OrderNames.Length; i++){- int iv = i; var c = new Border { BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(2, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = OrderNames[i], FontSize = 8, Foreground = MutedC, HorizontalAlignment = HorizontalAlignment.Center } };+ int iv = i; var c = new Border { BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Padding = new Thickness(2, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = OrderNames[i], FontSize = 8, Foreground = MutedC, HorizontalAlignment = HorizontalAlignment.Center } };c.PointerPressed += (_, _) => { S(GOrder, iv); HiOrder(); };Grid.SetColumn(c, i % 2); Grid.SetRow(c, i / 2); orderChips[i] = c; orderGrid.Children.Add(c);}@@ -168,25 +164,17 @@ internal sealed class ArpMidiBody : IMidiDeviceBody// Full-width segmented control: equal-star columns so the buttons fill the rail evenly.Control SegFill(int p, string[] names, int off = 0){- int n = names.Length; var arr = new Border[n];- var grid = new Grid { ColumnSpacing = 2 };- void Hi() { int cur = Math.Clamp(GI(p) - off, 0, n - 1); for (int i = 0; i < n; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Inset; arr[i].BorderBrush = on ? Amber : Border2; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : MutedC; } }- for (int i = 0; i < n; i++)- {- grid.ColumnDefinitions.Add(new ColumnDefinition(1, GridUnitType.Star));- int iv = i; var c = new Border { BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(0, 2), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = MutedC, HorizontalAlignment = HorizontalAlignment.Center } };- c.PointerPressed += (_, _) => { S(p, iv + off); Hi(); }; arr[i] = c; Grid.SetColumn(c, i); grid.Children.Add(c);- }- readouts.Add(Hi); Hi();- MidiLearn.Bind(grid, MidiTarget.MidiDeviceParam(track, mi, p), engine.MidiEffectParamName(track, mi, p));- return grid;+ var seg = DeviceCardKit.Segments(names, () => Math.Clamp(GI(p) - off, 0, names.Length - 1), iv => S(p, iv + off), out var sync, fill: true);+ readouts.Add(sync);+ MidiLearn.Bind(seg, MidiTarget.MidiDeviceParam(track, mi, p), engine.MidiEffectParamName(track, mi, p));+ return seg;}var rightRail = new Border { Width = 120, Background = RailBg, BorderBrush = Border2, BorderThickness = new Thickness(1, 0, 0, 0), Padding = new Thickness(8, 7),Child = new StackPanel { Spacing = 5, Children = {Block("ORDER", TxtC, orderGrid),Block("OCT", MutedC, SegFill(GOctaves, new[] { "1", "2", "3", "4" }, off: 1)),Block("DIR", MutedC, SegFill(GOctaveMode, DirGlyphs)),- new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, VerticalAlignment = VerticalAlignment.Center, Children = { new TextBlock { Text = "TRANSP", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center }, DragVal(GTranspose, "", -24, 24, v => $"{v:+0;-0;0} st") } } } } };+ new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, VerticalAlignment = VerticalAlignment.Center, Children = { new TextBlock { Text = "TRANSPOSE", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = MutedC, VerticalAlignment = VerticalAlignment.Center }, DragVal(GTranspose, "", -24, 24, v => $"{v:+0;−0;0}\u2009st") } } } } };// ---- assemble ----DockPanel.SetDock(laneRail, Dock.Left); DockPanel.SetDock(rightRail, Dock.Right);diff --git a/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.csindex 22177d51..4b79317f 100644--- a/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.cs@@ -81,11 +81,11 @@ internal sealed class ChordMidiBody : IMidiDeviceBodyControl RawSlider(int p, double min, double max, Func<double, string> fmt, double w, bool bipolar = false, double valW = 40){var val = Mono(fmt(G(p)), Txt); val.Width = valW; val.TextAlignment = TextAlignment.Right;- var fill = new Border { Height = 3, Background = Amber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 7, Height = 9, Background = Sub, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var fill = new Border { Height = 3, Background = Amber, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var handle = new Border { Width = 7, Height = 9, Background = Sub, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };var slot = new Panel { Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent };if (w > 0) slot.Width = w;- slot.Children.Add(new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center });+ slot.Children.Add(new Border { Height = 3, Background = Inset, CornerRadius = NotaRadius.Clip, VerticalAlignment = VerticalAlignment.Center });if (bipolar) slot.Children.Add(new Border { Width = 1, Background = Bd, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Stretch, Margin = new Thickness(0, 1) });slot.Children.Add(fill); slot.Children.Add(handle);double Norm(double v) => (v - min) / (max - min);@@ -115,8 +115,8 @@ internal sealed class ChordMidiBody : IMidiDeviceBody}Control Toggle(int p, string label){- var b = new Border { CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 9, FontWeight = FontWeight.SemiBold } };- void Sync() { bool on = G(p) >= 0.5f; b.Background = on ? AmberSubtle : Card; b.BorderBrush = on ? Amber : Bd; ((TextBlock)b.Child!).Foreground = on ? AmberLit : Sub; }+ var b = new Border { CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = new TextBlock { Text = label, FontSize = 9, FontWeight = FontWeight.SemiBold } };+ void Sync() { bool on = G(p) >= 0.5f; b.Background = on ? NotaPalette.AccentSubtle : Card; b.BorderBrush = on ? NotaPalette.BorderBrass : Bd; ((TextBlock)b.Child!).Foreground = on ? NotaPalette.AccentHover : Sub; }b.PointerPressed += (_, _) => { S(p, G(p) >= 0.5f ? 0 : 1); Refresh(); };readouts.Add(Sync); Sync();MidiLearn.Bind(b, MidiTarget.MidiDeviceParam(track, mi, p), label);@@ -138,7 +138,7 @@ internal sealed class ChordMidiBody : IMidiDeviceBodyfor (int i = 0; i < names.Length; i++){int iv = i;- var c = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = Muted } };+ var c = new Border { CornerRadius = NotaRadius.Badge, Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = Muted } };c.PointerPressed += (_, _) =>{if (iv < Templates.Length) { var t = Templates[iv].semis; for (int v = 0; v < Voices; v++) S(Voice1 + v, v < t.Length ? t[v] : 0); }@@ -147,11 +147,11 @@ internal sealed class ChordMidiBody : IMidiDeviceBodyarr[i] = c; row.Children.Add(c);}readouts.Add(Hi); Hi();- return new Border { Background = Inset, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ return new Border { Background = Inset, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };}// ---- LIVE strip ----- var strumBlock = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("STRUM"), RawSlider(Strum, 0, 120, v => $"{v:0} ms", 52, false, 40) } };+ var strumBlock = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("STRUM"), RawSlider(Strum, 0, 120, v => $"{v:0}\u2009ms", 52, false, 40) } };var liveL = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("CHORD"), ChordChips(), strumBlock } };var liveR = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Right, Children = { Toggle(KeepRoot, "Keep root"), Toggle(Fold, "Fold in scale") } };var liveGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto") };@@ -169,7 +169,7 @@ internal sealed class ChordMidiBody : IMidiDeviceBodyvar g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,*,Auto"), ColumnSpacing = 7, VerticalAlignment = VerticalAlignment.Center };var cells = new Control[] { dot, lbl, semi, vel };for (int c = 0; c < cells.Length; c++) { Grid.SetColumn(cells[c], c); g.Children.Add(cells[c]); }- return new Border { Background = NotaPalette.BgApp, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(7, 0), Height = 26, Child = g };+ return new Border { Background = NotaPalette.BgApp, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(7, 0), Height = 26, Child = g };}var shiftHead = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), Height = 11 };var sh1 = Cap("semitones · velocity"); sh1.HorizontalAlignment = HorizontalAlignment.Right; Grid.SetColumn(sh1, 1);@@ -185,12 +185,12 @@ internal sealed class ChordMidiBody : IMidiDeviceBodyGrid.SetColumn(noteText, 1); resHead.Children.Add(Cap("RESULT")); resHead.Children.Add(noteText);var legend = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, VerticalAlignment = VerticalAlignment.Center, Children ={- new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, Children = { new Border { Width = 8, Height = 8, Background = AmberLit, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center }, Cap("played", Sub) } },- new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, Children = { new Border { Width = 8, Height = 8, Background = Amber, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center }, Cap("added", Sub) } },+ new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, Children = { new Border { Width = 8, Height = 8, Background = AmberLit, CornerRadius = NotaRadius.Clip, VerticalAlignment = VerticalAlignment.Center }, Cap("played", Sub) } },+ new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, Children = { new Border { Width = 8, Height = 8, Background = Amber, CornerRadius = NotaRadius.Clip, VerticalAlignment = VerticalAlignment.Center }, Cap("added", Sub) } },} };var voicesText = Mono("", Txt);var voicesRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("VOICES"), voicesText } };- var spreadRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("SPREAD"), RawSlider(Spread, 0, 100, v => $"{v:0} %", 0, false, 34) } };+ var spreadRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("SPREAD"), RawSlider(Spread, 0, 100, v => $"{v:0}\u2009%", 0, false, 34) } };var resBottom = new StackPanel { Spacing = 4, Children = { voicesRow, spreadRow } };var resDock = new DockPanel { LastChildFill = true };DockPanel.SetDock(resHead, Dock.Top); DockPanel.SetDock(legend, Dock.Top);diff --git a/src/managed/Nota.App/DeviceCards/Midi/GenericMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/GenericMidiBody.csindex 87e232ef..2bc89cc9 100644--- a/src/managed/Nota.App/DeviceCards/Midi/GenericMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/GenericMidiBody.cs@@ -43,5 +43,5 @@ internal sealed class GenericMidiBody : IMidiDeviceBodyreturn panel;}- private static string FmtParam(float v, bool integral) => integral ? Math.Round(v).ToString("0", CultureInfo.InvariantCulture) : v.ToString("0.00", CultureInfo.InvariantCulture);+ private static string FmtParam(float v, bool integral) => integral ? Math.Round(v).ToString("0", NotaNum.Culture) : v.ToString("0.00", NotaNum.Culture);}diff --git a/src/managed/Nota.App/DeviceCards/Midi/LengthMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/LengthMidiBody.csindex 5037855b..8d2d2552 100644--- a/src/managed/Nota.App/DeviceCards/Midi/LengthMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/LengthMidiBody.cs@@ -71,11 +71,11 @@ internal sealed class LengthMidiBody : IMidiDeviceBodyControl RawSlider(int p, double min, double max, Func<double, string> fmt, double w, IBrush fill, double valW = 42){var val = Mono(fmt(G(p)), Txt); val.MinWidth = valW; val.TextAlignment = TextAlignment.Right;- var fillB = new Border { Height = 3, Background = fill, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 7, Height = 9, Background = Sub, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var fillB = new Border { Height = 3, Background = fill, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var handle = new Border { Width = 7, Height = 9, Background = Sub, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };var slot = new Panel { Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent };if (w > 0) slot.Width = w;- slot.Children.Add(new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center });+ slot.Children.Add(new Border { Height = 3, Background = Inset, CornerRadius = NotaRadius.Clip, VerticalAlignment = VerticalAlignment.Center });slot.Children.Add(fillB); slot.Children.Add(handle);void Vis(double v) { double W = slot.Bounds.Width, n = (v - min) / (max - min); fillB.Width = n * W; handle.Margin = new Thickness(Math.Clamp(n * W - 3.5, 0, Math.Max(0, W - 7)), 0, 0, 0); }bool drag = false;@@ -92,49 +92,33 @@ internal sealed class LengthMidiBody : IMidiDeviceBody}Control Seg(int p, string[] names, Action<int>? extra = null, double padX = 7){- var arr = new Border[names.Length];- void Hi() { int cur = Math.Clamp(Gi(p), 0, names.Length - 1); for (int i = 0; i < names.Length; i++) { bool on = i == cur; arr[i].Background = on ? Amber : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? Ink : Muted; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < names.Length; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(padX, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = Muted } }; c.PointerPressed += (_, _) => { S(p, iv); extra?.Invoke(iv); Refresh(); }; arr[i] = c; row.Children.Add(c); }- readouts.Add(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ var seg = DeviceCardKit.Segments(names, () => Math.Clamp(Gi(p), 0, names.Length - 1), iv => { S(p, iv); extra?.Invoke(iv); Refresh(); }, out var sync);+ readouts.Add(sync);MidiLearn.Bind(seg, MidiTarget.MidiDeviceParam(track, mi, p), engine.MidiEffectParamName(track, mi, p));return seg;}// Outlined pill buttons (radio-style) bound to a 0/1 param — for the trigger choice.Control TrigSeg(){- var opts = new[] { "On note-on", "On note-off" }; var arr = new Border[2];- void Hi() { int cur = G(PTrigger) >= 0.5f ? 1 : 0; for (int i = 0; i < 2; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Card; arr[i].BorderBrush = on ? Amber : Bd; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : Sub; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4 };- for (int i = 0; i < 2; i++) { int iv = i; var b = new Border { CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = opts[i], FontSize = 9, Foreground = Sub } }; b.PointerPressed += (_, _) => { S(PTrigger, iv); Refresh(); }; arr[i] = b; row.Children.Add(b); }- readouts.Add(Hi); Hi();- MidiLearn.Bind(row, MidiTarget.MidiDeviceParam(track, mi, PTrigger), engine.MidiEffectParamName(track, mi, PTrigger));- return row;+ var seg = DeviceCardKit.Segments(new[] { "On note-on", "On note-off" }, () => G(PTrigger) >= 0.5f ? 1 : 0, i => { S(PTrigger, i); Refresh(); }, out var sync);+ readouts.Add(sync);+ MidiLearn.Bind(seg, MidiTarget.MidiDeviceParam(track, mi, PTrigger), engine.MidiEffectParamName(track, mi, PTrigger));+ return seg;}Control Toggle(int p, string label, IBrush accent){- var trk = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), Background = Inset };- var knob = new Ellipse { Width = 6, Height = 6, Fill = Muted, HorizontalAlignment = HorizontalAlignment.Left, Margin = new Thickness(2, 0, 0, 0), VerticalAlignment = VerticalAlignment.Center };- trk.Child = knob;- var lbl = Cap(label, accent);- void Sync() { bool on = G(p) >= 0.5f; trk.Background = on ? accent : Inset; knob.Fill = on ? Ink : Muted; knob.HorizontalAlignment = on ? HorizontalAlignment.Right : HorizontalAlignment.Left; knob.Margin = new Thickness(on ? 0 : 2, 0, on ? 2 : 0, 0); lbl.Foreground = on ? Sub : Muted; }- var host = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand), Children = { trk, lbl } };- host.PointerPressed += (_, _) => { S(p, G(p) >= 0.5f ? 0 : 1); Refresh(); };- readouts.Add(Sync); Sync();+ var host = DeviceCardKit.Switch(label, () => G(p) >= 0.5f, () => { S(p, G(p) >= 0.5f ? 0 : 1); Refresh(); }, out var sync);+ readouts.Add(sync);MidiLearn.Bind(host, MidiTarget.MidiDeviceParam(track, mi, p), label);return host;}// Sync-mode rate chips.Control RateChips(){- var arr = new Border[RateLbl.Length];- void Hi() { int cur = Math.Clamp(Gi(PRate), 0, 3); for (int i = 0; i < RateLbl.Length; i++) { bool on = i == cur; arr[i].Background = on ? AmberSubtle : Card; arr[i].BorderBrush = on ? Amber : Bd; ((TextBlock)arr[i].Child!).Foreground = on ? AmberLit : Sub; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2 };- for (int i = 0; i < RateLbl.Length; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Padding = new Thickness(6, 2), Cursor = new Cursor(StandardCursorType.Hand), Child = Mono(RateLbl[i], Sub, 9) }; c.PointerPressed += (_, _) => { S(PRate, iv); Refresh(); }; arr[i] = c; row.Children.Add(c); }- readouts.Add(Hi); Hi();- MidiLearn.Bind(row, MidiTarget.MidiDeviceParam(track, mi, PRate), engine.MidiEffectParamName(track, mi, PRate));- return row;+ var seg = DeviceCardKit.Segments(RateLbl, () => Math.Clamp(Gi(PRate), 0, RateLbl.Length - 1), i => { S(PRate, i); Refresh(); }, out var sync);+ readouts.Add(sync);+ MidiLearn.Bind(seg, MidiTarget.MidiDeviceParam(track, mi, PRate), engine.MidiEffectParamName(track, mi, PRate));+ return seg;}// ---- LIVE strip (Mode + contextual length + Trigger) ----@@ -145,13 +129,13 @@ internal sealed class LengthMidiBody : IMidiDeviceBodyint mode = Gi(PMode);lenHost.Children.Add(Cap("LENGTH"));if (mode == 1)- lenHost.Children.Add(RawSlider(PMs, 10, 2000, v => $"{v:0} ms", 64, Amber));+ lenHost.Children.Add(RawSlider(PMs, 10, 2000, v => $"{v:0}\u2009ms", 64, Amber));else if (mode == 2)- lenHost.Children.Add(RawSlider(PPercent, 5, 200, v => $"{v:0} %", 64, Amber));+ lenHost.Children.Add(RawSlider(PPercent, 5, 200, v => $"{v:0}\u2009%", 64, Amber));else{lenHost.Children.Insert(0, RateChips()); // rate chips before LENGTH (Sync only)- lenHost.Children.Add(RawSlider(PGate, 0.05, 2.0, v => $"{Div[Math.Clamp(Gi(PRate), 0, 3)] * v * (60000.0 / Bpm()):0} ms", 64, Amber));+ lenHost.Children.Add(RawSlider(PGate, 0.05, 2.0, v => $"{Div[Math.Clamp(Gi(PRate), 0, 3)] * v * (60000.0 / Bpm()):0}\u2009ms", 64, Amber));}}var modeSeg = Seg(PMode, Modes, _ => BuildLen());@@ -188,9 +172,9 @@ internal sealed class LengthMidiBody : IMidiDeviceBodyvar modStack = new StackPanel { Spacing = 6, Children ={Cap("MODIFIERS"),- ModRow("VEL → LEN", PVelToLen, v => $"{v * 100:0} %"),- ModRow("KEY → LEN", PKeyToLen, v => $"{v * 100:0} %"),- ModRow("RANDOM", PRandom, v => $"±{v * 100:0} %"),+ ModRow("VEL → LEN", PVelToLen, v => $"{v * 100:0}\u2009%"),+ ModRow("KEY → LEN", PKeyToLen, v => $"{v * 100:0}\u2009%"),+ ModRow("RANDOM", PRandom, v => $"±{v * 100:0}\u2009%"),new Border { Height = 1, Background = Card, Margin = new Thickness(0, 2) },Toggle(PLegato, "Legato · retrigger held", Amber),Toggle(PClipLimit, "Clip length limit", Amber),diff --git a/src/managed/Nota.App/DeviceCards/Midi/RandomMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/RandomMidiBody.csindex d6eb92ce..a718e19f 100644--- a/src/managed/Nota.App/DeviceCards/Midi/RandomMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/RandomMidiBody.cs@@ -59,43 +59,23 @@ internal sealed class RandomMidiBody : IMidiDeviceBody// ---- generic controls ----Control MiniSlider(string label, int p, double min, double max, Func<double, string> fmt, double w){- var val = Mono(fmt(G(p)), Txt); val.MinWidth = 30;- var fill = new Border { Height = 3, Background = Amber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 8, Height = 9, Background = Sub, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Width = w, Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent };- slot.Children.Add(new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center });- slot.Children.Add(fill); slot.Children.Add(handle);- void Vis(double v) { double n = (v - min) / (max - min); fill.Width = n * w; handle.Margin = new Thickness(Math.Clamp(n * w - 4, 0, w - 8), 0, 0, 0); }- bool drag = false;- void SetX(double x) { double n = Math.Clamp(x / w, 0, 1); double v = min + n * (max - min); S(p, v); Vis(v); val.Text = fmt(v); Refresh(); }- slot.PointerPressed += (_, e) => { drag = true; e.Pointer.Capture(slot); SetX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); } };- MidiLearn.Bind(slot, MidiTarget.MidiDeviceParam(track, mi, p), engine.MidiEffectParamName(track, mi, p));- readouts.Add(() => { if (!drag) { double v = G(p); Vis(v); val.Text = fmt(v); } });- return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap(label), slot, val } };+ var row = DeviceCardKit.SliderRow(label, () => (G(p) - min) / (max - min), n => { S(p, min + n * (max - min)); Refresh(); }, () => fmt(G(p)), out var sync,+ trackWidth: w, valueWidth: 30);+ MidiLearn.Bind(row, MidiTarget.MidiDeviceParam(track, mi, p), engine.MidiEffectParamName(track, mi, p));+ readouts.Add(sync);+ return row;}Control Seg(int p, string[] names, Action<int>? extra = null, double fs = 9, double padX = 7){- var arr = new Border[names.Length];- void Hi() { int cur = Math.Clamp(Gi(p), 0, names.Length - 1); for (int i = 0; i < names.Length; i++) { bool on = i == cur; arr[i].Background = on ? Amber : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? Ink : Muted; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < names.Length; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(padX, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, FontWeight = FontWeight.SemiBold, Foreground = Muted } }; c.PointerPressed += (_, _) => { S(p, iv); extra?.Invoke(iv); Refresh(); }; arr[i] = c; row.Children.Add(c); }- readouts.Add(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ var seg = DeviceCardKit.Segments(names, () => Math.Clamp(Gi(p), 0, names.Length - 1), iv => { S(p, iv); extra?.Invoke(iv); Refresh(); }, out var sync);+ readouts.Add(sync);MidiLearn.Bind(seg, MidiTarget.MidiDeviceParam(track, mi, p), engine.MidiEffectParamName(track, mi, p));return seg;}Control Toggle(int p, string label, IBrush accent){- var trk = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), Background = Inset };- var knob = new Ellipse { Width = 6, Height = 6, Fill = Muted, HorizontalAlignment = HorizontalAlignment.Left, Margin = new Thickness(2, 0, 0, 0), VerticalAlignment = VerticalAlignment.Center };- trk.Child = knob;- var lbl = Cap(label, accent);- void Sync() { bool on = G(p) >= 0.5f; trk.Background = on ? accent : Inset; knob.Fill = on ? Ink : Muted; knob.HorizontalAlignment = on ? HorizontalAlignment.Right : HorizontalAlignment.Left; knob.Margin = new Thickness(on ? 0 : 2, 0, on ? 2 : 0, 0); lbl.Foreground = on ? accent : Muted; }- var host = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand), Children = { trk, lbl } };- host.PointerPressed += (_, _) => { S(p, G(p) >= 0.5f ? 0 : 1); Refresh(); };- readouts.Add(Sync); Sync();+ var host = DeviceCardKit.Switch(label, () => G(p) >= 0.5f, () => { S(p, G(p) >= 0.5f ? 0 : 1); Refresh(); }, out var sync);+ readouts.Add(sync);MidiLearn.Bind(host, MidiTarget.MidiDeviceParam(track, mi, p), label);return host;}@@ -104,10 +84,10 @@ internal sealed class RandomMidiBody : IMidiDeviceBody{var nm = new TextBlock { Text = name, FontSize = 9, Foreground = Txt, Width = 56, VerticalAlignment = VerticalAlignment.Center };var val = Mono(fmt(G(p)), Sub); val.Width = 46; val.TextAlignment = TextAlignment.Right;- var fill = new Border { Background = colour, CornerRadius = new CornerRadius(3), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Stretch };+ var fill = new Border { Background = colour, CornerRadius = NotaRadius.Badge, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Stretch };var slot = new Panel { Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Inset };slot.Children.Add(fill);- var slotClip = new Border { Height = 9, CornerRadius = new CornerRadius(3), ClipToBounds = true, Child = slot, VerticalAlignment = VerticalAlignment.Center };+ var slotClip = new Border { Height = 9, CornerRadius = NotaRadius.Badge, ClipToBounds = true, Child = slot, VerticalAlignment = VerticalAlignment.Center };void Vis(double v) { fill.Width = (v - min) / (max - min) * slot.Bounds.Width; }bool drag = false;void SetX(double x) { double n = Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1); double v = min + n * (max - min); S(p, v); Vis(v); val.Text = fmt(v); Refresh(); }@@ -124,15 +104,15 @@ internal sealed class RandomMidiBody : IMidiDeviceBody}// ---- LIVE strip ----- var chance = MiniSlider("CHANCE", PChance, 0, 1, v => $"{v * 100:0} %", 110);+ var chance = MiniSlider("CHANCE", PChance, 0, 1, v => $"{v * 100:0}\u2009%", 110);var distSeg = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("DIST"), Seg(PDist, Dists) } };var seedTxt = Mono("", Teal, 9);readouts.Add(() => seedTxt.Text = $"seed {Gi(PSeed)}" + (G(PLocked) >= 0.5f ? " · locked" : ""));- var lockBtn = new Border { CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = "Lock seed", FontSize = 9 } };- void LockSync() { bool on = G(PLocked) >= 0.5f; lockBtn.Background = on ? TealSubtle : Card; lockBtn.BorderBrush = on ? Teal : Bd; ((TextBlock)lockBtn.Child!).Foreground = on ? Teal : Sub; }+ var lockBtn = new Border { CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = "Lock seed", FontSize = 9 } };+ void LockSync() { bool on = G(PLocked) >= 0.5f; lockBtn.Background = on ? NotaPalette.AccentSubtle : Card; lockBtn.BorderBrush = on ? NotaPalette.BorderBrass : Bd; ((TextBlock)lockBtn.Child!).Foreground = on ? NotaPalette.AccentHover : Sub; }lockBtn.PointerPressed += (_, _) => { S(PLocked, G(PLocked) >= 0.5f ? 0 : 1); Refresh(); };readouts.Add(LockSync); LockSync();- var reroll = new Border { Background = Card, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = "Re-roll", FontSize = 9, Foreground = Sub } };+ var reroll = new Border { Background = Card, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = "Re-roll", FontSize = 9, Foreground = Sub } };reroll.PointerPressed += (_, _) => { long s = (long)Gi(PSeed); s = (s * 1103515245L + 12345L) % 1000L; if (s <= 0) s += 1000; S(PSeed, s); Refresh(); };var liveR = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Right, Children = { seedTxt, lockBtn, reroll } };var liveL = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center, Children = { chance, distSeg } };@@ -147,11 +127,11 @@ internal sealed class RandomMidiBody : IMidiDeviceBodyvar varyStack = new StackPanel { Spacing = 3, Children ={vHead,- VaryRow("Note", PNoteRange, 0, 12, v => v < 0.5 ? "off" : $"±{v:0} st", Amber),+ VaryRow("Note", PNoteRange, 0, 12, v => v < 0.5 ? "off" : $"±{v:0}\u2009st", Amber),VaryRow("Velocity", PVelAmt, 0, 1, v => v < 0.01 ? "off" : $"±{v * 0.5 * 127:0}", Amber),- VaryRow("Timing", PTimeAmt, 0, 1, v => v < 0.01 ? "off" : $"±{v * 50:0} ms", Teal),- VaryRow("Skip", PSkip, 0, 1, v => v < 0.01 ? "off" : $"{v * 100:0} %", Red),- VaryRow("Octave", POctAmt, 0, 1, v => { int n = (int)Math.Round(v * 2); return n <= 0 ? "off" : $"±{n} oct"; }, Amber),+ VaryRow("Timing", PTimeAmt, 0, 1, v => v < 0.01 ? "off" : $"±{v * 50:0}\u2009ms", Teal),+ VaryRow("Skip", PSkip, 0, 1, v => v < 0.01 ? "off" : $"{v * 100:0}\u2009%", Red),+ VaryRow("Octave", POctAmt, 0, 1, v => { int n = (int)Math.Round(v * 2); return n <= 0 ? "off" : $"±{n}\u2009oct"; }, Amber),} };var varyPanel = new Border { Padding = new Thickness(8, 6), Child = varyStack };diff --git a/src/managed/Nota.App/DeviceCards/Midi/ScaleMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/ScaleMidiBody.csindex 52a4900f..c8c48608 100644--- a/src/managed/Nota.App/DeviceCards/Midi/ScaleMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/ScaleMidiBody.cs@@ -92,31 +92,21 @@ internal sealed class ScaleMidiBody : IMidiDeviceBody// ---- generic controls ----Control Seg(int p, string[] names, Action<int>? extra = null){- var arr = new Border[names.Length];- void Hi() { int cur = Math.Clamp(Gi(p), 0, names.Length - 1); for (int i = 0; i < names.Length; i++) { bool on = i == cur; arr[i].Background = on ? Amber : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? Ink : Muted; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < names.Length; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = Muted } }; c.PointerPressed += (_, _) => { S(p, iv); extra?.Invoke(iv); Refresh(); }; arr[i] = c; row.Children.Add(c); }- readouts.Add(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ var seg = DeviceCardKit.Segments(names, () => Math.Clamp(Gi(p), 0, names.Length - 1), iv => { S(p, iv); extra?.Invoke(iv); Refresh(); }, out var sync);+ readouts.Add(sync);MidiLearn.Bind(seg, MidiTarget.MidiDeviceParam(track, mi, p), engine.MidiEffectParamName(track, mi, p));return seg;}Control Toggle(int p, string label, IBrush accent){- var trk = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), Background = Inset };- var knob = new Ellipse { Width = 6, Height = 6, Fill = Muted, HorizontalAlignment = HorizontalAlignment.Left, Margin = new Thickness(2, 0, 0, 0), VerticalAlignment = VerticalAlignment.Center };- trk.Child = knob;- var lbl = Cap(label, accent);- void Sync() { bool on = G(p) >= 0.5f; trk.Background = on ? accent : Inset; knob.Fill = on ? Ink : Muted; knob.HorizontalAlignment = on ? HorizontalAlignment.Right : HorizontalAlignment.Left; knob.Margin = new Thickness(on ? 0 : 2, 0, on ? 2 : 0, 0); lbl.Foreground = on ? accent : Muted; }- var host = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand), Children = { trk, lbl } };- host.PointerPressed += (_, _) => { S(p, G(p) >= 0.5f ? 0 : 1); Refresh(); };- readouts.Add(Sync); Sync();+ var host = DeviceCardKit.Switch(label, () => G(p) >= 0.5f, () => { S(p, G(p) >= 0.5f ? 0 : 1); Refresh(); }, out var sync);+ readouts.Add(sync);MidiLearn.Bind(host, MidiTarget.MidiDeviceParam(track, mi, p), label);return host;}Control Btn(string label, Action onClick){- var b = new Border { Background = Card, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(0, 3), HorizontalAlignment = HorizontalAlignment.Stretch, Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = label, FontSize = 9, Foreground = Sub, HorizontalAlignment = HorizontalAlignment.Center } };+ var b = new Border { Background = Card, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Padding = new Thickness(0, 3), HorizontalAlignment = HorizontalAlignment.Stretch, Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = label, FontSize = 9, Foreground = Sub, HorizontalAlignment = HorizontalAlignment.Center } };b.PointerPressed += (_, _) => { onClick(); Refresh(); };return b;}@@ -134,22 +124,22 @@ internal sealed class ScaleMidiBody : IMidiDeviceBody// ---- LIVE strip ----var rootName = Mono("C", Txt); rootName.Width = 20; rootName.TextAlignment = TextAlignment.Center;- Border StepBtn(string t, int dir)+ Border StepBtn(GlyphKind t, int dir){- var b = new Border { Width = 16, CornerRadius = new CornerRadius(3), BorderBrush = Bd, BorderThickness = new Thickness(1), Background = Card, Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = t, FontSize = 9, Foreground = Sub, HorizontalAlignment = HorizontalAlignment.Center }, VerticalAlignment = VerticalAlignment.Center };+ var b = new Border { Width = 16, CornerRadius = NotaRadius.Badge, BorderBrush = Bd, BorderThickness = new Thickness(1), Background = Card, Cursor = new Cursor(StandardCursorType.Hand), Child = new Glyph(t, 8) { Foreground = Sub }, VerticalAlignment = VerticalAlignment.Center };b.PointerPressed += (_, _) => { S(PRoot, ((Root() + dir) % 12 + 12) % 12); Refresh(); };return b;}readouts.Add(() => rootName.Text = Notes[Root()]);- var rootStepper = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 3, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("ROOT"), StepBtn("◂", -1), rootName, StepBtn("▸", +1) } };+ var rootStepper = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 3, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("ROOT"), StepBtn(GlyphKind.ChevronLeft, -1), rootName, StepBtn(GlyphKind.ChevronRight, +1) } };// scale chips (highlight the preset matching PScale, or Custom)var chipArr = new Border[Chips.Length];void ChipsHi() { int sc = Gi(PScale); for (int i = 0; i < Chips.Length; i++) { bool on = Chips[i].idx == sc || (sc >= Custom && Chips[i].idx == Custom); chipArr[i].Background = on ? Amber : Brushes.Transparent; ((TextBlock)chipArr[i].Child!).Foreground = on ? Ink : Muted; } }var chipRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < Chips.Length; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = Chips[i].name, FontSize = 9, Foreground = Muted } }; c.PointerPressed += (_, _) => { S(PScale, Chips[iv].idx); Refresh(); }; chipArr[i] = c; chipRow.Children.Add(c); }+ for (int i = 0; i < Chips.Length; i++) { int iv = i; var c = new Border { CornerRadius = NotaRadius.Badge, Padding = new Thickness(7, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = Chips[i].name, FontSize = 9, Foreground = Muted } }; c.PointerPressed += (_, _) => { S(PScale, Chips[iv].idx); Refresh(); }; chipArr[i] = c; chipRow.Children.Add(c); }readouts.Add(ChipsHi); ChipsHi();- var scaleChips = new Border { Background = Inset, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = chipRow };+ var scaleChips = new Border { Background = Inset, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = chipRow };var foldSeg = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Right, Children = { Cap("FOLD"), Seg(PFold, Folds) } };var liveL = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center, Children = { rootStepper, scaleChips } };@@ -167,9 +157,9 @@ internal sealed class ScaleMidiBody : IMidiDeviceBodyfor (int pc = 0; pc < 12; pc++){int iv = pc;- var nlbl = new TextBlock { Text = Notes[pc], FontSize = 11, FontWeight = FontWeight.SemiBold, HorizontalAlignment = HorizontalAlignment.Center };+ var nlbl = new TextBlock { Text = Notes[pc], FontSize = 9, FontWeight = FontWeight.SemiBold, HorizontalAlignment = HorizontalAlignment.Center };var arrow = Mono("", Teal, 8); arrow.HorizontalAlignment = HorizontalAlignment.Center;- var cell = new Border { Margin = new Thickness(2), CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand), Child = new StackPanel { VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center, Spacing = 1, Children = { nlbl, arrow } } };+ var cell = new Border { Margin = new Thickness(2), CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand), Child = new StackPanel { VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center, Spacing = 1, Children = { nlbl, arrow } } };cell.PointerPressed += (_, _) => { MakeCustom(); int rel = ((iv - Root()) % 12 + 12) % 12; S(PMask0 + rel, (G(PMask0 + rel) >= 0.5f) ? 0 : 1); Refresh(); };readouts.Add(() =>{@@ -186,17 +176,17 @@ internal sealed class ScaleMidiBody : IMidiDeviceBodyDockPanel.SetDock(mapHead, Dock.Top); mapDock.Children.Add(mapHead); mapDock.Children.Add(new Border { Margin = new Thickness(0, 4, 0, 0), Child = grid });// ---- right rail ----- var inTxt = Mono("—", Sub, 11); var arrTxt = new TextBlock { Text = "→", FontSize = 10, Foreground = Teal, VerticalAlignment = VerticalAlignment.Center };+ var inTxt = Mono("—", Sub, 11); var arrTxt = new TextBlock { Text = "→", FontSize = 9, Foreground = Teal, VerticalAlignment = VerticalAlignment.Center };var outTxt = Mono("—", AmberLit, 11); var distTxt = Mono("", Muted, 8); distTxt.HorizontalAlignment = HorizontalAlignment.Right;var ioInner = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,Auto,*") };var ioCells = new Control[] { inTxt, arrTxt, outTxt, distTxt };for (int c = 0; c < ioCells.Length; c++) { Grid.SetColumn(ioCells[c], c); ((Control)ioCells[c]).Margin = new Thickness(c == 0 ? 0 : 4, 0, 0, 0); ioInner.Children.Add(ioCells[c]); }- var ioBox = new Border { Background = Inset, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(7, 5), Child = ioInner };+ var ioBox = new Border { Background = Inset, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(7, 5), Child = ioInner };readouts.Add(() =>{int li = engine.MidiEffectLastIn(track, mi), lo = engine.MidiEffectLastOut(track, mi);if (li < 0) { inTxt.Text = "—"; outTxt.Text = "—"; distTxt.Text = ""; }- else { inTxt.Text = NoteName(li); outTxt.Text = NoteName(lo); int d = lo - li; distTxt.Text = d == 0 ? "0" : (d > 0 ? "+" : "−") + Math.Abs(d) + " st"; }+ else { inTxt.Text = NoteName(li); outTxt.Text = NoteName(lo); int d = lo - li; distTxt.Text = d == 0 ? "0" : (d > 0 ? "+" : "−") + Math.Abs(d) + "\u2009st"; }});var rangeRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("RANGE"), PitchDrag(PRangeLo, 30), new TextBlock { Text = "–", FontSize = 9, Foreground = Muted, VerticalAlignment = VerticalAlignment.Center }, PitchDrag(PRangeHi, 30) } };var followKey = Toggle(PFollowKey, "FOLLOW KEY", Teal);diff --git a/src/managed/Nota.App/DeviceCards/Midi/VelocityMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/VelocityMidiBody.csindex 81d4683d..4500abcf 100644--- a/src/managed/Nota.App/DeviceCards/Midi/VelocityMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/VelocityMidiBody.cs@@ -69,30 +69,16 @@ internal sealed class VelocityMidiBody : IMidiDeviceBody// ---- generic controls ----Control MiniSlider(string label, int p, double min, double max, Func<double, string> fmt, double w){- var val = Mono(fmt(G(p)), Txt); val.MinWidth = 26;- var fill = new Border { Height = 3, Background = Amber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 7, Height = 9, Background = Sub, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Width = w, Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent };- slot.Children.Add(new Border { Height = 3, Background = Inset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center });- slot.Children.Add(fill); slot.Children.Add(handle);- void Vis(double v) { double n = (v - min) / (max - min); fill.Width = n * w; handle.Margin = new Thickness(Math.Clamp(n * w - 3.5, 0, w - 7), 0, 0, 0); }- bool drag = false;- void SetX(double x) { double n = Math.Clamp(x / w, 0, 1); double v = min + n * (max - min); S(p, v); Vis(v); val.Text = fmt(v); Refresh(); }- slot.PointerPressed += (_, e) => { drag = true; e.Pointer.Capture(slot); SetX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); } };- MidiLearn.Bind(slot, MidiTarget.MidiDeviceParam(track, mi, p), engine.MidiEffectParamName(track, mi, p));- readouts.Add(() => { if (!drag) { double v = G(p); Vis(v); val.Text = fmt(v); } });- return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap(label), slot, val } };+ var row = DeviceCardKit.SliderRow(label, () => (G(p) - min) / (max - min), n => { S(p, min + n * (max - min)); Refresh(); }, () => fmt(G(p)), out var sync,+ trackWidth: w, valueWidth: 26);+ MidiLearn.Bind(row, MidiTarget.MidiDeviceParam(track, mi, p), engine.MidiEffectParamName(track, mi, p));+ readouts.Add(sync);+ return row;}Control Seg(int p, string[] names, Action<int>? extra = null, double fs = 9, double padX = 7){- var arr = new Border[names.Length];- void Hi() { int cur = Math.Clamp(Gi(p), 0, names.Length - 1); for (int i = 0; i < names.Length; i++) { bool on = i == cur; arr[i].Background = on ? Amber : Brushes.Transparent; ((TextBlock)arr[i].Child!).Foreground = on ? Ink : Muted; } }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1 };- for (int i = 0; i < names.Length; i++) { int iv = i; var c = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(padX, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = names[i], FontSize = fs, FontWeight = FontWeight.SemiBold, Foreground = Muted } }; c.PointerPressed += (_, _) => { S(p, iv); extra?.Invoke(iv); Refresh(); }; arr[i] = c; row.Children.Add(c); }- readouts.Add(Hi); Hi();- var seg = new Border { Background = Inset, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ var seg = DeviceCardKit.Segments(names, () => Math.Clamp(Gi(p), 0, names.Length - 1), iv => { S(p, iv); extra?.Invoke(iv); Refresh(); }, out var sync);+ readouts.Add(sync);MidiLearn.Bind(seg, MidiTarget.MidiDeviceParam(track, mi, p), engine.MidiEffectParamName(track, mi, p));return seg;}@@ -125,7 +111,7 @@ internal sealed class VelocityMidiBody : IMidiDeviceBodyvar transDock = new DockPanel { LastChildFill = true };DockPanel.SetDock(transHead, Dock.Top); DockPanel.SetDock(axis, Dock.Bottom);transDock.Children.Add(transHead); transDock.Children.Add(axis); transDock.Children.Add(viz);- var transPanel = new Border { Background = Inset, BorderBrush = NotaPalette.GraphBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(8, 4), Margin = new Thickness(8, 7), Child = transDock };+ var transPanel = new Border { Background = Inset, BorderBrush = NotaPalette.GraphBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(8, 4), Margin = new Thickness(8, 7), Child = transDock };readouts.Add(() =>{@@ -148,7 +134,7 @@ internal sealed class VelocityMidiBody : IMidiDeviceBodyvar rangeFill = new Border { Background = NotaPalette.Wash(NotaPalette.Accent, 0x73), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Stretch };var rangeBar = new Panel { Height = 8, Background = Inset, Cursor = new Cursor(StandardCursorType.Hand) };rangeBar.Children.Add(rangeFill);- var rangeClip = new Border { Height = 8, CornerRadius = new CornerRadius(4), ClipToBounds = true, Child = rangeBar };+ var rangeClip = new Border { Height = 8, CornerRadius = NotaRadius.Control, ClipToBounds = true, Child = rangeBar };int rDrag = 0; // 1 = lo, 2 = hivoid RangeVis() { double W = rangeBar.Bounds.Width, lo = G(POutLo), hi = G(POutHi); rangeFill.Margin = new Thickness(lo * W, 0, 0, 0); rangeFill.Width = Math.Max(0, (hi - lo) * W); loT.Text = $"{Math.Max(1, lo * 127):0}"; hiT.Text = $"{hi * 127:0}"; }void RangeX(double x) { double n = Math.Clamp(x / Math.Max(1, rangeBar.Bounds.Width), 0, 1); if (rDrag == 1) S(POutLo, Math.Min(n, G(POutHi))); else S(POutHi, Math.Max(n, G(POutLo))); RangeVis(); Refresh(); }@@ -159,21 +145,16 @@ internal sealed class VelocityMidiBody : IMidiDeviceBodyreadouts.Add(() => { if (rDrag == 0) RangeVis(); });// RANDOM ON toggle (amount lives in the strip; this gates it, remembering the amount).- var rndTrk = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), Background = Inset };- var rndKnob = new Ellipse { Width = 6, Height = 6, Fill = Muted, HorizontalAlignment = HorizontalAlignment.Left, Margin = new Thickness(2, 0, 0, 0), VerticalAlignment = VerticalAlignment.Center };- rndTrk.Child = rndKnob;- var rndLbl = Cap("RANDOM ON", Teal);- void RndSync() { bool on = G(PRandom) > 0; rndTrk.Background = on ? Teal : Inset; rndKnob.Fill = on ? Ink : Muted; rndKnob.HorizontalAlignment = on ? HorizontalAlignment.Right : HorizontalAlignment.Left; rndKnob.Margin = new Thickness(on ? 0 : 2, 0, on ? 2 : 0, 0); rndLbl.Foreground = on ? Teal : Muted; if (on) lastRnd = G(PRandom); }- var rndToggle = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand), Children = { rndTrk, rndLbl } };- rndToggle.PointerPressed += (_, _) => { if (G(PRandom) > 0) S(PRandom, 0); else S(PRandom, lastRnd > 0 ? lastRnd : 0.2); Refresh(); };- readouts.Add(RndSync); RndSync();+ var rndToggle = DeviceCardKit.Switch("Random", () => G(PRandom) > 0,+ () => { if (G(PRandom) > 0) S(PRandom, 0); else S(PRandom, lastRnd > 0 ? lastRnd : 0.2); Refresh(); }, out var rndSync);+ readouts.Add(rndSync);var dirRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { Cap("MODE"), Seg(PRandomDir, Dirs, null, 8, 6) } };// LAST 12 NOTES histogram.var bars = new Border[12];var barRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2, Height = 22, VerticalAlignment = VerticalAlignment.Bottom };- for (int i = 0; i < 12; i++) { bars[i] = new Border { Width = 9, CornerRadius = new CornerRadius(1), VerticalAlignment = VerticalAlignment.Bottom, Background = AmberDim, Height = 2 }; barRow.Children.Add(bars[i]); }+ for (int i = 0; i < 12; i++) { bars[i] = new Border { Width = 9, CornerRadius = NotaRadius.Bar, VerticalAlignment = VerticalAlignment.Bottom, Background = AmberDim, Height = 2 }; barRow.Children.Add(bars[i]); }readouts.Add(() =>{for (int i = 0; i < 12; i++)diff --git a/src/managed/Nota.App/DeviceCards/Rack/RackCardView.cs b/src/managed/Nota.App/DeviceCards/Rack/RackCardView.csindex bc4da694..0071a270 100644--- a/src/managed/Nota.App/DeviceCards/Rack/RackCardView.cs+++ b/src/managed/Nota.App/DeviceCards/Rack/RackCardView.cs@@ -46,7 +46,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)private static readonly IBrush IrTeal = NotaPalette.Teal;private static readonly IBrush IrTxt = NotaPalette.TextPrimary;private static readonly IBrush IrMuted = NotaPalette.TextTertiary;- private static readonly IBrush IrRed = NotaPalette.Danger;+ private static readonly IBrush IrRed = NotaPalette.AccentHover; // a state, not an alert: red is kept for recording and overloadprivate static bool _macroMapMode; // Instrument Rack: second (Macro-map) viewprivate static int _splitAxis; // 0 = Key zone, 1 = Velocityprivate static bool _drumMixer; // Drum Rack: false = Pads view, true = Mixer view@@ -78,7 +78,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)_irTick.Clear();Control content = _macroMapMode ? InstrumentRackMacroMap(a) : InstrumentRackMain(a);if (_irTick.Count > 0) _ctx.AddDeviceRefresher(() => { for (int i = 0; i < _irTick.Count; i++) _irTick[i](); });- return new Border { Width = 700, Height = 260, Background = NotaPalette.BgApp, BorderBrush = IrBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(8), ClipToBounds = true, Child = content };+ return new Border { Width = 700, Height = 260, Background = NotaPalette.BgApp, BorderBrush = IrBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Body, ClipToBounds = true, Child = content };}private Control InstrumentRackMain(IRackAccess a)@@ -93,24 +93,21 @@ internal sealed class RackCardView(DeviceCardContext ctx)return new DockPanel { LastChildFill = true, Children = { header, strip, body } };}- // ---- header (26) ----+ // ---- header (22) ----+ // The almanac device header (22): name left; a mono caps badge right. Nothing else — the+ // rack's level is on the track meter, and its view switches live in its LIVE strip.+ private static Control RackHeader(string name, string badge)+ {+ var nameTb = new TextBlock { Text = name, FontSize = NotaType.DeviceName, FontWeight = FontWeight.SemiBold, Foreground = IrTxt, VerticalAlignment = VerticalAlignment.Center };+ var badgeTb = new TextBlock { Text = badge, FontFamily = NotaFonts.MonoFamily, FontSize = NotaType.Eyebrow, FontWeight = FontWeight.Medium, LetterSpacing = 1.2, Foreground = IrMuted, VerticalAlignment = VerticalAlignment.Center, [DockPanel.DockProperty] = Dock.Right };+ var dp = new DockPanel { LastChildFill = false, Margin = new Thickness(NotaSpace.DeviceInsetWide, 0), Children = { badgeTb, nameTb } };+ return new Border { Height = DeviceCardKit.HeaderH, Background = IrHdr, BorderBrush = IrBorder, BorderThickness = new Thickness(0, 0, 0, 1), Child = dp };+ }+private Control IrHeader(IRackAccess a, string mode){int chains = a.ChainCount();- var left = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, VerticalAlignment = VerticalAlignment.Center, Children = {- new Border { Width = 6, Height = 6, CornerRadius = new CornerRadius(3), Background = Success, VerticalAlignment = VerticalAlignment.Center },- new TextBlock { Text = "Nota Instrument Rack", FontSize = 11, FontWeight = FontWeight.SemiBold, Foreground = IrTxt, VerticalAlignment = VerticalAlignment.Center },- new TextBlock { Text = $"{chains} CHAIN{(chains == 1 ? "" : "S")}", FontSize = 9, FontWeight = FontWeight.Bold, Foreground = IrMuted, VerticalAlignment = VerticalAlignment.Center } } };- // Little stereo meter fed by the loudest chain.- var mL = new Border { Height = 3, Background = Success, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center, CornerRadius = new CornerRadius(2) };- var mR = new Border { Height = 3, Background = Success, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center, CornerRadius = new CornerRadius(2) };- var mBg1 = new Panel { Height = 3, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = new CornerRadius(2) }, mL } };- var mBg2 = new Panel { Height = 3, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = new CornerRadius(2) }, mR } };- var meter = new StackPanel { Width = 46, Spacing = 2, VerticalAlignment = VerticalAlignment.Center, Children = { mBg1, mBg2 } };- _irTick.Add(() => { float pk = 0; for (int c = 0; c < a.ChainCount(); c++) pk = Math.Max(pk, E.RackChainMeter(T, c)); double w = 46 * Math.Clamp(pk, 0, 1); mL.Width = w; mR.Width = w * 0.94; });- var right = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, VerticalAlignment = VerticalAlignment.Center, [DockPanel.DockProperty] = Dock.Right, Children = { meter } };- var dp = new DockPanel { LastChildFill = false, Margin = new Thickness(9, 0), Children = { left, right } };- return new Border { Height = 26, Background = IrHdr, BorderBrush = IrBorder, BorderThickness = new Thickness(0, 0, 0, 1), Child = dp };+ return RackHeader("Nota Instrument Rack", $"RACK · {chains} CHAIN{(chains == 1 ? "" : "S")}");}// ---- macro strip (34): 8 named horizontal macro sliders ----@@ -135,9 +132,9 @@ internal sealed class RackCardView(DeviceCardContext ctx)for (int m = 0; m < a.MappingCount(); m++) if (a.TryGetMapping(m, out var mm) && mm.Macro == i) { mapped = true; break; }var name = new TextBlock { Text = a.MacroName(i), FontSize = 8, Foreground = mapped ? IrTxt : IrMuted, TextTrimming = TextTrimming.CharacterEllipsis, VerticalAlignment = VerticalAlignment.Center };var val = IrMono("0", IrMuted, 8); val.TextAlignment = TextAlignment.Right;- var fill = new Border { Height = 3, Background = mapped ? IrAmber : NotaPalette.TextDisabled, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 6, Height = 8, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Height = 10, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center }, fill, handle } };+ var fill = new Border { Height = 3, Background = mapped ? IrAmber : NotaPalette.TextDisabled, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var handle = new Border { Width = 6, Height = 8, Background = NotaPalette.TextSecondary, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var slot = new Panel { Height = 10, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = NotaRadius.Clip, VerticalAlignment = VerticalAlignment.Center }, fill, handle } };void Vis(double v) { double W = slot.Bounds.Width; fill.Width = v * W; handle.Margin = new Thickness(Math.Clamp(v * W - 3, 0, Math.Max(0, W - 6)), 0, 0, 0); }bool drag = false;void SetFromX(double x) { double v = Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1); E.PluginParamSet(T, adi, i, (float)v); Vis(v); _ctx.InvokeRackParamRefreshers(); }@@ -169,7 +166,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)var rows = new StackPanel { Spacing = 4 };int chains = a.ChainCount();for (int c = 0; c < chains; c++) rows.Children.Add(IrChainRow(a, c));- var addBtn = new Border { BorderBrush = NotaPalette.BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(0, 3),+ var addBtn = new Border { BorderBrush = NotaPalette.BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(0, 3),Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = "+ Add chain", FontSize = 9, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center } };addBtn.PointerPressed += (_, _) => ShowAddChainMenu(a, addBtn);rows.Children.Add(addBtn);@@ -195,8 +192,8 @@ internal sealed class RackCardView(DeviceCardContext ctx)var vel = IrMono($"{vLo}–{vHi}", IrMuted);double db = a.ChainGain(c) <= 0.001 ? -60 : 20 * Math.Log10(a.ChainGain(c));var dbT = IrMono(db <= -59 ? "−∞" : $"{db:+0.0;−0.0;0.0}", NotaPalette.TextSecondary);- var meterFill = new Border { Background = Success, HorizontalAlignment = HorizontalAlignment.Left, CornerRadius = new CornerRadius(1) };- var meter = new Border { Width = 20, Height = 3, Background = IrInset, CornerRadius = new CornerRadius(1), Child = meterFill, VerticalAlignment = VerticalAlignment.Center };+ var meterFill = new Border { Background = Success, HorizontalAlignment = HorizontalAlignment.Left, CornerRadius = NotaRadius.Bar };+ var meter = new Border { Width = 20, Height = 3, Background = IrInset, CornerRadius = NotaRadius.Bar, Child = meterFill, VerticalAlignment = VerticalAlignment.Center };_irTick.Add(() => meterFill.Width = 20 * Math.Clamp(E.RackChainMeter(T, c), 0, 1));var m = IrMsBtn("M", a.ChainMute(c), IrRed, () => { a.SetChainMute(c, !a.ChainMute(c)); _ctx.RequestRebuild(); });var s = IrMsBtn("S", a.ChainSolo(c), IrAmber, () => { a.SetChainSolo(c, !a.ChainSolo(c)); _ctx.RequestRebuild(); });@@ -205,11 +202,11 @@ internal sealed class RackCardView(DeviceCardContext ctx)var info = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, VerticalAlignment = VerticalAlignment.Center, Children = { zone, vel, WithRight(dbT), meter, m, s } };DockPanel.SetDock(dbT, Dock.Right);- var row = new Border { Background = sel ? RowSel : IrCard, BorderBrush = sel ? IrAmber : IrBorder, BorderThickness = new Thickness(1, 1, 1, 1), CornerRadius = new CornerRadius(4), Padding = new Thickness(6, 4), Cursor = new Cursor(StandardCursorType.Hand),+ var row = new Border { Background = sel ? RowSel : IrCard, BorderBrush = sel ? IrAmber : IrBorder, BorderThickness = new Thickness(1, 1, 1, 1), CornerRadius = NotaRadius.Control, Padding = new Thickness(6, 4), Cursor = new Cursor(StandardCursorType.Hand),Child = new StackPanel { Spacing = 3, Children = { head, info } } };row.Background = sel ? RowSel : IrCard;// left accent = chain hue, hidden while selected (the amber selection is enough).- var accent = new Border { Width = 2, Background = sel ? Brushes.Transparent : ChainHue(c), CornerRadius = new CornerRadius(2, 0, 0, 2) };+ var accent = new Border { Width = 2, Background = sel ? Brushes.Transparent : ChainHue(c), CornerRadius = new CornerRadius(NotaRadius.ClipValue, 0, 0, NotaRadius.ClipValue) };var wrap = new DockPanel { LastChildFill = true, Children = { accent, row } };DockPanel.SetDock(accent, Dock.Left);wrap.PointerPressed += (_, e) => { if (e.GetCurrentPoint(wrap).Properties.IsLeftButtonPressed && Sel != c) { Sel = c; _ctx.RequestRebuild(); } };@@ -224,11 +221,11 @@ internal sealed class RackCardView(DeviceCardContext ctx)private Control IrDeviceArea(IRackAccess a){if (a.ChainCount() == 0)- return new Border { Padding = new Thickness(9, 7), Child = new TextBlock { Text = "Add a chain to build its device chain.", FontSize = 10, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center } };+ return new Border { Padding = new Thickness(9, 7), Child = new TextBlock { Text = "Add a chain to build its device chain.", FontSize = 9, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center } };int sc = Sel;string inm = a.ChainInstrumentName(sc); if (string.IsNullOrEmpty(inm)) inm = "Instrument";var hdr = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 0, 7), Children = {- new Border { Width = 7, Height = 7, CornerRadius = new CornerRadius(2), Background = ChainHue(sc), VerticalAlignment = VerticalAlignment.Center },+ new Border { Width = 7, Height = 7, CornerRadius = NotaRadius.Clip, Background = ChainHue(sc), VerticalAlignment = VerticalAlignment.Center },new TextBlock { Text = inm, FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = IrTxt, VerticalAlignment = VerticalAlignment.Center },new TextBlock { Text = "chain devices · signal left → right", FontSize = 8, Foreground = IrMuted, VerticalAlignment = VerticalAlignment.Center } } };var slots = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5 };@@ -249,30 +246,32 @@ internal sealed class RackCardView(DeviceCardContext ctx)private Border IrSlot(IBrush dot, string name, string kind, bool dim, Action openGui, Action openParams, Control footerLeft, Action? onDelete = null){var head = new DockPanel { LastChildFill = true, Height = 18, Children = {- new Border { Width = 6, Height = 6, CornerRadius = new CornerRadius(3), Background = dot, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 4, 0), [DockPanel.DockProperty] = Dock.Left },+ new Border { Width = 6, Height = 6, CornerRadius = NotaRadius.Badge, Background = dot, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 4, 0), [DockPanel.DockProperty] = Dock.Left },WithRight(new TextBlock { Text = kind, FontSize = 7, FontWeight = FontWeight.Bold, Foreground = IrMuted, VerticalAlignment = VerticalAlignment.Center }),new TextBlock { Text = name, FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = IrTxt, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis } } };if (onDelete != null) head.Children.Insert(1, WithRight(SlotDelBtn(onDelete)));var headWrap = new Border { BorderBrush = IrBorder, BorderThickness = new Thickness(0, 0, 0, 1), Padding = new Thickness(6, 0), Child = head };Border MiniBtn(string label, Action act){- var b = new Border { BorderThickness = new Thickness(1), BorderBrush = IrBorder, Background = IrInset, CornerRadius = new CornerRadius(3), Padding = new Thickness(6, 2), Cursor = new Cursor(StandardCursorType.Hand),+ var b = new Border { BorderThickness = new Thickness(1), BorderBrush = IrBorder, Background = IrInset, CornerRadius = NotaRadius.Badge, Padding = new Thickness(6, 2), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = label, FontSize = 8, Foreground = NotaPalette.TextSecondary, HorizontalAlignment = HorizontalAlignment.Center } };b.PointerPressed += (_, e) => { e.Handled = true; act(); };return b;}- var center = new StackPanel { VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center, Spacing = 4, Children = { MiniBtn("▤ GUI", openGui), MiniBtn("≡ Params", openParams) } };+ var center = new StackPanel { VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center, Spacing = 4, Children = { MiniBtn("GUI", openGui), MiniBtn("Params", openParams) } };var footer = new Border { Height = 14, BorderBrush = IrBorder, BorderThickness = new Thickness(0, 1, 0, 0), Padding = new Thickness(6, 0), Child =- new DockPanel { LastChildFill = true, Children = { WithRight(new TextBlock { Text = "⠿", FontSize = 8, Foreground = IrMuted, VerticalAlignment = VerticalAlignment.Center }), footerLeft } } };+ new DockPanel { LastChildFill = true, Children = { WithRight(new Glyph(GlyphKind.Grip, 8) { Foreground = IrMuted }), footerLeft } } };DockPanel.SetDock(headWrap, Dock.Top); DockPanel.SetDock(footer, Dock.Bottom);- return new Border { Width = 96, Background = IrCard, BorderBrush = IrBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), ClipToBounds = true, Opacity = dim ? 0.6 : 1.0,+ var slotCard = new Border { Width = 96, Background = IrCard, BorderBrush = IrBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, ClipToBounds = true,Child = new DockPanel { LastChildFill = true, Children = { headWrap, footer, center } } };+ if (dim) slotCard.AttachedToVisualTree += (_, _) => Inactive.Set(slotCard, true, interactive: true); // no opacity for state+ return slotCard;}// Small borderless ✕ in a device slot header that removes that device from the chain.private Border SlotDelBtn(Action onDelete){- var glyph = new TextBlock { Text = "✕", FontSize = 8, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };+ var glyph = new Glyph(GlyphKind.Close, 8) { Foreground = IrMuted };var b = new Border { Width = 13, Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Stretch, Child = glyph };ToolTip.SetTip(b, "Remove device");b.PointerEntered += (_, _) => glyph.Foreground = IrRed;@@ -315,7 +314,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)private Control IrAddDeviceSlot(IRackAccess a, int sc){- var plus = new TextBlock { Text = "+", FontSize = 13, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center };+ var plus = new Glyph(GlyphKind.Plus, 10) { Foreground = IrMuted };var lbl = new TextBlock { Text = "Device", FontSize = 8, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center };var dash = new Avalonia.Controls.Shapes.Rectangle { Stroke = DashIdle, StrokeThickness = 1, StrokeDashArray = new Avalonia.Collections.AvaloniaList<double> { 3, 2.5 }, RadiusX = 6, RadiusY = 6 };var box = new Panel { Width = 52, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent,@@ -378,24 +377,24 @@ internal sealed class RackCardView(DeviceCardContext ctx)else E.RackSetChainZone(T, c, kLo, kHi, lo, hi);_ctx.RequestRebuild();};- return new Border { Height = 38, Background = IrInset, BorderBrush = IrField, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(4), Margin = new Thickness(0, 5, 0, 0), Child = map };+ return new Border { Height = 38, Background = IrInset, BorderBrush = IrField, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(4), Margin = new Thickness(0, 5, 0, 0), Child = map };}// ---- rack rail (96): volume · glide · macro-map · fold/save ----private Control IrRackRail(IRackAccess a){- var volVal = IrMono("0.0 dB", IrTxt, 9); volVal.HorizontalAlignment = HorizontalAlignment.Center;+ var volVal = IrMono("0.0\u2009dB", IrTxt, 9); volVal.HorizontalAlignment = HorizontalAlignment.Center;var vol = new Knob(Math.Clamp(E.RackVolume(T) / 2.0, 0, 1), 1.0) { Accent = true, Width = 40, Height = 40, HorizontalAlignment = HorizontalAlignment.Center };- string VolDb(double lin) => lin <= 0.001 ? "−∞ dB" : $"{20 * Math.Log10(lin):+0.0;−0.0;0.0} dB";+ string VolDb(double lin) => lin <= 0.001 ? "−∞\u2009dB" : $"{20 * Math.Log10(lin):+0.0;−0.0;0.0}\u2009dB";vol.ValueChanged += v => { E.RackSetVolume(T, (float)(v * 2.0)); volVal.Text = VolDb(v * 2.0); };volVal.Text = VolDb(E.RackVolume(T));MidiLearn.Bind(vol, MidiTarget.RackVolume(T, a.AutomationDeviceIndex), "Rack Volume");var volCell = new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, Children = { IrCap("VOLUME"), vol, volVal } };- var glideVal = IrMono("0 ms", IrTxt, 8); glideVal.VerticalAlignment = VerticalAlignment.Center;- var gFill = new Border { Height = 3, Background = IrAmber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var gSlot = new Panel { Height = 8, MinWidth = 30, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center }, gFill } };- string GlideMs(double v) => $"{v * 500:0} ms";+ var glideVal = IrMono("0\u2009ms", IrTxt, 8); glideVal.VerticalAlignment = VerticalAlignment.Center;+ var gFill = new Border { Height = 3, Background = IrAmber, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var gSlot = new Panel { Height = 8, MinWidth = 30, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = NotaRadius.Clip, VerticalAlignment = VerticalAlignment.Center }, gFill } };+ string GlideMs(double v) => $"{v * 500:0}\u2009ms";void GUpd() { double v = E.RackGlide(T); gFill.Width = v * gSlot.Bounds.Width; glideVal.Text = GlideMs(v); }bool gd = false; void GSet(double x) { double v = Math.Clamp(x / Math.Max(1, gSlot.Bounds.Width), 0, 1); E.RackSetGlide(T, (float)v); GUpd(); }gSlot.PointerPressed += (_, e) => { gd = true; e.Pointer.Capture(gSlot); GSet(e.GetPosition(gSlot).X); };@@ -404,7 +403,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)_irTick.Add(() => { if (!gd) GUpd(); });var glideRow = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 4, Children = { IrCap("GLIDE"), WithCol(gSlot, 1), WithCol(glideVal, 2) } };- var mapBtn = new Border { BorderBrush = IrTeal, BorderThickness = new Thickness(1), Background = NotaPalette.Wash(NotaPalette.Teal, 0x24), CornerRadius = new CornerRadius(4), Padding = new Thickness(0, 3), Cursor = new Cursor(StandardCursorType.Hand),+ var mapBtn = new Border { BorderBrush = IrTeal, BorderThickness = new Thickness(1), Background = NotaPalette.Wash(NotaPalette.Teal, 0x24), CornerRadius = NotaRadius.Control, Padding = new Thickness(0, 3), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = "MACRO MAP", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = IrTeal, HorizontalAlignment = HorizontalAlignment.Center, TextAlignment = TextAlignment.Center } };mapBtn.PointerPressed += (_, _) => { _macroMapMode = true; _ctx.RequestRebuild(); };@@ -445,7 +444,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)_ => { }, () => 0, _ => { }, tickReg, () => { }, () => { }, _ => { }, () => { });var body = _irFactory.Resolve(ik, true).Build(ctx);tickReg(() => { viz?.Invoke(); foreach (var f in faders) { if (f.k.Dragging) continue; float v = proxy.PluginParamGet(T, -1, f.i); if (Math.Abs(v - f.k.Value) > 1e-3) { f.k.Value = v; f.v.Text = (f.fmt ?? Pct)(v); } } });- return new Border { Width = 700, Height = 234, Background = NotaPalette.BgApp, ClipToBounds = true, Child = body };+ return new Border { Width = 700, Height = DeviceCardKit.CardH - DeviceCardKit.HeaderH, Background = NotaPalette.BgApp, ClipToBounds = true, Child = body };}// Sampler pop-out that also accepts a dropped sample file (browser or Finder) → load it@@ -460,7 +459,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)void Rebuild(){ticks.Clear();- var wrap = new Border { Width = 700, Height = 234, Background = NotaPalette.BgApp, ClipToBounds = true, Child = SamplerInstrumentCard.BuildEditor(E, acc, ticks.Add) };+ var wrap = new Border { Width = 700, Height = DeviceCardKit.CardH - DeviceCardKit.HeaderH, Background = NotaPalette.BgApp, ClipToBounds = true, Child = SamplerInstrumentCard.BuildEditor(E, acc, ticks.Add) };DragDrop.SetAllowDrop(wrap, true);DragDrop.AddDragOverHandler(wrap, (_, e) => { if (!BrowserView.IsAcceptableDrag(e)) { e.DragEffects = DragDropEffects.None; return; } e.DragEffects = DragDropEffects.Copy; e.Handled = true; });DragDrop.AddDropHandler(wrap, (_, e) => { foreach (var it in BrowserView.DroppedItems(e)) if (it.Kind == Nota.Presentation.BrowserItemKind.Sample) { acc.LoadSample(it.Path); Rebuild(); break; } e.Handled = true; });@@ -493,7 +492,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)var pp = (RackChainDeviceEngineProxy)(object)proxy; pp.Inner = E; pp.Access = a; pp.Chain = sc; pp.Dev = d;var ctx = new DeviceCardContext(proxy, T, tickReg, () => { }, (_, _, _, _) => { }, _ => { }, _ => { }, () => sc, _ => { }, tickReg, () => { }, () => { }, _ => { }, () => { });var body = _irDeviceFactory.Resolve(kind).Build(ctx, a.AutomationDeviceIndex);- return new Border { Width = 700, Height = 234, Background = NotaPalette.BgApp, ClipToBounds = true, Child = body };+ return new Border { Width = 700, Height = DeviceCardKit.CardH - DeviceCardKit.HeaderH, Background = NotaPalette.BgApp, ClipToBounds = true, Child = body };}private void OpenChainDeviceParams(IRackAccess a, int sc, int d, Control anchor){@@ -520,25 +519,25 @@ internal sealed class RackCardView(DeviceCardContext ctx)for (int i = 0; i < names.Length; i++){int iv = i; bool on = i == sel;- var c = new Border { CornerRadius = new CornerRadius(2), Padding = new Thickness(6, 1), Cursor = new Cursor(StandardCursorType.Hand), Background = on ? IrAmber : Brushes.Transparent,- Child = new TextBlock { Text = names[i], FontSize = 8, FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal, Foreground = on ? NotaPalette.BgApp : IrMuted } };+ var c = new Border { CornerRadius = NotaRadius.Clip, Padding = new Thickness(6, 1), Cursor = new Cursor(StandardCursorType.Hand), Background = on ? IrAmber : Brushes.Transparent,+ Child = new TextBlock { Text = names[i], FontSize = 8, FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal, Foreground = on ? NotaPalette.TextOnAccent : IrMuted } };c.PointerPressed += (_, _) => onSel(iv);row.Children.Add(c);}- return new Border { Background = IrInset, BorderBrush = IrBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };+ return new Border { Background = IrInset, BorderBrush = IrBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row };}private Border IrMsBtn(string t, bool on, IBrush accent, Action onClick){- var b = new Border { MinWidth = 13, Height = 12, CornerRadius = new CornerRadius(2), BorderThickness = new Thickness(1), BorderBrush = on ? accent : NotaPalette.BorderStrong, Background = on ? accent : IrCard, Cursor = new Cursor(StandardCursorType.Hand),- Child = new TextBlock { Text = t, FontSize = 7, FontWeight = FontWeight.Bold, Foreground = on ? NotaPalette.BgApp : NotaPalette.TextSecondary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Padding = new Thickness(3, 0) } };+ var b = new Border { MinWidth = 13, Height = 12, CornerRadius = NotaRadius.Clip, BorderThickness = new Thickness(1), BorderBrush = on ? accent : NotaPalette.BorderStrong, Background = on ? accent : IrCard, Cursor = new Cursor(StandardCursorType.Hand),+ Child = new TextBlock { Text = t, FontSize = 7, FontWeight = FontWeight.Bold, Foreground = on ? NotaPalette.TextOnAccent : NotaPalette.TextSecondary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Padding = new Thickness(3, 0) } };b.PointerPressed += (_, e) => { e.Handled = true; onClick(); };return b;}private Border IrRailBtn(string t, Action onClick){- var b = new Border { BorderThickness = new Thickness(1), BorderBrush = NotaPalette.BorderStrong, Background = IrCard, CornerRadius = new CornerRadius(3), Padding = new Thickness(0, 2), Cursor = new Cursor(StandardCursorType.Hand),+ var b = new Border { BorderThickness = new Thickness(1), BorderBrush = NotaPalette.BorderStrong, Background = IrCard, CornerRadius = NotaRadius.Badge, Padding = new Thickness(0, 2), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = t, FontSize = 9, Foreground = NotaPalette.TextSecondary, HorizontalAlignment = HorizontalAlignment.Center } };b.PointerPressed += (_, _) => onClick();return b;@@ -552,7 +551,7 @@ internal sealed class RackCardView(DeviceCardContext ctx){var header = withHeader ? IrHeader(a, "MAP") : null;// MAPPING strip.- var done = new Border { BorderBrush = IrTeal, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(10, 2), Cursor = new Cursor(StandardCursorType.Hand),+ var done = new Border { BorderBrush = IrTeal, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(10, 2), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = "Done", FontSize = 9, Foreground = IrTeal, HorizontalAlignment = HorizontalAlignment.Center, TextAlignment = TextAlignment.Center }, [DockPanel.DockProperty] = Dock.Right };done.PointerPressed += (_, _) => { if (onDone != null) onDone(); else { _macroMapMode = false; _ctx.RequestRebuild(); } };var strip = new Border { Height = 34, Background = IrHdr, BorderBrush = IrBorder, BorderThickness = new Thickness(0, 0, 0, 1), Padding = new Thickness(9, 0), Child =@@ -569,8 +568,8 @@ internal sealed class RackCardView(DeviceCardContext ctx)for (int m = 0; m < a.MappingCount(); m++) if (a.TryGetMapping(m, out var mm) && mm.Macro == i) tCount++;bool cur = i == _mapMacro;var nm = new TextBlock { Text = a.MacroName(i), FontSize = 9, Foreground = cur ? IrAmberLit : (tCount > 0 ? IrTxt : IrMuted), Width = 60, TextTrimming = TextTrimming.CharacterEllipsis, VerticalAlignment = VerticalAlignment.Center };- var fill = new Border { Height = 3, Background = IrAmber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Height = 6, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center }, fill } };+ var fill = new Border { Height = 3, Background = IrAmber, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var slot = new Panel { Height = 6, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = NotaRadius.Clip, VerticalAlignment = VerticalAlignment.Center }, fill } };_irTick.Add(() => fill.Width = E.PluginParamGet(T, a.AutomationDeviceIndex, iv) * slot.Bounds.Width);var cnt = IrMono(tCount.ToString(), cur ? IrTeal : IrMuted);var rowg = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 5, Cursor = new Cursor(StandardCursorType.Hand), Children = { nm, WithCol(slot, 1), WithCol(cnt, 2) } };@@ -589,11 +588,11 @@ internal sealed class RackCardView(DeviceCardContext ctx)if (!a.TryGetMapping(m, out var mm) || mm.Macro != _mapMacro) continue;targetStack.Children.Add(IrMappingRow(a, m, mm));}- targetStack.Children.Add(new Border { BorderBrush = NotaPalette.BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(0, 4),+ targetStack.Children.Add(new Border { BorderBrush = NotaPalette.BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(0, 4),Child = new TextBlock { Text = "click a control in any device to map it here", FontSize = 9, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center } });var curveSeg = IrSeg(new[] { "Linear", "Exp", "Log", "S" }, CommonCurve(a, _mapMacro), i => { for (int m = 0; m < a.MappingCount(); m++) if (a.TryGetMapping(m, out var mm) && mm.Macro == _mapMacro) a.SetMappingCurve(m, i); _ctx.RequestRebuild(); });- var unmap = new Border { BorderBrush = NotaPalette.Wash(NotaPalette.Danger, 0x80), BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), [DockPanel.DockProperty] = Dock.Right,+ var unmap = new Border { BorderBrush = NotaPalette.BorderDefault, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), [DockPanel.DockProperty] = Dock.Right,Child = new TextBlock { Text = "Unmap all", FontSize = 9, Foreground = IrRed } };unmap.PointerPressed += (_, _) => { for (int m = a.MappingCount() - 1; m >= 0; m--) if (a.TryGetMapping(m, out var mm) && mm.Macro == _mapMacro) a.RemoveMapping(m); _ctx.RequestRebuild(); };var bottom = new DockPanel { LastChildFill = false, [DockPanel.DockProperty] = Dock.Bottom, Children = { unmap, new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = { IrCap("CURVE"), curveSeg } } } };@@ -625,9 +624,9 @@ internal sealed class RackCardView(DeviceCardContext ctx)double span = Math.Max(1e-6, pMax - pMin);double fLo = Math.Clamp((mm.RangeMin - pMin) / span, 0, 1), fHi = Math.Clamp((mm.RangeMax - pMin) / span, 0, 1);var name = new TextBlock { Text = $"{dev} · {pn}", FontSize = 9, Foreground = IrTxt, Width = 122, TextTrimming = TextTrimming.CharacterEllipsis, VerticalAlignment = VerticalAlignment.Center };- var band = new Border { Height = 6, Background = NotaPalette.Wash(NotaPalette.Teal, 0x73), CornerRadius = new CornerRadius(3), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var track = new Panel { Height = 6, MinWidth = 60, Children = { new Border { Height = 6, Background = NotaPalette.BgApp, CornerRadius = new CornerRadius(3), VerticalAlignment = VerticalAlignment.Center }, band } };- var vals = IrMono($"{mm.RangeMin * 100:0}%–{mm.RangeMax * 100:0}%", NotaPalette.TextSecondary);+ var band = new Border { Height = 6, Background = NotaPalette.Wash(NotaPalette.Teal, 0x73), CornerRadius = NotaRadius.Badge, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var track = new Panel { Height = 6, MinWidth = 60, Children = { new Border { Height = 6, Background = NotaPalette.BgSunken, CornerRadius = NotaRadius.Badge, VerticalAlignment = VerticalAlignment.Center }, band } };+ var vals = IrMono($"{mm.RangeMin * 100:0}\u2009%–{mm.RangeMax * 100:0}\u2009%", NotaPalette.TextSecondary);void Upd() { double w = track.Bounds.Width; band.Margin = new Thickness(fLo * w, 0, 0, 0); band.Width = Math.Max(2, (fHi - fLo) * w); }int drag = 0; // 1 = min, 2 = maxvoid Apply(double x) { double f = Math.Clamp(x / Math.Max(1, track.Bounds.Width), 0, 1); if (drag == 1) fLo = Math.Min(f, fHi); else fHi = Math.Max(f, fLo); Upd(); }@@ -636,7 +635,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)track.PointerReleased += (_, e) => { if (drag != 0) { drag = 0; e.Pointer.Capture(null); a.SetMappingRange(mappingIndex, (float)(pMin + fLo * span), (float)(pMin + fHi * span)); _ctx.RequestRebuild(); } };_irTick.Add(Upd);var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 6, Children = { name, WithCol(track, 1), WithCol(vals, 2) } };- return new Border { Background = IrInset, BorderBrush = IrField, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(7, 4), Child = g };+ return new Border { Background = IrInset, BorderBrush = IrField, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(7, 4), Child = g };}// Audio Effect Rack body (a device, kind 5): wrapped by the view's DeviceShell.@@ -664,7 +663,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)root = new DockPanel { LastChildFill = true, Children = { strip, body } };}if (_irTick.Count > 0) _ctx.AddDeviceRefresher(() => { for (int i = 0; i < _irTick.Count; i++) _irTick[i](); });- return new Border { Height = 234, ClipToBounds = true, Child = root }; // fills the full-bleed shell slot (700)+ return new Border { Height = DeviceCardKit.CardH - DeviceCardKit.HeaderH, ClipToBounds = true, Child = root }; // fills the full-bleed shell slot (700)}// Parallel (mode 0) / Select (mode 2): chain list | devices | rack rail.@@ -687,7 +686,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)IrCap("CHAINS"), WithRight(new TextBlock { Text = sub, FontSize = 8, Foreground = IrMuted, VerticalAlignment = VerticalAlignment.Center }) } };var rows = new StackPanel { Spacing = 4 };for (int c = 0; c < chains; c++) rows.Children.Add(AeChainRow(a, di, c));- var add = new Border { BorderBrush = NotaPalette.BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(0, 3), Cursor = new Cursor(StandardCursorType.Hand),+ var add = new Border { BorderBrush = NotaPalette.BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(0, 3), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = "+ Add chain", FontSize = 9, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center } };add.PointerPressed += (_, _) => { int c = a.AddChain(-1); if (c >= 0) Sel = c; _ctx.RequestRebuild(); };rows.Children.Add(add);@@ -706,8 +705,8 @@ internal sealed class RackCardView(DeviceCardContext ctx)var head = new DockPanel { LastChildFill = true, Children = { WithRight(ChainDelBtn(a, c)), WithRight(IrMono($"{devs} dev", IrMuted)), nameTb } };double db = a.ChainGain(c) <= 0.001 ? -60 : 20 * Math.Log10(a.ChainGain(c));var dbT = IrMono(db <= -59 ? "−∞" : $"{db:+0.0;−0.0;0.0}", NotaPalette.TextSecondary);- var meterFill = new Border { Background = Success, HorizontalAlignment = HorizontalAlignment.Left, CornerRadius = new CornerRadius(1) };- var meter = new Border { Height = 3, Background = IrInset, CornerRadius = new CornerRadius(1), Child = meterFill, VerticalAlignment = VerticalAlignment.Center };+ var meterFill = new Border { Background = Success, HorizontalAlignment = HorizontalAlignment.Left, CornerRadius = NotaRadius.Bar };+ var meter = new Border { Height = 3, Background = IrInset, CornerRadius = NotaRadius.Bar, Child = meterFill, VerticalAlignment = VerticalAlignment.Center };_irTick.Add(() => meterFill.Width = meter.Bounds.Width * Math.Clamp(a.ChainMeter(c), 0, 1));var m = IrMsBtn("M", a.ChainMute(c), IrRed, () => { a.SetChainMute(c, !a.ChainMute(c)); _ctx.RequestRebuild(); });var s = IrMsBtn("S", a.ChainSolo(c), IrAmber, () => { a.SetChainSolo(c, !a.ChainSolo(c)); _ctx.RequestRebuild(); });@@ -720,9 +719,9 @@ internal sealed class RackCardView(DeviceCardContext ctx)// Built exactly like the Instrument Rack row (Border + PointerPressed), so it sizes to// its content. Clicking is reliable now that the full-bleed body removed the earlier// fixed-width overflow that skewed hit-testing inside the device shell.- var row = new Border { Background = sel ? RowSel : IrCard, BorderBrush = sel ? IrAmber : IrBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(6, 4), Cursor = new Cursor(StandardCursorType.Hand), Child = stack };+ var row = new Border { Background = sel ? RowSel : IrCard, BorderBrush = sel ? IrAmber : IrBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(6, 4), Cursor = new Cursor(StandardCursorType.Hand), Child = stack };// left accent = chain hue, hidden while selected (the amber selection is enough).- var accent = new Border { Width = 2, Background = sel ? Brushes.Transparent : ChainHue(c), CornerRadius = new CornerRadius(2, 0, 0, 2) };+ var accent = new Border { Width = 2, Background = sel ? Brushes.Transparent : ChainHue(c), CornerRadius = new CornerRadius(NotaRadius.ClipValue, 0, 0, NotaRadius.ClipValue) };var wrap = new DockPanel { LastChildFill = true, Children = { accent, row } };DockPanel.SetDock(accent, Dock.Left);wrap.PointerPressed += (_, e) => { if (e.GetCurrentPoint(wrap).Properties.IsLeftButtonPressed && Sel != c) { Sel = c; _ctx.RequestRebuild(); } };@@ -736,7 +735,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)// A small borderless ✕ that removes a rack chain (shared by both rack kinds).private Control ChainDelBtn(IRackAccess a, int c){- var glyph = new TextBlock { Text = "✕", FontSize = 9, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };+ var glyph = new Glyph(GlyphKind.Close, 9) { Foreground = IrMuted };var b = new Border { Width = 14, Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Stretch, Child = glyph };ToolTip.SetTip(b, "Remove chain");b.PointerEntered += (_, _) => glyph.Foreground = IrRed;@@ -749,11 +748,11 @@ internal sealed class RackCardView(DeviceCardContext ctx)private Control AeDeviceArea(IRackAccess a, int di){if (a.ChainCount() == 0)- return new Border { Padding = new Thickness(9, 7), Child = new TextBlock { Text = "Add a chain to build its device chain.", FontSize = 10, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center } };+ return new Border { Padding = new Thickness(9, 7), Child = new TextBlock { Text = "Add a chain to build its device chain.", FontSize = 9, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center } };int sc = Sel, mode = E.RackDevMode(T, di);double pdcMs = E.RackDevPdc(T, di) ? 0 : 0; // (informational; latency in samples is host-side)var hdr = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 0, 6), Children = {- new Border { Width = 7, Height = 7, CornerRadius = new CornerRadius(2), Background = ChainHue(sc), VerticalAlignment = VerticalAlignment.Center },+ new Border { Width = 7, Height = 7, CornerRadius = NotaRadius.Clip, Background = ChainHue(sc), VerticalAlignment = VerticalAlignment.Center },new TextBlock { Text = $"Chain {sc + 1}", FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = IrTxt, VerticalAlignment = VerticalAlignment.Center },new TextBlock { Text = "devices · signal left → right", FontSize = 8, Foreground = IrMuted, VerticalAlignment = VerticalAlignment.Center } } };@@ -777,11 +776,12 @@ internal sealed class RackCardView(DeviceCardContext ctx)private Control AeFoldedSlot(IRackAccess a, int sc, int d){bool byp = a.ChainDeviceBypassed(sc, d);- var chip = new Border { Height = 22, Background = IrCard, BorderBrush = IrBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(7, 0), Opacity = byp ? 0.6 : 1.0, VerticalAlignment = VerticalAlignment.Top,+ var chip = new Border { Height = 22, Background = IrCard, BorderBrush = IrBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Padding = new Thickness(7, 0), VerticalAlignment = VerticalAlignment.Top,Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = {- new Border { Width = 6, Height = 6, CornerRadius = new CornerRadius(3), Background = byp ? IrMuted : Success, VerticalAlignment = VerticalAlignment.Center },+ new Border { Width = 6, Height = 6, CornerRadius = NotaRadius.Badge, Background = byp ? IrMuted : Success, VerticalAlignment = VerticalAlignment.Center },new TextBlock { Text = a.ChainDeviceName(sc, d), FontSize = 9, Foreground = IrTxt, VerticalAlignment = VerticalAlignment.Center },SlotDelBtn(() => { a.RemoveChainDevice(sc, d); DeferRebuild(); }) } } };+ if (byp) chip.AttachedToVisualTree += (_, _) => Inactive.Set(chip, true, interactive: true); // no opacity for stateBorder b = chip; b.PointerPressed += (_, e) => { e.Handled = true; OpenChainDeviceGui(a, sc, d, b); };return chip;}@@ -815,13 +815,13 @@ internal sealed class RackCardView(DeviceCardContext ctx)mapHost.PointerPressed += (_, e) => { if (e.GetCurrentPoint(mapHost).Properties.IsRightButtonPressed) { double x = e.GetPosition(mapHost).X; E.RackDevSetChainSelect(T, di, (float)Math.Clamp(x / Math.Max(1, mapHost.Bounds.Width), 0, 1)); } };var readout = IrMono("", IrAmberLit);- _irTick.Add(() => readout.Text = $"in {(int)Math.Round(E.RackDevLiveSelector(T, di) * 48 - 48)} dB → {AeActiveCount(a, di)} chain{(AeActiveCount(a, di) == 1 ? "" : "s")}");+ _irTick.Add(() => readout.Text = $"in {(int)Math.Round(E.RackDevLiveSelector(T, di) * 48 - 48)}\u2009dB → {AeActiveCount(a, di)} chain{(AeActiveCount(a, di) == 1 ? "" : "s")}");var head = new DockPanel { LastChildFill = false, Children = { IrCap("CHAIN SELECTOR"),WithRight(DrumChip(follow ? "Follow" : "Manual", follow, () => { E.RackDevSetSelFollow(T, di, !follow); DeferRebuild(); })),WithRight(readout) } };DockPanel.SetDock(head, Dock.Top);var body = new DockPanel { LastChildFill = true, Children = { head, mapHost } };- return new Border { Height = 52, Background = IrInset, BorderBrush = IrField, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(6, 4), Margin = new Thickness(0, 5, 0, 0), Child = body };+ return new Border { Height = 52, Background = IrInset, BorderBrush = IrField, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(6, 4), Margin = new Thickness(0, 5, 0, 0), Child = body };}// ---- rack rail (96): MODE · dry/wet · gain · macro-map · pdc · fold/save ----@@ -832,14 +832,14 @@ internal sealed class RackCardView(DeviceCardContext ctx)var dwVal = IrMono("", IrTxt, 9); dwVal.HorizontalAlignment = HorizontalAlignment.Center;var dw = new Knob(Math.Clamp(E.RackDevDryWet(T, di), 0, 1), 1.0) { Accent = true, Width = 38, Height = 38, HorizontalAlignment = HorizontalAlignment.Center };- dw.ValueChanged += v => { E.RackDevSetDryWet(T, di, (float)v); dwVal.Text = $"{v * 100:0} %"; };- dwVal.Text = $"{E.RackDevDryWet(T, di) * 100:0} %";+ dw.ValueChanged += v => { E.RackDevSetDryWet(T, di, (float)v); dwVal.Text = $"{v * 100:0}\u2009%"; };+ dwVal.Text = $"{E.RackDevDryWet(T, di) * 100:0}\u2009%";var dwCell = new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, Children = { IrCap("DRY / WET"), dw, dwVal } };string GainDb(double lin) => lin <= 0.001 ? "−∞" : $"{20 * Math.Log10(lin):+0.0;−0.0;0.0}";var gainVal = IrMono(GainDb(E.RackDevVolume(T, di)), IrTxt, 8); gainVal.VerticalAlignment = VerticalAlignment.Center;- var gFill = new Border { Height = 3, Background = IrAmber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var gSlot = new Panel { Height = 8, MinWidth = 26, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center }, gFill } };+ var gFill = new Border { Height = 3, Background = IrAmber, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var gSlot = new Panel { Height = 8, MinWidth = 26, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = NotaRadius.Clip, VerticalAlignment = VerticalAlignment.Center }, gFill } };void GUpd() { double v = Math.Clamp(E.RackDevVolume(T, di) / 2.0, 0, 1); gFill.Width = v * gSlot.Bounds.Width; gainVal.Text = GainDb(E.RackDevVolume(T, di)); }bool gd = false; void GSet(double x) { double v = Math.Clamp(x / Math.Max(1, gSlot.Bounds.Width), 0, 1); E.RackDevSetVolume(T, di, (float)(v * 2.0)); GUpd(); }gSlot.PointerPressed += (_, e) => { gd = true; e.Pointer.Capture(gSlot); GSet(e.GetPosition(gSlot).X); };@@ -849,10 +849,10 @@ internal sealed class RackCardView(DeviceCardContext ctx)MidiLearn.Bind(gSlot, MidiTarget.RackVolume(T, di), "Rack Volume");var gainRow = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 4, VerticalAlignment = VerticalAlignment.Center, Children = { IrCap("GAIN"), WithCol(gSlot, 1), WithCol(gainVal, 2) } };- var macroMap = new Border { BorderBrush = IrTeal, BorderThickness = new Thickness(1), Background = NotaPalette.Wash(NotaPalette.Teal, 0x24), CornerRadius = new CornerRadius(4), Padding = new Thickness(0, 3), Cursor = new Cursor(StandardCursorType.Hand),+ var macroMap = new Border { BorderBrush = IrTeal, BorderThickness = new Thickness(1), Background = NotaPalette.Wash(NotaPalette.Teal, 0x24), CornerRadius = NotaRadius.Control, Padding = new Thickness(0, 3), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = "MACRO MAP", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = IrTeal, HorizontalAlignment = HorizontalAlignment.Center, TextAlignment = TextAlignment.Center } };macroMap.PointerPressed += (_, _) => { _aeMacroMap = true; DeferRebuild(); };- var pdc = AeRailToggle(E.RackDevPdc(T, di) ? "PDC ON" : "PDC OFF", E.RackDevPdc(T, di), () => { E.RackDevSetPdc(T, di, !E.RackDevPdc(T, di)); DeferRebuild(); });+ var pdc = AeRailToggle("PDC", E.RackDevPdc(T, di), () => { E.RackDevSetPdc(T, di, !E.RackDevPdc(T, di)); DeferRebuild(); });var fold = IrRailBtn(_aeFold ? "Unfold" : "Fold", () => { _aeFold = !_aeFold; DeferRebuild(); });var save = IrRailBtn("Save", () => { try { _ctx.RequestPresetSave(di); } catch { /* no-op */ } });@@ -875,23 +875,19 @@ internal sealed class RackCardView(DeviceCardContext ctx)for (int i = 0; i < 3; i++){int iv = i; bool on = i == mode;- var cell = new Border { Background = on ? IrAmber : Brushes.Transparent, CornerRadius = new CornerRadius(2), Cursor = new Cursor(StandardCursorType.Hand),- Child = new TextBlock { Text = names[i], FontSize = 8, FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal, Foreground = on ? NotaPalette.BgApp : IrMuted, HorizontalAlignment = HorizontalAlignment.Center, TextAlignment = TextAlignment.Center, Padding = new Thickness(0, 1) } };+ var cell = new Border { Background = on ? IrAmber : Brushes.Transparent, CornerRadius = NotaRadius.Clip, Cursor = new Cursor(StandardCursorType.Hand),+ Child = new TextBlock { Text = names[i], FontSize = 8, FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal, Foreground = on ? NotaPalette.TextOnAccent : IrMuted, HorizontalAlignment = HorizontalAlignment.Center, TextAlignment = TextAlignment.Center, Padding = new Thickness(0, 1) } };cell.PointerPressed += (_, _) => { E.RackDevSetMode(T, di, iv); DeferRebuild(); };Grid.SetColumn(cell, i); g.Children.Add(cell);}- return new Border { Background = IrInset, BorderBrush = IrBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(1), Child = g };+ return new Border { Background = IrInset, BorderBrush = IrBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, Padding = new Thickness(1), Child = g };}// A pill toggle (PDC): label on the left, switch on the right, fits the rail width.private Control AeRailToggle(string text, bool on, Action onClick){- var dot = new Border { Width = 18, Height = 10, CornerRadius = new CornerRadius(5), Background = on ? IrTeal : IrCard, BorderBrush = on ? Brushes.Transparent : NotaPalette.BorderStrong, BorderThickness = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, [DockPanel.DockProperty] = Dock.Right,- Child = new Border { Width = 6, Height = 6, CornerRadius = new CornerRadius(3), Background = on ? NotaPalette.BgApp : IrMuted, HorizontalAlignment = on ? HorizontalAlignment.Right : HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(1.5, 0) } };- var b = new Border { Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent, Child = new DockPanel { LastChildFill = true, Children = { dot,- new TextBlock { Text = text, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = on ? IrTeal : IrMuted, VerticalAlignment = VerticalAlignment.Center } } } };- b.PointerPressed += (_, _) => onClick();- return b;+ // The label names the setting; the switch carries the state (colour and position).+ return DeviceCardKit.Switch(text, () => on, onClick, out _);}// ---- Series mode: chains as stacked columns you build top → bottom ----@@ -901,8 +897,8 @@ internal sealed class RackCardView(DeviceCardContext ctx)var cols = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5 };int chains = a.ChainCount();for (int c = 0; c < chains; c++) cols.Children.Add(AeSeriesColumn(a, di, c));- var addCol = new Border { Width = 40, BorderBrush = NotaPalette.BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Cursor = new Cursor(StandardCursorType.Hand),- Child = new TextBlock { Text = "+", FontSize = 14, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center } };+ var addCol = new Border { Width = 40, BorderBrush = NotaPalette.BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Cursor = new Cursor(StandardCursorType.Hand),+ Child = new Glyph(GlyphKind.Plus, 10) { Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center } };addCol.PointerPressed += (_, _) => { int nc = a.AddChain(-1); if (nc >= 0) Sel = nc; DeferRebuild(); };cols.Children.Add(addCol);var scroll = new ScrollViewer { Content = cols, HorizontalScrollBarVisibility = ScrollBarVisibility.Auto, VerticalScrollBarVisibility = ScrollBarVisibility.Disabled, Padding = new Thickness(8, 7) };@@ -919,12 +915,12 @@ internal sealed class RackCardView(DeviceCardContext ctx)var stack = new StackPanel { Spacing = 4, Children = { head } };int dc = a.ChainDeviceCount(c);for (int d = 0; d < dc; d++) stack.Children.Add(AeSeriesDeviceRow(a, c, d));- var addDev = new Border { BorderBrush = NotaPalette.BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(0, 2), Cursor = new Cursor(StandardCursorType.Hand), [DockPanel.DockProperty] = Dock.Bottom,+ var addDev = new Border { BorderBrush = NotaPalette.BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(0, 2), Cursor = new Cursor(StandardCursorType.Hand), [DockPanel.DockProperty] = Dock.Bottom,Child = new TextBlock { Text = "+ device", FontSize = 8, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center } };addDev.PointerPressed += (_, _) => ShowAddDeviceMenu(a, c, addDev);DockPanel.SetDock(addDev, Dock.Bottom);var inner = new DockPanel { LastChildFill = false, Children = { addDev, stack } };- return new Border { Width = 150, Background = IrRail, BorderBrush = ChainHue(c), BorderThickness = new Thickness(0, 2, 0, 0), CornerRadius = new CornerRadius(6), Padding = new Thickness(6, 5), Child = inner };+ return new Border { Width = 150, Background = IrRail, BorderBrush = ChainHue(c), BorderThickness = new Thickness(0, 2, 0, 0), CornerRadius = NotaRadius.Panel, Padding = new Thickness(6, 5), Child = inner };}private Control AeSeriesDeviceRow(IRackAccess a, int c, int d)@@ -933,12 +929,13 @@ internal sealed class RackCardView(DeviceCardContext ctx)int mc = MacrosOnTarget(a, c, d);var rowInner = new DockPanel { LastChildFill = true, Children = {WithRight(SlotDelBtn(() => { a.RemoveChainDevice(c, d); DeferRebuild(); })),- WithRight(new TextBlock { Text = "⠿", FontSize = 8, Foreground = IrMuted, VerticalAlignment = VerticalAlignment.Center }),+ WithRight(new Glyph(GlyphKind.Grip, 8) { Foreground = IrMuted }),WithRight(mc > 0 ? new TextBlock { Text = $"{mc}M", FontSize = 7, FontWeight = FontWeight.Bold, Foreground = IrTeal, VerticalAlignment = VerticalAlignment.Center } : (Control)new Border()),new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = {- new Border { Width = 5, Height = 5, CornerRadius = new CornerRadius(3), Background = byp ? IrMuted : Success, VerticalAlignment = VerticalAlignment.Center },+ new Border { Width = 5, Height = 5, CornerRadius = NotaRadius.Badge, Background = byp ? IrMuted : Success, VerticalAlignment = VerticalAlignment.Center },new TextBlock { Text = a.ChainDeviceName(c, d), FontSize = 9, Foreground = IrTxt, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis } } } } };- var row = new Border { Height = 24, Background = IrCard, BorderBrush = IrBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4), Padding = new Thickness(6, 0), Opacity = byp ? 0.6 : 1.0, Cursor = new Cursor(StandardCursorType.Hand), Child = rowInner };+ var row = new Border { Height = 24, Background = IrCard, BorderBrush = IrBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Control, Padding = new Thickness(6, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = rowInner };+ if (byp) row.AttachedToVisualTree += (_, _) => Inactive.Set(row, true, interactive: true); // no opacity for stateBorder b = row; b.PointerPressed += (_, e) => { e.Handled = true; OpenChainDeviceGui(a, c, d, b); };return row;}@@ -960,30 +957,15 @@ internal sealed class RackCardView(DeviceCardContext ctx)DockPanel.SetDock(header, Dock.Top); DockPanel.SetDock(strip, Dock.Top);var content = new DockPanel { LastChildFill = true, Children = { header, strip, bodyView } };if (_irTick.Count > 0) _ctx.AddDeviceRefresher(() => { for (int i = 0; i < _irTick.Count; i++) _irTick[i](); });- return new Border { Width = 700, Height = 260, Background = NotaPalette.BgApp, BorderBrush = IrBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(8), ClipToBounds = true, Child = content };+ return new Border { Width = 700, Height = 260, Background = NotaPalette.BgApp, BorderBrush = IrBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Body, ClipToBounds = true, Child = content };}- // ---- header (26): name · pad count · view toggle · meter ----+ // ---- header (22): name · pad count ----private Control DrumHeader(IRackAccess a){int pads = 0;for (int c = 0; c < a.ChainCount(); c++) if (a.ChainTriggerNote(c) >= 0) pads++;- var left = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, VerticalAlignment = VerticalAlignment.Center, Children = {- new Border { Width = 6, Height = 6, CornerRadius = new CornerRadius(3), Background = Success, VerticalAlignment = VerticalAlignment.Center },- new TextBlock { Text = "Nota Drum Rack", FontSize = 11, FontWeight = FontWeight.SemiBold, Foreground = IrTxt, VerticalAlignment = VerticalAlignment.Center },- new TextBlock { Text = $"{pads} PAD{(pads == 1 ? "" : "S")}", FontSize = 9, FontWeight = FontWeight.Bold, Foreground = IrMuted, VerticalAlignment = VerticalAlignment.Center } } };-- var mL = new Border { Height = 3, Background = Success, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center, CornerRadius = new CornerRadius(2) };- var mR = new Border { Height = 3, Background = Success, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center, CornerRadius = new CornerRadius(2) };- var meter = new StackPanel { Width = 46, Spacing = 2, VerticalAlignment = VerticalAlignment.Center, Children = {- new Panel { Height = 3, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = new CornerRadius(2) }, mL } },- new Panel { Height = 3, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = new CornerRadius(2) }, mR } } } };- _irTick.Add(() => { float pk = 0; for (int c = 0; c < a.ChainCount(); c++) pk = Math.Max(pk, E.RackChainMeter(T, c)); double w = 46 * Math.Clamp(pk, 0, 1); mL.Width = w; mR.Width = w * 0.94; });-- var view = IrSeg(new[] { "Pads", "Mixer" }, _drumMixer ? 1 : 0, i => { _drumMixer = i == 1; _ctx.RequestRebuild(); });- var right = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, VerticalAlignment = VerticalAlignment.Center, [DockPanel.DockProperty] = Dock.Right, Children = { view, meter } };- var dp = new DockPanel { LastChildFill = false, Margin = new Thickness(9, 0), Children = { left, right } };- return new Border { Height = 26, Background = IrHdr, BorderBrush = IrBorder, BorderThickness = new Thickness(0, 0, 0, 1), Child = dp };+ return RackHeader("Nota Drum Rack", $"DRUMS · {pads} PAD{(pads == 1 ? "" : "S")}");}// ---- LIVE strip (34): bank · swing · humanize · fold ----@@ -995,7 +977,9 @@ internal sealed class RackCardView(DeviceCardContext ctx)row.Children.Add(DrumKitKnob("SWING", 52, IrAmber, () => E.RackSwing(T), v => E.RackSetSwing(T, v)));row.Children.Add(DrumKitKnob("HUMANIZE", 46, IrTeal, () => E.RackHumanize(T), v => E.RackSetHumanize(T, v)));var fold = DrumChip("Fold", _drumFold, () => { _drumFold = !_drumFold; _ctx.RequestRebuild(); });- var right = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, VerticalAlignment = VerticalAlignment.Center, [DockPanel.DockProperty] = Dock.Right, Children = { fold } };+ // Pads / Mixer view switch: moved here from the header (almanac header carries name and badge only).+ var view = IrSeg(new[] { "Pads", "Mixer" }, _drumMixer ? 1 : 0, i => { _drumMixer = i == 1; _ctx.RequestRebuild(); });+ var right = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, VerticalAlignment = VerticalAlignment.Center, [DockPanel.DockProperty] = Dock.Right, Children = { view, fold } };var dp = new DockPanel { LastChildFill = false, Margin = new Thickness(9, 0), Children = { row, right } };return new Border { Height = 34, Background = IrHdr, BorderBrush = IrBorder, BorderThickness = new Thickness(0, 0, 0, 1), Child = dp };}@@ -1003,15 +987,15 @@ internal sealed class RackCardView(DeviceCardContext ctx)// A labelled kit slider (swing / humanize) with a fixed-width groove + live % readout.private Control DrumKitKnob(string label, double width, IBrush accent, Func<float> get, Action<float> set){- var val = IrMono("0 %", IrTxt, 9); val.MinWidth = 30;- var slot = HSlider(width, accent, () => get(), v => { set((float)v); val.Text = $"{v * 100:0} %"; });- val.Text = $"{get() * 100:0} %";+ var val = IrMono("0\u2009%", IrTxt, 9); val.MinWidth = 30;+ var slot = HSlider(width, accent, () => get(), v => { set((float)v); val.Text = $"{v * 100:0}\u2009%"; });+ val.Text = $"{get() * 100:0}\u2009%";return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { IrCap(label), slot, val } };}private static Border DrumChip(string text, bool on, Action onClick){- var b = new Border { BorderThickness = new Thickness(1), BorderBrush = on ? IrTeal : NotaPalette.BorderStrong, Background = on ? NotaPalette.Wash(NotaPalette.Teal, 0x24) : IrCard, CornerRadius = new CornerRadius(4), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,+ var b = new Border { BorderThickness = new Thickness(1), BorderBrush = on ? IrTeal : NotaPalette.BorderStrong, Background = on ? NotaPalette.Wash(NotaPalette.Teal, 0x24) : IrCard, CornerRadius = NotaRadius.Control, Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,Child = new TextBlock { Text = text, FontSize = 9, Foreground = on ? IrTeal : NotaPalette.TextSecondary } };b.PointerPressed += (_, e) => { e.Handled = true; onClick(); };return b;@@ -1020,17 +1004,9 @@ internal sealed class RackCardView(DeviceCardContext ctx)// A fixed-width horizontal groove+fill+handle bound to a 0..1 getter/setter.private static Control HSlider(double width, IBrush accent, Func<double> get, Action<double> set){- var fill = new Border { Height = 3, Background = accent, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 8, Height = 9, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Width = width, Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center }, fill, handle } };- void Vis(double v) { fill.Width = v * width; handle.Margin = new Thickness(Math.Clamp(v * width - 4, 0, Math.Max(0, width - 8)), 0, 0, 0); }- bool drag = false;- void SetX(double x) { double v = Math.Clamp(x / width, 0, 1); set(v); Vis(v); }- slot.PointerPressed += (_, e) => { drag = true; e.Pointer.Capture(slot); SetX(e.GetPosition(slot).X); };- slot.PointerMoved += (_, e) => { if (drag) SetX(e.GetPosition(slot).X); };- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); } };- Vis(Math.Clamp(get(), 0, 1));- return slot;+ var slider = new SliderTrack { Width = width, Norm = Math.Clamp(get(), 0, 1) };+ slider.Changed += set;+ return slider;}// ==================== Pads view ====================@@ -1068,7 +1044,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)int chain = ChainForNote(a, note);bool filled = chain >= 0;bool selected = filled && chain == Sel;- Color hue = filled ? PadHue(chain) : Colors.Black;+ var hue = filled ? PadHue(chain) : NotaPalette.SurfaceAbyss;int choke = filled ? E.RackChainChoke(T, chain) : 0;// The pad's own name when it has one (kit voice, dropped sample); otherwise the// instrument's — which for a Sampler is the same word on every pad.@@ -1085,8 +1061,8 @@ internal sealed class RackCardView(DeviceCardContext ctx)IBrush LoadedBg() => filled ? PadFill(hue, 0.16) : IrCard;IBrush SelBg() => PadFill(hue, 0.28);IBrush idleBorder = selected ? AccentBright : (filled ? PadFill(hue, 0.5) : IrBorder);- double idleThick = selected ? 2 : 1;- var pad = new Border { Margin = new Thickness(2), Background = selected ? SelBg() : LoadedBg(), BorderBrush = idleBorder, BorderThickness = new Thickness(idleThick), CornerRadius = new CornerRadius(5), Cursor = new Cursor(StandardCursorType.Hand), Child = cell };+ double idleThick = 1; // selection shows in colour (SelBg), not a thicker edge+ var pad = new Border { Margin = new Thickness(2), Background = selected ? SelBg() : LoadedBg(), BorderBrush = idleBorder, BorderThickness = new Thickness(idleThick), CornerRadius = NotaRadius.Tile, Cursor = new Cursor(StandardCursorType.Hand), Child = cell };ToolTip.SetTip(pad, filled ? $"{name} · {NoteName(note)} — click to play + edit" : $"{NoteName(note)} — click to add · drop a sample here");if (filled)@@ -1113,9 +1089,9 @@ internal sealed class RackCardView(DeviceCardContext ctx)DragDrop.AddDragOverHandler(pad, (_, e) => {if (!BrowserView.IsAcceptableDrag(e)) { e.DragEffects = DragDropEffects.None; return; }e.DragEffects = DragDropEffects.Copy; e.Handled = true; _ctx.HideDropGlow();- pad.BorderBrush = AccentBright; pad.BorderThickness = new Thickness(2);+ pad.BorderBrush = AccentBright; // drop target: colour only, no thicker border});- DragDrop.AddDragLeaveHandler(pad, (_, _) => { pad.BorderBrush = idleBorder; pad.BorderThickness = new Thickness(idleThick); });+ DragDrop.AddDragLeaveHandler(pad, (_, _) => { pad.BorderBrush = idleBorder; });DragDrop.AddDropHandler(pad, (_, e) => {pad.BorderBrush = idleBorder; pad.BorderThickness = new Thickness(idleThick);var items = BrowserView.DroppedItems(e);@@ -1134,17 +1110,17 @@ internal sealed class RackCardView(DeviceCardContext ctx)int chains = a.ChainCount();if (chains == 0 || Sel < 0 || Sel >= chains || a.ChainTriggerNote(Sel) < 0){- panel.Child = new TextBlock { Text = "Select a pad to edit it.", FontSize = 10, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };+ panel.Child = new TextBlock { Text = "Select a pad to edit it.", FontSize = 9, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };return panel;}int c = Sel, note = a.ChainTriggerNote(c);int devs = a.ChainDeviceCount(c);int choke = E.RackChainChoke(T, c);- Color hue = PadHue(c);+ var hue = PadHue(c);var head = new DockPanel { LastChildFill = false, Children = {new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = {- new Border { Width = 7, Height = 7, CornerRadius = new CornerRadius(2), Background = new SolidColorBrush(hue), VerticalAlignment = VerticalAlignment.Center },+ new Border { Width = 7, Height = 7, CornerRadius = NotaRadius.Clip, Background = hue, VerticalAlignment = VerticalAlignment.Center },new TextBlock { Text = PadName(a, c), FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = IrTxt, VerticalAlignment = VerticalAlignment.Center },IrMono($"{NoteName(note)} · {(choke > 0 ? $"choke CH {choke}" : "no choke")} · {devs} dev", IrMuted) } },WithRight(DrumOpenChip(a, c)) } };@@ -1154,7 +1130,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)col.Children.Add(DrumSampleBox(a, c, hue));col.Children.Add(DrumParamRow("VOLUME", () => VolNorm(a.ChainGain(c)), v => a.SetChainGain(c, NormVol(v)), () => VolText(a.ChainGain(c))));col.Children.Add(DrumParamRow("PAN", () => (a.ChainPan(c) + 1) / 2, v => a.SetChainPan(c, (float)(v * 2 - 1)), () => PanText(a.ChainPan(c))));- col.Children.Add(DrumParamRow("TUNE", () => (E.RackChainTune(T, c) + 48) / 96.0, v => E.RackSetChainTune(T, c, (int)Math.Round(v * 96 - 48)), () => $"{E.RackChainTune(T, c):+0;-0;0} st"));+ col.Children.Add(DrumParamRow("TUNE", () => (E.RackChainTune(T, c) + 48) / 96.0, v => E.RackSetChainTune(T, c, (int)Math.Round(v * 96 - 48)), () => $"{E.RackChainTune(T, c):+0;−0;0}\u2009st"));col.Children.Add(DrumParamRow("DECAY", () => E.RackChainDecay(T, c), v => E.RackSetChainDecay(T, c, (float)v), () => DecayText(E.RackChainDecay(T, c))));var chokeLeft = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = {@@ -1171,12 +1147,12 @@ internal sealed class RackCardView(DeviceCardContext ctx){Border b = null!;b = new Border { Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,- Child = new TextBlock { Text = "▤ open chain", FontSize = 8, Foreground = IrMuted } };+ Child = new TextBlock { Text = "Open chain", FontSize = 8, Foreground = IrMuted } };b.PointerPressed += (_, e) => { e.Handled = true; OpenChainInstrumentGui(a, c, b); };return b;}- private Control DrumSampleBox(IRackAccess a, int c, Color hue)+ private Control DrumSampleBox(IRackAccess a, int c, SolidColorBrush hue){var title = IrMono("", IrTxt, 8);var dur = IrMono("", IrMuted, 8);@@ -1188,13 +1164,13 @@ internal sealed class RackCardView(DeviceCardContext ctx)int ch = Math.Max(1, sinfo.Channels); long frames = sinfo.Frames; double sr = sinfo.SampleRate;peaks = MiniPeaks(raw, ch, frames, 40);title.Text = a.ChainInstrumentName(c);- dur.Text = sr > 0 ? $"{frames / sr:0.00} s" : "";+ dur.Text = sr > 0 ? $"{frames / sr:0.00}\u2009s" : "";}else { title.Text = a.ChainInstrumentName(c); dur.Text = "synth"; }if (peaks.Length > 0)foreach (float p in peaks)- bars.Children.Add(new Border { Width = 3, Height = Math.Max(1, p * 30), Background = new SolidColorBrush(hue), Opacity = 0.55 + 0.45 * p, CornerRadius = new CornerRadius(1), VerticalAlignment = VerticalAlignment.Center });+ bars.Children.Add(new Border { Width = 3, Height = Math.Max(1, p * 30), Background = hue, CornerRadius = NotaRadius.Bar, VerticalAlignment = VerticalAlignment.Center });elsebars.Children.Add(new TextBlock { Text = "— no sample —", FontSize = 8, Foreground = IrMuted, VerticalAlignment = VerticalAlignment.Center });@@ -1202,7 +1178,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)var inner = new DockPanel { LastChildFill = true, Children = { top } };DockPanel.SetDock(top, Dock.Top);inner.Children.Add(new Border { Child = new ScrollViewer { HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden, VerticalScrollBarVisibility = ScrollBarVisibility.Disabled, Content = bars }, VerticalAlignment = VerticalAlignment.Center });- return new Border { Height = 56, Background = IrInset, BorderBrush = IrField, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6), Padding = new Thickness(7, 4), Child = inner };+ return new Border { Height = 56, Background = IrInset, BorderBrush = IrField, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(7, 4), Child = inner };}// A param row: label (44) · flexible groove · value (48). Synced via the 60 Hz tick.@@ -1210,9 +1186,9 @@ internal sealed class RackCardView(DeviceCardContext ctx){var lbl = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = IrMuted, Width = 44, VerticalAlignment = VerticalAlignment.Center };var val = IrMono(disp(), IrTxt, 9); val.Width = 48; val.TextAlignment = TextAlignment.Right;- var fill = new Border { Height = 3, Background = IrAmber, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 8, Height = 9, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var slot = new Panel { Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center }, fill, handle } };+ var fill = new Border { Height = 3, Background = IrAmber, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var handle = new Border { Width = 8, Height = 9, Background = NotaPalette.TextSecondary, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };+ var slot = new Panel { Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = NotaRadius.Clip, VerticalAlignment = VerticalAlignment.Center }, fill, handle } };void Vis(double v) { double W = slot.Bounds.Width; fill.Width = v * W; handle.Margin = new Thickness(Math.Clamp(v * W - 4, 0, Math.Max(0, W - 8)), 0, 0, 0); }bool drag = false;void SetX(double x) { double v = Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1); set(v); Vis(v); val.Text = disp(); }@@ -1240,7 +1216,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)var rows = new StackPanel { Spacing = 2 };foreach (int c in pads) rows.Children.Add(DrumMixerRow(a, c));- if (pads.Count == 0) rows.Children.Add(new TextBlock { Text = "No pads loaded — drop samples on the Pads view.", FontSize = 10, Foreground = IrMuted, Margin = new Thickness(0, 8, 0, 0), HorizontalAlignment = HorizontalAlignment.Center });+ if (pads.Count == 0) rows.Children.Add(new TextBlock { Text = "No pads loaded — drop samples on the Pads view.", FontSize = 9, Foreground = IrMuted, Margin = new Thickness(0, 8, 0, 0), HorizontalAlignment = HorizontalAlignment.Center });var scroll = new ScrollViewer { Content = rows, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled, Padding = new Thickness(9, 4, 9, 4) };DockPanel.SetDock(headBar, Dock.Top);return new DockPanel { LastChildFill = true, Children = { headBar, scroll } };@@ -1249,25 +1225,18 @@ internal sealed class RackCardView(DeviceCardContext ctx)private Control DrumMixerRow(IRackAccess a, int c){int note = a.ChainTriggerNote(c);- Color hue = PadHue(c);+ var hue = PadHue(c);var g = new Grid { ColumnDefinitions = new ColumnDefinitions("96,26,*,40,44"), ColumnSpacing = 6, Height = 13 };var nameCell = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = {- new Border { Width = 4, Height = 10, CornerRadius = new CornerRadius(1), Background = new SolidColorBrush(hue), VerticalAlignment = VerticalAlignment.Center },+ new Border { Width = 4, Height = 10, CornerRadius = NotaRadius.Bar, Background = hue, VerticalAlignment = VerticalAlignment.Center },new TextBlock { Text = PadName(a, c), FontSize = 9, Foreground = c == Sel ? IrAmberLit : IrTxt, TextTrimming = TextTrimming.CharacterEllipsis, VerticalAlignment = VerticalAlignment.Center } } };nameCell.PointerPressed += (_, _) => SelectPad(c);Grid.SetColumn(nameCell, 0); g.Children.Add(nameCell);var noteTb = IrMono(NoteName(note), IrMuted); Grid.SetColumn(noteTb, 1); g.Children.Add(noteTb);- var fill = new Border { Height = 4, Background = IrAmber, Opacity = 0.75, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var handle = new Border { Width = 7, Height = 10, Background = NotaPalette.TextSecondary, CornerRadius = new CornerRadius(2), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };- var vslot = new Panel { Height = 10, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent, Children = { new Border { Height = 4, Background = IrInset, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center }, fill, handle } };- void Vis(double v) { double W = vslot.Bounds.Width; fill.Width = v * W; handle.Margin = new Thickness(Math.Clamp(v * W - 3, 0, Math.Max(0, W - 7)), 0, 0, 0); }- bool drag = false;- void SetX(double x) { double v = Math.Clamp(x / Math.Max(1, vslot.Bounds.Width), 0, 1); a.SetChainGain(c, NormVol(v)); Vis(v); }- vslot.PointerPressed += (_, e) => { drag = true; e.Pointer.Capture(vslot); SetX(e.GetPosition(vslot).X); };- vslot.PointerMoved += (_, e) => { if (drag) SetX(e.GetPosition(vslot).X); };- vslot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); } };- _irTick.Add(() => { if (!drag) Vis(VolNorm(a.ChainGain(c))); });+ var vslot = new SliderTrack { Norm = VolNorm(a.ChainGain(c)) };+ vslot.Changed += v => a.SetChainGain(c, NormVol(v));+ _irTick.Add(() => { if (!vslot.Dragging) vslot.Norm = VolNorm(a.ChainGain(c)); });MidiLearn.Bind(vslot, MidiTarget.RackChainGain(T, a.AutomationDeviceIndex, c), "Pad Volume");Grid.SetColumn(vslot, 2); g.Children.Add(vslot);@@ -1286,13 +1255,14 @@ internal sealed class RackCardView(DeviceCardContext ctx)}// ---- drum helpers: pad hue + value mapping + mini peaks ----- private static Color PadHue(int chain) => NotaPalette.TrackColors[((chain % 8) + 8) % 8];- private static IBrush PadFill(Color c, double alpha) => new SolidColorBrush(Color.FromArgb((byte)(Math.Clamp(alpha, 0, 1) * 255), c.R, c.G, c.B));+ // Pad hues are the track palette slots themselves, so a pad re-tints with the theme.+ private static SolidColorBrush PadHue(int chain) => NotaPalette.TrackBrushes[((chain % 8) + 8) % 8];+ private static IBrush PadFill(SolidColorBrush c, double alpha) => NotaPalette.Wash(c, (byte)(Math.Clamp(alpha, 0, 1) * 255));private static double VolNorm(float gain) { double db = gain <= 0.001 ? -60 : 20 * Math.Log10(gain); return Math.Clamp((db + 60) / 66.0, 0, 1); }private static float NormVol(double v) { double db = -60 + v * 66; return (float)Math.Pow(10, db / 20); }- private static string VolText(float gain) { double db = gain <= 0.001 ? -60 : 20 * Math.Log10(gain); return db <= -59 ? "−∞" : $"{db:+0.0;−0.0;0.0} dB"; }+ private static string VolText(float gain) { double db = gain <= 0.001 ? -60 : 20 * Math.Log10(gain); return db <= -59 ? "−∞" : $"{db:+0.0;−0.0;0.0}\u2009dB"; }private static string PanText(float pan) { int p = (int)Math.Round(pan * 50); return p == 0 ? "C" : (p < 0 ? $"{-p}L" : $"{p}R"); }- private static string DecayText(float d) => d >= 0.999f ? "hold" : $"{20 * Math.Pow(100, d):0} ms";+ private static string DecayText(float d) => d >= 0.999f ? "hold" : $"{20 * Math.Pow(100, d):0}\u2009ms";private static float[] MiniPeaks(float[] raw, int ch, long frames, int buckets){var o = new float[buckets];@@ -1366,8 +1336,8 @@ internal sealed class RackCardView(DeviceCardContext ctx)string name = a.HasInstrumentChains ? a.ChainInstrumentName(c) : $"Chain {c + 1}";if (string.IsNullOrEmpty(name)) name = $"Chain {c + 1}";- var nameTb = new TextBlock { Text = name, FontSize = 10, FontWeight = FontWeight.SemiBold, Foreground = sel ? AccentBright : TextPrimary, TextTrimming = TextTrimming.CharacterEllipsis, VerticalAlignment = VerticalAlignment.Center };- var rm = Glyph("✕", true, () => { a.RemoveChain(c); if (Sel > 0) Sel--; _ctx.RequestRebuild(); });+ var nameTb = new TextBlock { Text = name, FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = sel ? AccentBright : TextPrimary, TextTrimming = TextTrimming.CharacterEllipsis, VerticalAlignment = VerticalAlignment.Center };+ var rm = Glyph(GlyphKind.Close, true, () => { a.RemoveChain(c); if (Sel > 0) Sel--; _ctx.RequestRebuild(); });ToolTip.SetTip(rm, "Remove chain");var head = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto") };head.Children.Add(nameTb);@@ -1384,7 +1354,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)var row = new Border{Background = sel ? RowSel : Card2, BorderBrush = sel ? Brass : BorderDef, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(5), Padding = new Thickness(6, 5), Cursor = new Cursor(StandardCursorType.Hand),+ CornerRadius = NotaRadius.Tile, Padding = new Thickness(6, 5), Cursor = new Cursor(StandardCursorType.Hand),Child = new StackPanel { Spacing = 5, Children = { head, ctrls } },};// Click the row (not its controls, which consume the press) to select it.@@ -1398,9 +1368,9 @@ internal sealed class RackCardView(DeviceCardContext ctx){if (!BrowserView.IsBrowserDrag || !IsEffect(BrowserView.CurrentDrag)) { e.DragEffects = DragDropEffects.None; return; }e.DragEffects = DragDropEffects.Copy; e.Handled = true; _ctx.HideDropGlow();- row.BorderBrush = AccentBright; row.BorderThickness = new Thickness(2);+ row.BorderBrush = AccentBright; // drop target: colour only});- DragDrop.AddDragLeaveHandler(row, (_, _) => { row.BorderBrush = sel ? Brass : BorderDef; row.BorderThickness = new Thickness(1); });+ DragDrop.AddDragLeaveHandler(row, (_, _) => { row.BorderBrush = sel ? Brass : BorderDef; });DragDrop.AddDropHandler(row, (_, e) =>{row.BorderBrush = sel ? Brass : BorderDef; row.BorderThickness = new Thickness(1);@@ -1416,7 +1386,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)if (a.ChainCount() == 0){col.Children.Add(SectionLabel(title ?? "DEVICES"));- var hint = new TextBlock { Text = "Add a chain to build its device chain.", FontSize = 10, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center };+ var hint = new TextBlock { Text = "Add a chain to build its device chain.", FontSize = 9, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center };Grid.SetRow(hint, 1); col.Children.Add(hint);return col;}@@ -1466,7 +1436,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)for (int p = 0; p < count; p++) wrap.Children.Add(new Border { Width = 148, Margin = new Thickness(2, 3), Child = row(p) });var scroll = new ScrollViewer { Content = wrap, MaxHeight = 360, HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled, VerticalScrollBarVisibility = ScrollBarVisibility.Auto };return new Border { Width = 476, Background = NotaPalette.BgApp, Padding = new Thickness(10), Child =- new StackPanel { Spacing = 7, Children = { new TextBlock { Text = title, FontSize = 11, FontWeight = FontWeight.SemiBold, Foreground = TextPrimary }, scroll } } };+ new StackPanel { Spacing = 7, Children = { new TextBlock { Text = title, FontSize = NotaType.DeviceName, FontWeight = FontWeight.SemiBold, Foreground = TextPrimary }, scroll } } };}// A small header button that pops out a device's full UI in a floating window.@@ -1521,16 +1491,16 @@ internal sealed class RackCardView(DeviceCardContext ctx)ctrls.Children.Add(a.ChainDeviceBuiltinKind(sc, d) < 0? ActionChip("Full", () => a.OpenChainDeviceEditor(sc, d)): FullUiChip(dnm, _ => ParamGridContent(dnm, a.ChainDeviceParamCount(sc, d), p => RackDeviceParamRow(a, sc, d, p))));- ctrls.Children.Add(Glyph("◀", d > 0, () => { a.MoveChainDevice(sc, d, d - 1); _ctx.RequestRebuild(); }));- ctrls.Children.Add(Glyph("▶", d < dc - 1, () => { a.MoveChainDevice(sc, d, d + 1); _ctx.RequestRebuild(); }));- ctrls.Children.Add(Glyph("✕", true, () => { a.RemoveChainDevice(sc, d); _ctx.RequestRebuild(); }));+ ctrls.Children.Add(Glyph(GlyphKind.StepLeft, d > 0, () => { a.MoveChainDevice(sc, d, d - 1); _ctx.RequestRebuild(); }));+ ctrls.Children.Add(Glyph(GlyphKind.StepRight, d < dc - 1, () => { a.MoveChainDevice(sc, d, d + 1); _ctx.RequestRebuild(); }));+ ctrls.Children.Add(Glyph(GlyphKind.Close, true, () => { a.RemoveChainDevice(sc, d); _ctx.RequestRebuild(); }));var body = new StackPanel { Spacing = 7 };body.Children.Add(Toggle(byp ? "BYPASSED" : "ACTIVE", !byp, Success, () => { a.SetChainDeviceBypassed(sc, d, !byp); _ctx.RequestRebuild(); }));int pc = a.ChainDeviceParamCount(sc, d);for (int p = 0; p < pc; p++) body.Children.Add(RackDeviceParamRow(a, sc, d, p));var card = DeviceCardShell(a.ChainDeviceName(sc, d), ctrls, body, 180);- card.Opacity = byp ? 0.6 : 1.0;+ if (byp) card.AttachedToVisualTree += (_, _) => Inactive.Set(body, true, interactive: true);return card;}@@ -1541,8 +1511,8 @@ internal sealed class RackCardView(DeviceCardContext ctx)Spacing = 4, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,Children ={- new TextBlock { Text = "+", FontSize = 16, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center },- new TextBlock { Text = "Add device", FontSize = 10, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center },+ new Glyph(GlyphKind.Plus, 12) { Foreground = TextTertiary },+ new TextBlock { Text = "Add device", FontSize = 9, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center },new TextBlock { Text = "or drop a plug-in", FontSize = 8, Foreground = TextDisabled, HorizontalAlignment = HorizontalAlignment.Center },},};@@ -1570,7 +1540,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)// scrollable body.private Border DeviceCardShell(string title, Control? headerRight, Control body, double width){- var titleTb = new TextBlock { Text = title, FontSize = 10, FontWeight = FontWeight.SemiBold, Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis };+ var titleTb = new TextBlock { Text = title, FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis };var headerGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto") };headerGrid.Children.Add(titleTb);if (headerRight != null) { Grid.SetColumn(headerRight, 1); headerGrid.Children.Add(headerRight); }@@ -1591,7 +1561,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)return new Border{Width = width, Background = Card2, BorderBrush = BorderDef, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(6), ClipToBounds = true, Child = stack,+ CornerRadius = NotaRadius.Panel, ClipToBounds = true, Child = stack,};}@@ -1722,9 +1692,9 @@ internal sealed class RackCardView(DeviceCardContext ctx){var b = new Border{- BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5),+ BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile,Padding = new Thickness(8, 5), Cursor = new Cursor(StandardCursorType.Hand), HorizontalAlignment = HorizontalAlignment.Left,- Child = new TextBlock { Text = "+ Add chain", FontSize = 10, Foreground = TextSecondary },+ Child = Glyph.Labeled("Add chain", GlyphKind.Plus, 9, 8),};b.PointerPressed += (_, _) =>{@@ -1814,7 +1784,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)var chip = new Border{Background = mapped >= 0 ? Brass : Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(3), Padding = new Thickness(4, 0), Cursor = new Cursor(StandardCursorType.Hand),+ CornerRadius = NotaRadius.Badge, Padding = new Thickness(4, 0), Cursor = new Cursor(StandardCursorType.Hand),VerticalAlignment = VerticalAlignment.Center, Child = tb,};ToolTip.SetTip(chip, mapped >= 0 ? $"Mapped to Macro {mapped + 1} — click to change" : "Map to a macro");@@ -1941,7 +1911,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)var b = new Border{Background = Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(4), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand),+ CornerRadius = NotaRadius.Control, Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = text, FontSize = 9, Foreground = TextSecondary },};b.PointerPressed += (_, e) => { e.Handled = true; onClick(); };@@ -1953,7 +1923,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)var b = new Border{Background = active ? activeBrush : Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(4), Padding = new Thickness(6, 2), Cursor = new Cursor(StandardCursorType.Hand),+ CornerRadius = NotaRadius.Control, Padding = new Thickness(6, 2), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = text, FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = active ? OnAccent : TextSecondary },};b.PointerPressed += (_, e) => { e.Handled = true; onClick(); };@@ -1964,8 +1934,8 @@ internal sealed class RackCardView(DeviceCardContext ctx){var headerBar = new Border{- Height = 26, BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 0, 1), Padding = new Thickness(8, 0),- Child = new TextBlock { Text = title, FontSize = 11, FontWeight = FontWeight.SemiBold, Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center },+ Height = DeviceCardKit.HeaderH, BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 0, 1), Padding = new Thickness(8, 0),+ Child = new TextBlock { Text = title, FontSize = NotaType.DeviceName, FontWeight = FontWeight.SemiBold, Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center },};var stack = new Grid { RowDefinitions = new RowDefinitions("Auto,*") };stack.Children.Add(headerBar);@@ -1975,7 +1945,7 @@ internal sealed class RackCardView(DeviceCardContext ctx)return new Border{Width = width, Height = CardH, Background = Raised, BorderBrush = BorderDef,- BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(7), ClipToBounds = true, Child = stack,+ BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Body, ClipToBounds = true, Child = stack,};}}diff --git a/src/managed/Nota.App/DeviceCards/Sampler/SamplerWaveform.cs b/src/managed/Nota.App/DeviceCards/Sampler/SamplerWaveform.csindex 12197a55..f85bfed9 100644--- a/src/managed/Nota.App/DeviceCards/Sampler/SamplerWaveform.cs+++ b/src/managed/Nota.App/DeviceCards/Sampler/SamplerWaveform.cs@@ -19,14 +19,15 @@ internal sealed class SamplerWaveform : Controlprivate static readonly IBrush WaveDim = NotaPalette.Wash(NotaPalette.Accent, 0x40);private static readonly IBrush Outside = NotaPalette.Wash(NotaPalette.BgSunken, 0x80);private static readonly IBrush LoopFill = NotaPalette.Wash(NotaPalette.Accent, 0x14); // brass wash- private static readonly IPen StartPen = new Pen(NotaPalette.Success, 2); // start = green- private static readonly IPen EndPen = new Pen(NotaPalette.Danger, 2); // end = red+ // Trim boundaries: 1px brass lines (almanac § oscillogram); green and red are status only.+ private static readonly IPen StartPen = new Pen(NotaPalette.Accent, 1);+ private static readonly IPen EndPen = new Pen(NotaPalette.Accent, 1);private static readonly IPen LoopPen = new Pen(NotaPalette.Wash(NotaPalette.AccentBright, 0xC8), 1.2);private static readonly IPen MidLine = new Pen(NotaPalette.GridBar, 1);- private static readonly IPen GridPen = new Pen(NotaPalette.Wash(NotaPalette.BorderStrong, 0x55), 1);+ private static readonly IPen GridPen = NotaGraph.GridPen;private static readonly IPen PlayPen = new Pen(NotaPalette.AccentBright, 1.4) { };private static readonly IBrush GridText = NotaPalette.TextTertiary;- private static readonly Typeface Mono = new("monospace");+ private static readonly Typeface Mono = NotaFonts.Mono;private float[] _peaks = Array.Empty<float>();private double _start, _end = 1, _ls, _le = 1;@@ -77,7 +78,7 @@ internal sealed class SamplerWaveform : Control{double w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;- ctx.DrawRectangle(Bg, null, new Rect(0, 0, w, h), 4, 4);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));double cy = h / 2;// Time grid (behind the waveform): vertical lines + labels at a nice step.@@ -88,7 +89,7 @@ internal sealed class SamplerWaveform : Control{double x = t / _dur * w;ctx.DrawLine(GridPen, new Point(x, 0), new Point(x, h));- string lbl = _dur >= 1 ? $"{t:0.##}s" : $"{(int)Math.Round(t * 1000)}";+ string lbl = _dur >= 1 ? $"{t:0.##}\u2009s" : $"{(int)Math.Round(t * 1000)}";ctx.DrawText(new FormattedText(lbl, System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Mono, 8, GridText), new Point(x + 2, h - 11));}}diff --git a/src/managed/Nota.App/DeviceChainView.Clipboard.cs b/src/managed/Nota.App/DeviceChainView.Clipboard.csindex 51ed348f..da058972 100644--- a/src/managed/Nota.App/DeviceChainView.Clipboard.cs+++ b/src/managed/Nota.App/DeviceChainView.Clipboard.cs@@ -152,10 +152,11 @@ public sealed partial class DeviceChainView// ---- context menu (header right-click) --------------------------------// Adds Copy / Cut / Paste / Delete above the existing "Save preset" item.- private void ShowDeviceContextMenu(Control anchor, ChainKind kind, int di)+ private void ShowDeviceContextMenu(Control anchor, ChainKind kind, int di, Action<MenuFlyout>? header = null){SelectDevice(kind, di);var flyout = new MenuFlyout();+ header?.Invoke(flyout);void Add(string header, bool enabled, Action act){var mi = new MenuItem { Header = header, IsEnabled = enabled };@@ -172,7 +173,7 @@ public sealed partial class DeviceChainViewflyout.ShowAt(anchor, showAtPointer: true);}- // ---- drag-reorder (grab a card's ⠿ handle) ----------------------------+ // ---- drag-reorder (grab a card by its header) ---------------------------// Tag stamped on each device card so a drag can find its same-domain siblings in _row.private sealed record DevTag(ChainKind Kind, int Index);@@ -183,7 +184,7 @@ public sealed partial class DeviceChainViewprivate Control? _devDragCard;private readonly Border _devDropBar = new(){- Width = 3, Background = AccentBright, CornerRadius = new CornerRadius(2),+ Width = 3, Background = AccentBright, CornerRadius = NotaRadius.Clip,Margin = new Thickness(-4, 6, 1, 6), IsHitTestVisible = false,};diff --git a/src/managed/Nota.App/DeviceChainView.Midi.cs b/src/managed/Nota.App/DeviceChainView.Midi.csindex e24f4d6c..8035613d 100644--- a/src/managed/Nota.App/DeviceChainView.Midi.cs+++ b/src/managed/Nota.App/DeviceChainView.Midi.cs@@ -23,6 +23,6 @@ public sealed partial class DeviceChainViewName: name, Subtitle: "MIDI", DeviceIndex: index, Count: count, Bypassed: bypassed, Bypassable: true,CanMove: true, CanDelete: true, PresetKind: kind, IsInstrument: false, Width: body.Width, Kind: ChainKind.Midi);var content = body.Build(NewCardContext(), index);- return BuildCardShell(spec, body.FullBleed ? content : new Border { Padding = new Thickness(8), Child = content });+ return BuildCardShell(spec, body.FullBleed ? content : new Border { Padding = new Thickness(NotaSpace.DeviceInset), Child = content });}}diff --git a/src/managed/Nota.App/DeviceChainView.Shell.cs b/src/managed/Nota.App/DeviceChainView.Shell.csindex 2a9992b3..956814b5 100644--- a/src/managed/Nota.App/DeviceChainView.Shell.cs+++ b/src/managed/Nota.App/DeviceChainView.Shell.cs@@ -99,61 +99,125 @@ public sealed partial class DeviceChainView{int di = s.DeviceIndex;var extra = Extra(s.Kind, di);- // Rich chrome (preset picker · A/B · meter) needs room; narrow effect cards get- // the essential chrome only. Instruments (≥700) and wide effects show everything.- bool full = !double.IsNaN(s.Width) && s.Width >= 520;- // ---- power dot: bypass toggle (effects) or a static status light (instruments) ----- var dot = new Ellipse { Width = 7, Height = 7, VerticalAlignment = VerticalAlignment.Center, Fill = s.Bypassed ? Brushes.Transparent : Success, Stroke = s.Bypassed ? TextSecondary : null, StrokeThickness = 1 };- var dotBtn = new Border { Child = dot, Padding = new Thickness(2), VerticalAlignment = VerticalAlignment.Center };- if (s.Bypassable) { dotBtn.Cursor = new Cursor(StandardCursorType.Hand); ToolTip.SetTip(dotBtn, s.Bypassed ? "Bypassed — click to enable" : "Active — click to bypass"); dotBtn.PointerPressed += (_, _) => { if (s.Kind == ChainKind.Midi) _engine.SetMidiEffectBypassed(_trackId, di, !s.Bypassed); else _engine.SetDeviceBypassed(_trackId, di, !s.Bypassed); Rebuild(); Changed?.Invoke(); }; }-- var left = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 7, VerticalAlignment = VerticalAlignment.Center };- left.Children.Add(dotBtn);- left.Children.Add(new TextBlock { Text = s.Name, FontSize = 11, FontWeight = FontWeight.SemiBold, Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis });- if (!string.IsNullOrEmpty(s.Subtitle)) left.Children.Add(new TextBlock { Text = s.Subtitle, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center });- if (full) left.Children.Add(PresetPicker(s, extra));+ // ---- header (22): the almanac's device header — name on the left; the processing+ // type as a mono badge and the bypass switch on the right; nothing else. Presets,+ // A/B, move and delete live in the header's context menu; the whole header drags the+ // card to a new slot; Delete removes the selected card.+ var name = new TextBlock+ {+ Text = s.Name, FontSize = NotaType.DeviceName, FontWeight = FontWeight.SemiBold, Foreground = TextPrimary,+ VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis,+ };- // ---- right group ----var right = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center };- // Voice count (instruments that report it).+ // Type badge (mono caps). An instrument that reports its voices shows them here, live,+ // as the badge's value — e.g. "SYNTH · 3/16".+ string type = (s.Subtitle ?? "").ToUpperInvariant();+ var badge = new TextBlock+ {+ Text = type, FontFamily = NotaFonts.MonoFamily, FontSize = NotaType.Eyebrow, FontWeight = FontWeight.Medium,+ LetterSpacing = 1.2, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center,+ };if (s.IsInstrument && _engine.InstrumentVoiceCount(_trackId) >= 0){- var vt = Mono("0/16", 30); vt.Foreground = Teal; vt.TextAlignment = TextAlignment.Left;- if (s.VoiceLabel != null) { vt.Width = double.NaN; vt.MinWidth = 30; } // e.g. "PARA 3/4" — size to the text- _deviceLiveRefreshers.Add(() => { int v = _engine.InstrumentVoiceCount(_trackId); vt.Text = s.VoiceLabel?.Invoke(_engine, _trackId, v) ?? (_engine.PluginParamGet(_trackId, -1, IndexOfId("mono")) > 0.5f ? "MONO" : $"{Math.Max(0, v)}/16"); });- right.Children.Add(vt);+ _deviceLiveRefreshers.Add(() =>+ {+ int v = _engine.InstrumentVoiceCount(_trackId);+ string voices = s.VoiceLabel?.Invoke(_engine, _trackId, v)+ ?? (_engine.PluginParamGet(_trackId, -1, IndexOfId("mono")) > 0.5f ? "MONO" : $"{Math.Max(0, v)}/16");+ badge.Text = type.Length > 0 ? $"{type} · {voices}" : voices;+ });}+ if (badge.Text.Length > 0 || s.IsInstrument) right.Children.Add(badge);- if (full) { right.Children.Add(ABControl(s, extra)); right.Children.Add(MeterBadge()); }-- void Move(int to) { if (s.Kind == ChainKind.Midi) _engine.MoveMidiEffect(_trackId, di, to); else _engine.MoveDevice(_trackId, di, to); ExtrasMoved(s.Kind, di, to); Rebuild(); Changed?.Invoke(); }- if (s.CanMove)+ if (s.Bypassable){- right.Children.Add(Glyph("◀", di > 0, () => Move(di - 1)));- right.Children.Add(Glyph("▶", di < s.Count - 1, () => Move(di + 1)));+ var bypass = new SwitchTrack { IsOn = !s.Bypassed, Cursor = new Cursor(StandardCursorType.Hand) };+ ToolTip.SetTip(bypass, s.Bypassed ? "Bypassed — click to enable" : "Active — click to bypass");+ bypass.PointerPressed += (_, e) =>+ {+ if (!e.GetCurrentPoint(bypass).Properties.IsLeftButtonPressed) return;+ e.Handled = true; // not a drag, not a selection click+ if (s.Kind == ChainKind.Midi) _engine.SetMidiEffectBypassed(_trackId, di, !s.Bypassed);+ else _engine.SetDeviceBypassed(_trackId, di, !s.Bypassed);+ Rebuild(); Changed?.Invoke();+ };+ right.Children.Add(bypass);}- if (s.CanDelete) right.Children.Add(Glyph("✕", true, () => { if (s.Kind == ChainKind.Midi) _engine.RemoveMidiEffect(_trackId, di); else _engine.RemoveDevice(_trackId, di); ExtrasRemoved(s.Kind, di); Rebuild(); Changed?.Invoke(); }));- var handle = new TextBlock++ var headerGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), ColumnSpacing = 8 };+ headerGrid.Children.Add(name);+ Grid.SetColumn(right, 1); headerGrid.Children.Add(right);+ var headerBar = new Border{- Text = "⠿", FontSize = 11, Foreground = TextDisabled, VerticalAlignment = VerticalAlignment.Center,- Background = Brushes.Transparent, Padding = new Thickness(2, 0),- Cursor = s.CanMove ? new Cursor(StandardCursorType.SizeAll) : null,+ Height = DeviceCardKit.HeaderH, Background = ShellHdr, BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 0, 1),+ Padding = new Thickness(NotaSpace.DeviceInsetWide, 0), Child = headerGrid,+ Cursor = s.CanMove && SelectableKind(s.Kind) ? new Cursor(StandardCursorType.SizeAll) : null,};- ToolTip.SetTip(handle, "Drag to reorder");- right.Children.Add(handle);+ ToolTip.SetTip(headerBar, s.CanMove ? "Drag to reorder · right-click for presets, A/B, move and delete" : "Right-click for presets and more");- var headerGrid = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto") };- headerGrid.Children.Add(left);- Grid.SetColumn(right, 1); headerGrid.Children.Add(right);- var headerBar = new Border { Height = 26, Background = ShellHdr, BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 0, 1), Padding = new Thickness(9, 0), Child = headerGrid };- // Click selects the device (accent border + keyboard target); right-click opens the- // context menu (copy/cut/paste/delete/save preset).+ void Move(int to) { if (s.Kind == ChainKind.Midi) _engine.MoveMidiEffect(_trackId, di, to); else _engine.MoveDevice(_trackId, di, to); ExtrasMoved(s.Kind, di, to); Rebuild(); Changed?.Invoke(); }++ // What the header used to carry, now in its context menu.+ void HeaderMenu(MenuFlyout flyout)+ {+ if (s.PresetKind >= 0 || s.IsInstrument || s.Kind == ChainKind.Midi)+ {+ var presets = _factory.All().Where(p => p.BuiltinKind == s.PresetKind+ && (s.Kind == ChainKind.Midi ? p.IsMidiEffect : (p.IsInstrument == s.IsInstrument && !p.IsMidiEffect))).ToList();+ if (presets.Count > 0)+ {+ int cur = presets.FindIndex(p => p.Id == extra.PresetId);+ void Apply(FactoryPresetInfo p) { _factory.ApplyInPlace(_engine, p.Id, _trackId, di); extra.PresetId = p.Id; extra.Preset = p.DisplayName; Rebuild(); }+ var menu = new MenuItem { Header = $"Preset: {(string.IsNullOrEmpty(extra.Preset) ? "Init" : extra.Preset)}" };+ int n = presets.Count;+ var prev = new MenuItem { Header = "Previous preset" }; prev.Click += (_, _) => Apply(presets[cur < 0 ? n - 1 : ((cur - 1) % n + n) % n]);+ var next = new MenuItem { Header = "Next preset" }; next.Click += (_, _) => Apply(presets[cur < 0 ? 0 : (cur + 1) % n]);+ menu.Items.Add(prev); menu.Items.Add(next); menu.Items.Add(new Separator());+ for (int i = 0; i < n; i++)+ {+ var info = presets[i];+ var mi = new MenuItem { Header = info.DisplayName, ToggleType = MenuItemToggleType.Radio, IsChecked = i == cur };+ mi.Click += (_, _) => Apply(info);+ menu.Items.Add(mi);+ }+ flyout.Items.Add(menu);+ }+ }+ // A / B compare of two full-parameter snapshots.+ float[] Capture() => CaptureParams(s.Kind, di);+ if (extra.A == null) { extra.A = Capture(); extra.B = (float[])extra.A.Clone(); extra.Active = 0; }+ var ab = new MenuItem { Header = $"Compare: {(extra.Active == 0 ? "A" : "B")}" };+ void Switch(int slot)+ {+ if (slot == extra.Active) return;+ if (extra.Active == 0) extra.A = Capture(); else extra.B = Capture();+ extra.Active = slot;+ ApplyParams(s.Kind, di, slot == 0 ? extra.A! : extra.B!);+ Rebuild();+ }+ var toA = new MenuItem { Header = "A", ToggleType = MenuItemToggleType.Radio, IsChecked = extra.Active == 0 }; toA.Click += (_, _) => Switch(0);+ var toB = new MenuItem { Header = "B", ToggleType = MenuItemToggleType.Radio, IsChecked = extra.Active == 1 }; toB.Click += (_, _) => Switch(1);+ var copy = new MenuItem { Header = extra.Active == 0 ? "Copy A to B" : "Copy B to A" };+ copy.Click += (_, _) => { var c = Capture(); if (extra.Active == 0) extra.B = (float[])c.Clone(); else extra.A = (float[])c.Clone(); };+ ab.Items.Add(toA); ab.Items.Add(toB); ab.Items.Add(new Separator()); ab.Items.Add(copy);+ flyout.Items.Add(ab);+ if (s.CanMove)+ {+ var left = new MenuItem { Header = "Move left", IsEnabled = di > 0 }; left.Click += (_, _) => Move(di - 1);+ var rightMi = new MenuItem { Header = "Move right", IsEnabled = di < s.Count - 1 }; rightMi.Click += (_, _) => Move(di + 1);+ flyout.Items.Add(left); flyout.Items.Add(rightMi);+ }+ flyout.Items.Add(new Separator());+ }++ // Click selects the device (accent ring + keyboard target); right-click opens the menu.headerBar.PointerPressed += (_, e) =>{var pt = e.GetCurrentPoint(headerBar).Properties;- if (pt.IsRightButtonPressed) { ShowDeviceContextMenu(headerBar, s.Kind, di); return; }+ if (pt.IsRightButtonPressed) { ShowDeviceContextMenu(headerBar, s.Kind, di, HeaderMenu); return; }if (pt.IsLeftButtonPressed) SelectDevice(s.Kind, di);};@@ -167,139 +231,24 @@ public sealed partial class DeviceChainView// inside the clip so its rounded corners render cleanly.var selRing = new Border{- BorderBrush = AccentBright, BorderThickness = new Thickness(1.5),- CornerRadius = new CornerRadius(7), Margin = new Thickness(0.5),+ BorderBrush = AccentBright, BorderThickness = new Thickness(1),+ CornerRadius = NotaRadius.Body, Margin = new Thickness(0.5),IsHitTestVisible = false, IsVisible = sel,};var card = new Border{Width = s.Width, Height = CardH, Background = ShellBg, BorderBrush = BorderDef,- BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(8), ClipToBounds = true,- Opacity = s.Bypassed ? 0.7 : 1.0,+ BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Body, ClipToBounds = true,Child = new Panel { Children = { root, selRing } },};- // The ⠿ handle drags the card to a new slot within its domain (audio FX / MIDI FX).- if (s.CanMove && SelectableKind(s.Kind)) HookDeviceDrag(handle, card, s.Kind, di);+ // Bypassed: the body loses its brass but stays playable (almanac: no opacity for state).+ if (s.Bypassed) card.AttachedToVisualTree += (_, _) => Inactive.Set(bodyHost, true, interactive: true);+ // The whole header drags the card to a new slot within its domain (audio FX / MIDI FX).+ if (s.CanMove && SelectableKind(s.Kind)) HookDeviceDrag(headerBar, card, s.Kind, di);return card;}private int IndexOfId(string id){ int n = _engine.PluginParamCount(_trackId, -1); for (int i = 0; i < n; i++) if (_engine.PluginParamId(_trackId, -1, i) == id) return i; return -1; }- // Preset picker "‹ Name ▾ ›": the name opens a flyout of factory presets for this kind- // (current one checked); ‹ › step to the previous / next preset, wrapping. From Init,- // › goes to the first preset and ‹ to the last. Always applied in place.- private Control PresetPicker(ShellSpec s, CardExtra extra)- {- var presets = _factory.All().Where(p => p.BuiltinKind == s.PresetKind- && (s.Kind == ChainKind.Midi ? p.IsMidiEffect : (p.IsInstrument == s.IsInstrument && !p.IsMidiEffect))).ToList();- int cur = presets.FindIndex(p => p.Id == extra.PresetId);- void Apply(FactoryPresetInfo p)- {- _factory.ApplyInPlace(_engine, p.Id, _trackId, s.DeviceIndex);- extra.PresetId = p.Id; extra.Preset = p.DisplayName;- Rebuild();- }-- var label = new TextBlock { Text = string.IsNullOrEmpty(extra.Preset) ? "Init" : extra.Preset, FontSize = 10, Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis, MaxWidth = 90 };- var box = new Border- {- MinWidth = 96, Background = Brushes.Transparent, Padding = new Thickness(6, 0), Cursor = new Cursor(StandardCursorType.Hand),- Child = new DockPanel { Children = { new TextBlock { Text = "▾", FontSize = 8, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center, [DockPanel.DockProperty] = Dock.Right }, label } },- };- box.PointerPressed += (_, _) =>- {- var flyout = new MenuFlyout();- if (presets.Count == 0) flyout.Items.Add(new MenuItem { Header = "No presets", IsEnabled = false });- for (int i = 0; i < presets.Count; i++)- {- var info = presets[i];- var mi = new MenuItem { Header = info.DisplayName, ToggleType = MenuItemToggleType.CheckBox, IsChecked = i == cur };- mi.Click += (_, _) => Apply(info);- flyout.Items.Add(mi);- }- flyout.ShowAt(box, showAtPointer: true);- };-- Border Step(int dir)- {- bool on = presets.Count > 0;- var chevron = new Path- {- Data = Geometry.Parse(dir < 0 ? "M3.5,0 L0,3.5 L3.5,7" : "M0,0 L3.5,3.5 L0,7"),- Stroke = on ? TextTertiary : TextDisabled, StrokeThickness = 1.2,- StrokeLineCap = PenLineCap.Round, StrokeJoin = PenLineJoin.Round,- HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,- };- var b = new Border { Width = 16, Background = Brushes.Transparent, Child = chevron };- if (!on) return b;- b.Cursor = new Cursor(StandardCursorType.Hand);- ToolTip.SetTip(b, dir < 0 ? "Previous preset" : "Next preset");- b.PointerEntered += (_, _) => chevron.Stroke = TextPrimary;- b.PointerExited += (_, _) => chevron.Stroke = TextTertiary;- b.PointerPressed += (_, e) =>- {- if (!e.GetCurrentPoint(b).Properties.IsLeftButtonPressed) return;- e.Handled = true;- int n = presets.Count;- Apply(presets[cur < 0 ? (dir > 0 ? 0 : n - 1) : ((cur + dir) % n + n) % n]);- };- return b;- }- Border Divider() => new() { Width = 1, Background = BorderDef };-- return new Border- {- Height = 18, Background = ShellInset, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(4),- ClipToBounds = true, VerticalAlignment = VerticalAlignment.Center,- Child = new StackPanel { Orientation = Orientation.Horizontal, Children = { Step(-1), Divider(), box, Divider(), Step(+1) } },- };- }-- // A | B compare of two full-param snapshots + copy-active-to-other.- private Control ABControl(ShellSpec s, CardExtra extra)- {- int di = s.DeviceIndex; var kind = s.Kind;- float[] Capture() => CaptureParams(kind, di);- void Apply(float[] p) => ApplyParams(kind, di, p);- if (extra.A == null) { extra.A = Capture(); extra.B = (float[])extra.A.Clone(); extra.Active = 0; }- Border? bA = null, bB = null;- void Hi() { if (bA == null || bB == null) return; bA.Background = extra.Active == 0 ? AccentSubtleB : Brushes.Transparent; ((TextBlock)bA.Child!).Foreground = extra.Active == 0 ? AccentBright : TextTertiary; bB.Background = extra.Active == 1 ? AccentSubtleB : Brushes.Transparent; ((TextBlock)bB.Child!).Foreground = extra.Active == 1 ? AccentBright : TextTertiary; }- Border Slot(string t, int slot)- {- var b = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(6, 1), Cursor = new Cursor(StandardCursorType.Hand), Child = new TextBlock { Text = t, FontSize = 9, FontWeight = FontWeight.Bold, Foreground = TextTertiary } };- b.PointerPressed += (_, _) =>- {- if (slot == extra.Active) return;- if (extra.Active == 0) extra.A = Capture(); else extra.B = Capture(); // save current into active- extra.Active = slot;- Apply(slot == 0 ? extra.A! : extra.B!);- Rebuild();- };- return b;- }- bA = Slot("A", 0); bB = Slot("B", 1);- var copy = new TextBlock { Text = "→", FontSize = 10, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand) };- ToolTip.SetTip(copy, "Copy active slot to the other");- copy.PointerPressed += (_, _) => { var cur = Capture(); if (extra.Active == 0) extra.B = (float[])cur.Clone(); else extra.A = (float[])cur.Clone(); };- Hi();- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1, VerticalAlignment = VerticalAlignment.Center, Children = { bA, bB, copy } };- return new Border { Background = ShellInset, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(2, 1), VerticalAlignment = VerticalAlignment.Center, Child = row };- }-- // Small stereo meter + a pinned dB readout (fixed width so neighbours don't shift).- // Fed from the track meter (per-device metering is deferred).- private Control MeterBadge()- {- var meter = new StereoMeter { Width = 44, Height = 8, VerticalAlignment = VerticalAlignment.Center };- var db = Mono("−∞", 30);- _deviceLiveRefreshers.Add(() =>- {- bool ok = _engine.TryGetTrackMeter(_trackId, out var mt);- meter.Set(ok ? mt.PeakL : 0f, ok ? mt.PeakR : 0f);- float peak = ok ? mt.Peak : 0f; double d = peak > 1e-4f ? 20 * Math.Log10(peak) : -80;- db.Text = d <= -79 ? "−∞" : $"{d:0.0}";- });- return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { meter, db } };- }}diff --git a/src/managed/Nota.App/DeviceChainView.cs b/src/managed/Nota.App/DeviceChainView.csindex 33f41d30..3e08d709 100644--- a/src/managed/Nota.App/DeviceChainView.cs+++ b/src/managed/Nota.App/DeviceChainView.cs@@ -64,7 +64,7 @@ public sealed partial class DeviceChainView : UserControlprivate readonly Border _dropGlow = new(){IsVisible = false, IsHitTestVisible = false,- BorderThickness = new Thickness(2), CornerRadius = new CornerRadius(7),+ BorderThickness = new Thickness(2), CornerRadius = NotaRadius.Body,BorderBrush = NotaPalette.AccentBright,Background = NotaPalette.Wash(NotaPalette.AccentBright, 0x14),Margin = new Thickness(2),@@ -180,7 +180,7 @@ public sealed partial class DeviceChainView : UserControldouble width;bool fullBleed = false;string tag = kind >= 0 ? "BUILT-IN" : "PLUGIN";- if (kind == 5) // Audio Effect Rack — full-bleed body (fills the shell; no 8px inset+ if (kind == 5) // Audio Effect Rack — full-bleed body (fills the shell; no body inset{ // that would overflow its fixed width and skew hit-testing).body = new RackCardView(NewCardContext()).BuildEffectRackBody(index); width = 700; fullBleed = true;}@@ -192,12 +192,12 @@ public sealed partial class DeviceChainView : UserControlfullBleed = strategy.FullBleed;if (strategy.Subtitle is { } sub) tag = sub;}- // Effects share the same shell as instruments (bypass + reorder + remove + preset,- // and the rich chrome when wide enough). Non-full-bleed bodies get an 8px inset.+ // Effects share the same shell as instruments. Non-full-bleed bodies get the+ // almanac body inset (6).var spec = new ShellSpec(Name: name, Subtitle: tag, DeviceIndex: index, Count: count, Bypassed: bypassed, Bypassable: true,CanMove: true, CanDelete: true, PresetKind: kind, IsInstrument: false, Width: width, Kind: ChainKind.Effect);- return BuildCardShell(spec, fullBleed ? body : new Border { Padding = new Thickness(8), Child = body });+ return BuildCardShell(spec, fullBleed ? body : new Border { Padding = new Thickness(NotaSpace.DeviceInset), Child = body });}// A fresh seam over this view's engine/track + live-refresh registry + orchestration@@ -246,8 +246,8 @@ public sealed partial class DeviceChainView : UserControlSpacing = 4, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,Children ={- new TextBlock { Text = "+", FontSize = 16, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center },- new TextBlock { Text = "Add device", FontSize = 10, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center },+ new Glyph(GlyphKind.Plus, 12) { Foreground = TextTertiary },+ new TextBlock { Text = "Add device", FontSize = 9, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center },new TextBlock { Text = "double-click in browser\nor drop here", FontSize = 8, Foreground = TextDisabled, TextAlignment = TextAlignment.Center },},};diff --git a/src/managed/Nota.App/DrumPatternView.cs b/src/managed/Nota.App/DrumPatternView.csindex fc326d0f..07e1d8ca 100644--- a/src/managed/Nota.App/DrumPatternView.cs+++ b/src/managed/Nota.App/DrumPatternView.cs@@ -275,7 +275,7 @@ public sealed class DrumPatternView : UserControlprivate Control EmptyState()=> new Border{- Background = NotaPalette.BgApp,+ Background = NotaPalette.BgSunken,Child = new StackPanel{Spacing = 6,@@ -307,7 +307,7 @@ public sealed class DrumPatternView : UserControlDockPanel.SetDock(header, Dock.Top);DockPanel.SetDock(ruler, Dock.Top);DockPanel.SetDock(velocity, Dock.Bottom);- return new DockPanel { LastChildFill = true, Background = NotaPalette.BgApp, Children = { header, ruler, velocity, scroll } };+ return new DockPanel { LastChildFill = true, Background = NotaPalette.BgSunken, Children = { header, ruler, velocity, scroll } };}// ---- header: title · pad count · grid · page · clear ----@@ -391,7 +391,7 @@ public sealed class DrumPatternView : UserControlprivate Control PadName(int r){var pad = _pads[r];- var swatch = new Border { Width = 4, Height = 11, CornerRadius = new CornerRadius(1), Background = Hue(pad.Chain), VerticalAlignment = VerticalAlignment.Center };+ var swatch = new Border { Width = 4, Height = 11, CornerRadius = NotaRadius.Bar, Background = Hue(pad.Chain), VerticalAlignment = VerticalAlignment.Center };var name = new TextBlock{Text = pad.Name, FontSize = 9, Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center,@@ -406,8 +406,8 @@ public sealed class DrumPatternView : UserControlinner.Children.Add(name);inner.Children.Add(note);- var cell = new Border { CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand), Child = inner };- ToolTip.SetTip(cell, $"{pad.Name} · {NoteName(pad.Note)} — click to play it and pick its velocity lane");+ var cell = new Border { CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand), Child = inner };+ ToolTip.SetTip(cell, $"Play {pad.Name} · {NoteName(pad.Note)} and show its velocity lane");cell.PointerPressed += (_, e) =>{e.Handled = true;@@ -424,7 +424,7 @@ public sealed class DrumPatternView : UserControlprivate Control StepCell(int r, int step){- var cell = new Border { CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand) };+ var cell = new Border { CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand) };_cells[r, step - _winStart] = cell;cell.PointerPressed += (_, e) =>{@@ -470,7 +470,7 @@ public sealed class DrumPatternView : UserControlprivate Control VelocityCell(int step){int local = step - _winStart;- var fill = new Border { VerticalAlignment = VerticalAlignment.Bottom, Background = NotaPalette.Accent, CornerRadius = new CornerRadius(2) };+ var fill = new Border { VerticalAlignment = VerticalAlignment.Bottom, Background = NotaPalette.Accent, CornerRadius = NotaRadius.Clip };var slot = new Panel { Background = NotaPalette.SurfaceAbyss, Cursor = new Cursor(StandardCursorType.SizeNorthSouth), ClipToBounds = true, Children = { fill } };_velFills[local] = fill;_velSlots[local] = slot;@@ -484,7 +484,7 @@ public sealed class DrumPatternView : UserControlslot.PointerPressed += (_, e) => { e.Handled = true; e.Pointer.Capture(slot); _dragging = true; SetFromY(e, live: false); };slot.PointerMoved += (_, e) => { if (e.GetCurrentPoint(slot).Properties.IsLeftButtonPressed) SetFromY(e, live: true); };slot.PointerReleased += (_, e) => { e.Pointer.Capture(null); _dragging = false; };- return new Border { CornerRadius = new CornerRadius(2), ClipToBounds = true, Child = slot };+ return new Border { CornerRadius = NotaRadius.Clip, ClipToBounds = true, Child = slot };}// Beat-grouped columns: one flexible column per beat, each holding its steps, so any@@ -564,7 +564,7 @@ public sealed class DrumPatternView : UserControlif (cell is null) return;bool sel = r == _selRow;cell.Background = sel ? NotaPalette.AccentSubtle : NotaPalette.SurfaceInset;- cell.BorderBrush = sel ? NotaPalette.AccentTint : NotaPalette.BorderDefault;+ cell.BorderBrush = sel ? NotaPalette.BorderBrass : NotaPalette.BorderDefault;_nameLabels[r].Foreground = sel ? NotaPalette.AccentBright : NotaPalette.TextPrimary;}@@ -647,7 +647,7 @@ public sealed class DrumPatternView : UserControlbool on = i == sel;var chip = new Border{- CornerRadius = new CornerRadius(2), Padding = new Thickness(6, 1), Cursor = new Cursor(StandardCursorType.Hand),+ CornerRadius = NotaRadius.Clip, Padding = new Thickness(6, 1), Cursor = new Cursor(StandardCursorType.Hand),Background = on ? NotaPalette.Accent : Brushes.Transparent,Child = new TextBlock { Text = names[i], FontSize = 8, FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal, Foreground = on ? NotaPalette.TextOnAccent : NotaPalette.TextTertiary },};@@ -657,7 +657,7 @@ public sealed class DrumPatternView : UserControlreturn new Border{Background = NotaPalette.BgSunken, BorderBrush = NotaPalette.BorderDefault, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(3), Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row,+ CornerRadius = NotaRadius.Badge, Padding = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Child = row,};}@@ -666,7 +666,7 @@ public sealed class DrumPatternView : UserControlvar b = new Border{BorderThickness = new Thickness(1), BorderBrush = NotaPalette.BorderStrong, Background = NotaPalette.SurfaceRaised,- CornerRadius = new CornerRadius(4), Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand),+ CornerRadius = NotaRadius.Control, Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand),VerticalAlignment = VerticalAlignment.Center,Child = new TextBlock { Text = text, FontSize = 9, Foreground = NotaPalette.TextSecondary },};diff --git a/src/managed/Nota.App/EqCurve.cs b/src/managed/Nota.App/EqCurve.csindex b17a739f..d5f45e8f 100644--- a/src/managed/Nota.App/EqCurve.cs+++ b/src/managed/Nota.App/EqCurve.cs@@ -31,10 +31,10 @@ public sealed class EqCurve : Controlprivate const int FftN = 2048, Bins = FftN / 2;private static readonly IBrush Bg = NotaPalette.BgSunken;- private static readonly IPen GridPen = new Pen(NotaPalette.WellGrid, 1);+ private static readonly IPen GridPen = NotaGraph.GridPen;private static readonly IPen GridPenFaint = new Pen(NotaPalette.Wash(NotaPalette.WellGrid, 0x60), 1);private static readonly IPen ZeroPen = new Pen(NotaPalette.BorderStrong, 1);- private static readonly IPen CurvePen = new Pen(NotaPalette.Accent, 1.6);+ private static readonly IPen CurvePen = new Pen(NotaPalette.Accent, NotaGraph.PrimaryWidth);private static readonly IBrush CurveFill = NotaPalette.Wash(NotaPalette.Accent, 0x1E);private static readonly IBrush SpecFill = NotaPalette.Wash(NotaPalette.Ink("#8AA6C0"), 0x30);private static readonly IPen SpecPen = new Pen(NotaPalette.Wash(NotaPalette.Ink("#9CB4CC"), 0x70), 1);@@ -44,8 +44,8 @@ public sealed class EqCurve : Controlprivate static readonly IBrush LabelDim = NotaPalette.TextTertiary;private static readonly IBrush LabelBright = NotaPalette.TextSecondary;private static readonly IBrush OnAccentText = NotaPalette.TextOnAccent;- private static readonly Typeface Mono = new("monospace");- private static readonly Typeface DotFont = new(FontFamily.Default, FontStyle.Normal, FontWeight.Bold);+ private static readonly Typeface Mono = NotaFonts.Mono;+ private static readonly Typeface DotFont = NotaFonts.SansBold;private readonly IAudioEngine _engine;private readonly int _track, _device;@@ -143,14 +143,13 @@ public sealed class EqCurve : Control{double mag = Math.Sqrt(_re[k] * _re[k] + _im[k] * _im[k]);double db = 20 * Math.Log10(mag / refMag + 1e-9);- // Fast attack, slow release for a lively-but-readable trace.- _specDb[k] = db > _specDb[k] ? db : Math.Max(db, _specDb[k] - 2.5);+ _specDb[k] = db; // no release ballistics: the spectrum shows this frame (almanac § no meter animation)}_sr = sr;InvalidateVisual();}private double _sr = 48000;- private void Decay() { for (int k = 1; k < Bins; k++) _specDb[k] = Math.Max(-120, _specDb[k] - 2.5); }+ private void Decay() { for (int k = 1; k < Bins; k++) _specDb[k] = -120; }// In-place iterative radix-2 Cooley–Tukey FFT.private static void Fft(double[] re, double[] im)@@ -276,7 +275,7 @@ public sealed class EqCurve : Controlfor (int t = 0; t < TypeNames.Length; t++){int tt = t;- var mi = new MenuItem { Header = (t == cur ? "● " : " ") + TypeNames[t] };+ var mi = new MenuItem { Header = TypeNames[t], ToggleType = MenuItemToggleType.Radio, IsChecked = t == cur };mi.Click += (_, _) => { SetP(b, TypeF, tt); InvalidateVisual(); };flyout.Items.Add(mi);}@@ -303,7 +302,7 @@ public sealed class EqCurve : Controldouble w = Bounds.Width, h = Bounds.Height;if (w <= 0 || h <= 0) return;double sr = _sr;- ctx.FillRectangle(Bg, new Rect(0, 0, w, h), 5);+ NotaGraph.Window(ctx, new Rect(0, 0, w, h));// --- grid: vertical decade lines + minor ticks, horizontal dB lines ---double[] majors = { 100, 1000, 10000 };@@ -313,14 +312,15 @@ public sealed class EqCurve : Control{double x = FreqToX(f, w);ctx.DrawLine(GridPen, new Point(x, 0), new Point(x, h));- Label(ctx, f >= 1000 ? $"{f / 1000:0}k" : $"{f:0}", x + 2, h - 11, LabelDim);}for (int db = -12; db <= 12; db += 6){double y = GainToY(db, h);ctx.DrawLine(db == 0 ? ZeroPen : GridPen, new Point(0, y), new Point(w, y));- if (db != 0) Label(ctx, $"{(db > 0 ? "+" : "")}{db}", 2, y - 9, LabelDim);}+ // The range is labelled in the bottom corners and nowhere else — no full axes.+ NotaGraph.Axis(ctx, new Rect(0, 0, w, h), NotaGraph.Corner.BottomLeft, "20");+ NotaGraph.Axis(ctx, new Rect(0, 0, w, h), NotaGraph.Corner.BottomRight, "20k Hz");// --- spectrum analyzer (behind the curve) ---var spec = new StreamGeometry();@@ -338,7 +338,7 @@ public sealed class EqCurve : Controlg.LineTo(new Point(w, h));g.EndFigure(true);}- ctx.DrawGeometry(SpecFill, SpecPen, spec);+ ctx.DrawGeometry(null, SpecPen, spec);// --- combined EQ magnitude curve + fill ---const int n = 128;@@ -359,7 +359,6 @@ public sealed class EqCurve : Controlgf.LineTo(new Point(w, h / 2));gf.EndFigure(true);}- ctx.DrawGeometry(CurveFill, null, fill);ctx.DrawGeometry(null, CurvePen, curve);// --- band dots (numbered) ---@@ -369,10 +368,9 @@ public sealed class EqCurve : Controlint type = BandType(b);double x = FreqToX(P(b, FreqF), w);double y = GainToY(HasGain(type) ? P(b, GainF) : 0, h);- bool sel = b == _selected;- double r = sel ? 8 : 6.5;- ctx.DrawEllipse(sel ? DotSel : DotOn, new Pen(DotRing, 1.5), new Point(x, y), r, r);- DotLabel(ctx, (b + 1).ToString(), x, y, OnAccentText, 9.5);+ // Almanac node: 7px, ringed in the ground; the selected band brass, the rest Ink 3.+ // The band number lives in the readout below, not on the node.+ NotaGraph.Node(ctx, new Point(x, y), b == _selected);}// --- readout: selected band (or a hint) ---@@ -380,9 +378,9 @@ public sealed class EqCurve : Controlif (_selected >= 0 && BandOn(_selected)){int b = _selected, type = BandType(b);- txt = string.Format(CultureInfo.InvariantCulture, "B{0} {1} {2:0} Hz{3} Q {4:0.00}",+ txt = string.Format(NotaNum.Culture, "B{0} {1} {2:0} Hz{3} Q {4:0.00}",b + 1, TypeNames[type], P(b, FreqF),- HasGain(type) ? string.Format(CultureInfo.InvariantCulture, " {0:+0.0;-0.0} dB", P(b, GainF)) : "",+ HasGain(type) ? string.Format(NotaNum.Culture, " {0:+0.0;−0.0}\u2009dB", P(b, GainF)) : "",P(b, QF));}else@@ -390,6 +388,6 @@ public sealed class EqCurve : Controlint active = 0; for (int b = 0; b < Bands; b++) if (BandOn(b)) active++;txt = $"{active}/8 bands · double-click to add · right-click a dot for type · wheel = Q";}- Label(ctx, txt, 6, h - 11, LabelBright);+ Label(ctx, txt, 6, 4, LabelBright); // readout at the top: the bottom corners carry the range}}diff --git a/src/managed/Nota.App/ExportWindow.cs b/src/managed/Nota.App/ExportWindow.csindex 75212db0..e48370ba 100644--- a/src/managed/Nota.App/ExportWindow.cs+++ b/src/managed/Nota.App/ExportWindow.cs@@ -88,7 +88,7 @@ public sealed class ExportWindow : NotaWindow_depth.SelectionChanged += (_, _) => { RefreshEstimate(); _refreshDitherEnabled?.Invoke(); };// Options: normalize + dither (working toggles) and a release tail (checkbox).- var normalize = WorkingToggle("Normalize −1 dBTP", () => _normalize, v => { _normalize = v; RefreshEstimate(); });+ var normalize = WorkingToggle("Normalize −1\u2009dBTP", () => _normalize, v => { _normalize = v; RefreshEstimate(); });var dither = WorkingToggle("Dither", () => _dither, v => { _dither = v; },enabled: () => _depth.SelectedIndex == 0, hint: "16-bit only");body.Children.Add(new StackPanel { Orientation = Orientation.Horizontal, Spacing = 22, Children = { normalize, dither } });@@ -101,7 +101,7 @@ public sealed class ExportWindow : NotaWindow_estimate = new TextBlock { FontSize = 10, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center };var export = new Border{- Background = Brass, CornerRadius = new CornerRadius(5), Padding = new Thickness(18, 0), Height = 30,+ Background = Brass, CornerRadius = NotaRadius.Tile, Padding = new Thickness(18, 0), Height = 30,Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,Child = (_exportLabel = new TextBlock { Text = "Export WAV", FontSize = 12, FontWeight = FontWeight.SemiBold, Foreground = OnAccent, VerticalAlignment = VerticalAlignment.Center }),};@@ -129,7 +129,7 @@ public sealed class ExportWindow : NotaWindow{double sec = _bpm > 0 ? _rangeBeats * 60.0 / _bpm : 0;int endBar = (int)(_rangeBeats / BeatsPerBar) + 1;- _rangeReadout.Text = string.Format(CultureInfo.InvariantCulture, "1.1.1 → {0}.1.1 · {1:0.0} s", endBar, sec);+ _rangeReadout.Text = string.Format(NotaNum.Culture, "1.1.1 → {0}.1.1 · {1:0.0}\u2009s", endBar, sec);RefreshEstimate();}@@ -142,8 +142,8 @@ public sealed class ExportWindow : NotaWindowint bytesPerSample = _depth.SelectedIndex switch { 0 => 2, 2 => 4, _ => 3 };double mb = sec * sr * 2 * bytesPerSample / 1_000_000.0;_estimate.Text = _stems- ? string.Format(CultureInfo.InvariantCulture, "one file per track · {0:0.0} MB each · offline render", mb)- : string.Format(CultureInfo.InvariantCulture, "≈ 1 file · {0:0.0} MB · offline render", mb);+ ? string.Format(NotaNum.Culture, "one file per track · {0:0.0}\u2009MB each · offline render", mb)+ : string.Format(NotaNum.Culture, "≈ 1 file · {0:0.0}\u2009MB · offline render", mb);}// ---- helpers ----------------------------------------------------------@@ -174,8 +174,8 @@ public sealed class ExportWindow : NotaWindowprivate Control WorkingToggle(string label, Func<bool> get, Action<bool> set,Func<bool>? enabled = null, string? hint = null){- var knob = new Border { Width = 26, Height = 15, CornerRadius = new CornerRadius(8), Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1) };- var dot = new Border { Width = 11, Height = 11, CornerRadius = new CornerRadius(6), Background = TextTertiary, VerticalAlignment = VerticalAlignment.Center };+ var knob = new Border { Width = 26, Height = 15, CornerRadius = NotaRadius.Body, Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1) };+ var dot = new Border { Width = 11, Height = 11, CornerRadius = NotaRadius.Panel, Background = TextTertiary, VerticalAlignment = VerticalAlignment.Center };knob.Child = dot;var text = new TextBlock { Text = label, FontSize = 11, Foreground = TextSecondary, VerticalAlignment = VerticalAlignment.Center };var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand), Children = { knob, text } };@@ -195,9 +195,8 @@ public sealed class ExportWindow : NotaWindow{bool en = enabled?.Invoke() ?? true;if (!en && get()) { set(false); }- row.Opacity = en ? 1.0 : 0.45;- row.IsHitTestVisible = en;Paint();+ Inactive.Set(row, !en);}row.PointerPressed += (_, _) => { set(!get()); Paint(); };if (enabled is not null) _refreshDitherEnabled += Sync;@@ -205,44 +204,19 @@ public sealed class ExportWindow : NotaWindowreturn row;}- // Design-system checkbox (Radius.Sm box, brass fill + dark check when on). Small,- // with a secondary-weight label — used for the release-tail option.+ // The release-tail option: the shell switch (a themed CheckBox), word to the right.private Control TailCheck(){- var box = new Border { Width = 16, Height = 16, CornerRadius = new CornerRadius(5), BorderThickness = new Thickness(1) };- var check = new Avalonia.Controls.Shapes.Path- {- Data = Geometry.Parse("M0 3.5 L3.2 6.7 L9 0"),- Stroke = OnAccent, StrokeThickness = 1.6,- StrokeLineCap = PenLineCap.Round, StrokeJoin = PenLineJoin.Round,- };- // A Viewbox fits the glyph's bounds into a fixed centred area, so the tick can't- // drift with the geometry's origin (a bare Path centres by its own bounds box).- var glyph = new Viewbox- {- Width = 9, Height = 7, Stretch = Stretch.Uniform, Child = check,- HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,- };- box.Child = glyph;- var text = new TextBlock { Text = "Add 1-bar release tail", FontSize = 12, VerticalAlignment = VerticalAlignment.Center };- void Paint()- {- box.Background = _tailOn ? Brass : Sunken;- box.BorderBrush = _tailOn ? Brass : BorderStrong;- check.IsVisible = _tailOn;- text.Foreground = _tailOn ? TextPrimary : TextSecondary;- }- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand), Children = { box, text } };- row.PointerPressed += (_, _) => { _tailOn = !_tailOn; Paint(); RefreshEstimate(); };- Paint();- return row;+ var sw = new CheckBox { Content = "Add 1-bar release tail", IsChecked = _tailOn, VerticalAlignment = VerticalAlignment.Center };+ sw.IsCheckedChanged += (_, _) => { _tailOn = sw.IsChecked == true; RefreshEstimate(); };+ return sw;}private Control StemsBlock(){// A working pill toggle: one WAV per track into a chosen folder (M6-5).- var knob = new Border { Width = 26, Height = 15, CornerRadius = new CornerRadius(8), Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1) };- var dot = new Border { Width = 11, Height = 11, CornerRadius = new CornerRadius(6), Background = TextTertiary, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(2, 0, 0, 0) };+ var knob = new Border { Width = 26, Height = 15, CornerRadius = NotaRadius.Body, Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1) };+ var dot = new Border { Width = 11, Height = 11, CornerRadius = NotaRadius.Panel, Background = TextTertiary, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(2, 0, 0, 0) };knob.Child = dot;void Paint(){@@ -266,7 +240,7 @@ public sealed class ExportWindow : NotaWindowvar headerBar = new Border { Height = 28, Background = NotaPalette.SurfaceInset, BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 0, 1), Padding = new Thickness(10, 0), Cursor = new Cursor(StandardCursorType.Hand), Child = header };headerBar.PointerPressed += (_, _) => { _stems = !_stems; Paint(); };var box = new StackPanel { Children = { headerBar } };- return new Border { BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(7), ClipToBounds = true, Child = box };+ return new Border { BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, ClipToBounds = true, Child = box };}private Control Segmented((string label, bool enabled)[] items, int active, Action<int> onSelect)@@ -277,9 +251,9 @@ public sealed class ExportWindow : NotaWindow{int idx = i;var t = new TextBlock { Text = items[i].label, FontSize = 10, VerticalAlignment = VerticalAlignment.Center };- var cell = new Border { CornerRadius = new CornerRadius(3), Padding = new Thickness(10, 2), Child = t };+ var cell = new Border { CornerRadius = NotaRadius.Badge, Padding = new Thickness(10, 2), Child = t };if (items[i].enabled) { cell.Cursor = new Cursor(StandardCursorType.Hand); cell.PointerPressed += (_, _) => { onSelect(idx); Paint(idx); }; }- else cell.Opacity = 0.5;+ else t.Foreground = NotaPalette.TextDisabled;cells[i] = cell;inner.Children.Add(cell);}@@ -294,6 +268,6 @@ public sealed class ExportWindow : NotaWindow}}Paint(active);- return new Border { Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5), Padding = new Thickness(2), Child = inner, VerticalAlignment = VerticalAlignment.Center };+ return new Border { Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile, Padding = new Thickness(2), Child = inner, VerticalAlignment = VerticalAlignment.Center };}}diff --git a/src/managed/Nota.App/MainWindow.Detail.cs b/src/managed/Nota.App/MainWindow.Detail.csindex 95465b5e..de12e41e 100644--- a/src/managed/Nota.App/MainWindow.Detail.cs+++ b/src/managed/Nota.App/MainWindow.Detail.cs@@ -22,8 +22,8 @@ namespace Nota.App;public partial class MainWindow{// Base track colour for a track id (mirrors the arrangement palette, 1e).- private Color TrackColor(int trackId)- => ArrangementView.TrackColorForIndex(ArrangementView.EffectiveColorIndex(Engine, trackId));+ private SolidColorBrush TrackBrush(int trackId)+ => ArrangementView.TrackBrush(ArrangementView.EffectiveColorIndex(Engine, trackId));// Detail-header track chip (1d/1e): colour dot · name · routing/PDC summary.// trackId <= 0 shows a plain mode label (e.g. the full-width Mixer).@@ -50,9 +50,9 @@ public partial class MainWindow: master ? "Master" : ret ? $"Return {Engine.TrackReturnIndex(trackId) + 1}" : (inst ? "Inst " : "Audio ") + trackId;string type = master ? "master" : ret ? "return" : inst ? "instrument · MIDI in" : "audio · In 1";double ms = Engine.SampleRate > 0 ? Engine.TrackLatencySamples(trackId) / Engine.SampleRate * 1000.0 : 0;- string summary = string.Format(System.Globalization.CultureInfo.InvariantCulture, "· {0} · Monitor Auto · PDC {1:0.0} ms", type, ms);+ string summary = string.Format(NotaNum.Culture, "· {0} · Monitor Auto · PDC {1:0.0}\u2009ms", type, ms);- var dot = new Rectangle { Width = 8, Height = 8, RadiusX = 2, RadiusY = 2, Fill = new SolidColorBrush(TrackColor(trackId)), VerticalAlignment = VerticalAlignment.Center };+ var dot = new Rectangle { Width = 8, Height = 8, RadiusX = 2, RadiusY = 2, Fill = TrackBrush(trackId), VerticalAlignment = VerticalAlignment.Center };var nameText = new TextBlock { Text = name, FontSize = 11, FontWeight = FontWeight.SemiBold, Foreground = NotaPalette.TextPrimary, VerticalAlignment = VerticalAlignment.Center };var sumText = new TextBlock { Text = summary, Classes = { "Caption" }, VerticalAlignment = VerticalAlignment.Center };DetailChipHost.Content = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = { dot, nameText, sumText } };@@ -302,7 +302,7 @@ public partial class MainWindow{if (_vm is null) return;_audioEditor = new AudioClipEditorView(Engine, trackId, clipIndex,- new SolidColorBrush(TrackColor(trackId)), () => Timeline.Refresh());+ TrackBrush(trackId), () => Timeline.Refresh());_audioEditorTrackId = trackId;_audioEditorClipIndex = clipIndex;}@@ -358,7 +358,7 @@ public partial class MainWindow};double length = Engine.TryGetClipInfo(trackId, clipIndex, out var ci) && ci.LengthBeats > 0 ? ci.LengthBeats : 4;double start = ci.StartBeat;- roll.SetTrackColor(TrackColor(trackId));+ roll.SetTrackColor(TrackBrush(trackId));roll.SetClipIdentity(trackId, clipIndex);roll.SetNotes(Engine.GetClipNotes(trackId, clipIndex), length);@@ -511,7 +511,7 @@ public partial class MainWindow{_sessionSlotTrack = -1; _sessionSlotScene = -1; // audio slot: no pattern to stepSyncClipTab();- var audioEd = new SessionAudioSlotEditor(Engine, trackId, scene, new SolidColorBrush(TrackColor(trackId)));+ var audioEd = new SessionAudioSlotEditor(Engine, trackId, scene, TrackBrush(trackId));_editorRoll = null; _clipEditor = null;_editorTrackId = -1; _editorClipIndex = -1;_lastClipEditor = audioEd;@@ -541,7 +541,7 @@ public partial class MainWindowPollHeldNotes = buf => Engine.LiveHeldNotes(buf),};double slotLen = Engine.SessionSlotLength(trackId, scene);- roll.SetTrackColor(TrackColor(trackId));+ roll.SetTrackColor(TrackBrush(trackId));roll.SetClipIdentity(trackId, -(scene + 2)); // distinct key from arrangement clipsroll.SetNotes(Engine.GetSessionNotes(trackId, scene), slotLen > 0 ? slotLen : 4);diff --git a/src/managed/Nota.App/MainWindow.Files.cs b/src/managed/Nota.App/MainWindow.Files.csindex b5c91056..9bcf2ce6 100644--- a/src/managed/Nota.App/MainWindow.Files.cs+++ b/src/managed/Nota.App/MainWindow.Files.cs@@ -59,7 +59,7 @@ public partial class MainWindowdouble bpm = AutoWarpImported(trackId, clip);Timeline.Refresh();_vm.StatusText = bpm > 0- ? string.Format(System.Globalization.CultureInfo.InvariantCulture, "Imported {0} · warped to tempo ({1:0.0} BPM)", name, bpm)+ ? string.Format(NotaNum.Culture, "Imported {0} · warped to tempo ({1:0.0}\u2009BPM)", name, bpm): $"Imported {name}";});}@@ -131,7 +131,7 @@ public partial class MainWindowawait RunBlockingAsync("Export", opts.Stems ? "Exporting stems…" : "Exporting…", async prog =>{var frac = new Progress<double>(f =>- prog.Report(ProgressReport.At(f, $"Exporting {noun}… {f * 100:0}%")));+ prog.Report(ProgressReport.At(f, $"Exporting {noun}… {f * 100:0}\u2009%")));if (opts.Stems){int count = await Task.Run(() => _exporter.ExportStems(Engine, request, frac));@@ -295,7 +295,7 @@ public partial class MainWindow{remaining = Engine.WarpBuildStep(chunk);double frac = Math.Clamp(1.0 - (double)remaining / total, 0.0, 1.0);- prog.Report(ProgressReport.At(frac, $"Preparing warped clips… {frac * 100:0}%"));+ prog.Report(ProgressReport.At(frac, $"Preparing warped clips… {frac * 100:0}\u2009%"));await Task.Yield();}});diff --git a/src/managed/Nota.App/MainWindow.Freeze.cs b/src/managed/Nota.App/MainWindow.Freeze.csindex d2970e82..5463b7ea 100644--- a/src/managed/Nota.App/MainWindow.Freeze.cs+++ b/src/managed/Nota.App/MainWindow.Freeze.cs@@ -68,8 +68,7 @@ public partial class MainWindowbool inPlace = IsFreezable(trackId) && Engine.IsTrackFrozen(trackId);bool sleeping = LinkForSource(trackId) is { State: LinkState.Frozen };bool dim = inPlace || sleeping;- _deviceChain.Opacity = dim ? 0.5 : 1.0;- _deviceChain.IsHitTestVisible = !dim;+ Inactive.Set(_deviceChain, dim);}private void EnsureFreezeMenu()@@ -112,7 +111,7 @@ public partial class MainWindowbool ok = false;await RunBlockingAsync("Freeze", "Freezing track…", async prog =>{- var frac = new Progress<double>(f => prog.Report(ProgressReport.At(f, $"Freezing track… {f * 100:0}%")));+ var frac = new Progress<double>(f => prog.Report(ProgressReport.At(f, $"Freezing track… {f * 100:0}\u2009%")));ok = await Task.Run(() => _freezer.Freeze(Engine, trackId, endBeats,_vm.Transport.LoopOn, _vm.Transport.MetronomeOn, frac));});@@ -154,14 +153,14 @@ public partial class MainWindowint src = link.SourceId;if (link.State == LinkState.Editing){- items.Add(FreezeMenuItem("Done — re-freeze", GlyphIcon("✓", accent: true),+ items.Add(FreezeMenuItem("Done — re-freeze", GlyphIcon(GlyphKind.Check, accent: true),async () => { Timeline.Select(trackId, -1); await CommitEditSessionAsync(src); }));- items.Add(FreezeMenuItem("Discard edits", GlyphIcon("✗", accent: false),+ items.Add(FreezeMenuItem("Discard edits", GlyphIcon(GlyphKind.Cross, accent: false),() => { Timeline.Select(trackId, -1); DiscardEditSession(src); }));}else// Editing changes the source's notes/devices, so land on the source track.- items.Add(FreezeMenuItem("Edit source", GlyphIcon("✎", accent: true),+ items.Add(FreezeMenuItem("Edit source", GlyphIcon(GlyphKind.Edit, accent: true),() => { Timeline.Select(src, -1); BeginEditSession(src); }));items.Add(FreezeMenuItem("Unfreeze (wake source)", null, () => UnfreezeLink(src)));items.Add(FreezeMenuItem("Flatten (remove source)", null, () => FlattenLinkAsync(src)));@@ -205,7 +204,7 @@ public partial class MainWindowprivate static readonly IBrush IceBrush = NotaPalette.Frozen;private static Control SnowflakeIcon()- => new TextBlock { Text = "❄", FontSize = 12, Foreground = IceBrush, VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center };+ => new Glyph(GlyphKind.Freeze, 11) { Foreground = IceBrush };private static Control ChainLinkIcon()=> new Avalonia.Controls.Shapes.Path@@ -214,12 +213,8 @@ public partial class MainWindowWidth = 14, Height = 14, VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center,};- private Control GlyphIcon(string glyph, bool accent)- => new TextBlock- {- Text = glyph, FontSize = 12, VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center,- Foreground = accent ? NotaPalette.AccentBright : NotaPalette.TextTertiary,- };+ private Control GlyphIcon(GlyphKind glyph, bool accent)+ => new Glyph(glyph, 11) { Foreground = accent ? NotaPalette.AccentBright : NotaPalette.TextTertiary };// --- Flatten -----------------------------------------------------------diff --git a/src/managed/Nota.App/MainWindow.LiveFreeze.cs b/src/managed/Nota.App/MainWindow.LiveFreeze.csindex 27bee708..dd670e3a 100644--- a/src/managed/Nota.App/MainWindow.LiveFreeze.cs+++ b/src/managed/Nota.App/MainWindow.LiveFreeze.cs@@ -254,7 +254,7 @@ public partial class MainWindow{await RunBlockingAsync(title, "Rendering…", async prog =>{- var frac = new Progress<double>(f => prog.Report(ProgressReport.At(f, $"Rendering… {f * 100:0}%")));+ var frac = new Progress<double>(f => prog.Report(ProgressReport.At(f, $"Rendering… {f * 100:0}\u2009%")));ok = await Task.Run(() => _freezer.Freeze(Engine, sourceId, endBeats,_vm.Transport.LoopOn, _vm.Transport.MetronomeOn, frac));});diff --git a/src/managed/Nota.App/MainWindow.axaml b/src/managed/Nota.App/MainWindow.axamlindex 2ede3b92..ff23930c 100644--- a/src/managed/Nota.App/MainWindow.axaml+++ b/src/managed/Nota.App/MainWindow.axaml@@ -94,16 +94,16 @@<Panel><DockPanel>- <!-- Title bar (36) — custom frameless: macOS traffic lights sit in the left- inset; centered doc title. Draggable. -->+ <!-- Header (36) — custom frameless: macOS traffic lights sit in the left inset;+ the project name is centred on the window. Draggable.+ (Transport sits right under it, at the top of the window.) --><Border x:Name="TitleBar" DockPanel.Dock="Top" Height="36"Background="{DynamicResource Brush.ChromeBg}"BorderBrush="{DynamicResource Brush.BorderDefault}" BorderThickness="0,0,0,1"PointerPressed="OnTitleBarPressed"><Grid x:Name="TitleBarRow" ColumnDefinitions="78,*,Auto" Margin="0,0,12,0">- <TextBlock x:Name="DocTitleText" Grid.Column="1" Text="Nota" Classes="Caption"- HorizontalAlignment="Center" VerticalAlignment="Center"- Foreground="{DynamicResource Brush.TextSecondary}"/>+ <TextBlock x:Name="DocTitleText" Grid.Column="0" Grid.ColumnSpan="3" Text="Nota" Classes="Heading"+ HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False"/><StackPanel Grid.Column="2" Orientation="Horizontal" Spacing="8" VerticalAlignment="Center"></StackPanel></Grid>@@ -112,17 +112,16 @@<!-- In-window menu bar for Windows/Linux (empty on macOS: menus go to the system bar) --><NativeMenuBar DockPanel.Dock="Top"/>- <!-- Transport (60) — mockup 1b: one row instead of the old transport+toolbar pair,- handing 22px back to the arrangement. Reads left to right as: which view ·- what plays (a recessed console fusing transport, position and loop) · the- numbers you set · the switches you flip · then, pinned right, what the machine- is doing. Everything the two old rows carried is still here; launch quantize- shows only in Session, where it applies. -->- <Border DockPanel.Dock="Top" Classes="Panel" Height="60" Padding="14,0">- <Grid ColumnDefinitions="Auto,Auto,Auto,Auto,*,Auto,Auto,Auto,Auto,Auto">+ <!-- Transport (42) under the header, above the work area. The whole strip is one+ recess on Void, so buttons, position, tempo and loop read as one object rather+ than a row of buttons. Reads left to right as: which view · what plays · the numbers you set ·+ the switches you flip · then, pinned right, what the machine is doing. Launch+ quantize shows only in Session, where it applies. The view switch leads the row. -->+ <Border x:Name="TransportBar" DockPanel.Dock="Top" Classes="transport" Height="{StaticResource Control.Console}" Padding="10,0">+ <Grid ColumnDefinitions="Auto,Auto,Auto,Auto,Auto,*,Auto,Auto,Auto,Auto,Auto"><!-- View switch -->- <Border Grid.Column="0" Classes="segmented" Margin="0,0,12,0">+ <Border Grid.Column="0" Classes="segmented" Margin="0,0,12,0" VerticalAlignment="Center"><StackPanel Orientation="Horizontal" Spacing="2"><ToggleButton x:Name="ArrangeBtn" Classes="seg" Content="Arrangement" IsChecked="True" Click="OnShowArrangement"/><ToggleButton x:Name="SessionBtn" Classes="seg" Content="Session" Click="OnShowSession"/>@@ -134,12 +133,20 @@<Border Grid.Column="1" Classes="console"><StackPanel Orientation="Horizontal" Spacing="11" VerticalAlignment="Center"><StackPanel Orientation="Horizontal" Spacing="4" VerticalAlignment="Center">- <Button x:Name="StopBtn" Classes="tp-icon" Content="■" ToolTip.Tip="Stop"- Foreground="{DynamicResource Brush.TextSecondary}" Command="{Binding Transport.StopCommand}"/>- <Button x:Name="PlayBtn" Classes="tp-play" Content="▶" ToolTip.Tip="Play"- Foreground="{DynamicResource Brush.TextOnAccent}" Command="{Binding Transport.PlayCommand}"/>- <ToggleButton x:Name="RecordBtn" Classes="tp-icon rec" Content="●" ToolTip.Tip="Record"- Foreground="{DynamicResource Brush.Danger}" IsChecked="{Binding Transport.RecordOn}"/>+ <!-- Shapes built from geometry (almanac): stop a 10px square r1, play an 11×14+ triangle, record an 11px disc. No glyph font. -->+ <Button x:Name="StopBtn" Classes="tp-icon" ToolTip.Tip="Stop"+ Foreground="{DynamicResource Brush.TextStrong}" Command="{Binding Transport.StopCommand}">+ <app:Glyph x:Name="StopGlyph" Kind="Stop"/>+ </Button>+ <Button x:Name="PlayBtn" Classes="tp-play" ToolTip.Tip="Play"+ Foreground="{DynamicResource Brush.TextOnAccent}" Command="{Binding Transport.PlayCommand}">+ <app:Glyph x:Name="PlayGlyph" Kind="Play" Margin="2,0,0,0"/>+ </Button>+ <ToggleButton x:Name="RecordBtn" Classes="tp-icon rec" ToolTip.Tip="Record"+ IsChecked="{Binding Transport.RecordOn}">+ <app:Glyph x:Name="RecordGlyph" Kind="Record"/>+ </ToggleButton></StackPanel><Border Width="1" Height="24" Background="{DynamicResource Brush.BorderDefault}"/>@@ -147,10 +154,10 @@<!-- Position — click to flip bars.beats ↔ minutes:seconds; the unit below says which --><StackPanel Spacing="1" VerticalAlignment="Center" Cursor="Hand" Background="Transparent"PointerPressed="OnTogglePositionDisplay"- ToolTip.Tip="Click to switch between bars and time">- <TextBlock Classes="Mono" Text="{Binding Transport.PositionText}" FontSize="19" LineHeight="20"- MinWidth="98" Foreground="{DynamicResource Brush.AccentBright}"/>- <TextBlock Classes="Mono CellLabel" Text="{Binding Transport.PositionUnitText}"/>+ ToolTip.Tip="Switch between bars and time">+ <TextBlock Classes="Readout" Text="{Binding Transport.PositionText}" LineHeight="16"+ MinWidth="72" Foreground="{DynamicResource Brush.AccentBright}"/>+ <TextBlock Classes="CellLabel" Text="{Binding Transport.PositionUnitText}"/></StackPanel><Border Width="1" Height="24" Background="{DynamicResource Brush.BorderDefault}"/>@@ -170,12 +177,12 @@<!-- Readouts: value over label, one shape for all of them --><StackPanel Grid.Column="2" Orientation="Horizontal" Spacing="2" VerticalAlignment="Center" Margin="12,0,0,0"><!-- Tempo (drag ↕ or double-click to type) -->- <StackPanel Spacing="2" VerticalAlignment="Center" Margin="7,0" ToolTip.Tip="Drag ↕ or double-click to set tempo">- <Panel x:Name="BpmHost" Width="34" Height="18"/>+ <StackPanel Spacing="2" VerticalAlignment="Center" Margin="7,0" ToolTip.Tip="Set the tempo — drag, or double-click to type">+ <Panel x:Name="BpmHost" Width="52" Height="18"/><TextBlock Classes="CellLabel" Text="BPM" HorizontalAlignment="Center"/></StackPanel><!-- Time signature (drag ↕ each field) -->- <StackPanel Spacing="2" VerticalAlignment="Center" Margin="7,0" ToolTip.Tip="Drag ↕ to set the time signature">+ <StackPanel Spacing="2" VerticalAlignment="Center" Margin="7,0" ToolTip.Tip="Set the time signature — drag each field"><StackPanel Orientation="Horizontal" Spacing="1" Height="18"><Panel x:Name="TimeSigNumHost" Width="16"/><TextBlock Classes="Mono" Text="/" FontSize="14" VerticalAlignment="Center"@@ -185,7 +192,7 @@<TextBlock Classes="CellLabel" Text="SIG" HorizontalAlignment="Center"/></StackPanel><!-- Clip snap grid: click to cycle -->- <Button x:Name="SnapChip" Classes="cell" Click="OnCycleSnap" ToolTip.Tip="Clip snap grid — click to cycle">+ <Button x:Name="SnapChip" Classes="cell" Click="OnCycleSnap" ToolTip.Tip="Cycle the clip snap grid"><StackPanel Spacing="2"><TextBlock x:Name="SnapLabel" Classes="Mono" Text="1/4" FontSize="14" LineHeight="16"MinWidth="36" TextAlignment="Center" HorizontalAlignment="Center" Foreground="{DynamicResource Brush.TextPrimary}"/>@@ -194,7 +201,7 @@</Button><!-- Launch quantize — a Session concept, so it only appears there --><Button x:Name="LaunchQChip" Classes="cell" Click="OnCycleLaunchQ" IsVisible="False"- ToolTip.Tip="Launch quantize — when Session slots and scenes fire">+ ToolTip.Tip="Set when Session slots and scenes launch"><StackPanel Spacing="2"><TextBlock x:Name="LaunchQLabel" Classes="Mono" Text="1 Bar" FontSize="14" LineHeight="16"MinWidth="44" TextAlignment="Center" HorizontalAlignment="Center" Foreground="{DynamicResource Brush.TextPrimary}"/>@@ -208,7 +215,7 @@engaged state turns the glyph brass through the base ToggleButton:checked. --><StackPanel Grid.Column="3" Orientation="Horizontal" Spacing="5" VerticalAlignment="Center" Margin="12,0,0,0"><!-- Metronome: body, pendulum rod, weight -->- <ToggleButton Classes="tp-icon" IsChecked="{Binding Transport.MetronomeOn}" ToolTip.Tip="Metronome (M)">+ <ToggleButton Classes="tp-icon" IsChecked="{Binding Transport.MetronomeOn}" ToolTip.Tip="Turn the metronome on or off (M)"><Viewbox Width="15" Height="15"><Canvas Width="24" Height="24"><Path Stroke="{Binding $parent[ToggleButton].Foreground}" StrokeThickness="1.7"@@ -226,7 +233,7 @@brackets around it were tried too and collapse into noise at this size. Mirrored by View ▸ Follow playhead,which shares one code path. --><ToggleButton x:Name="FollowBtn" Classes="tp-icon" Click="OnToggleFollow"- ToolTip.Tip="Follow playhead — scroll the arrangement to keep the cursor in view">+ ToolTip.Tip="Scroll the arrangement to keep the playhead in view"><Viewbox Width="15" Height="15"><Canvas Width="24" Height="24"><Path Stroke="{Binding $parent[ToggleButton].Foreground}" StrokeThickness="1.7"@@ -241,7 +248,7 @@same as holding Alt, but latched. A horseshoe magnet: the poles are bandedoff the body by a transparent gap, so the shape reads on any button state. --><ToggleButton x:Name="SnapToggle" Classes="tp-icon" IsChecked="True" Click="OnToggleSnapEnabled"- ToolTip.Tip="Snap to grid — off positions freely (hold Alt for one drag)">+ ToolTip.Tip="Snap clips to the grid (hold Alt to drag freely)"><Viewbox Width="15" Height="15"><Canvas Width="24" Height="24"><Path Fill="{Binding $parent[ToggleButton].Foreground}"@@ -272,28 +279,28 @@<Button x:Name="ReenableAutoBtn" Classes="chip" Content="Re-enable"IsVisible="False" Click="OnReenableAutomation"Foreground="{DynamicResource Brush.AccentBright}"- ToolTip.Tip="A control you moved is overriding its automation — click to hand it back"/>+ ToolTip.Tip="Hand overridden controls back to their automation"/></StackPanel><!-- Add track: one menu instead of three chips -->- <Button Grid.Column="5" Classes="chip" Margin="12,0,0,0" ToolTip.Tip="Add a track">- <StackPanel Orientation="Horizontal" Spacing="7" VerticalAlignment="Center">- <TextBlock Text="+ Track" VerticalAlignment="Center"/>- <Path Data="M0,0 L3.5,4 L7,0 Z" Fill="{DynamicResource Brush.TextTertiary}" VerticalAlignment="Center"/>- </StackPanel>- <Button.Flyout>- <MenuFlyout Placement="BottomEdgeAlignedLeft">- <MenuItem Header="Instrument" Click="OnAddInstrumentClicked"/>- <MenuItem Header="Audio" Click="OnAddAudioClicked"/>- <MenuItem Header="Return" Click="OnAddReturnClicked"/>- </MenuFlyout>- </Button.Flyout>- </Button>+ <!-- <Button Grid.Column="5" Classes="chip" Margin="12,0,0,0" ToolTip.Tip="Add a track"> -->+ <!-- <StackPanel Orientation="Horizontal" Spacing="7" VerticalAlignment="Center"> -->+ <!-- <TextBlock Text="+ Track" VerticalAlignment="Center"/> -->+ <!-- <Path Data="M0,0 L3.5,4 L7,0 Z" Fill="{DynamicResource Brush.TextTertiary}" VerticalAlignment="Center"/> -->+ <!-- </StackPanel> -->+ <!-- <Button.Flyout> -->+ <!-- <MenuFlyout Placement="BottomEdgeAlignedLeft"> -->+ <!-- <MenuItem Header="Instrument" Click="OnAddInstrumentClicked"/> -->+ <!-- <MenuItem Header="Audio" Click="OnAddAudioClicked"/> -->+ <!-- <MenuItem Header="Return" Click="OnAddReturnClicked"/> -->+ <!-- </MenuFlyout> -->+ <!-- </Button.Flyout> -->+ <!-- </Button> --><!-- MIDI learn + an input-activity dot, so a silent controller is diagnosable --><ToggleButton Grid.Column="6" x:Name="MidiLearnBtn" Classes="chip" Margin="8,0,0,0"Click="OnToggleMidiLearn"- ToolTip.Tip="MIDI Learn — highlight mappable controls, click one, then move a knob on your controller">+ ToolTip.Tip="Map a controller — click a control, then move a knob on the controller"><StackPanel Orientation="Horizontal" Spacing="6" VerticalAlignment="Center"><TextBlock Text="MIDI" VerticalAlignment="Center"Foreground="{Binding $parent[ToggleButton].Foreground}"/>@@ -316,8 +323,8 @@</StackPanel><!-- Master: fader over its meter, with the gain in dB -->- <Border Grid.Column="9" Height="42" Margin="12,0,0,0" Padding="10,0"- Background="{DynamicResource Brush.BgApp}" CornerRadius="{StaticResource Radius.Sm}"+ <Border Grid.Column="9" Height="{StaticResource Control.Transport}" Margin="12,0,0,0" Padding="10,0"+ Background="{DynamicResource Brush.BgSunken}" CornerRadius="{StaticResource Radius.Tile}"VerticalAlignment="Center"><StackPanel Orientation="Horizontal" Spacing="9" VerticalAlignment="Center"><TextBlock Classes="CellLabel" Text="MST" VerticalAlignment="Center"/>@@ -356,9 +363,10 @@</Grid></Border>+<!-- Main area (fills) over a resizable bottom Detail panel, split by adraggable horizontal GridSplitter. -->- <Grid x:Name="BodyGrid">+ <Grid x:Name="BodyGrid" Background="{DynamicResource Brush.Gutter}"><Grid.RowDefinitions><RowDefinition Height="*" MinHeight="120"/><RowDefinition Height="Auto"/>@@ -374,11 +382,11 @@<ColumnDefinition Width="Auto"/><ColumnDefinition Width="*"/></Grid.ColumnDefinitions>- <app:BrowserView x:Name="Browser" Grid.Column="0" Margin="8,8,6,8"/>+ <app:BrowserView x:Name="Browser" Grid.Column="0" Margin="12,12,10,12"/><GridSplitter Grid.Column="1" Width="2" Background="Transparent"ResizeDirection="Columns"/><Panel x:Name="MainContent" Grid.Column="2">- <app:ArrangementView x:Name="Timeline" Margin="0,8,8,8"/>+ <app:ArrangementView x:Name="Timeline" Margin="0,12,12,12"/></Panel></Grid>@@ -392,7 +400,7 @@<!-- Detail panel: Devices chain / Clip (piano roll) / Mixer for the selected track --><Border x:Name="DetailPanel" Grid.Row="2" Classes="Panel"- IsVisible="False" Background="{DynamicResource Brush.BgApp}">+ IsVisible="False" Background="{DynamicResource Brush.Panel}"><DockPanel><!-- Header (1d/1e): mode tabs · track chip (routing/PDC) · Freeze · close --><Grid DockPanel.Dock="Top" Height="34" Margin="12,0" ColumnDefinitions="Auto,*,Auto,Auto,Auto">@@ -410,17 +418,16 @@<StackPanel Grid.Column="2" Orientation="Horizontal" Spacing="4" VerticalAlignment="Center"><Button x:Name="FreezeBtn" Classes="ghost" Height="24" Padding="8,0" VerticalAlignment="Center"Click="OnFreezeClick"- ToolTip.Tip="Freeze track — bounce it to audio to free up CPU (right-click for Flatten)">+ ToolTip.Tip="Freeze the track to audio to free CPU (right-click to flatten)"><StackPanel Orientation="Horizontal" Spacing="6" VerticalAlignment="Center">- <TextBlock x:Name="FreezeIcon" Text="❄" FontSize="12" VerticalAlignment="Center"- Foreground="{DynamicResource Brush.TextSecondary}"/>+ <app:Glyph x:Name="FreezeIcon" Kind="Freeze" Foreground="{DynamicResource Brush.TextSecondary}"/><TextBlock x:Name="FreezeLabel" Text="Freeze" FontSize="11" VerticalAlignment="Center"Foreground="{DynamicResource Brush.TextSecondary}"/></StackPanel></Button><Button x:Name="LiveFreezeBtn" Classes="ghost" Height="24" Padding="8,0" VerticalAlignment="Center"IsVisible="False" Click="OnLiveFreezeClick"- ToolTip.Tip="Live Freeze — bounce to a linked audio track below and sleep the source (Edit later to change it)">+ ToolTip.Tip="Bounce to a linked audio track below and put the source to sleep"><StackPanel Orientation="Horizontal" Spacing="6" VerticalAlignment="Center"><Path Width="14" Height="14" Stretch="None" StrokeThickness="1.4"Stroke="{DynamicResource Brush.TextSecondary}" VerticalAlignment="Center"@@ -431,28 +438,35 @@</Button><Button x:Name="EditBtn" Classes="ghost" Height="24" Padding="8,0" VerticalAlignment="Center"IsVisible="False" Click="OnEditClick"- ToolTip.Tip="Edit the frozen source — wakes it so you can change notes/devices (right-click: Unfreeze / Flatten)">- <TextBlock Text="✎ Edit" FontSize="11" VerticalAlignment="Center"- Foreground="{DynamicResource Brush.AccentBright}"/>+ ToolTip.Tip="Wake the frozen source to edit it (right-click to unfreeze or flatten)">+ <StackPanel Orientation="Horizontal" Spacing="5" VerticalAlignment="Center">+ <app:Glyph x:Name="EditGlyph" Kind="Edit" Foreground="{DynamicResource Brush.AccentBright}"/>+ <TextBlock Text="Edit" FontSize="11" VerticalAlignment="Center" Foreground="{DynamicResource Brush.AccentBright}"/>+ </StackPanel></Button><Button x:Name="DoneBtn" Classes="ghost" Height="24" Padding="8,0" VerticalAlignment="Center"IsVisible="False" Click="OnDoneClick"- ToolTip.Tip="Done — re-freeze the source and put it back to sleep">- <TextBlock Text="✓ Done" FontSize="11" VerticalAlignment="Center"- Foreground="{DynamicResource Brush.AccentBright}"/>+ ToolTip.Tip="Re-freeze the source and put it back to sleep">+ <StackPanel Orientation="Horizontal" Spacing="5" VerticalAlignment="Center">+ <app:Glyph x:Name="DoneGlyph" Kind="Check" Foreground="{DynamicResource Brush.AccentBright}"/>+ <TextBlock Text="Done" FontSize="11" VerticalAlignment="Center" Foreground="{DynamicResource Brush.AccentBright}"/>+ </StackPanel></Button><Button x:Name="DiscardBtn" Classes="ghost" Height="24" Padding="6,0" VerticalAlignment="Center"IsVisible="False" Click="OnDiscardClick"- ToolTip.Tip="Discard — leave edit mode without re-freezing">- <TextBlock Text="✗" FontSize="12" VerticalAlignment="Center"- Foreground="{DynamicResource Brush.TextTertiary}"/>+ ToolTip.Tip="Leave edit mode without re-freezing">+ <app:Glyph x:Name="DiscardGlyph" Kind="Cross" Foreground="{DynamicResource Brush.TextTertiary}"/></Button></StackPanel>- <Button x:Name="DetailPopOut" Grid.Column="3" Content="⧉" Classes="ghost" FontSize="14" Margin="8,0,0,0"+ <Button x:Name="DetailPopOut" Grid.Column="3" Classes="ghost" Margin="8,0,0,0" Padding="7,0"Foreground="{DynamicResource Brush.TextTertiary}" Click="OnToggleDetailWindow"- ToolTip.Tip="Open Devices + Clip in a separate window"/>- <Button Grid.Column="4" Content="✕" Classes="ghost" FontSize="12" Margin="4,0,0,0"- Foreground="{DynamicResource Brush.TextTertiary}" Click="OnCloseDetail"/>+ ToolTip.Tip="Open devices and clip in a separate window">+ <app:Glyph x:Name="PopOutGlyph" Kind="PopOut"/>+ </Button>+ <Button Grid.Column="4" Classes="ghost" Margin="4,0,0,0" Padding="7,0"+ Foreground="{DynamicResource Brush.TextTertiary}" Click="OnCloseDetail" ToolTip.Tip="Close">+ <app:Glyph x:Name="CloseDetailGlyph" Kind="Close"/>+ </Button></Grid><ContentControl x:Name="DetailBody"/></DockPanel>diff --git a/src/managed/Nota.App/MainWindow.axaml.cs b/src/managed/Nota.App/MainWindow.axaml.csindex c2813742..419b2cd2 100644--- a/src/managed/Nota.App/MainWindow.axaml.cs+++ b/src/managed/Nota.App/MainWindow.axaml.cs@@ -197,8 +197,9 @@ public partial class MainWindow : WindowMidiLearn.Bind(masterVol, MidiTarget.MasterVolume, "Master Volume");// BPM as a drag/type field (HANDOFF §4).- var bpmField = new DragNumber((double)vm.Transport.Bpm, 20, 300, 0.5, "0", fontSize: 14);- bpmField.ValueChanged += v => vm.Transport.Bpm = (decimal)Math.Round(v);+ // Tempo reads with two decimals (almanac § Numbers); a drag moves in half-BPM steps.+ var bpmField = new DragNumber((double)vm.Transport.Bpm, 20, 300, 0.5, "0.00", fontSize: 14);+ bpmField.ValueChanged += v => vm.Transport.Bpm = (decimal)Math.Round(v, 2);BpmHost.Children.Add(bpmField);// Time signature: numerator drags 1–16; denominator snaps to a power of two.@@ -307,7 +308,7 @@ public partial class MainWindow : Window// Modular: signal-graph view of the selected track (mockup 1a). Follows track// selection like the Detail device chain does.// Same island gutter as the arrangement it replaces in MainContent.- _modular = new ModularView(vm.Engine) { IsVisible = false, Margin = new Thickness(0, 8, 8, 8) };+ _modular = new ModularView(vm.Engine) { IsVisible = false, Margin = new Thickness(0, NotaSpace.Gutter, NotaSpace.Gutter, NotaSpace.Gutter) };_modular.Changed += () => { Timeline.Refresh(); if (_deviceChain is { } dc && dc.TrackId > 0) dc.Refresh(); };_modular.TrackActivated += OnTrackSelected; // Global-view island → select that track_modular.ItemDropped += OnModularDrop; // browser drag onto the modular canvasdiff --git a/src/managed/Nota.App/MidiLearnOverlay.cs b/src/managed/Nota.App/MidiLearnOverlay.csindex 5a9842a0..adaaff4d 100644--- a/src/managed/Nota.App/MidiLearnOverlay.cs+++ b/src/managed/Nota.App/MidiLearnOverlay.cs@@ -95,9 +95,9 @@ public sealed class MidiLearnOverlay : Controlbool mapped = _service.MappingFor(binding.Target) is not null;var outline = pending ? NotaPalette.Accent : mapped ? NotaPalette.Success : NotaPalette.Accent;- var fill = pending ? new SolidColorBrush(NotaPalette.AccentColor, 0.30)- : mapped ? new SolidColorBrush(NotaPalette.SuccessColor, 0.18)- : new SolidColorBrush(NotaPalette.AccentColor, 0.15);+ var fill = pending ? NotaPalette.Wash(NotaPalette.Accent, 0x4D)+ : mapped ? NotaPalette.Wash(NotaPalette.Success, 0x2E)+ : NotaPalette.Wash(NotaPalette.Accent, 0x26);var pad = rect.Inflate(2);ctx.DrawRectangle(fill, new Pen(outline, pending ? 2.5 : 1.5), pad, 4, 4);}diff --git a/src/managed/Nota.App/MidiMapView.cs b/src/managed/Nota.App/MidiMapView.csindex 9d302c03..04385243 100644--- a/src/managed/Nota.App/MidiMapView.cs+++ b/src/managed/Nota.App/MidiMapView.cs@@ -58,7 +58,7 @@ public sealed class MidiMapView : UserControl};var del = new Button{- Content = "✕", FontSize = 11, Padding = new Avalonia.Thickness(6, 1),+ Content = new Glyph(GlyphKind.Close, 10), Padding = new Avalonia.Thickness(6, 1),Background = Brushes.Transparent, BorderThickness = new Avalonia.Thickness(0),Foreground = NotaPalette.TextTertiary, VerticalAlignment = VerticalAlignment.Center,};diff --git a/src/managed/Nota.App/MidiToolsView.cs b/src/managed/Nota.App/MidiToolsView.csindex 4730135e..d371f8ca 100644--- a/src/managed/Nota.App/MidiToolsView.cs+++ b/src/managed/Nota.App/MidiToolsView.cs@@ -78,7 +78,7 @@ public sealed class MidiToolsView : UserControlbody.Children.Add(KindTabs());body.Children.Add(new Border{- Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5),+ Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile,Padding = new Thickness(3), MaxHeight = 236,Child = new ScrollViewer { Content = _toolList, HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled },});@@ -159,7 +159,7 @@ public sealed class MidiToolsView : UserControl_roll.ShowPreview(result);_suppressResync = false;int delta = result.Count - _source.Count;- _resultText.Text = $"{result.Count} notes ({delta:+0;-0;\u00b10})";+ _resultText.Text = $"{result.Count} notes ({delta:+0;−0;\u00b10})";_resultText.Foreground = delta == 0 ? TextTertiary : AccentBright;PaintApply();}@@ -193,7 +193,7 @@ public sealed class MidiToolsView : UserControl{if (_applyButton is null) return;bool pending = _roll.Previewing;- _applyButton.Opacity = pending ? 1 : 0.45;+ Inactive.Set(_applyButton, !pending, interactive: true);_applyButton.Cursor = new Cursor(pending ? StandardCursorType.Hand : StandardCursorType.Arrow);}@@ -226,7 +226,7 @@ public sealed class MidiToolsView : UserControlvar t = new TextBlock { Text = label, FontSize = 10, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };var b = new Border{- Height = 24, CornerRadius = new CornerRadius(5), BorderThickness = new Thickness(1),+ Height = 24, CornerRadius = NotaRadius.Tile, BorderThickness = new Thickness(1),Cursor = new Cursor(StandardCursorType.Hand), Child = t, Tag = kind,};b.PointerPressed += (_, e) =>@@ -265,7 +265,7 @@ public sealed class MidiToolsView : UserControl};var row = new Border{- Height = 24, CornerRadius = new CornerRadius(4),+ Height = 24, CornerRadius = NotaRadius.Control,Background = active ? AccentSubtle : Brushes.Transparent,BorderBrush = active ? Brass : Brushes.Transparent, BorderThickness = new Thickness(1),Cursor = new Cursor(StandardCursorType.Hand), Child = text,@@ -448,7 +448,7 @@ public sealed class MidiToolsView : UserControl{var apply = new Border{- Height = 26, Background = AccentSubtle, BorderBrush = Brass, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5),+ Height = 26, Background = AccentSubtle, BorderBrush = Brass, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile,Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = "Apply", FontSize = 11, Foreground = AccentBright, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center },};@@ -513,18 +513,18 @@ public sealed class MidiToolsView : UserControlprivate static Border FieldBox(double h) => new(){- Height = h, Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5),+ Height = h, Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile,};private static Border Chip(Control child) => new(){- Height = 20, Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5),+ Height = 20, Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile,Cursor = new Cursor(StandardCursorType.Hand), Child = child, Padding = new Thickness(0, 0, 6, 0),};private static Border TextChip(string text) => new(){- Height = 22, Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5),+ Height = 22, Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile,Cursor = new Cursor(StandardCursorType.Hand), Padding = new Thickness(8, 0),Child = new TextBlock { Text = text, FontSize = 10, Foreground = TextSecondary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center },};diff --git a/src/managed/Nota.App/MixerView.cs b/src/managed/Nota.App/MixerView.csindex 9f3cc317..f2fe32c6 100644--- a/src/managed/Nota.App/MixerView.cs+++ b/src/managed/Nota.App/MixerView.cs@@ -74,7 +74,7 @@ public sealed class MixerView : UserControlfor (int i = 0; i < n; i++){if (!_engine.TryGetTrackInfo(i, out var ti)) continue;- Color c = ArrangementView.TrackColorForIndex(ArrangementView.EffectiveColorIndex(_engine, ti.Id));+ var c = ArrangementView.TrackBrush(ArrangementView.EffectiveColorIndex(_engine, ti.Id));_row.Children.Add(Strip(ti, c, returns));}_row.Children.Add(MasterStrip());@@ -92,7 +92,7 @@ public sealed class MixerView : UserControl// ---- strips ------------------------------------------------------------ private Control Strip(NotaTrackInfo ti, Color color, int returns)+ private Control Strip(NotaTrackInfo ti, IBrush color, int returns){int id = ti.Id;bool isReturn = ti.IsReturn;@@ -125,21 +125,21 @@ public sealed class MixerView : UserControlreturn new Border{Width = 154, Background = Card, BorderBrush = BorderDef, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(6), ClipToBounds = true, Child = col,+ CornerRadius = NotaRadius.Panel, ClipToBounds = true, Child = col,};}private Control MasterStrip(){var col = new StackPanel();- col.Children.Add(Header("Master", NotaPalette.AccentColor, MasterBg));+ col.Children.Add(Header("Master", NotaPalette.Accent, MasterBg));var ioRow = IoRow("Sum bus", "→ Output");ioRow.IsVisible = _ioVisible;_ioSections.Add(ioRow);col.Children.Add(ioRow);Control db;- var faderRow = FaderRow(-1, _masterVolume, NotaPalette.AccentColor, out db, out var meter);+ var faderRow = FaderRow(-1, _masterVolume, NotaPalette.Accent, out db, out var meter);_meters.Add((-1, meter));col.Children.Add(faderRow);col.Children.Add(db);@@ -150,7 +150,7 @@ public sealed class MixerView : UserControlreturn new Border{Width = 154, Background = MasterBg, BorderBrush = BorderDef, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(6), ClipToBounds = true, Child = col,+ CornerRadius = NotaRadius.Panel, ClipToBounds = true, Child = col,};}@@ -178,8 +178,9 @@ public sealed class MixerView : UserControl{bool on = initial;var t = new TextBlock { Text = label, FontSize = 10, FontWeight = FontWeight.SemiBold, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };- var b = new Border { Height = 20, Padding = new Thickness(8, 0), CornerRadius = new CornerRadius(5), BorderThickness = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand), Child = t };- void Paint() { b.Background = on ? Brass : MasterBg; b.BorderBrush = on ? Brass : BorderStrong; t.Foreground = on ? OnAccent : TextSecondary; }+ var b = new Border { Height = 20, Padding = new Thickness(8, 0), CornerRadius = NotaRadius.Tile, BorderThickness = new Thickness(1), VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.Hand), Child = t };+ // Engaged, not the primary action: Brass Wash + brass border + Brass Hover text (solid brass is for one action only).+ void Paint() { b.Background = on ? NotaPalette.AccentSubtle : MasterBg; b.BorderBrush = on ? NotaPalette.BorderBrass : BorderStrong; t.Foreground = on ? NotaPalette.AccentHover : TextSecondary; }b.PointerPressed += (_, e) => { e.Handled = true; on = !on; set(on); Paint(); };Paint();return b;@@ -188,12 +189,12 @@ public sealed class MixerView : UserControl// Crossfader is not in the engine yet — a disabled A/B track with an M7+ badge.private Control Crossfader(){- var track = new Border { Width = 120, Height = 4, Background = Sunken, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center };- var knob = new Border { Width = 12, Height = 14, Background = NotaPalette.SurfaceHover, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };+ var track = new Border { Width = 120, Height = 4, Background = Sunken, CornerRadius = NotaRadius.Clip, VerticalAlignment = VerticalAlignment.Center };+ var knob = new Border { Width = 12, Height = 14, Background = NotaPalette.SurfaceHover, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };var host = new Panel { Width = 120, Children = { track, knob } };var row = new StackPanel{- Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Opacity = 0.7, IsEnabled = false,+ Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, IsEnabled = false,Children ={new TextBlock { Text = "A", FontSize = 9, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center },@@ -212,10 +213,10 @@ public sealed class MixerView : UserControl=> ti.IsReturn ? $"Return {_engine.TrackReturnIndex(ti.Id) + 1}": (ti.IsInstrument ? "Inst " : "Audio ") + ti.Id;- private Control Header(string name, Color topColor, IBrush bg)+ private Control Header(string name, IBrush topColor, IBrush bg){var grid = new Grid { RowDefinitions = new RowDefinitions("2,*") };- grid.Children.Add(new Border { Background = new SolidColorBrush(topColor), Height = 2, VerticalAlignment = VerticalAlignment.Top });+ grid.Children.Add(new Border { Background = topColor, Height = 2, VerticalAlignment = VerticalAlignment.Top });var label = new TextBlock { Text = name, FontSize = 10, FontWeight = FontWeight.SemiBold, Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(7, 0, 7, 0), TextTrimming = TextTrimming.CharacterEllipsis };Grid.SetRow(label, 1);grid.Children.Add(label);@@ -296,7 +297,7 @@ public sealed class MixerView : UserControl}else{- var flat = new Border { Height = 3, Background = Sunken, CornerRadius = new CornerRadius(2), VerticalAlignment = VerticalAlignment.Center, Opacity = 0.5 };+ var flat = new Border { Height = 3, Background = NotaPalette.TrackOff, CornerRadius = NotaRadius.Clip, VerticalAlignment = VerticalAlignment.Center };Grid.SetColumn(flat, 1); grid.Children.Add(flat);}body.Children.Add(grid);@@ -327,14 +328,14 @@ public sealed class MixerView : UserControlprivate static double LinToDb(double v) => v <= 1e-4 ? MinDb : Math.Clamp(AudioMath.LinToDb(v), MinDb, MaxDb);private static double DbToLin(double db) => db <= MinDb + 1e-6 ? 0.0 : Math.Clamp(AudioMath.DbToLin(db), 0, MaxLin);- private Control FaderRow(int id, float vol, Color color, out Control db, out MeterBar meter)+ private Control FaderRow(int id, float vol, IBrush color, out Control db, out MeterBar meter){var fader = new VFader(vol, color);- var dbNum = new DragNumber(LinToDb(vol), MinDb, MaxDb, 0.3, "+0.0;-0.0;0.0", 8)+ var dbNum = new DragNumber(LinToDb(vol), MinDb, MaxDb, 0.3, "+0.0;−0.0;0.0", 8){Width = 52, HorizontalAlignment = HorizontalAlignment.Center,};- ToolTip.SetTip(dbNum, "Drag or double-click to set gain (dB)");+ ToolTip.SetTip(dbNum, "Set the gain — drag, or double-click to type");void SetVolume(double v) { if (id < 0) { _masterVolume = (float)v; _engine.SetMasterVolume(_masterVolume); } else _engine.SetTrackVolume(id, (float)v); }fader.ValueChanged += v => { SetVolume(v); dbNum.Value = LinToDb(v); };dbNum.ValueChanged += d => { double v = DbToLin(d); SetVolume(v); fader.SetValueExternal(v); };@@ -346,7 +347,7 @@ public sealed class MixerView : UserControlMidiLearn.Bind(fader, id > 0 ? MidiTarget.TrackVolume(id) : MidiTarget.MasterVolume, id > 0 ? "Track Volume" : "Master Volume");db = dbNum;- meter = new MeterBar { Width = 12 };+ meter = new MeterBar(); // the almanac stereo meter: 11 + 5 + 11var scaleGrid = new Grid { Width = 16, RowDefinitions = new RowDefinitions("*,*,*,*") };string[] marks = { "+6", "0", "-12", "-48" };for (int i = 0; i < 4; i++)@@ -360,7 +361,16 @@ public sealed class MixerView : UserControlvar grid = new Grid { Height = 190, ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), Margin = new Thickness(7, 8) };grid.Children.Add(scaleGrid);Grid.SetColumn(fader, 1); grid.Children.Add(fader);- Grid.SetColumn(meter, 2); meter.Margin = new Thickness(4, 0, 0, 0); grid.Children.Add(meter);+ // Channels lettered under the meter (almanac § level meters), one letter per 11px column.+ var letters = new Grid { ColumnDefinitions = new ColumnDefinitions($"{MeterScale.ChannelW},{MeterScale.Step},{MeterScale.ChannelW}"), Margin = new Thickness(0, 3, 0, 0) };+ foreach (var (txt, col) in new[] { ("L", 0), ("R", 2) })+ {+ var t = new TextBlock { Text = txt, FontSize = NotaType.Axis, FontFamily = NotaFonts.MonoFamily, Foreground = NotaPalette.TextTertiary, HorizontalAlignment = HorizontalAlignment.Center };+ Grid.SetColumn(t, col); letters.Children.Add(t);+ }+ DockPanel.SetDock(letters, Dock.Bottom);+ var meterCol = new DockPanel { Margin = new Thickness(4, 0, 0, 0), Children = { letters, meter } };+ Grid.SetColumn(meterCol, 2); grid.Children.Add(meterCol);return grid;}@@ -373,15 +383,32 @@ public sealed class MixerView : UserControlMidiLearn.Bind(solo, MidiTarget.TrackSolo(id), "Solo");row.Children.Add(mute);row.Children.Add(solo);- if (!isReturn) row.Children.Add(Toggle("●", true, ti.Armed != 0, v => _engine.SetTrackArmed(id, v)));+ if (!isReturn) row.Children.Add(ArmToggle(ti.Armed != 0, v => _engine.SetTrackArmed(id, v)));return new Border { Height = 28, BorderBrush = BorderInner, BorderThickness = new Thickness(0, 1, 0, 0), Child = row };}+ // Record-arm: neutral with a red disc at rest, solid record red with a pale disc when armed.+ private Border ArmToggle(bool initial, Action<bool> set)+ {+ bool on = initial;+ var disc = new Glyph(GlyphKind.Record, 7);+ var b = new Border { Width = 20, Height = 17, CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Child = disc };+ void Paint()+ {+ b.Background = on ? NotaPalette.Record : MasterBg;+ b.BorderBrush = on ? NotaPalette.Record : BorderStrong;+ disc.Foreground = on ? NotaPalette.RecordInk : NotaPalette.Record;+ }+ b.PointerPressed += (_, e) => { if (!e.GetCurrentPoint(b).Properties.IsLeftButtonPressed) return; e.Handled = true; on = !on; set(on); Paint(); };+ Paint();+ return b;+ }+private Border Toggle(string label, bool danger, bool initial, Action<bool> set){bool on = initial;var t = new TextBlock { Text = label, FontSize = 9, FontWeight = FontWeight.Bold, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };- var b = new Border { Width = 20, Height = 17, CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1), Child = t };+ var b = new Border { Width = 20, Height = 17, CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1), Child = t };void Paint(){var accent = danger ? Danger : Brass;diff --git a/src/managed/Nota.App/ModularView.cs b/src/managed/Nota.App/ModularView.csindex 2063dd92..dea05d7d 100644--- a/src/managed/Nota.App/ModularView.cs+++ b/src/managed/Nota.App/ModularView.cs@@ -38,7 +38,7 @@ public sealed class ModularView : UserControlprivate static readonly IBrush BorderDef = NotaPalette.BorderDefault;private static readonly IBrush BorderInner = NotaPalette.SurfaceRaised;private static readonly IBrush BorderStrong = NotaPalette.BorderStrong;- private static readonly IBrush BorderHover = NotaPalette.BorderHover;+ private static readonly IBrush BorderHover = NotaPalette.BorderStrong;private static readonly IBrush Text1 = NotaPalette.TextPrimary;private static readonly IBrush Text2 = NotaPalette.TextSecondary;private static readonly IBrush Text3 = NotaPalette.TextTertiary;@@ -61,7 +61,7 @@ public sealed class ModularView : UserControl// toolbar / status widgetsprivate readonly ToggleButton _trackBtn = Seg("Track", true);private readonly ToggleButton _globalBtn = Seg("Global", false);- private readonly TextBlock _zoomLabel = new() { Text = "100 %", FontSize = 10, Foreground = Text3, VerticalAlignment = VerticalAlignment.Center };+ private readonly TextBlock _zoomLabel = new() { Text = "100\u2009%", FontSize = 10, Foreground = Text3, VerticalAlignment = VerticalAlignment.Center };private readonly TextBlock _status = new() { Text = "", FontSize = 10, Foreground = Text2, VerticalAlignment = VerticalAlignment.Center };private readonly TextBlock _statusRight = new() { Text = "", FontSize = 10, Foreground = Text2, VerticalAlignment = VerticalAlignment.Center };@@ -75,7 +75,7 @@ public sealed class ModularView : UserControlpublic int TrackId => _trackId;private readonly Border _dropGlow = new(){- BorderBrush = NotaPalette.Accent, BorderThickness = new Thickness(2), CornerRadius = new CornerRadius(4),+ BorderBrush = NotaPalette.Accent, BorderThickness = new Thickness(2), CornerRadius = NotaRadius.Control,Background = NotaPalette.AccentSubtle, IsVisible = false, IsHitTestVisible = false,};@@ -179,7 +179,7 @@ public sealed class ModularView : UserControlClipToBounds = true,Child = root,};- island.BindResource(Border.CornerRadiusProperty, "Radius.Md");+ island.BindResource(Border.CornerRadiusProperty, "Radius.Panel");island.BindResource(Border.BackgroundProperty, "Brush.SurfaceCard");island.BindResource(Border.BorderBrushProperty, "Brush.BorderDefault");Content = island;@@ -255,7 +255,7 @@ public sealed class ModularView : UserControlbool active = trackId == _trackId;string name = _engine.GetTrackName(trackId);if (string.IsNullOrEmpty(name)) name = (ti.IsReturn ? "Return " : ti.IsInstrument ? "Inst " : "Audio ") + trackId;- var color = new SolidColorBrush(ArrangementView.TrackColorForIndex(ArrangementView.EffectiveColorIndex(_engine, trackId)));+ var color = ArrangementView.TrackBrush(ArrangementView.EffectiveColorIndex(_engine, trackId));var row = new Border{Height = 34, Background = active ? NotaPalette.AccentSubtle : Brushes.Transparent,@@ -499,7 +499,7 @@ public sealed class ModularView : UserControl_status.Text = $"{trackName} · {_nodes.Count} nodes · {edges} edge{(edges == 1 ? "" : "s")}";var cfg = _engine.GetAudioConfig();double ms = cfg.BufferFrames > 0 && cfg.SampleRate > 0 ? cfg.BufferFrames / cfg.SampleRate * 1000.0 : 0;- _statusRight.Text = $"{_engine.SampleRate / 1000.0:0.0} kHz · {cfg.BufferFrames} · {ms:0.0} ms";+ _statusRight.Text = $"{_engine.SampleRate / 1000.0:0.0}\u2009kHz · {cfg.BufferFrames} · {ms:0.0}\u2009ms";// Re-apply selection to the surviving node (structural edits rebuild the nodes).if (_selId != null)@@ -562,7 +562,7 @@ public sealed class ModularView : UserControl+ (xlinks > 0 ? $" · {xlinks} cross-track CV link{(xlinks == 1 ? "" : "s")}" : "");var cfg = _engine.GetAudioConfig();double ms = cfg.BufferFrames > 0 && cfg.SampleRate > 0 ? cfg.BufferFrames / cfg.SampleRate * 1000.0 : 0;- _statusRight.Text = $"{_engine.SampleRate / 1000.0:0.0} kHz · {cfg.BufferFrames} · {ms:0.0} ms";+ _statusRight.Text = $"{_engine.SampleRate / 1000.0:0.0}\u2009kHz · {cfg.BufferFrames} · {ms:0.0}\u2009ms";if (_selId != null) { var s = _nodes.FirstOrDefault(x => x.Id == _selId); if (s != null) SelectNode(s); }_grid.InvalidateVisual();_edges.InvalidateVisual();@@ -575,7 +575,7 @@ public sealed class ModularView : UserControl{string name = _engine.GetTrackName(trackId);if (string.IsNullOrEmpty(name)) name = "Track " + trackId;- var color = new SolidColorBrush(ArrangementView.TrackColorForIndex(ArrangementView.EffectiveColorIndex(_engine, trackId)));+ var color = ArrangementView.TrackBrush(ArrangementView.EffectiveColorIndex(_engine, trackId));int mfx = ti.IsInstrument ? _engine.TrackMidiEffectCount(trackId) : 0;int dev = _engine.TrackDeviceCount(trackId);int mods = _engine.ModulatorCount(trackId);@@ -595,7 +595,7 @@ public sealed class ModularView : UserControln.IslandHeight = h;var col = new Grid { RowDefinitions = new RowDefinitions(hasMods ? "2,30,54,34" : "2,30,54") };- col.Children.Add(Row(new Border { Background = n.Stripe, CornerRadius = new CornerRadius(9, 9, 0, 0) }, 0));+ col.Children.Add(Row(new Border { Background = n.Stripe, CornerRadius = NotaRadius.Top(NotaRadius.BodyValue) }, 0));// headervar head = new DockPanel { LastChildFill = true, Margin = new Thickness(10, 0) };@@ -620,7 +620,7 @@ public sealed class ModularView : UserControlif (dev > 0){pipe.ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto,*,Auto");- var pill = IslandPill($"{dev} device{(dev == 1 ? "" : "s")} ▸");+ var pill = IslandPill($"{dev} device{(dev == 1 ? "" : "s")} →");pill.PointerPressed += (_, e) => { OpenTrack(trackId); e.Handled = true; };Grid.SetColumn(pill, 2);pipe.Children.Add(IslandChip(srcName, n.Stripe, 0));@@ -655,10 +655,10 @@ public sealed class ModularView : UserControlvar frame = new Border{Width = IslandW, Height = h, Background = Rail,- BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(10),+ BorderBrush = BorderDef, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Body,Child = col,- BoxShadow = new BoxShadows(new BoxShadow { OffsetX = 0, OffsetY = 10, Blur = 28, Color = Color.FromArgb(115, 0, 0, 0) }),};+ if (n.Bypassed) frame.AttachedToVisualTree += (_, _) => Inactive.Set(col, true, interactive: true);n.View = frame;frame.PointerEntered += (_, _) => { if (!n.Selected) frame.BorderBrush = BorderHover; };frame.PointerExited += (_, _) => { if (!n.Selected) frame.BorderBrush = BorderDef; };@@ -674,7 +674,7 @@ public sealed class ModularView : UserControlvar b = new Border{Height = 30, Background = Card, BorderBrush = topColor, BorderThickness = new Thickness(1, 2, 1, 1),- CornerRadius = new CornerRadius(5), Padding = new Thickness(9, 0),+ CornerRadius = NotaRadius.Tile, Padding = new Thickness(9, 0),Child = new TextBlock { Text = text, FontSize = 10, Foreground = Text1, VerticalAlignment = VerticalAlignment.Center },VerticalAlignment = VerticalAlignment.Center,};@@ -687,7 +687,7 @@ public sealed class ModularView : UserControlvar b = new Border{Height = 22, Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(11), Padding = new Thickness(9, 0), Cursor = new Cursor(StandardCursorType.Hand),+ CornerRadius = NotaRadius.Pill, Padding = new Thickness(9, 0), Cursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = text, FontSize = 9, Foreground = Text2, VerticalAlignment = VerticalAlignment.Center },VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center,};@@ -696,7 +696,7 @@ public sealed class ModularView : UserControlprivate static Border Pipe(int column){- var b = new Border { Height = 6, Background = Sage, Opacity = 0.55, VerticalAlignment = VerticalAlignment.Center };+ var b = new Border { Height = 6, Background = NotaPalette.Wash(NotaPalette.Sage, 0x8C), VerticalAlignment = VerticalAlignment.Center };Grid.SetColumn(b, column);return b;}@@ -792,8 +792,8 @@ public sealed class ModularView : UserControl// ---- param → knob cell (device/midi raw floats, instrument normalized) ----private static string Fmt(float v) => Math.Abs(v) >= 100- ? v.ToString("0", CultureInfo.InvariantCulture)- : v.ToString("0.0", CultureInfo.InvariantCulture);+ ? v.ToString("0", NotaNum.Culture)+ : v.ToString("0.0", NotaNum.Culture);private Control DeviceParam(int device, int param){@@ -850,9 +850,9 @@ public sealed class ModularView : UserControlstring pid = e.PluginParamId(t, -1, pp);float val = e.PluginParamGet(t, -1, pp); // normalized 0..1bool modulated = e.ParamModulated(1, t, -1, pp);- var value = MonoValue(val.ToString("0.00", CultureInfo.InvariantCulture));+ var value = MonoValue(val.ToString("0.00", NotaNum.Culture));var knob = new Knob(val, 1.0) { Accent = true, ArcColor = modulated ? Teal : null, Default = e.InstrumentParamDefault(t, pp) };- knob.ValueChanged += frac => { e.PluginParamSet(t, -1, pp, (float)frac); value.Text = frac.ToString("0.00", CultureInfo.InvariantCulture); };+ knob.ValueChanged += frac => { e.PluginParamSet(t, -1, pp, (float)frac); value.Text = frac.ToString("0.00", NotaNum.Culture); };knob.GestureBegin += () => e.BeginAutomationWrite(t, AutomationTarget.PluginParam, -1, -1, pid);knob.GestureEnd += () => e.EndAutomationWrite(t, AutomationTarget.PluginParam, -1, -1, pid);// Instrument params are modulated by dragging a CV cable onto the node (no right-click menu).@@ -860,7 +860,7 @@ public sealed class ModularView : UserControl{if (knob.Dragging) return;float cur = e.PluginParamGet(t, -1, pp);- if (Math.Abs(cur - knob.Value) > 1e-3) { knob.Value = cur; value.Text = cur.ToString("0.00", CultureInfo.InvariantCulture); }+ if (Math.Abs(cur - knob.Value) > 1e-3) { knob.Value = cur; value.Text = cur.ToString("0.00", NotaNum.Culture); }});return KnobCell(name, knob, value, modulated ? Teal : null);}@@ -910,7 +910,7 @@ public sealed class ModularView : UserControl// A top "select" row (waveform for LFO, MIDI source for MIDI→CV) then a knob grid.bool hasTopRow = kind == 0 || kind == 2;var col = new Grid { RowDefinitions = hasTopRow ? new RowDefinitions("3,32,34,Auto,Auto") : new RowDefinitions("3,32,Auto,Auto") };- col.Children.Add(Row(new Border { Background = n.Stripe, CornerRadius = new CornerRadius(5, 5, 0, 0) }, 0));+ col.Children.Add(Row(new Border { Background = n.Stripe, CornerRadius = NotaRadius.Top(NotaRadius.TileValue) }, 0));var headBorder = NodeHeader(n);col.Children.Add(Row(headBorder, 1));@@ -918,38 +918,38 @@ public sealed class ModularView : UserControlGrid grid;if (kind == 4) // Macro: one manual knob (its value is the CV output){- grid = KnobGrid(ModFieldCell("MACRO", modId, 4, 0f, 1f, v => (v * 100).ToString("0", CultureInfo.InvariantCulture) + " %"));+ grid = KnobGrid(ModFieldCell("MACRO", modId, 4, 0f, 1f, v => (v * 100).ToString("0", NotaNum.Culture) + "\u2009%"));}else if (kind == 3) // ADSR: Attack / Decay / Sustain / Release (+ Depth){grid = KnobGrid(- ModFieldCell("ATTACK", modId, 6, 0.1f, 2000f, v => v.ToString("0", CultureInfo.InvariantCulture) + " ms"),- ModFieldCell("DECAY", modId, 8, 1f, 2000f, v => v.ToString("0", CultureInfo.InvariantCulture) + " ms"),- ModFieldCell("SUSTAIN", modId, 9, 0f, 1f, v => (v * 100).ToString("0", CultureInfo.InvariantCulture) + " %"),- ModFieldCell("RELEASE", modId, 7, 1f, 4000f, v => v.ToString("0", CultureInfo.InvariantCulture) + " ms"),- ModFieldCell("DEPTH", modId, 4, 0f, 1f, v => (v * 100).ToString("0", CultureInfo.InvariantCulture) + " %"));+ ModFieldCell("ATTACK", modId, 6, 0.1f, 2000f, v => v.ToString("0", NotaNum.Culture) + "\u2009ms"),+ ModFieldCell("DECAY", modId, 8, 1f, 2000f, v => v.ToString("0", NotaNum.Culture) + "\u2009ms"),+ ModFieldCell("SUSTAIN", modId, 9, 0f, 1f, v => (v * 100).ToString("0", NotaNum.Culture) + "\u2009%"),+ ModFieldCell("RELEASE", modId, 7, 1f, 4000f, v => v.ToString("0", NotaNum.Culture) + "\u2009ms"),+ ModFieldCell("DEPTH", modId, 4, 0f, 1f, v => (v * 100).ToString("0", NotaNum.Culture) + "\u2009%"));}else if (kind == 1) // envelope follower: Attack / Release / Depth{grid = KnobGrid(- ModFieldCell("ATTACK", modId, 6, 0.1f, 500f, v => v.ToString("0", CultureInfo.InvariantCulture) + " ms"),- ModFieldCell("RELEASE", modId, 7, 1f, 2000f, v => v.ToString("0", CultureInfo.InvariantCulture) + " ms"),- ModFieldCell("DEPTH", modId, 4, 0f, 1f, v => (v * 100).ToString("0", CultureInfo.InvariantCulture) + " %"));+ ModFieldCell("ATTACK", modId, 6, 0.1f, 500f, v => v.ToString("0", NotaNum.Culture) + "\u2009ms"),+ ModFieldCell("RELEASE", modId, 7, 1f, 2000f, v => v.ToString("0", NotaNum.Culture) + "\u2009ms"),+ ModFieldCell("DEPTH", modId, 4, 0f, 1f, v => (v * 100).ToString("0", NotaNum.Culture) + "\u2009%"));}else if (kind == 2) // MIDI→CV: source select + Smooth / Depth{col.Children.Add(Row(MidiSourceRow(modId), 2));grid = KnobGrid(- ModFieldCell("SMOOTH", modId, 6, 0.1f, 500f, v => v.ToString("0", CultureInfo.InvariantCulture) + " ms"),- ModFieldCell("DEPTH", modId, 4, 0f, 1f, v => (v * 100).ToString("0", CultureInfo.InvariantCulture) + " %"));+ ModFieldCell("SMOOTH", modId, 6, 0.1f, 500f, v => v.ToString("0", NotaNum.Culture) + "\u2009ms"),+ ModFieldCell("DEPTH", modId, 4, 0f, 1f, v => (v * 100).ToString("0", NotaNum.Culture) + "\u2009%"));}else // LFO: waveform + sync, then Rate / Depth / Phase{col.Children.Add(Row(WaveSyncRow(modId), 2));grid = KnobGrid(ModRateCell(modId),- ModFieldCell("DEPTH", modId, 4, 0f, 1f, v => (v * 100).ToString("0", CultureInfo.InvariantCulture) + " %"),- ModFieldCell("PHASE", modId, 5, 0f, 1f, v => (v * 360).ToString("0", CultureInfo.InvariantCulture) + "°"));+ ModFieldCell("DEPTH", modId, 4, 0f, 1f, v => (v * 100).ToString("0", NotaNum.Culture) + "\u2009%"),+ ModFieldCell("PHASE", modId, 5, 0f, 1f, v => (v * 360).ToString("0", NotaNum.Culture) + "°"));}col.Children.Add(Row(grid, gridRow));col.Children.Add(Row(PortsBlock(n), gridRow + 1));@@ -961,15 +961,15 @@ public sealed class ModularView : UserControlprivate void BuildMathView(GNode n, int modId){var col = new Grid { RowDefinitions = new RowDefinitions("3,32,Auto,Auto") };- col.Children.Add(Row(new Border { Background = n.Stripe, CornerRadius = new CornerRadius(5, 5, 0, 0) }, 0));+ col.Children.Add(Row(new Border { Background = n.Stripe, CornerRadius = NotaRadius.Top(NotaRadius.TileValue) }, 0));var headBorder = NodeHeader(n);col.Children.Add(Row(headBorder, 1));var body = new StackPanel { Spacing = 4, Margin = new Thickness(9, 6) };body.Children.Add(MathLabeledRow("OP", MathOpCombo(modId)));body.Children.Add(KnobGrid(- ModFieldCell("GAIN", modId, 4, 0f, 2f, v => v.ToString("0.00", CultureInfo.InvariantCulture)),- ModFieldCell("OFFSET", modId, 12, -1f, 1f, v => v.ToString("0.00", CultureInfo.InvariantCulture))));+ ModFieldCell("GAIN", modId, 4, 0f, 2f, v => v.ToString("0.00", NotaNum.Culture)),+ ModFieldCell("OFFSET", modId, 12, -1f, 1f, v => v.ToString("0.00", NotaNum.Culture))));col.Children.Add(Row(body, 2));col.Children.Add(Row(MathPortsBlock(n), 3)); // A/B CV inputs (drag a cable in) + CV outWrapFrame(n, col, headBorder);@@ -989,7 +989,7 @@ public sealed class ModularView : UserControlprivate void BuildScopeView(GNode n, int modId){var col = new Grid { RowDefinitions = new RowDefinitions("3,32,Auto,Auto") };- col.Children.Add(Row(new Border { Background = n.Stripe, CornerRadius = new CornerRadius(5, 5, 0, 0) }, 0));+ col.Children.Add(Row(new Border { Background = n.Stripe, CornerRadius = NotaRadius.Top(NotaRadius.TileValue) }, 0));var headBorder = NodeHeader(n);col.Children.Add(Row(headBorder, 1));@@ -1083,7 +1083,7 @@ public sealed class ModularView : UserControl{var b = new Border{- Height = 13, CornerRadius = new CornerRadius(3), Padding = new Thickness(5, 0),+ Height = 13, CornerRadius = NotaRadius.Badge, Padding = new Thickness(5, 0),Background = NotaPalette.AccentSubtle, BorderBrush = NotaPalette.Accent, BorderThickness = new Thickness(1),Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,Child = new TextBlock { Text = synced ? "SYNC" : "FREE", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = BrassBright, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center },@@ -1096,7 +1096,7 @@ public sealed class ModularView : UserControl{var b = new Border{- Height = 20, MinWidth = 30, CornerRadius = new CornerRadius(3),+ Height = 20, MinWidth = 30, CornerRadius = NotaRadius.Badge,BorderBrush = active ? NotaPalette.Accent : BorderStrong, BorderThickness = new Thickness(1),Background = active ? NotaPalette.AccentSubtle : Brushes.Transparent,Padding = new Thickness(6, 0), Cursor = new Cursor(StandardCursorType.Hand),@@ -1132,7 +1132,7 @@ public sealed class ModularView : UserControlbool synced = e.ModulatorGet(t, modId, 1) > 0.5f;int field = synced ? 3 : 2;float min = synced ? 0.0625f : 0.01f, max = synced ? 4f : 20f;- Func<double, string> fmt = synced ? DivisionLabel : v => v.ToString("0.00", CultureInfo.InvariantCulture) + " Hz";+ Func<double, string> fmt = synced ? DivisionLabel : v => v.ToString("0.00", NotaNum.Culture) + "\u2009Hz";double span = Math.Max(1e-6, max - min);float v0 = e.ModulatorGet(t, modId, field);var value = MonoValue(fmt(v0));@@ -1307,8 +1307,8 @@ public sealed class ModularView : UserControlvar title = new TextBlock { Text = $"CV LINK · LFO {modId}", FontSize = 9, FontWeight = FontWeight.Bold, Foreground = Text3 };var depth = new Slider { Minimum = -1, Maximum = 1, Value = e.CvLinkDepth(t, linkIndex), Width = 180, SmallChange = 0.05, LargeChange = 0.2 };- var depthVal = MonoValue(((int)Math.Round(e.CvLinkDepth(t, linkIndex) * 100)) + " %");- depth.PropertyChanged += (_, ev) => { if (ev.Property == Slider.ValueProperty) { e.SetCvLinkDepth(t, linkIndex, (float)depth.Value); depthVal.Text = ((int)Math.Round(depth.Value * 100)) + " %"; } };+ var depthVal = MonoValue(((int)Math.Round(e.CvLinkDepth(t, linkIndex) * 100)) + "\u2009%");+ depth.PropertyChanged += (_, ev) => { if (ev.Property == Slider.ValueProperty) { e.SetCvLinkDepth(t, linkIndex, (float)depth.Value); depthVal.Text = ((int)Math.Round(depth.Value * 100)) + "\u2009%"; } };var depthRow = new DockPanel { LastChildFill = true };var dl = new TextBlock { Text = "DEPTH", FontSize = 8, FontWeight = FontWeight.Bold, Foreground = Text3, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 8, 0) };DockPanel.SetDock(dl, Dock.Left); DockPanel.SetDock(depthVal, Dock.Right);@@ -1318,7 +1318,7 @@ public sealed class ModularView : UserControlvar modeNames = new[] { "Add", "Multiply", "Override" };int curMode = e.CvLinkMode(t, linkIndex);var chips = new Border[3];- void SyncModes(int sel) { for (int i = 0; i < 3; i++) { bool on = i == sel; chips[i].Background = on ? NotaPalette.AccentSubtle : Brushes.Transparent; chips[i].BorderBrush = on ? NotaPalette.Accent : BorderStrong; ((TextBlock)chips[i].Child!).Foreground = on ? BrassBright : Text2; } }+ void SyncModes(int sel) { for (int i = 0; i < 3; i++) { bool on = i == sel; chips[i].Background = on ? NotaPalette.Accent : Brushes.Transparent; chips[i].BorderBrush = on ? NotaPalette.Accent : BorderStrong; ((TextBlock)chips[i].Child!).Foreground = on ? BrassBright : Text2; } }for (int i = 0; i < 3; i++){int mode = i;@@ -1344,16 +1344,13 @@ public sealed class ModularView : UserControlprivate static Control KnobCell(string name, Knob knob, TextBlock value, IBrush? labelColor = null){- knob.Width = 30; knob.Height = 30;- return new StackPanel- {- Spacing = 1, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,- Children =- {- new TextBlock { Text = name.ToUpperInvariant(), FontSize = 8, FontWeight = FontWeight.Bold, Foreground = labelColor ?? Text3, HorizontalAlignment = HorizontalAlignment.Center },- knob, value,- },- };+ // Same cell as a device card (DeviceCardKit.KnobCell): secondary knob, caps label+ // over a mono value. A node passes its own label tint for modulation targets.+ knob.Width = Knob.SizeSecondary; knob.Height = Knob.SizeSecondary;+ var cell = (StackPanel)DeviceCardKit.KnobCell(name, knob, value, 50, labelInk: labelColor);+ cell.HorizontalAlignment = HorizontalAlignment.Center;+ cell.VerticalAlignment = VerticalAlignment.Center;+ return cell;}// ---- node visual ----------------------------------------------------@@ -1365,7 +1362,7 @@ public sealed class ModularView : UserControlvar title = new TextBlock { Text = n.Title, FontSize = 11, FontWeight = FontWeight.SemiBold, Foreground = Text1, VerticalAlignment = VerticalAlignment.Center };var head = new DockPanel { LastChildFill = true, Margin = new Thickness(9, 0) };var stripeDot = n.Slot == Slot.Modulator ? (IBrush)Brass : (n.Bypassed ? BorderStrong : Success);- var dot = new Border { Width = 6, Height = 6, CornerRadius = new CornerRadius(3), Background = stripeDot, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 6, 0) };+ var dot = new Border { Width = 6, Height = 6, CornerRadius = NotaRadius.Badge, Background = stripeDot, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 6, 0) };DockPanel.SetDock(dot, Dock.Left);head.Children.Add(dot);// Right cluster: chain devices get bypass / expand / delete; modulators get a@@ -1373,12 +1370,12 @@ public sealed class ModularView : UserControlif (n.IsChainDevice){var actions = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, VerticalAlignment = VerticalAlignment.Center };- actions.Children.Add(HeaderGlyph("⊘", n.Bypassed ? BrassBright : Text3, "Bypass (B)", () => ToggleBypass(n)));+ actions.Children.Add(HeaderGlyph(GlyphKind.Bypass, n.Bypassed ? BrassBright : Text3, "Bypass (B)", () => ToggleBypass(n)));// Only offer expand when there are more params than the headline row shows,// otherwise the button reveals nothing (e.g. a plugin exposing few params).if (CanExpand(n))- actions.Children.Add(HeaderGlyph("↕", _expanded.Contains(n.Id) ? BrassBright : Text3, "Expand", () => ToggleExpand(n)));- actions.Children.Add(HeaderGlyph("✕", Text3, "Delete", () => DeleteNode(n)));+ actions.Children.Add(HeaderGlyph(_expanded.Contains(n.Id) ? GlyphKind.ChevronUp : GlyphKind.ChevronDown, _expanded.Contains(n.Id) ? BrassBright : Text3, "Expand", () => ToggleExpand(n)));+ actions.Children.Add(HeaderGlyph(GlyphKind.Close, Text3, "Delete", () => DeleteNode(n)));DockPanel.SetDock(actions, Dock.Right);head.Children.Add(actions);}@@ -1386,7 +1383,7 @@ public sealed class ModularView : UserControl{// The instrument can't be bypassed/removed, but its params are expandable too.var actions = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, VerticalAlignment = VerticalAlignment.Center };- actions.Children.Add(HeaderGlyph("↕", _expanded.Contains(n.Id) ? BrassBright : Text3, "Expand", () => ToggleExpand(n)));+ actions.Children.Add(HeaderGlyph(_expanded.Contains(n.Id) ? GlyphKind.ChevronUp : GlyphKind.ChevronDown, _expanded.Contains(n.Id) ? BrassBright : Text3, "Expand", () => ToggleExpand(n)));DockPanel.SetDock(actions, Dock.Right);head.Children.Add(actions);}@@ -1394,7 +1391,7 @@ public sealed class ModularView : UserControl{var actions = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center };actions.Children.Add(new TextBlock { Text = string.IsNullOrEmpty(n.Badge) ? "LFO" : n.Badge, FontSize = 9, FontWeight = FontWeight.Bold, Foreground = Text3, VerticalAlignment = VerticalAlignment.Center });- actions.Children.Add(HeaderGlyph("✕", Text3, "Delete", () => RemoveModulatorNode(n)));+ actions.Children.Add(HeaderGlyph(GlyphKind.Close, Text3, "Delete", () => RemoveModulatorNode(n)));DockPanel.SetDock(actions, Dock.Right);head.Children.Add(actions);}@@ -1417,9 +1414,8 @@ public sealed class ModularView : UserControl{Width = NodeW, Background = Card,BorderBrush = n.Bypassed ? BorderStrong : BorderDef,- BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(6),- Opacity = n.Bypassed ? 0.6 : 1.0, Child = col,- BoxShadow = new BoxShadows(new BoxShadow { OffsetX = 0, OffsetY = 8, Blur = 22, Color = Color.FromArgb(128, 0, 0, 0) }),+ BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel,+ Child = col,};n.View = frame;frame.PointerEntered += (_, _) => { if (!n.Selected && !n.Bypassed) frame.BorderBrush = BorderHover; };@@ -1435,7 +1431,7 @@ public sealed class ModularView : UserControlvar col = new Grid { RowDefinitions = new RowDefinitions("3,32,Auto,Auto") };// type stripe- col.Children.Add(Row(new Border { Background = n.Stripe, CornerRadius = new CornerRadius(5, 5, 0, 0) }, 0));+ col.Children.Add(Row(new Border { Background = n.Stripe, CornerRadius = NotaRadius.Top(NotaRadius.TileValue) }, 0));var headBorder = NodeHeader(n);col.Children.Add(Row(headBorder, 1));@@ -1563,7 +1559,7 @@ public sealed class ModularView : UserControlprivate Point _nodeOrigin;private readonly Border _dropBar = new(){- Width = 3, Background = NotaPalette.AccentBright, CornerRadius = new CornerRadius(2), IsHitTestVisible = false,+ Width = 3, Background = NotaPalette.AccentBright, CornerRadius = NotaRadius.Clip, IsHitTestVisible = false,};private void BeginNodeDrag(GNode n, Control captureTarget, PointerPressedEventArgs e)@@ -1794,9 +1790,8 @@ public sealed class ModularView : UserControlprivate readonly Border _edgeTip = new(){Background = NotaPalette.SurfaceCard, BorderBrush = NotaPalette.BorderStrong, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(5), Padding = new Thickness(8, 5), IsVisible = false, IsHitTestVisible = false,+ CornerRadius = NotaRadius.Tile, Padding = new Thickness(8, 5), IsVisible = false, IsHitTestVisible = false,HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top,- BoxShadow = new BoxShadows(new BoxShadow { OffsetY = 8, Blur = 20, Color = Color.FromArgb(153, 0, 0, 0) }),};private readonly TextBlock _edgeTipText = new() { FontSize = 9, Foreground = NotaPalette.TextPrimary };@@ -1832,12 +1827,12 @@ public sealed class ModularView : UserControl/// so the host can refresh the arrangement + detail panel.</summary>public event Action? Changed;- private static Control HeaderGlyph(string glyph, IBrush color, string tip, Action act)+ private static Control HeaderGlyph(GlyphKind glyph, IBrush color, string tip, Action act){- var tb = new TextBlock { Text = glyph, FontSize = 11, Foreground = color, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };+ var tb = new Glyph(glyph, 9) { Foreground = color };var b = new Border{- Width = 16, Height = 16, CornerRadius = new CornerRadius(3), Background = Brushes.Transparent,+ Width = 16, Height = 16, CornerRadius = NotaRadius.Badge, Background = Brushes.Transparent,Cursor = new Cursor(StandardCursorType.Hand), Child = tb, VerticalAlignment = VerticalAlignment.Center,};ToolTip.SetTip(b, tip);@@ -1977,7 +1972,7 @@ public sealed class ModularView : UserControlChildren = { new ScaleTransform(_scale, _scale), new TranslateTransform(_pan.X, _pan.Y) },};_world.RenderTransformOrigin = new RelativePoint(0, 0, RelativeUnit.Relative);- _zoomLabel.Text = $"{_scale * 100:0} %";+ _zoomLabel.Text = $"{_scale * 100:0}\u2009%";_grid.InvalidateVisual();_edges.InvalidateVisual();_mini.InvalidateVisual();@@ -2056,7 +2051,7 @@ public sealed class ModularView : UserControl_globalBtn.Click += (_, _) => SetGlobal(true);var seg = new Border{- Background = Sunken, CornerRadius = new CornerRadius(5), Padding = new Thickness(2),+ Background = Sunken, CornerRadius = NotaRadius.Tile, Padding = new Thickness(2),Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2, Children = { _trackBtn, _globalBtn } },};// All the modulator sources collapse into one "+ Add" dropdown (a normal chip@@ -2075,7 +2070,7 @@ public sealed class ModularView : UserControlAddItem("Macro", 4);AddItem("Math", 5);AddItem("Scope", 6);- var addBtn = Chip("+ Add ▾");+ var addBtn = Chip("+ Add"); addBtn.Content = Glyph.Labeled("+ Add", GlyphKind.ChevronDown);addBtn.Flyout = addMenu;left.Children.Add(seg);left.Children.Add(addBtn);@@ -2085,7 +2080,7 @@ public sealed class ModularView : UserControlvar zoomIn = ZoomBtn("+"); zoomIn.Click += (_, _) => ZoomAround(Center(), 1.15);var zoomSeg = new Border{- Background = Sunken, CornerRadius = new CornerRadius(5), Padding = new Thickness(2),+ Background = Sunken, CornerRadius = NotaRadius.Tile, Padding = new Thickness(2),Child = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2, Children = { zoomOut, zoomIn } },};var fit = Chip("Fit"); fit.Click += (_, _) => FitNow();@@ -2474,7 +2469,8 @@ public sealed class ModularView : UserControl{var p = M(n.World.X, n.World.Y);double bw = n.NodeWidth * s, bh = (n.View.Bounds.Height > 0 ? n.View.Bounds.Height : 120) * s;- var b = new SolidColorBrush(((SolidColorBrush)n.Stripe).Color, 0.7);+ var sc = ((ISolidColorBrush)n.Stripe).Color;+ var b = new SolidColorBrush(Color.FromArgb(0xB3, sc.R, sc.G, sc.B));ctx.DrawRectangle(b, null, new Rect(p.X, p.Y, bw, bh), 2, 2);}diff --git a/src/managed/Nota.App/Nota.App.csproj b/src/managed/Nota.App/Nota.App.csprojindex 61ffb1c6..e1552e2f 100644--- a/src/managed/Nota.App/Nota.App.csproj+++ b/src/managed/Nota.App/Nota.App.csproj@@ -16,7 +16,6 @@<PackageReference Include="Avalonia" Version="12.0.3" /><PackageReference Include="Avalonia.Desktop" Version="12.0.3" /><PackageReference Include="Avalonia.Themes.Fluent" Version="12.0.3" />- <PackageReference Include="Avalonia.Fonts.Inter" Version="12.0.3" /><PackageReference Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.1"><IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets><PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>@@ -35,6 +34,9 @@<!-- Ship the changelog inside the app so the "What's New" window can parse theentries for the current version at runtime (avares://Nota.App/Assets/CHANGELOG.md). --><AvaloniaResource Include="..\..\..\CHANGELOG.md" Link="Assets/CHANGELOG.md" />+ <!-- Geist + Geist Mono (SIL OFL 1.1, LICENSES/OFL-1.1-Geist.txt): the UI and numeric+ typefaces, served as avares://Nota.App/Assets/Fonts#Geist and #Geist Mono. -->+ <AvaloniaResource Include="..\..\..\assets\fonts\*.ttf" Link="Assets/Fonts/%(Filename)%(Extension)" /></ItemGroup><ItemGroup>diff --git a/src/managed/Nota.App/PianoRollView.cs b/src/managed/Nota.App/PianoRollView.csindex 1c342cd9..9abd4533 100644--- a/src/managed/Nota.App/PianoRollView.cs+++ b/src/managed/Nota.App/PianoRollView.cs@@ -60,7 +60,8 @@ public sealed class PianoRollView : UserControlprivate double _lengthBeats = 4;private double _grid = 0.25;private readonly HashSet<int> _selection = new(); // indices into _notes- private Color _trackColor = NotaPalette.TrackColors[3];+ private ISolidColorBrush _trackBrush = NotaPalette.TrackBrushes[3]; // read .Color at draw time: it follows the theme+ private Color _trackColor => _trackBrush.Color;// --- musical scale overlay ("Set Scale") ----------------// Session-global (static seed) so the chosen key/scale persists as you move@@ -165,7 +166,7 @@ public sealed class PianoRollView : UserControl_hScroll.IsVisible = _hScroll.Maximum > 1e-6;}- private static readonly IBrush Bg = NotaPalette.BgApp;+ private static readonly IBrush Bg = NotaPalette.BgSunken;private static readonly IBrush KeysBg = NotaPalette.BgSunken;private static readonly IBrush VelBg = NotaPalette.GridRow;private static readonly IBrush KeyWhite = NotaPalette.KeyWhite;@@ -176,12 +177,12 @@ public sealed class PianoRollView : UserControlprivate static readonly IBrush OutScaleWash = NotaPalette.Wash(NotaPalette.BgSunken, 0xB4);private static readonly IBrush InScaleTint = NotaPalette.Wash(NotaPalette.AccentBright, 0x1E);private static readonly IBrush RootTint = NotaPalette.Wash(NotaPalette.AccentBright, 0x40);- private static readonly IPen PlayheadPen = new Pen(NotaPalette.AccentBright, 1.5);+ private static readonly IPen PlayheadPen = new Pen(NotaPalette.Accent, 1); // almanac playhead: 1px brassprivate static readonly IBrush KeyHover = NotaPalette.Wash(NotaPalette.AccentBright, 0x66);// Played-key highlight (currently-pressed keyboard / MIDI note): a solid key tint + a faint row wash.private static readonly IBrush HeldKeyFill = NotaPalette.AccentBright;private static readonly IBrush HeldRowTint = NotaPalette.Wash(NotaPalette.AccentBright, 0x30);- private static readonly IPen KeyLine = new Pen(NotaPalette.BgApp, 1);+ private static readonly IPen KeyLine = new Pen(NotaPalette.GraphBorder, 1);private static readonly IPen RowLine = new Pen(NotaPalette.GridRow, 1);private static readonly IPen BeatPen = new Pen(NotaPalette.GridBeat, 1);private static readonly IPen BarPen = new Pen(NotaPalette.GridBar, 1);@@ -193,7 +194,7 @@ public sealed class PianoRollView : UserControlprivate static readonly IBrush LabelText = NotaPalette.TextTertiary;private static readonly IBrush KeyLabel = NotaPalette.BgSunken;private static readonly IBrush Divider = NotaPalette.BorderDefault;- private static readonly Typeface Mono = new("monospace");+ private static readonly Typeface Mono = NotaFonts.Mono;private static double RangeH => (MaxPitch - MinPitch + 1) * RowH;@@ -301,7 +302,7 @@ public sealed class PianoRollView : UserControlpublic double LengthBeats => _lengthBeats;public double Grid { get => _grid; set { _grid = Math.Max(1.0 / 32, value); Invalidate(); } }- public void SetTrackColor(Color c) { _trackColor = c; Invalidate(); }+ public void SetTrackColor(ISolidColorBrush b) { _trackBrush = b; Invalidate(); }public void SetNotes(IEnumerable<NotaNote> notes, double lengthBeats){diff --git a/src/managed/Nota.App/PreferencesWindow.cs b/src/managed/Nota.App/PreferencesWindow.csindex 7ced2cda..6e4af9cd 100644--- a/src/managed/Nota.App/PreferencesWindow.cs+++ b/src/managed/Nota.App/PreferencesWindow.cs@@ -78,7 +78,7 @@ public sealed class PreferencesWindow : NotaWindowfor (int i = 0; i < Sections.Length; i++){int idx = i;- var item = new Border { CornerRadius = new CornerRadius(5), Padding = new Thickness(10, 6), Cursor = new Cursor(StandardCursorType.Hand) };+ var item = new Border { CornerRadius = NotaRadius.Tile, Padding = new Thickness(10, 6), Cursor = new Cursor(StandardCursorType.Hand) };item.Child = new TextBlock { Text = Sections[i], FontSize = 11, VerticalAlignment = VerticalAlignment.Center };item.PointerPressed += (_, _) => Select(idx);_navItems.Add(item);@@ -146,7 +146,7 @@ public sealed class PreferencesWindow : NotaWindowinputCombo.SelectionChanged += (_, _) => { int i = inputCombo.SelectedIndex; if (i >= 0 && i < _inputUids.Count) { engine.SetAudioInputDevice(_inputUids[i]); Apply(); } };var srCombo = new ComboBox { HorizontalAlignment = HorizontalAlignment.Stretch };- foreach (var sr in SampleRates) srCombo.Items.Add(sr == 0 ? "Device default" : $"{sr:0} Hz");+ foreach (var sr in SampleRates) srCombo.Items.Add(sr == 0 ? "Device default" : $"{sr:0}\u2009Hz");srCombo.SelectedIndex = IndexOf(SampleRates, cfg.SampleRate);srCombo.SelectionChanged += (_, _) => { int i = srCombo.SelectedIndex; if (i >= 0) { engine.SetAudioSampleRate(SampleRates[i]); Apply(); } };@@ -219,7 +219,7 @@ public sealed class PreferencesWindow : NotaWindowstring mode = OperatingSystem.IsWindows() && _main.Engine.AudioExclusiveFallback? " · exclusive refused → shared": OperatingSystem.IsWindows() && _main.Engine.GetAudioConfig().WasapiExclusive ? " · exclusive" : "";- return buf > 0 ? $"{sr:0} Hz · {buf} frames{mode}" : $"{sr:0} Hz{mode}";+ return buf > 0 ? $"{sr:0}\u2009Hz · {buf} frames{mode}" : $"{sr:0} Hz{mode}";}// ---- MIDI -------------------------------------------------------------@@ -328,7 +328,7 @@ public sealed class PreferencesWindow : NotaWindowrow.Children.Add(last);padList.Children.Add(new Border{- Background = Sunken, CornerRadius = new CornerRadius(6),+ Background = Sunken, CornerRadius = NotaRadius.Panel,Padding = new Thickness(10, 6), Child = row,});}@@ -621,7 +621,9 @@ public sealed class PreferencesWindow : NotaWindow("Drag overview strip", "Drag sideways to scroll · up / down to zoom out / in"),("Drag overview edge", "Zoom by resizing the viewport window"),("Double-click overview", "Fit the whole project on screen"),- ("Drag ⠿", "Reorder devices (◀ ▶)"),+ ("Drag a device header", "Reorder devices (or right-click the header → Move left / right)"),+ ("Right-click a device header", "Presets, A / B compare, move, copy, delete, save preset"),+ ("Delete (device selected)", "Remove the selected device — the header no longer carries a close button"),("Drag clip + ⌥", "Position freely, ignoring the grid for this drag (the magnet in the transport latches the same thing)"),("Drag knob", "Change a device value · hold ⌘ or ⇧ for fine steps"),("Double-click knob", "Reset the value to its default"),@@ -647,7 +649,7 @@ public sealed class PreferencesWindow : NotaWindowvar cap = new Border{Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(4), Padding = new Thickness(7, 2),+ CornerRadius = NotaRadius.Control, Padding = new Thickness(7, 2),VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Left,};var kt = new TextBlock { Text = key, FontSize = 10, Foreground = TextPrimary };@@ -665,9 +667,10 @@ public sealed class PreferencesWindow : NotaWindowprivate Border DisabledChip(string text) => new(){- Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(5),- Padding = new Thickness(12, 4), Opacity = 0.6, VerticalAlignment = VerticalAlignment.Center,- Child = new TextBlock { Text = text, FontSize = 11, Foreground = TextPrimary },+ // Disabled (almanac § States): panel ground, hairline edge, Ink 6 — no opacity.+ Background = NotaPalette.Panel, BorderBrush = NotaPalette.GraphBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Tile,+ Padding = new Thickness(12, 4), VerticalAlignment = VerticalAlignment.Center,+ Child = new TextBlock { Text = text, FontSize = 11, Foreground = NotaPalette.TextDisabled },};private static TextBlock SectionLabel(string text) => new()diff --git a/src/managed/Nota.App/Program.cs b/src/managed/Nota.App/Program.csindex b4a14de0..50030ba7 100644--- a/src/managed/Nota.App/Program.cs+++ b/src/managed/Nota.App/Program.cs@@ -1,27 +1,27 @@-// SPDX-License-Identifier: AGPL-3.0-only-// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.--using Avalonia;-using System;--namespace Nota.App;--class Program-{- // Initialization code. Don't use any Avalonia, third-party APIs or any- // SynchronizationContext-reliant code before AppMain is called: things aren't initialized- // yet and stuff might break.- [STAThread]- public static void Main(string[] args) => BuildAvaloniaApp()- .StartWithClassicDesktopLifetime(args);-- // Avalonia configuration, don't remove; also used by visual designer.- public static AppBuilder BuildAvaloniaApp()- => AppBuilder.Configure<App>()- .UsePlatformDetect()-#if DEBUG- .WithDeveloperTools()-#endif- .WithInterFont()- .LogToTrace();-}+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.++using Avalonia;+using System;++namespace Nota.App;++class Program+{+ // Initialization code. Don't use any Avalonia, third-party APIs or any+ // SynchronizationContext-reliant code before AppMain is called: things aren't initialized+ // yet and stuff might break.+ [STAThread]+ public static void Main(string[] args) => BuildAvaloniaApp()+ .StartWithClassicDesktopLifetime(args);++ // Avalonia configuration, don't remove; also used by visual designer.+ public static AppBuilder BuildAvaloniaApp()+ => AppBuilder.Configure<App>()+ .UsePlatformDetect()+#if DEBUG+ .WithDeveloperTools()+#endif+ .WithNotaFonts()+ .LogToTrace();+}diff --git a/src/managed/Nota.App/ProgressWindow.cs b/src/managed/Nota.App/ProgressWindow.csindex c86b3003..00f0bfb0 100644--- a/src/managed/Nota.App/ProgressWindow.cs+++ b/src/managed/Nota.App/ProgressWindow.cs@@ -91,5 +91,5 @@ public sealed class ProgressWindow : NotaWindowfinally { win.Close(); await dialog; }}- private static IBrush Brush(string key) => (IBrush?)NotaPalette.ByKey(key) ?? Brushes.Gray;+ private static IBrush Brush(string key) => (IBrush?)NotaPalette.ByKey(key) ?? NotaPalette.TextTertiary;}diff --git a/src/managed/Nota.App/SessionAudioSlotEditor.cs b/src/managed/Nota.App/SessionAudioSlotEditor.csindex 054306dd..8bb6e32c 100644--- a/src/managed/Nota.App/SessionAudioSlotEditor.cs+++ b/src/managed/Nota.App/SessionAudioSlotEditor.cs@@ -41,14 +41,14 @@ public sealed class SessionAudioSlotEditor : UserControlvar waveBox = new Border{Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(5), Child = wave, ClipToBounds = true,+ CornerRadius = NotaRadius.Tile, Child = wave, ClipToBounds = true,};// Gain: fader maps 0..1 -> 0..2 linear (unity at 0.5), with a dB readout.float gain = _engine.SessionSlotGain(trackId, scene);var gainFader = new MiniFader(Math.Clamp(gain / 2.0, 0, 1), 1.0) { Default = 0.5, Width = 180 };var gainDb = new TextBlock { FontSize = 10, Classes = { "Mono" }, Foreground = Text3, Width = 48, TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Center };- void ShowGain(double f) { double g = f * 2.0; gainDb.Text = g <= 1e-4 ? "-inf" : $"{AudioMath.LinToDb(g):+0.0;-0.0} dB"; }+ void ShowGain(double f) { double g = f * 2.0; gainDb.Text = g <= 1e-4 ? "−∞" : $"{AudioMath.LinToDb(g):+0.0;−0.0}\u2009dB"; }gainFader.ValueChanged += f => { _engine.SetSessionSlotGain(trackId, scene, (float)(f * 2.0)); ShowGain(f); };ShowGain(gainFader.Value);var gainRow = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, VerticalAlignment = VerticalAlignment.Center, Children = { Label("GAIN"), gainFader, gainDb } };@@ -90,8 +90,8 @@ public sealed class SessionAudioSlotEditor : UserControl{var b = new Border{- Height = 22, MinWidth = 34, CornerRadius = new CornerRadius(4), BorderThickness = new Thickness(1),- Padding = new Thickness(8, 0), Tag = double.Parse(t, System.Globalization.CultureInfo.InvariantCulture),+ Height = 22, MinWidth = 34, CornerRadius = NotaRadius.Control, BorderThickness = new Thickness(1),+ Padding = new Thickness(8, 0), Tag = double.Parse(t, NotaNum.Culture),Cursor = new Avalonia.Input.Cursor(Avalonia.Input.StandardCursorType.Hand),Child = new TextBlock { Text = t + "b", FontSize = 10, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center },};diff --git a/src/managed/Nota.App/SessionView.cs b/src/managed/Nota.App/SessionView.csindex 8b9b96fe..c10be41d 100644--- a/src/managed/Nota.App/SessionView.cs+++ b/src/managed/Nota.App/SessionView.cs@@ -29,7 +29,7 @@ public sealed class SessionView : UserControlprivate const double HeaderH = 38;private const double StopNubH = 24;private const double Gap = 2;- private const double Radius = 5;+ private const double Radius = NotaRadius.TileValue;// Ember Graphite palette (static so cells can repaint without resource lookups).private static readonly IBrush Lane = NotaPalette.SurfaceInset;@@ -42,6 +42,7 @@ public sealed class SessionView : UserControlprivate static readonly IBrush Warning = NotaPalette.Warning;private static readonly IBrush Warning40 = NotaPalette.Wash(NotaPalette.Warning, 0x66); // queued blink dim (HANDOFF §4)private static readonly IBrush Danger = NotaPalette.Danger;+ private static readonly IBrush Record = NotaPalette.Record; // red belongs to recordingprivate static readonly IBrush Brass = NotaPalette.Accent;private static readonly IBrush AccentBright = NotaPalette.AccentBright;private static readonly IBrush TextPrimary = NotaPalette.TextPrimary;@@ -50,11 +51,11 @@ public sealed class SessionView : UserControlprivate static readonly IBrush TextDisabled = NotaPalette.TextDisabled;private static readonly IBrush OnAccent = NotaPalette.TextOnAccent;private static readonly IBrush GreenFill = NotaPalette.Wash(NotaPalette.Success, 0x21);- private static readonly IBrush RedFill = NotaPalette.Wash(NotaPalette.Danger, 0x28);+ private static readonly IBrush RedFill = NotaPalette.Wash(NotaPalette.Record, 0x28);private static readonly IBrush AmberFill = NotaPalette.Wash(NotaPalette.Warning, 0x1F);// Track palette — mirrors ArrangementView.TrackBase (Brush.Track1..8 + Return A/B).- private static readonly Color[] TrackBase = NotaPalette.TrackColors;+ private static Color[] TrackBase => NotaPalette.TrackColors;private readonly IAudioEngine _engine;// Three horizontally-aligned strips (same column widths + spacing) so a column's@@ -125,7 +126,7 @@ public sealed class SessionView : UserControlCursor = new Cursor(StandardCursorType.Hand),Child = new TextBlock { Text = "+ Scene", FontSize = 11, Foreground = TextSecondary },};- ToolTip.SetTip(addScene, "Add a scene row");+ ToolTip.SetTip(addScene, "Add a scene");addScene.PointerPressed += (_, _) => { _engine.AddScene(); Refresh(); };AddHoverPress(addScene);@@ -143,9 +144,9 @@ public sealed class SessionView : UserControlvar backToArr = new Border{Background = Raised, BorderBrush = BorderStrong, BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(Radius), Padding = new Thickness(9, 3), Opacity = 0.5,+ CornerRadius = new CornerRadius(Radius), Padding = new Thickness(9, 3),IsHitTestVisible = false,- Child = new TextBlock { Text = "Back to Arrangement", FontSize = 11, Foreground = TextSecondary },+ Child = new TextBlock { Text = "Back to Arrangement", FontSize = 11, Foreground = NotaPalette.TextDisabled },};ToolTip.SetTip(backToArr, "Stop session clips and return all tracks to the Arrangement");backToArr.PointerPressed += (_, _) => { _engine.BackToArrangement(); UpdateStates(); };@@ -213,10 +214,9 @@ public sealed class SessionView : UserControl// "Back to Arrangement" lights up (and becomes clickable) only while session overrides.if (_backToArr is not null){- _backToArr.Opacity = sessionOverride ? 1.0 : 0.5;_backToArr.IsHitTestVisible = sessionOverride;_backToArr.BorderBrush = sessionOverride ? Brass : BorderStrong;- ((TextBlock)_backToArr.Child!).Foreground = sessionOverride ? AccentBright : TextSecondary;+ ((TextBlock)_backToArr.Child!).Foreground = sessionOverride ? AccentBright : NotaPalette.TextDisabled;}}@@ -245,7 +245,7 @@ public sealed class SessionView : UserControlprivate Control SceneRow(int scene){- var launch = IconButton("▶", AccentBright, 22, 22);+ var launch = IconButton(GlyphKind.Play, AccentBright, 22, 22, 9);launch.PointerPressed += (_, _) => { _engine.LaunchScene(scene); UpdateStates(); };ToolTip.SetTip(launch, $"Launch scene {scene + 1}");@@ -259,7 +259,7 @@ public sealed class SessionView : UserControl},};- var stop = IconButton("■", TextTertiary, 14, 14, 6);+ var stop = IconButton(GlyphKind.Stop, TextTertiary, 14, 14, 6);stop.PointerPressed += (_, _) => { _engine.StopScene(scene); UpdateStates(); };ToolTip.SetTip(stop, $"Stop scene {scene + 1}");@@ -311,7 +311,7 @@ public sealed class SessionView : UserControl{Height = StopNubH, Background = Lane, BorderBrush = Raised,BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(Radius),- Child = new TextBlock { Text = "■", FontSize = 8, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center },+ Child = new Glyph(GlyphKind.Stop, 7) { Foreground = TextTertiary },};ToolTip.SetTip(stop, "Stop this track");stop.PointerPressed += (_, _) => { _engine.StopSlot(ti.Id); UpdateStates(); };@@ -349,7 +349,7 @@ public sealed class SessionView : UserControlpan.ValueChanged += v => _engine.SetTrackPan(id, (float)(v * 2 - 1));var db = new MonoText("", 8, TextTertiary);- void RefreshDb() { double d = AudioMath.LinToDb(Math.Max(1e-4, vol.Value)); db.Text = vol.Value <= 1e-4 ? "-inf" : $"{d:+0.0;-0.0}"; }+ void RefreshDb() { double d = AudioMath.LinToDb(Math.Max(1e-4, vol.Value)); db.Text = vol.Value <= 1e-4 ? "−∞" : $"{d:+0.0;−0.0}"; }vol.ValueChanged += _ => RefreshDb();RefreshDb();@@ -360,7 +360,7 @@ public sealed class SessionView : UserControlvar mute = MixToggle("M", false, ti.Muted != 0, v => _engine.SetTrackMute(id, v));var solo = MixToggle("S", false, ti.Soloed != 0, v => _engine.SetTrackSolo(id, v));if (ti.Armed != 0) _armed.Add(id);- var arm = MixToggle("●", true, ti.Armed != 0, v =>+ var arm = ArmToggle(ti.Armed != 0, v =>{_engine.SetTrackArmed(id, v);if (v) _armed.Add(id); else _armed.Remove(id);@@ -371,7 +371,7 @@ public sealed class SessionView : UserControlbtnRow.Children.Add(mute);Grid.SetColumn(solo, 1); btnRow.Children.Add(solo);Grid.SetColumn(arm, 2); btnRow.Children.Add(arm);- var meterWrap = new Border { Height = 4, Background = Sunken, CornerRadius = new CornerRadius(2), ClipToBounds = true, VerticalAlignment = VerticalAlignment.Center, Child = meter };+ var meterWrap = new Border { Height = 4, Background = Sunken, CornerRadius = NotaRadius.Clip, ClipToBounds = true, VerticalAlignment = VerticalAlignment.Center, Child = meter };Grid.SetColumn(meterWrap, 3); meterWrap.Margin = new Thickness(2, 0, 0, 0);btnRow.Children.Add(meterWrap);@@ -386,7 +386,7 @@ public sealed class SessionView : UserControlsend.ValueChanged += v => _engine.SetTrackSend(id, bus, (float)v);body.Children.Add(FaderRow(((char)('A' + bus)).ToString(), send, null));}- body.Children.Add(FaderRow("VOL", vol, db));+ body.Children.Add(FaderRow("VOLUME", vol, db));body.Children.Add(btnRow);return new Border{@@ -399,7 +399,7 @@ public sealed class SessionView : UserControl{fader.VerticalAlignment = VerticalAlignment.Center;var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto") };- grid.Children.Add(new TextBlock { Text = label, FontSize = 8, Foreground = TextTertiary, Width = 20, VerticalAlignment = VerticalAlignment.Center });+ grid.Children.Add(new TextBlock { Text = label, FontSize = 8, Foreground = TextTertiary, Width = 32, VerticalAlignment = VerticalAlignment.Center });Grid.SetColumn(fader, 1);grid.Children.Add(fader);if (trailing is not null)@@ -412,11 +412,28 @@ public sealed class SessionView : UserControlreturn grid;}+ // Record-arm: neutral with a red disc at rest, solid record red with a pale disc when armed.+ private Border ArmToggle(bool initial, Action<bool> set)+ {+ bool on = initial;+ var disc = new Glyph(GlyphKind.Record, 6);+ var b = new Border { Width = 17, Height = 15, CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), Child = disc };+ void Paint()+ {+ b.Background = on ? Record : Raised;+ b.BorderBrush = on ? Record : BorderStrong;+ disc.Foreground = on ? NotaPalette.RecordInk : Record;+ }+ b.PointerPressed += (_, e) => { if (!e.GetCurrentPoint(b).Properties.IsLeftButtonPressed) return; e.Handled = true; on = !on; set(on); Paint(); };+ Paint();+ return b;+ }+private Border MixToggle(string label, bool danger, bool initial, Action<bool> set){bool on = initial;var t = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };- var b = new Border { Width = 17, Height = 15, CornerRadius = new CornerRadius(3), BorderThickness = new Thickness(1), Child = t };+ var b = new Border { Width = 17, Height = 15, CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1), Child = t };void Paint(){var accent = danger ? Danger : Brass;@@ -446,7 +463,7 @@ public sealed class SessionView : UserControlOrientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center,Children ={- new TextBlock { Text = "▶", FontSize = 10, Foreground = AccentBright, VerticalAlignment = VerticalAlignment.Center },+ new Glyph(GlyphKind.Play, 9) { Foreground = AccentBright },new TextBlock { Text = $"Scene {scene + 1}", FontSize = 10, Foreground = TextSecondary, VerticalAlignment = VerticalAlignment.Center },},};@@ -470,7 +487,7 @@ public sealed class SessionView : UserControlOrientation = Orientation.Horizontal, Spacing = 5, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,Children ={- new TextBlock { Text = "■", FontSize = 8, Foreground = TextSecondary, VerticalAlignment = VerticalAlignment.Center },+ new Glyph(GlyphKind.Stop, 7) { Foreground = TextSecondary },new TextBlock { Text = "Stop All", FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = TextSecondary, VerticalAlignment = VerticalAlignment.Center },},},@@ -483,28 +500,30 @@ public sealed class SessionView : UserControl// ---- helpers ----------------------------------------------------------- private static Border IconButton(string glyph, IBrush fg, double w, double h, double fs = 11)+ private static Border IconButton(GlyphKind glyph, IBrush fg, double w, double h, double glyphSize = 9){var b = new Border{Width = w, Height = h, Background = Raised, BorderBrush = BorderStrong,BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(Radius),- Child = new TextBlock { Text = glyph, FontSize = fs, Foreground = fg, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center },+ Child = new Glyph(glyph, glyphSize) { Foreground = fg },};AddHoverPress(b);return b;}// Manual hover/press feedback for the hand-built Border "buttons" (these aren't themed- // Buttons, so they'd otherwise be visually inert): brass outline on hover, a dim on press.+ // Buttons, so they'd otherwise be visually inert): brass outline on hover, recess on press.private static void AddHoverPress(Border b){var restBorder = b.BorderBrush;b.Cursor = new Cursor(StandardCursorType.Hand);b.PointerEntered += (_, _) => { b.BorderBrush = Brass; };- b.PointerExited += (_, _) => { b.BorderBrush = restBorder; b.Opacity = 1.0; };- b.PointerPressed += (_, _) => { b.Opacity = 0.6; };- b.PointerReleased += (_, _) => { b.Opacity = 1.0; };+ var restBg = b.Background;+ b.PointerExited += (_, _) => { b.BorderBrush = restBorder; b.Background = restBg; };+ // Pressed goes into the recess (almanac § States) — the ground changes, nothing fades.+ b.PointerPressed += (_, _) => { b.Background = NotaPalette.BgSunken; };+ b.PointerReleased += (_, _) => { b.Background = restBg; };}private sealed class MonoText : TextBlock@@ -549,7 +568,7 @@ public sealed class SessionView : UserControlprivate readonly bool _instrument;private readonly IBrush _trackColor;private readonly IBrush _trackBorder; // track colour @ ~45%- private readonly TextBlock _icon;+ private readonly Glyph _icon;private readonly TextBlock _label;private readonly MonoText _badge;private readonly Rectangle _progress;@@ -568,7 +587,7 @@ public sealed class SessionView : UserControl? NotaPalette.Wash(slot, 0x73): new SolidColorBrush(Color.FromArgb(0x73, trackColor.Color.R, trackColor.Color.G, trackColor.Color.B));- _icon = new TextBlock { FontSize = 10, VerticalAlignment = VerticalAlignment.Center };+ _icon = new Glyph(GlyphKind.Play, 9);_label = new TextBlock { FontSize = 10, FontWeight = FontWeight.Medium, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis };_badge = new MonoText("", 8, TextTertiary) { VerticalAlignment = VerticalAlignment.Center };@@ -708,24 +727,24 @@ public sealed class SessionView : UserControlswitch (state){case 4: // recording- Border.Background = RedFill; Border.BorderBrush = Danger;- _icon.Text = "●"; _icon.Foreground = Danger;- _label.Text = "rec"; _label.Foreground = Danger;+ Border.Background = RedFill; Border.BorderBrush = Record;+ _icon.Kind = GlyphKind.Record; _icon.IsVisible = true; _icon.Foreground = Record;+ _label.Text = "rec"; _label.Foreground = Record;break;case 3: // playingBorder.Background = GreenFill; Border.BorderBrush = Success;- _icon.Text = "▶"; _icon.Foreground = Success;+ _icon.Kind = GlyphKind.Play; _icon.IsVisible = true; _icon.Foreground = Success;_label.Text = "Clip"; _label.Foreground = TextPrimary;break;case 2: // queued — border blinks 100%↔40% at ~2Hz (HANDOFF §4)Border.Background = AmberFill;Border.BorderBrush = blinkOn ? Warning : Warning40;- _icon.Text = "▶"; _icon.Foreground = Warning;+ _icon.Kind = GlyphKind.Play; _icon.IsVisible = true; _icon.Foreground = Warning;_label.Text = "Clip"; _label.Foreground = Warning;break;case 1: // filledBorder.Background = Raised; Border.BorderBrush = _trackBorder;- _icon.Text = "▶"; _icon.Foreground = _trackColor;+ _icon.Kind = GlyphKind.Play; _icon.IsVisible = true; _icon.Foreground = _trackColor;_label.Text = "Clip"; _label.Foreground = TextPrimary;break;default: // empty@@ -733,19 +752,19 @@ public sealed class SessionView : UserControlif (_instrument){// Instrument: "+" to create a MIDI clip.- _icon.Text = "";+ _icon.IsVisible = false;_label.Text = "+"; _label.Foreground = TextDisabled;}else if (armed){// Armed audio track: a red record dot — click to capture input here.- _icon.Text = "●"; _icon.Foreground = Danger;- _label.Text = "Rec"; _label.Foreground = Danger;+ _icon.Kind = GlyphKind.Record; _icon.IsVisible = true; _icon.Foreground = Record;+ _label.Text = "Rec"; _label.Foreground = Record;}else{// Idle audio slot: a faint hollow ring hints it's a record / drop target.- _icon.Text = "○"; _icon.Foreground = TextDisabled;+ _icon.Kind = GlyphKind.RecordRing; _icon.IsVisible = true; _icon.Foreground = TextDisabled;_label.Text = ""; _label.Foreground = TextDisabled;}break;diff --git a/src/managed/Nota.App/SplashWindow.cs b/src/managed/Nota.App/SplashWindow.csindex 5fce1351..adbfc4a9 100644--- a/src/managed/Nota.App/SplashWindow.cs+++ b/src/managed/Nota.App/SplashWindow.cs@@ -88,7 +88,7 @@ public sealed class SplashWindow : WindowBackground = NotaPalette.BgSunken,BorderBrush = NotaPalette.BorderDefault,BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(14),+ CornerRadius = NotaRadius.Body,Child = stack,};}diff --git a/src/managed/Nota.App/TagEditorWindow.cs b/src/managed/Nota.App/TagEditorWindow.csindex b47b47c5..5d904c04 100644--- a/src/managed/Nota.App/TagEditorWindow.cs+++ b/src/managed/Nota.App/TagEditorWindow.cs@@ -85,7 +85,7 @@ public sealed class TagEditorWindow : NotaWindow_rows.Children.Clear();foreach (var tag in _lib.Tags) _rows.Children.Add(BuildRow(tag));if (_lib.Tags.Count == 0)- _rows.Children.Add(new TextBlock { Text = "No tags yet — add one below.", Opacity = 0.6, FontSize = 11 });+ _rows.Children.Add(new TextBlock { Text = "No tags yet — add one below.", Foreground = NotaPalette.TextTertiary, FontSize = 11 });}private Control BuildRow(BrowserTag tag)@@ -106,7 +106,7 @@ public sealed class TagEditorWindow : NotaWindowbool sel = string.Equals(c, tag.Color, StringComparison.OrdinalIgnoreCase);var sw = new Border{- Width = 16, Height = 16, CornerRadius = new CornerRadius(8),+ Width = 16, Height = 16, CornerRadius = NotaRadius.Body,Background = NotaPalette.Ink(c),BorderThickness = new Thickness(sel ? 2 : 0),BorderBrush = NotaPalette.HandleSel,@@ -116,7 +116,7 @@ public sealed class TagEditorWindow : NotaWindowswatches.Children.Add(sw);}- var del = new Button { Content = "✕", Classes = { "ghost" }, Width = 32 };+ var del = new Button { Content = new Glyph(GlyphKind.Close, 10), Classes = { "ghost" }, Width = 32, Foreground = NotaPalette.TextTertiary };del.Click += (_, _) => { _lib.DeleteTag(tag.Id); RebuildRows(); };var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 10 };diff --git a/src/managed/Nota.App/Theme/NotaFonts.cs b/src/managed/Nota.App/Theme/NotaFonts.csnew file mode 100644index 00000000..f782974b--- /dev/null+++ b/src/managed/Nota.App/Theme/NotaFonts.cs@@ -0,0 +1,63 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// Two typefaces and one hard rule between them: Geist for names and words, Geist Mono+// for anything that is a measurement — position, tempo, dB, Hz, ms, percentages,+// counters, format badges. Mono is monospaced, so digits keep their width as a knob turns.+//+// This is the C# side of Font.UI / Font.Mono in Theme/NotaTheme.axaml, for the+// custom-drawn layer that builds FormattedText itself. Never construct a Typeface from a+// family name in a view: a name the app does not bundle ("Inter", "Menlo", "monospace")+// silently resolves to whatever the OS has, which is how half the visualisers ended up+// in a different face from the chrome around them.+//+// Both families are bundled (assets/fonts, SIL OFL 1.1). Glyphs they lack — the thin+// space, ■ ▾ ✓ ★ — fall back to the system font per character.++using Avalonia;+using Avalonia.Media;++namespace Nota.App;++public static class NotaFonts+{+ public const string UiUri = "avares://Nota.App/Assets/Fonts#Geist";+ public const string MonoUri = "avares://Nota.App/Assets/Fonts#Geist Mono";++ public static readonly FontFamily UiFamily = new(UiUri);+ public static readonly FontFamily MonoFamily = new(MonoUri);++ // Geist 400 · 500 · 600 · 700+ public static readonly Typeface Sans = new(UiFamily);+ public static readonly Typeface SansMedium = new(UiFamily, FontStyle.Normal, FontWeight.Medium);+ public static readonly Typeface SansSemiBold = new(UiFamily, FontStyle.Normal, FontWeight.SemiBold);+ public static readonly Typeface SansBold = new(UiFamily, FontStyle.Normal, FontWeight.Bold);++ // Geist Mono 400 · 500 (· 700 for the rare bold readout)+ public static readonly Typeface Mono = new(MonoFamily);+ public static readonly Typeface MonoMedium = new(MonoFamily, FontStyle.Normal, FontWeight.Medium);+ public static readonly Typeface MonoBold = new(MonoFamily, FontStyle.Normal, FontWeight.Bold);++ /// <summary>Make Geist the default family, so a control that never names a font — and+ /// <c>FontFamily.Default</c> — still lands on it rather than on the OS face.</summary>+ public static AppBuilder WithNotaFonts(this AppBuilder builder)+ => builder.With(new FontManagerOptions { DefaultFamilyName = UiUri });+}++/// <summary>The type scales from the almanac, for views that set FontSize in code. Mirrors+/// the TextBlock role classes in NotaTheme.axaml. Tracking is in px, already multiplied out+/// from the em value at that size.</summary>+internal static class NotaType+{+ // Shell scale+ public const double Title = 26, Heading = 13, Name = 12, Body = 11, Caption = 11,+ SectionLabel = 10, Readout = 13, Value = 10, Eyebrow = 9;+ public const double SectionLabelTracking = 1.4, EyebrowTracking = 1.62;++ // Device scale — 7 is the floor, and only for a caps label or its value.+ public const double DeviceName = 12, DeviceSection = 9, RowLabel = 8, KnobLabel = 7,+ KnobValue = 7, Axis = 7;+ public const double DeviceSectionTracking = 1.08, RowLabelTracking = 0.8, KnobLabelTracking = 0.56;++ public const double Floor = 7;+}diff --git a/src/managed/Nota.App/Theme/NotaGeometry.cs b/src/managed/Nota.App/Theme/NotaGeometry.csnew file mode 100644index 00000000..27d9a78d--- /dev/null+++ b/src/managed/Nota.App/Theme/NotaGeometry.cs@@ -0,0 +1,68 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// Geometry for code-built views — the C# mirror of the Radius.* / Control.* / Space.*+// keys in Theme/NotaTheme.axaml, the way NotaPalette mirrors Brush.*. Geometry does not+// change with the variant, so these are plain constants. The smoke test fails if a value+// here and its XAML key drift apart.+//+// Radius follows the size of the object, not its role: a clip and a slider track are+// both 2 because both are thin, not because they do the same job.++using Avalonia;++namespace Nota.App;++internal static class NotaRadius+{+ public const double BarValue = 1, ClipValue = 2, BadgeValue = 3, ControlValue = 4,+ TileValue = 5, PanelValue = 6, BodyValue = 8, PillValue = 999;++ /// <summary>1 — spectrum and level bars.</summary>+ public static readonly CornerRadius Bar = new(BarValue);+ /// <summary>2 — clip, indicator, slider track.</summary>+ public static readonly CornerRadius Clip = new(ClipValue);+ /// <summary>3 — small segment, badge inside a device.</summary>+ public static readonly CornerRadius Badge = new(BadgeValue);+ /// <summary>4 — graph window, button, dropdown.</summary>+ public static readonly CornerRadius Control = new(ControlValue);+ /// <summary>5 — transport button, search field, tile.</summary>+ public static readonly CornerRadius Tile = new(TileValue);+ /// <summary>6 — panel, device section, transport module.</summary>+ public static readonly CornerRadius Panel = new(PanelValue);+ /// <summary>8 — device body, outer window frame.</summary>+ public static readonly CornerRadius Body = new(BodyValue);+ /// <summary>Half the height, whatever the height is — Avalonia clamps an oversized radius.</summary>+ public static readonly CornerRadius Pill = new(PillValue);++ /// <summary>Rounded top only — a header strip or a stripe sitting on a body.</summary>+ public static CornerRadius Top(double r) => new(r, r, 0, 0);+}++internal static class NotaSize+{+ public const double Chip = 20; // filter chip+ public const double Seg = 24; // tab segment+ public const double Shell = 26; // shell button, field, dropdown+ public const double SegGroup = 30; // segment container+ public const double Transport = 34; // transport button+ public const double Play = 46; // Play is wider on purpose+ public const double Console = 42; // transport module+ public const double KnobSecondary = 34;+ public const double KnobRegular = 36;+ public const double KnobMain = 44;+ public const double ParamCell = 53; // knob 34 + label line 9 + value line 10+}++internal static class NotaSpace+{+ // Inside a device: 2px units.+ public const double DeviceHair = 2;+ public const double DeviceGap = 5;+ public const double DeviceInset = 6;+ public const double DeviceInsetWide = 8;+ // In the shell: 4px units.+ public const double Tile = 8;+ public const double Gutter = 12;+ public const double Inset = 20;+}diff --git a/src/managed/Nota.App/Theme/NotaNum.cs b/src/managed/Nota.App/Theme/NotaNum.csnew file mode 100644index 00000000..d3188e6f--- /dev/null+++ b/src/managed/Nota.App/Theme/NotaNum.cs@@ -0,0 +1,75 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// How a number is set (almanac § Labels and numbers):+//+// the unit follows a thin space 4.6 s · −3.3 dB · 72 %+// the minus is typographic (U+2212) a plus only where the sign matters: +0.8 dB+// the precision is fixed per unit dB one decimal · tempo two · percent whole ·+// Hz whole up to 999, then 3.2 k+// the width never jumps across 10 or 100+//+// Culture is the display culture the app runs in: invariant (a point, never a comma,+// whatever the OS locale) with U+2212 as the negative sign, so an implicit {v:0.0} already+// prints −3.3. Parsing with it still accepts a typed hyphen. Persistence never goes through+// it — project, preset and settings files are JSON and culture-free.++using System;+using System.Globalization;++namespace Nota.App;++public static class NotaNum+{+ public const string Thin = "\u2009";+ public const string Minus = "\u2212";++ public static readonly CultureInfo Culture = MakeCulture();++ private static CultureInfo MakeCulture()+ {+ var c = (CultureInfo)CultureInfo.InvariantCulture.Clone();+ c.NumberFormat.NegativeSign = Minus;+ return CultureInfo.ReadOnly(c);+ }++ /// <summary>Make the display culture the default for every thread. Call once at start-up.</summary>+ public static void Install()+ {+ CultureInfo.DefaultThreadCurrentCulture = Culture;+ CultureInfo.CurrentCulture = Culture;+ }++ /// <summary>Format an interpolated string in the display culture.</summary>+ public static string F(FormattableString s) => s.ToString(Culture);++ public static string Str(double v, string format) => v.ToString(format, Culture);++ /// <summary>Decibels, one decimal: "−3.3 dB"; "+0.8 dB" when <paramref name="signed"/>; "−∞ dB" at silence.</summary>+ public static string Db(double db, bool signed = false, double floor = -99)+ {+ if (db <= floor || double.IsNegativeInfinity(db)) return Minus + "∞" + Thin + "dB";+ return db.ToString(signed ? "+0.0;\u22120.0;0.0" : "0.0", Culture) + Thin + "dB";+ }++ /// <summary>Frequency: whole Hz up to 999, then "3.2 k" (one decimal below 10 k, whole above).</summary>+ public static string Hz(double hz)+ {+ if (hz < 999.5) return hz.ToString("0", Culture) + Thin + "Hz";+ double k = hz / 1000;+ return (k < 9.95 ? k.ToString("0.0", Culture) : k.ToString("0", Culture)) + Thin + "k";+ }++ /// <summary>Percent, whole: "72 %". <paramref name="frac"/> is 0..1.</summary>+ public static string Pct(double frac) => (frac * 100).ToString("0", Culture) + Thin + "%";++ /// <summary>Tempo, two decimals: "120.00".</summary>+ public static string Bpm(double bpm) => bpm.ToString("0.00", Culture);++ /// <summary>Time: "240 ms" below a second, "1.25 s" above.</summary>+ public static string Time(double seconds)+ => seconds < 0.9995 ? (seconds * 1000).ToString("0", Culture) + Thin + "ms" : seconds.ToString("0.00", Culture) + Thin + "s";++ /// <summary>A number followed by its unit, thin-spaced.</summary>+ public static string Unit(double v, string format, string unit) => v.ToString(format, Culture) + Thin + unit;+}diff --git a/src/managed/Nota.App/Theme/NotaPalette.cs b/src/managed/Nota.App/Theme/NotaPalette.csindex c0e69a5b..9f146260 100644--- a/src/managed/Nota.App/Theme/NotaPalette.cs+++ b/src/managed/Nota.App/Theme/NotaPalette.cs@@ -124,6 +124,11 @@ internal static class NotaPalette{var key = darkHex.ToUpperInvariant();if (InkCache.TryGetValue(key, out var b)) return b;+ // A hex that already is a role token (brass, teal, rose, steel…) resolves to that token,+ // so it gets the designed light value instead of a derived one — never a second brass.+ var dark = Color.Parse(darkHex);+ foreach (var slot in Slots)+ if (slot.Dark == dark) { InkCache[key] = slot.Brush; return slot.Brush; }b = T(darkHex, InkOverrides.TryGetValue(key, out var pin) ? pin : DeriveLight(Color.Parse(darkHex)));InkCache[key] = b;return b;@@ -179,64 +184,89 @@ internal static class NotaPalette// Tokens. dark = "Ember Graphite" light = "Ember Paper"// =======================================================================- // ---- Surfaces (both themes: the further forward, the lighter) ---------- public static readonly SolidColorBrush SurfaceAbyss = T("#0A0908", "#DCD6C5"); // Brush.SurfaceAbyss — deepest well (meter troughs, transport console)- public static readonly SolidColorBrush BgSunken = T("#100F0D", "#E4DFD1"); // Brush.BgSunken / ChromeBg+ // ---- Surfaces: the nine steps of the almanac, far to near -------------+ // Void · App · Gutter · Well · Panel · Card · Raised · Hover · Track off.+ // Depth is lightness plus a hairline, never a shadow, and three levels of+ // nesting is the limit — a fourth means the layout is wrong, not the palette.+ public static readonly SolidColorBrush SurfaceAbyss = T("#0A0908", "#D8D1BE"); // Brush.SurfaceAbyss — Void+ public static readonly SolidColorBrush BgApp = T("#0B0A09", "#DCD6C5"); // Brush.BgApp — window ground, plugin body+ public static readonly SolidColorBrush Gutter = T("#0C0B09", "#E0DAC9"); // Brush.Gutter — the gaps panels float in+ public static readonly SolidColorBrush BgSunken = T("#100F0D", "#E4DFD1"); // Brush.BgSunken / ChromeBg — Well+ public static readonly SolidColorBrush CanvasBg = T("#121110", "#E6E1D3"); // modular canvas, just above the wellpublic static readonly SolidColorBrush SurfaceDeep = T("#131210", "#E7E2D4"); // step-sequencer ground- public static readonly SolidColorBrush CanvasBg = T("#121110", "#E9E5D8"); // modular canvas- public static readonly SolidColorBrush BgApp = T("#171613", "#EFEADE"); // Brush.BgApp- public static readonly SolidColorBrush LaneB = T("#191814", "#E9E4D6"); // Brush.LaneB (alternating lane)- public static readonly SolidColorBrush SurfaceInset = T("#1B1916", "#E7E2D4"); // rail / sunken chip- public static readonly SolidColorBrush SurfaceCard = T("#1E1C18", "#F8F5EC"); // Brush.SurfaceCard- public static readonly SolidColorBrush SurfaceRaised = T("#26231E", "#FFFEF8"); // Brush.SurfaceRaised- public static readonly SolidColorBrush SurfaceHover = T("#2E2B24", "#E7E1D0"); // Brush.SurfaceHover- public static readonly SolidColorBrush SurfaceActive = T("#332F27", "#DBD4C0"); // Brush.SurfaceActive+ public static readonly SolidColorBrush LaneB = T("#131210", "#E7E2D4"); // Brush.LaneB (alternating lane)+ public static readonly SolidColorBrush Panel = T("#141310", "#EAE5D7"); // Brush.Panel — browser, headers, inspector+ public static readonly SolidColorBrush SurfaceCard = T("#171613", "#EFEADE"); // Brush.SurfaceCard — a section inside a device+ public static readonly SolidColorBrush SurfaceInset = T("#1A1815", "#E9E4D6"); // rail / sunken chip+ public static readonly SolidColorBrush SurfaceRaised = T("#1C1A16", "#F8F5EC"); // Brush.SurfaceRaised — button at rest+ public static readonly SolidColorBrush SurfaceHover = T("#252219", "#E7E1D0"); // Brush.SurfaceHover+ public static readonly SolidColorBrush TrackOff = T("#26231E", "#DBD4C0"); // Brush.TrackOff — track of an off toggle+ // Pressed goes *into* the recess rather than to a fourth raised step.+ public static readonly SolidColorBrush SurfaceActive = T("#100F0D", "#D5CEBB"); // Brush.SurfaceActive// ---- Grid + graph lines (kept under ~12% contrast against their lane) -public static readonly SolidColorBrush GridSubBeat = T("#191712", "#E5DFCE"); // finer than a beat- public static readonly SolidColorBrush GridBeat = T("#1F1D18", "#DED8C8"); // Brush.GridBeat+ public static readonly SolidColorBrush GridBeat = T("#1E1C18", "#DED8C8"); // Brush.GridBeat — grid inside graphs, zero axispublic static readonly SolidColorBrush GridRow = T("#141311", "#E6E1D2"); // piano-roll row dividerpublic static readonly SolidColorBrush GridBar = T("#2A2721", "#CFC8B4"); // Brush.GridBarpublic static readonly SolidColorBrush GraphBorder = T("#221F1A", "#D5CFBE"); // inner border of a visualiser wellpublic static readonly SolidColorBrush WellGrid = T("#232019", "#DDD7C6"); // grid drawn inside a wellpublic static readonly SolidColorBrush PadGrid = T("#1C1A16", "#DED8C7"); // XY-pad grid- // ---- Text (warm off-white on graphite, warm near-black on paper) ------- public static readonly SolidColorBrush TextPrimary = T("#E9E4D8", "#241F17"); // Brush.TextPrimary- public static readonly SolidColorBrush TextStrong = T("#C8C2B4", "#3E382C"); // between primary and secondary- public static readonly SolidColorBrush TextSecondary = T("#A39D8F", "#5E5849"); // Brush.TextSecondary- public static readonly SolidColorBrush TextTertiary = T("#6E6A5E", "#8A8474"); // Brush.TextTertiary- public static readonly SolidColorBrush TextDisabled = T("#4A463D", "#ADA694"); // Brush.TextDisabled+ // ---- Text: eight steps, strictly by descending importance ------------+ // Warm off-white on graphite, warm near-black on paper. Muted text takes the+ // next Ink step down — never opacity, which makes contrast unpredictable.+ public static readonly SolidColorBrush TextHeading = T("#F2EDE1", "#1A150E"); // Ink 0 — page titles, project name. Rare.+ public static readonly SolidColorBrush TextPrimary = T("#E9E4D8", "#241F17"); // Ink 1 — device/track/preset names, values+ public static readonly SolidColorBrush TextStrong = T("#C7C0B0", "#3E382C"); // Ink 2 — button text, transport readouts+ public static readonly SolidColorBrush TextSecondary = T("#A39D8F", "#5E5849"); // Ink 3 — inactive but readable, metadata+ public static readonly SolidColorBrush TextMuted = T("#8D8779", "#746D5C"); // Ink 4 — explanations, units, hints+ public static readonly SolidColorBrush TextTertiary = T("#6E6A5E", "#8A8474"); // Ink 5 — caps labels above parameters+ public static readonly SolidColorBrush TextDisabled = T("#55514A", "#9E9786"); // Ink 6 — placeholder, disabled action+ public static readonly SolidColorBrush TextAxis = T("#4A463D", "#ADA694"); // Ink 7 — axis labels inside graphs onlypublic static readonly SolidColorBrush TextOnAccent = T("#171613", "#FFFBF2"); // Brush.TextOnAccent// ---- Borders ----------------------------------------------------------public static readonly SolidColorBrush BorderDefault = T("#2C2923", "#D5CEBB"); // Brush.BorderDefault- public static readonly SolidColorBrush BorderStrong = T("#3A362D", "#BDB5A0"); // Brush.BorderStrong- public static readonly SolidColorBrush BorderHover = T("#444038", "#ADA48D");+ public static readonly SolidColorBrush BorderStrong = T("#3A362D", "#BDB5A0"); // Brush.BorderStrong — knob cap, hovered border+ public static readonly SolidColorBrush BorderBrass = T("#6B5326", "#C9A254"); // Brush.BorderBrass — engaged button: brass at 40%// ---- Accent (brass on graphite, bronze on paper: darker carries the// same emphasis against a light ground) ----------------------------- public static readonly SolidColorBrush Accent = T("#D8A03D", "#A87415"); // Brush.Accent- public static readonly SolidColorBrush AccentHover = T("#E8B24C", "#8F6110"); // Brush.AccentHover- public static readonly SolidColorBrush AccentBright = T("#F0C060", "#744D07"); // Brush.AccentBright — hottest- public static readonly SolidColorBrush AccentGlow = T("#F4CE7A", "#C08D22"); // gradient highlight- public static readonly SolidColorBrush AccentDeep = T("#B8842E", "#7A5008"); // gradient shadow+ public static readonly SolidColorBrush Accent = T("#D8A03D", "#A87415"); // Brush.Accent — arc, fill, playhead, solid button+ public static readonly SolidColorBrush AccentBright = T("#F0C060", "#744D07"); // Brush.AccentBright — Brass Light, the hottest mark+ public static readonly SolidColorBrush AccentHover = T("#E9BE6A", "#8F6110"); // Brush.AccentHover — hover on brass text+ public static readonly SolidColorBrush AccentDeep = T("#B08536", "#7A5008"); // Brush.AccentDeep — press, left half of the loop+ public static readonly SolidColorBrush AccentDim = T("#8A6B2E", "#9C8034"); // Brush.AccentDim — eyebrows, mono section marks+ public static readonly SolidColorBrush AccentEdge = T("#5E4A22", "#D3B173"); // Brush.AccentEdge — chip border, link underlinepublic static readonly SolidColorBrush AccentPale = T("#FCE5B8", "#5C3C04"); // hot edge highlight- public static readonly SolidColorBrush AccentTint = T("#5A4C2E", "#CCAB63"); // accent-tinted fill / border- public static readonly SolidColorBrush AccentSubtle = Wash(Accent, 0x24); // Brush.AccentSubtle+ // Opaque, not an alpha tint: the almanac wants one predictable colour, and+ // alpha over two different grounds is not one.+ public static readonly SolidColorBrush AccentSubtle = T("#241F17", "#F2E4C4"); // Brush.AccentSubtle — Brass Wash, selected row// ---- Status ------------------------------------------------------------ public static readonly SolidColorBrush Success = T("#58B368", "#2C7A3E"); // Brush.Success- public static readonly SolidColorBrush Warning = T("#D9C34C", "#837010"); // Brush.Warning- public static readonly SolidColorBrush Danger = T("#D95F4C", "#B03A28"); // Brush.Danger- public static readonly SolidColorBrush DangerHover= T("#E4715F", "#C64A36"); // Brush.DangerHover- public static readonly SolidColorBrush DangerDeep = T("#C55A47", "#9C3221"); // over-threshold fill- public static readonly SolidColorBrush DangerPale = T("#F0928A", "#8E2416"); // live-take waveform / label+ // Red belongs to recording. Everything else red is an alert about level.+ public static readonly SolidColorBrush Record = T("#C25B44", "#B54A32"); // Brush.Record — active recording, the only claim on red+ public static readonly SolidColorBrush RecordInk = T("#F4E3DC", "#FFF4EE"); // Brush.RecordInk — disc on an engaged record button+ public static readonly SolidColorBrush Success = T("#58B368", "#2C7A3E"); // Brush.Success — Signal, working meter zone+ public static readonly SolidColorBrush SuccessDim = T("#7FB069", "#609548"); // Brush.SuccessDim — transport input, metronome+ public static readonly SolidColorBrush Warning = T("#D9C34C", "#837010"); // Brush.Warning — Caution, −6..0 dB+ public static readonly SolidColorBrush Danger = T("#C2554A", "#B13E33"); // Brush.Danger — Alert, overload / clipping+ public static readonly SolidColorBrush DangerHover = T("#D0685C", "#C64A36"); // Brush.DangerHover+ public static readonly SolidColorBrush DangerBright= T("#E08A72", "#A3391B"); // Brush.DangerBright — Alert Light, readout text+ public static readonly SolidColorBrush DangerDeep = T("#A8453B", "#9C3221"); // over-threshold fill, below Alert+ public static readonly SolidColorBrush DangerPale = T("#F0928A", "#8E2416"); // live-take waveform / label// ---- Data + modulation ------------------------------------------------- public static readonly SolidColorBrush Teal = T("#5B9E9C", "#2F7472"); // Brush.Track5 — modulation accent- public static readonly SolidColorBrush TealBright = T("#7FC9C6", "#3D9491");- public static readonly SolidColorBrush Sage = T("#6FA383", "#42765A"); // Brush.Track4 — audio+ // Role chromas live inside visualisers only. When two or three sources share+ // one graph, brass takes the primary and these follow in order. They never+ // reach a button and they never mean state.+ public static readonly SolidColorBrush Teal = T("#5B9E9C", "#2F7472"); // Brush.ChromaTeal — 2nd layer; also the modulation accent+ public static readonly SolidColorBrush TealBright = T("#7FC0BE", "#3E8A88"); // Brush.ChromaTealLight+ public static readonly SolidColorBrush Rose = T("#B57286", "#86465B"); // Brush.ChromaRose — 3rd layer: right channel, highs, tail+ public static readonly SolidColorBrush RoseBright = T("#D79BAB", "#7F2D43"); // Brush.ChromaRoseLight+ public static readonly SolidColorBrush Steel = T("#6D8FB5", "#3E6288"); // Brush.ChromaSteel — 4th layer, used rarely+ public static readonly SolidColorBrush Sage = T("#6FA383", "#42765A"); // standalone hue (no longer a track slot)public static readonly SolidColorBrush Threshold = T("#C9884F", "#8A5218"); // threshold markerspublic static readonly SolidColorBrush Marker = T("#7FCCE1", "#1B6E8C"); // clip markers / bracketspublic static readonly SolidColorBrush MarkerHot = T("#CDEEF8", "#0E5470"); // resize-edge affordance@@ -246,7 +276,7 @@ internal static class NotaPalettepublic static readonly SolidColorBrush HandleSel = T("#FFFFFF", "#1E1A14"); // selected graph handle// ---- Tinted chrome ----------------------------------------------------- public static readonly SolidColorBrush SelHeaderBg = T("#332C1E", "#EFE4C6"); // selected track header+ public static readonly SolidColorBrush SelHeaderBg = T("#241F17", "#F2E4C4"); // selected track header — Brass Washpublic static readonly SolidColorBrush FrozenHeaderBg = T("#1B2A33", "#D8E8F0"); // frozen track headerpublic static readonly SolidColorBrush MuteTint = T("#3A2320", "#F0D9D3"); // muted bandpublic static readonly SolidColorBrush Veil = T("#121418", "#F2EFE6"); // deactivated-clip scrim base@@ -264,18 +294,26 @@ internal static class NotaPalettepublic static readonly SolidColorBrush ShadeDown = T("#141210", "#3A3227"); // "darker" shade// ---- Track palette (Brush.Track1..8) + return buses --------------------+ // Nine roles at one lightness, so no track is louder than another. A group sets+ // the hue and its tracks take neighbouring shades of it. Paper darkens each by+ // the same ratio the previous eight pairs used (lightness ×0.67, saturation ×1.18).+ //+ // Saved projects are NOT migrated: a stored colour index keeps working but now+ // points at the hue that sits at that place in this table.private static readonly SolidColorBrush[] TrackSlots ={- T("#C4756A", "#9A4A3E"), // rust- T("#C99C55", "#97682A"), // amber- T("#9BA65D", "#646E32"), // olive- T("#6FA383", "#42765A"), // sage- T("#5B9E9C", "#2F7472"), // teal- T("#6D8FB5", "#3E6288"), // slate- T("#9B7FA6", "#6A5176"), // mauve- T("#B57286", "#86465B"), // rose+ T("#58B368", "#328140"), // Drums+ T("#4E9E7A", "#306F53"), // Perc+ T("#3E8E8E", "#256464"), // Bass+ T("#5AA0B8", "#317187"), // Keys+ T("#C77F55", "#985127"), // Texture+ T("#7A6FB0", "#4B4082"), // FX+ T("#B05A7A", "#7F3450"), // Brass+ T("#9AA64A", "#6C752C"), // Vox+ T("#7FA88E", "#4D7A5D"), // Return};- private static readonly SolidColorBrush[] ReturnSlots = { T("#7C88A0", "#4D5972"), T("#A08A7C", "#705B4E") };+ // Return buses draw from the ninth role rather than a palette of their own.+ private static readonly SolidColorBrush[] ReturnSlots = { T("#7FA88E", "#4D7A5D"), T("#6B907B", "#3E6A4D") };/// <summary>Brush form of the 8-track cycle — index it for fills that follow the theme.</summary>public static readonly SolidColorBrush[] TrackBrushes = TrackSlots;@@ -284,7 +322,7 @@ internal static class NotaPalette/// <summary>The 8-track colour cycle + the two return-bus tints, as Colors for the views/// that mix or alpha-blend them. Rewritten in place by <see cref="Apply"/> — read at draw/// time (the array reference is stable, its contents are not).</summary>- public static readonly Color[] TrackColors = { TrackSlots[0].Color, TrackSlots[1].Color, TrackSlots[2].Color, TrackSlots[3].Color, TrackSlots[4].Color, TrackSlots[5].Color, TrackSlots[6].Color, TrackSlots[7].Color };+ public static readonly Color[] TrackColors = { TrackSlots[0].Color, TrackSlots[1].Color, TrackSlots[2].Color, TrackSlots[3].Color, TrackSlots[4].Color, TrackSlots[5].Color, TrackSlots[6].Color, TrackSlots[7].Color, TrackSlots[8].Color };public static readonly Color[] ReturnColors = { ReturnSlots[0].Color, ReturnSlots[1].Color };// ---- Lookup by XAML key ------------------------------------------------@@ -295,20 +333,34 @@ internal static class NotaPalette// are already live and should keep using the resource observable.)private static readonly Dictionary<string, SolidColorBrush> KeyMap = new(StringComparer.OrdinalIgnoreCase){- ["Brush.SurfaceAbyss"] = SurfaceAbyss,+ ["Brush.SurfaceAbyss"] = SurfaceAbyss, ["Brush.Gutter"] = Gutter,["Brush.BgSunken"] = BgSunken, ["Brush.ChromeBg"] = BgSunken,["Brush.BgApp"] = BgApp, ["Brush.LaneB"] = LaneB,+ ["Brush.Panel"] = Panel, ["Brush.TrackOff"] = TrackOff,["Brush.SurfaceCard"] = SurfaceCard, ["Brush.SurfaceRaised"] = SurfaceRaised,["Brush.SurfaceHover"] = SurfaceHover, ["Brush.SurfaceActive"] = SurfaceActive,+ ["Brush.SurfaceSelected"] = AccentSubtle,["Brush.GridBeat"] = GridBeat, ["Brush.GridBar"] = GridBar,- ["Brush.TextPrimary"] = TextPrimary, ["Brush.TextSecondary"] = TextSecondary,- ["Brush.TextTertiary"] = TextTertiary, ["Brush.TextDisabled"] = TextDisabled,+ ["Brush.Hairline"] = GraphBorder,+ ["Brush.TextHeading"] = TextHeading, ["Brush.TextPrimary"] = TextPrimary,+ ["Brush.TextStrong"] = TextStrong, ["Brush.TextSecondary"] = TextSecondary,+ ["Brush.TextMuted"] = TextMuted, ["Brush.TextTertiary"] = TextTertiary,+ ["Brush.TextDisabled"] = TextDisabled, ["Brush.TextAxis"] = TextAxis,["Brush.TextOnAccent"] = TextOnAccent,["Brush.BorderDefault"] = BorderDefault, ["Brush.BorderStrong"] = BorderStrong,+ ["Brush.BorderBrass"] = BorderBrass,["Brush.Accent"] = Accent, ["Brush.AccentHover"] = AccentHover,- ["Brush.AccentBright"] = AccentBright, ["Brush.AccentSubtle"] = AccentSubtle,- ["Brush.Success"] = Success, ["Brush.Warning"] = Warning,+ ["Brush.AccentBright"] = AccentBright, ["Brush.AccentDeep"] = AccentDeep,+ ["Brush.AccentDim"] = AccentDim, ["Brush.AccentEdge"] = AccentEdge,+ ["Brush.AccentSubtle"] = AccentSubtle,+ ["Brush.Record"] = Record, ["Brush.RecordInk"] = RecordInk,+ ["Brush.Success"] = Success,+ ["Brush.SuccessDim"] = SuccessDim, ["Brush.Warning"] = Warning,["Brush.Danger"] = Danger, ["Brush.DangerHover"] = DangerHover,+ ["Brush.DangerBright"] = DangerBright,+ ["Brush.ChromaTeal"] = Teal, ["Brush.ChromaTealLight"] = TealBright,+ ["Brush.ChromaRose"] = Rose, ["Brush.ChromaRoseLight"] = RoseBright,+ ["Brush.ChromaSteel"] = Steel,};/// <summary>The slot behind a <c>Brush.*</c> XAML key, or null if the key is unknown.</summary>diff --git a/src/managed/Nota.App/Theme/NotaTheme.axaml b/src/managed/Nota.App/Theme/NotaTheme.axamlindex 4d1d84f8..11bcc38a 100644--- a/src/managed/Nota.App/Theme/NotaTheme.axaml+++ b/src/managed/Nota.App/Theme/NotaTheme.axaml@@ -10,23 +10,46 @@xmlns:sys="using:System"><Styles.Resources><ResourceDictionary>- <!-- Fonts: Inter (Geist substitute) for UI, monospace for numeric data.- Swap Font.UI to Geist once it is bundled (HANDOFF §1). -->- <FontFamily x:Key="Font.UI">avares://Avalonia.Fonts.Inter/Assets#Inter</FontFamily>- <FontFamily x:Key="Font.Mono">Cascadia Code,Menlo,Consolas,monospace</FontFamily>-- <!-- Geometry: radii (control/card/panel/xl/clip/pill) -->- <CornerRadius x:Key="Radius.Sm">5</CornerRadius>- <CornerRadius x:Key="Radius.Md">7</CornerRadius>- <CornerRadius x:Key="Radius.Lg">10</CornerRadius>- <CornerRadius x:Key="Radius.Xl">14</CornerRadius>- <CornerRadius x:Key="Radius.Clip">4</CornerRadius>- <CornerRadius x:Key="Radius.Pill">8</CornerRadius>-- <!-- Control heights (dense — HANDOFF §1: toolbar/buttons 22–26, transport 28) -->- <sys:Double x:Key="Control.Sm">22</sys:Double>- <sys:Double x:Key="Control.Md">26</sys:Double>- <sys:Double x:Key="Control.Lg">28</sys:Double>+ <!-- Fonts: Geist for names and words, Geist Mono for every measurement.+ Bundled from assets/fonts (SIL OFL 1.1); mirrored by Theme/NotaFonts.cs. -->+ <FontFamily x:Key="Font.UI">avares://Nota.App/Assets/Fonts#Geist</FontFamily>+ <FontFamily x:Key="Font.Mono">avares://Nota.App/Assets/Fonts#Geist Mono</FontFamily>++ <!-- ===== Geometry ========================================================+ Mirrored in Theme/NotaGeometry.cs for code-built views; the smoke test+ keeps the two files equal.++ Radius follows the size of the object, not its role. -->+ <CornerRadius x:Key="Radius.Bar">1</CornerRadius> <!-- spectrum / level bar -->+ <CornerRadius x:Key="Radius.Clip">2</CornerRadius> <!-- clip, indicator, slider track -->+ <CornerRadius x:Key="Radius.Badge">3</CornerRadius> <!-- small segment, badge inside a device -->+ <CornerRadius x:Key="Radius.Control">4</CornerRadius> <!-- graph window, button, dropdown -->+ <CornerRadius x:Key="Radius.Tile">5</CornerRadius> <!-- transport button, search field, tile -->+ <CornerRadius x:Key="Radius.Panel">6</CornerRadius> <!-- panel, device section, transport module -->+ <CornerRadius x:Key="Radius.Body">8</CornerRadius> <!-- device body, outer window frame -->+ <CornerRadius x:Key="Radius.Pill">999</CornerRadius> <!-- filter chip, toggle: half the height -->++ <!-- Heights and fixed widths already settled in the designs -->+ <sys:Double x:Key="Control.Chip">20</sys:Double> <!-- filter chip -->+ <sys:Double x:Key="Control.Seg">24</sys:Double> <!-- tab segment -->+ <sys:Double x:Key="Control.Shell">26</sys:Double> <!-- shell button, field, dropdown -->+ <sys:Double x:Key="Control.SegGroup">30</sys:Double> <!-- segment container: 24 + 2 pad + 1 border -->+ <sys:Double x:Key="Control.Transport">34</sys:Double> <!-- transport button -->+ <sys:Double x:Key="Control.Play">46</sys:Double> <!-- Play is wider on purpose: found by hand -->+ <sys:Double x:Key="Control.Console">42</sys:Double> <!-- transport module -->+ <sys:Double x:Key="Control.KnobSecondary">34</sys:Double>+ <sys:Double x:Key="Control.KnobRegular">36</sys:Double>+ <sys:Double x:Key="Control.KnobMain">44</sys:Double>+ <sys:Double x:Key="Control.ParamCell">53</sys:Double> <!-- knob 34 + label line 9 + value line 10 -->++ <!-- Spacing. Inside a device everything moves in 2px units, in the shell in 4px. -->+ <sys:Double x:Key="Space.DeviceHair">2</sys:Double>+ <sys:Double x:Key="Space.DeviceGap">5</sys:Double> <!-- between device sections -->+ <sys:Double x:Key="Space.DeviceInset">6</sys:Double> <!-- body padding, section inset -->+ <sys:Double x:Key="Space.DeviceInsetWide">8</sys:Double>+ <sys:Double x:Key="Space.Tile">8</sys:Double> <!-- between tiles -->+ <sys:Double x:Key="Space.Gutter">12</sys:Double> <!-- between shell panels -->+ <sys:Double x:Key="Space.Inset">20</sys:Double> <!-- inside a shell panel --><!-- ===== Palette =========================================================Two variants of one system. "Ember Graphite" (dark) is the default: warm@@ -41,46 +64,74 @@<ResourceDictionary.ThemeDictionaries><ResourceDictionary x:Key="Dark">- <!-- Surfaces -->- <!-- The deepest surface: a recess cut into the chrome, used by the transport- console so playback reads as one inset object (mockup 1b). Mirrors the- NotaPalette.SurfaceAbyss slot the custom-drawn meters already use. -->- <SolidColorBrush x:Key="Brush.SurfaceAbyss">#0A0908</SolidColorBrush>- <SolidColorBrush x:Key="Brush.BgSunken">#100F0D</SolidColorBrush>- <SolidColorBrush x:Key="Brush.BgApp">#171613</SolidColorBrush>- <SolidColorBrush x:Key="Brush.LaneB">#191814</SolidColorBrush>- <SolidColorBrush x:Key="Brush.SurfaceCard">#1E1C18</SolidColorBrush>- <SolidColorBrush x:Key="Brush.SurfaceRaised">#26231E</SolidColorBrush>- <SolidColorBrush x:Key="Brush.SurfaceHover">#2E2B24</SolidColorBrush>- <SolidColorBrush x:Key="Brush.SurfaceActive">#332F27</SolidColorBrush>- <SolidColorBrush x:Key="Brush.SurfaceSelected">#24D8A03D</SolidColorBrush>- <SolidColorBrush x:Key="Brush.ChromeBg">#100F0D</SolidColorBrush>-- <!-- Grid lines (drawn by custom views) — keep < 12% contrast vs lanes -->- <SolidColorBrush x:Key="Brush.GridBeat">#1F1D18</SolidColorBrush>+ <!-- === Surfaces: the nine steps of the almanac, far to near ===+ Void · App · Gutter · Well · Panel · Card · Raised · Hover · Track off.+ Depth is lightness plus a hairline, never a shadow. Three levels of+ nesting is the limit; a fourth means the layout is wrong. -->+ <SolidColorBrush x:Key="Brush.SurfaceAbyss">#0A0908</SolidColorBrush> <!-- Void: deepest recess, under the transport -->+ <SolidColorBrush x:Key="Brush.BgApp">#0B0A09</SolidColorBrush> <!-- App: window ground and plugin body -->+ <SolidColorBrush x:Key="Brush.Gutter">#0C0B09</SolidColorBrush> <!-- Gutter: the gaps panels float in -->+ <SolidColorBrush x:Key="Brush.BgSunken">#100F0D</SolidColorBrush> <!-- Well: graph windows, inputs, slider tracks -->+ <SolidColorBrush x:Key="Brush.Panel">#141310</SolidColorBrush> <!-- Panel: browser, headers, inspector -->+ <SolidColorBrush x:Key="Brush.SurfaceCard">#171613</SolidColorBrush> <!-- Card: a section inside a device -->+ <SolidColorBrush x:Key="Brush.SurfaceRaised">#1C1A16</SolidColorBrush> <!-- Raised: button at rest -->+ <SolidColorBrush x:Key="Brush.SurfaceHover">#252219</SolidColorBrush> <!-- Hover: button or list row under the pointer -->+ <SolidColorBrush x:Key="Brush.TrackOff">#26231E</SolidColorBrush> <!-- Track off: the track of an off toggle -->+ <!-- Pressed goes *into* the recess rather than to a fourth raised step. -->+ <SolidColorBrush x:Key="Brush.SurfaceActive">#100F0D</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.LaneB">#131210</SolidColorBrush> <!-- alternating lane, one hair above the well -->+ <SolidColorBrush x:Key="Brush.ChromeBg">#100F0D</SolidColorBrush> <!-- alias of Well -->+ <!-- Selected row: opaque brass wash, not an alpha tint — the almanac wants a+ predictable colour, and alpha over two different grounds is not one. -->+ <SolidColorBrush x:Key="Brush.SurfaceSelected">#241F17</SolidColorBrush>++ <!-- Lines and frames -->+ <SolidColorBrush x:Key="Brush.Hairline">#221F1A</SolidColorBrush> <!-- row dividers, graph-window frame -->+ <SolidColorBrush x:Key="Brush.BorderDefault">#2C2923</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.BorderStrong">#3A362D</SolidColorBrush> <!-- knob cap, hovered border -->+ <SolidColorBrush x:Key="Brush.BorderBrass">#6B5326</SolidColorBrush> <!-- border of an engaged button: brass at 40% -->+ <SolidColorBrush x:Key="Brush.GridBeat">#1E1C18</SolidColorBrush> <!-- grid inside graphs, zero axis --><SolidColorBrush x:Key="Brush.GridBar">#2A2721</SolidColorBrush>- <!-- Text (warm off-white) -->- <SolidColorBrush x:Key="Brush.TextPrimary">#E9E4D8</SolidColorBrush>- <SolidColorBrush x:Key="Brush.TextSecondary">#A39D8F</SolidColorBrush>- <SolidColorBrush x:Key="Brush.TextTertiary">#6E6A5E</SolidColorBrush>- <SolidColorBrush x:Key="Brush.TextDisabled">#4A463D</SolidColorBrush>+ <!-- === Text: eight steps, strictly by descending importance === -->+ <SolidColorBrush x:Key="Brush.TextHeading">#F2EDE1</SolidColorBrush> <!-- Ink 0: page titles, project name. Rare. -->+ <SolidColorBrush x:Key="Brush.TextPrimary">#E9E4D8</SolidColorBrush> <!-- Ink 1: device, track and preset names, values -->+ <SolidColorBrush x:Key="Brush.TextStrong">#C7C0B0</SolidColorBrush> <!-- Ink 2: button text, transport readouts -->+ <SolidColorBrush x:Key="Brush.TextSecondary">#A39D8F</SolidColorBrush> <!-- Ink 3: inactive but readable, metadata -->+ <SolidColorBrush x:Key="Brush.TextMuted">#8D8779</SolidColorBrush> <!-- Ink 4: explanations, units, hints -->+ <SolidColorBrush x:Key="Brush.TextTertiary">#6E6A5E</SolidColorBrush> <!-- Ink 5: caps labels above parameters -->+ <SolidColorBrush x:Key="Brush.TextDisabled">#55514A</SolidColorBrush> <!-- Ink 6: search placeholder, disabled action -->+ <SolidColorBrush x:Key="Brush.TextAxis">#4A463D</SolidColorBrush> <!-- Ink 7: axis labels inside graphs only, mono 7-8px --><SolidColorBrush x:Key="Brush.TextOnAccent">#171613</SolidColorBrush>- <!-- Borders -->- <SolidColorBrush x:Key="Brush.BorderDefault">#2C2923</SolidColorBrush>- <SolidColorBrush x:Key="Brush.BorderStrong">#3A362D</SolidColorBrush>-- <!-- Accent (brass) + semantic -->- <SolidColorBrush x:Key="Brush.Accent">#D8A03D</SolidColorBrush>- <SolidColorBrush x:Key="Brush.AccentHover">#E8B24C</SolidColorBrush>- <SolidColorBrush x:Key="Brush.AccentBright">#F0C060</SolidColorBrush>- <SolidColorBrush x:Key="Brush.AccentSubtle">#24D8A03D</SolidColorBrush>- <SolidColorBrush x:Key="Brush.Success">#58B368</SolidColorBrush>- <SolidColorBrush x:Key="Brush.Warning">#D9C34C</SolidColorBrush>- <SolidColorBrush x:Key="Brush.Danger">#D95F4C</SolidColorBrush>- <SolidColorBrush x:Key="Brush.DangerHover">#E4715F</SolidColorBrush>- <SolidColorBrush x:Key="Brush.DangerSubtle">#33D95F4C</SolidColorBrush>+ <!-- === Brass: the one accent. "Active, selected, changed" and nothing+ else. A second accent must never enter the system. === -->+ <SolidColorBrush x:Key="Brush.Accent">#D8A03D</SolidColorBrush> <!-- arc, fill, playhead, solid button -->+ <SolidColorBrush x:Key="Brush.AccentBright">#F0C060</SolidColorBrush> <!-- Brass Light: text and knob pointer on dark -->+ <SolidColorBrush x:Key="Brush.AccentHover">#E9BE6A</SolidColorBrush> <!-- hover on brass text and links -->+ <SolidColorBrush x:Key="Brush.AccentDeep">#B08536</SolidColorBrush> <!-- press, left half of the loop -->+ <SolidColorBrush x:Key="Brush.AccentDim">#8A6B2E</SolidColorBrush> <!-- Brass Dim: eyebrows, mono section marks -->+ <SolidColorBrush x:Key="Brush.AccentEdge">#5E4A22</SolidColorBrush> <!-- Brass Edge: chip border, link underline -->+ <SolidColorBrush x:Key="Brush.AccentSubtle">#241F17</SolidColorBrush> <!-- Brass Wash: selected-row ground -->++ <!-- === Semantic: by purpose only === -->+ <SolidColorBrush x:Key="Brush.Record">#C25B44</SolidColorBrush> <!-- active recording. The only claim on red. -->+ <SolidColorBrush x:Key="Brush.RecordInk">#F4E3DC</SolidColorBrush> <!-- the disc on an engaged record button -->+ <SolidColorBrush x:Key="Brush.Danger">#C2554A</SolidColorBrush> <!-- Alert: overload, clipping -->+ <SolidColorBrush x:Key="Brush.DangerHover">#D0685C</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.DangerBright">#E08A72</SolidColorBrush> <!-- Alert Light: overload readout text on dark -->+ <SolidColorBrush x:Key="Brush.DangerSubtle">#33C2554A</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.Warning">#D9C34C</SolidColorBrush> <!-- Caution: meter -6..0 dB -->+ <SolidColorBrush x:Key="Brush.Success">#58B368</SolidColorBrush> <!-- Signal: working meter zone -->+ <SolidColorBrush x:Key="Brush.SuccessDim">#7FB069</SolidColorBrush> <!-- Signal Dim: transport input, metronome -->++ <!-- === Role chromas: inside visualisers only, never on a button ===+ When two or three sources share one graph they take these in order. -->+ <SolidColorBrush x:Key="Brush.ChromaTeal">#5B9E9C</SolidColorBrush> <!-- 2nd layer: lows, early reflections, input -->+ <SolidColorBrush x:Key="Brush.ChromaTealLight">#7FC0BE</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.ChromaRose">#B57286</SolidColorBrush> <!-- 3rd layer: right channel, highs, tail -->+ <SolidColorBrush x:Key="Brush.ChromaRoseLight">#D79BAB</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.ChromaSteel">#6D8FB5</SolidColorBrush> <!-- 4th layer, used rarely --><!-- Retint Fluent's built-in accent (slider fills, checkboxes, focus) tobrass so stock controls match the palette instead of the default blue. -->@@ -92,58 +143,90 @@<Color x:Key="SystemAccentColorDark2">#A87C28</Color><Color x:Key="SystemAccentColorDark3">#8E6820</Color>- <!-- Track palette (8, assigned round-robin), returns, master -->- <SolidColorBrush x:Key="Brush.Track1">#C4756A</SolidColorBrush> <!-- rust -->- <SolidColorBrush x:Key="Brush.Track2">#C99C55</SolidColorBrush> <!-- amber -->- <SolidColorBrush x:Key="Brush.Track3">#9BA65D</SolidColorBrush> <!-- olive -->- <SolidColorBrush x:Key="Brush.Track4">#6FA383</SolidColorBrush> <!-- sage -->- <SolidColorBrush x:Key="Brush.Track5">#5B9E9C</SolidColorBrush> <!-- teal -->- <SolidColorBrush x:Key="Brush.Track6">#6D8FB5</SolidColorBrush> <!-- slate -->- <SolidColorBrush x:Key="Brush.Track7">#9B7FA6</SolidColorBrush> <!-- mauve -->- <SolidColorBrush x:Key="Brush.Track8">#B57286</SolidColorBrush> <!-- rose -->- <SolidColorBrush x:Key="Brush.ReturnA">#7C88A0</SolidColorBrush>- <SolidColorBrush x:Key="Brush.ReturnB">#A08A7C</SolidColorBrush>+ <!-- === Track palette: nine roles, one lightness, no track louder than+ another. A group sets the hue; its tracks take neighbouring shades. -->+ <SolidColorBrush x:Key="Brush.Track1">#58B368</SolidColorBrush> <!-- Drums -->+ <SolidColorBrush x:Key="Brush.Track2">#4E9E7A</SolidColorBrush> <!-- Perc -->+ <SolidColorBrush x:Key="Brush.Track3">#3E8E8E</SolidColorBrush> <!-- Bass -->+ <SolidColorBrush x:Key="Brush.Track4">#5AA0B8</SolidColorBrush> <!-- Keys -->+ <SolidColorBrush x:Key="Brush.Track5">#C77F55</SolidColorBrush> <!-- Texture -->+ <SolidColorBrush x:Key="Brush.Track6">#7A6FB0</SolidColorBrush> <!-- FX -->+ <SolidColorBrush x:Key="Brush.Track7">#B05A7A</SolidColorBrush> <!-- Brass -->+ <SolidColorBrush x:Key="Brush.Track8">#9AA64A</SolidColorBrush> <!-- Vox -->+ <SolidColorBrush x:Key="Brush.Track9">#7FA88E</SolidColorBrush> <!-- Return -->+ <SolidColorBrush x:Key="Brush.ReturnA">#7FA88E</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.ReturnB">#6B907B</SolidColorBrush><SolidColorBrush x:Key="Brush.Master">#D8A03D</SolidColorBrush>++ <!-- Depth: an inner top line, never a drop shadow -->+ <BoxShadows x:Key="Shadow.Sunken">inset 0 1 0 0 #80000000</BoxShadows>+ <BoxShadows x:Key="Shadow.Raised">inset 0 1 0 0 #08FFFFFF</BoxShadows></ResourceDictionary><ResourceDictionary x:Key="Light">- <!-- Surfaces (warm paper; forward still means lighter, wells go darker) -->- <SolidColorBrush x:Key="Brush.SurfaceAbyss">#DCD6C5</SolidColorBrush>+ <!-- Ember Paper. Same hues, same roles, lightness reflected onto the paper+ ground; brass darkens to bronze so a mark carries the same emphasis.+ Derived with NotaPalette.DeriveLight where that reads true, authored by+ hand for the ramps it inverts (ink, brass structure, track hues). -->+ <SolidColorBrush x:Key="Brush.SurfaceAbyss">#D8D1BE</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.BgApp">#DCD6C5</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.Gutter">#E0DAC9</SolidColorBrush><SolidColorBrush x:Key="Brush.BgSunken">#E4DFD1</SolidColorBrush>- <SolidColorBrush x:Key="Brush.BgApp">#EFEADE</SolidColorBrush>- <SolidColorBrush x:Key="Brush.LaneB">#E9E4D6</SolidColorBrush>- <SolidColorBrush x:Key="Brush.SurfaceCard">#F8F5EC</SolidColorBrush>- <SolidColorBrush x:Key="Brush.SurfaceRaised">#FFFEF8</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.Panel">#EAE5D7</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.SurfaceCard">#EFEADE</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.SurfaceRaised">#F8F5EC</SolidColorBrush><SolidColorBrush x:Key="Brush.SurfaceHover">#E7E1D0</SolidColorBrush>- <SolidColorBrush x:Key="Brush.SurfaceActive">#DBD4C0</SolidColorBrush>- <SolidColorBrush x:Key="Brush.SurfaceSelected">#2EA87415</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.TrackOff">#DBD4C0</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.SurfaceActive">#D5CEBB</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.LaneB">#E7E2D4</SolidColorBrush><SolidColorBrush x:Key="Brush.ChromeBg">#E4DFD1</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.SurfaceSelected">#F2E4C4</SolidColorBrush>- <!-- Grid lines — same job, now slightly darker than the lane they sit on -->+ <!-- Lines and frames -->+ <SolidColorBrush x:Key="Brush.Hairline">#D5CFBE</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.BorderDefault">#D5CEBB</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.BorderStrong">#BDB5A0</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.BorderBrass">#C9A254</SolidColorBrush><SolidColorBrush x:Key="Brush.GridBeat">#DED8C8</SolidColorBrush><SolidColorBrush x:Key="Brush.GridBar">#CFC8B4</SolidColorBrush>- <!-- Text (warm near-black) -->+ <!-- Text: warm near-black, same eight steps -->+ <SolidColorBrush x:Key="Brush.TextHeading">#1A150E</SolidColorBrush><SolidColorBrush x:Key="Brush.TextPrimary">#241F17</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.TextStrong">#3E382C</SolidColorBrush><SolidColorBrush x:Key="Brush.TextSecondary">#5E5849</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.TextMuted">#746D5C</SolidColorBrush><SolidColorBrush x:Key="Brush.TextTertiary">#8A8474</SolidColorBrush>- <SolidColorBrush x:Key="Brush.TextDisabled">#ADA694</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.TextDisabled">#9E9786</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.TextAxis">#ADA694</SolidColorBrush><SolidColorBrush x:Key="Brush.TextOnAccent">#FFFBF2</SolidColorBrush>- <!-- Borders -->- <SolidColorBrush x:Key="Brush.BorderDefault">#D5CEBB</SolidColorBrush>- <SolidColorBrush x:Key="Brush.BorderStrong">#BDB5A0</SolidColorBrush>-- <!-- Accent (bronze — brass darkened to hold its emphasis on paper) -->+ <!-- Accent: bronze — brass darkened to hold its emphasis on paper --><SolidColorBrush x:Key="Brush.Accent">#A87415</SolidColorBrush>- <SolidColorBrush x:Key="Brush.AccentHover">#8F6110</SolidColorBrush><SolidColorBrush x:Key="Brush.AccentBright">#744D07</SolidColorBrush>- <SolidColorBrush x:Key="Brush.AccentSubtle">#24A87415</SolidColorBrush>- <SolidColorBrush x:Key="Brush.Success">#2C7A3E</SolidColorBrush>- <SolidColorBrush x:Key="Brush.Warning">#837010</SolidColorBrush>- <SolidColorBrush x:Key="Brush.Danger">#B03A28</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.AccentHover">#8F6110</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.AccentDeep">#7A5008</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.AccentDim">#9C8034</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.AccentEdge">#D3B173</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.AccentSubtle">#F2E4C4</SolidColorBrush>++ <!-- Semantic -->+ <SolidColorBrush x:Key="Brush.Record">#B54A32</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.RecordInk">#FFF4EE</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.Danger">#B13E33</SolidColorBrush><SolidColorBrush x:Key="Brush.DangerHover">#C64A36</SolidColorBrush>- <SolidColorBrush x:Key="Brush.DangerSubtle">#33B03A28</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.DangerBright">#A3391B</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.DangerSubtle">#33B13E33</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.Warning">#837010</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.Success">#2C7A3E</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.SuccessDim">#609548</SolidColorBrush>++ <!-- Role chromas -->+ <SolidColorBrush x:Key="Brush.ChromaTeal">#2F7472</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.ChromaTealLight">#3E8A88</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.ChromaRose">#86465B</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.ChromaRoseLight">#7F2D43</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.ChromaSteel">#3E6288</SolidColorBrush><Color x:Key="SystemAccentColor">#A87415</Color><Color x:Key="SystemAccentColorLight1">#B98219</Color>@@ -153,50 +236,110 @@<Color x:Key="SystemAccentColorDark2">#83590E</Color><Color x:Key="SystemAccentColorDark3">#6F4B0B</Color>- <!-- Track palette — same eight hues, darkened so a clip's content reads on paper -->- <SolidColorBrush x:Key="Brush.Track1">#9A4A3E</SolidColorBrush> <!-- rust -->- <SolidColorBrush x:Key="Brush.Track2">#97682A</SolidColorBrush> <!-- amber -->- <SolidColorBrush x:Key="Brush.Track3">#646E32</SolidColorBrush> <!-- olive -->- <SolidColorBrush x:Key="Brush.Track4">#42765A</SolidColorBrush> <!-- sage -->- <SolidColorBrush x:Key="Brush.Track5">#2F7472</SolidColorBrush> <!-- teal -->- <SolidColorBrush x:Key="Brush.Track6">#3E6288</SolidColorBrush> <!-- slate -->- <SolidColorBrush x:Key="Brush.Track7">#6A5176</SolidColorBrush> <!-- mauve -->- <SolidColorBrush x:Key="Brush.Track8">#86465B</SolidColorBrush> <!-- rose -->- <SolidColorBrush x:Key="Brush.ReturnA">#4D5972</SolidColorBrush>- <SolidColorBrush x:Key="Brush.ReturnB">#705B4E</SolidColorBrush>+ <!-- Track palette — the same nine roles, darkened so a clip's content reads -->+ <SolidColorBrush x:Key="Brush.Track1">#328140</SolidColorBrush> <!-- Drums -->+ <SolidColorBrush x:Key="Brush.Track2">#306F53</SolidColorBrush> <!-- Perc -->+ <SolidColorBrush x:Key="Brush.Track3">#256464</SolidColorBrush> <!-- Bass -->+ <SolidColorBrush x:Key="Brush.Track4">#317187</SolidColorBrush> <!-- Keys -->+ <SolidColorBrush x:Key="Brush.Track5">#985127</SolidColorBrush> <!-- Texture -->+ <SolidColorBrush x:Key="Brush.Track6">#4B4082</SolidColorBrush> <!-- FX -->+ <SolidColorBrush x:Key="Brush.Track7">#7F3450</SolidColorBrush> <!-- Brass -->+ <SolidColorBrush x:Key="Brush.Track8">#6C752C</SolidColorBrush> <!-- Vox -->+ <SolidColorBrush x:Key="Brush.Track9">#4D7A5D</SolidColorBrush> <!-- Return -->+ <SolidColorBrush x:Key="Brush.ReturnA">#4D7A5D</SolidColorBrush>+ <SolidColorBrush x:Key="Brush.ReturnB">#3E6A4D</SolidColorBrush><SolidColorBrush x:Key="Brush.Master">#A87415</SolidColorBrush>++ <BoxShadows x:Key="Shadow.Sunken">inset 0 1 0 0 #1F000000</BoxShadows>+ <BoxShadows x:Key="Shadow.Raised">inset 0 1 0 0 #66FFFFFF</BoxShadows></ResourceDictionary></ResourceDictionary.ThemeDictionaries></ResourceDictionary></Styles.Resources>+ <!-- ===== Motion (almanac § States) =====================================================+ Hover and colour change over 120ms ease-out; nothing moves or scales. Real-time views+ (meters, playhead, spectra) are custom-drawn and never animate. -->+ <Style Selector="Button /template/ ContentPresenter#PART_ContentPresenter, ToggleButton /template/ ContentPresenter#PART_ContentPresenter, ListBoxItem /template/ ContentPresenter#PART_ContentPresenter">+ <Setter Property="Transitions">+ <Transitions>+ <BrushTransition Property="Background" Duration="0:0:0.12" Easing="CubicEaseOut"/>+ <BrushTransition Property="BorderBrush" Duration="0:0:0.12" Easing="CubicEaseOut"/>+ </Transitions>+ </Setter>+ </Style>+ <Style Selector="CheckBox /template/ Border#Track">+ <Setter Property="Transitions">+ <Transitions>+ <BrushTransition Property="Background" Duration="0:0:0.12" Easing="CubicEaseOut"/>+ </Transitions>+ </Setter>+ </Style>+<!-- ===== Buttons ===== --><Style Selector="Button"><!-- Toolbar/transport buttons stay out of the keyboard focus + Tab order so globalhotkeys (Space/R/L/Return/…) always reach the window, never a focused button. --><Setter Property="IsTabStop" Value="False"/><Setter Property="Focusable" Value="False"/>- <Setter Property="Height" Value="{StaticResource Control.Md}"/>+ <Setter Property="Height" Value="{StaticResource Control.Shell}"/><Setter Property="Padding" Value="14,0"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Md}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Control}"/><Setter Property="FontFamily" Value="{StaticResource Font.UI}"/><Setter Property="FontSize" Value="11"/><Setter Property="FontWeight" Value="Medium"/>- <Setter Property="Background" Value="{DynamicResource Brush.SurfaceCard}"/>- <Setter Property="Foreground" Value="{DynamicResource Brush.TextPrimary}"/>- <Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderStrong}"/>+ <Setter Property="Background" Value="{DynamicResource Brush.SurfaceRaised}"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextStrong}"/>+ <Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderDefault}"/><Setter Property="BorderThickness" Value="1"/><Setter Property="VerticalAlignment" Value="Center"/><Setter Property="HorizontalContentAlignment" Value="Center"/><Setter Property="VerticalContentAlignment" Value="Center"/>+ <!-- A raised face carries a 1px inner highlight on top (Shadow.Raised). The presenter+ paints the face, so the highlight rides an overlay above it; styles hide it+ wherever the face is not raised (pressed, solid brass, ghost, engaged). -->+ <Setter Property="Template">+ <ControlTemplate>+ <Panel>+ <ContentPresenter x:Name="PART_ContentPresenter"+ Background="{TemplateBinding Background}"+ BorderBrush="{TemplateBinding BorderBrush}"+ BorderThickness="{TemplateBinding BorderThickness}"+ CornerRadius="{TemplateBinding CornerRadius}"+ Content="{TemplateBinding Content}"+ ContentTemplate="{TemplateBinding ContentTemplate}"+ Padding="{TemplateBinding Padding}"+ Foreground="{TemplateBinding Foreground}"+ RecognizesAccessKey="True"+ HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"+ VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>+ <Border x:Name="PART_Lift" CornerRadius="{TemplateBinding CornerRadius}"+ BoxShadow="{DynamicResource Shadow.Raised}" IsHitTestVisible="False"/>+ </Panel>+ </ControlTemplate>+ </Setter></Style><Style Selector="Button:pointerover /template/ ContentPresenter#PART_ContentPresenter"><Setter Property="Background" Value="{DynamicResource Brush.SurfaceHover}"/><Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderStrong}"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextPrimary}"/></Style>+ <!-- Pressed goes into the recess: the ground changes, nothing moves. --><Style Selector="Button:pressed /template/ ContentPresenter#PART_ContentPresenter"><Setter Property="Background" Value="{DynamicResource Brush.SurfaceActive}"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.AccentDeep}"/>+ </Style>+ <Style Selector="Button:pressed /template/ Border#PART_Lift, Button:disabled /template/ Border#PART_Lift,+ Button.primary /template/ Border#PART_Lift, Button.ghost /template/ Border#PART_Lift,+ Button.tp-play /template/ Border#PART_Lift, Button.cell /template/ Border#PART_Lift">+ <Setter Property="IsVisible" Value="False"/>+ </Style>+ <!-- Disabled: the ground drops to the panel colour and the text to Ink 6 — never opacity. -->+ <Style Selector="Button:disabled /template/ ContentPresenter#PART_ContentPresenter">+ <Setter Property="Background" Value="{DynamicResource Brush.Panel}"/>+ <Setter Property="BorderBrush" Value="{DynamicResource Brush.Hairline}"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextDisabled}"/></Style><Style Selector="Button.primary">@@ -217,43 +360,75 @@<Setter Property="Background" Value="{DynamicResource Brush.SurfaceHover}"/></Style>- <Style Selector="Button.danger">- <Setter Property="Background" Value="{DynamicResource Brush.Danger}"/>- <Setter Property="Foreground" Value="{DynamicResource Brush.TextOnAccent}"/>- <Setter Property="BorderThickness" Value="0"/>- </Style>- <Style Selector="Button.danger:pointerover /template/ ContentPresenter#PART_ContentPresenter">- <Setter Property="Background" Value="{DynamicResource Brush.DangerHover}"/>- </Style>+ <!-- .danger no longer paints red: the almanac gives red to recording alone. A destructive+ action is an ordinary raised button; its label says what it does. --><!-- ===== Toggle buttons ===== --><Style Selector="ToggleButton"><Setter Property="IsTabStop" Value="False"/><Setter Property="Focusable" Value="False"/>- <Setter Property="Height" Value="{StaticResource Control.Md}"/>+ <Setter Property="Height" Value="{StaticResource Control.Shell}"/><Setter Property="Padding" Value="12,0"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Md}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Control}"/><Setter Property="FontFamily" Value="{StaticResource Font.UI}"/><Setter Property="FontSize" Value="11"/><Setter Property="FontWeight" Value="Medium"/>- <Setter Property="Background" Value="{DynamicResource Brush.SurfaceCard}"/>- <Setter Property="Foreground" Value="{DynamicResource Brush.TextSecondary}"/>- <Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderStrong}"/>+ <Setter Property="Background" Value="{DynamicResource Brush.SurfaceRaised}"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextStrong}"/>+ <Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderDefault}"/><Setter Property="BorderThickness" Value="1"/><Setter Property="VerticalAlignment" Value="Center"/><Setter Property="HorizontalContentAlignment" Value="Center"/><Setter Property="VerticalContentAlignment" Value="Center"/>+ <!-- A raised face carries a 1px inner highlight on top (Shadow.Raised). The presenter+ paints the face, so the highlight rides an overlay above it; styles hide it+ wherever the face is not raised (pressed, solid brass, ghost, engaged). -->+ <Setter Property="Template">+ <ControlTemplate>+ <Panel>+ <ContentPresenter x:Name="PART_ContentPresenter"+ Background="{TemplateBinding Background}"+ BorderBrush="{TemplateBinding BorderBrush}"+ BorderThickness="{TemplateBinding BorderThickness}"+ CornerRadius="{TemplateBinding CornerRadius}"+ Content="{TemplateBinding Content}"+ ContentTemplate="{TemplateBinding ContentTemplate}"+ Padding="{TemplateBinding Padding}"+ Foreground="{TemplateBinding Foreground}"+ RecognizesAccessKey="True"+ HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"+ VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>+ <Border x:Name="PART_Lift" CornerRadius="{TemplateBinding CornerRadius}"+ BoxShadow="{DynamicResource Shadow.Raised}" IsHitTestVisible="False"/>+ </Panel>+ </ControlTemplate>+ </Setter>+ </Style>+ <Style Selector="ToggleButton:checked /template/ Border#PART_Lift, ToggleButton:pressed /template/ Border#PART_Lift,+ ToggleButton:disabled /template/ Border#PART_Lift, ToggleButton.seg /template/ Border#PART_Lift,+ ToggleButton.cell /template/ Border#PART_Lift">+ <Setter Property="IsVisible" Value="False"/>+ </Style>+ <Style Selector="ToggleButton:pressed /template/ ContentPresenter#PART_ContentPresenter">+ <Setter Property="Background" Value="{DynamicResource Brush.SurfaceActive}"/>+ </Style>+ <Style Selector="ToggleButton:disabled /template/ ContentPresenter#PART_ContentPresenter">+ <Setter Property="Background" Value="{DynamicResource Brush.Panel}"/>+ <Setter Property="BorderBrush" Value="{DynamicResource Brush.Hairline}"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextDisabled}"/></Style><Style Selector="ToggleButton:pointerover /template/ ContentPresenter#PART_ContentPresenter"><Setter Property="Background" Value="{DynamicResource Brush.SurfaceHover}"/><Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderStrong}"/></Style>+ <!-- Engaged: brass edge and brass ink on the wash. Solid brass is kept for the one+ primary action in a context. --><Style Selector="ToggleButton:checked /template/ ContentPresenter#PART_ContentPresenter"><Setter Property="Background" Value="{DynamicResource Brush.AccentSubtle}"/>- <Setter Property="BorderBrush" Value="{DynamicResource Brush.Accent}"/>+ <Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderBrass}"/></Style><Style Selector="ToggleButton:checked">- <Setter Property="Foreground" Value="{DynamicResource Brush.AccentBright}"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.AccentHover}"/></Style><!-- Record: danger tint when engaged --><Style Selector="ToggleButton.danger:checked /template/ ContentPresenter#PART_ContentPresenter">@@ -267,25 +442,33 @@<!-- ===== Transport / toolbar chrome (mockup 1b) ===== --><!-- 28px icon transport buttons on surface-1 --><Style Selector="Button.tp-icon, ToggleButton.tp-icon">- <Setter Property="Width" Value="28"/>- <Setter Property="Height" Value="28"/>+ <Setter Property="Width" Value="{StaticResource Control.Transport}"/>+ <Setter Property="Height" Value="{StaticResource Control.Transport}"/><Setter Property="Padding" Value="0"/><Setter Property="FontSize" Value="11"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Sm}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Tile}"/><Setter Property="Background" Value="{DynamicResource Brush.SurfaceRaised}"/><Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderStrong}"/><Setter Property="BorderThickness" Value="1"/></Style><!-- Record engaged: translucent danger box, red glyph stays visible -->+ <!-- Record: at rest a neutral button with a red disc; engaged, solid record red with a+ pale disc. The only place red fills a control. -->+ <Style Selector="ToggleButton.tp-icon.rec">+ <Setter Property="Foreground" Value="{DynamicResource Brush.Record}"/>+ </Style><Style Selector="ToggleButton.tp-icon.rec:checked /template/ ContentPresenter#PART_ContentPresenter">- <Setter Property="Background" Value="{DynamicResource Brush.DangerSubtle}"/>- <Setter Property="BorderBrush" Value="{DynamicResource Brush.Danger}"/>+ <Setter Property="Background" Value="{DynamicResource Brush.Record}"/>+ <Setter Property="BorderBrush" Value="{DynamicResource Brush.Record}"/>+ </Style>+ <Style Selector="ToggleButton.tp-icon.rec:checked">+ <Setter Property="Foreground" Value="{DynamicResource Brush.RecordInk}"/></Style><Style Selector="Button.tp-play">- <Setter Property="Width" Value="34"/>- <Setter Property="Height" Value="28"/>+ <Setter Property="Width" Value="{StaticResource Control.Play}"/>+ <Setter Property="Height" Value="{StaticResource Control.Transport}"/><Setter Property="Padding" Value="0"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Sm}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Tile}"/><Setter Property="Background" Value="{DynamicResource Brush.Accent}"/><Setter Property="BorderThickness" Value="0"/></Style>@@ -299,9 +482,9 @@<!-- Bordered pill chips (Metro / Snap / add-track etc.), 28px --><Style Selector="Button.chip, ToggleButton.chip">- <Setter Property="Height" Value="28"/>+ <Setter Property="Height" Value="{StaticResource Control.Shell}"/><Setter Property="Padding" Value="9,0"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Sm}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Control}"/><Setter Property="FontSize" Value="11"/><Setter Property="Background" Value="{DynamicResource Brush.SurfaceRaised}"/><Setter Property="Foreground" Value="{DynamicResource Brush.TextSecondary}"/>@@ -325,11 +508,12 @@<!-- bg-sunken well (position / BPM / time-sig) --><Style Selector="Border.well">+ <Setter Property="BoxShadow" Value="{DynamicResource Shadow.Sunken}"/><Setter Property="Height" Value="28"/><Setter Property="Background" Value="{DynamicResource Brush.BgSunken}"/><Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderDefault}"/><Setter Property="BorderThickness" Value="1"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Sm}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Control}"/><Setter Property="Padding" Value="10,0"/><Setter Property="VerticalAlignment" Value="Center"/></Style>@@ -360,13 +544,17 @@<!-- Transport console (mockup 1b): a recess cut into the chrome holding thetransport buttons, the position readout and the loop range, so playback readsas one object instead of three neighbours. -->- <Style Selector="Border.console">- <Setter Property="Height" Value="42"/>+ <!-- The transport strip: one 42px recess on Void across the bottom of the window. -->+ <Style Selector="Border.transport"><Setter Property="Background" Value="{DynamicResource Brush.SurfaceAbyss}"/><Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderDefault}"/>- <Setter Property="BorderThickness" Value="1"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Md}"/>- <Setter Property="Padding" Value="11,0,13,0"/>+ <Setter Property="BorderThickness" Value="0,0,0,1"/>+ <Setter Property="BoxShadow" Value="{DynamicResource Shadow.Sunken}"/>+ </Style>+ <!-- Transport · position · loop: grouped inside the strip; the strip is the recess. -->+ <Style Selector="Border.console">+ <Setter Property="Background" Value="Transparent"/>+ <Setter Property="Padding" Value="0,0,4,0"/><Setter Property="VerticalAlignment" Value="Center"/></Style>@@ -376,7 +564,7 @@<Style Selector="Button.cell, ToggleButton.cell"><Setter Property="Height" Value="34"/><Setter Property="Padding" Value="7,0"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Sm}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Control}"/><Setter Property="Background" Value="Transparent"/><Setter Property="BorderThickness" Value="0"/><Setter Property="Foreground" Value="{DynamicResource Brush.TextTertiary}"/>@@ -398,17 +586,18 @@<!-- Segmented control (Arrangement / Session view switch) --><Style Selector="Border.segmented">+ <Setter Property="BoxShadow" Value="{DynamicResource Shadow.Sunken}"/><Setter Property="Background" Value="{DynamicResource Brush.BgSunken}"/><Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderDefault}"/><Setter Property="BorderThickness" Value="1"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Sm}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Tile}"/><Setter Property="Padding" Value="2"/><Setter Property="VerticalAlignment" Value="Center"/></Style><Style Selector="ToggleButton.seg">- <Setter Property="Height" Value="22"/>+ <Setter Property="Height" Value="{StaticResource Control.Seg}"/><Setter Property="Padding" Value="10,0"/>- <Setter Property="CornerRadius" Value="3"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Badge}"/><Setter Property="FontSize" Value="11"/><Setter Property="Background" Value="Transparent"/><Setter Property="BorderThickness" Value="0"/>@@ -426,7 +615,6 @@</Style><Style Selector="ToggleButton.seg:disabled"><Setter Property="Foreground" Value="{DynamicResource Brush.TextDisabled}"/>- <Setter Property="Opacity" Value="0.55"/></Style><!-- ===== ComboBox — bg-sunken well (mockup 1h/1i fields) ===== -->@@ -434,7 +622,7 @@<Setter Property="Height" Value="28"/><Setter Property="MinHeight" Value="0"/><Setter Property="Padding" Value="9,0"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Sm}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Control}"/><Setter Property="FontSize" Value="11"/><Setter Property="Background" Value="{DynamicResource Brush.BgSunken}"/><Setter Property="Foreground" Value="{DynamicResource Brush.TextPrimary}"/>@@ -447,7 +635,7 @@<Setter Property="Background" Value="{DynamicResource Brush.BgSunken}"/><Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderDefault}"/><Setter Property="BorderThickness" Value="1"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Sm}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Control}"/></Style><Style Selector="ComboBox:pointerover /template/ Border#Background"><Setter Property="Background" Value="{DynamicResource Brush.BgSunken}"/>@@ -478,29 +666,28 @@<Setter Property="Background" Value="{DynamicResource Brush.AccentSubtle}"/></Style>- <!-- ===== CheckBox — design-system box (brass fill + dark tick when on).- Full template so it renders exactly like the export dialog's checkbox- (16px Radius.Sm box, Viewbox-centred tick) instead of the Fluent default. -->+ <!-- ===== CheckBox — drawn as the almanac switch ==============================+ The almanac has no checkbox: an on/off choice is an 18×10 pill with a 7px knob+ inset 1.5, and its word sits to the right — 11px regular in the shell. State reads+ from colour and from the knob's position. Disabled takes the next ink step and the+ panel ground, never opacity. --><Style Selector="CheckBox"><Setter Property="FontFamily" Value="{StaticResource Font.UI}"/><Setter Property="FontSize" Value="11"/><Setter Property="Foreground" Value="{DynamicResource Brush.TextSecondary}"/><Setter Property="VerticalContentAlignment" Value="Center"/><Setter Property="MinHeight" Value="0"/>+ <Setter Property="Cursor" Value="Hand"/><Setter Property="Template"><ControlTemplate>- <Grid ColumnDefinitions="Auto,*">- <Border x:Name="Box" Width="16" Height="16" VerticalAlignment="Center"- CornerRadius="{StaticResource Radius.Sm}"- Background="{DynamicResource Brush.BgSunken}"- BorderBrush="{DynamicResource Brush.BorderStrong}"- BorderThickness="1">- <Viewbox Width="9" Height="7" Stretch="Uniform"- HorizontalAlignment="Center" VerticalAlignment="Center">- <Path x:Name="Check" Data="M0 3.5 L3.2 6.7 L9 0" IsVisible="False"- Stroke="{DynamicResource Brush.TextOnAccent}" StrokeThickness="1.6"- StrokeLineCap="Round" StrokeJoin="Round"/>- </Viewbox>+ <Grid ColumnDefinitions="Auto,*" Background="Transparent">+ <Border x:Name="Track" Width="18" Height="10" VerticalAlignment="Center"+ CornerRadius="{StaticResource Radius.Pill}"+ Background="{DynamicResource Brush.TrackOff}"+ BorderBrush="Transparent" BorderThickness="1">+ <Ellipse x:Name="Knob" Width="7" Height="7" HorizontalAlignment="Left"+ VerticalAlignment="Center" Margin="0.5,0,0,0"+ Fill="{DynamicResource Brush.TextTertiary}"/></Border><ContentPresenter x:Name="PART_ContentPresenter" Grid.Column="1"Margin="8,0,0,0" VerticalAlignment="Center"@@ -512,25 +699,36 @@</ControlTemplate></Setter></Style>- <Style Selector="CheckBox:checked /template/ Border#Box">+ <Style Selector="CheckBox:checked /template/ Border#Track"><Setter Property="Background" Value="{DynamicResource Brush.Accent}"/>- <Setter Property="BorderBrush" Value="{DynamicResource Brush.Accent}"/></Style>- <Style Selector="CheckBox:checked /template/ Path#Check">- <Setter Property="IsVisible" Value="True"/>+ <Style Selector="CheckBox:checked /template/ Ellipse#Knob">+ <Setter Property="HorizontalAlignment" Value="Right"/>+ <Setter Property="Margin" Value="0,0,0.5,0"/>+ <Setter Property="Fill" Value="{DynamicResource Brush.Panel}"/></Style>- <Style Selector="CheckBox:indeterminate /template/ Border#Box">- <Setter Property="Background" Value="{DynamicResource Brush.Accent}"/>- <Setter Property="BorderBrush" Value="{DynamicResource Brush.Accent}"/>+ <Style Selector="CheckBox:indeterminate /template/ Border#Track">+ <Setter Property="Background" Value="{DynamicResource Brush.BorderStrong}"/>+ </Style>+ <Style Selector="CheckBox:indeterminate /template/ Ellipse#Knob">+ <Setter Property="HorizontalAlignment" Value="Center"/>+ <Setter Property="Margin" Value="0"/></Style><Style Selector="CheckBox:checked"><Setter Property="Foreground" Value="{DynamicResource Brush.TextPrimary}"/></Style>- <Style Selector="CheckBox:pointerover /template/ Border#Box">- <Setter Property="BorderBrush" Value="{DynamicResource Brush.Accent}"/>+ <Style Selector="CheckBox:pointerover">+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextPrimary}"/></Style><Style Selector="CheckBox:disabled">- <Setter Property="Opacity" Value="0.5"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextDisabled}"/>+ </Style>+ <Style Selector="CheckBox:disabled /template/ Border#Track">+ <Setter Property="Background" Value="{DynamicResource Brush.Panel}"/>+ <Setter Property="BorderBrush" Value="{DynamicResource Brush.Hairline}"/>+ </Style>+ <Style Selector="CheckBox:disabled /template/ Ellipse#Knob">+ <Setter Property="Fill" Value="{DynamicResource Brush.TextDisabled}"/></Style><!-- ===== Form text field (bg-sunken well, matches the ComboBox field) =====@@ -541,80 +739,161 @@<Setter Property="MinHeight" Value="0"/><Setter Property="Padding" Value="9,0"/><Setter Property="FontSize" Value="11"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Sm}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Control}"/><Setter Property="Background" Value="{DynamicResource Brush.BgSunken}"/><Setter Property="Foreground" Value="{DynamicResource Brush.TextPrimary}"/><Setter Property="CaretBrush" Value="{DynamicResource Brush.AccentBright}"/><Setter Property="VerticalContentAlignment" Value="Center"/></Style><Style Selector="TextBox.field /template/ Border#PART_BorderElement">+ <Setter Property="BoxShadow" Value="{DynamicResource Shadow.Sunken}"/><Setter Property="Background" Value="{DynamicResource Brush.BgSunken}"/><Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderDefault}"/><Setter Property="BorderThickness" Value="1"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Sm}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Control}"/><Setter Property="MinHeight" Value="0"/></Style><Style Selector="TextBox.field:pointerover /template/ Border#PART_BorderElement"><Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderStrong}"/></Style><Style Selector="TextBox.field:focus /template/ Border#PART_BorderElement">- <Setter Property="BorderBrush" Value="{DynamicResource Brush.Accent}"/>+ <Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderBrass}"/></Style>- <!-- ===== Keyboard focus: 1px AccentBright ring (HANDOFF §4) ===== -->+ <!-- ===== Keyboard focus: a brass edge, no ring and no glow (almanac § States) ===== --><Style Selector="Button:focus-visible /template/ ContentPresenter#PART_ContentPresenter">- <Setter Property="BorderBrush" Value="{DynamicResource Brush.AccentBright}"/>+ <Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderBrass}"/><Setter Property="BorderThickness" Value="1"/></Style><Style Selector="ToggleButton:focus-visible /template/ ContentPresenter#PART_ContentPresenter">- <Setter Property="BorderBrush" Value="{DynamicResource Brush.AccentBright}"/>+ <Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderBrass}"/><Setter Property="BorderThickness" Value="1"/></Style><Style Selector="ComboBox:focus-visible /template/ Border#Background">- <Setter Property="BorderBrush" Value="{DynamicResource Brush.AccentBright}"/>+ <Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderBrass}"/></Style>- <Style Selector="CheckBox:focus-visible /template/ Border#Box">- <Setter Property="BorderBrush" Value="{DynamicResource Brush.AccentBright}"/>+ <Style Selector="CheckBox:focus-visible /template/ Border#Track">+ <Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderBrass}"/></Style><!-- ===== Text roles ===== -->- <Style Selector="TextBlock.Caption">- <Setter Property="FontSize" Value="10"/>- <Setter Property="Foreground" Value="{DynamicResource Brush.TextSecondary}"/>+ <!-- ===== Type ============================================================+ Two scales. The shell scale runs 26 · 13 · 12 · 11 · 10; a device lives in 260px,+ so its scale sits two or three steps lower (12 · 9 · 8 · 7). 7px is the floor and+ only for a caps label — if a caption does not fit, the layout shrinks, not the type.+ Mono means measurement; prose never takes it. Caps and tracking are part of the+ role: the strings are uppercased at the call site, the tracking lives here.+ Mirrored as constants in Theme/NotaFonts.cs (NotaType). -->++ <!-- Shell scale -->+ <Style Selector="TextBlock.Title"> <!-- section title: 26 / 600 / −.015em -->+ <Setter Property="FontSize" Value="26"/>+ <Setter Property="FontWeight" Value="SemiBold"/>+ <Setter Property="LetterSpacing" Value="-0.39"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextHeading}"/>+ </Style>+ <Style Selector="TextBlock.Heading"> <!-- project name in the header: 13 / 600 -->+ <Setter Property="FontSize" Value="13"/>+ <Setter Property="FontWeight" Value="SemiBold"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextPrimary}"/>+ </Style>+ <Style Selector="TextBlock.Name"> <!-- track, preset, file name: 12 / 500 -->+ <Setter Property="FontSize" Value="12"/>+ <Setter Property="FontWeight" Value="Medium"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextPrimary}"/>+ </Style>+ <Style Selector="TextBlock.Caption"> <!-- explanation, hint: 11 / 400 / 1.65 -->+ <Setter Property="FontSize" Value="11"/>+ <Setter Property="FontWeight" Value="Normal"/>+ <Setter Property="LineHeight" Value="18"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextMuted}"/></Style>- <Style Selector="TextBlock.SectionLabel">+ <Style Selector="TextBlock.SectionLabel"> <!-- panel group heading: 10 / 700 / .14em caps --><Setter Property="FontSize" Value="10"/><Setter Property="FontWeight" Value="Bold"/>+ <Setter Property="LetterSpacing" Value="1.4"/><Setter Property="Foreground" Value="{DynamicResource Brush.TextTertiary}"/></Style>- <!-- The tracked caption under a transport readout cell (BPM / SIG / GRID / LOOP).- Smaller and dimmer than SectionLabel so the value above it leads. -->- <Style Selector="TextBlock.CellLabel">+ <!-- The caption under a transport readout (BPM / SIG / GRID / LOOP). It labels a+ parameter, so it takes the device label role rather than the shell group heading:+ smaller and dimmer so the value above it leads. -->+ <Style Selector="TextBlock.CellLabel"> <!-- 8 / 700 / .1em caps -->+ <Setter Property="FontFamily" Value="{StaticResource Font.UI}"/><Setter Property="FontSize" Value="8"/><Setter Property="FontWeight" Value="Bold"/><Setter Property="LetterSpacing" Value="0.8"/><Setter Property="LineHeight" Value="10"/><Setter Property="Foreground" Value="{DynamicResource Brush.TextTertiary}"/></Style>- <Style Selector="TextBlock.Mono">+ <Style Selector="TextBlock.Mono"> <!-- family only; size comes from the role --><Setter Property="FontFamily" Value="{StaticResource Font.Mono}"/></Style>- <Style Selector="TextBlock.Heading">+ <Style Selector="TextBlock.Readout"> <!-- transport position and tempo: mono 13 / 500 -->+ <Setter Property="FontFamily" Value="{StaticResource Font.Mono}"/><Setter Property="FontSize" Value="13"/>+ <Setter Property="FontWeight" Value="Medium"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextStrong}"/>+ </Style>+ <Style Selector="TextBlock.Value"> <!-- value in a row, metadata: mono 10 / 400 -->+ <Setter Property="FontFamily" Value="{StaticResource Font.Mono}"/>+ <Setter Property="FontSize" Value="10"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextSecondary}"/>+ </Style>+ <Style Selector="TextBlock.Eyebrow"> <!-- eyebrow, format badge: mono 9 / 500 / .18em caps -->+ <Setter Property="FontFamily" Value="{StaticResource Font.Mono}"/>+ <Setter Property="FontSize" Value="9"/>+ <Setter Property="FontWeight" Value="Medium"/>+ <Setter Property="LetterSpacing" Value="1.62"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.AccentDim}"/>+ </Style>++ <!-- Device scale (inside a 260px card) -->+ <Style Selector="TextBlock.DeviceName"> <!-- 12 / 600 -->+ <Setter Property="FontSize" Value="12"/><Setter Property="FontWeight" Value="SemiBold"/><Setter Property="Foreground" Value="{DynamicResource Brush.TextPrimary}"/></Style>+ <Style Selector="TextBlock.DeviceSection"> <!-- 9 / 700 / .12em caps -->+ <Setter Property="FontSize" Value="9"/>+ <Setter Property="FontWeight" Value="Bold"/>+ <Setter Property="LetterSpacing" Value="1.08"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextTertiary}"/>+ </Style>+ <Style Selector="TextBlock.RowLabel"> <!-- slider-row label: 8 / 700 / .1em caps -->+ <Setter Property="FontSize" Value="8"/>+ <Setter Property="FontWeight" Value="Bold"/>+ <Setter Property="LetterSpacing" Value="0.8"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextTertiary}"/>+ </Style>+ <Style Selector="TextBlock.KnobLabel"> <!-- under a knob: 7 / 700 / .08em caps — the floor -->+ <Setter Property="FontSize" Value="7"/>+ <Setter Property="FontWeight" Value="Bold"/>+ <Setter Property="LetterSpacing" Value="0.56"/>+ <Setter Property="LineHeight" Value="9"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextTertiary}"/>+ </Style>+ <Style Selector="TextBlock.KnobValue"> <!-- parameter value: mono 7 -->+ <Setter Property="FontFamily" Value="{StaticResource Font.Mono}"/>+ <Setter Property="FontSize" Value="7"/>+ <Setter Property="LineHeight" Value="10"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextPrimary}"/>+ </Style>+ <Style Selector="TextBlock.Axis"> <!-- axis label inside a graph: mono 7 -->+ <Setter Property="FontFamily" Value="{StaticResource Font.Mono}"/>+ <Setter Property="FontSize" Value="7"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextAxis}"/>+ </Style><!-- ===== Containers ===== --><Style Selector="Border.Card"><Setter Property="Background" Value="{DynamicResource Brush.SurfaceCard}"/><Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderDefault}"/><Setter Property="BorderThickness" Value="1"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Lg}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Panel}"/><Setter Property="Padding" Value="10"/></Style><Style Selector="Border.Panel">- <Setter Property="Background" Value="{DynamicResource Brush.SurfaceCard}"/>+ <Setter Property="Background" Value="{DynamicResource Brush.Panel}"/><Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderDefault}"/><Setter Property="BorderThickness" Value="0,0,0,1"/></Style>@@ -624,14 +903,16 @@<Setter Property="Background" Value="{DynamicResource Brush.BgSunken}"/><Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderDefault}"/><Setter Property="BorderThickness" Value="1"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Md}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Panel}"/></Style>+ <!-- A list row: 26px, one line of text (almanac § layout). --><Style Selector="ListBoxItem"><Setter Property="FontSize" Value="11"/><Setter Property="Foreground" Value="{DynamicResource Brush.TextSecondary}"/>- <Setter Property="Padding" Value="8,5"/>- <Setter Property="MinHeight" Value="0"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Md}"/>+ <Setter Property="Padding" Value="8,0"/>+ <Setter Property="MinHeight" Value="{StaticResource Control.Shell}"/>+ <Setter Property="VerticalContentAlignment" Value="Center"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Control}"/></Style><Style Selector="ListBoxItem:selected /template/ ContentPresenter#PART_ContentPresenter"><Setter Property="Background" Value="{DynamicResource Brush.SurfaceSelected}"/>@@ -687,7 +968,7 @@<Setter Property="Background" Value="Transparent"/><Setter Property="Width" Value="2"/><Setter Property="Margin" Value="0,6"/>- <Setter Property="CornerRadius" Value="1"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Clip}"/><Setter Property="HorizontalAlignment" Value="Left"/></Style><Style Selector="Border.RailTab.active Border.RailBar">@@ -724,7 +1005,7 @@<Setter Property="Background" Value="{DynamicResource Brush.Accent}"/></Style><Style Selector="TextBlock.RowName">- <Setter Property="FontSize" Value="11"/>+ <Setter Property="FontSize" Value="12"/><Setter Property="FontWeight" Value="Medium"/><Setter Property="Foreground" Value="{DynamicResource Brush.TextPrimary}"/></Style>@@ -736,17 +1017,19 @@<Setter Property="FontSize" Value="11"/><Setter Property="Foreground" Value="{DynamicResource Brush.TextTertiary}"/></Style>+ <!-- Row metadata on the right: mono, like every other measurement-ish value. --><Style Selector="TextBlock.RowTag">- <Setter Property="FontSize" Value="9"/>+ <Setter Property="FontFamily" Value="{StaticResource Font.Mono}"/>+ <Setter Property="FontSize" Value="10"/><Setter Property="Foreground" Value="{DynamicResource Brush.TextTertiary}"/></Style><Style Selector="ListBoxItem:selected TextBlock.RowTag"><Setter Property="Foreground" Value="{DynamicResource Brush.TextSecondary}"/></Style><Style Selector="TextBlock.GroupLabel">- <Setter Property="FontSize" Value="9"/>+ <Setter Property="FontSize" Value="10"/><Setter Property="FontWeight" Value="Bold"/>- <Setter Property="LetterSpacing" Value="0.9"/>+ <Setter Property="LetterSpacing" Value="1.4"/><Setter Property="Foreground" Value="{DynamicResource Brush.TextTertiary}"/></Style>@@ -784,14 +1067,14 @@<Setter Property="Background" Value="{DynamicResource Brush.SurfaceCard}"/><Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderDefault}"/><Setter Property="BorderThickness" Value="1"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Md}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Control}"/><Setter Property="Padding" Value="4"/></Style><Style Selector="ContextMenu"><Setter Property="Background" Value="{DynamicResource Brush.SurfaceCard}"/><Setter Property="BorderBrush" Value="{DynamicResource Brush.BorderDefault}"/><Setter Property="BorderThickness" Value="1"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Md}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Control}"/><Setter Property="Padding" Value="4"/></Style>@@ -804,7 +1087,7 @@on highlight (Avalonia marks the hovered flyout item :selected). --><Style Selector="MenuItem /template/ Border#PART_LayoutRoot"><Setter Property="Background" Value="Transparent"/>- <Setter Property="CornerRadius" Value="{StaticResource Radius.Sm}"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Badge}"/><Setter Property="Margin" Value="2,1"/></Style><Style Selector="MenuItem:selected /template/ Border#PART_LayoutRoot">@@ -838,7 +1121,7 @@</Style><Style Selector="ScrollBar /template/ Thumb"><Setter Property="Background" Value="{DynamicResource Brush.BorderStrong}"/>- <Setter Property="CornerRadius" Value="4"/>+ <Setter Property="CornerRadius" Value="{StaticResource Radius.Pill}"/><Setter Property="MinWidth" Value="5"/><Setter Property="MinHeight" Value="5"/></Style>diff --git a/src/managed/Nota.App/WelcomeWindow.cs b/src/managed/Nota.App/WelcomeWindow.csindex d09b3edf..86ecbe60 100644--- a/src/managed/Nota.App/WelcomeWindow.cs+++ b/src/managed/Nota.App/WelcomeWindow.cs@@ -219,8 +219,7 @@ public sealed class WelcomeWindow : NotaWindowvar recover = new Button{- Content = "Recover",- Classes = { "primary" },+ Content = "Recover", // not solid brass: "New project" is this window's primary actionVerticalAlignment = VerticalAlignment.Center,Margin = new Thickness(12, 0, 0, 0),};@@ -247,7 +246,7 @@ public sealed class WelcomeWindow : NotaWindowBackground = NotaPalette.AccentSubtle,BorderBrush = NotaPalette.Accent,BorderThickness = new Thickness(1),- CornerRadius = new CornerRadius(7),+ CornerRadius = NotaRadius.Panel,Padding = new Thickness(14, 12),Margin = new Thickness(28, 16, 28, 0),Child = grid,diff --git a/src/managed/Nota.App/WhatsNewWindow.cs b/src/managed/Nota.App/WhatsNewWindow.csindex 84a87940..52dfd8d2 100644--- a/src/managed/Nota.App/WhatsNewWindow.cs+++ b/src/managed/Nota.App/WhatsNewWindow.cs@@ -137,5 +137,5 @@ public sealed class WhatsNewWindow : NotaWindow}private IBrush Brush(string key)- => (IBrush?)NotaPalette.ByKey(key) ?? Brushes.Magenta;+ => (IBrush?)NotaPalette.ByKey(key) ?? NotaPalette.TextPrimary;}diff --git a/src/managed/Nota.Presentation/ViewModels/MainWindowViewModel.cs b/src/managed/Nota.Presentation/ViewModels/MainWindowViewModel.csindex 50efcea0..2ff6b40f 100644--- a/src/managed/Nota.Presentation/ViewModels/MainWindowViewModel.cs+++ b/src/managed/Nota.Presentation/ViewModels/MainWindowViewModel.cs@@ -66,8 +66,8 @@ public sealed partial class MainWindowViewModel : ObservableObject, IDisposableEngine.SetBpm(120);Engine.SetTimeSignature(4, 4);// EngineInfo = $"v{_build.Version} · {Engine.SampleRate:0} Hz";- EngineInfo = $"{Engine.SampleRate:0} Hz";- _log.Info($"Engine started · {Engine.SampleRate:0} Hz");+ EngineInfo = $"{Engine.SampleRate:0}\u2009Hz";+ _log.Info($"Engine started · {Engine.SampleRate:0}\u2009Hz");Transport.Message += m => { if (m.Length > 0) StatusText = m; };@@ -138,9 +138,9 @@ public sealed partial class MainWindowViewModel : ObservableObject, IDisposableSuspendEnginePolling = false;}- EngineInfo = $"v{_build.Version} · {Engine.SampleRate:0} Hz";+ EngineInfo = $"v{_build.Version} · {Engine.SampleRate:0}\u2009Hz";int buf = Engine.NegotiatedBufferFrames;- _log.Info($"Audio applied · {Engine.NegotiatedSampleRate:0} Hz · {buf} frames");+ _log.Info($"Audio applied · {Engine.NegotiatedSampleRate:0}\u2009Hz · {buf} frames");bool fallback = Engine.AudioExclusiveFallback;if (fallback){@@ -149,8 +149,8 @@ public sealed partial class MainWindowViewModel : ObservableObject, IDisposablereturn StatusText;}StatusText = buf > 0- ? $"Audio: {Engine.NegotiatedSampleRate:0} Hz · {buf} frames"- : $"Audio: {Engine.NegotiatedSampleRate:0} Hz";+ ? $"Audio: {Engine.NegotiatedSampleRate:0}\u2009Hz · {buf} frames"+ : $"Audio: {Engine.NegotiatedSampleRate:0}\u2009Hz";return StatusText;}diff --git a/src/managed/Nota.Presentation/ViewModels/TransportViewModel.cs b/src/managed/Nota.Presentation/ViewModels/TransportViewModel.csindex eaba41fd..985d776f 100644--- a/src/managed/Nota.Presentation/ViewModels/TransportViewModel.cs+++ b/src/managed/Nota.Presentation/ViewModels/TransportViewModel.cs@@ -25,7 +25,7 @@ public partial class TransportViewModel(IAudioEngine engine) : ObservableObject[ObservableProperty] private int _timeSigNumerator = 4;[ObservableProperty] private int _timeSigDenominator = 4;[ObservableProperty] private double _masterVolume = 1.0;- [ObservableProperty] private string _masterDbText = "0.0 dB";+ [ObservableProperty] private string _masterDbText = "0.0\u2009dB";[ObservableProperty] private bool _metronomeOn;[ObservableProperty] private bool _loopOn;[ObservableProperty] private string _loopRangeText = "1.1 – 5.1";@@ -57,8 +57,8 @@ public partial class TransportViewModel(IAudioEngine engine) : ObservableObject// Show the gain the fader is actually applying. Silence has no dB value, so it// gets the symbol rather than a very large negative number.MasterDbText = value <= 1e-4- ? "-\u221e dB"- : (20.0 * Math.Log10(value)).ToString("0.0", CultureInfo.InvariantCulture) + " dB";+ ? "\u2212\u221e\u2009dB"+ : (20.0 * Math.Log10(value)).ToString("0.0", CultureInfo.CurrentCulture) + "\u2009dB";}partial void OnMetronomeOnChanged(bool value) => _engine.SetMetronome(value);@@ -179,8 +179,8 @@ public partial class TransportViewModel(IAudioEngine engine) : ObservableObjectdouble sec = Bpm > 0 ? beats * 60.0 / (double)Bpm : 0.0;int m = (int)(sec / 60.0);double s = sec - m * 60.0;- // Invariant so the readout keeps a "." separator regardless of locale.- PositionText = m + ":" + s.ToString("00.000", System.Globalization.CultureInfo.InvariantCulture);+ // The app installs a display culture (point separator, U+2212 minus) at start-up.+ PositionText = m + ":" + s.ToString("00.000", CultureInfo.CurrentCulture);}else{diff --git a/tests/Nota.SmokeTest/DesignTokenCheck.cs b/tests/Nota.SmokeTest/DesignTokenCheck.csnew file mode 100644index 00000000..58969435--- /dev/null+++ b/tests/Nota.SmokeTest/DesignTokenCheck.cs@@ -0,0 +1,436 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// The palette lives in two files that nothing but discipline kept in step:+// Theme/NotaTheme.axaml serves XAML through {DynamicResource Brush.*}, and+// Theme/NotaPalette.cs serves the custom-drawn layer, which cannot cheaply+// resolve a resource inside a Render override. A token changed in one and+// missed in the other is invisible until someone opens the other variant.+//+// So this reads both as text — no reference to Nota.App, no Avalonia, no UI+// thread — and enforces what the two files claim about each other:+//+// 1. the Dark and Light dictionaries declare the same keys;+// 2. a NotaPalette slot tagged `// Brush.Key` holds the same dark/light pair+// that NotaTheme.axaml gives that key;+// 3. every key NotaPalette.KeyMap hands out actually exists in the theme.+//+// See DESIGN.md § How theming works.++using System.Text.RegularExpressions;++namespace Nota.SmokeTest;++internal static class DesignTokenCheck+{+ public static IEnumerable<(bool Ok, string Label)> Run()+ {+ var root = RepoRoot();+ if (root is null)+ {+ yield return (false, "repo root located (no Nota.sln above the test binary)");+ yield break;+ }++ var themePath = Path.Combine(root, "src/managed/Nota.App/Theme/NotaTheme.axaml");+ var palettePath = Path.Combine(root, "src/managed/Nota.App/Theme/NotaPalette.cs");+ if (!File.Exists(themePath) || !File.Exists(palettePath))+ {+ yield return (false, "both palette files found");+ yield break;+ }++ var theme = File.ReadAllText(themePath);+ var palette = File.ReadAllText(palettePath);++ var dark = Brushes(theme, "Dark");+ var light = Brushes(theme, "Light");++ // 1. Both variants must declare the same keys: a token added to one branch+ // and not the other is a colour that vanishes when the variant flips.+ var onlyDark = dark.Keys.Except(light.Keys).OrderBy(k => k).ToArray();+ var onlyLight = light.Keys.Except(dark.Keys).OrderBy(k => k).ToArray();+ yield return (onlyDark.Length == 0 && onlyLight.Length == 0,+ onlyDark.Length == 0 && onlyLight.Length == 0+ ? $"NotaTheme Dark and Light declare the same {dark.Count} keys"+ : $"NotaTheme variants disagree — only Dark: [{string.Join(", ", onlyDark)}]; only Light: [{string.Join(", ", onlyLight)}]");++ // 2. Every mirrored slot must carry the theme's pair. A slot claims its+ // mirror in a trailing comment: T("#dark", "#light"); // Brush.Key — note+ var slot = new Regex(+ """public\s+static\s+readonly\s+SolidColorBrush\s+(?<name>\w+)\s*=\s*T\(\s*"(?<d>#[0-9A-Fa-f]{6,8})"\s*,\s*"(?<l>#[0-9A-Fa-f]{6,8})"\s*\)\s*;\s*//\s*(?<key>Brush\.\w+)""",+ RegexOptions.Compiled);++ var mismatched = new List<string>();+ int mirrored = 0;+ foreach (Match m in slot.Matches(palette))+ {+ var key = m.Groups["key"].Value;+ if (!dark.TryGetValue(key, out var td) || !light.TryGetValue(key, out var tl))+ {+ mismatched.Add($"{m.Groups["name"].Value} claims {key}, which the theme does not declare");+ continue;+ }+ mirrored++;+ var sd = m.Groups["d"].Value;+ var sl = m.Groups["l"].Value;+ if (!Same(sd, td)) mismatched.Add($"{key} dark: palette {sd} vs theme {td}");+ if (!Same(sl, tl)) mismatched.Add($"{key} light: palette {sl} vs theme {tl}");+ }++ yield return (mirrored > 0, $"NotaPalette mirrors {mirrored} theme keys by name");+ yield return (mismatched.Count == 0,+ mismatched.Count == 0+ ? "every mirrored slot matches the theme in both variants"+ : $"palette/theme drift ({mismatched.Count}): {string.Join("; ", mismatched.Take(8))}");++ // 3. KeyMap is how a code-built view resolves a token by its XAML key, so+ // every key it offers has to be a key the theme really defines.+ var keyMap = Regex.Match(palette, @"KeyMap\s*=\s*new\([^)]*\)\s*\{(?<body>.*?)\n \};", RegexOptions.Singleline);+ var unknown = new List<string>();+ int mapped = 0;+ if (keyMap.Success)+ {+ foreach (Match m in Regex.Matches(keyMap.Groups["body"].Value, @"\[""(?<key>Brush\.\w+)""\]"))+ {+ mapped++;+ if (!dark.ContainsKey(m.Groups["key"].Value)) unknown.Add(m.Groups["key"].Value);+ }+ }+ yield return (keyMap.Success && mapped > 0, $"NotaPalette.KeyMap parsed ({mapped} keys)");+ yield return (unknown.Count == 0,+ unknown.Count == 0+ ? "every KeyMap key exists in NotaTheme"+ : $"KeyMap offers keys the theme lacks: {string.Join(", ", unknown)}");+ }++ /// <summary>Geometry: Radius.* / Control.* / Space.* in NotaTheme.axaml must equal the+ /// constants in NotaGeometry.cs, and the view layer must not bring literals, drop+ /// shadows or gradients back. See DESIGN.md § Geometry.</summary>+ public static IEnumerable<(bool Ok, string Label)> RunGeometry()+ {+ var root = RepoRoot();+ if (root is null) { yield return (false, "repo root located"); yield break; }+ var app = Path.Combine(root, "src/managed/Nota.App");+ var theme = File.ReadAllText(Path.Combine(app, "Theme/NotaTheme.axaml"));+ var geo = File.ReadAllText(Path.Combine(app, "Theme/NotaGeometry.cs"));++ // XAML side: <CornerRadius x:Key="Radius.Clip">2</CornerRadius>, <sys:Double x:Key="Space.Tile">8</sys:Double>+ var xaml = new Dictionary<string, double>(StringComparer.Ordinal);+ foreach (Match m in Regex.Matches(theme, """x:Key="(?<key>(?:Radius|Control|Space)\.\w+)">(?<v>[0-9.]+)<"""))+ xaml[m.Groups["key"].Value] = double.Parse(m.Groups["v"].Value, System.Globalization.CultureInfo.InvariantCulture);++ // C# side: NotaRadius.<Name>Value, NotaSize.<Name>, NotaSpace.<Name>+ var cs = new Dictionary<string, double>(StringComparer.Ordinal);+ foreach (Match m in Regex.Matches(geo, @"\b(?<name>\w+)Value\s*=\s*(?<v>[0-9.]+)"))+ cs["Radius." + m.Groups["name"].Value] = double.Parse(m.Groups["v"].Value, System.Globalization.CultureInfo.InvariantCulture);+ foreach (var (cls, prefix) in new[] { ("NotaSize", "Control."), ("NotaSpace", "Space.") })+ {+ var body = Regex.Match(geo, $@"class {cls}\s*\{{(?<b>.*?)\n\}}", RegexOptions.Singleline).Groups["b"].Value;+ foreach (Match m in Regex.Matches(body, @"const double (?<name>\w+)\s*=\s*(?<v>[0-9.]+)"))+ cs[prefix + m.Groups["name"].Value] = double.Parse(m.Groups["v"].Value, System.Globalization.CultureInfo.InvariantCulture);+ }++ var drift = xaml.Keys.Union(cs.Keys).OrderBy(k => k)+ .Where(k => !xaml.TryGetValue(k, out var a) || !cs.TryGetValue(k, out var b) || a != b)+ .Select(k => $"{k}: xaml {(xaml.TryGetValue(k, out var a) ? a : double.NaN)} vs cs {(cs.TryGetValue(k, out var b) ? b : double.NaN)}")+ .ToArray();+ yield return (xaml.Count > 0 && drift.Length == 0,+ drift.Length == 0 ? $"NotaTheme geometry matches NotaGeometry.cs ({xaml.Count} keys)"+ : $"geometry drift: {string.Join("; ", drift)}");++ // Every Radius/Control/Space key a style or view names must exist.+ var used = Directory.EnumerateFiles(app, "*.*", SearchOption.AllDirectories)+ .Where(f => (f.EndsWith(".cs") || f.EndsWith(".axaml")) && !f.Contains("/obj/") && !f.Contains("/bin/"))+ .SelectMany(f => Regex.Matches(File.ReadAllText(f), @"(?:StaticResource |"")(?<key>(?:Radius|Control|Space)\.\w+)[}""]")+ .Select(m => m.Groups["key"].Value))+ .Distinct().Where(k => !xaml.ContainsKey(k)).OrderBy(k => k).ToArray();+ yield return (used.Length == 0,+ used.Length == 0 ? "every referenced Radius/Control/Space key exists"+ : $"references to undefined geometry keys: {string.Join(", ", used)}");++ // The view layer stays literal-free, flat and shadowless.+ var views = Directory.EnumerateFiles(app, "*.cs", SearchOption.AllDirectories)+ .Where(f => !f.Contains("/obj/") && !f.Contains("/bin/") && !f.Contains("/Theme/"))+ .Select(f => (Path: Path.GetRelativePath(app, f), Text: File.ReadAllText(f))).ToArray();+ string[] Offenders(string pattern) => views.Where(v => Regex.IsMatch(v.Text, pattern)).Select(v => v.Path).OrderBy(p => p).ToArray();++ var radiusLiterals = Offenders(@"new CornerRadius\(\s*[0-9]");+ yield return (radiusLiterals.Length == 0,+ radiusLiterals.Length == 0 ? "no CornerRadius literals in views (NotaRadius only)"+ : $"CornerRadius literals in: {string.Join(", ", radiusLiterals)}");+ var shadows = Offenders(@"new BoxShadows?\b");+ yield return (shadows.Length == 0,+ shadows.Length == 0 ? "no drop shadows in views" : $"drop shadows in: {string.Join(", ", shadows)}");+ var gradients = Offenders(@"\b(?:Linear|Radial|Conic)GradientBrush\b|NotaPalette\.VGradient\(");+ yield return (gradients.Length == 0,+ gradients.Length == 0 ? "no gradients in views" : $"gradients in: {string.Join(", ", gradients)}");+ }++ /// <summary>Type: the theme and NotaFonts point at the same bundled Geist files, and no+ /// view names a font of its own or sets text below the 7px floor. See DESIGN.md § Type.</summary>+ public static IEnumerable<(bool Ok, string Label)> RunType()+ {+ var root = RepoRoot();+ if (root is null) { yield return (false, "repo root located"); yield break; }+ var app = Path.Combine(root, "src/managed/Nota.App");+ var theme = File.ReadAllText(Path.Combine(app, "Theme/NotaTheme.axaml"));+ var fonts = File.ReadAllText(Path.Combine(app, "Theme/NotaFonts.cs"));++ string XamlFont(string key) => Regex.Match(theme, $"""<FontFamily x:Key="{key}">(?<v>[^<]+)</FontFamily>""").Groups["v"].Value;+ string CsFont(string name) => Regex.Match(fonts, $@"const string {name}\s*=\s*""(?<v>[^""]+)""").Groups["v"].Value;+ var ui = XamlFont("Font.UI"); var mono = XamlFont("Font.Mono");+ yield return (ui.Length > 0 && ui == CsFont("UiUri") && mono.Length > 0 && mono == CsFont("MonoUri"),+ $"Font.UI / Font.Mono match NotaFonts ({ui} · {mono})");++ var files = new[] { "Regular", "Medium", "SemiBold", "Bold" }+ .SelectMany(w => new[] { $"Geist-{w}.ttf", $"GeistMono-{w}.ttf" })+ .Where(f => !File.Exists(Path.Combine(root, "assets/fonts", f))).ToArray();+ yield return (files.Length == 0,+ files.Length == 0 ? "all eight Geist weights are bundled" : $"missing font files: {string.Join(", ", files)}");+ yield return (File.Exists(Path.Combine(root, "LICENSES/OFL-1.1-Geist.txt")), "the Geist OFL licence ships with the fonts");++ var views = Directory.EnumerateFiles(app, "*.*", SearchOption.AllDirectories)+ .Where(f => (f.EndsWith(".cs") || f.EndsWith(".axaml")) && !f.Contains("/obj/") && !f.Contains("/bin/") && !f.Contains("/Theme/"))+ .Select(f => (Path: Path.GetRelativePath(app, f), Text: File.ReadAllText(f))).ToArray();++ // A family named by string resolves to whatever the OS has; FontFamily.Default+ // hides the choice. Both must go through NotaFonts.+ var named = views.Where(v => Regex.IsMatch(v.Text,+ @"new\s+Typeface\s*\(\s*""|Typeface\s+\w+\s*=\s*new\s*\(\s*""|new\s+FontFamily\s*\(\s*""|FontFamily\.Default|FontFamily=""(?!\{)"))+ .Select(v => v.Path).OrderBy(p => p).ToArray();+ yield return (named.Length == 0,+ named.Length == 0 ? "no view names a font family (NotaFonts / Font.* only)"+ : $"font families named in views: {string.Join(", ", named)}");++ // 7px is the floor. Catches FontSize literals and a FormattedText size literal.+ var small = new List<string>();+ foreach (var v in views)+ {+ foreach (Match m in Regex.Matches(v.Text, @"FontSize\s*=\s*""?(?<n>[0-9]+(?:\.[0-9]+)?)""?"))+ if (double.Parse(m.Groups["n"].Value, System.Globalization.CultureInfo.InvariantCulture) < 7) small.Add($"{v.Path} FontSize {m.Groups["n"].Value}");+ foreach (Match m in Regex.Matches(v.Text, @"FlowDirection\.\w+,\s*[\w.]+,\s*(?<n>[0-9]+(?:\.[0-9]+)?)\s*,"))+ if (double.Parse(m.Groups["n"].Value, System.Globalization.CultureInfo.InvariantCulture) < 7) small.Add($"{v.Path} FormattedText {m.Groups["n"].Value}");+ }+ yield return (small.Count == 0,+ small.Count == 0 ? "no text below the 7px floor" : $"text below 7px: {string.Join("; ", small)}");+ }++ /// <summary>Controls: no icon typed as a character (Glyph draws them), and the shared+ /// controls keep the almanac's fixed sizes. See DESIGN.md § Controls.</summary>+ public static IEnumerable<(bool Ok, string Label)> RunControls()+ {+ var root = RepoRoot();+ if (root is null) { yield return (false, "repo root located"); yield break; }+ var app = Path.Combine(root, "src/managed/Nota.App");++ const string icons = "■□▶▷◀◁●○◆◇★☆✓✔✗✕✖✎❄☰⧉‹›▾▴▸◂▼▲⏵⏸⏹⏺⟳⊘─┄▩⠿+▤";+ var offenders = new List<string>();+ foreach (var f in Directory.EnumerateFiles(app, "*.*", SearchOption.AllDirectories)+ .Where(f => (f.EndsWith(".cs") || f.EndsWith(".axaml")) && !f.Contains("/obj/") && !f.Contains("/bin/")))+ {+ int n = 0;+ foreach (var line in File.ReadLines(f))+ {+ n++;+ var code = f.EndsWith(".cs") ? line.Split("//")[0] : Regex.Replace(line, "<!--.*?-->", "");+ foreach (Match m in Regex.Matches(code, "\"((?:[^\"\\\\]|\\\\.)*)\""))+ if (m.Groups[1].Value.IndexOfAny(icons.ToCharArray()) >= 0)+ offenders.Add($"{Path.GetRelativePath(app, f)}:{n}");+ }+ }+ yield return (offenders.Count == 0,+ offenders.Count == 0 ? "no icon glyphs typed as text (Glyph draws them)"+ : $"icon glyphs typed as text: {string.Join(", ", offenders.Take(10))}");++ var knob = File.ReadAllText(Path.Combine(app, "Controls/Knob.cs"));+ yield return (knob.Contains("NotaSize.KnobSecondary") && knob.Contains("WidthProperty.OverrideMetadata<Knob>"),+ "Knob snaps to the three almanac sizes");+ var sw = File.ReadAllText(Path.Combine(app, "Controls/SwitchTrack.cs"));+ yield return (Regex.IsMatch(sw, @"W = 18, H = 10, KnobD = 7, Inset = 1\.5"), "SwitchTrack is 18×10 with a 7px knob inset 1.5");+ var sl = File.ReadAllText(Path.Combine(app, "Controls/SliderTrack.cs"));+ yield return (Regex.IsMatch(sl, @"TrackH = 3, HandleW = 6, HandleH = 7"), "SliderTrack is a 3px track with a 6×7 handle");+ }++ /// <summary>Numbers and labels: a display culture with a point and U+2212, units after a+ /// thin space, no vowel-dropped parameter labels. See DESIGN.md § Numbers.</summary>+ public static IEnumerable<(bool Ok, string Label)> RunNumbers()+ {+ var root = RepoRoot();+ if (root is null) { yield return (false, "repo root located"); yield break; }+ var app = Path.Combine(root, "src/managed/Nota.App");++ var num = File.ReadAllText(Path.Combine(app, "Theme/NotaNum.cs"));+ var boot = File.ReadAllText(Path.Combine(app, "App.axaml.cs"));+ yield return (num.Contains("NegativeSign = Minus") && num.Contains("Minus = \"\\u2212\"") && boot.Contains("NotaNum.Install()"),+ "the app installs the display culture (point, U+2212 minus)");++ var rules = new (string Name, Regex Re)[]+ {+ ("hyphen in a negative format section", new(@";-[0#]")),+ ("hyphen before infinity", new("\"-(∞|inf)")),+ ("invariant culture on a readout", new(@"FormattableString\.Invariant\(|ToString\([^()]*CultureInfo\.InvariantCulture\)|string\.Format\(\s*(System\.Globalization\.)?CultureInfo\.InvariantCulture")),+ ("plain space before a unit", new(@"(\}|\d) (dB|dBFS|LUFS|kHz|Hz|ms|st|%)(?=[""\s·,)])|\{[^{}""]*:[0#.+\-−;]+\}(dB|Hz|kHz|ms|s|st|%|LUFS)(?=[""\s·,)])")),+ ("vowel-dropped parameter label", new("\"(FDBK|FEEDB|FB|ATK|DEC|SUS|REL|LVL|DET|SPR|QNT|PIT|TRANSP|AMT|VOL|POS|EMPH|RESON)\"")),+ };+ var hits = rules.ToDictionary(r => r.Name, _ => new List<string>());+ foreach (var f in Directory.EnumerateFiles(app, "*.cs", SearchOption.AllDirectories)+ .Where(f => !f.Contains("/obj/") && !f.Contains("/bin/") && !f.EndsWith("NotaNum.cs")))+ {+ int n = 0;+ foreach (var line in File.ReadLines(f))+ {+ n++;+ var code = line.Split("//")[0];+ // Only what reaches the screen: the string literals on the line.+ var literals = string.Join("\n", Regex.Matches(code, "\"((?:[^\"\\\\]|\\\\.)*)\"").Select(m => m.Value));+ foreach (var (name, re) in rules)+ if (re.IsMatch(name.StartsWith("invariant") ? code : literals)) hits[name].Add($"{Path.GetRelativePath(app, f)}:{n}");+ }+ }+ foreach (var (name, _) in rules)+ yield return (hits[name].Count == 0, hits[name].Count == 0 ? $"no {name}" : $"{name}: {string.Join(", ", hits[name].Take(8))}");+ }++ /// <summary>Visualisers: one graph window, no fills under curves, meters on the almanac+ /// scale with no ballistics, a playhead without glow. See DESIGN.md § Visualisers.</summary>+ public static IEnumerable<(bool Ok, string Label)> RunVisualisers()+ {+ var root = RepoRoot();+ if (root is null) { yield return (false, "repo root located"); yield break; }+ var app = Path.Combine(root, "src/managed/Nota.App");+ var views = Directory.EnumerateFiles(Path.Combine(app, "Controls"), "*.cs")+ .Append(Path.Combine(app, "EqCurve.cs"))+ .Select(f => (Path: Path.GetRelativePath(app, f), Text: File.ReadAllText(f))).ToArray();+ // Deliberate exceptions: MixBar is a level strip, not a graph window; RhythmWaveViz+ // draws the waveform itself as a shape, which is data, not a fill under a curve.+ var exempt = new HashSet<string> { "Controls/MixBar.cs", "Controls/RhythmWaveViz.cs" };+ string[] Offenders(string pattern) => views.Where(v => !exempt.Contains(v.Path) && Regex.IsMatch(v.Text, pattern)).Select(v => v.Path).OrderBy(p => p).ToArray();++ var frames = Offenders(@"DrawRectangle\((?:Sunken|Bg|Well|NotaPalette\.BgSunken), (?:new Pen\(\w+(?:, 1)?\)|null), new Rect\(0, 0, w, h\), \d+, \d+\)");+ yield return (frames.Length == 0,+ frames.Length == 0 ? "graphs draw their window through NotaGraph.Window" : $"hand-drawn graph windows in: {string.Join(", ", frames)}");++ var fills = Offenders(@"DrawGeometry\((?:\w*Fill\w*|new SolidColorBrush\(Color\.FromArgb\(0x[0-9A-F]{2}, col\.R|ChamberInk\.Alpha\([^)]*\)), null, (?:fill|geo)\)");+ yield return (fills.Length == 0,+ fills.Length == 0 ? "no fills under curves" : $"fills under curves in: {string.Join(", ", fills)}");++ var ballistics = Offenders(@"_specDb\[k\] - [0-9.]+|Peak \* 0\.9|_pk[LR] \* 0\.9|FallPerTick");+ yield return (ballistics.Length == 0,+ ballistics.Length == 0 ? "meters and spectra have no release ballistics" : $"meter/spectrum ballistics in: {string.Join(", ", ballistics)}");++ var meter = File.ReadAllText(Path.Combine(app, "Controls/MeterBar.cs"));+ yield return (Regex.IsMatch(meter, @"ChannelW = 11, Step = 5"), "level meter channels are 11px with a 5px step");++ var arr = string.Concat(Directory.EnumerateFiles(app, "ArrangementView*.cs").Select(File.ReadAllText));+ yield return (!arr.Contains("PlayheadGlow") && Regex.IsMatch(arr, @"PlayheadPen = new Pen\(PlayheadBrush, 1\)"),+ "the arrangement playhead is a 1px brass line with no glow");+ }++ /// <summary>The almanac's closed list of bans (§ 9) that the other checks do not already+ /// hold: colour literals outside the palette, a second hue typed in as RGB, named system+ /// colours, opacity as a state, and brushes that snapshot a theme colour. Gradients,+ /// CornerRadius literals and type under 7px are enforced in RunGeometry / RunType.+ /// See DESIGN.md § Enforced by tests.</summary>+ public static IEnumerable<(bool Ok, string Label)> RunBans()+ {+ var root = RepoRoot();+ if (root is null) { yield return (false, "repo root located"); yield break; }+ var app = Path.Combine(root, "src/managed/Nota.App");++ // Hex strings that are data rather than tokens: tag swatches the library stores, and+ // two device hue tables. Each is only ever painted through NotaPalette.Ink().+ var hexData = new[] { "TagEditorWindow.cs", "DeviceCards/Bodies/StrataDeviceBody.cs", "DeviceCards/Instruments/RhythmInstrumentCard.cs" };+ // Opacity is allowed for exactly one thing: the ghost of a card being dragged.+ var dragGhost = new Regex(@"\b(card|_devDragCard)\.Opacity = (0\.55|1\.0);");++ var rules = new (string Name, Regex Re, Func<string, string, bool>? Allow)[]+ {+ ("hex colour outside NotaPalette.Ink()", new(@"""#[0-9A-Fa-f]{6}(?:[0-9A-Fa-f]{2})?"""),+ (file, line) => line.Contains("Ink(") || line.Contains("InkColor(") || hexData.Contains(file)),+ ("RGB colour typed as numbers", new(@"Color\.From(?:Argb|Rgb)\((?:[^,()]+,\s*)?(?<r>0x[0-9A-Fa-f]{2}|\d{1,3})\s*,\s*(?<g>0x[0-9A-Fa-f]{2}|\d{1,3})\s*,\s*(?<b>0x[0-9A-Fa-f]{2}|\d{1,3})\s*\)|Color\.Parse\("),+ (_, line) => Regex.IsMatch(line, @"Color\.From(?:Argb|Rgb)\((?:[^,()]+,\s*)?(?:0x00|0)\s*,\s*(?:0x00|0)\s*,\s*(?:0x00|0)\s*\)")), // black shade is not a hue+ ("named system colour", new(@"\b(?:Colors|Brushes)\.(?!Transparent\b)[A-Z]\w*"), null),+ ("Opacity used as a state", new(@"\bOpacity\s*=\s*[0-9.]"), (_, line) => dragGhost.IsMatch(line)),+ ("brush snapshotting a theme colour", new(@"new (?:[\w.]+\.)?SolidColorBrush\(\s*(?:NotaPalette\.\w+(?:\.Color)?\s*[,)]|[\w.]*TrackColor(?:ForIndex)?\(|NotaPalette\.(?:TrackColors|ReturnColors)\[)|static readonly (?:I?Solid\w*Brush|IBrush)(?:\[\])?\s+\w+\s*=\s*new (?:[\w.]+\.)?SolidColorBrush\((?!Color\.FromArgb\(0x[0-9A-Fa-f]{2}, 0x00, 0x00, 0x00\))|static readonly Color(?:\[\])?\s+\w+\s*=.*NotaPalette"), null),+ };+ var hits = rules.ToDictionary(r => r.Name, _ => new List<string>());+ foreach (var f in Directory.EnumerateFiles(app, "*.*", SearchOption.AllDirectories)+ .Where(f => (f.EndsWith(".cs") || f.EndsWith(".axaml")) && !f.Contains("/obj/") && !f.Contains("/bin/")+ && !f.EndsWith("Theme/NotaPalette.cs") && !f.EndsWith("Theme/NotaTheme.axaml")))+ {+ var rel = Path.GetRelativePath(app, f);+ int n = 0;+ foreach (var line in File.ReadLines(f))+ {+ n++;+ var code = f.EndsWith(".cs") ? line.Split("//")[0] : Regex.Replace(line, "<!--.*?-->", "");+ foreach (var (name, re, allow) in rules)+ if (re.IsMatch(code) && !(allow?.Invoke(rel, code) ?? false)) hits[name].Add($"{rel}:{n}");+ }+ }+ foreach (var (name, _, _) in rules)+ yield return (hits[name].Count == 0, hits[name].Count == 0 ? $"no {name}" : $"{name}: {string.Join(", ", hits[name].Take(8))}");+ }++ /// <summary>Layout: device cards 700 wide with a 22px header (documented exceptions only),+ /// transport at the top, list rows 26. See DESIGN.md § Device cards and § Shell.</summary>+ public static IEnumerable<(bool Ok, string Label)> RunLayout()+ {+ var root = RepoRoot();+ if (root is null) { yield return (false, "repo root located"); yield break; }+ var app = Path.Combine(root, "src/managed/Nota.App");++ var kit = File.ReadAllText(Path.Combine(app, "DeviceCardKit.cs"));+ yield 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.+ var exempt = new HashSet<string> { "PluginDeviceBody.cs", "GenericParamDeviceBody.cs", "GenericMidiBody.cs",+ "RhythmInstrumentCard.cs", "FluxInstrumentCard.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]+);")+ .Where(m => m.Groups["w"].Value != "700").Select(m => $"{Path.GetFileName(f)} ({m.Groups["w"].Value})"))+ .ToArray();+ yield return (off.Length == 0, off.Length == 0 ? "device cards are 700 wide (documented exceptions aside)" : $"cards off the 700 format: {string.Join(", ", off)}");++ var main = File.ReadAllText(Path.Combine(app, "MainWindow.axaml"));+ yield return (Regex.IsMatch(main, "x:Name=\"TransportBar\" DockPanel.Dock=\"Top\"[^>]*Height=\"\\{StaticResource Control.Console\\}\""),+ "transport is a 42px strip at the top of the window");++ var browser = File.ReadAllText(Path.Combine(app, "BrowserView.cs"));+ yield return (Regex.IsMatch(browser, @"const double RowH = 2[6-8];"), "browser list rows are 26–28px");+ }++ /// <summary>The Brush.* keys and values of one ThemeDictionary.</summary>+ private static Dictionary<string, string> Brushes(string theme, string variant)+ {+ var dict = new Dictionary<string, string>(StringComparer.Ordinal);+ var block = Regex.Match(theme,+ $"""x:Key="{variant}">(?<body>.*?)\n </ResourceDictionary>""", RegexOptions.Singleline);+ if (!block.Success) return dict;+ foreach (Match m in Regex.Matches(block.Groups["body"].Value,+ """<SolidColorBrush\s+x:Key="(?<key>Brush\.\w+)">(?<val>#[0-9A-Fa-f]{6,8})</SolidColorBrush>"""))+ dict[m.Groups["key"].Value] = m.Groups["val"].Value;+ return dict;+ }++ // #RRGGBB and #FFRRGGBB name the same colour; compare on the opaque form.+ private static bool Same(string a, string b) => Norm(a) == Norm(b);++ private static string Norm(string hex)+ {+ hex = hex.TrimStart('#').ToUpperInvariant();+ if (hex.Length == 8 && hex.StartsWith("FF", StringComparison.Ordinal)) hex = hex[2..];+ return hex;+ }++ /// <summary>Walk up from the test binary until the solution file appears.</summary>+ private static string? RepoRoot()+ {+ var d = new DirectoryInfo(AppContext.BaseDirectory);+ while (d is not null && !File.Exists(Path.Combine(d.FullName, "Nota.sln"))) d = d.Parent;+ return d?.FullName;+ }+}diff --git a/tests/Nota.SmokeTest/Program.cs b/tests/Nota.SmokeTest/Program.csindex 5dc9c847..b540e94b 100644--- a/tests/Nota.SmokeTest/Program.cs+++ b/tests/Nota.SmokeTest/Program.cs@@ -47,6 +47,28 @@ Console.WriteLine($"engine v{NotaEngine.Version}");"Presentation references neither Avalonia nor Infrastructure");}+// --- design tokens: the two palette files must agree -------------------------+// NotaTheme.axaml and NotaPalette.cs carry the same palette for two different+// consumers and nothing but discipline kept them in step. See DESIGN.md § Enforced by tests.+{+ Console.WriteLine("-- design: palette mirror --");+ foreach (var (ok, label) in Nota.SmokeTest.DesignTokenCheck.Run()) Check(ok, label);+ Console.WriteLine("-- design: geometry --");+ foreach (var (ok, label) in Nota.SmokeTest.DesignTokenCheck.RunGeometry()) Check(ok, label);+ Console.WriteLine("-- design: type --");+ foreach (var (ok, label) in Nota.SmokeTest.DesignTokenCheck.RunType()) Check(ok, label);+ Console.WriteLine("-- design: controls --");+ foreach (var (ok, label) in Nota.SmokeTest.DesignTokenCheck.RunControls()) Check(ok, label);+ Console.WriteLine("-- design: visualisers --");+ foreach (var (ok, label) in Nota.SmokeTest.DesignTokenCheck.RunVisualisers()) Check(ok, label);+ Console.WriteLine("-- design: layout --");+ foreach (var (ok, label) in Nota.SmokeTest.DesignTokenCheck.RunLayout()) Check(ok, label);+ Console.WriteLine("-- design: numbers --");+ foreach (var (ok, label) in Nota.SmokeTest.DesignTokenCheck.RunNumbers()) Check(ok, label);+ Console.WriteLine("-- design: bans --");+ foreach (var (ok, label) in Nota.SmokeTest.DesignTokenCheck.RunBans()) Check(ok, label);+}+// Opt-in plugin-scan check (M3-1): `--scan <path-to-nota-scanworker>`. Kept out// of the default run because results depend on which plugins are installed.if (args.Length >= 2 && args[0] == "--scan")