Skip to content

armgit / nota

Public Imported from GitHub
0

Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.

(style) Redesign of VST/AU host control

Egor Khindikaynene48163af3715
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8bb10cd4..ad906a48 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -112,6 +112,12 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
## [Unreleased]
### Changed
+- VST3 and AU plug-ins get a proper device card with two sizes. The header names the
+ plug-in. The small card shows its vendor, format, parameter count and latency, with
+ Open editor and Save preset. The full card adds every parameter as a knob, with a filter
+ and pages (the mouse wheel turns them), and a sidechain source for plug-ins that have
+ one. Knobs show the plug-in's own values (such as "−12.0 dB"), and a double-click
+ restores the plug-in's default.
- The browser's preview player stays out of the way until you use it. It is hidden at
launch, appears once you click or arrow through a list (or press Space there), and hides
again when you drag or double-click an item into the project.
diff --git a/DESIGN.md b/DESIGN.md
index 1420df5a..37f51ab0 100644
--- a/DESIGN.md
+++ b/DESIGN.md
@@ -369,7 +369,10 @@ Every built-in device is a **700 × 260** card (`DeviceCardKit.CardH`, width fro
- A bypassed card keeps its layout and turns to the disabled look via `Inactive`.
Width exceptions, by decision: **Bass 1060, Physical 720** (squeezing them would be a
-redesign) and the host-plugin / parameter-list stubs (230, 190). Rhythm moved onto the
+redesign) and the parameter-list stub (190). A hosted plug-in (VST3 / AU) is a two-size
+card like the S / L instruments: **S 260** names it (name, vendor, format, kind, params,
+latency) over *Open editor* and *Save preset*; **L 700** adds its parameters as a paged,
+filterable knob grid (and the sidechain source when it has a bus). Rhythm moved onto the
700 frame with its redesign.
## Shell
diff --git a/src/managed/Nota.App/DeviceCards/Bodies/PluginDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/PluginDeviceBody.cs
deleted file mode 100644
index d6d335c5..00000000
--- a/src/managed/Nota.App/DeviceCards/Bodies/PluginDeviceBody.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-only
-// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
-//
-// Detail · Devices — hosted plug-in (kind -1) body: an "open editor" stub, latency
-// readout, and (for plugins that expose a sidechain bus) the shared source picker.
-
-using Avalonia;
-using Avalonia.Controls;
-using Avalonia.Input;
-using Avalonia.Layout;
-using Avalonia.Media;
-using static Nota.App.DeviceCardKit;
-
-namespace Nota.App;
-
-internal sealed class PluginDeviceBody : IDeviceBody
-{
- public double Width => 230;
-
- public Control Build(DeviceCardContext ctx, int index)
- {
- var engine = ctx.Engine;
- int track = ctx.TrackId;
-
- var open = new Border
- {
- Background = Card2, BorderBrush = BorderStrong, BorderThickness = new Thickness(1),
- CornerRadius = NotaRadius.Tile, Padding = new Thickness(12, 4), HorizontalAlignment = HorizontalAlignment.Center,
- Cursor = new Cursor(StandardCursorType.Hand),
- 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}\u2009ms — compensated", FontSize = 9, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center };
- latency.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");
-
- var body = new StackPanel
- {
- Spacing = 8, VerticalAlignment = VerticalAlignment.Center,
- Children =
- {
- new TextBlock { Text = "Hosted plug-in — native GUI in own window", FontSize = 9, Foreground = TextTertiary, TextWrapping = TextWrapping.Wrap, TextAlignment = TextAlignment.Center },
- open, latency,
- },
- };
- // Phase C: plugins that expose a sidechain input bus get the same source picker.
- if (engine.DeviceAcceptsSidechain(track, index))
- {
- body.Children.Add(new Border { Height = 1, Background = BorderDef, Margin = new Thickness(0, 2), HorizontalAlignment = HorizontalAlignment.Stretch });
- body.Children.Add(DeviceParamControls.SidechainSelector(ctx, index));
- }
- return body;
- }
-}
diff --git a/src/managed/Nota.App/DeviceCards/DeviceCardFactory.cs b/src/managed/Nota.App/DeviceCards/DeviceCardFactory.cs
index 9962fc7b..e11fbd82 100644
--- a/src/managed/Nota.App/DeviceCards/DeviceCardFactory.cs
+++ b/src/managed/Nota.App/DeviceCards/DeviceCardFactory.cs
@@ -15,7 +15,6 @@ namespace Nota.App;
internal sealed class DeviceCardFactory
{
- private readonly IDeviceBody _plugin = new PluginDeviceBody();
private readonly IDeviceBody _generic = new GenericParamDeviceBody();
private readonly Dictionary<int, IDeviceBody> _byKind = new()
{
@@ -46,11 +45,10 @@ internal sealed class DeviceCardFactory
[25] = new ChorusDeviceBody(),
};
- /// <summary>Resolve the body for a device: -1 = hosted plugin, a mapped built-in kind,
- /// or the generic param-bar fallback for any built-in without a bespoke body.
- /// Note: the Audio Effect Rack (kind 5) is still handled inline by the view.</summary>
+ /// <summary>Resolve the body for a built-in device: its mapped body, or the generic
+ /// param-bar fallback. Hosted plug-ins (-1) and the Audio Effect Rack (5) are built by
+ /// the view (PluginCard / RackCardView).</summary>
public IDeviceBody Resolve(int builtinKind)
- => builtinKind < 0 ? _plugin
- : _byKind.TryGetValue(builtinKind, out var body) ? body
+ => _byKind.TryGetValue(builtinKind, out var body) ? body
: _generic;
}
diff --git a/src/managed/Nota.App/DeviceCards/Instruments/GenericInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/GenericInstrumentCard.cs
index 05fffc14..bfccef61 100644
--- a/src/managed/Nota.App/DeviceCards/Instruments/GenericInstrumentCard.cs
+++ b/src/managed/Nota.App/DeviceCards/Instruments/GenericInstrumentCard.cs
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
//
-// Detail · Devices — fallback instrument card: an "Open GUI" stub for a hosted plugin
-// instrument (or a built-in with no editor), plus a "Save preset" action for plugins.
+// Detail · Devices — fallback instrument card: an "Open GUI" stub for a built-in with no
+// editor. Hosted plug-ins have their own card (PluginCard).
using Avalonia.Controls;
using Avalonia.Layout;
@@ -20,12 +20,6 @@ internal sealed class GenericInstrumentCard : IInstrumentCard
var gui = TextButton("Open GUI ↗");
gui.PointerPressed += (_, _) => { try { engine.OpenPluginEditor(track, -1); } catch { /* no-op */ } };
var body = new StackPanel { Spacing = 8, VerticalAlignment = VerticalAlignment.Center, Children = { gui } };
- if (engine.TrackInstrumentKind(track) == -1)
- {
- var save = TextButton("Save preset");
- save.PointerPressed += (_, _) => ctx.RequestPresetSave(-1);
- body.Children.Add(save);
- }
return SimpleCard("Instrument", 170, body);
}
}
diff --git a/src/managed/Nota.App/DeviceCards/PluginCard.cs b/src/managed/Nota.App/DeviceCards/PluginCard.cs
new file mode 100644
index 00000000..3004a5a1
--- /dev/null
+++ b/src/managed/Nota.App/DeviceCards/PluginCard.cs
@@ -0,0 +1,302 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+//
+// Detail · Devices — the hosted plug-in card (VST3 / AU), for an instrument (deviceIndex -1)
+// and an insert effect alike. The shell header names the plug-in; two sizes share it:
+// • S 260 × 260 — who it is (name, vendor, format, kind, params, latency) over the two
+// actions: open the native editor, save a preset.
+// • L 700 × 260 — the same column on the left, then every automatable parameter as a
+// knob grid (search + pages), and, for a plug-in with a sidechain bus, its source.
+// The size is editor state kept by the chain view (a hosted plug-in has no "view" param).
+
+using System;
+using System.Collections.Generic;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Input;
+using Avalonia.Layout;
+using Avalonia.Media;
+using Nota.Application;
+using static Nota.App.DeviceCardKit;
+
+namespace Nota.App;
+
+/// <summary>What the catalog knows about a hosted plug-in.</summary>
+internal readonly record struct PluginInfo(string Name, string Vendor, string Format, bool IsInstrument)
+{
+ /// <summary>Looks the device's plug-in up in the scanned catalog; falls back to the
+ /// engine's name and the identifier's format prefix when it is not installed.</summary>
+ public static PluginInfo Of(IAudioEngine engine, int track, int deviceIndex)
+ {
+ string id = deviceIndex < 0 ? engine.TrackInstrumentPluginId(track) : engine.TrackDevicePluginId(track, deviceIndex);
+ string name = engine.DeviceName(track, deviceIndex), vendor = "", format = "";
+ if (App.Services?.GetService(typeof(IPluginCatalog)) is IPluginCatalog cat && id.Length > 0
+ && cat.IndexOfId(id) is var ci and >= 0 && cat.Description(ci) is { } desc)
+ {
+ // "Name | Format | inst|fx | Manufacturer"
+ var parts = desc.Split('|');
+ if (parts.Length > 0 && parts[0].Trim().Length > 0) name = parts[0].Trim();
+ if (parts.Length > 1) format = parts[1].Trim();
+ if (parts.Length > 3) vendor = parts[3].Trim();
+ }
+ if (format.Length == 0 && id.IndexOf('-') is var dash and > 0) format = id[..dash];
+ if (format == "AudioUnit") format = "AU";
+ if (string.IsNullOrWhiteSpace(name)) name = deviceIndex < 0 ? "Plug-in instrument" : "Plug-in";
+ return new PluginInfo(name, vendor, format, deviceIndex < 0);
+ }
+}
+
+internal static class PluginCard
+{
+ public const double MiniWidth = 260, FullWidth = 700;
+ private const double InfoW = 196, ScW = 128, CellW = 58, CellH = 53;
+
+ /// <summary>Per-card view state the chain view keeps across rebuilds.</summary>
+ internal sealed class ViewState { public bool Mini = true; public int Page; public string Filter = ""; }
+
+ public static Control Build(DeviceCardContext ctx, int di, PluginInfo info, ViewState state)
+ {
+ if (state.Mini) return Section(InfoColumn(ctx, di, info, mini: true));
+
+ var e = ctx.Engine; int t = ctx.TrackId;
+ bool sidechain = di >= 0 && e.DeviceAcceptsSidechain(t, di);
+ var grid = new Grid { ColumnDefinitions = new ColumnDefinitions(sidechain ? $"{InfoW},*,{ScW}" : $"{InfoW},*"), ColumnSpacing = 5 };
+ grid.Children.Add(Section(InfoColumn(ctx, di, info, mini: false)));
+ var pars = Section(Params(ctx, di, state)); Grid.SetColumn(pars, 1); grid.Children.Add(pars);
+ if (sidechain)
+ {
+ var sc = Section(DeviceParamControls.SidechainSelector(ctx, di), pad: 6);
+ Grid.SetColumn(sc, 2); grid.Children.Add(sc);
+ }
+ return grid;
+ }
+
+ // ---- who it is + the two actions ------------------------------------------
+
+ private static Control InfoColumn(DeviceCardContext ctx, int di, PluginInfo info, bool mini)
+ {
+ var e = ctx.Engine; int t = ctx.TrackId;
+
+ var name = new TextBlock
+ {
+ Text = info.Name, FontSize = NotaType.Heading, FontWeight = FontWeight.SemiBold, Foreground = TextPrimary,
+ TextTrimming = TextTrimming.CharacterEllipsis,
+ };
+ ToolTip.SetTip(name, info.Name);
+ var vendor = new TextBlock
+ {
+ Text = info.Vendor.Length > 0 ? info.Vendor : "Unknown vendor", FontSize = NotaType.Body,
+ Foreground = info.Vendor.Length > 0 ? TextSecondary : TextTertiary, TextTrimming = TextTrimming.CharacterEllipsis,
+ };
+ var tags = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, Margin = new Thickness(0, 4, 0, 0) };
+ if (info.Format.Length > 0) tags.Children.Add(Tag(info.Format));
+ tags.Children.Add(Tag(info.IsInstrument ? "INSTRUMENT" : "EFFECT"));
+
+ int pc = e.PluginParamCount(t, di);
+ double ms = e.SampleRate > 0 ? e.TrackLatencySamples(t) / e.SampleRate * 1000.0 : 0;
+ var facts = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), RowDefinitions = new RowDefinitions("Auto,Auto"), RowSpacing = 3, Margin = new Thickness(0, 8, 0, 0) };
+ Fact(facts, 0, "PARAMS", pc.ToString(NotaNum.Culture));
+ Fact(facts, 1, "LATENCY", $"{ms.ToString("0.0", NotaNum.Culture)}\u2009ms");
+
+ var open = ActionButton("Open editor", GlyphKind.PopOut, primary: true);
+ ToolTip.SetTip(open, "Open the plug-in's own window");
+ open.Click += (_, _) => { try { e.OpenPluginEditor(t, di); } catch { /* no editor */ } };
+ var save = ActionButton("Save preset", GlyphKind.Save, primary: false);
+ ToolTip.SetTip(save, "Save the plug-in's state as a preset");
+ save.Click += (_, _) => ctx.RequestPresetSave(di);
+
+ var top = new StackPanel { Spacing = 1, Children = { name, vendor, tags, facts } };
+ var actions = new StackPanel { Spacing = 5, Children = { open, save } };
+ if (mini && di >= 0 && e.DeviceAcceptsSidechain(t, di)) actions.Children.Insert(0, SidechainLine(e, t, di));
+ var col = new DockPanel { LastChildFill = true };
+ DockPanel.SetDock(actions, Dock.Bottom);
+ col.Children.Add(actions);
+ col.Children.Add(top);
+ return col;
+ }
+
+ // S has no room for the sidechain controls: it names the source; L edits it.
+ private static Control SidechainLine(IAudioEngine e, int t, int di)
+ {
+ int src = e.DeviceSidechainSource(t, di);
+ string label = "None";
+ for (int i = 0, n = e.TrackCount; i < n && src >= 0; i++)
+ if (e.TryGetTrackInfo(i, out var ti) && ti.Id == src) { label = TrackNames.Of(e, ti); break; }
+ var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), Margin = new Thickness(0, 0, 0, 3) };
+ Fact(g, 0, "SIDECHAIN", label);
+ return g;
+ }
+
+ private static void Fact(Grid g, int row, string label, string value)
+ {
+ if (g.RowDefinitions.Count <= row) g.RowDefinitions.Add(new RowDefinition(GridLength.Auto));
+ var l = new TextBlock
+ {
+ Text = label, FontSize = NotaType.RowLabel, FontWeight = FontWeight.Bold, LetterSpacing = NotaType.RowLabelTracking,
+ Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 0, 10, 0),
+ };
+ var v = new TextBlock
+ {
+ Text = value, FontFamily = NotaFonts.MonoFamily, FontSize = NotaType.Value, Foreground = TextPrimary,
+ HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis,
+ };
+ Grid.SetRow(l, row); Grid.SetRow(v, row); Grid.SetColumn(v, 1);
+ g.Children.Add(l); g.Children.Add(v);
+ }
+
+ private static Border Tag(string text) => new()
+ {
+ BorderBrush = BorderStrong, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge,
+ Padding = new Thickness(4, 1), VerticalAlignment = VerticalAlignment.Center,
+ Child = new TextBlock
+ {
+ Text = text.ToUpperInvariant(), FontFamily = NotaFonts.MonoFamily, FontSize = NotaType.KnobLabel,
+ FontWeight = FontWeight.Medium, LetterSpacing = 0.8, Foreground = TextSecondary,
+ },
+ };
+
+ private static Button ActionButton(string text, GlyphKind glyph, bool primary)
+ {
+ var b = new Button
+ {
+ HorizontalAlignment = HorizontalAlignment.Stretch, HorizontalContentAlignment = HorizontalAlignment.Center,
+ Content = new StackPanel
+ {
+ Orientation = Orientation.Horizontal, Spacing = 6,
+ Children = { new Glyph(glyph, 10) { VerticalAlignment = VerticalAlignment.Center }, new TextBlock { Text = text, VerticalAlignment = VerticalAlignment.Center } },
+ },
+ };
+ if (primary) b.Classes.Add("primary");
+ return b;
+ }
+
+ // ---- parameters: search + pages of knobs ------------------------------------
+
+ private static Control Params(DeviceCardContext ctx, int di, ViewState state)
+ {
+ var e = ctx.Engine; int t = ctx.TrackId;
+ int total = e.PluginParamCount(t, di);
+ var names = new string[total];
+ for (int i = 0; i < total; i++) names[i] = e.PluginParamName(t, di, i);
+
+ var title = new TextBlock
+ {
+ Text = "PARAMETERS", FontSize = NotaType.DeviceSection, FontWeight = FontWeight.Bold,
+ LetterSpacing = NotaType.DeviceSectionTracking, Foreground = TextSecondary, VerticalAlignment = VerticalAlignment.Center,
+ };
+ var count = new TextBlock { FontFamily = NotaFonts.MonoFamily, FontSize = NotaType.KnobValue, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(6, 0, 0, 0) };
+
+ var search = new TextBox { Watermark = "Filter", Text = state.Filter, FontSize = 9, Classes = { "search" }, VerticalAlignment = VerticalAlignment.Center };
+ var searchWrap = new Border
+ {
+ Width = 116, Height = 18, Background = Sunken, BorderBrush = BorderDef, BorderThickness = new Thickness(1),
+ CornerRadius = NotaRadius.Control, Padding = new Thickness(6, 0), Child = search,
+ };
+ search.GotFocus += (_, _) => searchWrap.BorderBrush = NotaPalette.Accent;
+ search.LostFocus += (_, _) => searchWrap.BorderBrush = BorderDef;
+
+ var pageText = new TextBlock { FontFamily = NotaFonts.MonoFamily, FontSize = NotaType.KnobValue, Foreground = TextSecondary, VerticalAlignment = VerticalAlignment.Center, MinWidth = 30, TextAlignment = TextAlignment.Center };
+ var host = new ContentControl();
+ int perPage = 1, gen = 0;
+ var matches = new List<int>();
+
+ void Render()
+ {
+ gen++; // stale knobs stop following once their page is gone
+ matches.Clear();
+ string f = state.Filter.Trim();
+ for (int i = 0; i < total; i++)
+ if (f.Length == 0 || names[i].Contains(f, StringComparison.OrdinalIgnoreCase)) matches.Add(i);
+ int pages = Math.Max(1, (matches.Count + perPage - 1) / perPage);
+ state.Page = Math.Clamp(state.Page, 0, pages - 1);
+ pageText.Text = $"{state.Page + 1}/{pages}";
+ count.Text = f.Length == 0 ? total.ToString(NotaNum.Culture) : $"{matches.Count}/{total}";
+
+ if (matches.Count == 0)
+ {
+ host.Content = new TextBlock
+ {
+ Text = total == 0 ? "This plug-in exposes no parameters" : "No parameter matches",
+ FontSize = 9, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,
+ };
+ return;
+ }
+ var wrap = new WrapPanel { HorizontalAlignment = HorizontalAlignment.Center, ItemHeight = CellH + 6 };
+ int myGen = gen;
+ for (int k = state.Page * perPage; k < Math.Min(matches.Count, (state.Page + 1) * perPage); k++)
+ wrap.Children.Add(ParamKnob(ctx, di, matches[k], names[matches[k]], () => myGen == gen));
+ host.Content = wrap;
+ }
+ void Step(int dir)
+ {
+ int pages = Math.Max(1, (matches.Count + perPage - 1) / perPage);
+ int next = Math.Clamp(state.Page + dir, 0, pages - 1);
+ if (next != state.Page) { state.Page = next; Render(); }
+ }
+
+ search.TextChanged += (_, _) => { if (state.Filter == search.Text) return; state.Filter = search.Text ?? ""; state.Page = 0; Render(); };
+ var prev = Glyph(GlyphKind.ChevronLeft, true, () => Step(-1));
+ var next = Glyph(GlyphKind.ChevronRight, true, () => Step(+1));
+ ToolTip.SetTip(prev, "Previous page"); ToolTip.SetTip(next, "Next page");
+
+ var head = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto,Auto,Auto,Auto"), Height = 22 };
+ head.Children.Add(title);
+ Grid.SetColumn(count, 1); head.Children.Add(count);
+ Grid.SetColumn(searchWrap, 2); searchWrap.Margin = new Thickness(0, 0, 8, 0); head.Children.Add(searchWrap);
+ Grid.SetColumn(prev, 3); head.Children.Add(prev);
+ Grid.SetColumn(pageText, 4); head.Children.Add(pageText);
+ Grid.SetColumn(next, 5); head.Children.Add(next);
+
+ // The page holds as many knobs as the section fits; wheel over it turns the page.
+ var body = new Border { Background = Brushes.Transparent, Padding = new Thickness(0, 4, 0, 0), Child = host };
+ body.PointerWheelChanged += (_, ev) => { Step(ev.Delta.Y < 0 ? +1 : -1); ev.Handled = true; };
+ body.SizeChanged += (_, ev) =>
+ {
+ int cols = Math.Max(1, (int)(ev.NewSize.Width / CellW));
+ int rows = Math.Max(1, (int)((ev.NewSize.Height - 4) / (CellH + 6)));
+ int fit = cols * rows;
+ if (fit != perPage) { perPage = fit; state.Page = Math.Min(state.Page, Math.Max(0, (matches.Count - 1) / perPage)); Render(); }
+ };
+
+ var col = new DockPanel { LastChildFill = true };
+ var headStrip = new Border { BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 0, 1), Child = head };
+ DockPanel.SetDock(headStrip, Dock.Top);
+ col.Children.Add(headStrip);
+ col.Children.Add(body);
+ Render();
+ return col;
+ }
+
+ // One plug-in parameter as the shared gauge knob: the plug-in's own value text, its
+ // default on double-click, automation-write gestures, MIDI Learn and live follow.
+ private static Control ParamKnob(DeviceCardContext ctx, int di, int p, string name, Func<bool> live)
+ {
+ var e = ctx.Engine; int t = ctx.TrackId;
+ string pid = e.PluginParamId(t, di, p);
+ string Text(float v) { string s = e.PluginParamText(t, di, p); return s.Length > 0 ? s : Pct(v); }
+
+ float v0 = e.PluginParamGet(t, di, p);
+ var value = new TextBlock { Text = Text(v0), Foreground = TextPrimary, TextTrimming = TextTrimming.CharacterEllipsis, MaxWidth = CellW - 2 };
+ var knob = new Knob(v0, 1.0) { Accent = true, Default = e.PluginParamDefault(t, di, p), Width = Knob.SizeSecondary, Height = Knob.SizeSecondary };
+ knob.ValueChanged += v => { e.PluginParamSet(t, di, p, (float)v); value.Text = Text((float)v); ctx.NotifyChanged(); };
+ knob.GestureBegin += () => e.BeginAutomationWrite(t, AutomationTarget.PluginParam, di, -1, pid);
+ knob.GestureEnd += () => e.EndAutomationWrite(t, AutomationTarget.PluginParam, di, -1, pid);
+ MidiLearn.Bind(knob, MidiTarget.PluginParam(t, di, p), name);
+ ctx.AddDeviceRefresher(() =>
+ {
+ if (!live() || knob.Dragging) return;
+ float v = e.PluginParamGet(t, di, p);
+ if (Math.Abs(v - knob.Value) > 1e-4) { knob.Value = v; value.Text = Text(v); }
+ });
+ var cell = KnobCell(name, knob, value, CellW);
+ ToolTip.SetTip(cell, name);
+ return cell;
+ }
+
+ // A device section: card ground, hairline, radius 6.
+ private static Border Section(Control child, double pad = 8) => new()
+ {
+ Background = NotaPalette.SurfaceCard, BorderBrush = BorderDef, BorderThickness = new Thickness(1),
+ CornerRadius = NotaRadius.Panel, Padding = new Thickness(pad, 6, pad, pad), ClipToBounds = true, Child = child,
+ };
+}
diff --git a/src/managed/Nota.App/DeviceChainView.Instruments.cs b/src/managed/Nota.App/DeviceChainView.Instruments.cs
index 37b1d383..5c4bc9c6 100644
--- a/src/managed/Nota.App/DeviceChainView.Instruments.cs
+++ b/src/managed/Nota.App/DeviceChainView.Instruments.cs
@@ -18,6 +18,7 @@ public sealed partial class DeviceChainView
int kind = _engine.TrackInstrumentKind(_trackId);
if (kind == 3) return new RackCardView(NewCardContext()).BuildInstrumentRackCard(); // Instrument Rack
if (kind == 4) return DrumRackCard();
+ if (kind == -1) return PluginCardFor(ChainKind.Instrument, -1, 1); // hosted VST3 / AU
// Built-in Sampler + synths (Synth/Physical/Aurora/Volt) → their strategy; anything
// else (or a synth reporting no params) → the generic Open-GUI card.
bool hasParams = _engine.PluginParamCount(_trackId, -1) > 0;
diff --git a/src/managed/Nota.App/DeviceChainView.Plugin.cs b/src/managed/Nota.App/DeviceChainView.Plugin.cs
new file mode 100644
index 00000000..0db24866
--- /dev/null
+++ b/src/managed/Nota.App/DeviceChainView.Plugin.cs
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+//
+// Detail · Devices — a hosted plug-in (VST3 / AU) in the shared shell: the header names the
+// plug-in and its format, the S / L toggle picks the card size (see PluginCard). The size,
+// page and filter ride on the card's extra, so they follow the device through moves.
+
+using Avalonia;
+using Avalonia.Controls;
+
+namespace Nota.App;
+
+public sealed partial class DeviceChainView
+{
+ private Control PluginCardFor(ChainKind k, int di, int count)
+ {
+ var state = Extra(k, di).Plugin;
+ var ctx = NewCardContext();
+ var info = PluginInfo.Of(_engine, _trackId, di);
+ var body = PluginCard.Build(ctx, di, info, state);
+ double width = state.Mini ? PluginCard.MiniWidth : PluginCard.FullWidth;
+ var toggle = MidiCardHeader.SizeToggle(ctx, () => state.Mini, m => state.Mini = m);
+ bool effect = k == ChainKind.Effect;
+ var spec = new ShellSpec(
+ Name: info.Name, Subtitle: info.Format, DeviceIndex: di, Count: count,
+ Bypassed: effect && _engine.DeviceBypassed(_trackId, di), Bypassable: effect,
+ CanMove: effect, CanDelete: effect, PresetKind: -1, IsInstrument: !effect, Width: width, Kind: k,
+ HeaderExtra: toggle, Compact: state.Mini);
+ return BuildCardShell(spec, new Border { Padding = new Thickness(NotaSpace.DeviceInset), Child = body });
+ }
+}
diff --git a/src/managed/Nota.App/DeviceChainView.Shell.cs b/src/managed/Nota.App/DeviceChainView.Shell.cs
index 17e383a2..cd619fc8 100644
--- a/src/managed/Nota.App/DeviceChainView.Shell.cs
+++ b/src/managed/Nota.App/DeviceChainView.Shell.cs
@@ -38,7 +38,7 @@ public sealed partial class DeviceChainView
// back restores them, and keyed so a MIDI effect and an audio effect at the same index
// don't collide. Sig ties an entry to the device it was made for: when that slot now
// holds a different device (swapped, removed behind our back, undo), the card starts fresh.
- private sealed class CardExtra { public string Sig = ""; public float[]? A, B; public int Active; public string Preset = "", PresetId = ""; }
+ private sealed class CardExtra { public string Sig = ""; public float[]? A, B; public int Active; public string Preset = "", PresetId = ""; public PluginCard.ViewState Plugin = new(); }
private readonly System.Collections.Generic.Dictionary<int, System.Collections.Generic.Dictionary<int, CardExtra>> _cardExtra = new(); // trackId → key → extra
private static int ExtraKey(ChainKind k, int di) => k switch { ChainKind.Instrument => -1, ChainKind.Midi => -1000 - di, _ => di };
private static ChainKind KeyKind(int key) => key >= 0 ? ChainKind.Effect : key == -1 ? ChainKind.Instrument : ChainKind.Midi;
diff --git a/src/managed/Nota.App/DeviceChainView.cs b/src/managed/Nota.App/DeviceChainView.cs
index f684c66b..dc8148f7 100644
--- a/src/managed/Nota.App/DeviceChainView.cs
+++ b/src/managed/Nota.App/DeviceChainView.cs
@@ -176,6 +176,7 @@ public sealed partial class DeviceChainView : UserControl
double width;
bool fullBleed = false;
string tag = kind >= 0 ? "BUILT-IN" : "PLUGIN";
+ if (kind == -1) return PluginCardFor(ChainKind.Effect, index, count); // hosted VST3 / AU
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;
diff --git a/src/managed/Nota.App/MainWindow.Browser.cs b/src/managed/Nota.App/MainWindow.Browser.cs
index a3f0beec..0ef204c0 100644
--- a/src/managed/Nota.App/MainWindow.Browser.cs
+++ b/src/managed/Nota.App/MainWindow.Browser.cs
@@ -298,7 +298,8 @@ public partial class MainWindow
int trackId = _deviceChain.TrackId;
if (trackId <= 0) { _vm.StatusText = "Select a track first."; return; }
- string label = deviceIndex < 0 ? "Instrument" : Engine.DeviceName(trackId, deviceIndex);
+ string label = Engine.DeviceName(trackId, deviceIndex);
+ if (string.IsNullOrEmpty(label)) label = "Instrument";
var name = await new TextPromptWindow("Save preset", "Preset name", label).ShowDialog<string?>(this);
if (string.IsNullOrEmpty(name)) return;
diff --git a/src/managed/Nota.Application/Engine/IAudioEngine.cs b/src/managed/Nota.Application/Engine/IAudioEngine.cs
index bdc1d9fa..abe625a3 100644
--- a/src/managed/Nota.Application/Engine/IAudioEngine.cs
+++ b/src/managed/Nota.Application/Engine/IAudioEngine.cs
@@ -811,6 +811,10 @@ public interface IAudioEngine : IDisposable
string PluginParamId(int trackId, int deviceIndex, int paramIndex);
string PluginParamName(int trackId, int deviceIndex, int paramIndex);
float PluginParamGet(int trackId, int deviceIndex, int paramIndex);
+ /// <summary>The plugin's own text for a param's current value ("−12.0 dB"), or "" when it has none.</summary>
+ string PluginParamText(int trackId, int deviceIndex, int paramIndex);
+ /// <summary>The plugin's default for a param, normalized 0..1.</summary>
+ float PluginParamDefault(int trackId, int deviceIndex, int paramIndex);
void PluginParamSet(int trackId, int deviceIndex, int paramIndex, float normalized);
int AddPluginAutomationLane(int trackId, int deviceIndex, string paramId);
string AutomationLaneParamId(int trackId, int laneIndex);
diff --git a/src/managed/Nota.Infrastructure/Interop/NativeMethods.Devices.cs b/src/managed/Nota.Infrastructure/Interop/NativeMethods.Devices.cs
index 79c38a5b..bfff0ac2 100644
--- a/src/managed/Nota.Infrastructure/Interop/NativeMethods.Devices.cs
+++ b/src/managed/Nota.Infrastructure/Interop/NativeMethods.Devices.cs
@@ -221,6 +221,12 @@ internal static partial class NativeMethods
[LibraryImport(Lib, EntryPoint = "nota_plugin_param_name")]
internal static partial IntPtr PluginParamName(IntPtr engine, int trackId, int deviceIndex, int paramIndex);
+ [LibraryImport(Lib, EntryPoint = "nota_plugin_param_text")]
+ internal static partial IntPtr PluginParamText(IntPtr engine, int trackId, int deviceIndex, int paramIndex);
+
+ [LibraryImport(Lib, EntryPoint = "nota_plugin_param_default")]
+ internal static partial float PluginParamDefault(IntPtr engine, int trackId, int deviceIndex, int paramIndex);
+
[LibraryImport(Lib, EntryPoint = "nota_plugin_param_get")]
internal static partial float PluginParamGet(IntPtr engine, int trackId, int deviceIndex, int paramIndex);
diff --git a/src/managed/Nota.Infrastructure/Interop/NotaEngine.Devices.cs b/src/managed/Nota.Infrastructure/Interop/NotaEngine.Devices.cs
index 2548e8e4..3af5e766 100644
--- a/src/managed/Nota.Infrastructure/Interop/NotaEngine.Devices.cs
+++ b/src/managed/Nota.Infrastructure/Interop/NotaEngine.Devices.cs
@@ -268,6 +268,10 @@ public sealed partial class NotaEngine
{ ThrowIfDisposed(); return Marshal.PtrToStringUTF8(NativeMethods.PluginParamId(_handle, trackId, deviceIndex, paramIndex)) ?? ""; }
public string PluginParamName(int trackId, int deviceIndex, int paramIndex)
{ ThrowIfDisposed(); return Marshal.PtrToStringUTF8(NativeMethods.PluginParamName(_handle, trackId, deviceIndex, paramIndex)) ?? ""; }
+ public string PluginParamText(int trackId, int deviceIndex, int paramIndex)
+ { ThrowIfDisposed(); return Marshal.PtrToStringUTF8(NativeMethods.PluginParamText(_handle, trackId, deviceIndex, paramIndex)) ?? ""; }
+ public float PluginParamDefault(int trackId, int deviceIndex, int paramIndex)
+ { ThrowIfDisposed(); return NativeMethods.PluginParamDefault(_handle, trackId, deviceIndex, paramIndex); }
public float PluginParamGet(int trackId, int deviceIndex, int paramIndex)
{ ThrowIfDisposed(); return NativeMethods.PluginParamGet(_handle, trackId, deviceIndex, paramIndex); }
public void PluginParamSet(int trackId, int deviceIndex, int paramIndex, float normalized)
diff --git a/src/native/nota.engine/include/nota/nota_engine.h b/src/native/nota.engine/include/nota/nota_engine.h
index 88ce8916..9b88df52 100644
--- a/src/native/nota.engine/include/nota/nota_engine.h
+++ b/src/native/nota.engine/include/nota/nota_engine.h
@@ -325,6 +325,10 @@ NOTA_API NotaResult nota_engine_master_volume_automation_set(NotaEngine* engine,
NOTA_API int32_t nota_plugin_param_count(const NotaEngine* engine, int32_t track_id, int32_t device_index);
NOTA_API const char* nota_plugin_param_id(const NotaEngine* engine, int32_t track_id, int32_t device_index, int32_t param_index);
NOTA_API const char* nota_plugin_param_name(const NotaEngine* engine, int32_t track_id, int32_t device_index, int32_t param_index);
+/* The plugin's display text for a param's current value ("-12.0 dB", unit appended), and its
+ * normalized default. Engine-owned string, valid until the next call. */
+NOTA_API const char* nota_plugin_param_text(const NotaEngine* engine, int32_t track_id, int32_t device_index, int32_t param_index);
+NOTA_API float nota_plugin_param_default(const NotaEngine* engine, int32_t track_id, int32_t device_index, int32_t param_index);
NOTA_API float nota_plugin_param_get(const NotaEngine* engine, int32_t track_id, int32_t device_index, int32_t param_index);
NOTA_API NotaResult nota_plugin_param_set(NotaEngine* engine, int32_t track_id, int32_t device_index, int32_t param_index, float normalized);
/* Add (or reuse) a PluginParam automation lane bound to a stable paramID; the
diff --git a/src/native/nota.engine/pluginhost/PluginHost.cpp b/src/native/nota.engine/pluginhost/PluginHost.cpp
index 0a67f6f3..c4ed87ba 100644
--- a/src/native/nota.engine/pluginhost/PluginHost.cpp
+++ b/src/native/nota.engine/pluginhost/PluginHost.cpp
@@ -490,6 +490,22 @@ std::string paramNameImpl(juce::AudioPluginInstance* p, int32_t i) {
if (i < 0 || i >= params.size()) return {};
return params[i]->getName(64).toStdString();
}
+std::string paramTextImpl(juce::AudioPluginInstance* p, int32_t i) {
+ if (p == nullptr) return {};
+ const auto& params = p->getParameters();
+ if (i < 0 || i >= params.size()) return {};
+ auto* prm = params[i];
+ juce::String text = prm->getCurrentValueAsText().trim();
+ juce::String unit = prm->getLabel().trim();
+ if (text.isNotEmpty() && unit.isNotEmpty() && !text.endsWithIgnoreCase(unit)) text << " " << unit;
+ return text.toStdString();
+}
+float paramDefaultImpl(juce::AudioPluginInstance* p, int32_t i) {
+ if (p == nullptr) return 0.0f;
+ const auto& params = p->getParameters();
+ if (i < 0 || i >= params.size()) return 0.0f;
+ return params[i]->getDefaultValue();
+}
float paramGetImpl(juce::AudioPluginInstance* p, int32_t i) {
if (p == nullptr) return 0.0f;
const auto& params = p->getParameters();
@@ -620,6 +636,8 @@ public:
int32_t pluginParamCount() const override { return paramCountImpl(plugin_.get()); }
std::string pluginParamId(int32_t i) const override { return paramIdImpl(plugin_.get(), i); }
std::string pluginParamName(int32_t i) const override { return paramNameImpl(plugin_.get(), i); }
+ std::string pluginParamText(int32_t i) const override { return paramTextImpl(plugin_.get(), i); }
+ float pluginParamDefault(int32_t i) const override { return paramDefaultImpl(plugin_.get(), i); }
float pluginParamGet(int32_t i) const override { return paramGetImpl(plugin_.get(), i); }
void pluginParamSet(int32_t i, float v) override { paramSetImpl(plugin_.get(), i, v); }
int32_t pluginParamIndexOfId(const std::string& id) const override { return paramIndexOfIdImpl(plugin_.get(), id); }
@@ -772,6 +790,8 @@ public:
int32_t pluginParamCount() const override { return paramCountImpl(plugin_.get()); }
std::string pluginParamId(int32_t i) const override { return paramIdImpl(plugin_.get(), i); }
std::string pluginParamName(int32_t i) const override { return paramNameImpl(plugin_.get(), i); }
+ std::string pluginParamText(int32_t i) const override { return paramTextImpl(plugin_.get(), i); }
+ float pluginParamDefault(int32_t i) const override { return paramDefaultImpl(plugin_.get(), i); }
float pluginParamGet(int32_t i) const override { return paramGetImpl(plugin_.get(), i); }
void pluginParamSet(int32_t i, float v) override { paramSetImpl(plugin_.get(), i, v); }
int32_t pluginParamIndexOfId(const std::string& id) const override { return paramIndexOfIdImpl(plugin_.get(), id); }
diff --git a/src/native/nota.engine/src/Device.h b/src/native/nota.engine/src/Device.h
index 3b489896..63441f7c 100644
--- a/src/native/nota.engine/src/Device.h
+++ b/src/native/nota.engine/src/Device.h
@@ -75,6 +75,10 @@ public:
virtual std::string pluginParamId(int32_t index) const { (void)index; return {}; }
virtual std::string pluginParamName(int32_t index) const { (void)index; return {}; }
virtual float pluginParamGet(int32_t index) const { (void)index; return 0.0f; }
+ // The plugin's own display text for the current value ("-12.0 dB"), and its default
+ // (normalized). Message thread; empty / 0 when the device has no such param.
+ virtual std::string pluginParamText(int32_t index) const { (void)index; return {}; }
+ virtual float pluginParamDefault(int32_t index) const { (void)index; return 0.0f; }
virtual void pluginParamSet(int32_t index, float normalized) { (void)index; (void)normalized; }
virtual int32_t pluginParamIndexOfId(const std::string& id) const { (void)id; return -1; }
// "Learn" (M9-B3): index of the parameter last moved in the plugin's own GUI
diff --git a/src/native/nota.engine/src/Engine.h b/src/native/nota.engine/src/Engine.h
index 4d1b7396..87ba57ff 100644
--- a/src/native/nota.engine/src/Engine.h
+++ b/src/native/nota.engine/src/Engine.h
@@ -224,6 +224,8 @@ public:
int32_t pluginParamCount(int32_t trackId, int32_t deviceIndex) const;
std::string pluginParamId(int32_t trackId, int32_t deviceIndex, int32_t paramIndex) const;
std::string pluginParamName(int32_t trackId, int32_t deviceIndex, int32_t paramIndex) const;
+ std::string pluginParamText(int32_t trackId, int32_t deviceIndex, int32_t paramIndex) const;
+ float pluginParamDefault(int32_t trackId, int32_t deviceIndex, int32_t paramIndex) const;
float pluginParamGet(int32_t trackId, int32_t deviceIndex, int32_t paramIndex) const;
void pluginParamSet(int32_t trackId, int32_t deviceIndex, int32_t paramIndex, float normalized);
int32_t pluginParamIndexOfId(int32_t trackId, int32_t deviceIndex, const std::string& id) const;
diff --git a/src/native/nota.engine/src/Engine_Automation.cpp b/src/native/nota.engine/src/Engine_Automation.cpp
index ae348379..eee2fd1d 100644
--- a/src/native/nota.engine/src/Engine_Automation.cpp
+++ b/src/native/nota.engine/src/Engine_Automation.cpp
@@ -127,6 +127,22 @@ std::string Engine::pluginParamName(int32_t trackId, int32_t deviceIndex, int32_
auto& d = t->devices[deviceIndex];
return d ? d->pluginParamName(paramIndex) : std::string{};
}
+std::string Engine::pluginParamText(int32_t trackId, int32_t deviceIndex, int32_t paramIndex) const {
+ auto t = findTrackAuthoring(trackId);
+ if (!t) return {};
+ if (deviceIndex < 0) return t->instrument ? t->instrument->pluginParamText(paramIndex) : std::string{};
+ if (deviceIndex >= static_cast<int32_t>(t->devices.size())) return {};
+ auto& d = t->devices[deviceIndex];
+ return d ? d->pluginParamText(paramIndex) : std::string{};
+}
+float Engine::pluginParamDefault(int32_t trackId, int32_t deviceIndex, int32_t paramIndex) const {
+ auto t = findTrackAuthoring(trackId);
+ if (!t) return 0.0f;
+ if (deviceIndex < 0) return t->instrument ? t->instrument->pluginParamDefault(paramIndex) : 0.0f;
+ if (deviceIndex >= static_cast<int32_t>(t->devices.size())) return 0.0f;
+ auto& d = t->devices[deviceIndex];
+ return d ? d->pluginParamDefault(paramIndex) : 0.0f;
+}
float Engine::pluginParamGet(int32_t trackId, int32_t deviceIndex, int32_t paramIndex) const {
auto t = findTrackAuthoring(trackId);
if (!t) return 0.0f;
diff --git a/src/native/nota.engine/src/Instrument.h b/src/native/nota.engine/src/Instrument.h
index ec4f235c..2080b298 100644
--- a/src/native/nota.engine/src/Instrument.h
+++ b/src/native/nota.engine/src/Instrument.h
@@ -105,6 +105,10 @@ public:
virtual std::string pluginParamId(int32_t index) const { (void)index; return {}; }
virtual std::string pluginParamName(int32_t index) const { (void)index; return {}; }
virtual float pluginParamGet(int32_t index) const { (void)index; return 0.0f; }
+ // The plugin's own display text for the current value ("-12.0 dB"), and its default
+ // (normalized). Message thread; empty / 0 when the device has no such param.
+ virtual std::string pluginParamText(int32_t index) const { (void)index; return {}; }
+ virtual float pluginParamDefault(int32_t index) const { (void)index; return 0.0f; }
virtual void pluginParamSet(int32_t index, float normalized) { (void)index; (void)normalized; }
virtual int32_t pluginParamIndexOfId(const std::string& id) const { (void)id; return -1; }
// "Learn" (M9-B3): index of the parameter last moved in the plugin's own GUI
diff --git a/src/native/nota.engine/src/nota_engine_device.cpp b/src/native/nota.engine/src/nota_engine_device.cpp
index 59d2dac6..22d1ebf7 100644
--- a/src/native/nota.engine/src/nota_engine_device.cpp
+++ b/src/native/nota.engine/src/nota_engine_device.cpp
@@ -360,6 +360,14 @@ const char* nota_plugin_param_name(const NotaEngine* e, int32_t track_id, int32_
s = e ? CENG(e)->pluginParamName(track_id, device_index, param_index) : std::string{};
return s.c_str();
}
+const char* nota_plugin_param_text(const NotaEngine* e, int32_t track_id, int32_t device_index, int32_t param_index) {
+ static std::string s; // owned by the engine, valid until the next call
+ s = e ? CENG(e)->pluginParamText(track_id, device_index, param_index) : std::string{};
+ return s.c_str();
+}
+float nota_plugin_param_default(const NotaEngine* e, int32_t track_id, int32_t device_index, int32_t param_index) {
+ return e ? CENG(e)->pluginParamDefault(track_id, device_index, param_index) : 0.0f;
+}
float nota_plugin_param_get(const NotaEngine* e, int32_t track_id, int32_t device_index, int32_t param_index) {
return e ? CENG(e)->pluginParamGet(track_id, device_index, param_index) : 0.0f;
}
diff --git a/tests/Nota.SmokeTest/DesignTokenCheck.cs b/tests/Nota.SmokeTest/DesignTokenCheck.cs
index ed5f0156..2380a97e 100644
--- a/tests/Nota.SmokeTest/DesignTokenCheck.cs
+++ b/tests/Nota.SmokeTest/DesignTokenCheck.cs
@@ -382,9 +382,9 @@ internal static class DesignTokenCheck
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
- // Bass and Physical instruments keep their wider layouts.
- var exempt = new HashSet<string> { "PluginDeviceBody.cs", "GenericParamDeviceBody.cs", "GenericMidiBody.cs",
+ // Accepted exceptions (decided 2026-09-16): parameter stubs are narrow; the Bass and
+ // Physical instruments keep their wider layouts. (Plug-ins are S 260 / L 700.)
+ var exempt = new HashSet<string> { "GenericParamDeviceBody.cs", "GenericMidiBody.cs",
"BassInstrumentCard.cs", "PhysicalInstrumentCard.cs" };
var off = Directory.EnumerateFiles(Path.Combine(app, "DeviceCards"), "*.cs", SearchOption.AllDirectories)
.Where(f => !exempt.Contains(Path.GetFileName(f)))