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
Fixes
Egor Khindikaynen3c27e13c2599
diff --git a/.claude/skills/nota-design/SKILL.md b/.claude/skills/nota-design/SKILL.mdindex 12222d40..06354df8 100644--- a/.claude/skills/nota-design/SKILL.md+++ b/.claude/skills/nota-design/SKILL.md@@ -56,7 +56,7 @@ Most of these are enforced by `DesignTokenCheck`; the smoke test fails when onetransitions 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+ U+2212 minus). Put a thin space (`\u2009` in source) before units, keep precision fixed (dB onedecimal, tempo two, percent whole, Hz up to 999 then `3.2 k`) — use `NotaNum` helpers.- **Icons are geometry.** `Glyph` / `GlyphKind`; no unicode symbols (`■ ▶ ● ✓ ★ ▾`…) andno emoji as text. `·` separates meta; `→` in prose is fine.@@ -67,8 +67,9 @@ Most of these are enforced by `DesignTokenCheck`; the smoke test fails when one## 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.+- **Header 22:** name left; preset picker `‹ Name ⌄ ›` (when the device has presets),+ processing-type badge (mono caps) and bypass right — nothing else. A/B, move and 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 gothrough `NotaGraph` (Well, hairline, radius 4, corner axis labels, no fills under curves).diff --git a/DESIGN.html b/DESIGN.htmlindex 107860b3..eee09170 100644--- a/DESIGN.html+++ b/DESIGN.html@@ -272,6 +272,9 @@ td:first-child{color:var(--text-primary)}.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)}+.preset{margin-left:auto;display:inline-flex;align-items:stretch;height:18px;border:1px solid var(--hairline);border-radius:var(--r-control);background:var(--bg-sunken);overflow:hidden;font-size:11px}+.preset i{font-style:normal;width:18px;display:grid;place-items:center;color:var(--text-tertiary)}+.preset b{font-weight:500;width:132px;padding:0 7px;border-left:1px solid var(--hairline);border-right:1px solid var(--hairline);display:flex;align-items:center;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}@@ -494,9 +497,9 @@ ul.plain{margin:0;padding-left:18px;color:var(--text-secondary)} ul.plain li{mar<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>+ <p>Header 22: name left; preset picker, processing-type badge and bypass right (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__head"><span class="card__name">Nota Chamber</span><span class="preset"><i>‹</i><b>Stone Vault</b><i>›</i></span><span class="card__badge" style="margin-left:0">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>diff --git a/DESIGN.md b/DESIGN.mdindex 18685b8f..804cd15c 100644--- a/DESIGN.md+++ b/DESIGN.md@@ -252,7 +252,7 @@ invariant with U+2212 as the negative sign — so every implicit `{v:0.0}` printwith a point on any OS locale; typed input still accepts a hyphen. Project and presetfiles are JSON and never go through it.-- The unit follows a **thin space**: `4.6 s`, `−3.3 dB`, `72 %` (` ` in source).+- The unit follows a **thin space**: `4.6 s`, `−3.3 dB`, `72 %` (`\u2009` 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 to999, then `3.2 k`. Helpers: `NotaNum.Db`, `Hz`, `Pct`, `Bpm`, `Time`, `Unit`, `F`.@@ -354,10 +354,12 @@ All live in one **graph window** (`Controls/NotaGraph.cs`):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.+- **Header 22** (`HeaderH`): device name (12/600) on the left; on the right the **preset+ picker** `‹ Name ⌄ ›` (an 18 px sunken field, radius 4: the name opens the factory+ presets, the chevrons step through them, wrapping), the processing-type badge (mono caps;+ instruments add live voices, `SUBTRACTIVE · 3/16`) and the bypass switch. The picker+ appears only when the device has factory 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,@@ -427,6 +429,8 @@ Decisions taken while aligning the app, kept on purpose: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).+- **Preset picker in the device header.** The almanac allows only name, badge and bypass+ there; switching presets is frequent enough to stay one click away.- **Zoom 28 px per beat** by default, not a 16 px bar; the ruler labels every bar once a baris wider than 40 px.- **`FREQ`, `RESO`, `THRESH`** as labels (see § Labels and copy).diff --git a/scripts/design-html.py b/scripts/design-html.pyindex bb62bdf3..22545fd0 100755--- a/scripts/design-html.py+++ b/scripts/design-html.py@@ -204,6 +204,9 @@ td:first-child{{color:var(--text-primary)}}.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)}}+.preset{{margin-left:auto;display:inline-flex;align-items:stretch;height:18px;border:1px solid var(--hairline);border-radius:var(--r-control);background:var(--bg-sunken);overflow:hidden;font-size:11px}}+.preset i{{font-style:normal;width:18px;display:grid;place-items:center;color:var(--text-tertiary)}}+.preset b{{font-weight:500;width:132px;padding:0 7px;border-left:1px solid var(--hairline);border-right:1px solid var(--hairline);display:flex;align-items:center;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}}@@ -426,9 +429,9 @@ ul.plain{{margin:0;padding-left:18px;color:var(--text-secondary)}} ul.plain li{{<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>+ <p>Header 22: name left; preset picker, processing-type badge and bypass right (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__head"><span class="card__name">Nota Chamber</span><span class="preset"><i>‹</i><b>Stone Vault</b><i>›</i></span><span class="card__badge" style="margin-left:0">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>diff --git a/src/managed/Nota.App/DeviceChainView.Shell.cs b/src/managed/Nota.App/DeviceChainView.Shell.csindex 956814b5..bb913b86 100644--- a/src/managed/Nota.App/DeviceChainView.Shell.cs+++ b/src/managed/Nota.App/DeviceChainView.Shell.cs@@ -10,6 +10,7 @@// return content only; this wraps them.using System;+using System.Collections.Generic;using System.Linq;using Avalonia;using Avalonia.Controls;@@ -95,15 +96,78 @@ public sealed partial class DeviceChainViewprivate static TextBlock Caps(string t, double fs = 9) => new() { Text = t, FontSize = fs, FontWeight = FontWeight.Bold, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center };private static TextBlock Mono(string t, double w) { var tb = new TextBlock { Text = t, FontSize = 9, Foreground = TextSecondary, Width = w, TextAlignment = TextAlignment.Right, VerticalAlignment = VerticalAlignment.Center }; tb.BindResource(TextBlock.FontFamilyProperty, "Font.Mono"); return tb; }+ // Preset picker "‹ Name ▾ ›" — a sunken field (a list you pick from, not a button): the+ // name opens the factory presets for this kind with the current one checked; ‹ › step to+ // the previous / next preset, wrapping (from Init, › is the first and ‹ the last).+ // Clicks are handled so they neither select nor start dragging the card.+ private Control PresetPicker(List<FactoryPresetInfo> presets, int cur, string current,+ Action<FactoryPresetInfo> apply, Action<int> step)+ {+ const double H = 18;+ var label = new TextBlock+ {+ Text = string.IsNullOrEmpty(current) ? "Init" : current, FontSize = NotaType.Value + 1, FontWeight = FontWeight.Medium,+ Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis,+ };+ var chevron = new Glyph(GlyphKind.ChevronDown, 8) { Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(6, 0, 0, 0) };+ var name = new Border+ {+ Width = 132, Padding = new Thickness(7, 0, 6, 0), Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand),+ Child = new DockPanel { Children = { Docked(chevron, Dock.Right), label } },+ };+ ToolTip.SetTip(name, "Choose a preset");+ name.PointerPressed += (_, e) =>+ {+ if (!e.GetCurrentPoint(name).Properties.IsLeftButtonPressed) return;+ e.Handled = true;+ var flyout = new MenuFlyout();+ for (int i = 0; i < presets.Count; i++)+ {+ var info = presets[i];+ var mi = new MenuItem { Header = info.DisplayName, ToggleType = MenuItemToggleType.Radio, IsChecked = i == cur };+ mi.Click += (_, _) => apply(info);+ flyout.Items.Add(mi);+ }+ flyout.ShowAt(name);+ };++ Border Step(int dir)+ {+ var g = new Glyph(dir < 0 ? GlyphKind.ChevronLeft : GlyphKind.ChevronRight, 8)+ { Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };+ var b = new Border { Width = H, Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Child = g };+ ToolTip.SetTip(b, dir < 0 ? "Previous preset" : "Next preset");+ b.PointerEntered += (_, _) => g.Foreground = TextPrimary;+ b.PointerExited += (_, _) => g.Foreground = TextTertiary;+ b.PointerPressed += (_, e) =>+ {+ if (!e.GetCurrentPoint(b).Properties.IsLeftButtonPressed) return;+ e.Handled = true;+ step(dir);+ };+ return b;+ }+ Border Rule() => new() { Width = 1, Background = NotaPalette.GraphBorder };++ return new Border+ {+ Height = H, Background = NotaPalette.BgSunken, BorderBrush = NotaPalette.GraphBorder, BorderThickness = new Thickness(1),+ CornerRadius = NotaRadius.Control, ClipToBounds = true, VerticalAlignment = VerticalAlignment.Center,+ Child = new StackPanel { Orientation = Orientation.Horizontal, Children = { Step(-1), Rule(), name, Rule(), Step(+1) } },+ };+ }++ private static T Docked<T>(T c, Dock d) where T : Control { DockPanel.SetDock(c, d); return c; }+private Border BuildCardShell(ShellSpec s, Control body){int di = s.DeviceIndex;var extra = Extra(s.Kind, di);- // ---- 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.+ // ---- header (22): name on the left; on the right the preset picker, the processing+ // type as a mono badge and the bypass switch. A/B, move and delete live in the+ // header's context menu (with the presets again); 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,@@ -156,35 +220,41 @@ public sealed partial class DeviceChainViewPadding = new Thickness(NotaSpace.DeviceInsetWide, 0), Child = headerGrid,Cursor = s.CanMove && SelectableKind(s.Kind) ? new Cursor(StandardCursorType.SizeAll) : null,};- ToolTip.SetTip(headerBar, s.CanMove ? "Drag to reorder · right-click for presets, A/B, move and delete" : "Right-click for presets and more");+ ToolTip.SetTip(headerBar, s.CanMove ? "Drag to reorder · right-click for A/B, move and delete" : "Right-click for more");++ // Factory presets for this device, and applying one in place.+ var presets = s.PresetKind >= 0 || s.IsInstrument || s.Kind == ChainKind.Midi+ ? _factory.All().Where(p => p.BuiltinKind == s.PresetKind+ && (s.Kind == ChainKind.Midi ? p.IsMidiEffect : (p.IsInstrument == s.IsInstrument && !p.IsMidiEffect))).ToList()+ : new List<FactoryPresetInfo>();+ int curPreset = presets.FindIndex(p => p.Id == extra.PresetId);+ void ApplyPreset(FactoryPresetInfo p) { _factory.ApplyInPlace(_engine, p.Id, _trackId, di); extra.PresetId = p.Id; extra.Preset = p.DisplayName; Rebuild(); }+ void StepPreset(int dir)+ {+ int n = presets.Count; if (n == 0) return;+ ApplyPreset(presets[curPreset < 0 ? (dir > 0 ? 0 : n - 1) : ((curPreset + dir) % n + n) % n]);+ }+ if (presets.Count > 0) right.Children.Insert(0, PresetPicker(presets, curPreset, extra.Preset, ApplyPreset, StepPreset));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)+ if (presets.Count > 0){- 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)+ var menu = new MenuItem { Header = $"Preset: {(string.IsNullOrEmpty(extra.Preset) ? "Init" : extra.Preset)}" };+ var prev = new MenuItem { Header = "Previous preset" }; prev.Click += (_, _) => StepPreset(-1);+ var next = new MenuItem { Header = "Next preset" }; next.Click += (_, _) => StepPreset(+1);+ menu.Items.Add(prev); menu.Items.Add(next); menu.Items.Add(new Separator());+ for (int i = 0; i < presets.Count; i++){- 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);+ var info = presets[i];+ var mi = new MenuItem { Header = info.DisplayName, ToggleType = MenuItemToggleType.Radio, IsChecked = i == curPreset };+ mi.Click += (_, _) => ApplyPreset(info);+ menu.Items.Add(mi);}+ flyout.Items.Add(menu);}// A / B compare of two full-parameter snapshots.float[] Capture() => CaptureParams(s.Kind, di);diff --git a/src/managed/Nota.App/PreferencesWindow.cs b/src/managed/Nota.App/PreferencesWindow.csindex 6e4af9cd..6111ed18 100644--- a/src/managed/Nota.App/PreferencesWindow.cs+++ b/src/managed/Nota.App/PreferencesWindow.cs@@ -622,7 +622,7 @@ public sealed class PreferencesWindow : NotaWindow("Drag overview edge", "Zoom by resizing the viewport window"),("Double-click overview", "Fit the whole project on screen"),("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"),+ ("Right-click a device header", "A / B compare, move, copy, delete, presets, 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"),