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
(feat) Type a slider's value
Egor Khindikaynenf3994ae47d69
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 993ac17a..7585e96a 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -19,6 +19,9 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.## [Unreleased]### Added+- **Type a slider's value:** double-click the number next to a slider in a device card,+ the clip editor or a rack macro and type the value you want — "−6", "1.5k", "250 ms",+ "L 30", "1/16". Return sets it, Esc cancels.- **Nota Remote — your phone as a controller:** the **Remote** button in the top bar (or**View → Connect Phone…**) shows a QR code; scan it with a phone and in five seconds thephone plays Nota — pads, keys with the project's scale and chords, an XY pad with tilt, thediff --git a/src/managed/Nota.App/ClipEditorKit.cs b/src/managed/Nota.App/ClipEditorKit.csindex 6d112341..ff1cef71 100644--- a/src/managed/Nota.App/ClipEditorKit.cs+++ b/src/managed/Nota.App/ClipEditorKit.cs@@ -322,7 +322,7 @@ internal static class ClipEditorKitCornerRadius = NotaRadius.Control, Padding = new Thickness(10, 0), Child = child,};- /// <summary>A shell slider row: caps label · 3px track · fixed-width mono value.</summary>+ /// <summary>A shell slider row: caps label · 3px track · fixed-width mono value (double-click to type).</summary>public static Grid SliderRow(string label, double labelW, Func<double> norm, Action<double> setNorm, Func<string> text,out Action sync, Action? reset = null, double valueW = 36, Func<bool>? dim = null){@@ -347,6 +347,7 @@ internal static class ClipEditorKit}repaint = Paint;track.Changed += v => { setNorm(v); val.Text = text(); };+ ValueEntry.Attach(val, norm, setNorm, text, after: Paint);var g = new Grid { Height = 20, ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 10 };g.Children.Add(lbl);Grid.SetColumn(track, 1); g.Children.Add(track);diff --git a/src/managed/Nota.App/Controls/ValueEntry.cs b/src/managed/Nota.App/Controls/ValueEntry.csnew file mode 100644index 00000000..f5e81042--- /dev/null+++ b/src/managed/Nota.App/Controls/ValueEntry.cs@@ -0,0 +1,271 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// Double-click-to-type for a slider's value read-out (HANDOFF §4: "all numerics editable+// by drag (vertical) and double-click-type"). Double-clicking the read-out lays a flat+// text box over it (an adorner, so it works whatever panel the read-out sits in); Enter+// or a click away commits, Escape cancels.+//+// A slider works in normalised 0..1 and each row formats its own value, so there is no+// inverse mapping to call. Instead the typed text is read as a quantity (sign, number or+// fraction, unit multiplier — k, ms, µs; L/R for pan; ∞) and the slider position whose+// read-out shows that quantity is searched for: the read-out is sampled across the range,+// the bracketing step is bisected, and on a match the middle of the run of positions that+// display it is taken — so typing "0" lands on 0 dB, not on the edge of the "0.0" bucket.+// A word the read-out shows (off, HOLD) is matched as text. The search probes through the+// row's own setter, then the result is written inside one begin/end gesture.++using System;+using System.Collections.Generic;+using System.Globalization;+using System.Text.RegularExpressions;+using Avalonia;+using Avalonia.Controls;+using Avalonia.Controls.Primitives;+using Avalonia.Input;+using Avalonia.Interactivity;+using Avalonia.Layout;+using Avalonia.Media;+using Avalonia.Threading;+using Avalonia.VisualTree;++namespace Nota.App;++internal static partial class ValueEntry+{+ /// <summary>Make <paramref name="readout"/> typeable. <paramref name="norm"/> / <paramref name="setNorm"/>+ /// are the slider's 0..1 position, <paramref name="text"/> the read-out at the current position;+ /// <paramref name="after"/> repaints the row once the typed value is in.</summary>+ public static void Attach(TextBlock readout, Func<double> norm, Action<double> setNorm, Func<string> text,+ Action? begin = null, Action? end = null, Action? after = null)+ {+ readout.Background ??= Brushes.Transparent; // the whole column takes the double-click, not just the glyphs+ readout.AddHandler(InputElement.PointerPressedEvent, (_, e) =>+ {+ if (e.ClickCount != 2 || !e.GetCurrentPoint(readout).Properties.IsLeftButtonPressed) return;+ e.Handled = true;+ Open(readout, typed =>+ {+ double from = norm();+ double? to = Solve(typed, text(), n => { setNorm(n); return text(); });+ begin?.Invoke();+ setNorm(to ?? from);+ end?.Invoke();+ after?.Invoke();+ });+ }, RoutingStrategies.Bubble, handledEventsToo: false);+ }++ private static void Open(TextBlock readout, Action<string> commit)+ {+ if (AdornerLayer.GetAdornerLayer(readout) is null) return;+ double w = readout.Bounds.Width, extra = Math.Max(0, 48 - w);+ // The form field look (sunken well, brass edge while focused), shrunk to the read-out.+ var box = new TextBox+ {+ Classes = { "field" },+ Text = readout.Text, FontFamily = readout.FontFamily, FontSize = readout.FontSize,+ Height = readout.Bounds.Height + 6, Width = w + extra + 4, Padding = new Thickness(3, 0), MinWidth = 0,+ CornerRadius = NotaRadius.Badge,+ HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top,+ HorizontalContentAlignment = HorizontalAlignment.Right,+ // Grow to the left over the track when the read-out column is narrow, and a little taller than the text.+ Margin = new Thickness(-extra - 2, -3, 0, 0),+ };+ TopLevel? top = TopLevel.GetTopLevel(readout);+ bool done = false;+ EventHandler<PointerPressedEventArgs>? outside = null;+ EventHandler<VisualTreeAttachmentEventArgs>? gone = null;+ void Close(bool apply)+ {+ if (done) return;+ done = true;+ if (outside is not null) top?.RemoveHandler(InputElement.PointerPressedEvent, outside);+ readout.DetachedFromVisualTree -= gone;+ AdornerLayer.SetAdorner(readout, null);+ if (apply && !string.IsNullOrWhiteSpace(box.Text)) commit(box.Text!);+ }+ box.KeyDown += (_, e) =>+ {+ if (e.Key is Key.Enter or Key.Return) { Close(true); e.Handled = true; }+ else if (e.Key == Key.Escape) { Close(false); e.Handled = true; }+ };+ box.LostFocus += (_, _) => Close(true);+ gone = (_, _) => Close(false);+ readout.DetachedFromVisualTree += gone;+ // A click on something that doesn't take focus (a canvas, a slider track) still ends the edit.+ outside = (_, e) => { if (e.Source is not Visual v || !box.IsVisualAncestorOf(v) && v != box) Close(true); };+ top?.AddHandler(InputElement.PointerPressedEvent, outside, RoutingStrategies.Tunnel, handledEventsToo: true);++ AdornerLayer.SetIsClipEnabled(box, false); // it overhangs the read-out+ AdornerLayer.SetAdorner(readout, box);+ Dispatcher.UIThread.Post(() => { if (done) return; box.Focus(); box.SelectAll(); });+ }++ // ---- reading the typed text against the read-out -------------------------------------++ private const int Samples = 48, Steps = 22;++ /// <summary>The 0..1 position whose read-out (<paramref name="at"/>) shows <paramref name="typed"/>+ /// (<paramref name="current"/> is the read-out now, whose unit a bare number takes),+ /// or null when the text says nothing the read-out can show. Assumes the read-out moves+ /// monotonically with the position (or is stepped).</summary>+ internal static double? Solve(string typed, string current, Func<double, string> at)+ {+ var n = new double[Samples + 1];+ var txt = new string[Samples + 1];+ var q = new double[Samples + 1];+ for (int i = 0; i <= Samples; i++)+ {+ n[i] = (double)i / Samples;+ txt[i] = at(n[i]);+ q[i] = Read(txt[i], out _, out _) ?? double.NaN;+ }++ string t = Clean(typed);+ for (int i = 0; i <= Samples; i++)+ if (string.Equals(Clean(txt[i]), t, StringComparison.OrdinalIgnoreCase))+ return Plateau(at, n, q, txt, i);++ double? parsed = Read(typed, out _, out bool typedHasUnit);+ if (parsed is not { } raw || double.IsNaN(raw)) return null;+ double target = Pick(raw, typedHasUnit, current, txt, q);++ // A step of the sampled read-out that brackets the target: bisect it.+ for (int i = 0; i < Samples; i++)+ {+ double a = q[i], b = q[i + 1];+ if (double.IsNaN(a) || double.IsNaN(b) || a == b) continue;+ if (Math.Min(a, b) > target || Math.Max(a, b) < target) continue;+ if (Same(a, target)) return Plateau(at, n, q, txt, i);+ if (Same(b, target)) return Plateau(at, n, q, txt, i + 1);+ double lo = n[i], hi = n[i + 1];+ bool rising = b > a;+ for (int s = 0; s < Steps; s++)+ {+ double mid = (lo + hi) / 2, qm = Read(at(mid), out _, out _) ?? double.NaN;+ if (double.IsNaN(qm)) break;+ if (Same(qm, target)) return Edges(at, lo, mid, hi, target);+ if (qm < target == rising) lo = mid; else hi = mid;+ }+ double ql = Read(at(lo), out _, out _) ?? a, qh = Read(at(hi), out _, out _) ?? b;+ return Math.Abs(ql - target) <= Math.Abs(qh - target) ? lo : hi;+ }++ // Out of range (or no bracketing step): the nearest sample — usually an end of the slider.+ int best = -1;+ for (int i = 0; i <= Samples; i++)+ {+ if (double.IsNaN(q[i])) continue;+ if (best < 0 || Distance(q[i], target) < Distance(q[best], target)) best = i;+ }+ return best < 0 ? null : Plateau(at, n, q, txt, best);+ }++ private static double Distance(double a, double b) => a == b ? 0 : Math.Abs(a - b);++ private static bool Same(double a, double b) =>+ a == b || Math.Abs(a - b) <= 1e-9 * Math.Max(1, Math.Max(Math.Abs(a), Math.Abs(b)));++ // The middle of the run of positions around sample i that show the same text — a+ // stepped or rounded read-out lands in the centre of its bucket, not on its edge. A run+ // that reaches an end of the slider takes the end (100 %, −∞, off are the extremes).+ private static double Plateau(Func<double, string> at, double[] n, double[] q, string[] txt, int i)+ {+ int a = i, b = i;+ while (a > 0 && txt[a - 1] == txt[i]) a--;+ while (b < Samples && txt[b + 1] == txt[i]) b++;+ if (a == 0) return 0;+ if (b == Samples) return 1;+ string s = txt[i];+ double lo = a == 0 ? 0 : Edge(at, n[a - 1], n[a], s, insideHigh: true);+ double hi = b == Samples ? 1 : Edge(at, n[b], n[b + 1], s, insideHigh: false);+ return (lo + hi) / 2;+ }++ // Bisect between an outside and an inside position for where the text `s` begins/ends.+ private static double Edge(Func<double, string> at, double x0, double x1, string s, bool insideHigh)+ {+ double outP = insideHigh ? x0 : x1, inP = insideHigh ? x1 : x0;+ for (int k = 0; k < Steps; k++)+ {+ double mid = (outP + inP) / 2;+ if (at(mid) == s) inP = mid; else outP = mid;+ }+ return inP;+ }++ // A bisection hit at `mid` inside (lo, hi): widen to the bucket that shows the same text.+ private static double Edges(Func<double, string> at, double lo, double mid, double hi, double target)+ {+ string s = at(mid);+ return (Edge(at, lo, mid, s, insideHigh: true) + Edge(at, mid, hi, s, insideHigh: false)) / 2;+ }++ // A unitless typed number takes the read-out's own unit when that fits the range+ // ("1.5" on a kHz read-out is 1.5 kHz), else whichever unit the read-out uses that+ // fits ("500" on a seconds read-out that drops to ms is 500 ms).+ private static double Pick(double raw, bool hasUnit, string current, string[] txt, double[] q)+ {+ if (hasUnit) return raw; // already in base units+ double min = double.PositiveInfinity, max = double.NegativeInfinity;+ var muls = new List<double>();+ foreach (var x in q) if (double.IsFinite(x)) { min = Math.Min(min, x); max = Math.Max(max, x); }+ Read(current, out double curMul, out _);+ muls.Add(curMul);+ foreach (var s in txt) { Read(s, out double m, out bool u); if (u && !muls.Contains(m)) muls.Add(m); }+ if (!muls.Contains(1)) muls.Add(1);+ foreach (var m in muls)+ {+ double v = raw * m;+ if (v >= min - 1e-9 && v <= max + 1e-9) return v;+ }+ return raw * curMul;+ }++ private static string Clean(string s) => s.Replace('\u2009', ' ').Replace('\u202F', ' ').Replace('\u00A0', ' ').Trim();++ [GeneratedRegex(@"^(?<pan>[LRC](?=[\s\d]|$))?\s*(?<sign>[+\-])?\s*(?:(?<inf>∞|inf)|(?<num>\d+(?:\.\d*)?|\.\d+)(?:\s*/\s*(?<den>\d+(?:\.\d*)?))?)?\s*(?<unit>[A-Za-zµ%°]*)", RegexOptions.IgnoreCase)]+ private static partial Regex Quantity();++ /// <summary>A read-out or typed text as a number in base units (Hz, s, …), or null.+ /// <paramref name="mul"/> is its unit's multiplier; <paramref name="hasUnit"/> whether it named one.</summary>+ internal static double? Read(string text, out double mul, out bool hasUnit)+ {+ mul = 1; hasUnit = false;+ string s = Clean(text).Replace('−', '-').Replace(',', '.').Replace("±", "");+ var m = Quantity().Match(s);+ if (!m.Success) return null;+ string pan = m.Groups["pan"].Value.ToUpperInvariant();+ string unit = m.Groups["unit"].Value;+ double v;+ if (m.Groups["inf"].Success) v = double.PositiveInfinity;+ else if (m.Groups["num"].Success)+ {+ v = double.Parse(m.Groups["num"].Value, CultureInfo.InvariantCulture);+ if (m.Groups["den"].Success)+ {+ double d = double.Parse(m.Groups["den"].Value, CultureInfo.InvariantCulture);+ if (d == 0) return null;+ v /= d;+ }+ }+ else if (pan == "C") v = 0;+ else return null;+ // "30 L" / "30L" — a pan side written after the number.+ if (pan.Length == 0 && unit.Length == 1 && char.ToUpperInvariant(unit[0]) is 'L' or 'R')+ { pan = unit.ToUpperInvariant(); unit = ""; }+ if (m.Groups["sign"].Value == "-" || pan == "L") v = -v;++ string u = unit.ToLowerInvariant();+ if (u.Length > 0)+ {+ hasUnit = true;+ mul = u == "k" || (u.StartsWith('k') && u.Length > 1) ? 1e3+ : u == "ms" ? 1e-3+ : u is "µs" or "us" ? 1e-6+ : 1;+ }+ return v * mul;+ }+}diff --git a/src/managed/Nota.App/DeviceCardKit.cs b/src/managed/Nota.App/DeviceCardKit.csindex 0dc91ed8..3e2d7290 100644--- a/src/managed/Nota.App/DeviceCardKit.cs+++ b/src/managed/Nota.App/DeviceCardKit.cs@@ -192,7 +192,7 @@ internal static class DeviceCardKit// 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. `modulation` draws a modulation depth in teal. `sync` repaints from- // `norm` and skips while the hand is on the slider.+ // `norm` and skips while the hand is on the slider. Double-clicking the value types one in.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, bool modulation = false)@@ -228,6 +228,7 @@ internal static class DeviceCardKit}repaint = Paint;track.Changed += v => { setNorm(v); val.Text = text(); };+ ValueEntry.Attach(val, norm, setNorm, text, begin, end, Paint);if (begin is not null) track.GestureBegin += begin;if (end is not null) track.GestureEnd += end;track.SizeChanged += (_, _) => track.InvalidateVisual();diff --git a/src/managed/Nota.App/DeviceCards/Bodies/AutoGainDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/AutoGainDeviceBody.csindex 0c1ab5d4..ad7b789f 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/AutoGainDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/AutoGainDeviceBody.cs@@ -110,7 +110,9 @@ internal sealed class AutoGainDeviceBody : IDeviceBodyval.TextAlignment = TextAlignment.Right;val.HorizontalAlignment = HorizontalAlignment.Right;Control valCtl = val;- if (valueClick is not null)+ if (valueClick is null)+ ValueEntry.Attach(val, () => P(p), v => Raw(p, v), () => fmt(P(p)), () => Begin(p), () => End(p), RefreshAll);+ else{var box = new Border { Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Child = val };box.PointerPressed += (_, e) =>diff --git a/src/managed/Nota.App/DeviceCards/Bodies/DynamicEqDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/DynamicEqDeviceBody.csindex 1e65b182..16679022 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/DynamicEqDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/DynamicEqDeviceBody.cs@@ -277,6 +277,9 @@ internal sealed class DynamicEqDeviceBody : IDeviceBodyLearn(trk, p);ToolTip.SetTip(trk, tip);var val = Mono(fmt(), 8, TextPrimary); val.TextAlignment = TextAlignment.Right; val.HorizontalAlignment = HorizontalAlignment.Right;+ // Range's read-out sits in its flip arrow, which a click toggles — it stays click-only.+ if (valueCtl is null)+ ValueEntry.Attach(val, getN, setN, fmt, () => Begin(p), () => End(p), () => { RefreshAll(); curve.InvalidateVisual(); });var lbl = Caps(label);bandReadouts.Add(() =>{diff --git a/src/managed/Nota.App/DeviceCards/Bodies/EqDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/EqDeviceBody.csindex 806d50c8..7a5134a7 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/EqDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/EqDeviceBody.cs@@ -273,6 +273,8 @@ internal sealed class EqDeviceBody : IDeviceBodyLearn(trk, p);ToolTip.SetTip(trk, tip);var val = Mono(fmt(), 8, TextPrimary); val.TextAlignment = TextAlignment.Right; val.HorizontalAlignment = HorizontalAlignment.Right;+ ValueEntry.Attach(val, () => (P(p) - mn[p]) / (mx[p] - mn[p]), v => Raw(p, (float)(mn[p] + v * (mx[p] - mn[p]))), fmt,+ () => Begin(p), () => End(p), RefreshAll);bandReadouts.Add(() =>{if (!trk.Dragging) trk.Norm = (P(p) - mn[p]) / (mx[p] - mn[p]);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/ForgeDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/ForgeDeviceBody.csindex 1377ee13..3e5fe89b 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/ForgeDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/ForgeDeviceBody.cs@@ -132,6 +132,7 @@ internal sealed class ForgeDeviceBody : IDeviceBodyvar val = Mono("", 8, TextPrimary);val.TextAlignment = TextAlignment.Right;val.HorizontalAlignment = HorizontalAlignment.Right;+ ValueEntry.Attach(val, () => P(param()), v => Raw(param(), v), () => fmt(P(param())), () => Begin(param()), () => End(param()), Refresh);static ColumnDefinition Fixed(double w) => new(w > 0 ? new GridLength(w) : GridLength.Auto);var g = new Grid { ColumnSpacing = 5, VerticalAlignment = VerticalAlignment.Center, Background = Brushes.Transparent };g.ColumnDefinitions.Add(Fixed(labelW));diff --git a/src/managed/Nota.App/DeviceCards/Bodies/StrataDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/StrataDeviceBody.csindex c9451646..f6edf80f 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/StrataDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/StrataDeviceBody.cs@@ -141,6 +141,9 @@ internal sealed class StrataDeviceBody : IDeviceBodyslider.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);+ ValueEntry.Attach(val, () => NormOf(P(p)), n => SetR(p, (float)ValOf(n)), () => fmt(P(p)),+ () => engine.BeginAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""),+ () => engine.EndAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""), Vis);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 };diff --git a/src/managed/Nota.App/DeviceCards/Midi/ArpMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/ArpMidiBody.csindex c2199657..b3d28007 100644--- a/src/managed/Nota.App/DeviceCards/Midi/ArpMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/ArpMidiBody.cs@@ -236,6 +236,9 @@ internal sealed class ArpMidiBody : IMidiDeviceBodyfreeTrack.GestureBegin += () => Begin(GFreeRate); freeTrack.GestureEnd += () => End(GFreeRate);Learn(freeTrack, GFreeRate, "Free rate");var freeVal = Mono("", Txt); freeVal.Width = 40; freeVal.TextAlignment = TextAlignment.Right;+ ValueEntry.Attach(freeVal, () => (FreeMs(G(GFreeRate)) - FreeMsMin) / (FreeMsMax - FreeMsMin),+ n => S(GFreeRate, 1000.0 / (FreeMsMin + n * (FreeMsMax - FreeMsMin))), () => $"{FreeMs(G(GFreeRate)):0}\u2009ms",+ () => Begin(GFreeRate), () => End(GFreeRate), Refresh);var freeRow = new DockPanel { Children = { WithDock(freeVal, Dock.Right), freeTrack } };var rateHost = new Panel { Margin = new Thickness(4, 0, 0, 0), Children = { rateGrid, freeRow } };var rateStrip = new DockPanel { Height = 16, Margin = new Thickness(0, 4, 0, 0), Children = { WithDock(mode, Dock.Left), rateHost } };@@ -409,6 +412,7 @@ internal sealed class ArpMidiBody : IMidiDeviceBodytrack.Changed += n => { S(p, fromNorm(n)); Refresh(); };track.GestureBegin += () => Begin(p); track.GestureEnd += () => End(p);Learn(track, p, label);+ ValueEntry.Attach(val, () => toNorm(G(p)), n => S(p, fromNorm(n)), () => fmt(G(p)), () => Begin(p), () => End(p), Refresh);readouts.Add(() =>{double v = G(p);diff --git a/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.csindex 3560e5c5..9bc0e52b 100644--- a/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.cs@@ -537,6 +537,7 @@ internal sealed class ChordMidiBody : IMidiDeviceBodytrack.GestureBegin += () => Begin(p);track.GestureEnd += () => { End(p); Edited(); };Learn(track, p, label);+ ValueEntry.Attach(val, () => toNorm(G(p)), n => S(p, fromNorm(n)), () => fmt(G(p)), () => Begin(p), () => End(p), Edited);readouts.Add(() =>{double v = G(p);diff --git a/src/managed/Nota.App/DeviceCards/Midi/LengthMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/LengthMidiBody.csindex cb569ce7..4f87b174 100644--- a/src/managed/Nota.App/DeviceCards/Midi/LengthMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/LengthMidiBody.cs@@ -181,6 +181,8 @@ internal sealed class LengthMidiBody : IMidiDeviceBodylenTrack.GestureBegin += () => { lenGesture = LenParam(G); Begin(lenGesture); };lenTrack.GestureEnd += () => { if (lenGesture >= 0) End(lenGesture); lenGesture = -1; };ToolTip.SetTip(lenTrack, "Length — drag up / down, double-click resets");+ ValueEntry.Attach(bigVal, () => LenNorm(G), n => S(LenParam(G), LenFromNorm(G, n)), () => LenValue(G),+ () => { lenGesture = LenParam(G); Begin(lenGesture); }, () => { End(lenGesture); lenGesture = -1; }, Refresh);readouts.Add(() =>{bigVal.Text = LenValue(G); bigSub.Text = LenSub(G, Bpm());@@ -373,6 +375,8 @@ internal sealed class LengthMidiBody : IMidiDeviceBodytrk.GestureEnd += () => End(p);Learn(trk, p, label);ToolTip.SetTip(trk, $"{label} — drag up / down, double-click resets");+ ValueEntry.Attach(v, toNorm, n => S(p, fromNorm(n)), () => bipolar ? Signed(G(p)) : $"±{Math.Round(G(p) * 100):0}\u2009%",+ () => Begin(p), () => End(p), Refresh);readouts.Add(() =>{double x = G(p);diff --git a/src/managed/Nota.App/DeviceCards/Midi/RandomMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/RandomMidiBody.csindex 07df71e5..a406f501 100644--- a/src/managed/Nota.App/DeviceCards/Midi/RandomMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/RandomMidiBody.cs@@ -372,6 +372,8 @@ internal sealed class RandomMidiBody : IMidiDeviceBodyvar v = Mono("", Sub); v.HorizontalAlignment = HorizontalAlignment.Right;var trk = Slider(p, max);ToolTip.SetTip(trk, $"{tip} — drag up / down, double-click resets");+ ValueEntry.Attach(v, () => G(p) / max, n => S(p, max > 1 ? Math.Round(n * max) : Math.Round(n * max, 3)), () => fmt(G(p)),+ () => Begin(p), () => End(p), Refresh);readouts.Add(() =>{double x = G(p);diff --git a/src/managed/Nota.App/DeviceCards/Midi/VelocityMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/VelocityMidiBody.csindex 4ff56d10..922b8ed0 100644--- a/src/managed/Nota.App/DeviceCards/Midi/VelocityMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/VelocityMidiBody.cs@@ -258,6 +258,8 @@ internal sealed class VelocityMidiBody : IMidiDeviceBodydTrack.GestureEnd += () => { if (dGesture >= 0) End(dGesture); dGesture = -1; };ToolTip.SetTip(dTrack, "Drag up / down, Shift for fine, double-click resets");Learn(dTrack, PDrive, "Drive");+ ValueEntry.Attach(dValue, DriveNorm, DriveSet, () => VelocityModel.DriveText(G),+ () => { dGesture = DriveParam(); Begin(dGesture); }, () => { End(dGesture); dGesture = -1; }, Refresh);var dHint = new TextBlock { FontSize = 7, Foreground = Cap, TextTrimming = TextTrimming.CharacterEllipsis };readouts.Add(() =>{diff --git a/src/managed/Nota.App/DeviceCards/Rack/RackCardView.cs b/src/managed/Nota.App/DeviceCards/Rack/RackCardView.csindex c0ca4be7..428ce657 100644--- a/src/managed/Nota.App/DeviceCards/Rack/RackCardView.cs+++ b/src/managed/Nota.App/DeviceCards/Rack/RackCardView.cs@@ -142,6 +142,9 @@ internal sealed partial class RackCardView(DeviceCardContext ctx)slot.PointerMoved += (_, e) => { if (drag) SetFromX(e.GetPosition(slot).X); };slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); } };name.DoubleTapped += (_, _) => PromptRenameMacro(a, i, name);+ ValueEntry.Attach(val, () => E.PluginParamGet(T, adi, i), v => E.PluginParamSet(T, adi, i, (float)v),+ () => NotaNum.F($"{E.PluginParamGet(T, adi, i) * 100:0}"),+ after: () => { double v = E.PluginParamGet(T, adi, i); Vis(v); val.Text = NotaNum.F($"{v * 100:0}"); _ctx.InvokeRackParamRefreshers(); });_irTick.Add(() => { double v = E.PluginParamGet(T, adi, i); if (!drag) Vis(v); val.Text = $"{v * 100:0}"; });var head = new DockPanel { LastChildFill = true, Children = { WithRight(val), name } };var cell = new StackPanel { Spacing = 2, Children = { head, slot } };diff --git a/src/managed/Nota.App/PreferencesWindow.cs b/src/managed/Nota.App/PreferencesWindow.csindex 4d57d981..6f3070ec 100644--- a/src/managed/Nota.App/PreferencesWindow.cs+++ b/src/managed/Nota.App/PreferencesWindow.cs@@ -1056,6 +1056,7 @@ public sealed partial class PreferencesWindow : NotaWindow("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"),+ ("Double-click a slider's value", "Type a value (units like k, ms, dB, L / R work) · Return sets it, Esc cancels"),("Drag jack → jack", "Patch a cable in Nota Consort · ⌥-click a jack to pull its cables"),("Click · ⇧ · ⌥ a Rhythm step", "Step on / off · accent · quiet step — drag across to paint, up / down (or scroll) for its velocity"),("Click a Rhythm voice", "Select and play it · drop a file on it to load a sample"),