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 exact values into knobs, faders and sliders (#240) (#242)
Egor Khindikaynenbe7666c98e97
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 3a7858a3..c289c040 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -23,6 +23,12 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.## [Unreleased]### Added+- **Type an exact value into any knob, fader or slider** (#240): double-click the control+ or its value and type it in the units shown — `1.2k`, `-6`, `12 ms`, `30L`, `1/4`, `off`.+ Enter or a click away applies it, Esc cancels, Tab moves to the next value on the card.+ A typed value is one undo step and records into automation like a drag. Device cards,+ instruments, racks, the mixer, track headers and the preview volume all work this way;+ right-click a parameter for **Type value…** and **Reset to default**.- **Recent instruments in Add track**: right-click a track (in Arrangement or Session) →**Add track** now lists the five instruments you added most recently under **Recent** —built-in or plug-in, from the browser, the menus or the AI tools. One click adds a track@@ -64,6 +70,9 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.**Check now** button. Nothing downloads until you click Update.### Changed+- **Reset to default is now ⌥-click** (Alt-click on Windows and Linux) on knobs, faders,+ sliders and value boxes — double-click types a value instead. The mixer fader no longer+ jumps to where you click; drag it like any other control.- **Context menus, redesigned**: every right-click menu in the app now follows the Studiolook and one order. A menu for a track, clip, device, scene, pad or version starts withits name, colour and type; commands come in the same groups everywhere, with Copy, Cut,diff --git a/DESIGN.md b/DESIGN.mdindex 160e6eeb..a89295f5 100644--- a/DESIGN.md+++ b/DESIGN.md@@ -451,8 +451,17 @@ Builders live in `DeviceCardKit`; controls in `Controls/`. Reuse before writingCursor `ns-resize`. A click never jumps the value. The one horizontal drag is a horizontalslider (`SliderTrack`) along its own axis: right increases, the handle follows the pointer,cursor `ew-resize`; a vertical drag still works on it as on a knob.-- **Double-click** restores the default where one is supplied.-- **Left button only** — right-click bubbles to the CV-modulate / MIDI Learn menu.+- **Double-click** the control or its read-out types a value: the read-out itself turns+ editable (`TextBox.value` — no well, no frame; its own font, size and alignment, a 1px+ accent line under it, the number selected in `AccentSubtle` and its unit left alone; laid on+ `SurfaceRaised` over a control without a read-out), read in the units shown —+ `ValueEntry` / `ValueText`. Enter or a click away commits, Esc cancels, Tab / ⇧Tab move to+ the next / previous value on the card. A commit is one `GestureBegin` / `GestureEnd`, so one+ undo step and one automation gesture, like a drag. Return outside the box stays Stop.+- **⌥/Alt-click** restores the default where one is supplied (clears a route or point).+- **Right-click** opens the parameter menu — Type value…, Reset to default — merged into the+ CV-modulate / macro menu where the control has one.+- **Drag with the left button only.**- **`GestureBegin` / `GestureEnd`** bracket `BeginAutomationWrite` / `EndAutomationWrite`.- **`MidiLearn.Bind`** registers the control with its display name.- **Live follow** re-reads engine state each tick and skips while dragging.@@ -467,7 +476,7 @@ Builders live in `DeviceCardKit`; controls in `Controls/`. Reuse before writing| `DeviceCardKit.Segments` | Well strip with a rule edge; chosen = solid accent with derived ink, 600. 9 px in a device; in the shell `ToggleButton.seg` (24, raised, 12 px, the weight unchanged when chosen so auto-width keys never shift) inside `Border.segmented` — keys butted on 1px seams, only the group's outer corners round. || `SliderTrack` / `DeviceCardKit.SliderRow` | Name 9/500 · 3 px well track · 6 × 7 handle · fixed-width mono value right. Fill `VizInk` and handle primary at rest, accent while hovered or dragged; teal under modulation. Bipolar fills from centre. Inactive drops to `Rule` and faint ink, keeps the number. || `MiniFader`, `PanBar`, `ValueBar`, `MixBar`, `VFader` | Track-header gain and pan, value bars, mixer fader — same drag contract, same rule: neutral at rest, accent while live. |-| `DragNumber` | Mono field: drag, or double-click to type. |+| `DragNumber` | Mono field: drag, or double-click to type (the shared parser, one gesture per typed value). || Buttons (`Button`, `.primary`, `.ghost`, `.cell`, `.chip`, `.tp-icon`, `.tp-play`) | 26 tall, radius 3, raised with a seam border and the bevel at rest. A context's primary action is set apart by weight (600) and one tone step (raised hover), **not by colour**. A toggled-on key is solid accent with derived ink. A destructive action is an ordinary raised key; its label says what it does. || Readouts and fields (`Border.well`, `.cell`, `TextBox.field`, `ComboBox`, `.search`) | 26, well fill, 1 px rule edge, radius 3; a mono value with its muted unit on one line. Focus = the edge turns accent, no ring. || Filter chips | 20, radius 3, 9 side pad, raised with a seam border; a category-colour dot instead of an icon; active = solid accent with derived ink. The Favorites / tags strip is one line and overflows into `+N`; the device tabs' category row wraps instead, so every category stays in sight. |@@ -866,7 +875,8 @@ True today, not yet fixed:- **The user manual** (`../nota-docs`) screenshots still show Ember; they are not re-shot.- **Column order** choice → work → output is applied in Utility; the other cards have notbeen audited card by card.-- **Slider reset** on double-click works only where the card passes a default.+- **Graph controls** (curves, pads, envelope and matrix handles) still reset on double-click+ and do not take typed values yet (specs/035, later PRs); ⌥-click already resets them.- **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 — dropped only from browser rows anddiff --git a/specs/035-typed-value-entry/checklists/requirements.md b/specs/035-typed-value-entry/checklists/requirements.mdnew file mode 100644index 00000000..c579a177--- /dev/null+++ b/specs/035-typed-value-entry/checklists/requirements.md@@ -0,0 +1,39 @@+# Specification Quality Checklist: Typed value entry on every parameter control++**Purpose**: Validate specification completeness and quality before proceeding to planning+**Created**: 2026-10-21+**Feature**: [spec.md](../spec.md)++## Content Quality++- [x] No implementation details (languages, frameworks, APIs)+- [x] Focused on user value and business needs+- [x] Written for non-technical stakeholders+- [x] All mandatory sections completed++## Requirement Completeness++- [x] No [NEEDS CLARIFICATION] markers remain+- [x] Requirements are testable and unambiguous+- [x] Success criteria are measurable+- [x] Success criteria are technology-agnostic (no implementation details)+- [x] All acceptance scenarios are defined+- [x] Edge cases are identified+- [x] Scope is clearly bounded+- [x] Dependencies and assumptions identified++## Feature Readiness++- [x] All functional requirements have clear acceptance criteria+- [x] User scenarios cover primary flows+- [x] Feature meets measurable outcomes defined in Success Criteria+- [x] No implementation details leak into specification++## Notes++- The "Nota Context" section names files and classes on purpose: the project's spec+ template asks for it to drive the plan. The requirements, stories and success criteria+ themselves stay implementation-free.+- Gesture choice (⌥/Alt-click for reset) is an assumption grounded in the code: Ctrl/⌘ and+ Shift are already fine-drag modifiers. Worth confirming in `/speckit-clarify`, along with+ the Tab wrap and the scope of piano-roll / step-sequencer / automation-lane values.diff --git a/specs/035-typed-value-entry/contracts/control-audit.md b/specs/035-typed-value-entry/contracts/control-audit.mdnew file mode 100644index 00000000..a3dfbae5--- /dev/null+++ b/specs/035-typed-value-entry/contracts/control-audit.md@@ -0,0 +1,122 @@+# Control audit: numeric parameter controls++The acceptance list from nota-daw/nota#240 (FR-017). Every control type that sets a+numeric value, and every place that builds one outside the shared kits. Each row ends+**converted**, **covered** (it goes through a converted kit/helper) or **exempt** (with a+reason). The first implementation task re-checks this list against the code and adds+anything missing; the last one ticks every row.++Legend for *Gesture today*: DC = double-click, RC = right-click, ⌥ = Alt-click.+*Plan*: **A** = `ValueEntry.Attach` (one value), **H** = `IValueEntryHost` (handles),+**K** = covered by a kit (`KnobCell`, `SliderRow`, `ClipEditorKit`), **R** = adds an+A/D/S/R read-out row.++## 1. Shared controls++| ☐ | Control | File | Gesture today | Plan |+|---|---|---|---|---|+| ☑ | `Knob` | Controls/Knob.cs | DC reset | A — `Format` property; `KnobCell` attaches when set; DC branch removed, ⌥ reset |+| ☑ | `PanKnob` | Controls/PanKnob.cs | — | A — L/R/C read-out, default C |+| ☑ | `MiniFader` | Controls/MiniFader.cs | DC reset | A — dB read-out; DC branch removed |+| ☑ | `VFader` | Controls/VFader.cs | — (a click jumped the value) | A — dB read-out, default 0 dB; the drag is now relative, so the first click of a double-click moves nothing |+| ☑ | `SliderTrack` | Controls/SliderTrack.cs | DC `Reset` | A via its row; `Reset` moves to ⌥ |+| ☐ | `RangeSliderTrack` | Controls/RangeSliderTrack.cs | DC `Reset` | H — low / high fields; `Reset` on ⌥ |+| ☑ | `DragNumber` | Controls/DragNumber.cs | DC types | already typed — move to the shared box and parser, add ⌥ reset where it has a default |+| ☑ | `PanBar` | Controls/PanBar.cs | DC reset to C | A — L/R/C read-out, default C |+| ☑ | `ValueBar` | Controls/ValueBar.cs | DC reset | A — ⌥ fallback in the control; no call sites today, so nothing to attach |+| ☑ | `MixBar` | Controls/MixBar.cs | — | **exempt** — display only (no pointer input) |+| ☑ | `PerformWheel` | Controls/PerformWheel.cs | DC reset | A for the mod wheel; the spring pitch wheel is **exempt** (it returns to centre on release, a typed value would not stay) — ⌥ reset kept on both |+| ☑ | `ChordShiftTrack` | Controls/ChordShiftTrack.cs | DC reset to 0 | A — semitones −12…+12, ⌥ reset |+| ☑ | `DeviceCardKit.KnobCell` | DeviceCardKit.cs | — | K — attach knob + value read-out |+| ☑ | `DeviceCardKit.SliderRow` | DeviceCardKit.cs | DC types | K — optional pure `textAt`; DC reset on the track → ⌥ |+| ☑ | `ClipEditorKit` rows | ClipEditorKit.cs | DC types | K — same as `SliderRow` |++## 2. Knob factories and direct builders++| ☐ | Site | Plan |+|---|---|---|+| ☑ | DeviceCards/DeviceParamControls.cs (built-in device params; generic knob) | set `Format` |+| ☑ | DeviceCards/InstrumentControls.cs | set `Format` |+| ☑ | DeviceCards/PluginCard.cs (VST3/AU generic params) | `Format` from `PluginParamText` via probe — exempt from pure `TextAt` (plug-in text is only readable at the current value); probe path allowed here, documented |+| ☑ | DeviceCards/Rack/RackCardView.cs (×5), Rack/MacroPanel.cs | set `Format`; merge menu into `MacroPanel.ShowMenu` |+| ☑ | ModularView.cs (×5) | set `Format`; merge into `ShowModulateMenu` |+| ☐ | DeviceChainView.cs | set `Format` |+| ☑ | Device bodies: AutoFilter, AutoShift, BeatRepeat, Ceiling, Chamber, Compressor, Crush, Delay, DynamicEq, Eq, Forge, Lens, Prism, Reverb, Shutter, Utility, Valve, Vintage, Vocoder | set `Format` in each body's knob helper |+| ☑ | MIDI bodies: Arp, Chord, Generic, Length, Random, Velocity | set `Format` |+| ☑ | Instrument cards: Aurora (×2), Bass, Consort, Flux, Grain, Monolith, Mosaic (×2), Pendulum, Physical, Rhythm, Sampler, Volt | set `Format` |+| ☑ | `SliderTrack` outside kits: AutoGain, DynamicEq, Eq, Forge, Strata, Physical, Arp (×2), Chord, Length (×2), Random, Velocity (×2), Rack drum | already `ValueEntry.Attach` on read-out in most — verify each; DC `Reset` → ⌥ |+| ☑ | `MiniFader` sites: ArrangementView (×2), RackCardView (×2), MainWindow, MixerView, SessionView.Mixer (×2) | A with the track's dB / pan text |+| ☑ | `VFader`, `PanKnob`: MixerView | A |+| ☑ | Preview player volume (MainWindow / PreviewPlayer, "Double-click volume = reset to 0 dB" in Shortcuts) | A; reset → ⌥ |++## 3. Graph controls (handles that set numbers)++| ☐ | Control | File | Plan |+|---|---|---|---|+| ☐ | `AutoFilterCurve` | Controls/AutoFilterCurve.cs | H — cutoff → resonance |+| ☐ | `AfFader`, `AfEnvView`, `AfLfoView` | Controls/AutoFilterViews.cs | A (fader) · H (env / LFO handles) |+| ☐ | `ChorusVoicesView`, `ChorusFieldView` | Controls/ChorusViews.cs | H |+| ☐ | `CompFader`, `CompTransferView` (threshold node), `CompMotionView`, `CompKeyView` | Controls/CompViews.cs | A · H; history view exempt (display only) |+| ☐ | `ConsortFilterCurve`, `ConsortDelayView`, `ConsortPitchLane`, `ConsortStepGrid` | Controls/ConsortViews.cs | H for curve / delay; step and pitch lanes keep ⌥ paint — **exempt** (step editors, out of scope) unless they set a card parameter |+| ☐ | `ConsortPatchMatrix` | Controls/ConsortViews.cs | H per cell — see §4 |+| ☐ | `CrSpectrumView`, `CrTransferView` | Controls/CrushViews.cs | H |+| ☐ | `DelayTaps`, `DelayFader`, `DelayFilterCurve` | Controls/DelayViews.cs | H · A · H (low cut → high cut) |+| ☐ | `DynamicEqCurve` | Controls/DynamicEqCurve.cs | H — band freq → gain → Q; keep empty-space DC |+| ☐ | `Eq3Fader`, `Eq3Graph` | Controls/Eq3Views.cs | A · H |+| ☐ | `Eq8Curve` | Controls/Eq8Views.cs | H — band freq → gain → Q; keep empty-space DC |+| ☐ | `FlangerSweepView`, `FlangerBar` | Controls/FlangerViews.cs | H · A; comb view exempt (display) |+| ☐ | `FluxVectorPad` | Controls/FluxVectorPad.cs | H — X → Y |+| ☐ | `GrainWaveViz` | Controls/GrainWaveViz.cs | H — position → spray |+| ☐ | `KeysPickupView`, `KeysTremView` | Controls/KeysViews.cs | H — symmetry → drive (per its handle) |+| ☐ | `LensVSlider` | Controls/LensViews.cs | A; spectrum / scope / waterfall exempt (display) |+| ☐ | `LvHistoryView`, `LvGainFader` | Controls/LevelViews.cs | H · A |+| ☐ | `OrbitGainView`, `OrbitPanBar` | Controls/OrbitViews.cs | H — amount → rate · A |+| ☐ | `PhaserSweepView` | Controls/PhaserViews.cs | H; response view exempt (display) |+| ☐ | `ReverbTailView` | Controls/ReverbViews.cs | H if it drags (verify) |+| ☐ | `RhythmHitView`, `RhythmSampleView` | Controls/RhythmViews.cs | H; `RhythmStepStrip` exempt (step editor) |+| ☐ | `ShSignalView`, `ShEnvelopeView`, `ShKeyView` | Controls/ShutterViews.cs | H; `ShPill`, `ShPatternView` verify |+| ☐ | `VtCurveView`, `VtWearView`, `VtHarmView` | Controls/VintageViews.cs | H if they drag (verify) |+| ☐ | `VocoderGraph` | Controls/VocoderGraph.cs | H — low edge → high edge |+| ☐ | `VoltFilter` | Controls/VoltFilter.cs | H — cutoff → resonance |+| ☐ | `SynthViz` Filter pad | Controls/SynthViz.cs | H — cutoff (X) → reso (Y) |+| ☐ | `AuroraLfoStrip`, `AuroraStack`, `StrataWave`, `PadWave`, `ChordKeysViz` | Controls/ | verify: display only → exempt |+| ☐ | `ArpGrid` | Controls/ArpGrid.cs | exempt (pattern editor, ⌥ already used) unless a handle sets a card parameter |+| ☐ | `StereoMapView` handles | StereoMapView.cs | DC reset (pan → C, ⌥ volume → 0 dB) | H — pan → volume per track dot; ⌥ already resets volume, keep; reset pan via menu |+| ☐ | Sampler / Mosaic views | DeviceCards/Sampler/SamplerViews.cs, Mosaic/MosaicViews.cs | H for start / end / loop / zone handles (verify) |++## 4. Envelopes and matrices++| ☐ | Control | Plan |+|---|---|---|+| ☐ | `VoltEnv` — Volt (amp, filter), Bass (amp, filter), Aurora (×2), Operator, Physical noise | H — A · D→S · R nodes and segments; R where the card has no A/D/S/R controls beside the graph |+| ☐ | `SynthViz` Env tab | H — breakpoints; read-outs already in the graph |+| ☐ | Clip ADSR handles (`ClipAdsrKit`, arrangement lane) | H — commit via `CommitAdsr`; DC reset → ⌥ (Shortcuts row "double-click resets the stage" changes) |+| ☐ | Audio clip editor ADSR rows | K — already typed; reset → ⌥ |+| ☐ | Other envelope strips (Monolith / Pentad / Consort inline-knob ADSR) | covered by `Knob` |+| ☐ | `VoltMatrix` | H per cell, % −100…+100; DC types, ⌥ / menu **Clear**; RC → menu; clear wrapped in a gesture (undoable) |+| ☐ | `ConsortPatchMatrix` | H per cell; DC types depth (creates the cable); ⌥ / menu **Clear** removes |++## 5. Out of scope (recorded, not converted)++| Area | Reason |+|---|---|+| Piano-roll note velocity / expression lanes, MPE lanes | Note data, not parameters; own gesture set (DC adds / deletes points) |+| Arrangement automation breakpoints | Own editor; DC adds a point |+| Step sequencer cells (Consort steps / pitch, Rhythm steps, Arp grid) | Step editors with ⌥ paint |+| Plug-ins' own editor windows | Not Nota controls |+| Nota Remote (phone) | Separate UI |+| Tempo / time-signature / inspector `DragNumber` fields | Already typed (they keep their gesture; only the box look and parser are shared) |++## 6. Interim (PR 1)++Graph controls and custom value boxes that still reset on double-click until PR 3 also+reset on ⌥-click now, so ⌥ is the reset gesture everywhere from PR 1 on: AutoFilter /+Delay / Comp / Chamber / Eq3 / Level / Lens faders, the Reverb / Phaser / Chorus / Orbit /+Crush / Flanger / Vocoder / Prism views, `ShDragView` (Shutter, Ceiling, Crush, Beat Repeat,+Forge views), the output-gain boxes in EQ-8 / Dynamic EQ / EQ-3 / AutoGain / Forge /+Prism / Shutter, the Chord / Scale / Arp value boxes, Consort mod amount, Mosaic value box,+the Drum-rack pad pan, and the Sampler handles. Not touched (double-click means something+else there): EQ-8 / Dynamic EQ add-band and band on/off, Rhythm sample load, Consort+painting, Flux pad / Grain view (`DoubleTapped`), `StereoMapView`, `VoltMatrix` (PR 2).+The rack macro knobs type and reset but keep their own right-click menu (no Type value…+item there yet).diff --git a/specs/035-typed-value-entry/contracts/value-entry.md b/specs/035-typed-value-entry/contracts/value-entry.mdnew file mode 100644index 00000000..67a5b9f6--- /dev/null+++ b/specs/035-typed-value-entry/contracts/value-entry.md@@ -0,0 +1,89 @@+# Contract: value entry (gesture, helper, parser)++The behaviour every typeable control must show, and the internal API controls use to get+it. Internal to `Nota.App` — no C ABI, MCP or file-format change.++## Gestures (user-facing)++| Input | On a single-value control / read-out | On a host (graph, matrix, envelope) |+|---|---|---|+| Double-click (left) | Open the box for its value | On a handle: open the box for the handle's first field. Off a handle: the control's own double-click, unchanged |+| ⌥/Alt-click (left) | Reset to default (no-op without a default) | On a handle: reset its fields (matrix cell / route: clear). Where the control already uses ⌥ (paint / pull / remove), that meaning stays |+| Right-click | Parameter menu: **Type value…**, **Reset to default** — merged into the control's own menu if it has one | Same, for the handle under the pointer (**Clear** for a route) |+| Drag, Shift/Ctrl/⌘ drag | Unchanged | Unchanged |+| Return (box closed) | Unchanged: Stop / Session launch | Unchanged |++In the open box:++| Key / action | Effect |+|---|---|+| Enter / Return | Commit, close |+| Click outside, focus lost | Commit, close |+| Esc | Cancel, close — value as before the box opened, nothing in undo |+| Tab / Shift+Tab | Commit, then open the next / previous field in the scope (wraps) |+| Any other key | Goes to the box (no transport, no note keys) |+| Control removed / scope hidden | Close without commit |++Commit, for any field: `Begin()` → `Set(n)` → `End()` once — one undo step, one+automation gesture. Unreadable text or an unchanged value: nothing is called.++## Field++```text+ValueField+ Name string "Cutoff" — menu header, Tab announce+ Get () -> double current position, 0..1+ TextAt (double) -> string read-out at a position — pure (no engine writes)+ Set (double) -> void write the position (parameter setter)+ Begin () -> void opens the gesture (BeginAutomationWrite / undo)+ End () -> void closes it+ Default double? 0..1 position of the default; null = no reset+ Clear () -> void? optional: remove instead of reset (routes, points)+ After () -> void? repaint the owner after a commit / reset+```++Legacy probing (`SliderRow` / `ClipEditorKit` without a pure `textAt`, plug-in generic+params): `TextAt` is built from `Set` + read-back and restores the original position+before `Begin` — as `ValueEntry.Attach` does today.++## Helper API (Nota.App, internal)++```text+ValueEntry.Attach(Control control, ValueField field, TextBlock? readout = null)+ Tunnel handlers on control and readout: DC → open, ⌥ → reset; RC → menu.+ The box sits over `readout` when given, else over the control.++ValueEntry.AttachHost(Control host) host : IValueEntryHost+ Same, using host.FieldsAt(point); null → let the event through.++interface IValueEntryHost+ IReadOnlyList<ValueField>? FieldsAt(Point p) fields of the handle at p, in Tab order+ Rect AnchorOf(ValueField f) where the box sits for that field+ IReadOnlyList<ValueField> AllFields for the Tab chain, in order++ValueEntry.Scope (attached bool) marks a Tab-chain root (card / strip / panel)+ValueEntry.Open(Control control, ValueField f) open programmatically ("Type value…", Tab)+ValueEntry.MenuItems(Control control, ValueField f) -> MenuItem[]+ for controls that build their own menu+Knob.Format Func<double, string>? the knob's read-out text at a value+```++`ValueEntry.Attach(TextBlock readout, norm, setNorm, text, begin, end, after)` — the+current signature — stays as a thin wrapper over the above.++## Parser (`ValueText.Read` / `ValueText.Solve`)++Accepted input, case-insensitive, surrounding spaces ignored, decimal point or comma,+`−` or `-`:++| Form | Examples | Meaning |+|---|---|---|+| number, fraction | `12`, `-6.5`, `1/4`, `.5` | in the read-out's unit (or the unit that fits the range) |+| unit multiplier | `1.2k`, `1.2kHz`, `12ms`, `500µs` / `500us`, `2s` | base units |+| plain units | `dB`, `Hz`, `%`, `st`, `ct`, `°` | taken as written (multiplier 1) |+| pan | `30L`, `L30`, `30 R`, `C` | left negative, C = 0 |+| infinity | `∞`, `inf`, `-inf` | the end of the range |+| a word the read-out shows | `off`, `HOLD`, `−∞` | the position(s) showing it |++Out of range → the nearest end. Nothing readable → no change. A stepped read-out lands in+the middle of the step that shows the value; a run that touches an end lands on the end.diff --git a/specs/035-typed-value-entry/data-model.md b/specs/035-typed-value-entry/data-model.mdnew file mode 100644index 00000000..fb269b8d--- /dev/null+++ b/specs/035-typed-value-entry/data-model.md@@ -0,0 +1,55 @@+# Data model: Typed value entry++No persisted data changes — project files, presets and settings are untouched. The+entities are UI-side, in `src/managed/Nota.App`.++## ValueField++One typeable value. Fields and their meaning: [contracts/value-entry.md](contracts/value-entry.md#field).++Rules:++- `Get` / `Set` work in 0..1; the parameter mapping stays inside the owner.+- `TextAt` is pure: it formats, it never writes the engine. Exceptions are listed in the+ audit (legacy `SliderRow` callers, plug-in generic params) and use the probing adapter.+- `Default` is in 0..1 and clamped; null disables ⌥ reset and greys the menu item.+- `Clear`, when present, is what ⌥-click and **Clear** call instead of a reset (matrix+ route, cable).++## ValueEntrySession++One open box.++| Field | Meaning |+|---|---|+| Owner | control the box belongs to |+| Field | the `ValueField` being typed |+| Before | `Field.Get()` when the box opened |+| Text | what is typed |+| Scope | the nearest `ValueEntry.Scope` ancestor (for Tab) |++States: **Open** → (Enter / outside click / focus lost) **Committed** · (Esc) **Cancelled** ·+(owner detached / scope hidden) **Abandoned** · (Tab) **Committed** then a new session on+the next field. Only one session exists per top level; opening a second commits the first.++Commit: `n = ValueText.Solve(Text, Field.TextAt(Get()), Field.TextAt)`; if `n` is null or+`Field.TextAt(n) == Field.TextAt(Before)` → no-op; else `Begin(); Set(n); End(); After()`.++## Tab chain++Built when Tab is pressed, never cached: every `Attach`ed control and every host field+under `Scope` that is visible (`IsEffectivelyVisible`, inside the scope's bounds) and+enabled; ordered by reading order — rows grouped by top edge (within half the smaller+height), then left edge; a host contributes `AllFields` in its own order at its position.+Wraps at both ends.++## Control audit item++| Field | Meaning |+|---|---|+| Control / site | class or file |+| Gesture today | DC / RC / ⌥ behaviour before the change |+| Plan | Attach · Host · Kit · Read-out row · Exempt |+| Status | ☐ / ☑, with a reason when exempt |++Kept in [contracts/control-audit.md](contracts/control-audit.md).diff --git a/specs/035-typed-value-entry/plan.md b/specs/035-typed-value-entry/plan.mdnew file mode 100644index 00000000..89fb019a--- /dev/null+++ b/specs/035-typed-value-entry/plan.md@@ -0,0 +1,179 @@+# Implementation Plan: Typed value entry on every parameter control++**Branch**: `035-typed-value-entry` | **Date**: 2026-10-21 | **Spec**: [spec.md](spec.md)++**Input**: Feature specification from `/specs/035-typed-value-entry/spec.md`++## Summary++Every numeric parameter control gets the same text entry: double-click opens a flat box+over the read-out, ⌥/Alt-click resets to default, right-click offers **Type value…** /+**Reset to default**; Enter or a click away commits as one undo step and one automation+gesture, Esc cancels, Tab walks the card. The existing `ValueEntry` adorner and parser are+generalised into one helper: a pure parser / solver (`ValueText`, tested from the smoke+test), and an Avalonia side that attaches to single-value controls (`Knob`, faders,+sliders, bars) or to *hosts* — graph controls, envelopes and matrices that describe the+fields of the handle under the pointer. Return keeps its transport meaning, so a focused+control does not open entry on Enter (research R2). UI-only; no engine, ABI or file-format+change. See [research.md](research.md).++## Nota: Read Before Planning++- **UI work** → [`DESIGN.md`](../../DESIGN.md) § Controls / Interaction contract (changes+ here) and § Readouts and fields (the box look); the `nota-design` skill.+- **Anything** → [`CONTRIBUTING.md`](../../CONTRIBUTING.md).++## Technical Context++**Language/Version**: C# / .NET 10 (managed app only)++**Primary Dependencies**: Avalonia 12 (existing); no new dependency++**Storage**: N/A — no project, preset or settings change++**Audio-Thread Impact**: None. A commit is `Begin` → one parameter set → `End` through the+setters a drag uses. The new pure `TextAt` removes the ~70 throwaway engine writes the+current slider probe makes per commit; the legacy probe path stays only where listed in+the audit (it already restores the value before the gesture opens).++**Testing**: `scripts/build.sh` (smoke test, design checks); new `ValueEntryTests` in+`tests/Nota.SmokeTest` (`--valueentry`) over `ValueText` linked as source, like+`Changelog.cs`; in-app walk per [quickstart.md](quickstart.md)++**Target Platform**: macOS, Windows, Linux desktop++**Project Type**: desktop app (Avalonia)++**Performance Goals**: a commit (solve + write) under one frame (16 ms) on any control; the+solver is ≤ 48 samples + ≤ 22 bisection steps of a pure formatter++**Constraints**: one undo step and one gesture per commit (engine drops no-op gestures —+`Engine::endMixGesture`); Return = Stop and Space = Play stay global outside text boxes;+fine-drag modifiers unchanged; tokens only (design checks)++**Scale/Scope**: ~15 shared controls, 44 knob-building files, ~40 graph classes in 30+files, 2 matrices, 7 envelope sites — inventory in+[contracts/control-audit.md](contracts/control-audit.md). Estimated ~1 500 lines changed,+mostly small per-site edits.++## Constitution Check++| Principle | Status |+|---|---|+| I. Real-time audio safety | ✅ no audio-thread change; fewer stray parameter writes than today |+| II. Boundary discipline | ✅ no ABI change; existing `BeginAutomationWrite` / `EndAutomationWrite` and setters |+| III. Licensing hygiene | ✅ new files (`ValueText.cs`, `IValueEntryHost.cs`, `ValueEntryTests.cs`) get the SPDX header; no dependency |+| IV. Verification gate | ✅ `scripts/build.sh`; parser / solver covered by managed checks in the smoke test; no engine behaviour change to cover |+| V. One logical change | ⚠️ one behaviour ("type exact values everywhere"), but wide. Delivered as one PR per story group (see Delivery) so each stays reviewable |+| VI. Docs in sync | ⏳ CHANGELOG, FEATURES.md, user docs EN + RU, Shortcuts pane, DESIGN.md interaction contract |+| VII. Spec-first | ✅ |+| VIII. Rules not weakened | ✅ |++Post-design re-check: unchanged — the design adds no audio-thread work, no ABI and no+dependency.++## Design++### 1. Parser / solver — `Controls/ValueText.cs` (new, pure)++Move `Read`, `Solve`, `Pick`, `Plateau`, `Edge(s)`, `Clean` and the regex out of+`ValueEntry.cs` unchanged, then extend `Read`: `s` (×1, seconds), `Hz` / `kHz`, `dB`,+`%`, `st`, `ct`, `°` as named units (multiplier 1 except k-prefixed), `-inf`. No Avalonia+`using`s, so `tests/Nota.SmokeTest` links it (`<Compile Include=… Link=…>`).++### 2. Helper — `Controls/ValueEntry.cs`++- `ValueField` record and `IValueEntryHost` ([contract](contracts/value-entry.md)).+- `Attach(control, field, readout?)` / `AttachHost(host)`: tunnel `PointerPressed`+ handlers — `ClickCount == 2` + left → `Open`; left + ⌥ → reset (`Clear` if present,+ else `Default`; skipped for a host whose `FieldsAt` is null so its own ⌥ meaning+ stays); `ContextRequested` → parameter menu unless already handled.+- `Open`: the current adorner box (unchanged look, see research R7), clamped inside the+ top level; one session per top level; Tab / Shift+Tab handled on the box in tunnel.+- Tab chain: `Scope` attached property; registry of attached controls (weak, removed+ on detach); ordering per [data-model.md](data-model.md#tab-chain).+- `MenuItems(control, field)` for controls with their own menus (ModularView, MacroPanel,+ Rack drum pads).+- The old `Attach(TextBlock, norm, setNorm, text, …)` wraps a probing `ValueField`.++### 3. Single-value controls++`Knob`, `MiniFader`, `SliderTrack`, `RangeSliderTrack`: delete the double-click reset+branch (now unreachable, handled in tunnel). `Knob.Format` property; `KnobCell` attaches+when `Format` is set, using its `value` TextBlock as the read-out. `PanKnob`, `VFader`,+`PanBar`, `MixBar`, `ValueBar`, `PerformWheel`, faders inside graph files: attached by+their owners with the owner's formatter. `SliderRow` / `ClipEditorKit`: `reset` goes to+⌥ (through the field's `Default`/reset action), optional `textAt`.++### 4. Hosts++Each graph control in the audit implements `IValueEntryHost` next to its existing hit+test (most already have a "nearest handle" function for dragging), and its owner card+passes formatters. Envelopes (`VoltEnv`, `SynthViz` Env, clip ADSR) and matrices+(`VoltMatrix`, `ConsortPatchMatrix`) per research R8 / R9. `VoltMatrix` clear goes+through a gesture (fixes non-undoable clear). Read-out row+`DeviceCardKit.EnvReadouts(fields)` for envelope graphs without A/D/S/R controls nearby.++### 5. Docs and checks++`PreferencesWindow` Shortcuts rows; DESIGN.md § Interaction contract and § Known gaps+("Slider reset on double-click…" line); CHANGELOG; FEATURES.md; nota-docs EN + RU. The+audit file is ticked as the last task.++### Delivery++One spec, three PRs (each passes `scripts/build.sh` on its own):++1. **Core + P1** — `ValueText` + tests, helper, Knob / faders / sliders / bars and every+ knob site, ⌥ reset, parameter menu, Tab chain, DESIGN.md, Shortcuts, CHANGELOG.+2. **Envelopes + matrices** (Stories 4, 5).+3. **Graph controls** (Story 6), final audit tick, FEATURES.md and user docs.++## Project Structure++### Documentation (this feature)++```text+specs/035-typed-value-entry/+├── plan.md+├── research.md+├── data-model.md+├── quickstart.md+├── contracts/+│ ├── value-entry.md # gestures, field, helper API, parser grammar+│ └── control-audit.md # the acceptance inventory+└── tasks.md # /speckit-tasks+```++### Source Code (repository root)++```text+src/managed/Nota.App/+├── Controls/+│ ├── ValueText.cs # NEW — pure parser / solver (linked into the smoke test)+│ ├── ValueEntry.cs # box, Attach / AttachHost, Tab chain, parameter menu+│ ├── IValueEntryHost.cs # NEW — host interface + ValueField+│ ├── Knob.cs, PanKnob.cs, MiniFader.cs, VFader.cs, SliderTrack.cs, RangeSliderTrack.cs,+│ │ DragNumber.cs, PanBar.cs, ValueBar.cs, MixBar.cs, PerformWheel.cs, ChordShiftTrack.cs+│ ├── VoltEnv.cs, SynthViz.cs, VoltMatrix.cs, ConsortViews.cs+│ └── *Views.cs / *Curve.cs / FluxVectorPad.cs … # hosts per the audit+├── DeviceCardKit.cs, ClipEditorKit.cs, ClipAdsrKit.cs+├── DeviceCards/** # Format on knob sites, Scope on card roots, read-out rows+├── MixerView.cs, ArrangementView*.cs, SessionView.Mixer.cs, MainWindow.axaml.cs, ModularView.cs+└── PreferencesWindow.cs # Shortcuts rows++tests/Nota.SmokeTest/+├── ValueEntryTests.cs # NEW — parser / solver checks (--valueentry, and in the default run)+└── Nota.SmokeTest.csproj # link Controls/ValueText.cs++DESIGN.md, CHANGELOG.md, FEATURES.md, ../nota-docs (EN + RU)+```++**Structure Decision**: managed UI only, all in `src/managed/Nota.App` plus one smoke-test+file; no engine, `Nota.Presentation` or `Nota.Application` change.++## Complexity Tracking++| Violation | Why Needed | Simpler Alternative Rejected Because |+|-----------|------------|-------------------------------------|+| Wide change (V) | The issue's acceptance is "same gesture everywhere" — a partial rollout leaves double-click meaning reset on some controls and type on others | One PR per control family: more churn on the shared helper and a mixed-gesture app between merges; three PRs by story keep each reviewable and each consistent |diff --git a/specs/035-typed-value-entry/quickstart.md b/specs/035-typed-value-entry/quickstart.mdnew file mode 100644index 00000000..149ba75a--- /dev/null+++ b/specs/035-typed-value-entry/quickstart.md@@ -0,0 +1,64 @@+# Quickstart: verifying typed value entry++## Prerequisites++- Release engine build in `src/native/nota.engine/build` (see BUILD.md; `build/` stays Release).+- A scratch data dir so the run does not touch your library: `export NOTA_DATA_DIR=$(mktemp -d)`.++## 1. Build and smoke test (the PR gate)++```bash+scripts/build.sh+```++Expect green. The parser / solver tests run in the smoke test's own section:++```bash+dotnet run --project tests/Nota.SmokeTest -c Release -- --valueentry+```++Expect every check `ok`: the cases in [contracts/value-entry.md § Parser](contracts/value-entry.md#parser-valuetextread--valuetextsolve)+— units, fractions, pan, ∞, words, decimal comma, clamping, stepped read-outs landing mid-step,+unit switch (ms ↔ s, Hz ↔ kHz), unreadable text → null.++The design checks (`-- design: controls --`, `-- design: menus --`) must stay green: the box+uses tokens only and the parameter menu goes through `MenuKit`.++## 2. In the app — one control of each family++Open a project with a Volt track (amp + filter env, mod matrix), an EQ-8 and a Compressor,+and the mixer.++| Step | Expect |+|---|---|+| Double-click a device knob, type `1.2k`, Enter | read-out shows 1.20 kHz; ⌘Z once restores it |+| Double-click a knob, type `abc`, Enter | nothing changes; history unchanged |+| Double-click, type a value, Esc | unchanged, no history entry |+| ⌥-click a moved knob | back to default; one history entry |+| Right-click a device knob | menu: Type value…, Reset to default |+| Mixer fader: double-click, `-6`, Enter | fader at −6.0 dB |+| Mixer pan: `30L` | 30 % left; `C` centres |+| On a card, open a box, Tab ×N | commits each, walks the card left→right, top→bottom, wraps; Shift+Tab reverses |+| With a box open press Space / letters | typed into the box; transport and note keys do nothing |+| Box closed, click a knob, press Return | transport stops (unchanged) |+| Volt env: double-click the attack node, `12ms` | attack 12 ms; A read-out shows it |+| Volt env: double-click the D/S node, type D, Tab, type S | two history entries, both values set |+| Volt matrix: double-click empty cell, `-35` | route at −35 %; ⌥-click clears; ⌘Z brings it back |+| EQ-8: double-click a band handle; empty space | handle → freq box, Tab → gain → Q; empty space still adds a band |+| Automation armed (write), type a value during playback | one gesture written, like a drag |+| Every colour theme (Studio Dark / Light, Ember Graphite / Paper) | the box looks the same: well fill, rule edge, accent edge, mono |++## 3. Audit++Walk [contracts/control-audit.md](contracts/control-audit.md): every row ☑ (converted /+covered) or exempt with its reason. `/speckit-converge` must report **Converged**.++## 4. Docs++- Preferences → Shortcuts shows: double-click = type a value, ⌥-click = reset, Enter / Tab /+ Esc in the box; the rows that said "double-click resets" (preview volume, clip ADSR handle)+ are updated (`nota-shortcuts`).+- DESIGN.md § Interaction contract: double-click types, ⌥-click resets, right-click opens the+ parameter menu.+- FEATURES.md (`nota-features`), user docs EN + RU (`nota-docs`), CHANGELOG `[Unreleased]`+ ("Changed: double-click on a knob, fader or slider now types a value; ⌥-click resets").diff --git a/specs/035-typed-value-entry/research.md b/specs/035-typed-value-entry/research.mdnew file mode 100644index 00000000..110a9d8e--- /dev/null+++ b/specs/035-typed-value-entry/research.md@@ -0,0 +1,174 @@+# Research: Typed value entry on every parameter control++**Feature**: [spec.md](spec.md) · **Plan**: [plan.md](plan.md) · **Date**: 2026-10-21++Findings from reading the code on `develop` (d4cfb96), and the decisions taken from them.++## R1 — Gesture scheme++**Decision**: double-click (control, read-out or graph handle) → text box; ⌥/Alt-click →+reset to default (or clear a route / point); right-click → a parameter menu with+**Type value…** and **Reset to default** (or **Clear**) where the control has no menu of+its own, merged into the existing menu where it has one. No Enter-to-open on a focused+control (see R2).++**Rationale**: Ctrl/⌘ and Shift are fine-drag on `Knob`, `MiniFader`, `SliderTrack`,+`RangeSliderTrack` and `VoltMatrix` (`(KeyModifiers.Control | Meta | Shift)`), so+⌘/Ctrl-click cannot be reset. ⌥ is free on every parameter control; where it is taken+(Consort step / pitch lanes paint with ⌥, `ConsortJackField` pulls with ⌥, Rhythm and+Arp grids, arrangement off-grid) it is not a parameter control or it already means+"remove" (`ConsortPatchMatrix`: ⌥-click or double-click removes — ⌥ keeps that meaning,+double-click moves to typing). Device-card knobs have no right-click menu today (only+`ModularView` knobs have the CV-modulate menu, via `ContextRequested`), so the parameter+menu is new there and merges into `ModularView`'s and `MacroPanel`'s.++**Alternatives considered**: ⌘-click reset (collides with fine drag; on macOS+Ctrl-click is a right-click); keep double-click = reset and type on ⌥-double-click+(hidden, and the issue asks for double-click = type).++## R2 — Enter on a focused control++**Decision**: dropped. Return stays **Stop** (and *launch* in the Session grid).+Text entry opens by double-click, the context menu, and Tab from an open box.++**Rationale**: `MainWindow.OnGlobalTransportKey` handles Return in the tunnel phase for+any focus except a `TextBox` / `NumericUpDown` — deliberately, it fixed "the transport+buttons periodically don't work". Knobs and faders are not focusable today; making them+focusable and letting Return open entry would break that guarantee for whatever control+was last clicked. Inside the open box Return is a `TextBox` key, so commit-on-Enter works.++**Alternatives considered**: Return opens entry when a parameter control has focus+(breaks the transport rule, surprising after a click on a knob); a chord such as ⌘Return+(undiscoverable, one more shortcut to document). The spec's FR-002 and Story 3 were+updated to match.++## R3 — One helper, pure value ↔ text++**Decision**: split `Controls/ValueEntry.cs` in two:++- `Controls/ValueText.cs` — pure: `Read` (the quantity parser) and `Solve` (the+ read-out search), no Avalonia. Linked into `tests/Nota.SmokeTest` the way `Changelog.cs`+ is, so the parser and solver get managed tests.+- `Controls/ValueEntry.cs` — Avalonia: the box (adorner), attaching to controls and+ hosts, the Tab chain, the parameter menu.++A typeable value is a **field** (see [data-model.md](data-model.md)): `Get` (0..1),+`TextAt(n)` (the read-out at position n — **pure**), `Set(n)`, `Begin` / `End`,+optional `Default`. Commit = `Begin(); Set(Solve(...)); End();`.++**Rationale**: the existing slider path probes the read-out through the row's own setter+(`setNorm` then `text()`), which writes the engine ~70 times per commit before restoring.+That is safe for undo (the gesture opens after the restore and the engine drops no-op+steps — `Engine::endMixGesture`: "exact: no net change, no step") but sends throwaway+parameter changes to the audio thread. New attachments pass a pure `TextAt`; the+`SliderRow` / `ClipEditorKit` signature keeps its probing adapter so its ~60 callers don't+all change in this feature, and gains an optional pure `textAt` that the converted bodies+use.++**Alternatives considered**: an inverse map per parameter (every card would need one;+`Solve` already exists and handles stepped read-outs, words and unit changes); probing+through `Knob.ValueChanged` (writes the engine, and the read-out `TextBlock` is updated+by card code, not the knob).++## R4 — How controls get typed entry++**Decision**:++- Single-value controls (`Knob`, `PanKnob`, `MiniFader`, `VFader`, `SliderTrack`, bars):+ `ValueEntry.Attach(control, field, readout?)` adds **tunnel** pointer handlers on the+ control and its read-out: `ClickCount == 2` (left) opens the box over the read-out (or+ over the control when it has none); left + ⌥ resets. Handled in tunnel, so the+ control's own `OnPointerPressed` never sees them; the controls' own double-click reset+ branches are removed. `Knob` gains `Format : Func<double, string>?` so+ `DeviceCardKit.KnobCell` can attach automatically when the knob has one.+- Multi-value graph controls implement `IValueEntryHost.FieldsAt(Point)` → the fields of+ the handle under the pointer (time then level; frequency → gain → Q; X → Y) and the+ rectangle to anchor the box to; `null` = not on a handle, so the event passes through+ and an existing empty-space double-click (add band / point) is kept.+ `ValueEntry.AttachHost(control)` wires the same tunnel handlers.+- `Default` NaN / absent → ⌥-click does nothing and the menu item is disabled.++**Rationale**: one place decides the gesture (FR-002, FR-009) instead of ~40 controls+each re-implementing it; graph controls only describe their handles. The first click of+a double-click starts a drag gesture with no change — the engine drops it, so a typed+commit is still one step.++**Alternatives considered**: a base class for all controls (they derive from `Control`+directly and differ a lot); reusing `IMidiLearnRegions` (only four controls implement it+and it maps strips, not handles; it may be built on top of `FieldsAt` later).++## R5 — Tab chain and scope++**Decision**: `ValueEntry.Scope` attached property marks a card root (device card body,+instrument card, rack card, mixer strip, clip editor panel, detail Synth tab). Tab from an+open box commits, then collects the attached controls and host fields inside the nearest+scope that are visible and enabled, orders them by reading order (rows bucketed by top+edge within half a row height, then left edge; a host's fields in its own order), and+opens the next one; wraps; Shift+Tab reverses.++**Rationale**: no focus order exists to reuse (the controls are not focusable) and cards+are laid out in different panels; geometric order matches what the user sees, including+after a tab / section switch (only shown controls count). Tab is handled in the box, so+the window-level Tab (detail-tab cycling) is not affected — `MainWindow.OnKeyDown`+already returns early for a `TextBox` source.++## R6 — Keys while the box is open++**Decision**: nothing to add. Space / Return / note keys are skipped for a `TextBox`+source in both `OnGlobalTransportKey` and `OnKeyDown`, and+`ReleaseTextFocusOnOutsidePress` drops focus on an outside press, which the box treats+as commit (it already closes on `LostFocus` and on an outside press).++## R7 — Box look++**Decision**: keep `TextBox.field` (well fill, 1 px rule edge, accent edge while+focused — DESIGN.md § Readouts and fields), radius `NotaRadius.Badge`, mono family and the+read-out's own size, right-aligned, at least 48 wide, growing left over the control;+kept inside the top level's bounds (clamped against `TopLevel.ClientSize`). Value+pre-selected. Same in every theme because it is drawn from tokens only.++## R8 — Envelope editors++**Decision**:++- `VoltEnv` (Volt, Bass, Aurora ×2, Operator, Physical noise env): `IValueEntryHost` —+ attack node → A; decay/sustain node → D then S; release node → R; segment hit+ (nearest segment within 6 px) → that stage's time. `TextAt` uses the instrument's own+ stage formatters (the same ones its knobs or read-outs use); where the card has no A/D/S/R+ knobs next to the graph (Volt amp / filter env, Bass, Aurora), a compact four-column+ read-out row (`DeviceCardKit.EnvReadouts`, mono 8, labels A · D · S · R) is added under+ the graph, each read-out typeable and in the Tab chain.+- `SynthViz` Env tab: same host, breakpoints → A, D/S, R; its read-outs are already+ drawn into the graph, so typing opens over the read-out caption.+- Clip ADSR handles (`ClipAdsrKit`, arrangement lane): host over the three handles; commit+ through the lane's existing `CommitAdsr` (one undo step). The audio clip editor already+ has typeable ADSR slider rows (`ClipEditorKit`).+- Other envelope graphs found in the audit (`AfEnvView`, `ShEnvelopeView`, Monolith /+ Pentad / Consort env strips with inline knobs) follow the same rule: host on the graph,+ read-out row only if no numeric control sits beside it.++## R9 — Modulation matrices++**Decision**: `VoltMatrix` becomes a host: one field per cell, amount shown and typed in+% (−100…+100; the parameter is 0..1 with 0.5 = 0). Double-click types; ⌥-click and the+menu's **Clear** reset to 0. Clear is wrapped in `Begin/End` — today right-click /+double-click writes `PluginParamSet(…, 0.5f)` outside a gesture, so clearing a cell is+not undoable; this fixes it. `ConsortPatchMatrix` (depth cells, `DepthChanged` /+`Removed`) gets the same: double-click types the depth (creating the cable), ⌥-click and+**Clear** remove. Right-click on a `VoltMatrix` cell opens the menu instead of clearing.++## R10 — Inventory size (for tasks)++| Family | Sites |+|---|---|+| `Knob` | 44 files construct knobs; most bodies go through one local helper or `DeviceParamControls` / `InstrumentControls` |+| `DeviceCardKit.KnobCell` | 65 call sites |+| `SliderTrack` outside the kits | 13 bodies (most already call `ValueEntry.Attach` on their read-out) |+| `RangeSliderTrack` | Velocity MIDI body |+| `MiniFader` | arrangement header ×2, rack ×2, main window, mixer, session mixer ×2 |+| `VFader`, `PanKnob` | mixer |+| `PanBar`, `MixBar`, `PerformWheel`, `ChordShiftTrack` | 2 / 2 / 4 / 2 |+| Graph controls in `Controls/` | ~40 classes in 30 files (curves, faders, pads, envelope and step views) |+| Matrices | `VoltMatrix`, `ConsortPatchMatrix` |++The full per-class list with decisions is [contracts/control-audit.md](contracts/control-audit.md).diff --git a/specs/035-typed-value-entry/spec.md b/specs/035-typed-value-entry/spec.mdnew file mode 100644index 00000000..2da5dd05--- /dev/null+++ b/specs/035-typed-value-entry/spec.md@@ -0,0 +1,269 @@+# Feature Specification: Typed value entry on every parameter control++**Feature Branch**: `035-typed-value-entry`++**Created**: 2026-10-21++**Status**: Draft++**Input**: User description: "Type exact values into every parameter control (knobs, sliders, faders, ADSR/envelope editors, mod matrices, graph controls) — GitHub issue nota-daw/nota#240." The issue asks that every control editing a numeric parameter can switch into a text-entry mode, with one gesture scheme everywhere (double-click → text box; reset to default moves to ⌥/Alt-click; Enter on a focused control), the existing value parser reused, Enter / click-away commit, Esc cancel, Tab to the next parameter, one undo step and one automation gesture per commit, typed editing of envelope breakpoints plus editable A/D/S/R read-outs, typed mod-matrix amounts, and a flat Studio-styled text box. Acceptance: an audit list of every numeric control type, each checked off; the Shortcuts pane, user docs and FEATURES.md updated.++## Nota Context *(fill in — drives plan and tasks)*++**Feature area** *(pick the main one)*:++- [ ] Engine (C++, `src/native/nota.engine`) — real-time audio rules apply, see `ARCHITECTURE.md` AR table+- [ ] Managed app (C#, `src/managed/*`) — domain, application, infrastructure, presentation+- [x] UI (Avalonia, `src/managed/Nota.Presentation`) — follow `DESIGN.md` (Studio)+- [ ] Plugin hosting (`pluginhost/`) — the only place JUCE is allowed+- [ ] Build / packaging / CI (`scripts/`, `.github/`) — see `BUILD.md`+- [ ] Docs only++All the controls live in `src/managed/Nota.App`. Typed entry already exists in two forms:+`Controls/DragNumber.cs` (double-click → text box) and `Controls/ValueEntry.cs`, an+adorner attached to slider read-outs by `DeviceCardKit` / `ClipEditorKit` and by a dozen+device bodies (EQ, Dynamic EQ, Forge, Strata, AutoGain, the MIDI effects, the rack card).+`ValueEntry` already reads sign, numbers and fractions, k / ms / µs multipliers, L/R pan,+∞ and words the read-out shows, and searches the control position whose read-out shows+the typed quantity — so it needs no inverse value mapping.++Controls without typed entry today, and what double-click does on them now:++- `Knob` (≈44 files build knobs directly) and `PanKnob` — double-click resets to default.+- `MiniFader` — double-click resets; `VFader` — no double-click behaviour.+- `SliderTrack` / `RangeSliderTrack` used outside the kits — double-click calls `Reset`.+- Envelope / ADSR editors — `VoltEnv`, `SynthViz` and the other instrument graph editors,+ `ClipAdsrKit`: breakpoints can only be dragged.+- `VoltMatrix` — a cell's amount can only be dragged; right-click or double-click clears it.+- Graph controls in device views that set a number (filter / compressor / EQ curves,+ `FluxVectorPad` and other XY pads, bars such as `ValueBar` / `PanBar` / `MixBar`).++Modifier constraints found in the code: Ctrl/⌘ and Shift already mean *fine drag* on+`Knob`, `MiniFader`, `SliderTrack` and `RangeSliderTrack`, so reset cannot move to+⌘/Ctrl-click. ⌥/Alt already carries a meaning in a few step / paint editors (Consort,+Rhythm, Arp grids) and in the arrangement (off-grid). Context menus were restyled in+specs/034-context-menus, so a "Reset" / "Clear" menu item is available as a fallback.+No engine change is expected: values reach the engine through the same parameter setters+and gestures a drag uses.++**Nota docs to keep in mind** *(links relative to `specs/<slug>/`, where this file lands)*:+[`ARCHITECTURE.md`](../../ARCHITECTURE.md) (AR rules),+[`CONTRIBUTING.md`](../../CONTRIBUTING.md) (licensing, dependency policy, PR+expectations), [`BUILD.md`](../../BUILD.md), [`DESIGN.md`](../../DESIGN.md),+[`FEATURES.md`](../../FEATURES.md).++## User Scenarios & Testing *(mandatory)*++### User Story 1 - Type a value into a knob, fader or slider (Priority: P1)++A producer wants a filter cutoff at exactly 1.2 kHz, a send at −6 dB, a pan at 30 L. They+double-click the knob, fader or slider (or its read-out), a small text box opens over the+read-out with the current value selected, they type the value in the units shown and+press Enter. The control lands on that value exactly as the read-out would show it.++**Why this priority**: Knobs, faders and sliders are the bulk of the parameter controls in+Nota and the most common reason a user needs an exact value. This alone closes most of+the gap the issue describes.++**Independent Test**: On any device card, the mixer and a rack pad, double-click a knob,+a fader and a slider, type a value with and without a unit, press Enter, and check the+read-out, the parameter value, one undo step and one automation gesture.++**Acceptance Scenarios**:++1. **Given** a knob showing "800 Hz", **When** the user double-clicks it, types "1.2k" and presses Enter, **Then** the read-out shows "1.20 kHz" (or the read-out's own rounding of 1200 Hz) and the parameter is at that value.+2. **Given** a mixer fader at 0 dB, **When** the user double-clicks it, types "-6" and presses Enter, **Then** the fader sits at −6 dB and a single undo restores 0 dB.+3. **Given** a pan knob, **When** the user types "30L", **Then** pan is 30 % left; typing "C" centres it.+4. **Given** an open text box, **When** the user presses Esc, **Then** the box closes and the value is unchanged, with no undo step and no automation written.+5. **Given** an open text box, **When** the user clicks elsewhere, **Then** the typed value is committed as if Enter had been pressed.+6. **Given** a parameter with range 20 Hz–20 kHz, **When** the user types "50k", **Then** the value is clamped to 20 kHz.+7. **Given** text that the control cannot read (e.g. "abc"), **When** the user commits, **Then** the value stays where it was and no undo step is added.+8. **Given** automation recording (write / touch) is armed on that parameter, **When** a typed value is committed, **Then** it is recorded as one gesture, exactly like a drag that ended at that value.++---++### User Story 2 - One reset gesture everywhere (Priority: P1)++Since double-click now opens text entry, a user who wants the default value back+⌥/Alt-clicks the control. This works on every control that had a double-click reset+before, and on those that had none (e.g. `VFader`) wherever the parameter has a default.++**Why this priority**: Moving double-click to text entry removes the existing reset+gesture; without a replacement in the same change, users lose a feature. It ships with+Story 1.++**Independent Test**: ⌥/Alt-click each control family from the audit list and check that+it returns to its default in one undo step.++**Acceptance Scenarios**:++1. **Given** a knob moved away from its default, **When** the user ⌥/Alt-clicks it, **Then** it returns to its default value as one undo step and one automation gesture.+2. **Given** a control with no defined default, **When** the user ⌥/Alt-clicks it, **Then** nothing changes and nothing is written.+3. **Given** a control's context menu, **When** it is opened, **Then** it offers "Reset to default" (disabled when already at default or without a default) and "Type value…", which opens the same text box.+4. **Given** a graph editor where ⌥/Alt already has a meaning (paint / remove / off-grid), **When** the user ⌥/Alt-clicks there, **Then** the existing meaning is kept and reset is reachable from the context menu.++---++### User Story 3 - Keyboard: Tab to the next parameter (Priority: P2)++A user tuning a device by keyboard opens the text box on one parameter, types a value and+presses Tab: the value commits and the next parameter on the same card opens for typing.+Shift+Tab goes back. (Return outside a text box stays Stop / Session launch, so a focused+control does not open entry on Enter — see research R2.)++**Why this priority**: It turns setting several exact values into one fast pass instead of+a double-click per control, but Story 1 is already useful without it.++**Independent Test**: On a device card with several knobs and sliders, open entry on the+first, press Tab repeatedly and check the order, the commits and that focus stays on the+card.++**Acceptance Scenarios**:++1. **Given** an open text box on a card, **When** the user presses Tab, **Then** the typed value commits (one undo step) and the next typeable parameter on that card, in reading order (left to right, top to bottom), opens with its value selected.+2. **Given** the last typeable parameter on a card, **When** the user presses Tab, **Then** entry wraps to the first parameter of the same card; Shift+Tab moves backwards the same way.+3. **Given** a control the user just clicked, **When** the user presses Return, **Then** the transport stops as before (no text box opens).+4. **Given** the text box is open, **When** the user presses any app-wide shortcut key (Space, numbers, letters), **Then** the key goes into the text box and does not trigger transport or other commands.++---++### User Story 4 - Type envelope times and levels (Priority: P2)++A sound designer wants an attack of exactly 12 ms and a sustain of −6 dB. They+double-click the attack breakpoint (or the attack segment) on the envelope graph and type+"12", or type into the A/D/S/R read-outs shown next to the graph.++**Why this priority**: Envelopes are the second most common place where exact values+matter, and today the graph is drag-only.++**Independent Test**: On each instrument with an envelope graph, double-click each+breakpoint / segment, type a value, and edit each A/D/S/R read-out; check the graph, the+parameter, undo and automation.++**Acceptance Scenarios**:++1. **Given** an envelope graph, **When** the user double-clicks the attack breakpoint, **Then** a text box opens for the attack time; typing "12ms" (or "12") sets attack to 12 ms.+2. **Given** a breakpoint that sets two values (e.g. decay time and sustain level), **When** the user double-clicks it, **Then** the box edits the value the breakpoint moves along the time axis, and Tab moves to its level value.+3. **Given** a segment between two breakpoints, **When** the user double-clicks the segment, **Then** the box edits that segment's time (attack, decay or release).+4. **Given** an envelope graph without adjacent numeric controls for its stages, **When** it is shown, **Then** compact editable A/D/S/R read-outs are shown next to it in the units of each stage (ms / s for times, dB or % for sustain as the instrument shows it).+5. **Given** an envelope editor that already sits beside A/D/S/R knobs, **When** it is shown, **Then** no duplicate read-outs are added — those knobs are typeable through Story 1.++---++### User Story 5 - Type modulation amounts (Priority: P2)++In a modulation matrix the user double-clicks a cell and types "-35" to set a −35 %+route. ⌥/Alt-click (or "Clear" in the context menu) removes the route.++**Why this priority**: Mod amounts are fiddly to drag precisely in small cells, and today+double-click destroys a route instead of editing it.++**Independent Test**: In Volt's matrix (and any other mod matrix in the audit), type+amounts into empty and filled cells, clear cells with ⌥/Alt-click and the context menu,+check undo and automation.++**Acceptance Scenarios**:++1. **Given** an empty matrix cell, **When** the user double-clicks it and types "50", **Then** the route is created at +50 %.+2. **Given** a cell, **When** the user types "-150", **Then** the amount is clamped to −100 %.+3. **Given** a filled cell, **When** the user ⌥/Alt-clicks it, **Then** the route is cleared as one undo step.+4. **Given** a filled cell, **When** the user right-clicks it, **Then** a context menu offers "Type value…" and "Clear".++---++### User Story 6 - Type values into graph controls (Priority: P3)++On a filter, compressor or EQ curve, or an XY pad, a handle or point sets one or two+numbers. Double-clicking the handle opens text entry for its value(s): an EQ band's+frequency then (Tab) gain then (Tab) Q; an XY pad's X then Y.++**Why this priority**: These controls usually have neighbouring knobs or read-outs for the+same parameters, which Story 1 already makes typeable; typing on the graph itself is a+convenience.++**Independent Test**: For each graph control in the audit list, double-click a handle,+type each value it sets, and check the graph and the paired controls.++**Acceptance Scenarios**:++1. **Given** an EQ band handle, **When** the user double-clicks it, **Then** a text box opens for the band frequency next to the handle; Tab moves to gain, then Q.+2. **Given** an XY pad, **When** the user double-clicks its point, **Then** the box edits X, and Tab moves to Y.+3. **Given** a graph control whose double-click already does something else (e.g. adds a band or point on an empty area), **When** the user double-clicks empty space, **Then** that existing behaviour is kept; only double-clicking a handle opens entry.++---++### Edge Cases++- A control's read-out shows a word at one end ("off", "−∞", "HOLD"): typing that word lands on that end; typing a number past it clamps.+- A stepped or rounded read-out ("0.0 dB"): the typed value lands in the middle of the step that shows it, not on its edge (current `ValueEntry` behaviour).+- A bare number on a control whose read-out changes unit across its range (ms ↔ s, Hz ↔ kHz): the number takes the unit shown now when it fits, else the unit that fits.+- The parameter changes underneath the open box (automation playback, a remote/MCP edit): the box keeps the user's text; commit writes the typed value; Esc leaves whatever the parameter now is.+- The control's card is folded, scrolled away, removed or the track deleted while the box is open: the box closes without committing.+- The control is disabled or the device bypassed / inactive: double-click does not open entry on a disabled control; a bypassed device still accepts typed values (as it accepts drags).+- Locale: a decimal comma ("1,5") is read as 1.5; a typed thousands separator is not supported.+- Typing during playback must not glitch audio: the commit is one ordinary parameter change.+- Two values on one handle (EQ, XY, decay/sustain): Esc cancels only the value whose box is open; values already committed with Tab stay committed (each its own undo step).+- A Tab chain on a card whose layout changes (a tab or section switch) continues among the controls currently shown.+- A double-click that starts a drag (press, move): it is a drag, not text entry.++## Requirements *(mandatory)*++### Functional Requirements++- **FR-001**: Every control that edits a numeric parameter MUST offer a text-entry mode in which the user types the value in the units the control displays.+- **FR-002**: Text entry MUST open on double-click of the control or of its read-out, from a "Type value…" item in the control's context menu, and by Tab / Shift+Tab from another open box on the same card. Return outside a text box keeps its transport meaning (Stop; launch in the Session grid).+- **FR-003**: Typed text MUST be read by one shared parser everywhere: sign, decimals (dot or comma) and fractions, unit multipliers (k, ms, µs, s, Hz/kHz, dB, %, st/ct), L/R/C for pan, ∞, and any word the control's read-out shows (off, HOLD …).+- **FR-004**: A typed value outside the parameter's range MUST be clamped to the range; text that cannot be read MUST leave the value unchanged and add nothing to undo or automation.+- **FR-005**: Enter and a click outside the box MUST commit; Esc MUST cancel and restore the value shown before the box opened.+- **FR-006**: A commit MUST be exactly one undo step and exactly one automation gesture (begin / end), indistinguishable in history and automation from a drag that ends at the same value.+- **FR-007**: Tab MUST commit and open entry on the next typeable parameter of the same card (or editor panel) in reading order, wrapping at the end; Shift+Tab MUST go the other way.+- **FR-008**: While the box is open, keystrokes MUST go to the box and not trigger app-wide shortcuts.+- **FR-009**: Reset to default MUST move from double-click to ⌥/Alt-click on every control that previously reset on double-click, and be available on every control that has a default; it MUST be one undo step and one automation gesture.+- **FR-010**: Every typeable control's context menu MUST offer "Reset to default" (and "Clear" where the value is a route or point that can be removed), so reset is reachable where ⌥/Alt already has another meaning.+- **FR-011**: Fine-drag modifiers (Shift, Ctrl/⌘) MUST keep their current behaviour.+- **FR-012**: Envelope / ADSR graph editors MUST open typed entry on double-click of a breakpoint (time first, Tab to level when it has one) and of a segment (that stage's time).+- **FR-013**: Envelope graph editors that have no adjacent numeric controls for their stages MUST show compact editable A/D/S/R (or the editor's own stage) read-outs next to the graph.+- **FR-014**: Modulation matrix cells MUST open typed entry for their amount (−100…+100 %) on double-click; clearing a cell MUST move to ⌥/Alt-click and a "Clear" context-menu item.+- **FR-015**: Graph controls whose handles set numeric parameters (filter / compressor / EQ curves, XY pads, value / pan / mix bars) MUST open typed entry on double-click of a handle, cycling with Tab through the values that handle sets; existing double-click actions on empty graph space MUST be kept.+- **FR-016**: The text box MUST look the same on every control and in every colour theme: a flat box over (or beside) the read-out, Studio tokens, mono figures, current value pre-selected; it MUST stay inside the window.+- **FR-017**: The feature MUST ship with an audit list of every numeric control type and every place that builds one outside the shared kits, each item checked off as converted (or recorded as exempt with a reason).+- **FR-018**: The Shortcuts pane, the user docs (EN + RU) and FEATURES.md MUST describe the new gestures (double-click = type, ⌥/Alt-click = reset, Enter / Tab / Esc in the box), and CHANGELOG `[Unreleased]` MUST note that double-click no longer resets.++### Key Entities++- **Typeable parameter control**: any on-screen control that sets a numeric parameter — its current value, its read-out text at any position, its range, an optional default, and the gesture hooks (begin / end) that bracket a change.+- **Value entry session**: one open text box — the control it belongs to, the value before it opened, the typed text; ends in commit or cancel.+- **Card tab order**: the reading-order sequence of typeable controls on one device card or editor panel, used by Tab / Shift+Tab.+- **Control audit list**: the inventory of numeric control types and their non-kit call sites, with conversion status.++## Success Criteria *(mandatory)*++### Measurable Outcomes++- **SC-001**: 100 % of the control types in the audit list accept typed values; none is left drag-only without a recorded reason.+- **SC-002**: Typing a value that the read-out can show lands on a position whose read-out shows exactly that value in at least 99 % of probed cases across all audited controls (excluding clamped inputs).+- **SC-003**: A user can set five parameters on one card to exact values by keyboard (one double-click, then typing and Tab) in under 15 seconds.+- **SC-004**: Every committed typed value and every ⌥/Alt-click reset produces exactly one undo step and one automation gesture — verified on every control family.+- **SC-005**: Reset to default is reachable on 100 % of controls that had it before the change.+- **SC-006**: The text box renders identically (same metrics, Studio tokens) in all four colour themes.++## Assumptions++- ⌥/Alt-click is the reset gesture (not ⌘/Ctrl-click), because Ctrl/⌘ and Shift already mean fine drag on knobs, faders and sliders.+- Where ⌥/Alt already carries a meaning (Consort / Rhythm / Arp step and paint editors, arrangement off-grid), that meaning wins and reset is reached through the context menu.+- The Tab order stays inside one device card or editor panel and wraps; it does not jump across devices.+- "Units shown" means the units of the control's own read-out; controls without a visible read-out (bare knobs in tight rows) use the parameter's display text — the same text their tooltip or hover read-out shows.+- Plugin (VST3/AU) generic parameter views are covered when they use the same Nota controls; plugins' own editors are out of scope.+- Step sequencer cells, note velocity bars in the piano roll and arrangement automation breakpoints are outside this feature unless they turn out to use one of the audited parameter controls; the audit records them either way.+- No new dependency and no engine change: values go through the existing parameter setters and gesture hooks.+- Nota Remote (phone UI) is out of scope.++## Nota Compliance Checklist *(review before implementation; re-check in tasks.md)*++- [x] Every new source file will carry the AGPL-3.0-only SPDX header (two lines, see CONTRIBUTING.md)+- [x] No new dependency — or: license checked, AGPL-compatible, `LICENSES/third-party.md` row planned+- [x] Audio-thread impact considered: no alloc / lock / I/O on the audio thread (AR-6), command queue for data in (AR-4), immutable snapshots for structural edits (AR-5) — UI only; commits use existing parameter setters+- [x] Managed/native crossings go through the pure C ABI in `nota_engine.h` only (AR-7); no JUCE outside `pluginhost/` — no new crossings+- [x] Smoke-test impact assessed: engine behaviour change → extend `tests/Nota.SmokeTest` — no engine change; parser / solver covered by managed tests+- [x] User-visible change → `CHANGELOG.md` `[Unreleased]` entry planned (and FEATURES.md / user docs via the nota-features / nota-docs skills when working with an agent that has them)+- [x] UI change → follows `DESIGN.md` (Studio design language)diff --git a/specs/035-typed-value-entry/tasks.md b/specs/035-typed-value-entry/tasks.mdnew file mode 100644index 00000000..f8dbd4a8--- /dev/null+++ b/specs/035-typed-value-entry/tasks.md@@ -0,0 +1,256 @@+---++description: "Task list for typed value entry on every parameter control"+---++# Tasks: Typed value entry on every parameter control++**Input**: Design documents from `/specs/035-typed-value-entry/`++**Prerequisites**: [plan.md](plan.md), [spec.md](spec.md), [research.md](research.md), [data-model.md](data-model.md), [contracts/](contracts/), [quickstart.md](quickstart.md)++**Tests**: The plan asks for managed checks of the parser / solver in `tests/Nota.SmokeTest` (`ValueEntryTests`, `--valueentry`). UI behaviour is verified by the quickstart walk.++**Organization**: Tasks are grouped by user story. US1 and US2 are both P1 and ship together: once double-click is intercepted for typing, the old double-click reset is gone, so ⌥ reset must land in the same PR.++All app paths are under `src/managed/Nota.App/` unless they start with `tests/`, `specs/` or a repo-root file.++## Format: `[ID] [P?] [Story] Description`++- **[P]**: Can run in parallel (different files, no dependencies)+- **[Story]**: Which user story this task belongs to (US1…US6)++---++## Phase 1: Setup++**Purpose**: Confirm the inventory before code moves.++- [X] T001 Re-check `specs/035-typed-value-entry/contracts/control-audit.md` against the code: grep `new Knob`, `new MiniFader`, `new VFader`, `new PanKnob`, `new SliderTrack`, `new RangeSliderTrack`, `new PanBar`, `new ValueBar`, `new MixBar`, `new PerformWheel`, `new ChordShiftTrack`, `ClickCount`, `KeyModifiers.Alt` and `BeginAutomationWrite` in `src/managed/Nota.App`; resolve every "(check)" / "(verify)" row (does the control drag a parameter? what does its double-click do?), add missing sites, move display-only views to exempt with a reason++---++## Phase 2: Foundational (Blocking Prerequisites)++**Purpose**: The shared parser, field model and helper every story uses.++**⚠️ CRITICAL**: No user story work can begin until this phase is complete++- [X] T002 Create `Controls/ValueText.cs` (SPDX header, no Avalonia `using`s): move `Read`, `Solve`, `Pick`, `Plateau`, `Edge`, `Edges`, `Distance`, `Same`, `Clean`, the `Quantity` regex and the `Samples` / `Steps` constants out of `Controls/ValueEntry.cs` unchanged into `internal static partial class ValueText`; `ValueEntry` calls `ValueText.Solve`+- [X] T003 Extend `ValueText.Read` in `Controls/ValueText.cs` per contracts/value-entry.md § Parser: named units `s`, `Hz`, `kHz`, `dB`, `%`, `st`, `ct`, `°` (multiplier 1 except a `k` prefix = 1e3; `ms` 1e-3; `µs`/`us` 1e-6), `-inf` / `−∞`, `L30` as well as `30L` / `30 L`, `C` = 0; decimal comma; unreadable → null+- [X] T004 [P] Create `tests/Nota.SmokeTest/ValueEntryTests.cs` (SPDX header) with checks over `ValueText.Read` / `ValueText.Solve` using pure formatters: units and multipliers, fractions (`1/4`), pan (`30L`, `L30`, `C`), ∞, words (`off`, `HOLD`), decimal comma, out-of-range clamp to an end, stepped read-out lands mid-step (typing `0` on a `0.0 dB` read-out), unit switch (`500` on a s/ms read-out → 500 ms; `1.5` on a kHz read-out → 1.5 kHz), `abc` → null+- [X] T005 Link the source and register the run in `tests/Nota.SmokeTest/Nota.SmokeTest.csproj` (`<Compile Include="..\..\src\managed\Nota.App\Controls\ValueText.cs" Link="ValueText.cs" />`) and `tests/Nota.SmokeTest/Program.cs` (`--valueentry` section, and in the default run)+- [X] T006 Create `Controls/IValueEntryHost.cs` (SPDX header): `ValueField` record (`Name`, `Get`, `TextAt`, `Set`, `Begin`, `End`, `Default` — "0..1 position of the default; null = no reset", `Clear` optional, `After` optional) and `IValueEntryHost` (`FieldsAt(Point)` — "null = not on a handle, so the event passes through", `AnchorOf(ValueField)`, `AllFields`) per contracts/value-entry.md+- [X] T007 Rework `Controls/ValueEntry.cs`: `Attach(Control, ValueField, TextBlock? readout)` and `AttachHost(Control)` with **tunnel** `PointerPressedEvent` handlers on the control and the read-out — left + `ClickCount == 2` → `Open`; left + ⌥ → `Clear` if present else reset to `Default` (Begin / Set / End / After; no-op when `Default` is null or already at default); a host whose `FieldsAt` returns null lets both events through+- [X] T008 `ValueEntry.Open(Control, ValueField)` in `Controls/ValueEntry.cs`: keep the current adorner box look (`TextBox.field`, `NotaRadius.Badge`, mono family, read-out font size, right-aligned, min 48 wide, grows left) anchored to the read-out, the control or `host.AnchorOf(field)`; clamp it inside the `TopLevel` client area; one session per top level (opening a second commits the first); Enter / outside press / `LostFocus` commit, Esc cancels, owner detached → close without commit+- [X] T009 Commit rule in `Controls/ValueEntry.cs` per data-model.md: `n = ValueText.Solve(text, TextAt(Get()), TextAt)`; "if `n` is null or `Field.TextAt(n) == Field.TextAt(Before)` → no-op; else `Begin(); Set(n); End(); After()`"+- [X] T010 Probing adapter in `Controls/ValueEntry.cs`: keep the old `Attach(TextBlock readout, norm, setNorm, text, begin, end, after)` signature as a wrapper that builds a `ValueField` whose `TextAt` probes through `setNorm` + `text()` and restores the original position before `Begin` (current behaviour, specs/016)+- [X] T011 Parameter menu in `Controls/ValueEntry.cs`: `MenuItems(Control, ValueField)` → **Type value…** (calls `Open`) and **Reset to default** (disabled when `Default` is null or the value is at default) or **Clear** when `Clear` is set, built with `MenuKit.Item`; `Attach` / `AttachHost` add a `ContextRequested` handler that shows them in a `MenuFlyout` unless the event is already handled+- [X] T012 Add `Format` (`Func<double, string>?`, the read-out text at a value) to `Controls/Knob.cs`; update its header comment and the `Default` doc comment ("restored on ⌥-click")++**Checkpoint**: parser tested, helper ready — `scripts/build.sh` green with no visible change yet except the existing slider rows (now through the new helper)++---++## Phase 3: User Story 1 — Type a value into a knob, fader or slider (Priority: P1) 🎯 MVP++**Goal**: Double-click any knob, fader, slider or bar (or its read-out), type, Enter → exact value, one undo step, one gesture.++**Independent Test**: quickstart § 2 rows 1–3, 6–7, mixer fader and pan, automation armed.++### Shared controls++- [X] T013 [US1] `DeviceCardKit.KnobCell` in `DeviceCardKit.cs`: when `knob.Format` is set, `ValueEntry.Attach(knob, field, value)` with `Get = knob.Value / max`, `Set` raising the knob's `ValueChanged` path, `Begin`/`End` = the knob's `GestureBegin`/`GestureEnd` subscribers (expose `Knob.BeginGesture()` / `EndGesture()` / `SetByUser(double)` in `Controls/Knob.cs` so a typed value runs the same handlers as a drag), `Default` from `knob.Default`+- [X] T014 [US1] `DeviceCardKit.SliderRow` in `DeviceCardKit.cs` and the row builders in `ClipEditorKit.cs`: optional pure `Func<double, string>? textAt` parameter (used instead of probing when given); attach the track as well as the read-out so double-click on the track also types+- [X] T015 [P] [US1] `Controls/MiniFader.cs`, `Controls/VFader.cs`, `Controls/PanKnob.cs`: add `BeginGesture` / `EndGesture` / `SetByUser` like `Knob` so owners can build a `ValueField`; no gesture code in the controls themselves+- [X] T016 [P] [US1] `Controls/PanBar.cs`, `Controls/ValueBar.cs`, `Controls/MixBar.cs`, `Controls/PerformWheel.cs`: same helpers (or mark exempt in the audit per T001)++### Knob factories (set `Format`)++- [X] T017 [P] [US1] `DeviceCards/DeviceParamControls.cs`: set `Format = frac => Fmt((float)(min + frac * span))` on the device-param knob and `Format = fmt` on the normalised knob helper+- [X] T018 [P] [US1] `DeviceCards/InstrumentControls.cs`: set `Format` from the instrument param formatter+- [X] T019 [P] [US1] `DeviceCards/PluginCard.cs`: VST3/AU generic knobs — field with probing `TextAt` via `PluginParamText` (documented exception in the audit)+- [X] T020 [P] [US1] Effect bodies — set `Format` in each body's knob helper: `DeviceCards/Bodies/AutoFilterDeviceBody.cs`, `AutoShiftDeviceBody.cs`, `BeatRepeatDeviceBody.cs`, `CeilingDeviceBody.cs`, `ChamberDeviceBody.cs`, `CompressorDeviceBody.cs`, `CrushDeviceBody.cs`, `DelayDeviceBody.cs`+- [X] T021 [P] [US1] Effect bodies (cont.): `DeviceCards/Bodies/DynamicEqDeviceBody.cs`, `EqDeviceBody.cs`, `ForgeDeviceBody.cs`, `LensDeviceBody.cs`, `PrismDeviceBody.cs`, `ReverbDeviceBody.cs`, `ShutterDeviceBody.cs`, `UtilityDeviceBody.cs`, `ValveDeviceBody.cs`, `VintageDeviceBody.cs`, `VocoderDeviceBody.cs`+- [X] T022 [P] [US1] MIDI bodies: `DeviceCards/Midi/ArpMidiBody.cs`, `ChordMidiBody.cs`, `GenericMidiBody.cs`, `LengthMidiBody.cs`, `RandomMidiBody.cs`, `VelocityMidiBody.cs` (knobs → `Format`; their `SliderTrack`s → confirm the read-out is attached and pass `textAt`)+- [X] T023 [P] [US1] Instrument cards A–M: `DeviceCards/Instruments/AuroraInstrumentCard.cs`, `BassInstrumentCard.cs`, `ConsortInstrumentCard.cs`, `FluxInstrumentCard.cs`, `GrainInstrumentCard.cs`, `MonolithInstrumentCard.cs`, `MosaicInstrumentCard.cs`+- [X] T024 [P] [US1] Instrument cards P–V: `DeviceCards/Instruments/PendulumInstrumentCard.cs`, `PhysicalInstrumentCard.cs`, `RhythmInstrumentCard.cs`, `SamplerInstrumentCard.cs`, `VoltInstrumentCard.cs`+- [X] T025 [P] [US1] Racks: `DeviceCards/Rack/RackCardView.cs` (5 knobs, 2 `MiniFader`s), `DeviceCards/Rack/RackCardView.Drum.cs` (`SliderTrack`), `DeviceCards/Rack/MacroPanel.cs` (knob `Format`; append `ValueEntry.MenuItems` to `ShowMenu`)+- [X] T026 [P] [US1] `ModularView.cs` (5 knobs: `Format`; append `ValueEntry.MenuItems` in `ShowModulateMenu`) and `DeviceChainView.cs` (1 knob)+- [X] T027 [P] [US1] Remaining `SliderTrack` bodies: `DeviceCards/Bodies/AutoGainDeviceBody.cs`, `DynamicEqDeviceBody.cs`, `EqDeviceBody.cs`, `ForgeDeviceBody.cs`, `StrataDeviceBody.cs` — confirm the attach, pass `textAt`, attach the track too++### Mixer and track headers++- [X] T028 [P] [US1] `MixerView.cs`: `VFader` (dB, default 0 dB), `PanKnob` (L/R/C, default C), `MiniFader`s — `ValueEntry.Attach` with the strip's dB / pan formatters and their existing gesture hooks+- [X] T029 [P] [US1] `ArrangementView.cs` (2 `MiniFader`s, `PanBar`) and `SessionView.Mixer.cs` (2 `MiniFader`s, `PanBar`): attach with track volume / pan formatters+- [X] T030 [P] [US1] `MainWindow.axaml.cs` (`MiniFader`, preview volume): attach; preview volume default 0 dB+- [X] T031 [US1] `Controls/DragNumber.cs`: open its typing through `ValueEntry.Open` / `ValueText` so the box and parser are the shared ones; behaviour otherwise unchanged++**Checkpoint**: every knob, fader, slider and bar types — but reset still needs US2 before this can ship++---++## Phase 4: User Story 2 — One reset gesture everywhere (Priority: P1)++**Goal**: ⌥/Alt-click resets every control that had a double-click reset, and the parameter menu offers Reset / Type value….++**Independent Test**: quickstart § 2 "⌥-click a moved knob" and "Right-click a device knob" on each control family.++- [X] T032 [P] [US2] `Controls/Knob.cs`: remove the `ClickCount == 2` reset branch from `OnPointerPressed` (reset now comes from `ValueEntry` on ⌥); update the header comment ("double-click types a value, ⌥-click resets")+- [X] T033 [P] [US2] `Controls/MiniFader.cs`: remove the double-click reset branch; header comment+- [X] T034 [P] [US2] `Controls/SliderTrack.cs` and `Controls/RangeSliderTrack.cs`: remove the double-click `Reset` branch; `Reset` is invoked by the field's ⌥ reset (`DeviceCardKit.SliderRow` maps `reset` into the field); header comments+- [X] T035 [US2] `DeviceCardKit.cs` / `ClipEditorKit.cs`: wire each row's `reset` action as the field's reset (`Default` or a custom reset action on `ValueField`; extend `ValueField` with `Reset` if a row resets by action rather than position)+- [X] T036 [US2] Graph-control and step-editor ⌥ conflicts: confirm `ConsortStepGrid`, `ConsortPitchLane`, `ConsortJackField` (`Controls/ConsortViews.cs`), `RhythmViews.cs`, `ArpGrid.cs` keep their ⌥ meaning (they are not attached, or their `FieldsAt` returns null there) and that reset is reachable from the menu where they set a parameter+- [X] T037 [US2] Parameter menu on cards without one: verify right-click on a device-card knob, a slider row and a mixer fader opens **Type value… / Reset to default** and that `ModularView` / `MacroPanel` show their own items plus these++**Checkpoint**: US1 + US2 = PR 1 content (with US3 and the Phase 9 docs tasks marked "PR 1")++---++## Phase 5: User Story 3 — Keyboard: Tab to the next parameter (Priority: P2)++**Goal**: Tab / Shift+Tab in an open box commits and moves through the card in reading order, wrapping.++**Independent Test**: quickstart § 2 "open a box, Tab ×N", "Space / letters", "Return with the box closed".++- [X] T038 [US3] `ValueEntry.Scope` attached property and a weak registry of attached controls / hosts (removed on `DetachedFromVisualTree`) in `Controls/ValueEntry.cs`+- [X] T039 [US3] Tab chain in `Controls/ValueEntry.cs` per data-model.md § Tab chain: built on each Tab, "visible (`IsEffectivelyVisible`, inside the scope's bounds) and enabled", rows grouped by top edge "within half the smaller height", then left edge, host `AllFields` in order at the host's position; wraps; Shift+Tab reverses; handle Tab on the box in the tunnel phase so the window's detail-tab cycling (`MainWindow.Input.cs`) never sees it+- [X] T040 [P] [US3] Mark scopes: device / instrument card body root in `DeviceChainView.Shell.cs` (and the folded strip in `DeviceChainView.Fold.cs` if it shows controls), rack card in `DeviceCards/Rack/RackCardView.cs`, mixer strip in `MixerView.cs`, clip editor panel in `ClipEditorView.cs` / `AudioClipEditorView.cs`, the detail Synth tabs, the arrangement track header in `ArrangementView.cs`+- [X] T041 [US3] Verify keys while the box is open: Space, Return, note letters, ⌘Z go to the box (the `TextBox` exemptions in `MainWindow.OnGlobalTransportKey` / `OnKeyDown` and `DetailWindow` key routing); Return with the box closed still stops — fix any path that doesn't (e.g. floating `DeviceWindow` / `MixerWindow`)++---++## Phase 6: User Story 4 — Type envelope times and levels (Priority: P2)++**Goal**: Double-click an envelope breakpoint or segment to type its time / level; editable A/D/S/R read-outs where the graph has no numeric controls beside it.++**Independent Test**: quickstart § 2 Volt env rows; each `VoltEnv` site; clip ADSR handle in the arrangement.++- [ ] T042 [US4] `Controls/VoltEnv.cs`: implement `IValueEntryHost` — attack node → A; decay/sustain node → D then S; release node → R; nearest segment within 6 px → that stage's time; fields use `PluginParamGet/Set`, `Gest`-style Begin/End per param, `TextAt` from a formatter set by the owner (`VoltEnv.Format(Func<string, double, string>)` keyed by stage); `ValueEntry.AttachHost(this)`+- [ ] T043 [US4] `DeviceCardKit.EnvReadouts(IValueEntryHost env)` in `DeviceCardKit.cs`: a compact four-column read-out row (labels A · D · S · R, mono 8, Studio tokens) whose read-outs are typeable fields, live-followed via the card's refresher+- [ ] T044 [P] [US4] `DeviceCards/Instruments/VoltInstrumentCard.cs` (amp + filter env) and `BassInstrumentCard.cs` (amp + filter env): pass stage formatters; add `EnvReadouts` where no A/D/S/R knobs sit beside the graph+- [ ] T045 [P] [US4] `DeviceCards/Instruments/AuroraInstrumentCard.cs` (×2), `OperatorInstrumentCard.cs`, `PhysicalInstrumentCard.cs` (noise env): same+- [ ] T046 [P] [US4] `Controls/SynthViz.cs` Env tab: host over the breakpoints (A, D→S, R), box anchored over the read-out caption drawn in the graph+- [ ] T047 [US4] Clip ADSR handles: `ClipAdsrKit.cs` exposes the handle fields (Attack time, Decay time → Sustain level, Release time, `TextAt` from `ClipAdsrKit.Readout`'s formatting); `ArrangementView.LaneControl.cs` attaches them as a host on the lane, commits through `CommitAdsr` (one undo step), and the current double-click reset (`ClipAdsrKit.Reset`) moves to ⌥+- [ ] T048 [P] [US4] Other envelope graphs from the audit (`AfEnvView` in `Controls/AutoFilterViews.cs`, `ShEnvelopeView` in `Controls/ShutterViews.cs`): host over their handles; `EnvReadouts` only if no numeric controls sit beside them++---++## Phase 7: User Story 5 — Type modulation amounts (Priority: P2)++**Goal**: Double-click a matrix cell to type its amount; ⌥-click or **Clear** removes it, undoably.++**Independent Test**: quickstart § 2 Volt matrix row; Consort patch matrix.++- [ ] T049 [US5] `Controls/VoltMatrix.cs`: implement `IValueEntryHost` — one field per routed cell, `TextAt` = signed % ("−100…+100 %", 0.5 = 0), `Set` via `PluginParamSet`, Begin/End via `BeginAutomationWrite` / `EndAutomationWrite` on `mtx{s}_{d}`, `Clear` = Begin → set 0.5 → End (makes clearing undoable); remove the right-click / double-click clear from `OnPointerPressed` (right-click now opens the parameter menu with **Type value…** / **Clear**); update the header comment+- [ ] T050 [US5] `ConsortPatchMatrix` in `Controls/ConsortViews.cs`: host per cell — double-click types the depth (raising `DepthChanged`, which creates the cable), ⌥-click and **Clear** raise `Removed` (⌥ keeps its meaning); remove the double-click removal; owner `DeviceCards/Instruments/ConsortInstrumentCard.cs` supplies Begin/End and `TextAt`++---++## Phase 8: User Story 6 — Type values into graph controls (Priority: P3)++**Goal**: Double-click a graph handle to type each value it sets, Tab through them; empty-space double-click unchanged.++**Independent Test**: quickstart § 2 EQ-8 row; each graph control in contracts/control-audit.md § 3.++- [ ] T051 [P] [US6] `Controls/Eq8Views.cs` (`Eq8Curve`) and `Controls/DynamicEqCurve.cs`: host — band handle → frequency, gain, Q; `FieldsAt` null off a handle (keeps add-band double-click); owners `DeviceCards/Bodies/EqDeviceBody.cs` / `DynamicEqDeviceBody.cs` pass formatters and gestures+- [ ] T052 [P] [US6] `Controls/Eq3Views.cs` (`Eq3Fader` attach, `Eq3Graph` host) with `DeviceCards/Bodies/Eq3DeviceBody.cs`+- [ ] T053 [P] [US6] `Controls/AutoFilterCurve.cs` (cutoff → resonance), `Controls/AutoFilterViews.cs` (`AfFader` attach, `AfLfoView` host) with `DeviceCards/Bodies/AutoFilterDeviceBody.cs`+- [ ] T054 [P] [US6] `Controls/CompViews.cs` (`CompFader` attach, `CompTransferView` threshold, `CompMotionView`, `CompKeyView` hosts) with `DeviceCards/Bodies/CompressorDeviceBody.cs`+- [ ] T055 [P] [US6] `Controls/DelayViews.cs` (`DelayTaps` host, `DelayFader` attach, `DelayFilterCurve` low cut → high cut) with `DeviceCards/Bodies/DelayDeviceBody.cs`+- [ ] T056 [P] [US6] `Controls/ChorusViews.cs`, `Controls/FlangerViews.cs`, `Controls/PhaserViews.cs`, `Controls/OrbitViews.cs` hosts / attaches with their bodies (`ChorusDeviceBody.cs`, `FlangerDeviceBody.cs`, `PhaserDeviceBody.cs`, `AutoPanDeviceBody.cs` for Orbit)+- [ ] T057 [P] [US6] `Controls/CrushViews.cs`, `Controls/LevelViews.cs`, `Controls/LensViews.cs` (`LensVSlider`), `Controls/ShutterViews.cs` (`ShSignalView`, `ShKeyView`), `Controls/ReverbViews.cs`, `Controls/VintageViews.cs`, `Controls/VocoderGraph.cs` — the rows the audit marks H/A, with their bodies+- [ ] T058 [P] [US6] Instrument graphs: `Controls/VoltFilter.cs` (cutoff → resonance), `Controls/SynthViz.cs` Filter pad (X → Y), `Controls/FluxVectorPad.cs` (X → Y), `Controls/KeysViews.cs` (`KeysPickupView`, `KeysTremView`), `Controls/GrainWaveViz.cs`, `Controls/RhythmViews.cs` (`RhythmHitView`, `RhythmSampleView`), `Controls/ChordShiftTrack.cs`, `DeviceCards/Sampler/SamplerViews.cs`, `DeviceCards/Mosaic/MosaicViews.cs` — per audit+- [ ] T059 [US6] `Controls/RangeSliderTrack.cs` in `DeviceCards/Midi/VelocityMidiBody.cs`: host with low / high fields++---++## Phase 9: Polish & Cross-Cutting Concerns++- [X] T060 [P] DESIGN.md § Controls → Interaction contract: "Double-click types a value (a flat field over the read-out); ⌥/Alt-click restores the default; right-click opens the parameter menu (Type value…, Reset to default) merged with CV-modulate / MIDI Learn where present"; `DragNumber` row; remove the "Slider reset on double-click…" known-gap line (PR 1)+- [X] T061 [P] Preferences → Shortcuts in `PreferencesWindow.cs` via the `nota-shortcuts` skill: add "Double-click a knob, fader, slider or graph handle — type a value", "⌥-click — reset to default", "In the value field: Enter / Tab / ⇧Tab / Esc"; change "Double-click volume" (preview) and the clip ADSR handle row ("double-click resets the stage" → ⌥-click) (PR 1, extended in PR 2)+- [X] T062 `CHANGELOG.md` `[Unreleased]`: Added — type exact values into every parameter control; Changed — double-click on knobs / faders / sliders now types a value, ⌥-click resets; Fixed — clearing a Volt mod-matrix cell is undoable (PR 1 / PR 2 entries)+- [ ] T063 FEATURES.md via `nota-features`; user docs EN + RU in `../nota-docs` via `nota-docs` (device-card basics, mixer, envelopes, mod matrix pages)+- [ ] T064 Tick every row of `specs/035-typed-value-entry/contracts/control-audit.md` (☑ or exempt with reason)+- [ ] T065 Run quickstart.md § 2 in the app in every colour theme (Studio Dark / Light, Ember Graphite / Paper); capture before/after screenshots of the box for the PR (`nota-pr`)+- [ ] T066 `/speckit-converge` until **Converged**++### Nota closing tasks *(PR gates)*++- [X] T067 Run `scripts/build.sh` until native + managed + smoke test (incl. `--valueentry` and the design checks) are green+- [X] T068 AGPL-3.0-only SPDX two-line header on `Controls/ValueText.cs`, `Controls/IValueEntryHost.cs`, `tests/Nota.SmokeTest/ValueEntryTests.cs`+- [X] T069 New dependency: N/A+- [X] T070 Engine behaviour change: N/A — no engine change (parser covered by T004)++---++## Dependencies & Execution Order++### Phase Dependencies++- **Setup (T001)** → **Foundational (T002–T012)** → stories.+- T002 → T003 → T004/T005; T006 → T007 → T008–T011; T012 independent of T006–T011.+- **US1 (Phase 3)** and **US2 (Phase 4)** ship together (PR 1). US2's control edits (T032–T034) can run alongside US1's site edits.+- **US3 (Phase 5)** needs Foundational; ships in PR 1.+- **US4 / US5 (Phases 6–7)** need Foundational and T043 for read-outs; PR 2.+- **US6 (Phase 8)** needs Foundational; PR 3.+- **Polish**: T060–T062 per PR; T063–T066 at the end.++### Within Each Story++- Control API (helpers on the control) before the call sites that use it (T013/T015/T016 before T017–T030).+- A host's control file before its owner card.++### Parallel Opportunities++- T004 with T006–T012.+- T017–T030 are separate files: all [P] once T013–T016 are in.+- T032–T034 in parallel.+- T044–T046, T048 in parallel after T042/T043.+- T051–T058 in parallel.++---++## Parallel Example: User Story 1++```bash+Task: "T020 Effect bodies A–D: set Format in each body's knob helper"+Task: "T021 Effect bodies D–V: set Format in each body's knob helper"+Task: "T023 Instrument cards A–M: set Format"+Task: "T028 MixerView: VFader, PanKnob, MiniFader attach"+```++## Parallel Example: User Story 6++```bash+Task: "T051 Eq8Curve + DynamicEqCurve hosts"+Task: "T054 CompViews hosts"+Task: "T058 Instrument graphs"+```++---++## Implementation Strategy++### MVP (PR 1)++1. Phase 1 + Phase 2.+2. Phase 3 (US1) + Phase 4 (US2) together — the gesture swap is atomic.+3. Phase 5 (US3).+4. T060–T062, T067–T069; `scripts/build.sh`; quickstart § 2 rows for US1–US3.++### PR 2 — envelopes and matrices++Phases 6–7, Shortcuts / CHANGELOG additions, build.++### PR 3 — graph controls++Phase 8, T063–T066, final build. Until PR 2 lands, a Volt matrix double-click still clears (noted in PR 1's description).++---++## Notes++- Do not commit: the maintainer reviews and commits (see project memory).+- Keep the Studio box look identical everywhere — the design checks (`RunControls`, `RunMenus`) must stay green.+- When a graph control already has a "nearest handle" hit test for dragging, reuse it for `FieldsAt`.diff --git a/src/managed/Nota.App/ArrangementView.cs b/src/managed/Nota.App/ArrangementView.csindex 444d5faa..03985246 100644--- a/src/managed/Nota.App/ArrangementView.cs+++ b/src/managed/Nota.App/ArrangementView.cs@@ -2005,6 +2005,7 @@ public sealed partial class ArrangementView : UserControl_headerCards[t.Id] = (card, name, true, spine, spineBrush);if (selected) spine.Background = NotaPalette.Accent;AttachHeaderGestures(card, t);+ ValueEntry.SetScope(card, true); // Tab in a value box: volume → pan on this headerreturn card;}@@ -2122,6 +2123,7 @@ public sealed partial class ArrangementView : UserControlfader.GestureBegin += () => _engine?.BeginAutomationWrite(volTrackId, AutomationTarget.Volume, -1, -1, "");fader.GestureEnd += () => _engine?.EndAutomationWrite(volTrackId, AutomationTarget.Volume, -1, -1, "");fader.GestureEnd += () => volUndo?.End();+ ValueEntry.Attach(fader, fader.EntryField("Volume", VolumeDbText), db);_volFaders[t.Id] = fader; _volDb[t.Id] = db;var volCell = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto") };@@ -2138,6 +2140,7 @@ public sealed partial class ArrangementView : UserControlpan.GestureBegin += () => _engine?.BeginAutomationWrite(volTrackId, AutomationTarget.Pan, -1, -1, "");pan.GestureEnd += () => _engine?.EndAutomationWrite(volTrackId, AutomationTarget.Pan, -1, -1, "");pan.GestureEnd += () => panUndo?.End();+ ValueEntry.Attach(pan, pan.EntryField("Pan"));_panBars[t.Id] = pan;var volRow = new Grid { ColumnDefinitions = new ColumnDefinitions("2*,*"), ColumnSpacing = 6, Margin = new Thickness(0, 6, 0, 0) };@@ -2207,6 +2210,7 @@ public sealed partial class ArrangementView : UserControl_headerCards[t.Id] = (card, name, t.IsGroup, spine, spineBrush); // for in-place selection repaintif (selected) spine.Background = NotaPalette.Accent;AttachHeaderGestures(card, t);+ ValueEntry.SetScope(card, true); // Tab in a value box: volume → pan on this headerreturn card;}@@ -2737,6 +2741,7 @@ public sealed partial class ArrangementView : UserControlfader.GestureBegin += () => undo?.Begin();fader.GestureEnd += () => undo?.End();fader.ValueChanged += v => { Change(undo, v, setVolume); dbText.Text = VolumeDbText(v); };+ ValueEntry.Attach(fader, fader.EntryField("Volume", VolumeDbText), dbText);var row = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), RowDefinitions = new RowDefinitions("*,*") };Grid.SetColumn(name, 0);diff --git a/src/managed/Nota.App/AudioClipEditorView.cs b/src/managed/Nota.App/AudioClipEditorView.csindex cf879eee..76e48319 100644--- a/src/managed/Nota.App/AudioClipEditorView.cs+++ b/src/managed/Nota.App/AudioClipEditorView.cs@@ -66,6 +66,7 @@ public sealed class AudioClipEditorView : UserControlpublic AudioClipEditorView(IAudioEngine engine, int trackId, int clipIndex, IBrush clipColor, Action onChanged){+ ValueEntry.SetScope(this, true); // Tab in a value box walks the values shown here_engine = engine;TrackId = trackId;ClipIndex = clipIndex;diff --git a/src/managed/Nota.App/ClipEditorKit.cs b/src/managed/Nota.App/ClipEditorKit.csindex eb42e56b..4fe12fbf 100644--- a/src/managed/Nota.App/ClipEditorKit.cs+++ b/src/managed/Nota.App/ClipEditorKit.cs@@ -328,9 +328,11 @@ internal static class ClipEditorKitCornerRadius = NotaRadius.Control, Padding = new Thickness(10, 0), Child = child,};- /// <summary>A shell slider row: label · 3px track · fixed-width mono value (double-click to type).</summary>+ /// <summary>A shell slider row: label · 3px track · fixed-width mono value. Double-click the+ /// slider or the value to type one, ⌥-click to reset; `textAt` (the read-out at a position,+ /// pure) lets typing search without writing.</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)+ out Action sync, Action? reset = null, double valueW = 36, Func<bool>? dim = null, Func<double, string>? textAt = null){Action repaint = () => { };var track = new SliderTrack { Reset = reset is null ? null : () => { reset(); repaint(); } };@@ -353,7 +355,11 @@ internal static class ClipEditorKit}repaint = Paint;track.Changed += v => { setNorm(v); val.Text = text(); };- ValueEntry.Attach(val, norm, setNorm, text, after: Paint);+ Action? rowReset = reset is null ? null : () => { reset(); Paint(); };+ var field = textAt is null+ ? ValueEntry.Probing(label, norm, setNorm, text, after: Paint, reset: rowReset)+ : new ValueField(label, norm, textAt, setNorm) { After = Paint, Reset = rowReset };+ ValueEntry.Attach(track, field, val);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/AutoFilterViews.cs b/src/managed/Nota.App/Controls/AutoFilterViews.csindex 1ebfdb20..3a35dc8a 100644--- a/src/managed/Nota.App/Controls/AutoFilterViews.cs+++ b/src/managed/Nota.App/Controls/AutoFilterViews.cs@@ -53,7 +53,7 @@ internal sealed class AfFader : Control{base.OnPointerPressed(e);if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2 && !double.IsNaN(Default))+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0) && !double.IsNaN(Default)){GestureBegin?.Invoke(); _v = Default; Changed?.Invoke(_v); GestureEnd?.Invoke();InvalidateVisual(); e.Handled = true; return;diff --git a/src/managed/Nota.App/Controls/ChamberViews.cs b/src/managed/Nota.App/Controls/ChamberViews.csindex 1c40d57e..94e5de5c 100644--- a/src/managed/Nota.App/Controls/ChamberViews.cs+++ b/src/managed/Nota.App/Controls/ChamberViews.cs@@ -77,7 +77,7 @@ internal sealed class ChamberFader : Control{base.OnPointerPressed(e);if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2 && !double.IsNaN(Default))+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0) && !double.IsNaN(Default)){DragStarted?.Invoke(); _v = Default; Changed?.Invoke(_v); DragEnded?.Invoke(); InvalidateVisual(); e.Handled = true; return;}diff --git a/src/managed/Nota.App/Controls/ChordShiftTrack.cs b/src/managed/Nota.App/Controls/ChordShiftTrack.csindex ff23ba54..d8b64dfa 100644--- a/src/managed/Nota.App/Controls/ChordShiftTrack.cs+++ b/src/managed/Nota.App/Controls/ChordShiftTrack.cs@@ -7,8 +7,8 @@// growing up (positive) or down (negative). Unlike the generic SliderTrack the value is// positional — press or drag anywhere sets the semitone under the pointer — because the// track is a pitch ruler. A switched-off slot draws its fill in Border strong.-// GestureBegin / GestureEnd bracket the drag for automation writes; double-click resets-// to 0; right-click bubbles to MIDI Learn.+// GestureBegin / GestureEnd bracket the drag for automation writes; double-click types a+// shift, ⌥-click resets to 0; right-click opens the parameter menu.using System;using Avalonia;@@ -40,6 +40,14 @@ internal sealed class ChordShiftTrack : Controlpublic bool On { get => _on; set { if (_on == value) return; _on = value; InvalidateVisual(); } }public event Action<int>? Changed;++ /// <summary>The track as a typeable value: semitones −12…+12 ("+3", "−5"), ⌥-click 0.</summary>+ internal ValueField EntryField(string name)+ => new(name, () => (_value + Range) / (2.0 * Range), n => Semis(Steps(n)), n => { int v = Steps(n); _value = v; InvalidateVisual(); Changed?.Invoke(v); },+ () => GestureBegin?.Invoke(), () => GestureEnd?.Invoke(), 0.5);++ private static int Steps(double n) => (int)Math.Round(Math.Clamp(n, 0, 1) * 2 * Range) - Range;+ private static string Semis(int v) => v == 0 ? "0" : v.ToString("+0;−0", NotaNum.Culture);public event Action? GestureBegin;public event Action? GestureEnd;@@ -67,7 +75,7 @@ internal sealed class ChordShiftTrack : Control{if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;e.Handled = true;- if (e.ClickCount == 2) { _value = 0; InvalidateVisual(); GestureBegin?.Invoke(); Changed?.Invoke(0); GestureEnd?.Invoke(); return; }+ if ((e.KeyModifiers & KeyModifiers.Alt) != 0) { _value = 0; InvalidateVisual(); GestureBegin?.Invoke(); Changed?.Invoke(0); GestureEnd?.Invoke(); return; }_drag = true;e.Pointer.Capture(this);GestureBegin?.Invoke();diff --git a/src/managed/Nota.App/Controls/ChorusViews.cs b/src/managed/Nota.App/Controls/ChorusViews.csindex 81cfdd26..2ab182da 100644--- a/src/managed/Nota.App/Controls/ChorusViews.cs+++ b/src/managed/Nota.App/Controls/ChorusViews.cs@@ -88,7 +88,7 @@ internal sealed class ChorusVoicesView : Control{base.OnPointerPressed(e);if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { ResetRequested?.Invoke(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { ResetRequested?.Invoke(); e.Handled = true; return; }_a0 = Value?.Invoke() ?? 0.4; _y0 = e.GetPosition(this).Y; _drag = true;GestureBegin?.Invoke(); e.Pointer.Capture(this); e.Handled = true;}diff --git a/src/managed/Nota.App/Controls/CompViews.cs b/src/managed/Nota.App/Controls/CompViews.csindex 88167f98..deea0c0f 100644--- a/src/managed/Nota.App/Controls/CompViews.cs+++ b/src/managed/Nota.App/Controls/CompViews.cs@@ -82,7 +82,7 @@ internal sealed class CompFader : Control{base.OnPointerPressed(e);if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2 && !double.IsNaN(Default))+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0) && !double.IsNaN(Default)){GestureBegin?.Invoke(); _v = Default; Changed?.Invoke(_v); GestureEnd?.Invoke();InvalidateVisual(); e.Handled = true; return;@@ -174,7 +174,7 @@ internal sealed class CompTransferView : Control{base.OnPointerPressed(e);if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { Reset?.Invoke(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { Reset?.Invoke(); e.Handled = true; return; }_drag = true; _startX = e.GetPosition(this).X; _startY = e.GetPosition(this).Y; _startRatio = _ratio; _startThr = _thr;GestureBegin?.Invoke(); e.Pointer.Capture(this); e.Handled = true;}@@ -457,7 +457,7 @@ internal sealed class CompKeyView : Controlbase.OnPointerPressed(e);if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;int hnd = Nearest(e.GetPosition(this).X);- if (e.ClickCount == 2) { Reset?.Invoke(hnd - 1); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { Reset?.Invoke(hnd - 1); e.Handled = true; return; }_drag = hnd; _startY = e.GetPosition(this).Y; _startQ = _q;GestureBegin?.Invoke(hnd - 1); _qGesture = false;e.Pointer.Capture(this); Apply(e.GetPosition(this)); e.Handled = true;diff --git a/src/managed/Nota.App/Controls/CrushViews.cs b/src/managed/Nota.App/Controls/CrushViews.csindex c6989713..e48a2f00 100644--- a/src/managed/Nota.App/Controls/CrushViews.cs+++ b/src/managed/Nota.App/Controls/CrushViews.cs@@ -87,7 +87,7 @@ internal sealed class CrQuantView : Control{base.OnPointerPressed(e);if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { ResetRequested?.Invoke(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { ResetRequested?.Invoke(); e.Handled = true; return; }var v = Value?.Invoke() ?? (0.5, 0.5);_b0 = v.Bits; _r0 = v.Rate; _start = e.GetPosition(this); _drag = true;GestureBegin?.Invoke(); e.Pointer.Capture(this); e.Handled = true;diff --git a/src/managed/Nota.App/Controls/DelayViews.cs b/src/managed/Nota.App/Controls/DelayViews.csindex ac8ca42c..1c40ad8d 100644--- a/src/managed/Nota.App/Controls/DelayViews.cs+++ b/src/managed/Nota.App/Controls/DelayViews.cs@@ -144,7 +144,7 @@ internal sealed class DelayFader : Control{base.OnPointerPressed(e);if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2 && !double.IsNaN(Default))+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0) && !double.IsNaN(Default)){GestureBegin?.Invoke(); _v = Default; Changed?.Invoke(_v); GestureEnd?.Invoke();InvalidateVisual(); e.Handled = true; return;@@ -235,7 +235,7 @@ internal sealed class DelayFilterCurve : Controlbase.OnPointerPressed(e);if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;int h = NearestHandle(e.GetPosition(this).X, Bounds.Width);- if (e.ClickCount == 2) { Reset?.Invoke(h - 1); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { Reset?.Invoke(h - 1); e.Handled = true; return; }_drag = h; GestureBegin?.Invoke(h - 1); e.Pointer.Capture(this); Apply(e); e.Handled = true;}protected override void OnPointerMoved(PointerEventArgs e)diff --git a/src/managed/Nota.App/Controls/DragNumber.cs b/src/managed/Nota.App/Controls/DragNumber.csindex 2235cac3..86ed254f 100644--- a/src/managed/Nota.App/Controls/DragNumber.cs+++ b/src/managed/Nota.App/Controls/DragNumber.cs@@ -4,10 +4,11 @@// A numeric field that edits by vertical drag or double-click-to-type// (HANDOFF §4: "all numerics editable by drag (vertical) and double-click-type;// mono font keeps width stable"). Shows a mono read-out; drag up/down nudges the-// value, double-click swaps in a flat text box that commits on Enter / blur.+// value, double-click swaps in a flat text box that commits on Enter / blur. The typed text+// goes through the shared value parser (ValueText: sign, decimal comma, fractions) and is+// written as one gesture, so it is one undo step like a drag (specs/035).using System;-using System.Globalization;using Avalonia.Controls;using Avalonia.Input;using Avalonia.Layout;@@ -122,11 +123,16 @@ public sealed class DragNumber : UserControl_editing = false;_editor.IsVisible = false;_display.IsVisible = true;- if (double.TryParse(_editor.Text, NumberStyles.Any, NotaNum.Culture, out var v))+ // The field's own unit: a number typed with a unit word ("12ms") keeps the number as written.+ if (ValueText.Read(_editor.Text ?? "", out double mul, out _) is { } read && !double.IsNaN(read)){- _value = Math.Clamp(v, _min, _max);+ double v = Math.Clamp(read / mul, _min, _max);+ if (Math.Abs(v - _value) < 1e-12) return;+ _value = v;Refresh();+ GestureBegin?.Invoke();ValueChanged?.Invoke(_value);+ GestureEnd?.Invoke();}}diff --git a/src/managed/Nota.App/Controls/Eq3Views.cs b/src/managed/Nota.App/Controls/Eq3Views.csindex b23891b0..aad92e97 100644--- a/src/managed/Nota.App/Controls/Eq3Views.cs+++ b/src/managed/Nota.App/Controls/Eq3Views.cs@@ -112,7 +112,7 @@ internal sealed class Eq3Fader : Controlbase.OnPointerPressed(e);if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return; // right-click bubbles (MIDI learn)e.Handled = true;- if (e.ClickCount == 2) { ResetRequested?.Invoke(); return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { ResetRequested?.Invoke(); return; }_drag = true; _startY = e.GetPosition(this).Y; _startDb = _db;e.Pointer.Capture(this);GestureBegin?.Invoke();diff --git a/src/managed/Nota.App/Controls/FlangerViews.cs b/src/managed/Nota.App/Controls/FlangerViews.csindex 74ae14ad..43eb84f6 100644--- a/src/managed/Nota.App/Controls/FlangerViews.cs+++ b/src/managed/Nota.App/Controls/FlangerViews.cs@@ -110,7 +110,7 @@ internal sealed class FlangerCombView : Control{base.OnPointerPressed(e);if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { ResetRequested?.Invoke(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { ResetRequested?.Invoke(); e.Handled = true; return; }var v = Value?.Invoke() ?? (0.735, 0.868);_d0 = v.Delay; _f0 = v.Feedback; _start = e.GetPosition(this); _drag = true;GestureBegin?.Invoke(); e.Pointer.Capture(this); e.Handled = true;diff --git a/src/managed/Nota.App/Controls/IValueEntryHost.cs b/src/managed/Nota.App/Controls/IValueEntryHost.csnew file mode 100644index 00000000..566fa34e--- /dev/null+++ b/src/managed/Nota.App/Controls/IValueEntryHost.cs@@ -0,0 +1,54 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// What a control hands to ValueEntry so its value can be typed (specs/035-typed-value-entry):+// a ValueField per typeable value, and — for controls with several handles (graphs,+// envelopes, matrices) — an IValueEntryHost that says which fields sit under the pointer.++using System;+using System.Collections.Generic;+using Avalonia;++namespace Nota.App;++/// <summary>One typeable value. Positions are normalised 0..1; the owner maps them to the parameter.</summary>+/// <param name="Name">Shown in the menu header ("Cutoff").</param>+/// <param name="Get">The current position.</param>+/// <param name="TextAt">The read-out at a position — pure: it formats, it never writes the engine+/// (unless <see cref="Probes"/> says otherwise).</param>+/// <param name="Set">Writes a position through the same setter a drag uses.</param>+/// <param name="Begin">Opens the gesture (automation write / undo step).</param>+/// <param name="End">Closes it.</param>+/// <param name="Default">The 0..1 position of the default; null = no reset.</param>+internal sealed record ValueField(string Name, Func<double> Get, Func<double, string> TextAt, Action<double> Set,+ Action? Begin = null, Action? End = null, double? Default = null)+{+ /// <summary>Resets by action instead of by position (a slider row's own reset).</summary>+ public Action? Reset { get; init; }+ /// <summary>Removes instead of resetting (a matrix route, a cable): ⌥-click and the menu's Clear.</summary>+ public Action? Clear { get; init; }+ /// <summary>Repaints the owner after a commit or a reset.</summary>+ public Action? After { get; init; }+ /// <summary><see cref="TextAt"/> reads back through <see cref="Set"/> (legacy rows, plug-in+ /// parameters whose text is only readable at the current value); the position is restored+ /// before the gesture opens.</summary>+ public bool Probes { get; init; }++ public bool CanReset => Reset is not null || Default is not null;+}++/// <summary>A control with several typeable handles: double-click / ⌥-click / right-click ask it+/// which fields sit under the pointer.</summary>+internal interface IValueEntryHost+{+ /// <summary>The fields of the handle at <paramref name="p"/>, in Tab order; null = not on a+ /// handle, so the event passes through to the control (an empty-space double-click keeps+ /// its meaning).</summary>+ IReadOnlyList<ValueField>? FieldsAt(Point p);++ /// <summary>Where the box sits for <paramref name="field"/>, in the host's coordinates.</summary>+ Rect AnchorOf(ValueField field);++ /// <summary>Every field, in order, for the Tab chain.</summary>+ IReadOnlyList<ValueField> AllFields { get; }+}diff --git a/src/managed/Nota.App/Controls/Knob.cs b/src/managed/Nota.App/Controls/Knob.csindex 9203ce6d..8fbb030c 100644--- a/src/managed/Nota.App/Controls/Knob.cs+++ b/src/managed/Nota.App/Controls/Knob.cs@@ -6,7 +6,8 @@// raised cap on a seam and a primary-ink 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+// (up = increase; Ctrl/⌘/Shift = fine). Double-click types a value and ⌥-click resets+// (ValueEntry, attached by KnobCell once `Format` is set). Same public API as// MiniFader (Value / max / Accent / ValueChanged / GestureBegin / GestureEnd) so it// drops into the plugin editors.//@@ -78,9 +79,13 @@ public sealed class Knob : Controlpublic 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>+ /// <summary>Value restored on ⌥-click (NaN = no reset).</summary>public double Default { get; set; } = double.NaN;+ /// <summary>The read-out text at a value (0..max) — what the knob's value line shows. Pure:+ /// it formats, it never writes. Set it and the knob takes typed values (ValueEntry).</summary>+ public Func<double, string>? Format { get; set; }+private readonly double _max;private double _value;private bool _drag;@@ -106,6 +111,30 @@ public sealed class Knob : Control/// <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;+ /// <summary>The knob as a typeable value: a typed value or a reset runs the same+ /// GestureBegin / ValueChanged / GestureEnd a drag does. Null without a Format.</summary>+ internal ValueField? EntryField(string name)+ => Format is not { } fmt ? null : new ValueField(name, () => _value / _max, n => fmt(n * _max), n => SetByHand(n * _max),+ () => GestureBegin?.Invoke(), () => GestureEnd?.Invoke(), double.IsNaN(Default) ? null : Math.Clamp(Default, 0, _max) / _max);++ /// <summary>A probing field for a knob without a Format: each probe sets the knob (running its+ /// ValueChanged handlers) and reads <paramref name="text"/> back.</summary>+ internal ValueField ProbingField(string name, Func<string> text)+ => ValueEntry.Probing(name, () => _value / _max, n => SetByHand(n * _max), text,+ () => GestureBegin?.Invoke(), () => GestureEnd?.Invoke()) with+ { Default = double.IsNaN(Default) ? null : Math.Clamp(Default, 0, _max) / _max };++ // A value set by the user other than by dragging (typed, reset): repaint and notify.+ private void SetByHand(double v)+ {+ v = Math.Clamp(v, 0, _max);+ if (Math.Abs(v - _value) < 1e-9) return;+ _value = v;+ InvalidateVisual();+ ValueChanged?.Invoke(_value);+ ValueSet?.Invoke();+ }+public Knob(double value = 1.0, double max = 1.0){_max = max <= 0 ? 1.0 : max;@@ -119,19 +148,13 @@ public sealed class Knob : Control{// Left button only — let right-click bubble to a context menu (e.g. CV modulate).if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- // Double-click restores the parameter's default.- if (e.ClickCount == 2 && !double.IsNaN(Default))+ // ⌥-click restores the default — ValueEntry handles it first on an attached knob; this+ // keeps reset on a knob built without one.+ if ((e.KeyModifiers & KeyModifiers.Alt) != 0 && !double.IsNaN(Default)){- double d = Math.Clamp(Default, 0, _max);- if (Math.Abs(d - _value) > 1e-6)- {- GestureBegin?.Invoke();- _value = d;- InvalidateVisual();- ValueChanged?.Invoke(_value);- ValueSet?.Invoke();- GestureEnd?.Invoke();- }+ GestureBegin?.Invoke();+ SetByHand(Default);+ GestureEnd?.Invoke();e.Handled = true;return;}diff --git a/src/managed/Nota.App/Controls/LensViews.cs b/src/managed/Nota.App/Controls/LensViews.csindex 259c1407..51715a20 100644--- a/src/managed/Nota.App/Controls/LensViews.cs+++ b/src/managed/Nota.App/Controls/LensViews.cs@@ -596,7 +596,7 @@ internal sealed class LensVSlider : Controlprotected override void OnPointerPressed(PointerPressedEventArgs e){if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2 && Default >= 0) { Value = Default; ValueChanged?.Invoke(_value); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0) && Default >= 0) { Value = Default; ValueChanged?.Invoke(_value); e.Handled = true; return; }_drag = true; _lastY = e.GetPosition(this).Y;GestureBegin?.Invoke(); e.Pointer.Capture(this); e.Handled = true;}diff --git a/src/managed/Nota.App/Controls/LevelViews.cs b/src/managed/Nota.App/Controls/LevelViews.csindex 728659dd..9037202d 100644--- a/src/managed/Nota.App/Controls/LevelViews.cs+++ b/src/managed/Nota.App/Controls/LevelViews.cs@@ -91,7 +91,7 @@ internal sealed class LvHistoryView : Control{base.OnPointerPressed(e);if (!_canDrag || !e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { ResetRequested?.Invoke(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { ResetRequested?.Invoke(); e.Handled = true; return; }_v0 = Value?.Invoke() ?? 0.611; _y0 = e.GetPosition(this).Y; _dragging = true;GestureBegin?.Invoke(); e.Pointer.Capture(this); e.Handled = true;}@@ -215,7 +215,7 @@ internal sealed class LvGainFader : Control{base.OnPointerPressed(e);if (!_manual || !e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { ResetRequested?.Invoke(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { ResetRequested?.Invoke(); e.Handled = true; return; }_v0 = Value?.Invoke() ?? _db; _y0 = e.GetPosition(this).Y; _drag = true;GestureBegin?.Invoke(); e.Pointer.Capture(this); e.Handled = true;}diff --git a/src/managed/Nota.App/Controls/MiniFader.cs b/src/managed/Nota.App/Controls/MiniFader.csindex 76203b69..7d374760 100644--- a/src/managed/Nota.App/Controls/MiniFader.cs+++ b/src/managed/Nota.App/Controls/MiniFader.cs@@ -25,7 +25,7 @@ public sealed class MiniFader : Control/// <summary>On the audio path: neutral ink fill + cap instead of the quieter rule grey.</summary>public bool Accent { get; init; }- /// <summary>Double-click target value, or negative to disable reset.</summary>+ /// <summary>⌥-click target value, or negative to disable reset.</summary>public double Default { get; init; } = -1;private readonly double _max;@@ -60,11 +60,13 @@ public sealed class MiniFader : Control{// 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)+ // ⌥-click resets to the default value (e.g. 0 dB for a track volume) — ValueEntry+ // handles it first once attached; double-click types a value there.+ if ((e.KeyModifiers & KeyModifiers.Alt) != 0 && Default >= 0){- double d = Math.Clamp(Default, 0, _max);- if (Math.Abs(d - _value) > 1e-6) { _value = d; InvalidateVisual(); ValueChanged?.Invoke(_value); }+ GestureBegin?.Invoke();+ SetValue(Default);+ GestureEnd?.Invoke();e.Handled = true;return;}@@ -105,6 +107,11 @@ public sealed class MiniFader : Controlbase.OnPointerCaptureLost(e);}+ /// <summary>The fader as a typeable value; <paramref name="fmt"/> is its read-out at a value (0..max).</summary>+ internal ValueField EntryField(string name, Func<double, string> fmt)+ => new(name, () => _value / _max, n => fmt(n * _max), n => SetValue(n * _max),+ () => GestureBegin?.Invoke(), () => GestureEnd?.Invoke(), Default >= 0 ? Math.Clamp(Default, 0, _max) / _max : null);+private void SetValue(double raw){double v = Math.Clamp(raw, 0, _max);diff --git a/src/managed/Nota.App/Controls/OrbitViews.cs b/src/managed/Nota.App/Controls/OrbitViews.csindex bd7d5859..4884c1f5 100644--- a/src/managed/Nota.App/Controls/OrbitViews.cs+++ b/src/managed/Nota.App/Controls/OrbitViews.cs@@ -99,7 +99,7 @@ internal sealed class OrbitGainView : Control{base.OnPointerPressed(e);if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { ResetRequested?.Invoke(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { ResetRequested?.Invoke(); e.Handled = true; return; }var v = Value?.Invoke() ?? (0.7, 0.5);_a0 = v.Amount; _p0 = v.Phase; _start = e.GetPosition(this); _drag = true;GestureBegin?.Invoke(); e.Pointer.Capture(this); e.Handled = true;diff --git a/src/managed/Nota.App/Controls/PanBar.cs b/src/managed/Nota.App/Controls/PanBar.csindex 252b916b..50a33154 100644--- a/src/managed/Nota.App/Controls/PanBar.cs+++ b/src/managed/Nota.App/Controls/PanBar.cs@@ -3,8 +3,8 @@//// A compact bipolar pan bar for the arrangement track header: a// rounded field with a centre tick and a brass fill that grows from the centre-// toward the panned side, "50L … C … 50R" text over it. Drag horizontally to set;-// double-click resets to centre. Fires GestureBegin/End so callers can bracket an+// toward the panned side, "50L … C … 50R" text over it. Drag to set; double-click types+// a value, ⌥-click centres it. Fires GestureBegin/End so callers can bracket an// automation write, like MiniFader / the gauge Knob.using System;@@ -55,7 +55,7 @@ public sealed class PanBar : Controlprotected override void OnPointerPressed(PointerPressedEventArgs e){if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return; // right-click bubbles- if (e.ClickCount == 2) { Apply(0); e.Handled = true; return; } // reset to centre+ if ((e.KeyModifiers & KeyModifiers.Alt) != 0) { GestureBegin?.Invoke(); Apply(0); GestureEnd?.Invoke(); e.Handled = true; return; } // centre_drag = true;_lastY = e.GetPosition(this).Y;_raw = _pan;@@ -95,10 +95,16 @@ public sealed class PanBar : Controlbase.OnPointerCaptureLost(e);}+ /// <summary>The bar as a typeable value ("30L", "C", "12R" on its own 50 scale); ⌥-click centres.</summary>+ internal ValueField EntryField(string name)+ => new(name, () => (_pan + 1) / 2, n => Label(Detent(n * 2 - 1)), n => Apply(n * 2 - 1),+ () => GestureBegin?.Invoke(), () => GestureEnd?.Invoke(), 0.5);++ private static double Detent(double p) { p = Math.Clamp(p, -1, 1); return Math.Abs(p) < 0.04 ? 0 : p; } // small centre detent+private void Apply(double p){- p = Math.Clamp(p, -1, 1);- if (Math.Abs(p) < 0.04) p = 0; // small centre detent+ p = Detent(p);if (Math.Abs(p - _pan) < 1e-4) return;_pan = p;InvalidateVisual();diff --git a/src/managed/Nota.App/Controls/PanKnob.cs b/src/managed/Nota.App/Controls/PanKnob.csindex c2a8f4a7..8ac23107 100644--- a/src/managed/Nota.App/Controls/PanKnob.cs+++ b/src/managed/Nota.App/Controls/PanKnob.cs@@ -25,6 +25,22 @@ internal sealed class PanKnob : Controlpublic PanKnob(double pan) { _pan = Math.Clamp(pan, -1, 1); Width = 26; Height = 26; }+ /// <summary>The knob as a typeable value; <paramref name="fmt"/> is its read-out at a pan+ /// (−1..1). ⌥-click centres it.</summary>+ internal ValueField EntryField(string name, Func<double, string> fmt)+ => new(name, () => (_pan + 1) / 2, n => fmt(n * 2 - 1), n => Set(n * 2 - 1),+ () => GestureBegin?.Invoke(), () => GestureEnd?.Invoke(), 0.5);++ /// <summary>Sets the pan without raising PanChanged (external sync).</summary>+ public void SetPanExternal(double p) { _pan = Math.Clamp(p, -1, 1); InvalidateVisual(); }++ private void Set(double p)+ {+ p = Math.Clamp(p, -1, 1);+ if (Math.Abs(p - _pan) < 1e-9) return;+ _pan = p; InvalidateVisual(); PanChanged?.Invoke(_pan);+ }+protected override void OnPointerPressed(PointerPressedEventArgs e) { _drag = true; _startY = e.GetPosition(this).Y; _startPan = _pan; e.Pointer.Capture(this); GestureBegin?.Invoke(); e.Handled = true; }protected override void OnPointerMoved(PointerEventArgs e){diff --git a/src/managed/Nota.App/Controls/PerformWheel.cs b/src/managed/Nota.App/Controls/PerformWheel.csindex 1528b3db..306c859b 100644--- a/src/managed/Nota.App/Controls/PerformWheel.cs+++ b/src/managed/Nota.App/Controls/PerformWheel.cs@@ -6,7 +6,7 @@// neutral bar at the value (accent while dragged). Nota Operator's card keeps both on screen on every tab.//// Interaction matches the knob contract: vertical drag (up increases) over the wheel's own-// height, Shift/Ctrl/⌘ for fine, a click never jumps the value, double-click restores the+// height, Shift/Ctrl/⌘ for fine, a click never jumps the value, ⌥-click restores the// default, and a spring wheel (pitch bend) returns to its default when released.using System;@@ -32,7 +32,7 @@ internal sealed class PerformWheel : Controlprivate bool _drag;private double _startY, _startV;- /// <summary>Value restored on double-click, and sprung back to when <see cref="Spring"/>.</summary>+ /// <summary>Value restored on ⌥-click, and sprung back to when <see cref="Spring"/>.</summary>public double Default { get; init; } = 0;/// <summary>True for a pitch wheel: it snaps back to <see cref="Default"/> on release.</summary>@@ -62,7 +62,7 @@ internal sealed class PerformWheel : Control{var pt = e.GetCurrentPoint(this);if (!pt.Properties.IsLeftButtonPressed) return; // right-click bubbles to the CV / learn menu- if (e.ClickCount >= 2) { Write(Default); e.Handled = true; return; }+ if ((e.KeyModifiers & KeyModifiers.Alt) != 0) { GestureBegin?.Invoke(); Write(Default); GestureEnd?.Invoke(); e.Handled = true; return; }_drag = true; _startY = pt.Position.Y; _startV = _norm;GestureBegin?.Invoke();e.Pointer.Capture(this);@@ -98,6 +98,10 @@ internal sealed class PerformWheel : Controlbase.OnPointerCaptureLost(e);}+ /// <summary>The wheel as a typeable value (a held wheel — not a spring one, which would not stay put).</summary>+ internal ValueField EntryField(string name, Func<double, string> fmt)+ => new(name, () => _norm, fmt, Write, () => GestureBegin?.Invoke(), () => GestureEnd?.Invoke(), Default);+private void Write(double v){v = Math.Clamp(v, 0, 1);diff --git a/src/managed/Nota.App/Controls/PhaserViews.cs b/src/managed/Nota.App/Controls/PhaserViews.csindex b4149b1e..ebba130b 100644--- a/src/managed/Nota.App/Controls/PhaserViews.cs+++ b/src/managed/Nota.App/Controls/PhaserViews.cs@@ -127,7 +127,7 @@ internal sealed class PhaserResponseView : Control{base.OnPointerPressed(e);if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { ResetRequested?.Invoke(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { ResetRequested?.Invoke(); e.Handled = true; return; }var v = Value?.Invoke() ?? (0.602, 0.711);_c0 = v.Center; _f0 = v.Feedback; _start = e.GetPosition(this); _drag = true;GestureBegin?.Invoke(); e.Pointer.Capture(this); e.Handled = true;diff --git a/src/managed/Nota.App/Controls/PrismViews.cs b/src/managed/Nota.App/Controls/PrismViews.csindex 72c77f25..e565c4c4 100644--- a/src/managed/Nota.App/Controls/PrismViews.cs+++ b/src/managed/Nota.App/Controls/PrismViews.cs@@ -324,7 +324,7 @@ internal sealed class PrismTransfer : Controlif (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;int hdl = Hit(e.GetPosition(this));if (hdl == 0) return;- if (e.ClickCount == 2) { ResetRequested?.Invoke(hdl); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { ResetRequested?.Invoke(hdl); e.Handled = true; return; }_drag = hdl; _start = e.GetPosition(this);DragStarted?.Invoke(hdl); e.Pointer.Capture(this); e.Handled = true;}diff --git a/src/managed/Nota.App/Controls/RangeSliderTrack.cs b/src/managed/Nota.App/Controls/RangeSliderTrack.csindex bb257f5d..0b2ac042 100644--- a/src/managed/Nota.App/Controls/RangeSliderTrack.cs+++ b/src/managed/Nota.App/Controls/RangeSliderTrack.cs@@ -5,7 +5,7 @@// track, a brass fill between the handles and two 6×7 Brass Light handles. Works in// normalised 0..1 (the caller maps to its units and keeps a minimum gap). A press picks the// nearer handle and a horizontal drag moves it by the pointer's travel — a click never jumps-// a value; Shift (or Ctrl/⌘) drags fine. Double-click resets. GestureBegin / GestureEnd+// a value; Shift (or Ctrl/⌘) drags fine. ⌥-click resets. GestureBegin / GestureEnd// (with the handle: 0 = low, 1 = high) bracket the drag for automation writes.using System;@@ -59,9 +59,8 @@ internal sealed class RangeSliderTrack : Controlprotected override void OnPointerPressed(PointerPressedEventArgs e){if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2 && Reset is not null)+ if ((e.KeyModifiers & KeyModifiers.Alt) != 0 && Reset is not null){- if (_drag >= 0) { int d = _drag; _drag = -1; InvalidateVisual(); e.Pointer.Capture(null); GestureEnd?.Invoke(d); }Reset();e.Handled = true;return;diff --git a/src/managed/Nota.App/Controls/ReverbViews.cs b/src/managed/Nota.App/Controls/ReverbViews.csindex 261e70f4..e37e7be2 100644--- a/src/managed/Nota.App/Controls/ReverbViews.cs+++ b/src/managed/Nota.App/Controls/ReverbViews.cs@@ -75,7 +75,7 @@ internal sealed class ReverbTailView : Controlif (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;var p = e.GetPosition(this);int target = Math.Abs(p.X - PreX()) <= 8 ? 2 : 1;- if (e.ClickCount == 2) { Reset?.Invoke(target - 1); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { Reset?.Invoke(target - 1); e.Handled = true; return; }_drag = target; _dragX = p.X; _dragY = p.Y; _dragV = DecayValue?.Invoke() ?? 0.5;GestureBegin?.Invoke(target - 1);e.Pointer.Capture(this);diff --git a/src/managed/Nota.App/Controls/ShutterViews.cs b/src/managed/Nota.App/Controls/ShutterViews.csindex 1d6da317..52aa6872 100644--- a/src/managed/Nota.App/Controls/ShutterViews.cs+++ b/src/managed/Nota.App/Controls/ShutterViews.cs@@ -96,7 +96,7 @@ internal abstract class ShDragView : Controlif (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;int hdl = Hit(e.GetPosition(this));if (hdl < 0) return;- if (e.ClickCount == 2) { ResetRequested?.Invoke(hdl); InvalidateVisual(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { ResetRequested?.Invoke(hdl); InvalidateVisual(); e.Handled = true; return; }_drag = hdl; _start = e.GetPosition(this); _v0 = Value?.Invoke(hdl) ?? 0;GestureBegin?.Invoke(hdl); e.Pointer.Capture(this); e.Handled = true;Move(e.GetPosition(this));diff --git a/src/managed/Nota.App/Controls/SliderTrack.cs b/src/managed/Nota.App/Controls/SliderTrack.csindex 82ea84f5..26c9a723 100644--- a/src/managed/Nota.App/Controls/SliderTrack.cs+++ b/src/managed/Nota.App/Controls/SliderTrack.cs@@ -13,8 +13,8 @@// a slider drags along its own axis (#115) — right increases and the handle follows the// pointer — and a vertical drag still works as on a knob (up increases, full range over// ~140px). Shift (or Ctrl/⌘) is fine on both; ew-resize; a click never jumps the value.-// Double-click resets when a reset is supplied; right-click bubbles to the CV-modulate /-// MIDI Learn menu.+// ⌥-click resets when a reset is supplied; double-click types a value (ValueEntry, attached+// by the row); right-click opens the parameter menu.// GestureBegin / GestureEnd bracket the drag so automation writes are recorded, and the// row's live-follow refresher should skip while Dragging.@@ -59,7 +59,8 @@ internal sealed class SliderTrack : Controlpublic double Marker { get => _marker; set { if (value.Equals(_marker)) return; _marker = value; InvalidateVisual(); } }private double _marker = double.NaN;- /// <summary>Double-click handler (restore the default). Null disables double-click.</summary>+ /// <summary>⌥-click handler (restore the default). Null disables reset. Double-click types a+ /// value once the row attaches ValueEntry (DeviceCardKit.SliderRow does).</summary>public Action? Reset { get; init; }public event Action<double>? Changed; // new normalised value, from the pointer@@ -82,10 +83,11 @@ internal sealed class SliderTrack : Controlprotected override void OnPointerPressed(PointerPressedEventArgs e){if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2 && Reset is not null)+ if ((e.KeyModifiers & KeyModifiers.Alt) != 0 && Reset is not null){- if (_drag) { _drag = false; e.Pointer.Capture(null); GestureEnd?.Invoke(); InvalidateVisual(); }+ GestureBegin?.Invoke();Reset();+ GestureEnd?.Invoke();e.Handled = true;return;}diff --git a/src/managed/Nota.App/Controls/VFader.cs b/src/managed/Nota.App/Controls/VFader.csindex 78222921..0ccb523d 100644--- a/src/managed/Nota.App/Controls/VFader.cs+++ b/src/managed/Nota.App/Controls/VFader.cs@@ -31,21 +31,40 @@ internal sealed class VFader : Control/// <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(); }- protected override void OnPointerPressed(PointerPressedEventArgs e) { _drag = true; e.Pointer.Capture(this); GestureBegin?.Invoke(); SetY(e.GetPosition(this).Y); e.Handled = true; }- protected override void OnPointerMoved(PointerEventArgs e) { if (_drag) SetY(e.GetPosition(this).Y); }+ /// <summary>The fader as a typeable value; <paramref name="fmt"/> is its read-out at a value+ /// (0..1.5), <paramref name="def"/> the value ⌥-click restores.</summary>+ internal ValueField EntryField(string name, Func<double, string> fmt, double? def)+ => new(name, () => _value / Max, n => fmt(n * Max), n => Set(n * Max),+ () => GestureBegin?.Invoke(), () => GestureEnd?.Invoke(), def is { } d ? Math.Clamp(d, 0, Max) / Max : null);++ private void Set(double v)+ {+ v = Math.Clamp(v, 0, Max);+ if (Math.Abs(v - _value) < 1e-9) return;+ _value = v; InvalidateVisual(); ValueChanged?.Invoke(v);+ }++ // Relative, like every value control (DESIGN.md § Interaction contract): a click never+ // jumps the value — so the first click of a double-click (type a value) moves nothing.+ private double _startY, _startV;+ protected override void OnPointerPressed(PointerPressedEventArgs e)+ {+ if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;+ _drag = true; _startY = e.GetPosition(this).Y; _startV = _value;+ e.Pointer.Capture(this); GestureBegin?.Invoke(); e.Handled = true;+ }+ protected override void OnPointerMoved(PointerEventArgs e)+ {+ if (!_drag) return;+ double h = Bounds.Height - CapH; if (h <= 0) return;+ bool fine = (e.KeyModifiers & (KeyModifiers.Shift | KeyModifiers.Control | KeyModifiers.Meta)) != 0;+ Set(_startV + (_startY - e.GetPosition(this).Y) / h * Max / (fine ? 10 : 1));+ }protected override void OnPointerReleased(PointerReleasedEventArgs e) { if (_drag) GestureEnd?.Invoke(); _drag = false; e.Pointer.Capture(null); }// Capture taken away mid-drag (the window deactivates): end the gesture and drop the accent.protected override void OnPointerCaptureLost(PointerCaptureLostEventArgs e) { if (_drag) { _drag = false; GestureEnd?.Invoke(); InvalidateVisual(); } base.OnPointerCaptureLost(e); }- private void SetY(double y)- {- double h = Bounds.Height; if (h <= CapH) return;- double frac = Math.Clamp(1 - (y - CapH / 2) / (h - CapH), 0, 1);- double v = frac * Max;- if (Math.Abs(v - _value) < 1e-4) return;- _value = v; InvalidateVisual(); ValueChanged?.Invoke(v);- }public override void Render(DrawingContext ctx){diff --git a/src/managed/Nota.App/Controls/ValueBar.cs b/src/managed/Nota.App/Controls/ValueBar.csindex d0068354..c911cb90 100644--- a/src/managed/Nota.App/Controls/ValueBar.cs+++ b/src/managed/Nota.App/Controls/ValueBar.cs@@ -3,7 +3,7 @@//// A draggable value box: a rounded field showing the// value text centered over a horizontal fill that tracks the normalized value. Drag-// vertically to change (up = increase); double-click resets to the default. Fires+// vertically to change (up = increase); double-click types a value, ⌥-click resets to the default. Fires// GestureBegin/End so callers can bracket an automation write, like the gauge Knob.using System;@@ -33,7 +33,7 @@ public sealed class ValueBar : Controlpublic bool Accent { get; init; }/// <summary>Value change per pixel of vertical drag.</summary>public double Sensitivity { get; init; } = 0.006;- /// <summary>Double-click target (normalized), or negative to disable reset.</summary>+ /// <summary>⌥-click target (normalized), or negative to disable reset.</summary>public double Default { get; init; } = -1;public event Action<double>? ValueChanged;@@ -53,6 +53,8 @@ public sealed class ValueBar : Control{_value = Math.Clamp(value, 0, 1);_fmt = fmt;+ ValueEntry.Attach(this, new ValueField("Value", () => _value, fmt, Apply, () => GestureBegin?.Invoke(), () => GestureEnd?.Invoke(),+ Default >= 0 ? Default : null));Height = 18;MinWidth = 46;Cursor = new Cursor(StandardCursorType.SizeNorthSouth);@@ -60,7 +62,7 @@ public sealed class ValueBar : Controlprotected override void OnPointerPressed(PointerPressedEventArgs e){- if (e.ClickCount == 2 && Default >= 0) { Apply(Default); e.Handled = true; return; }+ if ((e.KeyModifiers & KeyModifiers.Alt) != 0 && Default >= 0) { GestureBegin?.Invoke(); Apply(Default); GestureEnd?.Invoke(); e.Handled = true; return; }_drag = true;_lastY = e.GetPosition(this).Y;e.Pointer.Capture(this);diff --git a/src/managed/Nota.App/Controls/ValueEntry.cs b/src/managed/Nota.App/Controls/ValueEntry.csindex c920cb50..b91b0ad8 100644--- a/src/managed/Nota.App/Controls/ValueEntry.cs+++ b/src/managed/Nota.App/Controls/ValueEntry.cs@@ -1,24 +1,31 @@// 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.+// Typing an exact value into any parameter control (HANDOFF §4: "all numerics editable by+// drag (vertical) and double-click-type"; specs/035-typed-value-entry). One gesture scheme+// for every knob, fader, slider, graph handle and matrix cell://-// 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.+// double-click turns the read-out itself editable — a borderless text box in its place+// (an adorner, so it works whatever panel the read-out sits in) with a 1px+// accent line under it and the number selected; Enter or a click away commits, Escape+// cancels, Tab / Shift+Tab commit and move to the next / previous value on+// the same card (the nearest Scope), wrapping+// ⌥/Alt-click restores the default (or clears a route)+// right-click a parameter menu — Type value…, Reset to default / Clear — unless the+// control has its own menu, which then adds MenuItems itself+//+// The pointer handlers run in the tunnel phase, so the control's own press handling (a drag)+// never sees these clicks. A control hands over a ValueField (one value) or is an+// IValueEntryHost (several handles, asked for the fields under the pointer; null lets the+// event through). The typed text is read by ValueText against the field's own read-out,+// and a commit is one Begin / Set / End — one undo step and one automation gesture, like a+// drag. Return outside the box keeps its transport meaning (Stop), so a control does not+// open entry on Enter.using System;using System.Collections.Generic;-using System.Globalization;-using System.Text.RegularExpressions;+using System.Linq;+using System.Runtime.CompilerServices;using Avalonia;using Avalonia.Controls;using Avalonia.Controls.Primitives;@@ -33,240 +40,319 @@ 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)+ [System.Text.RegularExpressions.GeneratedRegex(@"[+\-−]?(?:\d+(?:[.,]\d*)?|[.,]\d+|∞)")]+ private static partial System.Text.RegularExpressions.Regex Number();++ // ---- attaching -----------------------------------------------------------------------++ // What Tab needs to find a control's values again: the fields and where each one's box goes.+ private sealed class Entry(Control owner, Func<IReadOnlyList<ValueField>> fields, Func<ValueField, Anchor> anchor){- 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(); });- setNorm(from); // the probes moved it: the gesture must open on the old value (undo, specs/016)- begin?.Invoke();- setNorm(to ?? from);- end?.Invoke();- after?.Invoke();- });- }, RoutingStrategies.Bubble, handledEventsToo: false);+ public readonly WeakReference<Control> Owner = new(owner);+ public readonly Func<IReadOnlyList<ValueField>> Fields = fields;+ public readonly Func<ValueField, Anchor> AnchorOf = anchor;}- private static void Open(TextBlock readout, Action<string> commit)+ /// <summary>Where a box sits: a rectangle in <c>Visual</c>'s coordinates; <c>Font</c> is the read-out+ /// it replaces (its font and alignment), null over a control without one.</summary>+ private readonly record struct Anchor(Visual Visual, Rect Rect, TextBlock? Font);++ private static readonly ConditionalWeakTable<Control, Entry> Entries = new();++ /// <summary>Marks a Tab-chain root: a device card, a mixer strip, an editor panel.</summary>+ public static readonly AttachedProperty<bool> ScopeProperty =+ AvaloniaProperty.RegisterAttached<Control, bool>("Scope", typeof(ValueEntry));+ public static bool GetScope(Control c) => c.GetValue(ScopeProperty);+ public static void SetScope(Control c, bool v) => c.SetValue(ScopeProperty, v);++ /// <summary>Make <paramref name="control"/> typeable (and its <paramref name="readout"/>, where the+ /// box then sits). <paramref name="menu"/> false: the control shows its own right-click menu+ /// and adds <see cref="MenuItems"/> to it.</summary>+ public static void Attach(Control control, ValueField field, TextBlock? readout = null, bool menu = true){- 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+ Anchor AnchorOf(ValueField _) => readout is { IsEffectivelyVisible: true }+ ? new Anchor(readout, new Rect(readout.Bounds.Size), readout)+ : new Anchor(control, new Rect(control.Bounds.Size), null);+ var fields = new[] { field };+ if (control is TextBlock tb) tb.Background ??= Brushes.Transparent;+ Entries.AddOrUpdate(control, new Entry(control, () => fields, AnchorOf));+ void Press(object? s, PointerPressedEventArgs e){- 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 (Pressed(e, s as Visual ?? control, field)) Open(control, field, AnchorOf(field));+ }+ control.AddHandler(InputElement.PointerPressedEvent, Press, RoutingStrategies.Tunnel);+ if (readout is not null && !ReferenceEquals(readout, control)){- 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!);+ readout.Background ??= Brushes.Transparent; // the whole column takes the double-click, not just the glyphs+ readout.AddHandler(InputElement.PointerPressedEvent, Press, RoutingStrategies.Tunnel);}- box.KeyDown += (_, e) =>+ if (!menu) return;+ void Context(object? s, ContextRequestedEventArgs 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(); });+ if (e.Handled) return;+ e.Handled = true;+ ShowMenu(control, field, () => Open(control, field, AnchorOf(field)));+ }+ control.AddHandler(Control.ContextRequestedEvent, Context);+ if (readout is not null && !ReferenceEquals(readout, control)) readout.AddHandler(Control.ContextRequestedEvent, Context);}- // ---- reading the typed text against the read-out -------------------------------------+ /// <summary>A knob and its value line: typed through its Format, or — without one — by reading+ /// <paramref name="readout"/> back after each probe. Nothing without either.</summary>+ public static void Attach(Knob knob, string name, TextBlock? readout = null, bool menu = true)+ {+ if ((knob.EntryField(name) ?? (readout is null ? null : knob.ProbingField(name, () => readout.Text ?? ""))) is { } f)+ Attach(knob, f, readout, menu);+ }- private const int Samples = 48, Steps = 22;+ /// <summary>A knob whose value line is refreshed elsewhere: <paramref name="text"/> formats the+ /// current value (read back after each probe when the knob has no Format).</summary>+ public static void Attach(Knob knob, string name, TextBlock readout, Func<string> text, bool menu = true)+ => Attach(knob, knob.EntryField(name) ?? knob.ProbingField(name, text), readout, menu);- /// <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)+ /// <summary>Make the handles of <paramref name="host"/> typeable.</summary>+ public static void AttachHost<T>(T host, bool menu = true) where T : Control, IValueEntryHost{- 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++)+ Anchor AnchorOf(ValueField f) => new(host, host.AnchorOf(f), null);+ Entries.AddOrUpdate(host, new Entry(host, () => host.AllFields, AnchorOf));+ host.AddHandler(InputElement.PointerPressedEvent, (_, e) =>{- n[i] = (double)i / Samples;- txt[i] = at(n[i]);- q[i] = Read(txt[i], out _, out _) ?? double.NaN;- }+ if (host.FieldsAt(e.GetPosition(host)) is not { Count: > 0 } fs) return;+ if (Pressed(e, host, fs[0], fs)) Open(host, fs[0], AnchorOf(fs[0]));+ }, RoutingStrategies.Tunnel);+ if (!menu) return;+ host.AddHandler(Control.ContextRequestedEvent, (_, e) =>+ {+ if (e.Handled || !e.TryGetPosition(host, out var p) || host.FieldsAt(p) is not { Count: > 0 } fs) return;+ e.Handled = true;+ ShowMenu(host, fs[0], () => Open(host, fs[0], AnchorOf(fs[0])), fs);+ });+ }- 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);+ /// <summary>A slider row's read-out, typed by probing the row's own setter (<paramref name="setNorm"/>+ /// then <paramref name="text"/>). <paramref name="control"/> (its slider) takes the same gestures;+ /// <paramref name="reset"/> — by default the slider's own Reset — is what ⌥-click and the menu run.</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, Action? reset = null, Control? control = null, string name = "Value")+ => Attach(control ?? readout, Probing(name, norm, setNorm, text, begin, end, after, reset ?? (control as SliderTrack)?.Reset), readout);- 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);+ /// <summary>A field typed by probing <paramref name="setNorm"/> + <paramref name="text"/>.</summary>+ public static ValueField Probing(string name, Func<double> norm, Action<double> setNorm, Func<string> text,+ Action? begin = null, Action? end = null, Action? after = null, Action? reset = null)+ => new(name, norm, n => { setNorm(n); return text(); }, setNorm, begin, end)+ { Probes = true, After = after, Reset = reset };- // A step of the sampled read-out that brackets the target: bisect it.- for (int i = 0; i < Samples; i++)+ // A left press: ⌥ resets (every field of the handle), a double-click opens the box.+ private static bool Pressed(PointerPressedEventArgs e, Visual at, ValueField field, IReadOnlyList<ValueField>? all = null)+ {+ if (!e.GetCurrentPoint(at).Properties.IsLeftButtonPressed) return false;+ if ((e.KeyModifiers & KeyModifiers.Alt) != 0){- 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;+ if (field.Clear is null && !(all ?? [field]).Any(f => f.CanReset)) return false; // ⌥ keeps the control's own meaning+ e.Handled = true;+ if (field.Clear is not null) Clear(field);+ else foreach (var f in all ?? [field]) Reset(f);+ return false;}+ if (e.ClickCount != 2) return false;+ e.Handled = true;+ return true;+ }- // 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);+ // ---- reset / clear / commit ----------------------------------------------------------++ /// <summary>Back to the default as one gesture; nothing without a default or when already there.</summary>+ public static void Reset(ValueField f)+ {+ if (f.Reset is { } act) { f.Begin?.Invoke(); act(); f.End?.Invoke(); f.After?.Invoke(); return; }+ if (f.Default is not { } d) return;+ d = Math.Clamp(d, 0, 1);+ if (Math.Abs(f.Get() - d) < 1e-9) return;+ f.Begin?.Invoke(); f.Set(d); f.End?.Invoke(); f.After?.Invoke();}- private static double Distance(double a, double b) => a == b ? 0 : Math.Abs(a - b);+ private static void Clear(ValueField f) { f.Clear?.Invoke(); f.After?.Invoke(); }- 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)));+ private static bool AtDefault(ValueField f) => f.Reset is null && f.Default is { } d && Math.Abs(f.Get() - Math.Clamp(d, 0, 1)) < 1e-9;- // 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)+ /// <summary>Apply typed text: the position whose read-out shows it, written as one gesture.+ /// Unreadable text or a value the read-out already shows changes nothing.</summary>+ internal static void Commit(ValueField f, string typed){- 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;+ if (string.IsNullOrWhiteSpace(typed)) return;+ double before = f.Get();+ string was = f.TextAt(before);+ double? to = ValueText.Solve(typed, was, f.TextAt);+ string? now = to is { } n ? f.TextAt(n) : null;+ if (f.Probes) f.Set(before); // the probes moved it: the gesture must open on the old value (undo, specs/016)+ if (to is null || now == was) { f.After?.Invoke(); return; }+ f.Begin?.Invoke();+ f.Set(to.Value);+ f.End?.Invoke();+ f.After?.Invoke();}- // 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)+ // ---- the parameter menu --------------------------------------------------------------++ /// <summary>Type value… and Reset to default (Clear for a route), for a control that builds+ /// its own right-click menu.</summary>+ public static IEnumerable<Control> MenuItems(Control control, ValueField field){- 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;+ Anchor a = Entries.TryGetValue(control, out var en) ? en.AnchorOf(field) : new Anchor(control, new Rect(control.Bounds.Size), null);+ return MenuItems(field, () => Open(control, field, a));}- // 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)+ /// <summary>The same items for an attached control's (first) value; none when it is not attached.</summary>+ public static IEnumerable<Control> MenuItems(Control control)+ => Entries.TryGetValue(control, out var en) && en.Fields() is { Count: > 0 } fs ? MenuItems(control, fs[0]) : [];++ private static IEnumerable<Control> MenuItems(ValueField field, Action open, IReadOnlyList<ValueField>? all = null){- string s = at(mid);- return (Edge(at, lo, mid, s, insideHigh: true) + Edge(at, mid, hi, s, insideHigh: false)) / 2;+ yield return MenuKit.Item("Type value…", GlyphKind.Edit, open);+ var fs = all ?? [field];+ if (field.Clear is not null) yield return MenuKit.Danger("Clear", GlyphKind.Trash, () => Clear(field));+ else yield return MenuKit.Item("Reset to default", GlyphKind.Cycle, () => { foreach (var f in fs) Reset(f); },+ enabled: fs.Any(f => f.CanReset && !AtDefault(f)));}- // 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)+ private static void ShowMenu(Control control, ValueField field, Action open, IReadOnlyList<ValueField>? all = null){- 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;+ var fly = new MenuFlyout();+ fly.Items.Add(MenuKit.Header(field.Name, null, "Parameter"));+ fly.Items.Add(new Separator());+ foreach (var c in MenuItems(field, open, all)) fly.Items.Add(c);+ fly.ShowAt(control, showAtPointer: true);}- private static string Clean(string s) => s.Replace('\u2009', ' ').Replace('\u202F', ' ').Replace('\u00A0', ' ').Trim();+ // ---- the box -------------------------------------------------------------------------- [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();+ private static Action<bool>? _close; // the open box (one at a time): close it, committing or not++ /// <summary>Open the box on <paramref name="field"/> of <paramref name="control"/> (the menu, Tab).</summary>+ public static void Open(Control control, ValueField field)+ {+ if (Entries.TryGetValue(control, out var en)) Open(control, field, en.AnchorOf(field));+ }- /// <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)+ private static void Open(Control owner, ValueField field, Anchor at){- 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)+ _close?.Invoke(true);+ if (AdornerLayer.GetAdornerLayer(at.Visual) is null) return;+ TopLevel? top = TopLevel.GetTopLevel(at.Visual);+ var font = at.Font;+ Rect r = at.Rect;+ double fontSize = font is { FontSize: > 0 } ? font.FontSize : 9;+ // The value line itself turns editable (TextBox.value): same font, size and alignment+ // as the read-out, a 1px accent line under it, the read-out's own ink hidden meanwhile.+ // Without a read-out (a fader, a bar) a value line is laid over the control instead.+ var align = font is null ? HorizontalAlignment.Center+ : font.TextAlignment == TextAlignment.Center || font.HorizontalAlignment == HorizontalAlignment.Center && double.IsNaN(font.Width)+ ? HorizontalAlignment.Center+ : font.TextAlignment is TextAlignment.Right or TextAlignment.End ? HorizontalAlignment.Right+ : HorizontalAlignment.Left;+ double w = Math.Max(r.Width, font is null ? 40 : 28) + 2, h = font is null ? fontSize + 6 : r.Height + 2;+ double x = align switch{- v = double.Parse(m.Groups["num"].Value, CultureInfo.InvariantCulture);- if (m.Groups["den"].Success)+ HorizontalAlignment.Right => r.Right + 1 - w,+ HorizontalAlignment.Left => r.X - 1,+ _ => r.X + (r.Width - w) / 2,+ };+ double y = font is null ? r.Y + (r.Height - h) / 2 : r.Y;+ // Keep the box inside the window.+ if (top is not null && at.Visual.TranslatePoint(new Point(x, y), top) is { } p)+ {+ var size = top.ClientSize;+ if (p.X < 2) x += 2 - p.X; else if (p.X + w > size.Width - 2) x -= p.X + w - (size.Width - 2);+ if (p.Y < 2) y += 2 - p.Y; else if (p.Y + h > size.Height - 2) y -= p.Y + h - (size.Height - 2);+ }+ string was = font?.Text is { Length: > 0 } t ? t : field.TextAt(field.Get());+ var box = new TextBox+ {+ Classes = { "value" },+ Text = was, FontFamily = font?.FontFamily ?? NotaFonts.MonoFamily, FontSize = fontSize,+ FontWeight = font?.FontWeight ?? FontWeight.Normal,+ Height = h, Width = w,+ HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top,+ HorizontalContentAlignment = align,+ Margin = new Thickness(x, y, 0, 0),+ };+ if (font is null) box.Classes.Add("solid");+ IBrush? ink = font?.Foreground;+ if (font is not null) font.Foreground = Brushes.Transparent; // the box draws the value now+ bool done = false;+ EventHandler<PointerPressedEventArgs>? outside = null;+ EventHandler<VisualTreeAttachmentEventArgs>? gone = null;+ void Close(bool apply)+ {+ if (done) return;+ done = true;+ if (_close == Close) _close = null;+ if (outside is not null) top?.RemoveHandler(InputElement.PointerPressedEvent, outside);+ at.Visual.DetachedFromVisualTree -= gone;+ AdornerLayer.SetAdorner(at.Visual, null);+ if (font is not null && ReferenceEquals(font.Foreground, Brushes.Transparent)) font.Foreground = ink;+ if (apply) Commit(field, box.Text ?? "");+ }+ _close = Close;+ box.AddHandler(InputElement.KeyDownEvent, (_, 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; }+ else if (e.Key == Key.Tab){- double d = double.Parse(m.Groups["den"].Value, CultureInfo.InvariantCulture);- if (d == 0) return null;- v /= d;+ e.Handled = true;+ Close(true);+ Step(owner, field, (e.KeyModifiers & KeyModifiers.Shift) != 0 ? -1 : 1);}+ }, RoutingStrategies.Tunnel);+ box.LostFocus += (_, _) => Close(true);+ gone = (_, _) => Close(false);+ at.Visual.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(at.Visual, box);+ Dispatcher.UIThread.Post(() =>+ {+ if (done) return;+ box.Focus();+ // Select the number and leave its unit: typing "12" into "10.0 ms" reads 12 ms.+ if (Number().Match(was) is { Success: true } m) { box.SelectionStart = m.Index; box.SelectionEnd = m.Index + m.Length; }+ else box.SelectAll();+ });+ }++ // ---- Tab -----------------------------------------------------------------------------++ // Every typeable value under the nearest Scope, in reading order: rows by top edge (within+ // half the smaller height), then left edge; a host's fields in its own order. Wraps.+ private static void Step(Control owner, ValueField from, int dir)+ {+ if (owner.GetVisualAncestors().OfType<Control>().FirstOrDefault(GetScope) is not { } scope) return;+ var items = new List<(Control owner, ValueField field, Rect at, int sub)>();+ foreach (var c in scope.GetVisualDescendants().OfType<Control>())+ {+ if (!Entries.TryGetValue(c, out var en) || !c.IsEffectivelyVisible || !c.IsEffectivelyEnabled) continue;+ if (c.TranslatePoint(default, scope) is not { } p) continue;+ var at = new Rect(p, c.Bounds.Size);+ var fs = en.Fields();+ for (int i = 0; i < fs.Count; i++) items.Add((c, fs[i], at, i));}- 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)+ if (items.Count == 0) return;+ var rows = new List<List<(Control owner, ValueField field, Rect at, int sub)>>();+ foreach (var it in items.OrderBy(i => i.at.Top)){- hasUnit = true;- mul = u == "k" || (u.StartsWith('k') && u.Length > 1) ? 1e3- : u == "ms" ? 1e-3- : u is "µs" or "us" ? 1e-6- : 1;+ var row = rows.LastOrDefault();+ if (row is not null && it.at.Top - row[0].at.Top <= Math.Min(row[0].at.Height, it.at.Height) / 2) row.Add(it);+ else rows.Add([it]);}- return v * mul;+ var order = rows.SelectMany(r => r.OrderBy(i => i.at.Left).ThenBy(i => i.sub)).ToList();+ int k = order.FindIndex(i => i.owner == owner && ReferenceEquals(i.field, from));+ if (k < 0) k = order.FindIndex(i => i.owner == owner);+ var next = order[((k < 0 ? 0 : k) + dir + order.Count) % order.Count];+ next.owner.BringIntoView();+ Dispatcher.UIThread.Post(() => Open(next.owner, next.field), DispatcherPriority.Background);}}diff --git a/src/managed/Nota.App/Controls/ValueText.cs b/src/managed/Nota.App/Controls/ValueText.csnew file mode 100644index 00000000..0cc44590--- /dev/null+++ b/src/managed/Nota.App/Controls/ValueText.cs@@ -0,0 +1,190 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// Reading a typed value against a control's read-out (specs/035-typed-value-entry). Kept+// apart from the text box (ValueEntry) and free of Avalonia so the smoke test can link+// it and check the parser and the search directly.+//+// A control works in normalised 0..1 and 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 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.++using System;+using System.Collections.Generic;+using System.Globalization;+using System.Text.RegularExpressions;++namespace Nota.App;++internal static partial class ValueText+{+ 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, 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, txt, i);+ if (Same(b, target)) return Plateau(at, n, 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);+ 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 range.+ 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, 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 range takes the end (100 %, −∞, off are the extremes).+ private static double Plateau(Func<double, string> at, double[] n, 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 = Edge(at, n[a - 1], n[a], s, insideHigh: true);+ double hi = 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)+ {+ 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.+ /// Units: k-prefixed (kHz, k) ×1000, ms ×0.001, µs / us ×0.000001; s, Hz, dB, %, st, ct, ° as written.</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/Controls/VocoderGraph.cs b/src/managed/Nota.App/Controls/VocoderGraph.csindex eb735239..43b7132d 100644--- a/src/managed/Nota.App/Controls/VocoderGraph.cs+++ b/src/managed/Nota.App/Controls/VocoderGraph.cs@@ -81,7 +81,7 @@ internal sealed class VocoderGraph : Controlif (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;int edge = EdgeAt(e.GetPosition(this));if (edge < 0) return;- if (e.ClickCount == 2) { ResetRequested?.Invoke(edge); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { ResetRequested?.Invoke(edge); e.Handled = true; return; }_drag = edge; GestureBegin?.Invoke(edge); e.Pointer.Capture(this); e.Handled = true; InvalidateVisual();}protected override void OnPointerReleased(PointerReleasedEventArgs e)diff --git a/src/managed/Nota.App/DeviceCardKit.cs b/src/managed/Nota.App/DeviceCardKit.csindex 8adb1bec..b00955b4 100644--- a/src/managed/Nota.App/DeviceCardKit.cs+++ b/src/managed/Nota.App/DeviceCardKit.cs@@ -78,6 +78,9 @@ internal static class DeviceCardKit}knob.ValueSet += Paint;Paint();+ // Double-click the knob or its value to type one, ⌥-click to reset (specs/035). A knob+ // without a Format is typed by reading its value line back after each probe.+ ValueEntry.Attach(knob, name, value);return new StackPanel { Width = cellW, Spacing = 0, Children = { knob, lbl, value } };}@@ -192,10 +195,13 @@ 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. Double-clicking the value types one in.+ // `norm` and skips while the hand is on the slider. Double-clicking the slider or its+ // value types one in, ⌥-click runs `reset`. `textAt` (the read-out at a position, pure)+ // lets typing search without writing the parameter; without it the row probes `setNorm`.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)+ double labelWidth = 0, double trackWidth = double.NaN, double valueWidth = 42, bool modulation = false,+ Func<double, string>? textAt = null){Action repaint = () => { };var track = new SliderTrack { Bipolar = bipolar, Modulation = modulation, Reset = reset is null ? null : () => { reset(); repaint(); } };@@ -228,7 +234,12 @@ internal static class DeviceCardKit}repaint = Paint;track.Changed += v => { setNorm(v); val.Text = text(); };- ValueEntry.Attach(val, norm, setNorm, text, begin, end, Paint);+ string name = label.Length > 0 ? label : "Value";+ Action? rowReset = reset is null ? null : () => { reset(); Paint(); };+ var field = textAt is null+ ? ValueEntry.Probing(name, norm, setNorm, text, begin, end, Paint, rowReset)+ : new ValueField(name, norm, textAt, setNorm, begin, end) { After = Paint, Reset = rowReset };+ ValueEntry.Attach(track, field, val);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/AutoFilterDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/AutoFilterDeviceBody.csindex 7e04da9a..a790380b 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/AutoFilterDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/AutoFilterDeviceBody.cs@@ -139,6 +139,7 @@ internal sealed class AutoFilterDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 7, TextPrimary);var knob = new Knob(P(p), 1.0) { Accent = true, ArcColor = arc, Default = engine.DeviceParamDefault(track, di, p), Width = 34, Height = 34 };+ knob.Format = v => fmt(v); // read-out at any value: typing searches itknob.ValueChanged += v => { Raw(p, (float)v); val.Text = fmt(v); };knob.GestureBegin += () => Begin(p);knob.GestureEnd += () => End(p);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/AutoGainDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/AutoGainDeviceBody.csindex 6ea9e2a5..a2eac4ec 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/AutoGainDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/AutoGainDeviceBody.cs@@ -110,7 +110,7 @@ internal sealed class AutoGainDeviceBody : IDeviceBodyval.HorizontalAlignment = HorizontalAlignment.Right;Control valCtl = val;if (valueClick is null)- ValueEntry.Attach(val, () => P(p), v => Raw(p, v), () => fmt(P(p)), () => Begin(p), () => End(p), RefreshAll);+ ValueEntry.Attach(val, () => P(p), v => Raw(p, v), () => fmt(P(p)), () => Begin(p), () => End(p), RefreshAll, control: trk);else{var box = new Border { Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Child = val };@@ -349,7 +349,7 @@ internal sealed class AutoGainDeviceBody : IDeviceBodyceilBox.PointerPressed += (_, e) =>{if (!e.GetCurrentPoint(ceilBox).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { Reset(Ceiling); RefreshAll(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { Reset(Ceiling); RefreshAll(); e.Handled = true; return; }cd = true; cy0 = e.GetPosition(ceilBox).Y; cv0 = P(Ceiling); Begin(Ceiling); e.Pointer.Capture(ceilBox); e.Handled = true;};ceilBox.PointerMoved += (_, e) =>diff --git a/src/managed/Nota.App/DeviceCards/Bodies/AutoShiftDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/AutoShiftDeviceBody.csindex 77eaef1c..ec2d8e87 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/AutoShiftDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/AutoShiftDeviceBody.cs@@ -217,6 +217,7 @@ internal sealed class AutoShiftDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 7, TextPrimary);var knob = new Knob(P(p), 1.0) { Accent = true, ArcColor = arc, Default = Def(p), Width = 34, Height = 34 };+ knob.Format = v => fmt(v); // read-out at any value: typing searches itknob.ValueChanged += v => { Raw(p, v); val.Text = fmt(P(p)); RefreshAll(); };knob.GestureBegin += () => Begin(p);knob.GestureEnd += () => End(p);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/BeatRepeatDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/BeatRepeatDeviceBody.csindex 050a7cf3..673154d0 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/BeatRepeatDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/BeatRepeatDeviceBody.cs@@ -123,6 +123,7 @@ internal sealed class BeatRepeatDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 7, TextPrimary);var knob = new Knob(P(p), 1.0) { Accent = true, ArcColor = arc, Default = Def(p), Width = 34, Height = 34 };+ knob.Format = v => fmt(steps > 1 ? Math.Round(v * (steps - 1)) / (steps - 1) : v); // read-out at any value: typing searches itknob.ValueChanged += v =>{if (steps > 1) v = Math.Round(v * (steps - 1)) / (steps - 1);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/CeilingDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/CeilingDeviceBody.csindex 1ace6b32..34adad95 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/CeilingDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/CeilingDeviceBody.cs@@ -138,6 +138,7 @@ internal sealed class CeilingDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 7, TextPrimary);var knob = new Knob(N(p), 1.0) { Accent = true, Default = DefN(p), Width = 34, Height = 34 };+ knob.Format = v => fmt(FromN(p, v)); // read-out at any value: typing searches itknob.ValueChanged += v => { SetN(p, v); val.Text = fmt(P(p)); RefreshAll(); };knob.GestureBegin += () => Begin(p);knob.GestureEnd += () => End(p);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/ChamberDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/ChamberDeviceBody.csindex 52cc2060..414afd8a 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/ChamberDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/ChamberDeviceBody.cs@@ -142,6 +142,7 @@ internal sealed class ChamberDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 7, TxtC);var knob = new Knob(P(p), 1.0) { Accent = true, ArcColor = arc, Default = engine.DeviceParamDefault(track, di, p), Width = size, Height = size };+ knob.Format = v => fmt(v); // read-out at any value: typing searches itknob.ValueChanged += v => { Raw(p, (float)v); val.Text = fmt(v); onChange?.Invoke(); };knob.GestureBegin += () => Begin(p);knob.GestureEnd += () => End(p);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/CompressorDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/CompressorDeviceBody.csindex 1b781fe3..48880552 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/CompressorDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/CompressorDeviceBody.cs@@ -111,6 +111,7 @@ internal sealed class CompressorDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 7, TextPrimary);var knob = new Knob(map.N(P(p)), 1.0) { Accent = true, ArcColor = arc, Default = map.N(Def(p)), Width = 34, Height = 34 };+ knob.Format = v => fmt(map.V(v)); // read-out at any value: typing searches itknob.ValueChanged += v => { Raw(p, map.V(v)); val.Text = fmt(P(p)); };knob.GestureBegin += () => Begin(p);knob.GestureEnd += () => End(p);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/CrushDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/CrushDeviceBody.csindex 19132627..0e2aae07 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/CrushDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/CrushDeviceBody.cs@@ -107,6 +107,7 @@ internal sealed class CrushDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 7, TextPrimary);var knob = new Knob(P(p), 1.0) { Accent = true, Default = Def(p), Width = 34, Height = 34 };+ knob.Format = v => fmt(v); // read-out at any value: typing searches itif (teal) knob.ArcColor = Teal;knob.ValueChanged += v => { Raw(p, v); val.Text = fmt(P(p)); RefreshAll(); };knob.GestureBegin += () => Begin(p);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/DelayDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/DelayDeviceBody.csindex 7d8b446f..ebe788ed 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/DelayDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/DelayDeviceBody.cs@@ -111,6 +111,7 @@ internal sealed class DelayDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 7, TextPrimary);var knob = new Knob(P(p), 1.0) { Accent = true, ArcColor = arc, Default = engine.DeviceParamDefault(track, di, p), Width = size, Height = size };+ knob.Format = v => fmt(v); // read-out at any value: typing searches itknob.ValueChanged += v => { Raw(p, (float)v); val.Text = fmt(v); onChange?.Invoke(); };knob.GestureBegin += () => Begin(p);knob.GestureEnd += () => End(p);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/DynamicEqDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/DynamicEqDeviceBody.csindex b4b0d222..53aab6d7 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/DynamicEqDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/DynamicEqDeviceBody.cs@@ -278,7 +278,7 @@ internal sealed class DynamicEqDeviceBody : IDeviceBodyvar 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(); });+ ValueEntry.Attach(val, getN, setN, fmt, () => Begin(p), () => End(p), () => { RefreshAll(); curve.InvalidateVisual(); }, control: trk);var lbl = Caps(label);bandReadouts.Add(() =>{@@ -450,7 +450,7 @@ internal sealed class DynamicEqDeviceBody : IDeviceBodyoutBox.PointerPressed += (_, e) =>{if (!e.GetCurrentPoint(outBox).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { SetP(DynEq.OutputP, 0); RefreshAll(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { SetP(DynEq.OutputP, 0); RefreshAll(); e.Handled = true; return; }outDrag = true; outY = e.GetPosition(outBox).Y; e.Pointer.Capture(outBox); Begin(DynEq.OutputP); e.Handled = true;};outBox.PointerMoved += (_, e) =>diff --git a/src/managed/Nota.App/DeviceCards/Bodies/Eq3DeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/Eq3DeviceBody.csindex db3928f0..1604805c 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/Eq3DeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/Eq3DeviceBody.cs@@ -197,7 +197,7 @@ internal sealed class Eq3DeviceBody : IDeviceBody{if (!e.GetCurrentPoint(box).Properties.IsLeftButtonPressed) return;e.Handled = true;- if (e.ClickCount == 2) { SetP(Gain, 0.5); RefreshAll(); return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { SetP(Gain, 0.5); RefreshAll(); return; }drag = true; y0 = e.GetPosition(box).Y; v0 = P(Gain);e.Pointer.Capture(box); Begin(Gain);};diff --git a/src/managed/Nota.App/DeviceCards/Bodies/EqDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/EqDeviceBody.csindex 0aa73a8b..889541bd 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/EqDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/EqDeviceBody.cs@@ -273,7 +273,7 @@ internal sealed class EqDeviceBody : IDeviceBodyToolTip.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);+ () => Begin(p), () => End(p), RefreshAll, control: trk);bandReadouts.Add(() =>{if (!trk.Dragging) trk.Norm = (P(p) - mn[p]) / (mx[p] - mn[p]);@@ -348,7 +348,7 @@ internal sealed class EqDeviceBody : IDeviceBodyoutBox.PointerPressed += (_, e) =>{if (!e.GetCurrentPoint(outBox).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { SetP(Eq8.OutputP, 0); RefreshAll(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { SetP(Eq8.OutputP, 0); RefreshAll(); e.Handled = true; return; }outDrag = true; outY = e.GetPosition(outBox).Y; e.Pointer.Capture(outBox); Begin(Eq8.OutputP); e.Handled = true;};outBox.PointerMoved += (_, e) =>diff --git a/src/managed/Nota.App/DeviceCards/Bodies/ForgeDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/ForgeDeviceBody.csindex 83939dc6..88264378 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/ForgeDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/ForgeDeviceBody.cs@@ -128,7 +128,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);+ ValueEntry.Attach(val, () => P(param()), v => Raw(param(), v), () => fmt(P(param())), () => Begin(param()), () => End(param()), Refresh, control: track);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));@@ -200,7 +200,7 @@ internal sealed class ForgeDeviceBody : IDeviceBody{if (!e.GetCurrentPoint(outBox).Properties.IsLeftButtonPressed) return;sel = s;- if (e.ClickCount == 2) { Reset(OutP(s)); Refresh(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { Reset(OutP(s)); Refresh(); e.Handled = true; return; }od = true; oy = e.GetPosition(outBox).Y; ov = P(OutP(s)); Begin(OutP(s)); e.Pointer.Capture(outBox); e.Handled = true; Refresh();};outBox.PointerMoved += (_, e) =>@@ -288,6 +288,7 @@ internal sealed class ForgeDeviceBody : IDeviceBody{var val = Mono(fmt(P(param())), 7, TextPrimary);var knob = new Knob(P(param()), 1.0) { Accent = true, Default = Def(param()), Width = 30, Height = 30 };+ knob.Format = v => fmt(v); // read-out at any value: typing searches itknob.ValueChanged += v => { Raw(param(), v); val.Text = fmt(P(param())); Refresh(); };knob.GestureBegin += () => Begin(param());knob.GestureEnd += () => End(param());diff --git a/src/managed/Nota.App/DeviceCards/Bodies/LensDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/LensDeviceBody.csindex 858b827e..d8324540 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/LensDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/LensDeviceBody.cs@@ -120,6 +120,7 @@ internal sealed class LensDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 7, TxtC);var knob = new Knob(P(p), 1.0) { Accent = true, ArcColor = arc, Default = Def(p), Width = size, Height = size };+ knob.Format = v => fmt(v); // read-out at any value: typing searches itknob.ValueChanged += v => { Raw(p, (float)v); val.Text = fmt(v); };knob.GestureBegin += () => Begin(p);knob.GestureEnd += () => End(p);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/PrismDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/PrismDeviceBody.csindex 9657984d..1e9a83d0 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/PrismDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/PrismDeviceBody.cs@@ -131,6 +131,7 @@ internal sealed class PrismDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 7, TxtC);var knob = new Knob(P(p), 1.0) { Accent = true, ArcColor = arc, Default = Def(p), Width = size, Height = size };+ knob.Format = v => fmt(v); // read-out at any value: typing searches itknob.ValueChanged += v => { Raw(p, (float)v); val.Text = fmt(v); };knob.GestureBegin += () => Begin(p);knob.GestureEnd += () => End(p);@@ -184,7 +185,7 @@ internal sealed class PrismDeviceBody : IDeviceBodyhost.PointerPressed += (_, e) =>{if (!e.GetCurrentPoint(host).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { SetP(p, Def(p)); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { SetP(p, Def(p)); e.Handled = true; return; }drag = true; y0 = e.GetPosition(host).Y; v0 = P(p); Begin(p); e.Pointer.Capture(host); e.Handled = true;};host.PointerMoved += (_, e) => { if (drag) { Raw(p, (float)(v0 + (y0 - e.GetPosition(host).Y) / 140.0)); tb.Text = fmt(P(p)); } };diff --git a/src/managed/Nota.App/DeviceCards/Bodies/ReverbDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/ReverbDeviceBody.csindex 41c0c5f3..31f6d4ab 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/ReverbDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/ReverbDeviceBody.cs@@ -99,6 +99,7 @@ internal sealed class ReverbDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 7, TextPrimary);var knob = new Knob(P(p), 1.0) { Accent = true, ArcColor = arc, Default = engine.DeviceParamDefault(track, di, p), Width = size, Height = size };+ knob.Format = v => fmt(v); // read-out at any value: typing searches itknob.ValueChanged += v => { Raw(p, (float)v); val.Text = fmt(v); SyncTail(); };knob.GestureBegin += () => Begin(p);knob.GestureEnd += () => End(p);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/ShutterDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/ShutterDeviceBody.csindex 85d6d850..0f970af0 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/ShutterDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/ShutterDeviceBody.cs@@ -153,6 +153,7 @@ internal sealed class ShutterDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 7, TextPrimary);var knob = new Knob(P(p), 1.0) { Accent = true, ArcColor = arc, Default = Def(p), Width = size, Height = size };+ knob.Format = v => fmt(steps > 1 ? Math.Round(v * (steps - 1)) / (steps - 1) : v); // read-out at any value: typing searches itknob.ValueChanged += v =>{if (steps > 1) v = Math.Round(v * (steps - 1)) / (steps - 1);@@ -541,7 +542,7 @@ internal sealed class ShutterDeviceBody : IDeviceBodyhost.PointerPressed += (_, e) =>{if (!e.GetCurrentPoint(host).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { Reset(p); Paint(); RefreshAll(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { Reset(p); Paint(); RefreshAll(); e.Handled = true; return; }drag = true; Begin(p); e.Pointer.Capture(host); SetX(e.GetPosition(grid).X); e.Handled = true;};host.PointerMoved += (_, e) => { if (drag) SetX(e.GetPosition(grid).X); };diff --git a/src/managed/Nota.App/DeviceCards/Bodies/StrataDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/StrataDeviceBody.csindex 708e2a65..88c595b2 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/StrataDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/StrataDeviceBody.cs@@ -144,7 +144,7 @@ internal sealed class StrataDeviceBody : IDeviceBodyMidiLearn.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);+ () => engine.EndAutomationWrite(track, AutomationTarget.DeviceParam, di, p, ""), Vis, control: slider);readouts.Add(() => { if (!slider.Dragging) Vis(); });Vis();var lbl = new TextBlock { Text = NotaText.Label(name), FontSize = NotaType.RowLabel, FontWeight = FontWeight.Medium, Foreground = TextTertiary, Width = 52, VerticalAlignment = VerticalAlignment.Center };diff --git a/src/managed/Nota.App/DeviceCards/Bodies/UtilityDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/UtilityDeviceBody.csindex b9c25d01..13413b77 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/UtilityDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/UtilityDeviceBody.cs@@ -142,6 +142,7 @@ internal sealed class UtilityDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 7, TextPrimary);var knob = new Knob(N(p), 1.0) { Accent = true, ArcColor = arc, Default = DefN(p), Width = 34, Height = 34 };+ knob.Format = v => fmt(FromN(p, v)); // read-out at any value: typing searches itknob.ValueChanged += v => { SetN(p, v); val.Text = fmt(P(p)); };knob.GestureBegin += () => Begin(p);knob.GestureEnd += () => End(p);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/ValveDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/ValveDeviceBody.csindex a81b362c..34185058 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/ValveDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/ValveDeviceBody.cs@@ -124,6 +124,7 @@ internal sealed class ValveDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 7, TextPrimary);var knob = new Knob(N(p), 1.0) { Accent = true, ArcColor = arc, Default = DefN(p), Width = 34, Height = 34 };+ knob.Format = v => fmt(v * mx[p]); // read-out at any value: typing searches itknob.ValueChanged += v => { RawN(p, v); val.Text = fmt(P(p)); };knob.GestureBegin += () => Begin(p);knob.GestureEnd += () => End(p);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/VintageDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/VintageDeviceBody.csindex f66c40a6..ea4acac2 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/VintageDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/VintageDeviceBody.cs@@ -114,6 +114,7 @@ internal sealed class VintageDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 7, TextPrimary);var knob = new Knob(P(p), 1.0) { Accent = true, ArcColor = arc, Default = engine.DeviceParamDefault(track, di, p), Width = 34, Height = 34 };+ knob.Format = v => fmt(v); // read-out at any value: typing searches itknob.ValueChanged += v => { Raw(p, (float)v); val.Text = fmt(v); };knob.GestureBegin += () => Begin(p);knob.GestureEnd += () => End(p);diff --git a/src/managed/Nota.App/DeviceCards/Bodies/VocoderDeviceBody.cs b/src/managed/Nota.App/DeviceCards/Bodies/VocoderDeviceBody.csindex 17278cc8..9c71b3ea 100644--- a/src/managed/Nota.App/DeviceCards/Bodies/VocoderDeviceBody.cs+++ b/src/managed/Nota.App/DeviceCards/Bodies/VocoderDeviceBody.cs@@ -117,6 +117,7 @@ internal sealed class VocoderDeviceBody : IDeviceBody{var val = Mono(fmt(P(p)), 8, TextPrimary);var knob = new Knob(P(p), 1.0) { Accent = true, Default = engine.DeviceParamDefault(track, di, p), Width = 34, Height = 34 };+ knob.Format = v => fmt(steps > 1 ? Math.Round(v * (steps - 1)) / (steps - 1) : v); // read-out at any value: typing searches itknob.ValueChanged += v =>{if (steps > 1) v = Math.Round(v * (steps - 1)) / (steps - 1);diff --git a/src/managed/Nota.App/DeviceCards/DeviceParamControls.cs b/src/managed/Nota.App/DeviceCards/DeviceParamControls.csindex 2f9c2757..5a2ee026 100644--- a/src/managed/Nota.App/DeviceCards/DeviceParamControls.cs+++ b/src/managed/Nota.App/DeviceCards/DeviceParamControls.cs@@ -44,6 +44,7 @@ internal static class DeviceParamControlsvar value = new TextBlock { Text = Fmt(val), FontSize = 8, Foreground = TextPrimary };value.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");var knob = new Knob((val - min) / span, 1.0) { Accent = true, Default = (engine.DeviceParamDefault(track, device, param) - min) / span };+ knob.Format = frac => Fmt((float)(min + frac * span));int d = device, pp = param;knob.ValueChanged += frac =>{@@ -128,6 +129,7 @@ internal static class DeviceParamControlsvar value = new TextBlock { Text = fmt(norm), FontSize = 8, Foreground = TextPrimary };value.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");var knob = new Knob(Math.Clamp(norm, 0, 1), 1.0) { Accent = true };+ knob.Format = fmt;knob.ValueChanged += frac => { apply(frac); value.Text = fmt(frac); };return KnobCell(name, knob, value);}diff --git a/src/managed/Nota.App/DeviceCards/InstrumentControls.cs b/src/managed/Nota.App/DeviceCards/InstrumentControls.csindex 0501b17c..d849ab0d 100644--- a/src/managed/Nota.App/DeviceCards/InstrumentControls.cs+++ b/src/managed/Nota.App/DeviceCards/InstrumentControls.cs@@ -32,6 +32,7 @@ internal static class InstrumentControlsvar value = new TextBlock { Text = f(engine.PluginParamGet(track, -1, i)), FontSize = 8, Foreground = TextPrimary };value.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");var knob = new Knob(engine.PluginParamGet(track, -1, i), 1.0) { Accent = true, ArcColor = arc, Default = engine.InstrumentParamDefault(track, i), Inline = inline, Width = knobSize, Height = knobSize };+ knob.Format = v => f((float)v);int pi = i; string pid = id;knob.ValueChanged += v => { engine.PluginParamSet(track, -1, pi, (float)v); value.Text = f((float)v); sync(); };knob.GestureBegin += () => engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, pid);diff --git a/src/managed/Nota.App/DeviceCards/Instruments/AuroraInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/AuroraInstrumentCard.csindex 828d7a96..e2876581 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/AuroraInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/AuroraInstrumentCard.cs@@ -210,6 +210,7 @@ internal sealed class AuroraInstrumentCard : IInstrumentCardAccent = true, ArcColor = arc, Default = engine.InstrumentParamDefault(track, pi),Width = size, Height = size, HorizontalAlignment = HorizontalAlignment.Center,};+ knob.Format = v => fmt((float)v);knob.ValueChanged += v => { engine.PluginParamSet(track, -1, pi, (float)v); value.Text = fmt((float)v); Touch(); };knob.GestureBegin += () => Begin(id);knob.GestureEnd += () => End(id);@@ -237,6 +238,8 @@ internal sealed class AuroraInstrumentCard : IInstrumentCardctx.AddInstFader(pi, knob, shadow, fmt);readouts.Add(() => ToolTip.SetTip(knob, learn + " · " + fmt(G(id))));MidiLearn.Bind(knob, MidiTarget.PluginParam(track, -1, pi), learn);+ knob.Format = v => fmt((float)v);+ ValueEntry.Attach(knob, learn); // no value line: the box sits on the knobreturn knob;}@@ -378,6 +381,7 @@ internal sealed class AuroraInstrumentCard : IInstrumentCardw.GestureEnd += () => End(id);if (I(id) is var pi and >= 0) MidiLearn.Bind(w, MidiTarget.PluginParam(track, -1, pi), id);readouts.Add(() => { if (!w.Dragging) w.Norm = G(id); });+ if (!spring) ValueEntry.Attach(w, w.EntryField(id == "modwheel" ? "Mod wheel" : id, NotaNum.Pct)); // the bend wheel springs backreturn w;}var bendWheel = Wheel("bend", 0.5, true);diff --git a/src/managed/Nota.App/DeviceCards/Instruments/BassInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/BassInstrumentCard.csindex 3767b3d1..f946d3c0 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/BassInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/BassInstrumentCard.cs@@ -163,6 +163,7 @@ internal sealed class BassInstrumentCard : IInstrumentCardAccent = true, ArcColor = arc, Default = engine.InstrumentParamDefault(track, pi),Width = size, Height = size, HorizontalAlignment = HorizontalAlignment.Center,};+ knob.Format = v => fmt((float)v);knob.ValueChanged += v => { engine.PluginParamSet(track, -1, pi, (float)v); value.Text = fmt((float)v); Refresh(); };knob.GestureBegin += () => Begin(id);knob.GestureEnd += () => End(id);@@ -298,6 +299,7 @@ internal sealed class BassInstrumentCard : IInstrumentCardw.GestureEnd += () => End(id);if (I(id) is var pi and >= 0) MidiLearn.Bind(w, MidiTarget.PluginParam(track, -1, pi), id);readouts.Add(() => { if (!w.Dragging) w.Norm = G(id); });+ if (!spring) ValueEntry.Attach(w, w.EntryField(id == "modwheel" ? "Mod wheel" : id, NotaNum.Pct)); // the bend wheel springs backreturn w;}diff --git a/src/managed/Nota.App/DeviceCards/Instruments/ConsortInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/ConsortInstrumentCard.csindex 6838a77e..69f15779 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/ConsortInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/ConsortInstrumentCard.cs@@ -135,11 +135,13 @@ internal sealed class ConsortInstrumentCard : IInstrumentCardif (I(id) is not (var i and >= 0)) return new Panel();var value = MonoText(fmt(G(id)), 8, valColor); value.Width = valW;var knob = new Knob(G(id), 1.0) { Accent = true, Inline = true, Default = engine.InstrumentParamDefault(track, i) };+ knob.Format = v => fmt((float)v);knob.ValueChanged += v => { engine.PluginParamSet(track, -1, i, (float)v); value.Text = fmt((float)v); Refresh(); };knob.GestureBegin += () => Begin(id);knob.GestureEnd += () => End(id);ctx.AddInstFader(i, knob, value, fmt);MidiLearn.Bind(knob, MidiTarget.PluginParam(track, -1, i), id);+ ValueEntry.Attach(knob, engine.PluginParamName(track, -1, i), value);return Row(4, knob, value);}@@ -1004,7 +1006,7 @@ internal sealed class ConsortInstrumentCard : IInstrumentCarddepBox.PointerPressed += (_, e) =>{if (!e.GetCurrentPoint(depBox).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { SetP(AmtId(slot), 0.75f); Refresh(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { 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}"; };diff --git a/src/managed/Nota.App/DeviceCards/Instruments/FluxInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/FluxInstrumentCard.csindex 7b3a74c4..6e5bf4a9 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/FluxInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/FluxInstrumentCard.cs@@ -126,6 +126,7 @@ internal sealed class FluxInstrumentCard : IInstrumentCardAccent = true, ArcColor = arc, Width = size, Height = size,Default = I(id) is var d and >= 0 ? engine.InstrumentParamDefault(track, d) : double.NaN,};+ knob.Format = v => fmt((float)v);if (I(id) is var pi and >= 0){knob.ValueChanged += v => { engine.PluginParamSet(track, -1, pi, (float)v); value.Text = fmt((float)v); Refresh(); };diff --git a/src/managed/Nota.App/DeviceCards/Instruments/GrainInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/GrainInstrumentCard.csindex 92d216eb..5df082c0 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/GrainInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/GrainInstrumentCard.cs@@ -198,6 +198,7 @@ internal sealed class GrainInstrumentCard : IInstrumentCardAccent = true, ArcColor = arc, Default = engine.InstrumentParamDefault(track, pi),Width = size, Height = size, HorizontalAlignment = HorizontalAlignment.Center,};+ knob.Format = v => fmt((float)v);knob.ValueChanged += v => { engine.PluginParamSet(track, -1, pi, (float)v); value.Text = fmt((float)v); Refresh(); };knob.GestureBegin += () => Begin(id);knob.GestureEnd += () => End(id);diff --git a/src/managed/Nota.App/DeviceCards/Instruments/MonolithInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/MonolithInstrumentCard.csindex 63b8166b..dc5d866d 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/MonolithInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/MonolithInstrumentCard.cs@@ -82,11 +82,13 @@ internal sealed class MonolithInstrumentCard : IInstrumentCardvar value = new TextBlock { Text = fmt(G(id)), FontSize = 8, Foreground = TxtC, Width = valW, VerticalAlignment = VerticalAlignment.Center };value.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");var knob = new Knob(G(id), 1.0) { Accent = true, Inline = true, ArcColor = mod ? TealC : null, Default = engine.InstrumentParamDefault(track, i) };+ knob.Format = v => fmt((float)v);knob.ValueChanged += v => { engine.PluginParamSet(track, -1, i, (float)v); value.Text = fmt((float)v); Refresh(); };knob.GestureBegin += () => engine.BeginAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id);knob.GestureEnd += () => engine.EndAutomationWrite(track, AutomationTarget.PluginParam, -1, -1, id);ctx.AddInstFader(i, knob, value, fmt);MidiLearn.Bind(knob, MidiTarget.PluginParam(track, -1, i), id);+ ValueEntry.Attach(knob, engine.PluginParamName(track, -1, i), value);return Row(4, knob, value);}diff --git a/src/managed/Nota.App/DeviceCards/Instruments/MosaicInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/MosaicInstrumentCard.csindex 95e787b6..43254ee9 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/MosaicInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/MosaicInstrumentCard.cs@@ -190,6 +190,7 @@ internal sealed class MosaicInstrumentCard : IInstrumentCardif (pi < 0) return new Panel();var value = new TextBlock { Text = fmt(G(id)), Foreground = TextPrimary };var knob = new Knob(G(id), 1.0) { Accent = true, ArcColor = arc, Default = Def(id), Width = size, Height = size };+ knob.Format = v => fmt((float)v);knob.ValueChanged += v => { SetP(id, v); value.Text = fmt((float)v); Refresh(); };knob.GestureBegin += () => Begin(id);knob.GestureEnd += () => End(id);@@ -286,7 +287,7 @@ internal sealed class MosaicInstrumentCard : IInstrumentCardb.PointerPressed += (_, e) =>{if (!e.GetCurrentPoint(b).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2 && reset is not null) { reset(); done?.Invoke(); tb.Text = text(); Refresh(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0) && reset is not null) { reset(); done?.Invoke(); tb.Text = text(); Refresh(); e.Handled = true; return; }drag = true; y0 = e.GetPosition(b).Y; acc = 0; e.Pointer.Capture(b); e.Handled = true;};b.PointerMoved += (_, e) =>diff --git a/src/managed/Nota.App/DeviceCards/Instruments/OperatorInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/OperatorInstrumentCard.csindex 4baa84ef..e5b66460 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/OperatorInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/OperatorInstrumentCard.cs@@ -206,6 +206,7 @@ internal sealed class OperatorInstrumentCard : IInstrumentCardw.GestureEnd += () => End(id);if (I(id) is var pi and >= 0) MidiLearn.Bind(w, MidiTarget.PluginParam(track, -1, pi), id);readouts.Add(() => { if (!w.Dragging) w.Norm = G(id); });+ if (!spring) ValueEntry.Attach(w, w.EntryField(id == "modwheel" ? "Mod wheel" : id, NotaNum.Pct)); // the bend wheel springs backdragging = () => w.Dragging;return w;}diff --git a/src/managed/Nota.App/DeviceCards/Instruments/PendulumInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/PendulumInstrumentCard.csindex 0042f172..56825cbb 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/PendulumInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/PendulumInstrumentCard.cs@@ -185,6 +185,7 @@ internal sealed class PendulumInstrumentCard : IInstrumentCardAccent = true, ArcColor = arc, Default = engine.InstrumentParamDefault(track, pi),Width = size, Height = size,};+ knob.Format = v => fmt((float)v);knob.ValueChanged += v => { engine.PluginParamSet(track, -1, pi, (float)v); value.Text = fmt((float)v); Refresh(); };knob.GestureBegin += () => Begin(id);knob.GestureEnd += () => End(id);diff --git a/src/managed/Nota.App/DeviceCards/Instruments/PhysicalInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/PhysicalInstrumentCard.csindex 5ad6d43f..b461d1e8 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/PhysicalInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/PhysicalInstrumentCard.cs@@ -150,6 +150,7 @@ internal sealed class PhysicalInstrumentCard : IInstrumentCardAccent = true, ArcColor = arc, Default = engine.InstrumentParamDefault(track, pi),Width = size, Height = size, HorizontalAlignment = HorizontalAlignment.Center,};+ knob.Format = v => fmt((float)v);knob.ValueChanged += v => { engine.PluginParamSet(track, -1, pi, (float)v); value.Text = fmt((float)v); Refresh(); };knob.GestureBegin += () => Begin(id);knob.GestureEnd += () => End(id);diff --git a/src/managed/Nota.App/DeviceCards/Instruments/RhythmInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/RhythmInstrumentCard.csindex 32594ac4..d39b2ef3 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/RhythmInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/RhythmInstrumentCard.cs@@ -138,6 +138,7 @@ internal sealed class RhythmInstrumentCard : IInstrumentCard{Accent = true, Default = engine.InstrumentParamDefault(track, pi), Width = size, Height = size,};+ knob.Format = v => fmt((float)v);knob.ValueChanged += v => { engine.PluginParamSet(track, -1, pi, (float)v); value.Text = fmt((float)v); Refresh(); };knob.GestureBegin += () => Begin(id);knob.GestureEnd += () => End(id);diff --git a/src/managed/Nota.App/DeviceCards/Instruments/SamplerInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/SamplerInstrumentCard.csindex cae25b57..0cb57baa 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/SamplerInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/SamplerInstrumentCard.cs@@ -105,6 +105,7 @@ internal sealed class SamplerInstrumentCard : IInstrumentCardif (pi < 0) return new Panel();var value = new TextBlock { Text = fmt(G(id)), Foreground = TextPrimary };var knob = new Knob(G(id), 1.0) { Accent = true, ArcColor = arc, Default = acc.ParamDefault(pi), Width = size, Height = size };+ knob.Format = v => fmt((float)v);knob.ValueChanged += v => { acc.ParamSet(pi, (float)v); value.Text = fmt((float)v); Refresh(); };knob.GestureBegin += () => Begin(id);knob.GestureEnd += () => End(id);diff --git a/src/managed/Nota.App/DeviceCards/Instruments/VoltInstrumentCard.cs b/src/managed/Nota.App/DeviceCards/Instruments/VoltInstrumentCard.csindex 4bfaea22..1b297595 100644--- a/src/managed/Nota.App/DeviceCards/Instruments/VoltInstrumentCard.cs+++ b/src/managed/Nota.App/DeviceCards/Instruments/VoltInstrumentCard.cs@@ -187,6 +187,7 @@ internal sealed class VoltInstrumentCard : IInstrumentCardAccent = true, ArcColor = arc, Default = engine.InstrumentParamDefault(track, pi),Width = size, Height = size, HorizontalAlignment = HorizontalAlignment.Center,};+ knob.Format = v => fmt((float)v);knob.ValueChanged += v => { engine.PluginParamSet(track, -1, pi, (float)v); value.Text = fmt((float)v); Refresh(); };knob.GestureBegin += () => Begin(id);knob.GestureEnd += () => End(id);@@ -289,6 +290,7 @@ internal sealed class VoltInstrumentCard : IInstrumentCardw.GestureEnd += () => End(id);if (I(id) is var pi and >= 0) MidiLearn.Bind(w, MidiTarget.PluginParam(track, -1, pi), id);readouts.Add(() => { if (!w.Dragging) w.Norm = G(id); });+ if (!spring) ValueEntry.Attach(w, w.EntryField(id == "modwheel" ? "Mod wheel" : id, NotaNum.Pct)); // the bend wheel springs backreturn w;}diff --git a/src/managed/Nota.App/DeviceCards/Midi/ArpMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/ArpMidiBody.csindex bffe14c1..fa5a9891 100644--- a/src/managed/Nota.App/DeviceCards/Midi/ArpMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/ArpMidiBody.cs@@ -236,7 +236,7 @@ internal sealed class ArpMidiBody : IMidiDeviceBodyvar 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);+ () => Begin(GFreeRate), () => End(GFreeRate), Refresh, control: freeTrack);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 } };@@ -408,7 +408,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);+ ValueEntry.Attach(val, () => toNorm(G(p)), n => S(p, fromNorm(n)), () => fmt(G(p)), () => Begin(p), () => End(p), Refresh, control: track);readouts.Add(() =>{double v = G(p);@@ -440,7 +440,7 @@ internal sealed class ArpMidiBody : IMidiDeviceBody}var box = new Border { Height = 14, Background = Well, BorderBrush = Bd, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Badge,Child = new DockPanel { Children = { WithDock(Btn("−", -1), Dock.Left), WithDock(Btn("+", +1), Dock.Right), val } } };- box.PointerPressed += (_, ev) => { if (ev.ClickCount == 2) { S(p, Def(p)); Refresh(); } };+ box.PointerPressed += (_, ev) => { if ((ev.ClickCount == 2 || (ev.KeyModifiers & KeyModifiers.Alt) != 0)) { S(p, Def(p)); Refresh(); } };Learn(box, p, label);readouts.Add(() =>{@@ -492,6 +492,7 @@ internal sealed class ArpMidiBody : IMidiDeviceBodyknob.GestureBegin += () => Begin(LP()); knob.GestureEnd += () => End(LP());Learn(knob, p, label);var val = Mono("", Sub, 7); val.HorizontalAlignment = HorizontalAlignment.Center;+ ValueEntry.Attach(knob, label, val, text);readouts.Add(() => { double n = norm(); if (!knob.Dragging && Math.Abs(knob.Value - n) > 1e-6) knob.Value = n; val.Text = text(); });return new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, Cursor = new Cursor(StandardCursorType.SizeNorthSouth),Children = { knob, new TextBlock { Text = NotaText.Label(label), FontSize = NotaType.KnobLabel, FontWeight = FontWeight.Medium, Foreground = Cap, HorizontalAlignment = HorizontalAlignment.Center, LineHeight = 9 }, val } };diff --git a/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.csindex bcfba58a..811323e2 100644--- a/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.cs@@ -445,6 +445,7 @@ internal sealed class ChordMidiBody : IMidiDeviceBodyruler.GestureBegin += () => { Begin(pSt); Begin(pOn); }; ruler.GestureEnd += () => { End(pSt); End(pOn); };Learn(ruler, pSt, $"Shift {s + 1}");var iv = Mono("", Sub); iv.Width = 22; iv.TextAlignment = TextAlignment.Center;+ ValueEntry.Attach(ruler, ruler.EntryField($"Shift {s + 1}"));var vel = VelDrag(pVel, s);var g = new DockPanel { Children = { WithDock(dotHit, Dock.Left), WithDock(st, Dock.Left), WithDock(vel, Dock.Right), WithDock(iv, Dock.Right), ruler } };st.Margin = new Thickness(6, 0, 6, 0); iv.Margin = new Thickness(6, 0, 6, 0);@@ -474,7 +475,7 @@ internal sealed class ChordMidiBody : IMidiDeviceBody{if (!ev.GetCurrentPoint(hit).Properties.IsLeftButtonPressed) return;ev.Handled = true;- if (ev.ClickCount == 2) { Begin(p); S(p, 0); End(p); Edited(); return; }+ if ((ev.ClickCount == 2 || (ev.KeyModifiers & KeyModifiers.Alt) != 0)) { Begin(p); S(p, 0); End(p); Edited(); return; }drag = true; x0 = ev.GetPosition(hit).X; v0 = GI(p); ev.Pointer.Capture(hit); Begin(p);};hit.PointerMoved += (_, ev) =>@@ -500,7 +501,8 @@ internal sealed class ChordMidiBody : IMidiDeviceBodybar.Changed += v => SetShift(s, v);bar.GestureBegin += () => { Begin(pSt); Begin(pOn); }; bar.GestureEnd += () => { End(pSt); End(pOn); };Learn(bar, pSt, $"Shift {s + 1}");- ToolTip.SetTip(bar, $"Shift {s + 1}: drag up / down (±12 semitones)");+ ToolTip.SetTip(bar, $"Shift {s + 1}: drag up / down (±12 semitones) · double-click to type");+ ValueEntry.Attach(bar, bar.EntryField($"Shift {s + 1}"));var lbl = Mono("", Txt); lbl.HorizontalAlignment = HorizontalAlignment.Center;var lblHit = new Border { Height = 11, Margin = new Thickness(0, 2, 0, 0), Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Child = lbl };bool hover = false;@@ -533,7 +535,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);+ ValueEntry.Attach(val, () => toNorm(G(p)), n => S(p, fromNorm(n)), () => fmt(G(p)), () => Begin(p), () => End(p), Edited, control: track);readouts.Add(() =>{double v = G(p);@@ -556,6 +558,7 @@ internal sealed class ChordMidiBody : IMidiDeviceBodyknob.GestureEnd += () => { End(p); Edited(); };Learn(knob, p, label);var val = Mono("", Sub, 7); val.HorizontalAlignment = HorizontalAlignment.Center;+ ValueEntry.Attach(knob, label, val, text);readouts.Add(() => { double n = norm(); if (!knob.Dragging && Math.Abs(knob.Value - n) > 1e-6) knob.Value = n; val.Text = text(); });return new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.SizeNorthSouth),Children = { knob, new TextBlock { Text = NotaText.Label(label), FontSize = NotaType.KnobLabel, FontWeight = FontWeight.Medium, Foreground = Cap, HorizontalAlignment = HorizontalAlignment.Center, LineHeight = 9 }, val } };diff --git a/src/managed/Nota.App/DeviceCards/Midi/GenericMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/GenericMidiBody.csindex f5641682..3dd0bc22 100644--- a/src/managed/Nota.App/DeviceCards/Midi/GenericMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/GenericMidiBody.cs@@ -42,6 +42,8 @@ internal sealed class GenericMidiBody : IMidiDeviceBodybar.GestureBegin += () => engine.BeginAutomationWrite(track, AutomationTarget.MidiDeviceParam, index, pi, "");bar.GestureEnd += () => engine.EndAutomationWrite(track, AutomationTarget.MidiDeviceParam, index, pi, "");MidiLearn.Bind(bar, MidiTarget.MidiDeviceParam(track, index, pi), engine.MidiEffectParamName(track, index, pi));+ bar.Format = nv => FmtParam((float)(min + nv * (max - min)), integral);+ ValueEntry.Attach(bar, engine.MidiEffectParamName(track, index, pi), value);panel.Children.Add(new StackPanel { Spacing = 2, Children = { top, bar } });}return panel;diff --git a/src/managed/Nota.App/DeviceCards/Midi/LengthMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/LengthMidiBody.csindex b4b0acb1..b2df51ff 100644--- a/src/managed/Nota.App/DeviceCards/Midi/LengthMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/LengthMidiBody.cs@@ -180,7 +180,7 @@ internal sealed class LengthMidiBody : IMidiDeviceBodylenTrack.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);+ () => { lenGesture = LenParam(G); Begin(lenGesture); }, () => { End(lenGesture); lenGesture = -1; }, Refresh, control: lenTrack);readouts.Add(() =>{bigVal.Text = LenValue(G); bigSub.Text = LenSub(G, Bpm());@@ -372,7 +372,7 @@ internal sealed class LengthMidiBody : IMidiDeviceBodyLearn(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);+ () => Begin(p), () => End(p), Refresh, control: trk);readouts.Add(() =>{double x = G(p);@@ -417,6 +417,7 @@ internal sealed class LengthMidiBody : IMidiDeviceBodyknob.GestureEnd += () => { if (gesture >= 0) End(gesture); gesture = -1; };Learn(knob, param(), label);var v = Mono("", Sub, 7); v.HorizontalAlignment = HorizontalAlignment.Center;+ ValueEntry.Attach(knob, label, v, text);readouts.Add(() => { double n = norm(); if (!knob.Dragging && Math.Abs(knob.Value - n) > 1e-6) knob.Value = n; v.Text = text(); });return new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.SizeNorthSouth),Children = { knob, new TextBlock { Text = NotaText.Label(label), FontSize = NotaType.KnobLabel, FontWeight = FontWeight.Medium, Foreground = Cap, HorizontalAlignment = HorizontalAlignment.Center, LineHeight = 9 }, v } };diff --git a/src/managed/Nota.App/DeviceCards/Midi/RandomMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/RandomMidiBody.csindex 1f0faab9..9d4ae308 100644--- a/src/managed/Nota.App/DeviceCards/Midi/RandomMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/RandomMidiBody.cs@@ -368,7 +368,7 @@ internal sealed class RandomMidiBody : IMidiDeviceBodyvar 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);+ () => Begin(p), () => End(p), Refresh, control: trk);readouts.Add(() =>{double x = G(p);@@ -462,6 +462,8 @@ internal sealed class RandomMidiBody : IMidiDeviceBodyknob.GestureEnd += () => End(p);Learn(knob, p, label);var v = Mono("", Sub, 7); v.HorizontalAlignment = HorizontalAlignment.Center;+ knob.Format = n => text(max > 1 ? Math.Round(n * max) : Math.Round(n * max, 3));+ ValueEntry.Attach(knob, label, v);readouts.Add(() => { double n = G(p) / max; if (!knob.Dragging && Math.Abs(knob.Value - n) > 1e-6) knob.Value = n; v.Text = text(G(p)); });return new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Cursor = new Cursor(StandardCursorType.SizeNorthSouth),Children = { knob, new TextBlock { Text = NotaText.Label(label), FontSize = NotaType.KnobLabel, FontWeight = FontWeight.Medium, Foreground = Cap, HorizontalAlignment = HorizontalAlignment.Center, LineHeight = 9 }, v } };diff --git a/src/managed/Nota.App/DeviceCards/Midi/ScaleMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/ScaleMidiBody.csindex 3e39106e..48ffc000 100644--- a/src/managed/Nota.App/DeviceCards/Midi/ScaleMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/ScaleMidiBody.cs@@ -424,7 +424,7 @@ internal sealed class ScaleMidiBody : IMidiDeviceBody{if (!ev.GetCurrentPoint(valHit).Properties.IsLeftButtonPressed) return;ev.Handled = true;- if (ev.ClickCount == 2) { Begin(p); Put(p == PRangeLo ? 0 : 127); End(p); return; }+ if ((ev.ClickCount == 2 || (ev.KeyModifiers & KeyModifiers.Alt) != 0)) { Begin(p); Put(p == PRangeLo ? 0 : 127); End(p); return; }drag = true; y0 = ev.GetPosition(valHit).Y; v0 = Get(); ev.Pointer.Capture(valHit); Begin(p);};valHit.PointerMoved += (_, ev) => { if (drag) Put(v0 + (int)Math.Round((y0 - ev.GetPosition(valHit).Y) / 4)); };diff --git a/src/managed/Nota.App/DeviceCards/Midi/VelocityMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/VelocityMidiBody.csindex 2f96559d..5b0f7a13 100644--- a/src/managed/Nota.App/DeviceCards/Midi/VelocityMidiBody.cs+++ b/src/managed/Nota.App/DeviceCards/Midi/VelocityMidiBody.cs@@ -257,7 +257,7 @@ internal sealed class VelocityMidiBody : IMidiDeviceBodyToolTip.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);+ () => { dGesture = DriveParam(); Begin(dGesture); }, () => { End(dGesture); dGesture = -1; }, Refresh, control: dTrack);var dHint = new TextBlock { FontSize = 7, Foreground = Cap, TextTrimming = TextTrimming.CharacterEllipsis };readouts.Add(() =>{@@ -483,6 +483,7 @@ internal sealed class VelocityMidiBody : IMidiDeviceBodyLearn(knob, param(), label());var lbl = new TextBlock { FontSize = NotaType.KnobLabel, FontWeight = FontWeight.Medium, Foreground = Cap, HorizontalAlignment = HorizontalAlignment.Center, LineHeight = 9 };var v = Mono("", Sub, 7); v.HorizontalAlignment = HorizontalAlignment.Center;+ ValueEntry.Attach(knob, label(), v, text);readouts.Add(() =>{double n = norm();diff --git a/src/managed/Nota.App/DeviceCards/Mosaic/MosaicViews.cs b/src/managed/Nota.App/DeviceCards/Mosaic/MosaicViews.csindex 2d37e347..f01bb214 100644--- a/src/managed/Nota.App/DeviceCards/Mosaic/MosaicViews.cs+++ b/src/managed/Nota.App/DeviceCards/Mosaic/MosaicViews.cs@@ -356,7 +356,7 @@ internal sealed class MosaicCurveView : Control{base.OnPointerPressed(e);if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed || SetValue is null) return;- if (e.ClickCount == 2) { Begin?.Invoke(); SetValue(Default); End?.Invoke(); InvalidateVisual(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { Begin?.Invoke(); SetValue(Default); End?.Invoke(); InvalidateVisual(); e.Handled = true; return; }_drag = true; _y0 = e.GetPosition(this).Y; _v0 = Get();Begin?.Invoke();e.Pointer.Capture(this);diff --git a/src/managed/Nota.App/DeviceCards/PluginCard.cs b/src/managed/Nota.App/DeviceCards/PluginCard.csindex a582f3fb..a3dec74c 100644--- a/src/managed/Nota.App/DeviceCards/PluginCard.cs+++ b/src/managed/Nota.App/DeviceCards/PluginCard.cs@@ -268,7 +268,8 @@ internal static class PluginCard}// 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.+ // default on ⌥-click, typed values on double-click (KnobCell — probed, since a plug-in only+ // tells its text at the current value), 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;diff --git a/src/managed/Nota.App/DeviceCards/Rack/MacroPanel.cs b/src/managed/Nota.App/DeviceCards/Rack/MacroPanel.csindex 8fe554a7..e1883cea 100644--- a/src/managed/Nota.App/DeviceCards/Rack/MacroPanel.cs+++ b/src/managed/Nota.App/DeviceCards/Rack/MacroPanel.cs@@ -146,7 +146,7 @@ internal static class MacroPanelbool assigned = Mappings(s, m).Count > 0;string pid = RhythmModel.MacroId(m);- var knob = new Knob(Value(e, s, m), 1.0) { Accent = true, Default = 0.5, Width = Knob.SizeSecondary, Height = Knob.SizeSecondary, IsDim = !assigned };+ var knob = new Knob(Value(e, s, m), 1.0) { Accent = true, Default = 0.5, Width = Knob.SizeSecondary, Height = Knob.SizeSecondary, IsDim = !assigned, Format = v => Pct((float)v) };var value = new TextBlock { Text = Pct(Value(e, s, m)), FontSize = 7, FontFamily = NotaFonts.MonoFamily, Foreground = assigned ? TextPrimary : TextDisabled, LineHeight = 9 };knob.ValueChanged += v =>{@@ -162,6 +162,8 @@ internal static class MacroPanel};tick.Add(() => { if (!knob.Dragging) { float v = Value(e, s, m); if (Math.Abs(v - knob.Value) > 1e-4) { knob.Value = v; value.Text = Pct(v); } } });MidiLearn.Bind(knob, MidiTarget.PluginParam(track, di, pi), $"Macro {m + 1} · {s.MacroName(m)}");+ // Double-click types, ⌥-click resets; right-click stays the macro's own menu (the cell's).+ ValueEntry.Attach(knob, $"Macro {m + 1}", value, menu: false);string name = s.MacroName(m);bool custom = name != $"Macro {m + 1}";diff --git a/src/managed/Nota.App/DeviceCards/Rack/RackCardView.Drum.cs b/src/managed/Nota.App/DeviceCards/Rack/RackCardView.Drum.csindex ae8c1b3a..f67f9ec8 100644--- a/src/managed/Nota.App/DeviceCards/Rack/RackCardView.Drum.cs+++ b/src/managed/Nota.App/DeviceCards/Rack/RackCardView.Drum.cs@@ -429,7 +429,9 @@ internal sealed partial class RackCardViewvar vol = new SliderTrack { Norm = VolNorm(a.ChainGain(c)), Reset = () => a.SetChainGain(c, 1f) };vol.Changed += v => a.SetChainGain(c, NormVol(v));_irTick.Add(() => { if (!vol.Dragging) vol.Norm = VolNorm(a.ChainGain(c)); });- ToolTip.SetTip(vol, "Pad volume · drag up or down, double-click for 0\u2009dB");+ ToolTip.SetTip(vol, "Pad volume · drag up or down, double-click to type, ⌥-click for 0\u2009dB");+ ValueEntry.Attach(vol, new ValueField("Pad volume", () => VolNorm(a.ChainGain(c)), n => VolText(NormVol(n)),+ n => { vol.Norm = n; a.SetChainGain(c, NormVol(n)); }, Default: VolNorm(1f)));MidiLearn.Bind(vol, MidiTarget.RackChainGain(T, a.AutomationDeviceIndex, c), "Pad Volume");Grid.SetColumn(vol, 2); g.Children.Add(vol);@@ -461,7 +463,7 @@ internal sealed partial class RackCardView{if (!e.GetCurrentPoint(host).Properties.IsLeftButtonPressed) return;e.Handled = true;- if (e.ClickCount == 2) { a.SetChainPan(c, 0f); tb.Text = PanText(0f); return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { a.SetChainPan(c, 0f); tb.Text = PanText(0f); return; }drag = true; lastY = e.GetPosition(host).Y; e.Pointer.Capture(host);};host.PointerMoved += (_, e) =>diff --git a/src/managed/Nota.App/DeviceCards/Rack/RackCardView.cs b/src/managed/Nota.App/DeviceCards/Rack/RackCardView.csindex a29fff90..27d2540e 100644--- a/src/managed/Nota.App/DeviceCards/Rack/RackCardView.cs+++ b/src/managed/Nota.App/DeviceCards/Rack/RackCardView.cs@@ -376,6 +376,9 @@ internal sealed partial class RackCardView(DeviceCardContext ctx)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 ? "−∞\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); };+ vol.Default = 0.5; // unity gain+ vol.Format = v => VolDb(v * 2.0);+ ValueEntry.Attach(vol, "Rack volume", volVal);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 } };@@ -940,6 +943,8 @@ internal sealed partial 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}\u2009%"; };+ dw.Format = v => $"{v * 100:0}\u2009%";+ ValueEntry.Attach(dw, "Dry / wet", dwVal);dwVal.Text = $"{E.RackDevDryWet(T, di) * 100:0}\u2009%";var dwCell = new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, Children = { IrCap("DRY / WET"), dw, dwVal } };@@ -1112,10 +1117,12 @@ internal sealed partial class RackCardView(DeviceCardContext ctx)head.Children.Add(nameTb);Grid.SetColumn(rm, 1); head.Children.Add(rm);- var gain = new MiniFader(a.ChainGain(c), 2.0) { Accent = true, Width = 58 };+ var gain = new MiniFader(a.ChainGain(c), 2.0) { Accent = true, Width = 58, Default = 1.0 };gain.ValueChanged += v => a.SetChainGain(c, (float)v);- var pan = new MiniFader(a.ChainPan(c) * 0.5 + 0.5, 1.0) { Width = 40 };+ var pan = new MiniFader(a.ChainPan(c) * 0.5 + 0.5, 1.0) { Width = 40, Default = 0.5 };pan.ValueChanged += v => a.SetChainPan(c, (float)(v * 2.0 - 1.0));+ ValueEntry.Attach(gain, gain.EntryField("Chain gain", v => NotaNum.GainDb(v)));+ ValueEntry.Attach(pan, pan.EntryField("Chain pan", v => NotaNum.Pan(v * 2 - 1)));var m = Toggle("M", a.ChainMute(c), NotaPalette.Mute, () => { a.SetChainMute(c, !a.ChainMute(c)); _ctx.RequestRebuild(); });var s = Toggle("S", a.ChainSolo(c), NotaPalette.Solo, () => { a.SetChainSolo(c, !a.ChainSolo(c)); _ctx.RequestRebuild(); });var ctrls = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4, VerticalAlignment = VerticalAlignment.Center, Children = { gain, pan, m, s } };@@ -1337,6 +1344,8 @@ internal sealed partial class RackCardView(DeviceCardContext ctx)// plugin param — this is the in-model path for driving nested chain params over MIDI// (map a param to a macro, then learn the macro).MidiLearn.Bind(bar, MidiTarget.PluginParam(T, di, m), "Macro " + (m + 1));+ bar.Format = x => Pct((float)x);+ ValueEntry.Attach(bar, "Macro " + (m + 1), val);if (di < 0) _ctx.AddInstFader(m, bar, val); // live-refresh follows the instrument-rack macrosvar host = new StackPanel { Width = 92, Spacing = 2, Children = { top, bar, MappingLabel(a, m) } };@@ -1504,6 +1513,8 @@ internal sealed partial class RackCardView(DeviceCardContext ctx)var map = MapButton(a, c, d, p, min, max); Grid.SetColumn(map, 2); top.Children.Add(map);var bar = new Knob((val - min) / span, 1.0) { Accent = true, HorizontalAlignment = HorizontalAlignment.Center };bar.ValueChanged += frac => { float v = (float)(min + frac * span); a.ChainDeviceParamSet(c, d, p, v); value.Text = DeviceParamControls.Fmt(v); };+ bar.Format = frac => DeviceParamControls.Fmt((float)(min + frac * span));+ ValueEntry.Attach(bar, name, value);_ctx.AddRackParamRefresher(() =>{if (bar.Dragging) return;@@ -1526,6 +1537,8 @@ internal sealed partial class RackCardView(DeviceCardContext ctx)var map = MapButton(a, c, -1, p, 0f, 1f); Grid.SetColumn(map, 2); top.Children.Add(map);var bar = new Knob(val, 1.0) { Accent = true, HorizontalAlignment = HorizontalAlignment.Center };bar.ValueChanged += v => { a.ChainInstrumentParamSet(c, p, (float)v); value.Text = Pct((float)v); };+ bar.Format = v => Pct((float)v);+ ValueEntry.Attach(bar, name, value);_ctx.AddRackParamRefresher(() =>{if (bar.Dragging) return;diff --git a/src/managed/Nota.App/DeviceCards/Sampler/SamplerViews.cs b/src/managed/Nota.App/DeviceCards/Sampler/SamplerViews.csindex 58d958de..63819afb 100644--- a/src/managed/Nota.App/DeviceCards/Sampler/SamplerViews.cs+++ b/src/managed/Nota.App/DeviceCards/Sampler/SamplerViews.cs@@ -89,7 +89,7 @@ internal sealed class SamplerWaveView : Controldouble x = e.GetPosition(this).X / w;int h = Hit(x, w);if (h < 0) return;- if (e.ClickCount == 2) { ResetHandle?.Invoke(h); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { ResetHandle?.Invoke(h); e.Handled = true; return; }_drag = h;DragBegin?.Invoke(h);e.Pointer.Capture(this);@@ -318,7 +318,7 @@ internal sealed class SamplerEnvView : Controlint best = -1; double bd = 10;for (int i = 0; i < 3; i++) { double dd = Math.Abs(p.X - pts[i].X) + Math.Abs(p.Y - pts[i].Y) * 0.5; if (dd < bd) { bd = dd; best = i; } }if (best < 0) return;- if (e.ClickCount == 2) { Reset?.Invoke(Ids[best]); if (best == 1) Reset?.Invoke("sustain"); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { Reset?.Invoke(Ids[best]); if (best == 1) Reset?.Invoke("sustain"); e.Handled = true; return; }_drag = best; _last = p;DragBegin?.Invoke(Ids[best]);if (best == 1) DragBegin?.Invoke("sustain");@@ -469,7 +469,7 @@ internal sealed class SamplerFilterView : Controlprotected override void OnPointerPressed(PointerPressedEventArgs e){if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;- if (e.ClickCount == 2) { Reset?.Invoke(); e.Handled = true; return; }+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { Reset?.Invoke(); e.Handled = true; return; }_drag = true; _last = e.GetPosition(this);DragBegin?.Invoke();e.Pointer.Capture(this);diff --git a/src/managed/Nota.App/DeviceChainView.Shell.cs b/src/managed/Nota.App/DeviceChainView.Shell.csindex c4d4a766..45306b5a 100644--- a/src/managed/Nota.App/DeviceChainView.Shell.cs+++ b/src/managed/Nota.App/DeviceChainView.Shell.cs@@ -376,6 +376,7 @@ public sealed partial class DeviceChainViewWidth = s.Width, Height = CardH,Child = new Panel { Children = { shell, selRing } },};+ ValueEntry.SetScope(card, true); // Tab in a value box walks this card's parameters// Bypassed: the body takes the inactive look but stays playable (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).diff --git a/src/managed/Nota.App/DeviceChainView.cs b/src/managed/Nota.App/DeviceChainView.csindex 5a22a080..4ad3bf2a 100644--- a/src/managed/Nota.App/DeviceChainView.cs+++ b/src/managed/Nota.App/DeviceChainView.cs@@ -234,7 +234,7 @@ public sealed partial class DeviceChainView : UserControlvar value = new TextBlock { Text = Pct(_engine.GetTrackSend(_trackId, bus)), FontSize = 8, Foreground = TextPrimary };value.BindResource(TextBlock.FontFamilyProperty, "Font.Mono");- var knob = new Knob(_engine.GetTrackSend(_trackId, bus), 1.0) { Accent = true, Default = 0 };+ var knob = new Knob(_engine.GetTrackSend(_trackId, bus), 1.0) { Accent = true, Default = 0, Format = v => Pct((float)v) };int b = bus;knob.ValueChanged += v => { _engine.SetTrackSend(_trackId, b, (float)v); value.Text = Pct((float)v); };// Follow the Session / Mixer send faders and automation (#138).diff --git a/src/managed/Nota.App/MainWindow.axaml b/src/managed/Nota.App/MainWindow.axamlindex e71d75b8..67066992 100644--- a/src/managed/Nota.App/MainWindow.axaml+++ b/src/managed/Nota.App/MainWindow.axaml@@ -390,7 +390,7 @@<Panel x:Name="MasterVolHost" Width="88" Height="10"/><Panel x:Name="MasterMeterHost" Width="88" Height="4"/></StackPanel>- <TextBlock Classes="Mono" FontSize="11" MinWidth="46" TextAlignment="Right"+ <TextBlock x:Name="MasterDb" Classes="Mono" FontSize="11" MinWidth="46" TextAlignment="Right"VerticalAlignment="Center" Text="{Binding Transport.MasterDbText}"Foreground="{DynamicResource Brush.TextPrimary}"/></StackPanel>diff --git a/src/managed/Nota.App/MainWindow.axaml.cs b/src/managed/Nota.App/MainWindow.axaml.csindex b07ca903..34b78350 100644--- a/src/managed/Nota.App/MainWindow.axaml.cs+++ b/src/managed/Nota.App/MainWindow.axaml.cs@@ -230,12 +230,14 @@ public partial class MainWindow : Window// Thin master volume fader (mockup 1b) — MiniFader instead of a stock Slider. It// sits over the master meter inside the MST module, with the gain printed in dB.- var masterVol = new MiniFader((double)vm.Transport.MasterVolume, 1.5);+ var masterVol = new MiniFader((double)vm.Transport.MasterVolume, 1.5) { Default = 1.0 };var masterUndo = new MixGesture(vm.Engine, MixTarget.Master); // one undo step per drag (specs/009)masterVol.GestureBegin += masterUndo.Begin;masterVol.GestureEnd += masterUndo.End;Action<double> setMaster = v => vm.Transport.MasterVolume = v;masterVol.ValueChanged += v => masterUndo.Change(v, setMaster);+ // Double-click the fader or its dB number to type the master gain, ⌥-click for 0 dB.+ ValueEntry.Attach(masterVol, masterVol.EntryField("Master volume", v => NotaNum.GainDb(v)), MasterDb);MasterVolHost.Children.Add(masterVol);MidiLearn.Bind(masterVol, MidiTarget.MasterVolume, "Master Volume");diff --git a/src/managed/Nota.App/MixerView.cs b/src/managed/Nota.App/MixerView.csindex 87344a74..514368ab 100644--- a/src/managed/Nota.App/MixerView.cs+++ b/src/managed/Nota.App/MixerView.cs@@ -91,6 +91,7 @@ public sealed class MixerView : UserControlpublic MixerView(IAudioEngine engine){+ ValueEntry.SetScope(this, true); // Tab in a value box walks the values shown here_engine = engine;_stripsScroller = new ScrollViewer{@@ -453,6 +454,7 @@ public sealed class MixerView : UserControlvar f = new MiniFader(_engine.GetTrackSend(id, bus), 1.0) { VerticalAlignment = VerticalAlignment.Center };int b = bus;f.ValueChanged += v => _engine.SetTrackSend(id, b, (float)v);+ ValueEntry.Attach(f, f.EntryField($"Send {(char)('A' + b)}", NotaNum.Pct));_sendFaders.Add((id, b, f));Grid.SetColumn(f, 1); grid.Children.Add(f);}@@ -475,6 +477,7 @@ public sealed class MixerView : UserControlknob.GestureBegin += undo.Begin;Action<double> setPan = p => _engine.SetTrackPan(id, (float)p);knob.PanChanged += p => undo.Change(p, setPan);+ ValueEntry.Attach(knob, knob.EntryField("Pan", NotaNum.Pan));if (id > 0) // M9-C: record pan moves (master pan isn't an automation target){knob.GestureBegin += () => _engine.BeginAutomationWrite(id, AutomationTarget.Pan, -1, -1, "");@@ -529,6 +532,7 @@ public sealed class MixerView : UserControlfader.GestureEnd += undo.End;dbNum.GestureEnd += undo.End;MidiLearn.Bind(fader, id > 0 ? MidiTarget.TrackVolume(id) : MidiTarget.MasterVolume, id > 0 ? "Track Volume" : "Master Volume");+ ValueEntry.Attach(fader, fader.EntryField("Volume", v => NotaNum.GainDb(v, signed: true), 1.0));db = dbNum;meter = new MeterBar(); // the almanac stereo meter: 11 + 5 + 11diff --git a/src/managed/Nota.App/ModularView.cs b/src/managed/Nota.App/ModularView.csindex 95d0bd49..ffe642ef 100644--- a/src/managed/Nota.App/ModularView.cs+++ b/src/managed/Nota.App/ModularView.cs@@ -827,6 +827,7 @@ public sealed class ModularView : UserControlbool exposed = _exposedParams.Contains((t, d, pp));var value = MonoValue(Fmt(val));var knob = new Knob((val - min) / span, 1.0) { Accent = true, ArcColor = modulated ? Teal : null, Default = (e.DeviceParamDefault(t, d, pp) - min) / span };+ knob.Format = frac => Fmt((float)(min + frac * span));knob.ValueChanged += frac => { double v = min + frac * span; e.DeviceSetParam(t, d, pp, (float)v); value.Text = Fmt((float)v); };knob.GestureBegin += () => e.BeginAutomationWrite(t, AutomationTarget.DeviceParam, d, pp, "");knob.GestureEnd += () => e.EndAutomationWrite(t, AutomationTarget.DeviceParam, d, pp, "");@@ -852,6 +853,7 @@ public sealed class ModularView : UserControlbool modulated = e.ParamModulated(2, t, ix, pp);var value = MonoValue(Fmt(val));var knob = new Knob((val - min) / span, 1.0) { Accent = true, ArcColor = modulated ? Teal : null, Default = (e.MidiEffectParamDefault(t, ix, pp) - min) / span };+ knob.Format = frac => Fmt((float)(min + frac * span));knob.ValueChanged += frac => { double v = min + frac * span; e.MidiEffectSetParam(t, ix, pp, (float)v); value.Text = Fmt((float)v); };MidiLearn.Bind(knob, MidiTarget.MidiDeviceParam(t, ix, pp), name);knob.ContextRequested += (_, ev) => { ShowModulateMenu(knob, 2, ix, pp, name); ev.Handled = true; };@@ -873,6 +875,7 @@ public sealed class ModularView : UserControlbool modulated = e.ParamModulated(1, t, -1, pp);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.Format = frac => frac.ToString("0.00", NotaNum.Culture);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);@@ -1151,6 +1154,7 @@ public sealed class ModularView : UserControlfloat v0 = e.ModulatorGet(t, modId, field);var value = MonoValue(fmt((v0 - min) / span * span + min));var knob = new Knob((v0 - min) / span, 1.0) { Accent = true };+ knob.Format = frac => fmt((float)(min + frac * span));knob.ValueChanged += frac => { float v = (float)(min + frac * span); e.ModulatorSet(t, modId, field, v); value.Text = fmt(v); };_liveKnobs.Add(() =>{@@ -1174,6 +1178,7 @@ public sealed class ModularView : UserControlfloat v0 = e.ModulatorGet(t, modId, field);var value = MonoValue(fmt(v0));var knob = new Knob((v0 - min) / span, 1.0) { Accent = true, Width = 30, Height = 30 };+ knob.Format = frac => fmt((float)(min + frac * span));knob.ValueChanged += frac => { float v = (float)(min + frac * span); e.ModulatorSet(t, modId, field, v); value.Text = fmt(v); };_liveKnobs.Add(() =>{@@ -1181,6 +1186,7 @@ public sealed class ModularView : UserControlfloat cur = e.ModulatorGet(t, modId, field); double frac = (cur - min) / span;if (Math.Abs(frac - knob.Value) > 1e-3) { knob.Value = frac; value.Text = fmt(cur); }});+ ValueEntry.Attach(knob, "Rate", value);return new StackPanel{Spacing = 0, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,@@ -1203,6 +1209,9 @@ public sealed class ModularView : UserControlvar flyout = new MenuFlyout();flyout.Items.Add(MenuKit.Header(paramName, null, "Parameter"));flyout.Items.Add(new Separator());+ // Type value… / Reset to default first, as on every parameter (specs/035).+ foreach (var c in ValueEntry.MenuItems(anchor)) flyout.Items.Add(c);+ if (flyout.Items.Count > 2) flyout.Items.Add(new Separator());// Already modulated? Offer edit + remove (the link may be owned by another track);// Remove goes last, in the destructive group.diff --git a/src/managed/Nota.App/PreferencesWindow.cs b/src/managed/Nota.App/PreferencesWindow.csindex a26173cd..d92ddaaa 100644--- a/src/managed/Nota.App/PreferencesWindow.cs+++ b/src/managed/Nota.App/PreferencesWindow.cs@@ -1232,7 +1232,7 @@ public sealed partial class PreferencesWindow : NotaWindow("Click waveform", "Play from that point"),("Click WAVE / SPEC", "Switch the well between the waveform and a live spectrum"),("Scroll on the track button", "Step through the demo tracks an effect preset is heard through"),- ("Double-click volume", "Reset the preview volume to 0\u2009dB"),+ ("Double-click volume", "Type the preview volume · ⌥-click resets it to 0\u2009dB"),}),("Gamepad (macOS)", new[]{@@ -1272,8 +1272,10 @@ 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"),("Drag slider", "Left / right (or up / down) changes the 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"),+ ("Double-click a knob, fader or slider", "Type a value — on the control or its value (units like k, ms, dB, L / R work)"),+ ("Return · Esc · Tab / ⇧Tab (typing a value)", "Set it · cancel · set it and type the next / previous value on the card"),+ ("⌥-click a knob, fader or slider", "Reset the value to its default"),+ ("Right-click a knob, fader or slider", "Type value… · Reset to default"),("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"),diff --git a/src/managed/Nota.App/PreviewPlayer.cs b/src/managed/Nota.App/PreviewPlayer.csindex d270e052..16dfd1ba 100644--- a/src/managed/Nota.App/PreviewPlayer.cs+++ b/src/managed/Nota.App/PreviewPlayer.cs@@ -6,8 +6,8 @@// the name and format, the real waveform in a well (click = seek, hover = time tag, a brass// playhead while it plays) or — WAVE / SPEC in the well's corner — a live spectrum of what// the preview voice is playing, then Play/Stop, the time readout, the effect source (FX-// presets only), Loop, Auto (selecting plays it) and a preview-volume fader (double-click =-// 0 dB). A sample's waveform is decoded off the UI thread through the engine's background+// presets only), Loop, Auto (selecting plays it) and a preview-volume fader (double-click+// types a level, ⌥-click = 0 dB). A sample's waveform is decoded off the UI thread through the engine's background// import. A preset is rendered OFFLINE: IPresetAudition plans a phrase that suits it, a// worker builds and renders a standalone rig (see IAuditionRig), and the engine keeps the// result in its audition cache; the row below the selection is then pre-rendered, so@@ -483,8 +483,8 @@ public sealed class PreviewPlayer : UserControltry { _engine?.SetPreviewGain((float)(v * v)); } catch { }_volWaves.Kind = v <= 0.001 ? GlyphKind.SpeakerMute : v < 0.5 ? GlyphKind.SpeakerLow : GlyphKind.SpeakerHigh;var db = NotaNum.Db(v <= 0.001 ? double.NegativeInfinity : 40 * Math.Log10(v));- ToolTip.SetTip(_volumeBox, $"Preview volume {db} · double-click for 0{NotaNum.Thin}dB");- ToolTip.SetTip(_volumePop, $"Preview volume {db} · double-click for 0{NotaNum.Thin}dB");+ ToolTip.SetTip(_volumeBox, $"Preview volume {db} · double-click to type · ⌥-click for 0{NotaNum.Thin}dB");+ ToolTip.SetTip(_volumePop, $"Preview volume {db} · double-click to type · ⌥-click for 0{NotaNum.Thin}dB");if (persist && _settings is not null) { _settings.Current.BrowserPreviewVolume = v; _settings.Save(); }}@@ -1115,7 +1115,7 @@ public sealed class PreviewWaveform : Control}/// <summary>The preview-volume fader: a thin track, a fill to the value and a small bar-/// thumb. Drag anywhere to set; double-click resets to 0 dB (1.0).</summary>+/// thumb. Drag anywhere to set; double-click types a level, ⌥-click resets to 0 dB (1.0).</summary>public sealed class PreviewVolume : Control{private double _value = 0.7;@@ -1133,7 +1133,8 @@ public sealed class PreviewVolume : Controlpublic PreviewVolume(){Cursor = new Cursor(StandardCursorType.SizeWestEast);- DoubleTapped += (_, e) => { Value = 1; ValueChanged?.Invoke(1, true); e.Handled = true; };+ ValueEntry.Attach(this, new ValueField("Preview volume", () => _value, n => NotaNum.GainDb(n),+ n => { Value = n; ValueChanged?.Invoke(_value, true); }, Default: 1));}private void SetFrom(Point p)diff --git a/src/managed/Nota.App/SessionView.Mixer.cs b/src/managed/Nota.App/SessionView.Mixer.csindex 437ebdb8..4c1d14b0 100644--- a/src/managed/Nota.App/SessionView.Mixer.cs+++ b/src/managed/Nota.App/SessionView.Mixer.cs@@ -102,6 +102,7 @@ public sealed partial class SessionViewvar read = ReadoutText();void Show() => read.Text = f.Value <= 0.005 ? "–" : NotaNum.Str(f.Value * 100, "0");f.ValueChanged += v => { _engine.SetTrackSend(id, bus, (float)v); Show(); };+ ValueEntry.Attach(f, f.EntryField("Send", v => v <= 0.005 ? "–" : NotaNum.Str(v * 100, "0")), read);Show();sendSyncs.Add(() =>{@@ -129,6 +130,7 @@ public sealed partial class SessionViewpan.GestureEnd += panUndo.End;Action<double> setPan = p => _engine.SetTrackPan(id, (float)p);pan.PanChanged += p => panUndo.Change(p, setPan);+ ValueEntry.Attach(pan, pan.EntryField("Pan"));panRow = FaderRow(pan, ReadoutText());}else panRow = new Border { Height = FaderRowH };@@ -146,6 +148,7 @@ public sealed partial class SessionViewelse SetMasterVolume?.Invoke((float)v);};vol.ValueChanged += v => { volUndo.Change(v, setVol); ShowDb(); };+ ValueEntry.Attach(vol, vol.EntryField("Volume", v => v <= 1e-4 ? "−∞" : NotaNum.Db(AudioMath.LinToDb(v), signed: true)), db);ShowDb();var mL = new MeterLine(); var mR = new MeterLine();diff --git a/src/managed/Nota.App/SessionView.cs b/src/managed/Nota.App/SessionView.csindex f7d50ecc..33fba7d1 100644--- a/src/managed/Nota.App/SessionView.cs+++ b/src/managed/Nota.App/SessionView.cs@@ -99,6 +99,7 @@ public sealed partial class SessionView : UserControlpublic SessionView(IAudioEngine engine){+ ValueEntry.SetScope(this, true); // Tab in a value box walks the values shown here_engine = engine;Focusable = true;FocusAdorner = null;diff --git a/src/managed/Nota.App/Theme/NotaNum.cs b/src/managed/Nota.App/Theme/NotaNum.csindex a5356cc6..01a2858e 100644--- a/src/managed/Nota.App/Theme/NotaNum.cs+++ b/src/managed/Nota.App/Theme/NotaNum.cs@@ -52,6 +52,16 @@ public static class NotaNumreturn db.ToString(signed ? "+0.0;\u22120.0;0.0" : "0.0", Culture) + Thin + "dB";}+ /// <summary>A linear gain as decibels: "−3.3 dB", "−∞ dB" at silence.</summary>+ public static string GainDb(double lin, bool signed = false) => Db(lin <= 0 ? double.NegativeInfinity : 20 * Math.Log10(lin), signed);++ /// <summary>Pan −1..1 as the mixer writes it: "C", "30L", "100R".</summary>+ public static string Pan(double pan)+ {+ int amt = (int)Math.Round(Math.Abs(pan) * 100);+ return amt == 0 ? "C" : amt.ToString(Culture) + (pan < 0 ? "L" : "R");+ }+/// <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){diff --git a/src/managed/Nota.App/Theme/NotaTheme.axaml b/src/managed/Nota.App/Theme/NotaTheme.axamlindex 75a9cda4..fff5da97 100644--- a/src/managed/Nota.App/Theme/NotaTheme.axaml+++ b/src/managed/Nota.App/Theme/NotaTheme.axaml@@ -829,6 +829,32 @@<Setter Property="BorderBrush" Value="{DynamicResource Brush.Accent}"/></Style>+ <!-- ===== Typed value (specs/035): the read-out itself turns editable =====+ No well and no frame — the value keeps its own font, size and alignment, and a 1px+ accent line under it says it is live. The number is selected in the accent wash;+ `solid` lays the card surface under it where there is no read-out (over a fader). -->+ <Style Selector="TextBox.value">+ <Setter Property="MinHeight" Value="0"/>+ <Setter Property="MinWidth" Value="0"/>+ <Setter Property="Padding" Value="0"/>+ <Setter Property="Background" Value="Transparent"/>+ <Setter Property="Foreground" Value="{DynamicResource Brush.TextPrimary}"/>+ <Setter Property="CaretBrush" Value="{DynamicResource Brush.Accent}"/>+ <Setter Property="SelectionBrush" Value="{DynamicResource Brush.AccentSubtle}"/>+ <Setter Property="SelectionForegroundBrush" Value="{DynamicResource Brush.TextPrimary}"/>+ <Setter Property="VerticalContentAlignment" Value="Center"/>+ </Style>+ <Style Selector="TextBox.value /template/ Border#PART_BorderElement, TextBox.value:pointerover /template/ Border#PART_BorderElement, TextBox.value:focus /template/ Border#PART_BorderElement">+ <Setter Property="Background" Value="Transparent"/>+ <Setter Property="BorderBrush" Value="{DynamicResource Brush.Accent}"/>+ <Setter Property="BorderThickness" Value="0,0,0,1"/>+ <Setter Property="CornerRadius" Value="0"/>+ <Setter Property="MinHeight" Value="0"/>+ </Style>+ <Style Selector="TextBox.value.solid /template/ Border#PART_BorderElement, TextBox.value.solid:pointerover /template/ Border#PART_BorderElement, TextBox.value.solid:focus /template/ Border#PART_BorderElement">+ <Setter Property="Background" Value="{DynamicResource Brush.SurfaceRaised}"/>+ </Style>+<!-- ===== Keyboard focus: a 1px accent edge, no ring and no glow ===== --><Style Selector="Button:focus-visible /template/ ContentPresenter#PART_ContentPresenter"><Setter Property="BorderBrush" Value="{DynamicResource Brush.Accent}"/>diff --git a/tests/Nota.SmokeTest/Nota.SmokeTest.csproj b/tests/Nota.SmokeTest/Nota.SmokeTest.csprojindex 555b44b6..e1bfab6e 100644--- a/tests/Nota.SmokeTest/Nota.SmokeTest.csproj+++ b/tests/Nota.SmokeTest/Nota.SmokeTest.csproj@@ -45,6 +45,8 @@<Compile Include="..\..\src\managed\Nota.App\Input\ShortcutAvaloniaExtensions.cs" Link="ShortcutAvaloniaExtensions.cs" /><!-- What's New's changelog / release-notes parsers (no Avalonia inside). --><Compile Include="..\..\src\managed\Nota.App\Changelog.cs" Link="Changelog.cs" />+ <!-- Typed value entry's parser / read-out search (no Avalonia inside). -->+ <Compile Include="..\..\src\managed\Nota.App\Controls\ValueText.cs" Link="ValueText.cs" /></ItemGroup></Project>diff --git a/tests/Nota.SmokeTest/Program.cs b/tests/Nota.SmokeTest/Program.csindex 67892758..87df61c0 100644--- a/tests/Nota.SmokeTest/Program.cs+++ b/tests/Nota.SmokeTest/Program.cs@@ -282,6 +282,14 @@ if (args.Length >= 1 && args[0] == "--glide")Console.WriteLine(failures == 0 ? "GLIDE PASSED" : $"GLIDE FAILED ({failures})");return failures == 0 ? 0 : 1;}+// Typed value entry alone: `--valueentry`. Also part of the full run.+if (args.Length >= 1 && args[0] == "--valueentry")+{+ Console.WriteLine("-- typed value entry --");+ foreach (var (ok, label) in ValueEntryTests.Run()) Check(ok, label);+ Console.WriteLine(failures == 0 ? "VALUE ENTRY PASSED" : $"VALUE ENTRY FAILED ({failures})");+ return failures == 0 ? 0 : 1;+}// Snap grid alone: `--grid`. Also part of the full run.if (args.Length >= 1 && args[0] == "--grid"){@@ -14917,6 +14925,10 @@ foreach (var (ok, label) in AuditionTests.Run()) Check(ok, label);Console.WriteLine("-- app: What's New release notes --");foreach (var (ok, label) in ReleaseNotesTests.Run()) Check(ok, label);+// --- app: typed value entry (parser + read-out search) ---+Console.WriteLine("-- typed value entry --");+foreach (var (ok, label) in ValueEntryTests.Run()) Check(ok, label);+// --- project: content-addressed bundle (samples / plugin states named by hash) ---Console.WriteLine("-- project: content-addressed bundle --");foreach (var (ok, label) in BundleContentTests.Run()) Check(ok, label);diff --git a/tests/Nota.SmokeTest/ValueEntryTests.cs b/tests/Nota.SmokeTest/ValueEntryTests.csnew file mode 100644index 00000000..1b1b6c6c--- /dev/null+++ b/tests/Nota.SmokeTest/ValueEntryTests.cs@@ -0,0 +1,89 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// Typed value entry (specs/035-typed-value-entry): the parser reads what a user types and the+// search finds the control position whose read-out shows it. Checked against plain read-out+// formatters shaped like the app's (dB with −∞, log Hz → kHz, ms → s, pan L/C/R, % with+// "off"). Also runnable alone: `dotnet run --project tests/Nota.SmokeTest -- --valueentry`.++using System.Globalization;+using Nota.App;++namespace Nota.SmokeTest;++internal static class ValueEntryTests+{+ private static readonly CultureInfo Inv = CultureInfo.InvariantCulture;++ // −60 … +12 dB, 0.1 dB steps, −∞ at the bottom.+ private static string Db(double n) => n <= 0 ? "-∞ dB" : string.Format(Inv, "{0:0.0} dB", -60 + n * 72);+ // 20 Hz … 20 kHz, log.+ private static string Hz(double n)+ {+ double f = 20 * Math.Pow(1000, n);+ return f < 1000 ? string.Format(Inv, "{0:0} Hz", f) : string.Format(Inv, "{0:0.00} kHz", f / 1000);+ }+ // 1 ms … 10 s, log.+ private static string Time(double n)+ {+ double t = 0.001 * Math.Pow(10000, n);+ return t < 1 ? string.Format(Inv, "{0:0} ms", t * 1000) : string.Format(Inv, "{0:0.00} s", t);+ }+ // 100L … C … 100R.+ private static string Pan(double n)+ {+ double p = n * 2 - 1;+ int pc = (int)Math.Round(Math.Abs(p) * 100);+ return pc == 0 ? "C" : $"{pc}{(p < 0 ? "L" : "R")}";+ }+ // off, then 1 … 100 %.+ private static string Amount(double n) => n < 0.02 ? "off" : string.Format(Inv, "{0:0} %", n * 100);++ private static bool Near(double? a, double b, double tol = 1e-9) => a is { } v && Math.Abs(v - b) <= tol;++ private static string Typed(string typed, Func<double, string> at, double current)+ => ValueText.Solve(typed, at(current), at) is { } n ? at(n) : "(none)";++ public static IEnumerable<(bool Ok, string Label)> Run()+ {+ // ---- the parser ----+ yield return (Near(ValueText.Read("1.2k", out _, out _), 1200), "value entry: \"1.2k\" reads 1200");+ yield return (Near(ValueText.Read("1.2kHz", out _, out bool u1), 1200) && u1, "value entry: \"1.2kHz\" reads 1200 with a unit");+ yield return (Near(ValueText.Read("12ms", out _, out _), 0.012), "value entry: \"12ms\" reads 0.012 s");+ yield return (Near(ValueText.Read("500us", out _, out _), 500e-6) && Near(ValueText.Read("500µs", out _, out _), 500e-6),+ "value entry: µs / us read as microseconds");+ yield return (Near(ValueText.Read("1/4", out _, out _), 0.25), "value entry: a fraction reads as its quotient");+ yield return (Near(ValueText.Read("-6,5", out _, out _), -6.5) && Near(ValueText.Read("−6.5 dB", out _, out _), -6.5),+ "value entry: decimal comma and the typographic minus");+ yield return (Near(ValueText.Read("30L", out _, out _), -30) && Near(ValueText.Read("L30", out _, out _), -30)+ && Near(ValueText.Read("30 R", out _, out _), 30) && Near(ValueText.Read("C", out _, out _), 0),+ "value entry: pan written 30L, L30, 30 R and C");+ yield return (ValueText.Read("-∞", out _, out _) is double.NegativeInfinity && ValueText.Read("inf", out _, out _) is double.PositiveInfinity,+ "value entry: ∞ and inf, signed");+ yield return (ValueText.Read("abc", out _, out _) is null && ValueText.Read("", out _, out _) is null,+ "value entry: text with no number reads as nothing");++ // ---- the search against a read-out ----+ string s;+ yield return ((s = Typed("1.2k", Hz, 0.5)) == "1.20 kHz", $"value entry: \"1.2k\" on a frequency lands on 1.20 kHz ({s})");+ yield return ((s = Typed("1.5", Hz, 0.8)) == "1.50 kHz", $"value entry: a bare number takes the read-out's unit — 1.5 on a kHz read-out ({s})");+ yield return ((s = Typed("800", Hz, 0.8)) == "800 Hz", $"value entry: a bare number takes the unit that fits — 800 on a kHz read-out is 800 Hz ({s})");+ yield return ((s = Typed("1,5k", Hz, 0.2)) == "1.50 kHz", $"value entry: \"1,5k\" (decimal comma) ({s})");+ yield return ((s = Typed("50k", Hz, 0.5)) == "20.00 kHz", $"value entry: past the top clamps to the end ({s})");+ yield return ((s = Typed("5 Hz", Hz, 0.5)) == "20 Hz", $"value entry: below the bottom clamps to the start ({s})");+ yield return ((s = Typed("5", Hz, 0.5)) == "5.00 kHz", $"value entry: a bare 5 on a Hz read-out takes kHz, the unit it shows 5 in ({s})");+ yield return ((s = Typed("500", Time, 0.9)) == "500 ms", $"value entry: 500 on a seconds read-out is 500 ms ({s})");+ yield return ((s = Typed("12ms", Time, 0.9)) == "12 ms", $"value entry: \"12ms\" on a time ({s})");+ yield return ((s = Typed("-6", Db, 0.5)) == "-6.0 dB", $"value entry: -6 on a dB read-out ({s})");+ yield return ((s = Typed("-∞", Db, 0.5)) == "-∞ dB", $"value entry: -∞ lands on the bottom ({s})");+ yield return ((s = Typed("30L", Pan, 0.5)) == "30L" && Typed("C", Pan, 0.2) == "C", $"value entry: pan 30L and C ({s})");+ yield return ((s = Typed("off", Amount, 0.5)) == "off", $"value entry: a word the read-out shows ({s})");+ yield return (ValueText.Solve("abc", Db(0.5), Db) is null, "value entry: unreadable text finds nothing");++ // A stepped read-out: "0" lands in the middle of the run of positions showing 0.0 dB.+ double? z = ValueText.Solve("0", Db(0.2), Db);+ double exact = 60.0 / 72, step = 0.1 / 72;+ yield return (z is { } zz && Db(zz) == "0.0 dB" && Math.Abs(zz - exact) < step / 4,+ $"value entry: \"0\" lands mid-step on 0.0 dB (n={z?.ToString("0.00000", Inv)}, exact {exact:0.00000})");+ }+}