Skip to content

armgit / nota

Public Imported from GitHub
0

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

(feat) Add multiple MIDI CC lanes and saved lane heights (#425)

ret_xed989d2b9014aa
diff --git a/.specify/bugs/docked-note-area/assessment.md b/.specify/bugs/docked-note-area/assessment.md
new file mode 100644
index 00000000..15344c3b
--- /dev/null
+++ b/.specify/bugs/docked-note-area/assessment.md
@@ -0,0 +1,53 @@
+# Bug Assessment: Short docked MIDI editors lose their notes
+
+- **Slug**: docked-note-area (generated from report)
+- **Created**: 2026-11-02
+- **Source**: pasted PR #425 review follow-up
+- **Verdict**: valid
+- **Severity**: high
+
+## Symptom and reproduction
+
+The primary lane now reserves 72 pixels for its five tabs, but the docked Detail row
+still permits 120 pixels for the entire editor. Its 32-pixel host toolbar and 38-pixel
+clip header further reduce the space available for the roll. Shrink the actual docked
+MIDI editor to 190 pixels (roughly 120 for the roll): notes have no usable viewport.
+The earlier standalone 300-pixel test does not exercise these headers or host limits.
+Approved issue #422 remains open; this is a correction to its resizable MIDI lanes.
+
+## Root Cause and Suspected Code Paths
+
+`MainWindow.Detail.cs::ShowDetail` and `FollowDetailVisibility` use 120 as the minimum
+for every Detail tab. `FitControllerLanes` cannot fit ruler, 72-pixel primary lane,
+divider, toolbar and notes into the remaining space. Confidence: high.
+
+## Proposed Remediation
+
+Raise the docked MIDI Clip editor minimum to reserve both headers, all roll chrome,
+the optional clip strip and horizontal scrollbar, and a useful note viewport. Keep
+other Detail tabs' existing minimum. Apply the limit when opening/restoring and
+through the existing splitter/edge/window-fitting paths; test any interaction with
+the docked Mixer at the minimum main-window size. Prefer a host layout correction
+over shrinking or hiding the five primary tabs.
+
+Files likely to change: `MainWindow.Detail.cs`, CCProbe, CHANGELOG.md, the lane spec,
+plan and validation; other host files only if actual testing reveals a necessary
+minimum-window adjustment. Update the manual handoff if visible resizing guidance changes.
+
+## Tests to Add
+
+Use the real MainWindow and ClipEditorView, with both headers. Reproduce at the old
+docked heights; test minimum/saved heights, all tab hits, a note hit, optional strip
+and scrollbar, extra lanes, hide/show, reset, maximize/restore and docked Mixer. Keep
+the existing standalone lane tests. Capture before/after on the same actual host.
+Run the Windows build/smoke/scanner gate.
+
+## Risks & Considerations
+
+A higher panel minimum takes space from the main view and Mixer. Verify actual
+window bounds instead of checking only declared heights. No audio-thread or MIDI
+data changes are needed. Extension configuration has no hooks.
+
+## Open Questions
+
+Exact host minimum and window-fitting consequences will be established by layout tests.
diff --git a/.specify/bugs/docked-note-area/fix.md b/.specify/bugs/docked-note-area/fix.md
new file mode 100644
index 00000000..0cc127a4
--- /dev/null
+++ b/.specify/bugs/docked-note-area/fix.md
@@ -0,0 +1,52 @@
+# Bug Fix: Short docked MIDI editors lose their notes
+
+- **Slug**: docked-note-area (from assessment context)
+- **Fixed**: 2026-11-02
+- **Assessment**: ./assessment.md
+- **Status**: applied
+
+## Summary and Changes
+
+`MainWindow.Detail.cs` reserves a 300-pixel minimum for MIDI Clip content; other
+Detail content retains 120 pixels. Opening, default/reset heights and visibility
+restoration use the content-specific minimum. Existing splitter and edge dragging
+respect the row minimum, as does window fitting.
+
+`FitBottomPanels` also calculates the main-window minimum from visible panel minima
+and measured window chrome, bounded by the original window minimum. This prevents a
+docked Mixer from pushing the larger MIDI editor past the window's bottom. Hiding
+panels or maximizing the clip editor releases the extra minimum.
+
+The changelog, spec, plan and paired EN/RU manual handoff describe this resizing
+behavior. No new shortcuts or capability-list entries are needed. The external
+nota-docs checkout is absent; no site build is claimed.
+
+## Tests Added or Updated
+
+CCProbe now hosts the real ClipEditorView in the real MainWindow with both headers.
+It restores a 190-pixel preference, exercises hide/show, reset, maximize/restore,
+clip strip and scrollbar, extra CC lanes and the panel's edge drag. Actual hit tests
+and pointer events select a note and all five tabs. It checks the docked Mixer fits
+inside the window, hiding it restores the base minimum, and non-MIDI content keeps
+the previous minimum. Before/after captures use the full actual window bounds.
+
+## Local Verification
+
+Old code: `Docked layout: panel 190, roll 119, notes 0`; regression exits 1.
+Fixed code: `panel 300, roll 229, notes 104`, with 57 pixels of notes remaining when
+the optional clip strip, scrollbar and extra lanes are all present (over four default
+12-pixel note rows). The actual note-selection and tab-selection checks pass.
+Full results are recorded in test.md.
+
+## Deviations from Assessment
+
+Host testing exposed that panel minima together exceeded the original main-window
+minimum with a docked Mixer. The assessment anticipated this risk; the correction
+stays in MainWindow.Detail.cs and adds the required aggregate window minimum.
+The invariant tested is at least 48 pixels of reachable notes (four default rows),
+alongside actual note selection, rather than just checking a declared panel height.
+No extension hooks are registered.
+
+## Follow-ups
+
+Complete the Windows gate, attach full-window evidence and update PR #425.
diff --git a/.specify/bugs/docked-note-area/test.md b/.specify/bugs/docked-note-area/test.md
new file mode 100644
index 00000000..bab29dbc
--- /dev/null
+++ b/.specify/bugs/docked-note-area/test.md
@@ -0,0 +1,50 @@
+# Bug Verification: Short docked MIDI editors lose their notes
+
+- **Slug**: docked-note-area
+- **Tested**: 2026-11-02
+- **Assessment**: ./assessment.md
+- **Fix**: ./fix.md
+- **Result**: verified
+
+## Summary
+
+The real MainWindow and ClipEditorView reproduce a zero-height note viewport on
+the old code at a restored 190-pixel docked panel. The fix keeps notes and all
+five tabs usable, including with extra lanes, the clip strip, horizontal scrollbar
+and docked Mixer.
+
+## Checks Performed
+
+| Check | Command / Action | Result | Notes |
+| --- | --- | --- | --- |
+| Before-fix reproduction | Build `MainWindow.Detail.cs` from `a80d1654`, run expanded CCProbe | Expected failure, exit 1 | Panel 190, roll 119, notes 0 |
+| After-fix UI regression | `dotnet run --project specs/071-multiple-cc-lanes/validation/CCProbe.csproj -c Release -- specs/071-multiple-cc-lanes/validation` | Pass, exit 0 | 60 assertions, real docked host and pointer selection |
+| Fresh-process settings | `dotnet specs/071-multiple-cc-lanes/validation/bin/Release/net10.0/CCProbe.dll --read-lanes specs/071-multiple-cc-lanes/validation` | Pass, exit 0 | Lane heights still restore independently |
+| Windows build gate | `scripts/build-win.ps1` in VS developer PowerShell | Pass, exit 0 | Native and managed build, scanner self-test, smoke and scan-scale suites |
+| Diff check | `git diff --check` | Pass | No whitespace errors |
+| Visual comparison | Real MainWindow capture, same MIDI note and requested panel height | Pass | Before no notes; after note grid visible |
+
+## Output Excerpts
+
+Before: `Docked layout: panel 190, roll 119, notes 0`
+
+After: `Docked layout: panel 300, roll 229, notes 104`
+
+With clip strip, scrollbar and extra lanes: `notes 57, primary 72`.
+
+With Mixer: `window 869, panel bottom 847, notes 57`; note and all five tabs
+received real pointer hits and selection events. Hiding the Mixer restored the
+original 680-pixel window minimum; non-MIDI Detail content retained 120 pixels.
+
+`SMOKE TEST PASSED` / `SCAN SCALE PASSED`.
+
+## Residual Risks
+
+Windows x64 tested; macOS/Linux not run locally. The full app build reports existing
+warnings. With both panels docked, the window minimum grows to fit both; available
+desktop space depends on the screen. No extension hooks are registered.
+
+## Recommendation
+
+Accept the docked editor correction in PR #425; the original zero-note layout
+no longer reproduces.
diff --git a/.specify/bugs/folded-cc-gutter/assessment.md b/.specify/bugs/folded-cc-gutter/assessment.md
new file mode 100644
index 00000000..4d6dc515
--- /dev/null
+++ b/.specify/bugs/folded-cc-gutter/assessment.md
@@ -0,0 +1,50 @@
+# Bug Assessment: Folded CC lane gutter
+
+- **Slug**: folded-cc-gutter (generated from the report)
+- **Created**: 2026-11-02
+- **Source**: https://github.com/nota-daw/nota/pull/425#
+- **Verdict**: valid
+- **Severity**: high
+
+## Report
+
+The review reports that adding a controller lane to an already folded Drum Rack
+leaves its gutter at 48 pixels while the notes use 96, shifting edits to another beat.
+GitHub host policy: allowlisted; PR and review comments retrieved through GitHub's API.
+Review comment: https://github.com/nota-daw/nota/pull/425#discussion_r4441629915
+Approved issue #422 remains open and covers this correction to its lane implementation.
+
+## Symptom and reproduction
+
+1. Open a Drum Rack clip and enable Fold.
+2. Add a CC lane without changing the pad rows.
+3. Observe its left edge and click beneath a note: the lane starts 48 pixels too far left.
+4. Refresh the unchanged folded rows; the misalignment remains.
+
+## Suspected Code Paths and Root Cause
+
+High confidence: `PianoRollView.ControllerLanes.cs::AddControllerLane` initializes
+the new column with `KeysW`, then registers it for future updates only.
+`PianoRollView.Fold.cs::RebuildRows` returns early for unchanged rows before updating
+registered columns. `_rowsArePads` already records the current layout mode.
+
+## Proposed Remediation
+
+Initialize the column from `_rowsArePads ? FoldedPadKeysW : KeysW`. Keep registration
+in `_keyColumns` so later fold/unfold transitions continue to update it.
+
+Files likely to change: `src/managed/Nota.App/PianoRollView.ControllerLanes.cs`,
+`specs/071-multiple-cc-lanes/validation/Program.cs`, `validation.md`, and CHANGELOG.md.
+Add a real Avalonia regression covering addition after folding, unchanged-row refresh,
+pointer edits beneath a note, unfolding/refolding, and removal/readdition. Capture
+matching before/after images with the probe. Run the Windows build/smoke gate.
+
+## Risks & Considerations
+
+UI-only initialization fix; no new state, dependencies, public API or audio-thread work.
+Retain the normal 48-pixel melodic gutter and existing fold transitions. No manual,
+capability-list or shortcut changes: this restores the already documented alignment.
+
+## Open Questions
+
+None. Extension configuration has no hooks.
diff --git a/.specify/bugs/folded-cc-gutter/fix.md b/.specify/bugs/folded-cc-gutter/fix.md
new file mode 100644
index 00000000..b3e160d2
--- /dev/null
+++ b/.specify/bugs/folded-cc-gutter/fix.md
@@ -0,0 +1,43 @@
+# Bug Fix: Folded CC lane gutter
+
+- **Slug**: folded-cc-gutter (from the assessment context)
+- **Fixed**: 2026-11-02
+- **Assessment**: ./assessment.md
+- **Status**: applied
+
+## Summary
+
+New CC lane columns use the existing `_rowsArePads` state to select the same gutter
+as the note grid at construction. Registration for subsequent fold changes is retained.
+
+## Changes
+
+| File | Change |
+| --- | --- |
+| `src/managed/Nota.App/PianoRollView.ControllerLanes.cs` | Initialize the current gutter width |
+| `specs/071-multiple-cc-lanes/validation/Program.cs` | Add six real Avalonia regression assertions and capture folded layout |
+| `CHANGELOG.md` | Record the alignment correction |
+| `specs/071-multiple-cc-lanes/validation.md` | Record review follow-up evidence |
+
+## Tests Added or Updated
+
+The probe opens a folded Drum Rack before adding its CC lane, double-clicks beneath
+a beat-2 note and checks the saved CC point's beat. It also checks initial alignment,
+unchanged-row refresh, unfolding, refolding and removal/readdition.
+
+## Local Verification
+
+Before the fix, `dotnet run --project specs/071-multiple-cc-lanes/validation/CCProbe.csproj
+-c Release -- specs/071-multiple-cc-lanes/validation` fails with
+`click directly below a folded drum note writes CC at the same beat`.
+Matching screenshots are captured before the pointer edit. Post-fix results are in test.md.
+
+## Deviations from Assessment
+
+None. No extension hooks are registered. Nota design uses the existing gutter constants;
+the nota-docs audit requires no manual edit because this restores documented alignment.
+Capabilities and shortcuts are unchanged.
+
+## Follow-ups
+
+Run the expanded probe and Windows build gate, then push the existing PR branch.
diff --git a/.specify/bugs/folded-cc-gutter/test.md b/.specify/bugs/folded-cc-gutter/test.md
new file mode 100644
index 00000000..79cbe1fa
--- /dev/null
+++ b/.specify/bugs/folded-cc-gutter/test.md
@@ -0,0 +1,41 @@
+# Bug Verification: Folded CC lane gutter
+
+- **Slug**: folded-cc-gutter
+- **Tested**: 2026-11-02
+- **Assessment**: ./assessment.md
+- **Fix**: ./fix.md
+- **Result**: verified
+
+## Summary
+
+The original wrong-beat pointer edit reproduces before the fix and passes after it.
+All 22 UI assertions and the complete Windows build gate pass.
+
+## Checks Performed
+
+| Check | Command / Action | Result | Notes |
+| --- | --- | --- | --- |
+| Before-fix reproduction | Expanded CCProbe against `836f736c` app binaries | Expected failure | Double-click beneath beat-2 note writes at another beat |
+| Post-fix reproduction and UI regression | `dotnet run --project specs/071-multiple-cc-lanes/validation/CCProbe.csproj -c Release -- specs/071-multiple-cc-lanes/validation` | Pass, exit 0 | 22 assertions; actual layout, pointer events, CC callback and fold transitions |
+| Fresh-process restoration | `dotnet specs/071-multiple-cc-lanes/validation/bin/Release/net10.0/CCProbe.dll --read-lanes specs/071-multiple-cc-lanes/validation` | Pass, exit 0 | Saved lane heights restored |
+| Build and regression gate | `scripts/build-win.ps1` in VS developer PowerShell | Pass, exit 0 | Native + managed, scanner self-test, complete smoke and scan-scale suite; existing pinned CPM sources reused |
+| Whitespace | `git diff --check` | Pass | No whitespace errors |
+| Visual evidence | Matching Studio Light 1000 × 720 captures | Pass | Before gutter starts at 48; after aligns with notes at 96 |
+
+## Output Excerpts
+
+Before: `System.Exception: click directly below a folded drum note writes CC at the same beat`
+
+After: `click directly below a folded drum note writes CC at the same beat`
+
+`SMOKE TEST PASSED` and `SCAN SCALE PASSED`.
+
+## Residual Risks
+
+Windows x64 verified; macOS/Linux not run locally. Existing compiler warnings remain.
+The separate review finding concerning primary-lane tab reachability is outside this
+reported gutter correction and is not claimed resolved here. No extension hooks exist.
+
+## Recommendation
+
+Accept the folded-gutter correction in PR #425; the original interaction is verified.
diff --git a/.specify/bugs/primary-lane-tabs/assessment.md b/.specify/bugs/primary-lane-tabs/assessment.md
new file mode 100644
index 00000000..5466ce3c
--- /dev/null
+++ b/.specify/bugs/primary-lane-tabs/assessment.md
@@ -0,0 +1,54 @@
+# Bug Assessment: Primary lane tabs become unreachable
+
+- **Slug**: primary-lane-tabs (generated from the report)
+- **Created**: 2026-11-02
+- **Source**: https://github.com/nota-daw/nota/pull/425#
+- **Verdict**: valid
+- **Severity**: high
+
+## Report and symptom
+
+Shrinking the primary lane to 48 pixels hides its fifth tab behind the CC toolbar.
+Saved heights restore the same inaccessible controller selector.
+Review: https://github.com/nota-daw/nota/pull/425#discussion_r4441629908
+URL policy: github.com is allowlisted; fetched PR review through GitHub's API.
+Approved issue #422 remains open and covers the lane implementation being corrected.
+
+## Reproduction
+
+1. Drag the primary lane divider down until its row reaches 48 pixels.
+2. Try clicking the controller tab at y=60: the following toolbar receives the hit.
+3. Reopen the editor with a saved primary height of 48 and repeat.
+
+## Suspected Code Paths and Root Cause
+
+`PianoRollView.ControllerLanes.cs::FitControllerLanes` uses the generic 48-pixel
+minimum for the primary lane, including the available-space cap. `LaneTabs` in
+`PianoRollView.Expression.cs` draws five fixed rows within the original 72-pixel
+velocity height. Its last row is outside a 48-pixel control. Confidence: high.
+
+## Proposed Remediation
+
+Use `VelH` (72) as the primary row's minimum after both saved-height normalization
+and available-space fitting. Extra CC lanes retain the 48-pixel minimum. This also
+makes old saved values usable without changing the settings schema or tab geometry.
+
+Files likely to change: `PianoRollView.ControllerLanes.cs`, the existing CCProbe,
+CHANGELOG.md, the lane spec/plan/data model and validation report. Add bug fix/test
+reports here. Keep the documented workflow and shortcuts unchanged.
+
+Tests: real divider drag; actual visual hit testing and pointer selection of all five
+tabs; old saved heights loaded from disk into a reopened editor; short-window layout;
+extra lanes still shrink to 48; no MIDI commits. Capture matching before/after images.
+Run the complete Windows build gate and expanded UI probe.
+
+## Risks & Considerations
+
+The primary lane reserves 24 more pixels at minimum; check the existing short-editor
+note viewport guard. No engine, dependencies or settings migration is needed.
+The generic height helper still normalizes stored preferences to 48–480; the primary
+view imposes its stronger layout minimum. No extension hooks are registered.
+
+## Open Questions
+
+None.
diff --git a/.specify/bugs/primary-lane-tabs/fix.md b/.specify/bugs/primary-lane-tabs/fix.md
new file mode 100644
index 00000000..5c7d3d12
--- /dev/null
+++ b/.specify/bugs/primary-lane-tabs/fix.md
@@ -0,0 +1,41 @@
+# Bug Fix: Primary lane tabs become unreachable
+
+- **Slug**: primary-lane-tabs (from assessment context)
+- **Fixed**: 2026-11-02
+- **Assessment**: ./assessment.md
+- **Status**: applied
+
+## Summary and Changes
+
+`PianoRollView.ControllerLanes.cs::FitControllerLanes` clamps the final primary row
+height to the existing `VelH` (72 pixels), after saved preference normalization and
+available-space fitting. Extra CC rows still use the generic 48-pixel minimum.
+No preference migration is required. Spec, plan, data model and changelog reflect
+the distinction between saved values and the primary layout minimum.
+
+## Tests Added or Updated
+
+`CCProbe::CheckPrimaryLaneTabs` drives the divider, hit-tests all five tabs through
+the actual window visual tree and sends pointer events to select each mode. It
+reopens a short editor using preferences reloaded from disk, tests the controller
+tab again and checks the note viewport, extra lane minimum and absence of MIDI edits.
+It captures the same content before and after the fix for comparison.
+
+## Local Verification
+
+Before the fix, the expanded probe exits 1 with
+`Controller tab receives pointer hit after shrinking primary lane`.
+The definitive old-code run waits for the compositor's hit-test scene and reports
+`hit ContentPresenter`, `row 48`, confirming that the toolbar receives the hit.
+Post-fix checks and build results are recorded in test.md.
+
+## Deviations from Assessment
+
+None. Extension configuration has no hooks. Design uses existing tab geometry and
+the existing 72-pixel constant. The nota-docs audit needs no manual change: resizing
+and tab selection already have this documented workflow. FEATURES and shortcuts
+introduce no new capability or binding and need no changes.
+
+## Follow-ups
+
+Complete the Windows gate and regression checks, attach evidence and update PR #425.
diff --git a/.specify/bugs/primary-lane-tabs/test.md b/.specify/bugs/primary-lane-tabs/test.md
new file mode 100644
index 00000000..ec9c0dce
--- /dev/null
+++ b/.specify/bugs/primary-lane-tabs/test.md
@@ -0,0 +1,46 @@
+# Bug Verification: Primary lane tabs become unreachable
+
+- **Slug**: primary-lane-tabs
+- **Tested**: 2026-11-02
+- **Assessment**: ./assessment.md
+- **Fix**: ./fix.md
+- **Result**: verified
+
+## Summary
+
+The original controller-tab obstruction reproduces on the old code with a real
+window hit test. The fixed primary minimum keeps every tab clickable after dragging,
+mode changes, disk-restored preferences and reopening in a short window.
+
+## Checks Performed
+
+| Check | Command / Action | Result | Notes |
+| --- | --- | --- | --- |
+| Reproduction before fix | Temporarily build ControllerLanes.cs from `20cbc8f3`; run the expanded CCProbe | Expected failure, exit 1 | Controller tab's position hits toolbar ContentPresenter; row height 48 |
+| After fix / UI regression | `dotnet run --project specs/071-multiple-cc-lanes/validation/CCProbe.csproj -c Release -- specs/071-multiple-cc-lanes/validation` | Pass, exit 0 | 39 checks, including actual tab hits/selections, saved preferences and extra lane minimum |
+| Fresh process | `dotnet specs/071-multiple-cc-lanes/validation/bin/Release/net10.0/CCProbe.dll --read-lanes specs/071-multiple-cc-lanes/validation` | Pass, exit 0 | Existing independent heights still restore |
+| Full Windows gate | `scripts/build-win.ps1` in VS developer PowerShell | Pass, exit 0 | Native and managed build, scanner self-test, complete smoke suite, scan-scale |
+| Restored build | `dotnet build src/managed/Nota.App/Nota.App.csproj -c Release --nologo` | Pass | Restores fixed binaries after the old-code reproduction |
+| Whitespace | `git diff --check` | Pass | No whitespace errors |
+| Visual comparison | Studio Light, 1000 × 720, same clip and shrink gesture | Pass | Fifth tab visible after fix |
+
+## Output Excerpts
+
+Before: `Tab hit mismatch: expected Controller, hit ContentPresenter, tabs 0, 1, 47, 47, row 48, point 20, 710`
+
+After: `Controller tab receives pointer hit after shrinking primary lane`
+
+`reopened short editor clamps saved 48-pixel primary height to 72`
+
+`SMOKE TEST PASSED` / `SCAN SCALE PASSED`
+
+## Residual Risks
+
+Windows x64 tested; macOS/Linux not run locally. Existing compiler warnings remain.
+The harness waits for the compositor to publish new-window hit-test data before each
+tab check; without that wait a null target is a harness timing artifact.
+No extension hooks are registered.
+
+## Recommendation
+
+Accept this review correction in PR #425. All five primary tabs remain accessible.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 17524429..e3c6f141 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -102,6 +102,15 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
also clicked the stem. A note already at the default is left alone and a locked reference
clip's notes are never touched. Grabbing a stem by its cap no longer makes it jump to the pixel
you pressed: it moves from where it is.
+- **Multiple MIDI controller lanes** (#422): **+ lane** below the left sidebar entries
+ adds a CC lane. Each lane has an in-lane dropdown showing its controller name and
+ CC number, with **×** beside it to hide the lane without deleting MIDI data.
+ A **127 / 64 / 0** scale lines up with the curve on the left of each CC lane.
+ Extra lanes scroll vertically and share the notes' horizontal zoom and position.
+ Stacked clips scroll in their own strip when needed to keep notes accessible.
+- **Resizable piano-roll lanes** (#422): drag the divider above Velocity or any CC
+ lane to resize it independently. Heights are remembered when editors reopen and
+ Nota restarts; re-add the corresponding lane/controller to restore its height.
- **French interface and a Language setting**: Preferences → Appearance → **Language** lists
English and Français (each in its own name). The choice is saved and applies after a restart;
the row says so and offers a **Restart** button (the usual unsaved-changes prompt comes first).
@@ -296,6 +305,13 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
- **Windows playback cursor**: the Arrangement playhead now follows display frames,
interpolating the engine's rendered blocks instead of jumping on the UI polling timer.
Editing positions and audio timing remain tied to the engine transport.
+- **Docked MIDI clip editors** reserve enough height for notes and all five lane
+ tabs, including when restoring a small saved panel. The window minimum accounts
+ for both panels when the Mixer is also docked (#422).
+- **Resizing the primary piano-roll lane** keeps all five tabs reachable, including
+ after restoring a saved height. Extra CC lanes retain their smaller minimum (#422).
+- **CC lanes added to a folded Drum Rack** use the wider pad-name gutter immediately,
+ keeping their curves and pointer edits aligned with the notes (#422).
- **An armed audio track meters its input with monitoring off** (nota-daw/nota#352): arm a
track and its meter shows the level coming in (hardware input, or the source track it
records from) before and during a take, without hearing it. The meter reads the input
diff --git a/FEATURES.md b/FEATURES.md
index 644f3b9c..261b2ebf 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -483,8 +483,14 @@ docks as a panel under any of the three, or floats in its own window — see
Operator, Pentad, Consort). The sustain pedal holds released keys on every melodic built-in
(Keys and Mosaic model their own damper; drums ignore it); a re-struck held key restarts.
MCP `get_clip_controllers` / `set_clip_controller`.
+ - **Multiple controller lanes in the piano roll** — **+ lane** below the sidebar entries
+ adds independent CC lanes. Each lane has a controller-name/CC-number dropdown and
+ adjacent **×** to hide it while preserving data, plus a **127 / 64 / 0** value scale.
+ Extra lanes scroll vertically and share the notes' horizontal zoom and position.
+ Stacked clips scroll in their strip to keep notes visible. Drag the divider above Velocity
+ or a CC lane to resize it; heights return across editor reopening and restarts.
- **Controller lane in the piano roll** — the fifth tab of the lane under the notes edits
- any controller: click the active tab for a picker (the clip's controllers first, then
+ any controller: use its in-lane dropdown (the clip's controllers first, then
Sustain, Mod wheel, Pitch wheel, Channel pressure, Expression, Breath and **Other CC**).
Pedals (CC64–69) are on/off blocks — drag to draw, move or resize one on the grid (⌘ free),
double-click or Delete removes it; other controllers are a curve — drag to draw (⌥ for a
diff --git a/specs/071-multiple-cc-lanes/.gitignore b/specs/071-multiple-cc-lanes/.gitignore
new file mode 100644
index 00000000..73d31fd5
--- /dev/null
+++ b/specs/071-multiple-cc-lanes/.gitignore
@@ -0,0 +1,7 @@
+validation/*.log
+validation/*.png
+validation/probe-data/
+validation/results.json
+validation/cc-results.json
+validation/lane-height-expected.json
+validation/Capture/evidence/
diff --git a/specs/071-multiple-cc-lanes/checklists/requirements.md b/specs/071-multiple-cc-lanes/checklists/requirements.md
new file mode 100644
index 00000000..900ed32f
--- /dev/null
+++ b/specs/071-multiple-cc-lanes/checklists/requirements.md
@@ -0,0 +1,10 @@
+<!-- SPDX-License-Identifier: AGPL-3.0-only -->
+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->
+
+# Specification quality checklist
+
+- [x] Approved issue, bounded user outcomes and acceptance scenarios identified.
+- [x] Requirements and success criteria are testable and unambiguous.
+- [x] Edge cases, persistence, MIDI safety and deferred issue scope are explicit.
+- [x] Native themes/localization and existing app behavior are preserved.
+- [x] No unresolved clarification markers; ready for implementation.
diff --git a/specs/071-multiple-cc-lanes/contracts/lanes.md b/specs/071-multiple-cc-lanes/contracts/lanes.md
new file mode 100644
index 00000000..54f68c28
--- /dev/null
+++ b/specs/071-multiple-cc-lanes/contracts/lanes.md
@@ -0,0 +1,14 @@
+<!-- SPDX-License-Identifier: AGPL-3.0-only -->
+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->
+
+# UI and editing contract
+
++ appends a controller view. Each picker changes only its lane. Minus hides that view
+and preserves all MIDI. Clearing is the existing explicit controller context action.
+Every lane shares BeatToX/XToBeat, active clip selection and cache reloads.
+StoreController(controller, points) remains the sole existing commit boundary.
+
+Upper dividers resize only their own primary/extra row. Up grows, down shrinks;
+release saves heights. Resizing never changes notes, CC values, selection or undo.
+Overflow scrolls while notes and the primary lane remain usable. The Shortcuts pane
+must describe the divider. All controls retain the app's themes and localization.
diff --git a/specs/071-multiple-cc-lanes/data-model.md b/specs/071-multiple-cc-lanes/data-model.md
new file mode 100644
index 00000000..71dfcfbf
--- /dev/null
+++ b/specs/071-multiple-cc-lanes/data-model.md
@@ -0,0 +1,16 @@
+<!-- SPDX-License-Identifier: AGPL-3.0-only -->
+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->
+
+# Data model
+
+ExtraControllerLane owns a ControllerLane, Grid row, divider container and reusable
+slot index. Controller points remain in the active clip and existing shared cache.
+Removing the row releases its gesture/gutter references; it never edits the model.
+
+Settings.PianoRollLaneHeights maps mode/controller keys to logical pixel heights.
+Defaults remain 72/112; finite heights clamp to 48–480. Missing or malformed values
+fall back safely. The primary row applies a separate 72-pixel layout minimum after
+fitting available space; old saved 48-pixel values remain readable without a migration.
+Extra keys contain slot plus controller, allowing duplicates to
+retain independent sizes. Save after a completed divider gesture. The visible extra
+lane list is editor-local and is not persisted by this contribution.
diff --git a/specs/071-multiple-cc-lanes/manual-handoff.md b/specs/071-multiple-cc-lanes/manual-handoff.md
new file mode 100644
index 00000000..771933ad
--- /dev/null
+++ b/specs/071-multiple-cc-lanes/manual-handoff.md
@@ -0,0 +1,35 @@
+<!-- SPDX-License-Identifier: AGPL-3.0-only -->
+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->
+
+# User manual handoff
+
+The local EN/RU piano-roll pages were updated for the in-lane redesign. A paired
+patch is included in `specs/083-inline-cc-controls/manual.patch` for submission to
+the separate nota-docs repository; this PR only updates the existing app branch.
+Validation status is recorded in that feature's validation report.
+
+## English
+
+Use **+ lane** beneath the left sidebar entries to add controller lanes. Each lane's
+dropdown shows the controller name and CC number. The adjacent **×** hides the lane
+and preserves its MIDI data. The **127 / 64 / 0** scale follows the graph on the left.
+Extra lanes scroll vertically and share the notes' horizontal position
+and zoom. Drag the divider above Velocity or a CC lane to resize it. Heights are
+remembered when you reopen/restart and re-add the corresponding lane/controller.
+The docked MIDI Clip panel stops shrinking while notes and all five lane tabs are
+still usable. With the Mixer also docked, the window's minimum height grows to fit
+both panels; hiding the Mixer releases that extra minimum.
+
+## Русский
+
+Кнопка **+ lane** под списком слева добавляет дорожки MIDI-контроллеров. Внутри каждой
+дорожки есть список с именем контроллера и номером CC. Кнопка **×** рядом скрывает
+дорожку, сохраняя MIDI-данные. Слева от графика расположена шкала **127 / 64 / 0**.
+Дополнительные дорожки
+прокручиваются по вертикали и используют горизонтальную позицию и масштаб нот.
+Перетащите разделитель над Velocity или дорожкой CC, чтобы изменить её высоту.
+Высота сохраняется после повторного открытия и перезапуска, когда вы снова добавляете
+соответствующую дорожку с тем же контроллером.
+При уменьшении закреплённой панели MIDI-клипа ноты и все пять вкладок остаются
+доступными. Если микшер тоже закреплён, минимальная высота окна увеличивается,
+чтобы вместить обе панели; скрытие микшера снимает это дополнительное ограничение.
diff --git a/specs/071-multiple-cc-lanes/plan.md b/specs/071-multiple-cc-lanes/plan.md
new file mode 100644
index 00000000..30d1faf4
--- /dev/null
+++ b/specs/071-multiple-cc-lanes/plan.md
@@ -0,0 +1,53 @@
+<!-- SPDX-License-Identifier: AGPL-3.0-only -->
+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->
+
+# Plan: multiple MIDI CC lanes and saved heights
+
+Date: 2026-11-02. Approved issue: #422. Spec: spec.md.
+C# / .NET 10, existing Avalonia and settings services; no new dependencies.
+Audio-thread impact: none. No native, DSP, ABI, routing or file-format changes.
+
+## Decisions and implementation
+
+Give ControllerLane an optional per-instance controller identity; preserve its
+fallback for the primary lane. Parameterize the existing picker by a callback.
+Reuse StoreController and the shared cache, cancelling pending gestures/capture on
+reload, change or removal. Invalidate all lanes on data/view changes. Register each
+extra gutter with the existing key-column registry and remove it with the lane.
+Use a native plus toolbar, per-lane picker/minus and bounded vertical scroll area.
+
+Wrap the primary and extra lanes in captured upper dividers. Store stable logical
+height keys for the primary mode and extra slot/controller; clamp finite heights to
+48–480 and use original defaults otherwise. The primary row's final layout must be
+at least 72 pixels so all five tabs fit, even after available-space fitting or loading
+an older 48-pixel preference. Extra lanes keep the 48-pixel minimum.
+Save on release, not on every move.
+Fit lanes to the available height while retaining note editing. Inject the existing
+settings service into both Arrangement and Session editor construction paths.
+The MIDI Clip host reserves at least 300 logical pixels, including its 32-pixel
+Detail toolbar and 38-pixel clip header. Apply that minimum on opening, saved-height
+restoration and visibility restoration; existing splitter/edge/fit paths respect it.
+Fit the main-window minimum to the visible panel minima plus window chrome so a
+docked Mixer cannot push the editor beyond the window. Restore the original minimum
+when the panels no longer require the extra space. Validate through MainWindow,
+including pointer access to notes/tabs, rather than only a standalone roll.
+
+Update CHANGELOG [Unreleased], FEATURES, French strings and the divider row in
+Preferences > Shortcuts. The external manual repo is absent; include paired EN/RU
+handoff. Preserve native/theme/identity, workspace, zoom and velocity source behavior.
+
+## Validation and evidence
+
+A real Windows Avalonia probe exercises add/hide/reload/cache/commits and pointer
+resizing, independent saved heights, old settings and short-window overflow. The
+smoke test covers normalization and preference serialization. Run build-win.ps1.
+Capture the same controller data, size, scale and Studio Dark theme at the official
+base and on this branch. Put images on the fork's existing pr-assets branch; exclude
+images, logs, benchmark output and harness binaries from the contribution.
+
+## Constitution check
+
+Approved open issue #422 verified via GitHub API before this branch's changes.
+Existing audio and pure-C boundaries untouched; AGPL headers on new files; no new
+dependency. One bounded logical change; fresh build/test and convergence required.
+No extension hooks are configured. Docs site absence is disclosed in the PR.
diff --git a/specs/071-multiple-cc-lanes/quickstart.md b/specs/071-multiple-cc-lanes/quickstart.md
new file mode 100644
index 00000000..dc9ee47d
--- /dev/null
+++ b/specs/071-multiple-cc-lanes/quickstart.md
@@ -0,0 +1,20 @@
+<!-- SPDX-License-Identifier: AGPL-3.0-only -->
+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->
+
+# Validation
+
+From Developer PowerShell, run scripts/build-win.ps1. Build and run the Windows UI
+probe:
+
+```powershell
+dotnet build specs/071-multiple-cc-lanes/validation/CCProbe.csproj -c Release
+dotnet specs/071-multiple-cc-lanes/validation/bin/Release/net10.0/CCProbe.dll specs/071-multiple-cc-lanes/validation
+dotnet specs/071-multiple-cc-lanes/validation/bin/Release/net10.0/CCProbe.dll --read-lanes specs/071-multiple-cc-lanes/validation
+```
+
+Open a MIDI clip, add three lanes, pick Mod wheel / Expression / Sustain, and edit
+independently. Hide and re-add a lane: points remain. Zoom/scroll and undo/reload;
+all lanes follow. Add many lanes in a short editor: the overflow scrolls.
+Drag Velocity and two extra dividers to different heights. Reopen and re-add those
+lanes, then restart; sizes return. Resize and visibility changes create no MIDI edits.
+Check Studio Dark/Light and the divider row in Settings > Shortcuts.
diff --git a/specs/071-multiple-cc-lanes/research.md b/specs/071-multiple-cc-lanes/research.md
new file mode 100644
index 00000000..bfb11537
--- /dev/null
+++ b/specs/071-multiple-cc-lanes/research.md
@@ -0,0 +1,15 @@
+<!-- SPDX-License-Identifier: AGPL-3.0-only -->
+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->
+
+# Research
+
+- Reuse ControllerLane and StoreController: they already implement switch blocks,
+ continuous points and the clip's undo boundary. Duplicate editing code would drift.
+- Use optional per-instance controller plus callback picker; primary behavior stays
+ unchanged. Generation checks prevent stale picker/context actions after reload.
+- Capture lane divider pointers independently from note/CC edit gestures. Persist
+ only on release; layout changes must never commit MIDI.
+- Application preferences are the current persistence mechanism. Key an extra
+ height by its lane slot and controller so duplicate controller views stay independent.
+- Reuse existing CPU-safe presentation behavior. No playhead, engine or theme changes
+ are needed. Workspace, deeper zoom and portable app naming are separate local work.
diff --git a/specs/071-multiple-cc-lanes/spec.md b/specs/071-multiple-cc-lanes/spec.md
new file mode 100644
index 00000000..b424a935
--- /dev/null
+++ b/specs/071-multiple-cc-lanes/spec.md
@@ -0,0 +1,69 @@
+<!-- SPDX-License-Identifier: AGPL-3.0-only -->
+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->
+
+# Feature specification: multiple MIDI CC lanes and saved heights
+
+Approved issue: [nota-daw/nota#422](https://github.com/nota-daw/nota/issues/422).
+Date: 2026-11-02. Branch: feat/multiple-midi-cc-lanes.
+
+## User scenarios and acceptance
+
+### US1 — Edit several controllers together (P1)
+Use + below the piano roll to add three lanes. Each has its own controller picker,
+continuous/switch editor, shared timeline and existing undo boundary. The primary
+Velocity/MPE/controller lane remains available. Changes target only the chosen CC.
+
+### US2 — Hide a lane without deleting music (P1)
+Use a lane's minus control to hide it; re-add its controller and see identical MIDI
+points. Undo/reload or changing the active clip cancels stale gestures and refreshes
+all visible lanes. Many lanes scroll while leaving notes usable in a short window.
+
+### US3 — Resize lanes independently (P1)
+Drag the upper boundary of Velocity or an individual CC lane. Other lane heights,
+notes, controller values and undo history remain unchanged. Reopen the editor or
+restart the app, re-add the same lane slots/controllers, and recover saved heights.
+
+## Functional requirements
+
+- FR-001: Add native plus/minus controls and independent controller selection.
+- FR-002: Reuse the current CC editor and its existing commit/undo callbacks.
+- FR-003: All lanes share active-clip mapping, cache, horizontal zoom and scroll.
+- FR-004: Hiding/reselecting/reloading cancels stale gestures without deleting MIDI.
+- FR-005: Bound overflow with scrolling, keeping notes and the primary lane usable.
+- FR-006: Independently resize primary/extra lanes within readable bounds; persist
+ sizes in application preferences, tolerating old or invalid settings.
+- FR-007: Follow existing Studio controls, all official themes and localization;
+ update the Shortcuts reference for the divider gesture.
+- FR-008: Preserve engine/ABI, transport/playheads, zoom limits, note geometry,
+ workspace activation and official app identity. Add no dependency.
+- FR-009: Pass Windows build/smoke and real-window regression checks.
+
+## Success criteria
+
+- SC-001: Three distinct controller lanes are visible and independently editable.
+- SC-002: Removing/re-adding lanes leaves MIDI byte-identical; each edit uses one
+ existing commit callback and preserves unrelated controllers/notes.
+- SC-003: Many lanes scroll in a short window while notes stay usable; cache reloads
+ and gutter alignment follow the active editor.
+- SC-004: Velocity and two CC lanes retain independent sizes after reopening and
+ reading saved settings in another process; malformed sizes remain readable.
+- SC-005: Theme/localization/shortcut guards, real UI probes and Windows smoke pass.
+
+## Clarification and scope
+
+This PR implements the multiple-lane and independent-resizing portion of approved
+issue #422. Reordering, a separate collapse control, and persisting which extra lanes
+are visible are deferred; use Refs #422 rather than closing the whole issue.
+Extra lane slots are editor-local; sizes are preferences, not MIDI/project edits.
+Reserved controllers retain the current picker's restrictions. A hidden lane may be
+re-added; no data is cleared. Default primary/extra heights remain 72/112 logical
+pixels, with saved sizes normalized to 48–480. The primary row additionally keeps a
+72-pixel display minimum so all five tabs remain reachable, including in short editors
+and when restoring older saved sizes. Extra lanes retain a 48-pixel minimum.
+The docked MIDI Clip panel has a 300-pixel minimum, including both headers, to keep
+a usable note viewport alongside the lane controls. Other Detail tabs retain their
+existing minimum. The main window's minimum accounts for visible panel minima when
+the Mixer is docked too; hiding panels releases the extra minimum.
+No new key binding is introduced.
+The personal workspace/zoom changes and named portable build stay outside this PR.
+No additional user clarification is needed for this bounded contribution.
diff --git a/specs/071-multiple-cc-lanes/tasks.md b/specs/071-multiple-cc-lanes/tasks.md
new file mode 100644
index 00000000..e860c27d
--- /dev/null
+++ b/specs/071-multiple-cc-lanes/tasks.md
@@ -0,0 +1,29 @@
+<!-- SPDX-License-Identifier: AGPL-3.0-only -->
+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->
+
+# Tasks: multiple CC lanes and saved heights
+
+## Setup
+- [x] T001 Verify approved issue #422, clarify contribution scope and complete spec/plan/contracts.
+
+## US1 — Independent lanes
+- [x] T002 [US1] Port per-instance identity, picker callback and existing commit path in PianoRollView.Controllers.cs.
+- [x] T003 [US1] Add plus/picker/minus and synchronized scrolling in PianoRollView.ControllerLanes.cs and PianoRollView.cs.
+
+## US2 — Safe hiding and reload
+- [x] T004 [US2] Cancel stale gestures/capture and synchronize caches/gutters in PianoRollView.Controllers.cs and ControllerLanes.cs.
+- [x] T005 [US2] Exercise data preservation, commits, reloads and short-window overflow in validation/Program.cs.
+
+## US3 — Saved independent sizes
+- [x] T006 [US3] Port dividers, normalized preferences and settings injection in ControllerLanes.cs, MainWindow.Detail.cs, Settings.cs and MidiLaneHeight.cs.
+- [x] T007 [US3] Add normalization/JSON smoke tests and actual pointer/persistence checks in tests/Nota.SmokeTest and validation/Program.cs.
+
+## Polish and submission
+- [x] T008 Update CHANGELOG [Unreleased], FEATURES, French strings, Shortcuts and EN/RU manual handoff.
+- [x] T009 Capture comparable base/branch UI evidence into pr-assets, and inspect it.
+- [x] T010 Run scripts/build-win.ps1, UI checks and convergence; record validation.md.
+- [x] T011 Commit scoped source/spec changes under the configured identity, push the fork over HTTPS and open a PR against upstream develop referencing #422.
+
+Dependencies: T001 -> T002-T004 -> T006 -> T005/T007 -> T008-T010 -> T011.
+
+Submitted as [nota-daw/nota#425](https://github.com/nota-daw/nota/pull/425) against develop.
diff --git a/specs/071-multiple-cc-lanes/validation.md b/specs/071-multiple-cc-lanes/validation.md
new file mode 100644
index 00000000..f14616b2
--- /dev/null
+++ b/specs/071-multiple-cc-lanes/validation.md
@@ -0,0 +1,108 @@
+<!-- SPDX-License-Identifier: AGPL-3.0-only -->
+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->
+
+# Validation: multiple CC lanes and saved heights
+
+Date: 2026-11-02. Base: official develop `535da00f`.
+Approved issue: [#422](https://github.com/nota-daw/nota/issues/422).
+
+## Results
+
+- `scripts/build-win.ps1`: PASS, exit 0, native scanner self-test, Release managed
+ build (zero errors), complete `SMOKE TEST PASSED` and `SCAN SCALE PASSED`.
+- Real Windows Avalonia probe: 16 checks PASS. Covers distinct controller views,
+ continuous/switch controllers, removal/re-add data preservation, existing single
+ commit routing, stale-gesture cancellation, shared gutters, zoom/scroll, short
+ windows, real pointer resizing, duplicate-controller heights and editor reopening.
+- Fresh process: PASS, saved lane heights restored through SettingsService.
+- Lane-height normalization/serialization smoke checks: PASS in the complete suite.
+- Studio Dark and Studio Light rendered. Existing design/localization guards pass;
+ French covers every new label and the divider gesture is in Shortcuts.
+- Before/after screenshots: same 1100x850 window, Studio Dark, 100% scale, note data
+ and CC1/CC11/CC64 data. Captured from separate base/branch binaries and inspected.
+- Native/ABI, transport/playheads, themes, zoom bounds, velocity drawing/picking,
+ workspace activation and app identity have no changes in this contribution.
+- `git diff --check`: PASS. Existing unrelated compiler warnings remain.
+
+Capture source: `validation/Capture/`. Images live on the fork's `pr-assets` branch:
+
+- [Before](https://raw.githubusercontent.com/thoi1/nota/pr-assets/issue-422/cc-lanes-before.png)
+- [After](https://raw.githubusercontent.com/thoi1/nota/pr-assets/issue-422/cc-lanes-after.png)
+
+The capture and regression harness sources are included; logs, generated images,
+probe data and binaries are excluded from the code branch.
+
+## Convergence
+
+Converged: nine functional requirements, five success criteria, three user stories,
+implementation tasks and plan decisions checked against source and fresh evidence.
+No missing, partial, conflicting or unrequested work remains in the specified PR
+scope. Submission task T011 is complete: [PR #425](https://github.com/nota-daw/nota/pull/425) targets develop.
+No extension hooks are registered.
+
+This is a partial implementation of issue #422: lane reordering, a dedicated collapse
+control, and persistence of which extra lanes are visible remain follow-up work.
+The current picker retains its reserved-controller restrictions. Lane sizes persist
+by mode or extra-lane slot/controller; the extra view list itself is editor-local.
+
+## PR #425 folded Drum Rack review correction
+
+The expanded probe reproduces the reported bug on commit `836f736c`: a double-click
+directly beneath a beat-2 drum note fails to write its CC point at beat 2. Initializing
+new columns from the current pad-row state fixes it. All 22 UI checks pass, including
+the six new checks for pointer beat mapping, immediate alignment, unchanged-row refresh,
+unfold/refold and removal/readdition. Fresh-process height restoration also passes.
+The full `scripts/build-win.ps1` gate passes again, including the native scanner
+self-test, complete smoke suite and scan-scale check.
+
+Matching Studio Light captures (1000 × 720, identical clip, before the pointer edit):
+[before](https://raw.githubusercontent.com/thoi1/nota/pr-assets/issue-422/folded-cc-before.png),
+[after](https://raw.githubusercontent.com/thoi1/nota/pr-assets/issue-422/folded-cc-after.png).
+Assessment, fix and verification records: `.specify/bugs/folded-cc-gutter/`.
+
+## PR #425 primary lane tab correction
+
+The primary row now has a 72-pixel layout minimum after available-space fitting,
+including when restoring an older 48-pixel preference. Extra CC lanes keep their
+48-pixel minimum. The expanded probe performs actual window hit testing and pointer
+selection for all five tabs after dragging the divider; it repeats the controller
+selection in a short reopened editor with disk-restored settings. It also checks the
+note viewport, extra lane minimum and absence of controller commits.
+
+The corrected harness fails against `20cbc8f3`: the controller-tab position hits the
+toolbar's ContentPresenter with a 48-pixel primary row. The fixed implementation passes
+all 39 UI assertions, and the full Windows build/smoke/scan-scale gate passes again.
+Assessment and evidence: `.specify/bugs/primary-lane-tabs/`.
+
+Matching Studio Light captures (1000 × 720, identical clip and divider drag):
+[before](https://raw.githubusercontent.com/thoi1/nota/pr-assets/issue-422/primary-tabs-before.png),
+[after](https://raw.githubusercontent.com/thoi1/nota/pr-assets/issue-422/primary-tabs-after.png).
+
+## PR #425 docked note-area correction
+
+The real MainWindow/ClipEditorView regression reproduces the issue on `a80d1654`:
+a 190-pixel docked panel leaves a 119-pixel roll and a zero-height note viewport.
+The MIDI-specific 300-pixel host minimum instead leaves a 104-pixel note viewport;
+with clip strip, horizontal scrollbar and extra lanes present it still leaves 57
+pixels (over four default note rows). The primary tabs retain their 72-pixel minimum.
+
+All 60 UI checks pass. The 21 new checks include real note selection and all five
+tab selections through window hit testing, restored/default/hidden/maximized panels,
+extra lane overflow, actual panel-edge dragging, a docked Mixer fitting inside the
+window, restoration of the ordinary window minimum after hiding the Mixer, and the
+unchanged minimum for non-MIDI content. Saved lane heights still restore in a fresh
+process. The full Windows build/smoke/scanner gate is recorded in the bug report.
+
+Matching full-window Studio Light evidence (1200 × 711 render bounds; identical
+clip and requested 190-pixel panel height):
+[before](https://raw.githubusercontent.com/thoi1/nota/pr-assets/issue-422/docked-notes-before.png),
+[after](https://raw.githubusercontent.com/thoi1/nota/pr-assets/issue-422/docked-notes-after.png).
+Assessment and verification: `.specify/bugs/docked-note-area/`.
+
+## Limits
+
+Windows x64 was built and exercised; macOS/Linux and physical mixed-DPI monitor moves
+were not tested. The sibling nota-docs checkout is absent. Paired English/Russian
+manual updates are in `manual-handoff.md`; no external manual-site build is claimed.
+This UI contribution changes no audio thread or render-pool code and makes no DSP
+performance claim; the complete smoke suite includes the existing performance guards.
diff --git a/specs/071-multiple-cc-lanes/validation/CCProbe.csproj b/specs/071-multiple-cc-lanes/validation/CCProbe.csproj
new file mode 100644
index 00000000..26b6ab0b
--- /dev/null
+++ b/specs/071-multiple-cc-lanes/validation/CCProbe.csproj
@@ -0,0 +1,15 @@
+<!-- SPDX-License-Identifier: AGPL-3.0-only -->
+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <OutputType>Exe</OutputType><TargetFramework>net10.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable><UseAppHost>false</UseAppHost>
+ <NotaBinaries>$(MSBuildThisFileDirectory)..\..\..\src\managed\Nota.App\bin\Release\net10.0</NotaBinaries>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Remove="Capture/**" />
+ <FrameworkReference Include="Microsoft.AspNetCore.App" />
+ <Reference Include="$(NotaBinaries)\*.dll" Exclude="$(NotaBinaries)\nota_engine.dll" />
+ <None Include="$(NotaBinaries)\nota_engine.dll;$(NotaBinaries)\runtimes\win-x64\native\*.dll" Link="%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
+ </ItemGroup>
+</Project>
diff --git a/specs/071-multiple-cc-lanes/validation/Capture/LaneCapture.csproj b/specs/071-multiple-cc-lanes/validation/Capture/LaneCapture.csproj
new file mode 100644
index 00000000..6b2f8727
--- /dev/null
+++ b/specs/071-multiple-cc-lanes/validation/Capture/LaneCapture.csproj
@@ -0,0 +1,17 @@
+<!-- SPDX-License-Identifier: AGPL-3.0-only -->
+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>net10.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ <UseAppHost>false</UseAppHost>
+ <NotaBinaries Condition="'$(NotaBinaries)' == ''">$(MSBuildThisFileDirectory)..\..\..\..\src\managed\Nota.App\bin\Release\net10.0</NotaBinaries>
+ </PropertyGroup>
+ <ItemGroup>
+ <FrameworkReference Include="Microsoft.AspNetCore.App" />
+ <Reference Include="$(NotaBinaries)\*.dll" Exclude="$(NotaBinaries)\nota_engine.dll" />
+ <None Include="$(NotaBinaries)\nota_engine.dll;$(NotaBinaries)\runtimes\win-x64\native\*.dll" Link="%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
+ </ItemGroup>
+</Project>
diff --git a/specs/071-multiple-cc-lanes/validation/Capture/Program.cs b/specs/071-multiple-cc-lanes/validation/Capture/Program.cs
new file mode 100644
index 00000000..b1f69e0d
--- /dev/null
+++ b/specs/071-multiple-cc-lanes/validation/Capture/Program.cs
@@ -0,0 +1,71 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+using System.Reflection;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Controls.ApplicationLifetimes;
+using Avalonia.Media;
+using Avalonia.Media.Imaging;
+using Avalonia.Threading;
+using Nota.App;
+using Nota.Application;
+
+internal static class Program
+{
+ const BindingFlags Hidden = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
+ [STAThread] static int Main(string[] args)
+ {
+ string output=Path.GetFullPath(args[0]);
+ Directory.CreateDirectory(Path.GetDirectoryName(output)!);
+ Environment.SetEnvironmentVariable("NOTA_DATA_DIR",output+"-data");
+ var lifetime=new ClassicDesktopStyleApplicationLifetime {ShutdownMode=ShutdownMode.OnExplicitShutdown};
+ AppBuilder.Configure<Nota.App.App>().UseWin32().UseSkia().UseHarfBuzz().WithNotaFonts().SetupWithLifetime(lifetime);
+ var settings=(ISettingsService)App.Services.GetService(typeof(ISettingsService))!;
+ settings.Current.ShowWelcomeOnStartup=false;settings.Current.CheckForUpdates=false;settings.Current.LastSeenVersion=AppInfo.Version;
+ using var stop=new CancellationTokenSource();Exception? failure=null;bool done=false;
+ DispatcherTimer.RunOnce(()=>
+ {
+ try
+ {
+ typeof(MainWindow).Assembly.GetType("Nota.App.NotaThemeService")!.GetMethod("Set",BindingFlags.Public|BindingFlags.Static)!
+ .Invoke(null,[new AppearanceChoice(false,"studio-dark","studio-dark","studio-light")]);
+ var roll=new PianoRollView();
+ roll.SetNotes([new NotaNote(60,0,2,.55f),new NotaNote(64,2,1,.8f),new NotaNote(67,4,2,.7f),new NotaNote(62,6,1,.6f)],8);
+ var data=new Dictionary<int,AutomationPoint[]>
+ {
+ [1]=[new(0,.15f),new(2,.7f),new(4,.9f),new(6,.3f),new(8,.5f)],
+ [11]=[new(0,.3f),new(2,.8f),new(4,.6f),new(6,.95f),new(8,.4f)],
+ [64]=[new(0,1),new(1.5,0),new(4,1),new(5.5,0)],
+ };
+ roll.ControllersInClip=()=>data.Keys.ToArray();roll.GetController=c=>data.GetValueOrDefault(c,[]);
+ var window=new Window {Content=roll,Width=1100,Height=850,Background=(IBrush)Avalonia.Application.Current!.Resources["Brush.BgApp"]!};
+ window.Show();window.UpdateLayout();
+ var add=typeof(PianoRollView).GetMethod("AddControllerLane",Hidden);
+ if(add is not null)
+ {
+ for(int i=0;i<3;i++)add.Invoke(roll,null);
+ typeof(PianoRollView).GetMethod("ResizeLane",Hidden)!.Invoke(roll,["Velocity",122.0]);
+ }
+ typeof(PianoRollView).GetField("_pixelsPerBeat",Hidden)!.SetValue(roll,125.0);
+ typeof(PianoRollView).GetMethod("SetScrollBeats",Hidden)!.Invoke(roll,[0.0]);
+ window.UpdateLayout();
+ double pitchY=(double)typeof(PianoRollView).GetMethod("PitchY",Hidden)!.Invoke(roll,[60])!;
+ var scroll=(ScrollViewer)typeof(PianoRollView).GetField("_bodyScroll",Hidden)!.GetValue(roll)!;
+ scroll.Offset=new Vector(0,Math.Max(0,pitchY-150));window.UpdateLayout();
+ using var bitmap=new RenderTargetBitmap(new PixelSize(1100,850));bitmap.Render(window);bitmap.Save(output);
+ window.Close();
+ Dispatcher.UIThread.Post(()=>
+ {
+ typeof(MainWindow).GetField("_closeConfirmed",Hidden)!.SetValue(lifetime.MainWindow,true);
+ lifetime.MainWindow!.Close();done=true;stop.Cancel();
+ },DispatcherPriority.Background);
+ }
+ catch(Exception error){failure=error;stop.Cancel();}
+ },TimeSpan.FromMilliseconds(900));
+ using var watchdog=new Timer(_=>Dispatcher.UIThread.Post(()=>stop.Cancel()),null,15000,Timeout.Infinite);
+ Dispatcher.UIThread.MainLoop(stop.Token);
+ if(failure is not null){Console.Error.WriteLine(failure);return 1;}
+ if(!done){Console.Error.WriteLine("Capture timed out");return 1;}
+ Console.WriteLine(output);return 0;
+ }
+}
diff --git a/specs/071-multiple-cc-lanes/validation/Program.cs b/specs/071-multiple-cc-lanes/validation/Program.cs
new file mode 100644
index 00000000..13bd2591
--- /dev/null
+++ b/specs/071-multiple-cc-lanes/validation/Program.cs
@@ -0,0 +1,503 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+using System.Collections;
+using System.Reflection;
+using System.Text.Json;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Controls.ApplicationLifetimes;
+using Avalonia.Controls.Primitives;
+using Avalonia.Interactivity;
+using Avalonia.Input;
+using Avalonia.Media.Imaging;
+using Avalonia.Media;
+using Avalonia.Threading;
+using Avalonia.VisualTree;
+using Nota.App;
+using Nota.Application;
+using Nota.Application.Editing;
+using Nota.Presentation;
+
+internal static class Program
+{
+ const BindingFlags Hidden = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
+ static object? Get(object o, string n) => o.GetType().GetField(n, Hidden)!.GetValue(o);
+ static object? Call(object o, string n, params object[] a) => o.GetType().GetMethod(n, Hidden)!.Invoke(o,a);
+ [STAThread] static int Main(string[] args)
+ {
+ if(args[0]=="--read-lanes")
+ {
+ string root=Path.GetFullPath(args[1]);
+ Environment.SetEnvironmentVariable("NOTA_DATA_DIR",Path.Combine(root,"probe-data"));
+ var expected=JsonSerializer.Deserialize<Dictionary<string,double>>(File.ReadAllText(Path.Combine(root,"lane-height-expected.json")))!;
+ var actual=new Nota.Infrastructure.SettingsService().Current.PianoRollLaneHeights;
+ bool restored=expected.Count>=3 && expected.All(pair=>actual.GetValueOrDefault(pair.Key)==pair.Value);
+ Console.WriteLine(restored?"Fresh process restores independent lane heights":"Lane-height restart failed");
+ return restored?0:1;
+ }
+ try { Run(Path.GetFullPath(args[0])); return 0; } catch(Exception e) { Console.Error.WriteLine(e); return 1; }
+ }
+ static void Run(string root)
+ {
+ Directory.CreateDirectory(root);
+ Environment.SetEnvironmentVariable("NOTA_DATA_DIR", Path.Combine(root,"probe-data"));
+ var lifetime = new ClassicDesktopStyleApplicationLifetime { ShutdownMode = ShutdownMode.OnExplicitShutdown };
+ AppBuilder.Configure<Nota.App.App>().UseWin32().UseSkia().UseHarfBuzz().WithNotaFonts().SetupWithLifetime(lifetime);
+ var settings = (ISettingsService)App.Services.GetService(typeof(ISettingsService))!;
+ settings.Current.ShowWelcomeOnStartup=false; settings.Current.CheckForUpdates=false; settings.Current.LastSeenVersion=AppInfo.Version;
+ settings.Current.PianoRollLaneHeights.Clear();
+ using var stop = new CancellationTokenSource(); Exception? failure=null; bool done=false;
+ var checks = new List<string>();
+ void Require(bool ok,string label) { if(!ok) throw new Exception(label); checks.Add(label); }
+ DispatcherTimer.RunOnce(()=> {
+ try {
+ var roll = new PianoRollView { LaneSettings=settings };
+ var notes = new[] { new NotaNote(60,0,1,.8f), new NotaNote(64,2,1,.7f) };
+ roll.SetNotes(notes,16);
+ var data = new Dictionary<int,AutomationPoint[]> {
+ [1]=[new(0,.2f),new(4,.8f)], [11]=[new(0,.4f),new(8,.9f)], [64]=[new(1,1),new(3,0)] };
+ int commits=0;
+ roll.ControllersInClip=()=>data.Keys.ToArray();
+ roll.GetController=id=>data.GetValueOrDefault(id,[]);
+ roll.SetController=(id,p)=>{ data[id]=p; commits++; };
+ var window = new Window { Content=roll,Width=1000,Height=720,Title="CC lane validation",
+ Background=(IBrush)Avalonia.Application.Current!.Resources["Brush.BgApp"]! };
+ window.Show(); window.UpdateLayout();
+ var add = roll.GetVisualDescendants().OfType<Button>().Single(b=>b.Name=="AddControllerLane");
+ void Add()=>add.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
+ Add();Add();Add(); window.UpdateLayout();
+ var lanes=(IList)Get(roll,"_controllerLanes")!;
+ Require(lanes.Count==3,"plus adds three independent lane views");
+ object Lane(int i)=>lanes[i]!.GetType().GetProperty("Lane")!.GetValue(lanes[i])!;
+ int Ctl(int i)=>(int)Lane(i).GetType().GetProperty("Controller",Hidden)!.GetValue(Lane(i))!;
+ Require(new[]{Ctl(0),Ctl(1),Ctl(2)}.Distinct().Count()==3,"new lanes choose different controllers");
+ Require(new[]{Ctl(0),Ctl(1),Ctl(2)}.Contains(64),"switch-type sustain shares the existing block editor");
+ Grid Row(int i)=>(Grid)lanes[i]!.GetType().GetProperty("Row")!.GetValue(lanes[i])!;
+ var primary=(Grid)Get(roll,"_laneRow")!;
+ void Drag(Grid row,double growth)
+ {
+ var divider=((DockPanel)row.Parent!).Children.OfType<Border>().Single();
+ var p=divider.TranslatePoint(new Point(20,3),window)!.Value;
+ using var pointer=new Avalonia.Input.Pointer(42,PointerType.Mouse,true);
+ var down=new PointerPointProperties(RawInputModifiers.LeftMouseButton,PointerUpdateKind.LeftButtonPressed);
+ divider.RaiseEvent(new PointerPressedEventArgs(divider,pointer,window,p,1,down,KeyModifiers.None,1));
+ divider.RaiseEvent(new PointerEventArgs(InputElement.PointerMovedEvent,divider,pointer,window,p.WithY(p.Y-growth),2,down,KeyModifiers.None));
+ divider.RaiseEvent(new PointerReleasedEventArgs(divider,pointer,window,p.WithY(p.Y-growth),3,
+ new PointerPointProperties(RawInputModifiers.None,PointerUpdateKind.LeftButtonReleased),KeyModifiers.None,MouseButton.Left));
+ window.UpdateLayout();
+ }
+ Drag(primary,50);Drag(Row(0),45);Drag(Row(1),85);
+ Require(primary.Height==142 && Row(0).Height==157 && Row(1).Height==197,
+ "actual pointer drags resize Velocity and two CC lanes independently");
+ var second=Lane(1);
+ second.GetType().GetProperty("Controller",Hidden)!.SetValue(second,Ctl(0));
+ Call(roll,"FitControllerLanes");Drag(Row(1),20);
+ Require(Row(0).Height==157 && Row(1).Height==132,"duplicate controller views retain independent heights");
+ second.GetType().GetProperty("Controller",Hidden)!.SetValue(second,11);Call(roll,"FitControllerLanes");
+ var reopened=new PianoRollView {LaneSettings=settings,ControllersInClip=roll.ControllersInClip,GetController=roll.GetController};
+ reopened.SetNotes(notes,16);
+ var reopenedWindow=new Window {Content=reopened,Width=1000,Height=720};reopenedWindow.Show();reopenedWindow.UpdateLayout();
+ var reopenedAdd=reopened.GetVisualDescendants().OfType<Button>().Single(b=>b.Name=="AddControllerLane");
+ reopenedAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));reopenedAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));reopenedWindow.UpdateLayout();
+ var restored=(IList)Get(reopened,"_controllerLanes")!;
+ Require(((Grid)Get(reopened,"_laneRow")!).Height==142
+ && ((Grid)restored[0]!.GetType().GetProperty("Row")!.GetValue(restored[0])!).Height==157
+ && ((Grid)restored[1]!.GetType().GetProperty("Row")!.GetValue(restored[1])!).Height==197,
+ "editor reopening restores Velocity and corresponding CC lane heights");
+ reopenedWindow.Close();
+ File.WriteAllText(Path.Combine(root,"lane-height-expected.json"),JsonSerializer.Serialize(settings.Current.PianoRollLaneHeights));
+ Require(commits==0,"resizing and editor reopening do not commit MIDI edits");
+ string Snapshot()=>JsonSerializer.Serialize(data,new JsonSerializerOptions{IncludeFields=true});
+ string original=Snapshot();
+ var remove=roll.GetVisualDescendants().OfType<Button>().First(b=>ToolTip.GetTip(b)?.ToString()?.StartsWith("Hide controller lane")==true);
+ remove.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
+ Require(lanes.Count==2 && Snapshot()==original && commits==0,"minus removes only a view and preserves all CC points");
+ Add(); Require(lanes.Count==3 && Snapshot()==original,"readding a lane preserves controller data");
+ int target=Ctl(0); var untouched=data.Where(p=>p.Key!=target).ToDictionary(p=>p.Key,p=>p.Value);
+ Call(roll,"StoreController",target,new List<AutomationPoint>{new(0,.1f),new(2,.7f)});
+ Require(commits==1 && untouched.All(p=>data[p.Key].SequenceEqual(p.Value)),"existing commit boundary edits only its target controller");
+ var lane=Lane(0); var drag=lane.GetType().GetField("_drag",Hidden)!;
+ drag.SetValue(lane,Enum.Parse(drag.FieldType,"Point"));
+ lane.GetType().GetField("_work",Hidden)!.SetValue(lane,new List<AutomationPoint>{new(1,.5f)});
+ roll.SetNotes(notes,16);
+ Require(drag.GetValue(lane)!.ToString()=="None" && Get(lane,"_work") is null && lanes.Count==3,
+ "reload cancels stale controller gestures and keeps lane layout");
+ for(int i=0;i<7;i++)Add();
+ Call(roll,"ZoomAt",2.0,4.0); Call(roll,"SetScrollBeats",2.0); window.UpdateLayout();
+ var sc=roll.GetVisualDescendants().OfType<ScrollViewer>().Single(s=>s.Name=="ControllerLanes");
+ Require(sc.Extent.Height>sc.Viewport.Height && sc.Bounds.Height<=window.Bounds.Height-120,"many lanes scroll in a bounded area");
+ Require(((Control)Get(roll,"_gridControl")!).Bounds.Height>0,"note grid remains available");
+ window.Height=300; window.UpdateLayout(); window.UpdateLayout();
+ Require(((ScrollViewer)Get(roll,"_bodyScroll")!).Viewport.Height>=40,
+ "short editors retain a visible note viewport with many CC lanes");
+ window.Height=720; window.UpdateLayout();
+ Require(lanes.Cast<object>().All(x=>((Grid)x.GetType().GetProperty("Row")!.GetValue(x)!).ColumnDefinitions[0].Width.Value
+ ==((Grid)((Control)Get(roll,"_gridControl")!).Parent!).ColumnDefinitions[0].Width.Value),"all lane gutters follow the note-grid column");
+ while(lanes.Count>3)Call(roll,"RemoveControllerLane",lanes[lanes.Count-1]!);
+ window.UpdateLayout();
+ foreach(string theme in new[]{"studio-dark","studio-light"}) {
+ typeof(MainWindow).Assembly.GetType("Nota.App.NotaThemeService")!.GetMethod("Set",BindingFlags.Public|BindingFlags.Static)!
+ .Invoke(null,new object[]{new AppearanceChoice(false,theme,"studio-dark","studio-light")});
+ using var bitmap=new RenderTargetBitmap(new PixelSize(1000,720)); bitmap.Render(window); bitmap.Save(Path.Combine(root,theme+"-cc.png"));
+ }
+ Require(commits==1,"view, theme and zoom operations never write controller data");
+ CheckFoldedLanes(root, Require);
+ CheckPrimaryLaneTabs(root, settings, Require);
+ CheckInlineControls(root, Require);
+ CheckDockedNotes(root, (MainWindow)lifetime.MainWindow!, Require);
+ var preferences=new PreferencesWindow(new SettingsViewModel(settings));
+ typeof(PreferencesWindow).GetField("_shortcutFilter",Hidden)!.SetValue(preferences,"controller");
+ Call(preferences,"Select",8);preferences.Show();preferences.UpdateLayout();
+ Require(preferences.GetVisualDescendants().OfType<TextBlock>()
+ .Any(t=>t.Text=="Click a lane's controller dropdown"),"Shortcuts pane describes the in-lane controller dropdown");
+ using(var bitmap=new RenderTargetBitmap(new PixelSize(880,640)))
+ {bitmap.Render(preferences);bitmap.Save(Path.Combine(root,"controller-shortcuts.png"));}
+ preferences.GetVisualDescendants().OfType<TextBox>()
+ .Single(t=>t.PlaceholderText=="Filter shortcuts").Text="Bend";
+ var shortcutsFrame=new DispatcherFrame();
+ DispatcherTimer.RunOnce(()=>shortcutsFrame.Continue=false,TimeSpan.FromMilliseconds(50));
+ Dispatcher.UIThread.PushFrame(shortcutsFrame);
+ preferences.UpdateLayout();
+ Require(preferences.GetVisualDescendants().OfType<TextBlock>()
+ .Any(t=>t.Text=="Click the Bend lane's range"),"merged Shortcuts pane retains develop's Bend-range picker instruction");
+ preferences.Close();
+ File.WriteAllText(Path.Combine(root,"cc-results.json"),JsonSerializer.Serialize(checks,new JsonSerializerOptions{WriteIndented=true}));
+ window.Close();
+ // Drain theme-change work before disposing the real app's engine.
+ Dispatcher.UIThread.Post(()=> {
+ typeof(MainWindow).GetField("_closeConfirmed",Hidden)!.SetValue(lifetime.MainWindow,true);
+ lifetime.MainWindow!.Close(); done=true; stop.Cancel();
+ },DispatcherPriority.Background);
+ }catch(Exception e){failure=e;stop.Cancel();}
+ },TimeSpan.FromMilliseconds(900));
+ using var watchdog=new Timer(_=>Dispatcher.UIThread.Post(()=>stop.Cancel()),null,15000,Timeout.Infinite);
+ Dispatcher.UIThread.MainLoop(stop.Token);
+ if(failure is not null)throw failure; if(!done)throw new Exception("Probe timed out");
+ Console.WriteLine(string.Join(Environment.NewLine,checks));
+ }
+
+ static void CheckDockedNotes(string root, MainWindow window, Action<bool,string> require)
+ {
+ window.WindowState=WindowState.Normal;window.Width=1200;window.Height=680;
+ var roll=new PianoRollView();roll.SetNotes([new NotaNote(60,2,1,.8f)],8);
+ var editor=new ClipEditorView(roll,"Docked regression",0);
+ typeof(MainWindow).GetField("_clipEditor",Hidden)!.SetValue(window,editor);
+ typeof(MainWindow).GetField("_editorRoll",Hidden)!.SetValue(window,roll);
+ typeof(MainWindow).GetField("_detailHeight",Hidden)!.SetValue(window,190.0);
+ Call(window,"ShowClipPanel");window.UpdateLayout();
+ var frame=new DispatcherFrame();DispatcherTimer.RunOnce(()=>frame.Continue=false,TimeSpan.FromMilliseconds(150));Dispatcher.UIThread.PushFrame(frame);
+ var body=(ScrollViewer)Get(roll,"_bodyScroll")!;
+ var row=(RowDefinition)Get(window,"_detailRow")!;
+ Console.WriteLine($"Docked layout: panel {row.ActualHeight}, roll {roll.Bounds.Height}, notes {body.Viewport.Height}");
+ using(var bitmap=new RenderTargetBitmap(new PixelSize((int)window.Bounds.Width,(int)window.Bounds.Height)))
+ {bitmap.Render(window);bitmap.Save(Path.Combine(root,"docked-notes.png"));}
+ require(body.Viewport.Height>=48,"actual docked editor keeps a usable note viewport when restoring a small panel height");
+ window.FindControl<Border>("DetailPanel")!.IsVisible=false;window.UpdateLayout();
+ window.FindControl<Border>("DetailPanel")!.IsVisible=true;window.UpdateLayout();
+ require(body.Viewport.Height>=48,"hiding and showing the docked editor preserves its note viewport");
+ Call(window,"ResetDetailHeight");window.UpdateLayout();
+ require(body.Viewport.Height>=48,"resetting the docked panel height preserves its note viewport");
+ Call(window,"SetDetailMaximized",true);window.UpdateLayout();
+ Call(window,"SetDetailMaximized",false);window.UpdateLayout();
+ require(body.Viewport.Height>=48,"maximizing and restoring the docked editor preserves notes");
+ ((Control)Get(roll,"_strip")!).IsVisible=true;
+ ((Control)Get(roll,"_hScroll")!).IsVisible=true;
+ for(int i=0;i<3;i++)Call(roll,"AddControllerLane");
+ row.Height=new GridLength(120);window.UpdateLayout();Call(roll,"FitControllerLanes");window.UpdateLayout();
+ Console.WriteLine($"Smallest dock: min {row.MinHeight}, panel {row.ActualHeight}, roll {roll.Bounds.Height}, notes {body.Viewport.Height}, primary {((Grid)Get(roll,"_laneRow")!).Height}, extra {((ScrollViewer)Get(roll,"_controllerScroll")!).Bounds.Height}");
+ require(body.Viewport.Height>=48,"minimum docked panel keeps notes with clip strip scrollbar and extra CC lanes");
+ void Pump()
+ {
+ window.UpdateLayout();var pending=new DispatcherFrame();
+ DispatcherTimer.RunOnce(()=>pending.Continue=false,TimeSpan.FromMilliseconds(100));Dispatcher.UIThread.PushFrame(pending);
+ }
+ void Click(Control target,Point point)
+ {
+ using var pointer=new Avalonia.Input.Pointer(46,PointerType.Mouse,true);
+ target.RaiseEvent(new PointerPressedEventArgs(target,pointer,window,point,1,
+ new PointerPointProperties(RawInputModifiers.LeftMouseButton,PointerUpdateKind.LeftButtonPressed),KeyModifiers.None,1));
+ target.RaiseEvent(new PointerReleasedEventArgs(target,pointer,window,point,2,
+ new PointerPointProperties(RawInputModifiers.None,PointerUpdateKind.LeftButtonReleased),KeyModifiers.None,MouseButton.Left));
+ }
+ var modes=new[]{"Velocity","Bend","Pressure","Slide","Controller"};
+ for(int i=0;i<modes.Length;i++)
+ {
+ Pump();var tabs=(Control)Get(roll,"_laneTabs")!;
+ var point=tabs.TranslatePoint(new Point(20,8+13*i),window)!.Value;
+ require(ReferenceEquals(window.InputHitTest(point),tabs),$"docked minimum exposes {modes[i]} tab to pointer input");
+ Click(tabs,point);
+ require(Get(roll,"_laneMode")!.ToString()==modes[i],$"docked minimum allows selecting {modes[i]}");
+ }
+ double pitchY=(double)Call(roll,"PitchY",60)!;
+ body.Offset=new Vector(0,Math.Max(0,pitchY-12));Pump();
+ var grid=(Control)Get(roll,"_gridControl")!;
+ var notePoint=grid.TranslatePoint(new Point((double)Call(roll,"BeatToX",2.1)!,pitchY+6),window)!.Value;
+ require(ReferenceEquals(window.InputHitTest(notePoint),grid),"note grid receives pointer hits in the minimum docked editor");
+ Click(grid,notePoint);
+ require(roll.SelectionIndices.Contains(0),"a note can be selected in the minimum docked editor");
+ var stacked=Enumerable.Range(0,12).Select(i=>new OpenClip(i,0,0,8)).ToArray();
+ roll.SetClips(new ClipSet(stacked,0,0),stacked.Select(c=>new ClipNotes(c.TrackId,0,[new NotaNote(60,2,1,.8f)])).ToArray(),_=>Brushes.Gray);
+ Pump();
+ var stripScroll=(ScrollViewer)Get(roll,"_clipStripScroll")!;
+ require(body.Viewport.Height>=48 && stripScroll.Extent.Height>stripScroll.Viewport.Height,
+ "real minimum docked host retains notes with twelve stacked clips and extra CC lanes");
+ roll.SetActiveClip(11);Pump();
+ require(body.Viewport.Height>=48,"changing the active stacked clip keeps docked notes visible");
+ Call(window,"DockMixer");window.UpdateLayout();
+ frame=new DispatcherFrame();DispatcherTimer.RunOnce(()=>frame.Continue=false,TimeSpan.FromMilliseconds(200));Dispatcher.UIThread.PushFrame(frame);window.UpdateLayout();
+ var panel=window.FindControl<Border>("DetailPanel")!;
+ var bottom=panel.TranslatePoint(new Point(0,panel.Bounds.Height),window)!.Value.Y;
+ Console.WriteLine($"Docked mixer: window {window.Bounds.Height}, panel bottom {bottom}, notes {body.Viewport.Height}");
+ require(body.Viewport.Height>=48 && bottom<=window.Bounds.Height,
+ "docked Mixer and MIDI editor fit inside the minimum-size main window");
+ var edge=window.FindControl<Border>("DetailEdge")!;
+ var edgePoint=edge.TranslatePoint(new Point(20,2),window)!.Value;
+ using(var pointer=new Avalonia.Input.Pointer(47,PointerType.Mouse,true))
+ {
+ var down=new PointerPointProperties(RawInputModifiers.LeftMouseButton,PointerUpdateKind.LeftButtonPressed);
+ edge.RaiseEvent(new PointerPressedEventArgs(edge,pointer,window,edgePoint,1,down,KeyModifiers.None,1));
+ edge.RaiseEvent(new PointerEventArgs(InputElement.PointerMovedEvent,edge,pointer,window,edgePoint.WithY(edgePoint.Y+400),2,down,KeyModifiers.None));
+ edge.RaiseEvent(new PointerReleasedEventArgs(edge,pointer,window,edgePoint.WithY(edgePoint.Y+400),3,
+ new PointerPointProperties(RawInputModifiers.None,PointerUpdateKind.LeftButtonReleased),KeyModifiers.None,MouseButton.Left));
+ }
+ Pump();require(row.ActualHeight>=300 && body.Viewport.Height>=48,"dragging the docked panel edge stops before hiding notes");
+ Call(window,"HideMixer");Pump();
+ require(window.MinHeight==680,"hiding the docked Mixer restores the ordinary window minimum");
+ window.FindControl<ContentControl>("DetailBody")!.Content=new Border();
+ Call(window,"ShowDetail",250.0,false,true);Pump();
+ require(row.MinHeight==120,"non-MIDI Detail content retains the existing 120-pixel minimum");
+ }
+
+ static void CheckPrimaryLaneTabs(string root, ISettingsService settings, Action<bool,string> require)
+ {
+ var previous=new Dictionary<string,double>(settings.Current.PianoRollLaneHeights);
+ var shortHeights=new Dictionary<string,double> {
+ ["Velocity"]=48,["Bend"]=48,["Pressure"]=48,["Slide"]=48,["cc:1"]=48,["extra:0:cc:1"]=48 };
+ settings.Current.PianoRollLaneHeights=shortHeights;settings.Save();
+ int commits=0;
+ PianoRollView NewRoll(ISettingsService saved)
+ {
+ var view=new PianoRollView {LaneSettings=saved,ControllersInClip=()=>[1],GetController=_=>[],
+ SetController=(_,_)=>commits++};
+ view.SetNotes([new NotaNote(60,2,1,.8f)],8);
+ return view;
+ }
+ var roll=NewRoll(settings);
+ var window=new Window {Content=roll,Width=1000,Height=720};window.Show();window.UpdateLayout();
+ var row=(Grid)Get(roll,"_laneRow")!;
+ var divider=((DockPanel)row.Parent!).Children.OfType<Border>().Single();
+ var start=divider.TranslatePoint(new Point(20,3),window)!.Value;
+ using(var pointer=new Avalonia.Input.Pointer(44,PointerType.Mouse,true))
+ {
+ var down=new PointerPointProperties(RawInputModifiers.LeftMouseButton,PointerUpdateKind.LeftButtonPressed);
+ divider.RaiseEvent(new PointerPressedEventArgs(divider,pointer,window,start,1,down,KeyModifiers.None,1));
+ divider.RaiseEvent(new PointerEventArgs(InputElement.PointerMovedEvent,divider,pointer,window,start.WithY(start.Y+200),2,down,KeyModifiers.None));
+ divider.RaiseEvent(new PointerReleasedEventArgs(divider,pointer,window,start.WithY(start.Y+200),3,
+ new PointerPointProperties(RawInputModifiers.None,PointerUpdateKind.LeftButtonReleased),KeyModifiers.None,MouseButton.Left));
+ }
+ window.UpdateLayout();
+ using(var bitmap=new RenderTargetBitmap(new PixelSize(1000,720)))
+ { bitmap.Render(window);bitmap.Save(Path.Combine(root,"primary-tabs.png")); }
+ void ClickTab(int index,string expected)
+ {
+ // Let the new window's compositor publish its hit-test scene.
+ var frame=new DispatcherFrame();
+ DispatcherTimer.RunOnce(()=>frame.Continue=false,TimeSpan.FromMilliseconds(100));
+ Dispatcher.UIThread.PushFrame(frame);
+ var tabs=(Control)Get(roll,"_laneTabs")!;
+ var point=tabs.TranslatePoint(new Point(20,8+13*index),window)!.Value;
+ var target=window.InputHitTest(point);
+ if(!ReferenceEquals(target,tabs)) Console.WriteLine($"Tab hit mismatch: expected {expected}, hit {target?.GetType().Name}, tabs {tabs.Bounds}, row {((Grid)Get(roll,"_laneRow")!).Height}, point {point}");
+ require(ReferenceEquals(target,tabs),$"{expected} tab receives pointer hit after shrinking primary lane");
+ using var pointer=new Avalonia.Input.Pointer(45,PointerType.Mouse,true);
+ tabs.RaiseEvent(new PointerPressedEventArgs(tabs,pointer,window,point,1,
+ new PointerPointProperties(RawInputModifiers.LeftMouseButton,PointerUpdateKind.LeftButtonPressed),KeyModifiers.None,1));
+ window.UpdateLayout();
+ require(Get(roll,"_laneMode")!.ToString()==expected,$"pointer click selects {expected} after shrinking primary lane");
+ }
+ ClickTab(4,"Controller");ClickTab(0,"Velocity");ClickTab(1,"Bend");ClickTab(2,"Pressure");ClickTab(3,"Slide");
+ require(row.Height==92,"all primary modes retain room for five tabs and the add action");
+ Call(roll,"AddControllerLane");window.UpdateLayout();
+ var lanes=(IList)Get(roll,"_controllerLanes")!;
+ require(((Grid)lanes[0]!.GetType().GetProperty("Row")!.GetValue(lanes[0])!).Height==48,
+ "extra CC lanes retain their independent 48-pixel minimum");
+ window.Close();
+ roll=NewRoll(new Nota.Infrastructure.SettingsService());
+ window=new Window {Content=roll,Width=1000,Height=300};window.Show();window.UpdateLayout();
+ require(((Grid)Get(roll,"_laneRow")!).Height==92,"reopened short editor fits five tabs and the add action above a saved 48-pixel height");
+ ClickTab(4,"Controller");
+ require(((ScrollViewer)Get(roll,"_bodyScroll")!).Viewport.Height>=40,"short editor keeps note viewport with reachable primary tabs");
+ require(commits==0,"shrinking and switching primary tabs never commit controller data");
+ window.Close();settings.Current.PianoRollLaneHeights=previous;settings.Save();
+ }
+
+ static void CheckInlineControls(string root, Action<bool,string> require)
+ {
+ int commits=0;
+ var data=new Dictionary<int,AutomationPoint[]> { [1]=[new(0,.2f),new(6,.8f)], [11]=[new(2,.4f)] };
+ var roll=new PianoRollView { ControllersInClip=()=>data.Keys.ToArray(),
+ GetController=id=>data.GetValueOrDefault(id,[]), SetController=(id,p)=>{data[id]=p;commits++;} };
+ roll.SetNotes([new NotaNote(60,2,1,.8f)],8);
+ var window=new Window {Content=roll,Width=1000,Height=720};window.Show();window.UpdateLayout();
+ void Layout()
+ {
+ window.UpdateLayout();var frame=new DispatcherFrame();
+ DispatcherTimer.RunOnce(()=>frame.Continue=false,TimeSpan.FromMilliseconds(30));
+ Dispatcher.UIThread.PushFrame(frame);window.UpdateLayout();
+ }
+ Button ButtonIn(Control parent,string name)=>parent.GetVisualDescendants().OfType<Button>().Single(b=>b.Name==name);
+ void Click(Button button)=>button.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
+ var add=ButtonIn(roll,"AddControllerLane");
+ var tabs=(Control)Get(roll,"_laneTabs")!;
+ require(add.TranslatePoint(default,roll)!.Value.Y>=tabs.TranslatePoint(default,roll)!.Value.Y+tabs.Bounds.Height,
+ "compact add action sits below the primary sidebar entries");
+ require(!roll.GetVisualDescendants().OfType<TextBlock>().Any(t=>t.Text=="CC lanes"),
+ "full-width CC lanes toolbar is absent");
+ Click(add);Click(add);Layout();
+ var lanes=(IList)Get(roll,"_controllerLanes")!;
+ Grid Row(int i)=>(Grid)lanes[i]!.GetType().GetProperty("Row")!.GetValue(lanes[i])!;
+ Control Lane(int i)=>(Control)lanes[i]!.GetType().GetProperty("Lane")!.GetValue(lanes[i])!;
+ int Controller(Control lane)=>(int)lane.GetType().GetProperty("ControllerId",Hidden)!.GetValue(lane)!;
+ var picker=ButtonIn(Row(0),"ControllerPicker");
+ var close=ButtonIn(Row(0),"RemoveControllerLane");
+ require(ToolTip.GetTip(picker)?.ToString()=="Mod wheel · CC 1",
+ "in-lane dropdown displays controller name and CC number");
+ require(picker.TranslatePoint(default,window)!.Value.Y<Lane(0).TranslatePoint(default,window)!.Value.Y
+ && close.TranslatePoint(default,window)!.Value.X>=picker.TranslatePoint(default,window)!.Value.X+picker.Bounds.Width,
+ "picker and adjacent close button occupy a header above the editable graph");
+ var point=picker.TranslatePoint(new Point(8,8),window)!.Value;
+ var hit=window.InputHitTest(point) as Visual;
+ require(hit is not null && (ReferenceEquals(hit,picker)||picker.IsVisualAncestorOf(hit)),
+ "dropdown receives pointer hits without hitting the graph");
+ Click(picker);Layout();
+ var menu=(MenuFlyout)FlyoutBase.GetAttachedFlyout(picker)!;
+ MenuItem Item(MenuFlyout flyout,string text)=>flyout.Items.OfType<MenuItem>().First(i=>i.Header?.ToString()==text);
+ Item(menu,"Expression · CC 11").RaiseEvent(new RoutedEventArgs(MenuItem.ClickEvent));menu.Hide();Layout();
+ require(Controller(Lane(0))==11 && Controller(Lane(1))==11 && commits==0,
+ "real dropdown selection changes only its lane and allows independent duplicate views");
+ require(ToolTip.GetTip(picker)?.ToString()=="Expression · CC 11",
+ "dropdown caption follows the selected controller");
+ window.Width=180;Layout();
+ var closePoint=close.TranslatePoint(new Point(close.Bounds.Width/2,10),window)!.Value;
+ hit=window.InputHitTest(closePoint) as Visual;
+ require(closePoint.X<window.Bounds.Width && hit is not null
+ && (ReferenceEquals(hit,close)||close.IsVisualAncestorOf(hit)),
+ "narrow lane keeps its close button reachable beside a shortened controller caption");
+ window.Width=1000;Layout();
+ Click(picker);Layout();menu=(MenuFlyout)FlyoutBase.GetAttachedFlyout(picker)!;
+ var stale=Item(menu,"Mod wheel · CC 1");
+ roll.SetNotes([new NotaNote(60,2,1,.8f)],8);
+ stale.RaiseEvent(new RoutedEventArgs(MenuItem.ClickEvent));menu.Hide();Layout();
+ require(Controller(Lane(0))==11,"dropdown opened before clip reload cannot apply stale selection");
+ Click(picker);Layout();menu=(MenuFlyout)FlyoutBase.GetAttachedFlyout(picker)!;
+ stale=Item(menu,"Mod wheel · CC 1");
+ var removed=Lane(0);Click(close);
+ stale.RaiseEvent(new RoutedEventArgs(MenuItem.ClickEvent));menu.Hide();Layout();
+ require(lanes.Count==1 && Controller(removed)==11 && commits==0 && data[1].Length==2,
+ "close hides only its lane and ignores the removed lane's pending dropdown callback");
+
+ Call(roll,"SelectController",1);Layout();
+ var primary=(Control)Get(roll,"_ctlLane")!;
+ var primaryPicker=ButtonIn((Control)Get(roll,"_primaryControllerBody")!,"ControllerPicker");
+ require(primaryPicker.IsVisible && ((Control)Get(roll,"_primaryControllerScale")!).IsVisible,
+ "primary controller lane has the same header and value scale");
+ Click(primaryPicker);Layout();menu=(MenuFlyout)FlyoutBase.GetAttachedFlyout(primaryPicker)!;
+ Item(menu,"Expression · CC 11").RaiseEvent(new RoutedEventArgs(MenuItem.ClickEvent));menu.Hide();Layout();
+ require(Controller(primary)==11 && Controller(Lane(0))==11,
+ "primary dropdown preserves independently selected extra lanes");
+ Click(ButtonIn((Control)Get(roll,"_primaryControllerBody")!,"RemoveControllerLane"));Layout();
+ require(Get(roll,"_laneMode")!.ToString()=="Velocity" && commits==0,
+ "primary close returns to Velocity without deleting controller data");
+
+ void CheckScale(Control lane,Control scale,string label)
+ {
+ double top=(double)Call(lane,"ValueToY",1f)!;
+ double mid=(double)Call(lane,"ValueToY",64f/127)!;
+ double bottom=(double)Call(lane,"ValueToY",0f)!;
+ require(!scale.IsHitTestVisible && top<mid && mid<bottom
+ && Math.Abs((float)Call(lane,"YToValue",mid)!-64f/127)<.00001
+ && lane.TranslatePoint(new Point(0,bottom),scale)!.Value.Y<scale.Bounds.Height,
+ label+" scale aligns endpoints and MIDI 64 with graph pointer mapping");
+ }
+ Call(roll,"ResizeLane","extra:1:cc:11",48.0);Layout();
+ var scale=Row(0).GetVisualDescendants().Single(c=>c.Name=="ControllerValueScale");
+ CheckScale(Lane(0),(Control)scale,"minimum-height extra lane");
+ Call(roll,"ResizeLane","extra:1:cc:11",197.0);Layout();
+ CheckScale(Lane(0),(Control)scale,"resized extra lane");
+ Call(roll,"SelectController",1);Layout();
+ CheckScale(primary,(Control)Get(roll,"_primaryControllerScale")!,"primary lane");
+ Call(roll,"ZoomAt",2.0,2.0);Call(roll,"SetScrollBeats",1.0);Layout();
+ var grid=(Control)Get(roll,"_gridControl")!;
+ require(Math.Abs(Lane(0).TranslatePoint(default,window)!.Value.X-grid.TranslatePoint(default,window)!.Value.X)<.01,
+ "header and scale preserve shared note/controller beat origin through zoom and scroll");
+
+ var clips=Enumerable.Range(0,12).Select(i=>new OpenClip(i,0,0,8)).ToArray();
+ var notes=clips.Select(c=>new ClipNotes(c.TrackId,0,[new NotaNote(60,2,1,.8f)])).ToArray();
+ roll.SetClips(new ClipSet(clips,0,0),notes,_=>Brushes.Gray);
+ window.Height=300;Layout();
+ var strip=(Control)Get(roll,"_strip")!;
+ var stripScroll=(ScrollViewer)Get(roll,"_clipStripScroll")!;
+ var body=(ScrollViewer)Get(roll,"_bodyScroll")!;
+ require(strip.Height==216 && stripScroll.Viewport.Height<strip.Height && body.Viewport.Height>=48,
+ "twelve stacked clips scroll in their strip while a short editor retains usable notes");
+ stripScroll.Offset=new Vector(0,stripScroll.Extent.Height);Layout();
+ require(stripScroll.Offset.Y>0,"last stacked clip remains reachable by scrolling");
+ point=add.TranslatePoint(new Point(add.Bounds.Width/2,10),window)!.Value;
+ hit=window.InputHitTest(point) as Visual;
+ require(hit is not null && (ReferenceEquals(hit,add)||add.IsVisualAncestorOf(hit)),
+ "sidebar add action remains clickable with stacked clips in a short editor");
+ int count=lanes.Count;Click(add);Layout();
+ require(lanes.Count==count+1 && body.Viewport.Height>=48,"adding a lane with stacked clips preserves the note viewport");
+ roll.SetActiveClip(11);Layout();
+ require(commits==0 && lanes.Count==count+1,"switching stacked active clips preserves lane views and MIDI");
+ using(var bitmap=new RenderTargetBitmap(new PixelSize(1000,300)))
+ {bitmap.Render(window);bitmap.Save(Path.Combine(root,"stacked-inline-cc.png"));}
+ window.Close();
+ }
+
+ static void CheckFoldedLanes(string root, Action<bool,string> require)
+ {
+ var roll = new PianoRollView { FoldPads=()=>new Dictionary<int,string> { [36]="Kick", [38]="Snare" } };
+ roll.SetNotes([new NotaNote(36,2,1,.8f),new NotaNote(38,4,1,.7f)],8);
+ var points = new[] { new AutomationPoint(0,.2f), new AutomationPoint(6,.8f) };
+ roll.ControllersInClip=()=>[1]; roll.GetController=_=>points;
+ int commits=0;
+ roll.SetController=(_,updated)=>{points=updated;commits++;};
+ var window=new Window {Content=roll,Width=1000,Height=720};
+ window.Show();window.UpdateLayout();
+ roll.SetFold(true);
+ Call(roll,"AddControllerLane");window.UpdateLayout();
+ var lanes=(IList)Get(roll,"_controllerLanes")!;
+ Control Lane()=> (Control)lanes[0]!.GetType().GetProperty("Lane")!.GetValue(lanes[0])!;
+ var grid=(Control)Get(roll,"_gridControl")!;
+ bool Aligned()=>Math.Abs(Lane().TranslatePoint(default,window)!.Value.X
+ - grid.TranslatePoint(default,window)!.Value.X)<.01;
+ using(var bitmap=new RenderTargetBitmap(new PixelSize(1000,720)))
+ {
+ bitmap.Render(window);bitmap.Save(Path.Combine(root,"folded-cc.png"));
+ }
+ double noteX=grid.TranslatePoint(new Point((double)Call(roll,"BeatToX",2.0)!,0),window)!.Value.X;
+ var click=new Point(noteX,Lane().TranslatePoint(new Point(0,50),window)!.Value.Y);
+ using(var pointer=new Avalonia.Input.Pointer(43,PointerType.Mouse,true))
+ {
+ var down=new PointerPointProperties(RawInputModifiers.LeftMouseButton,PointerUpdateKind.LeftButtonPressed);
+ Lane().RaiseEvent(new PointerPressedEventArgs(Lane(),pointer,window,click,1,down,KeyModifiers.None,2));
+ Lane().RaiseEvent(new PointerReleasedEventArgs(Lane(),pointer,window,click,2,
+ new PointerPointProperties(RawInputModifiers.None,PointerUpdateKind.LeftButtonReleased),KeyModifiers.None,MouseButton.Left));
+ }
+ require(commits==1 && points.Any(p=>Math.Abs(p.Beat-2)<1e-6),
+ "click directly below a folded drum note writes CC at the same beat");
+ require(Aligned(),"CC lane added after Drum Rack folding starts aligned with notes");
+ roll.RefreshFold();window.UpdateLayout();
+ require(Aligned(),"unchanged folded pad rows preserve new CC lane alignment");
+ roll.SetFold(false);window.UpdateLayout();
+ require(Aligned() && grid.TranslatePoint(default,roll)!.Value.X==48,
+ "unfolding restores the normal aligned 48-pixel gutter");
+ roll.SetFold(true);window.UpdateLayout();
+ require(Aligned() && grid.TranslatePoint(default,roll)!.Value.X==96,
+ "refolding updates existing CC lanes to the 96-pixel pad gutter");
+ Call(roll,"RemoveControllerLane",lanes[0]!);Call(roll,"AddControllerLane");window.UpdateLayout();
+ require(Aligned(),"CC lane removed and readded while folded keeps alignment");
+ window.Close();
+ }
+}
diff --git a/specs/083-inline-cc-controls/checklists/requirements.md b/specs/083-inline-cc-controls/checklists/requirements.md
new file mode 100644
index 00000000..14e74cc0
--- /dev/null
+++ b/specs/083-inline-cc-controls/checklists/requirements.md
@@ -0,0 +1,29 @@
+# Specification Quality Checklist: Controls inside MIDI CC lanes
+
+**Created**: 2026-11-04
+**Feature**: [spec.md](../spec.md)
+
+## Content quality
+
+- [x] No implementation details in user requirements.
+- [x] Focused on musician value.
+- [x] Understandable without code knowledge.
+- [x] Mandatory sections complete.
+
+## Requirement completeness
+
+- [x] No unresolved clarification markers.
+- [x] Testable and unambiguous requirements.
+- [x] Measurable success criteria.
+- [x] User-facing outcomes independent of implementation.
+- [x] Acceptance scenarios defined.
+- [x] Edge cases identified.
+- [x] Scope bounded to the existing PR.
+- [x] Assumptions identified; reference image located in the PR design review.
+
+## Feature readiness
+
+- [x] Requirements map to acceptance scenarios.
+- [x] Stories cover creation, selection, removal, editing and layouts.
+- [x] Outcomes can be verified by existing probes and build gates.
+- [x] No implementation prescriptions leak into user requirements.
diff --git a/specs/083-inline-cc-controls/contracts/ui.md b/specs/083-inline-cc-controls/contracts/ui.md
new file mode 100644
index 00000000..ec2d747f
--- /dev/null
+++ b/specs/083-inline-cc-controls/contracts/ui.md
@@ -0,0 +1,10 @@
+# Lane UI contract
+
+- One `AddControllerLane` button lives below primary sidebar entries.
+- Controller shells expose `ControllerPicker` and `RemoveControllerLane` buttons;
+ picker uses ControllerLabel, caret glyph, and existing picker menu.
+- `ControllerValueScale` occupies the matching left gutter, ignores pointer input,
+ and aligns values with graph mapping below its header.
+- Graph x-origin remains note grid x-origin through fold/zoom/scroll.
+- Headers never route pointer presses into ControllerLane; they are siblings.
+- Existing resize dividers and settings keys remain authoritative.
diff --git a/specs/083-inline-cc-controls/data-model.md b/specs/083-inline-cc-controls/data-model.md
new file mode 100644
index 00000000..1a56601d
--- /dev/null
+++ b/specs/083-inline-cc-controls/data-model.md
@@ -0,0 +1,10 @@
+# State and data
+
+No new persisted entities or MIDI formats. ExtraControllerLane retains controller,
+slot, row and container; height keys remain `extra:{slot}:cc:{controller}`. The primary
+lane retains its mode-specific height key. Captions derive from ControllerLabel.
+
+Selection resets the target gesture and updates that view only. Removal resets the
+gesture and removes the view, leaving clip data and saved height entries intact.
+Primary removal selects Velocity. Pending menu callbacks validate cache generation
+and membership. Scale state derives from the lane controller.
diff --git a/specs/083-inline-cc-controls/manual.patch b/specs/083-inline-cc-controls/manual.patch
new file mode 100644
index 00000000..b4530b34
--- /dev/null
+++ b/specs/083-inline-cc-controls/manual.patch
@@ -0,0 +1,57 @@
+diff --git a/src/content/docs/editing/piano-roll.mdx b/src/content/docs/editing/piano-roll.mdx
+index 3382706..eb62505 100644
+--- a/src/content/docs/editing/piano-roll.mdx
++++ b/src/content/docs/editing/piano-roll.mdx
+@@ -12,0 +13 @@ sources:
++ - src/managed/Nota.App/PianoRollView.ControllerLanes.cs
+@@ -133,3 +134,3 @@ size of a step are in [Settings ▸ Shortcuts](../../preferences/shortcuts/#velo
+-The fifth tab in the lane's labels edits one MIDI controller over the whole clip — the sustain
+-pedal, the mod wheel, any CC. The tab shows the controller's short name and a small arrow. Click it to
+-show the lane; click it again to pick another controller:
++The **CC** tab shows a MIDI controller over the whole clip — the sustain pedal, mod wheel,
++or any CC. Use the dropdown inside the lane to select its controller. The dropdown shows
++the controller name and CC number, and offers:
+@@ -142,3 +143,11 @@ show the lane; click it again to pick another controller:
+-The first time you open the tab it shows the first controller the clip has data for, or Sustain
+-if there is none. The lane names the controller in its top-left corner, and reads out the value
+-under the pointer on the right.
++The first time you open the tab it shows the first controller with data, or Sustain if there
++is none. **+ lane** below the sidebar entries adds independent controller lanes. Each has
++its own dropdown and an adjacent **×** to hide it without deleting its MIDI. Closing the
++primary controller lane returns it to Velocity.
++
++The **127 / 64 / 0** scale on the left aligns with the graph; the pitch wheel uses a signed
++scale. The value under the pointer appears on the right. The controls sit above the graph,
++so clicking them does not draw automation. Extra lanes scroll vertically and share the notes'
++horizontal zoom and position. Drag a lane's upper divider to resize it. Heights return when
++you reopen the editor or restart Nota and re-add the corresponding lane and controller.
++With many overlapping clips, scroll their strip to reach every clip while keeping notes visible.
+diff --git a/src/content/docs/ru/editing/piano-roll.mdx b/src/content/docs/ru/editing/piano-roll.mdx
+index 5bb1dc9..3cd91d3 100644
+--- a/src/content/docs/ru/editing/piano-roll.mdx
++++ b/src/content/docs/ru/editing/piano-roll.mdx
+@@ -12,0 +13 @@ sources:
++ - src/managed/Nota.App/PianoRollView.ControllerLanes.cs
+@@ -134,3 +135,3 @@ Velocity можно менять и прямо на сетке: наведите
+-Пятая вкладка среди подписей дорожки правит один MIDI-контроллер на всём клипе: педаль
+-sustain, mod wheel, любой CC. На вкладке — короткое имя контроллера и маленькая стрелка. Нажмите,
+-чтобы показать дорожку; нажмите ещё раз, чтобы выбрать другой контроллер:
++Вкладка **CC** показывает MIDI-контроллер на всём клипе: педаль sustain, mod wheel
++или любой CC. Выберите контроллер в списке внутри дорожки. В нём видны имя и номер CC;
++варианты сгруппированы так:
+@@ -143,3 +144,12 @@ sustain, mod wheel, любой CC. На вкладке — короткое им
+-Когда вы открываете вкладку впервые, она показывает первый контроллер с данными в клипе, а если
+-данных нет — Sustain. В левом верхнем углу дорожки написано имя контроллера, справа — значение под
+-указателем.
++При первом открытии вкладка показывает первый контроллер с данными, а если их нет — Sustain.
++Кнопка **+ lane** под списком слева добавляет независимые дорожки контроллеров. В каждой
++есть свой список и кнопка **×** рядом: она скрывает дорожку, сохраняя MIDI-данные.
++Закрытие основной дорожки контроллера возвращает панель к Velocity.
++
++Слева от графика расположена шкала **127 / 64 / 0**; у pitch wheel шкала знаковая.
++Значение под указателем видно справа. Элементы управления находятся над графиком,
++поэтому нажатие на них не рисует автоматизацию. Дополнительные дорожки прокручиваются
++по вертикали и используют горизонтальную позицию и масштаб нот. Потяните верхний
++разделитель дорожки, чтобы изменить её высоту. Высота сохраняется после открытия редактора
++и перезапуска Nota: добавьте ту же дорожку с тем же контроллером, чтобы восстановить её.
++Если клипы перекрываются, прокручивайте их полосу: все клипы остаются доступны, а ноты — видны.
diff --git a/specs/083-inline-cc-controls/plan.md b/specs/083-inline-cc-controls/plan.md
new file mode 100644
index 00000000..78acf1fb
--- /dev/null
+++ b/specs/083-inline-cc-controls/plan.md
@@ -0,0 +1,72 @@
+# Implementation Plan: Controls inside MIDI CC lanes
+
+**Branch**: `feat/multiple-midi-cc-lanes` | **Date**: 2026-11-04
+**Spec**: [spec.md](spec.md)
+
+## Summary
+
+Refactor PR #425's existing lane shell, preserving ControllerLane and its routing.
+Each controller body becomes a header plus graph, with selector and close button in
+the header and a non-interactive value scale in the shared left gutter. Put the add
+action below the five primary sidebar entries. Remove the full-width toolbar.
+
+## Technical Context
+
+- Language/version: C# / .NET 10, Avalonia 12.1.4.
+- Dependencies: existing controls, Glyph, NotaPalette and fonts; no new dependencies.
+- Storage: existing PianoRollLaneHeights settings and existing clip MIDI curves.
+- Audio-thread impact: none; managed UI only, no native/ABI/transport changes.
+- Testing: extend the real Windows CCProbe and run scripts/build-win.ps1, including
+ smoke/design/localization/scanner guards; matching before/after screenshots.
+- Platforms: desktop Windows/macOS/Linux; local validation on Windows x64.
+- Constraints: shared graph x-origin remains unchanged, including 96 px folded pad
+ gutter; controls occupy a separate header, never an overlay over editable points.
+- Scope: PianoRollView partials, localization/docs, existing validation harness.
+
+## Constitution Check
+
+All eight principles pass before and after design: UI-only changes, no ABI or audio
+thread changes; existing palette/styles and dependencies; SPDX on new sources; full
+build gate; one existing PR; feature/docs/changelog sync; spec before implementation;
+no safety exceptions. User instruction overrides creating a new branch or PR.
+
+## Project Structure
+
+- `PianoRollView.ControllerLanes.cs`: shared header/graph shell, scale, sidebar action,
+ existing add/remove/resize functions and available-height accounting.
+- `PianoRollView.Controllers.cs`: update primary header on controller changes; remove
+ duplicated graph name; retain data/edit mapping and existing picker.
+- `PianoRollView.Expression.cs`: host primary controller shell, cancel gestures when
+ leaving it, reserve sidebar action height, simplify controller tab selection.
+- `PianoRollView.cs`: remove toolbar row; install sidebar action below primary tabs.
+- `PianoRollView.ClipStrip.cs`: refit lanes when stacked strip height changes.
+- `Nota.Application/Localization/en.json`, `FEATURES.md`, `CHANGELOG.md`: labels/workflow.
+- `specs/071-multiple-cc-lanes/validation/Program.cs`: existing regression harness.
+- `specs/083-inline-cc-controls/`: design and validation artifacts.
+- Sibling `nota-docs`: paired piano-roll manual update; include a paired handoff in
+ this branch to keep the requested submission contained within PR #425.
+
+## Implementation decisions
+
+A shared ControllerLaneBody helper serves primary and extra lane headers. Header
+height consumes part of the existing saved row height; graph uses remaining height.
+The 48 px extra minimum still permits a compact header and readable scale labels.
+Primary minimum keeps five tabs plus the compact add action accessible.
+Scale uses ControllerLane's ValueToY directly, translated into gutter coordinates;
+no new x offset in drawing or pointer math. Pitch wheel uses signed endpoints and
+zero; ordinary controllers show MIDI 127/64/0.
+
+Available-height budgeting uses actual clip strip height, not one assumed row.
+Extra lanes scroll within the remaining budget, leaving notes visible. Existing
+minimum host protections remain. No unknown technology choices require research
+delegation; findings come from the existing component implementation.
+
+## Integration with current develop
+
+Merge `d57d86dc839433c654ae17f67267a96b328fa35b` into the existing PR branch without
+rewriting its history. Develop uses stable localization keys and downloads translations;
+adapt the lane controls and shortcut descriptions to that system. Keep English text in
+`src/managed/Nota.Application/Localization/en.json`, remove the obsolete bundled French
+file as develop does, and retain the controller gesture-generation guards alongside the
+localized clear-menu key. Keep develop's Bend-range picker and its Shortcuts instruction.
+The user-facing lane layout, controller data, settings keys and editing routes are unchanged.
diff --git a/specs/083-inline-cc-controls/quickstart.md b/specs/083-inline-cc-controls/quickstart.md
new file mode 100644
index 00000000..046e380c
--- /dev/null
+++ b/specs/083-inline-cc-controls/quickstart.md
@@ -0,0 +1,16 @@
+# Validation
+
+From the existing PR branch in a Visual Studio developer PowerShell:
+
+```powershell
+./scripts/build-win.ps1
+dotnet run --project specs/071-multiple-cc-lanes/validation/CCProbe.csproj -c Release -- build/inline-cc-probe
+dotnet specs/071-multiple-cc-lanes/validation/bin/Release/net10.0/CCProbe.dll --read-lanes build/inline-cc-probe
+git diff --check
+```
+
+Cover controls, scale mapping, independent curves/heights, stale gestures, minimum
+heights, docked notes, folded pad gutters and stacked clips. Capture the same demo
+clip at 1100 × 850, Studio Dark, before/after with validation/Capture and inspect it.
+Check control pointer hits and graph endpoints, sidebar add after shrinking, primary
+Controller-to-Velocity hide; no writes during control or layout-only operations.
diff --git a/specs/083-inline-cc-controls/research.md b/specs/083-inline-cc-controls/research.md
new file mode 100644
index 00000000..d07d02cc
--- /dev/null
+++ b/specs/083-inline-cc-controls/research.md
@@ -0,0 +1,30 @@
+# Research
+
+## Shared lane shell
+
+Decision: compose native buttons above ControllerLane rather than inside its drawing
+surface. Rationale: pointer routing stays independent and every point is reachable.
+Rejected: overlaying curve points or duplicating the automation editor.
+
+## Scale and alignment
+
+Decision: use the current gutter and graph's ValueToY function. Rationale: normal
+and folded Drum Rack time alignment survives unchanged. Rejected: an extra graph
+column shifting the beat axis relative to notes.
+
+## Layout budget
+
+Decision: remove the toolbar row, reserve sidebar action height, and use actual
+stacked strip height. Rationale: the PR subtracts just one 18 px row even when clips
+stack; a review identifies hidden notes.
+
+## Integration constraints
+
+The IDE workspace is a source export without Git metadata. A shallow checkout of
+the existing PR branch is used in a sibling directory; all PR commits remain ancestors
+and pushes are ordinary fast forwards. The reference was found in PR #425's design
+review comment: `pr-assets/pr425-cc-lanes-review/cc-lanes-mockup.png`. The final shell
+uses compact backing only beneath its controls and a thin painted resize seam. The
+existing six-pixel resize hit zone and a shallow row separate controls from editing.
+
+Original PR head: `957d52865886483dd63f81f1065c70915c3f3667`.
diff --git a/specs/083-inline-cc-controls/spec.md b/specs/083-inline-cc-controls/spec.md
new file mode 100644
index 00000000..2828c9ed
--- /dev/null
+++ b/specs/083-inline-cc-controls/spec.md
@@ -0,0 +1,102 @@
+<!-- SPDX-License-Identifier: AGPL-3.0-only -->
+<!-- Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms. -->
+
+# Feature Specification: Controls inside MIDI CC lanes
+
+**Feature Branch**: `feat/multiple-midi-cc-lanes` (existing PR #425)
+**Created**: 2026-11-04
+**Status**: Ready for planning
+**Input**: Redesign PR #425 with in-lane controller dropdowns and remove buttons,
+a sidebar + lane action, and a 127/64/0 value scale, preserving editing and layouts.
+
+## User Scenarios & Testing
+
+### US1 — Manage controllers where their curves appear (P1)
+
+A musician identifies and changes each lane's controller using its in-lane dropdown,
+and hides a lane using the adjacent × control.
+**Independent test**: Add three lanes, select different controllers, hide and restore
+one, and compare all notes and MIDI curves before and after.
+
+**Acceptance scenarios**:
+1. Given multiple lanes, each dropdown displays its controller name and CC number.
+2. Changing a dropdown affects only that lane; hiding it preserves its MIDI data.
+3. Clicking controls or opening their menus never starts an automation gesture.
+
+### US2 — Add lanes without a full-width toolbar (P1)
+
+A musician uses a compact **+ lane** control below the left sidebar's existing entries.
+**Independent test**: Add lanes from each primary lane mode and in a short editor.
+
+**Acceptance scenarios**:
+1. The full-width **CC lanes** toolbar and its external plus button are absent.
+2. The sidebar action adds an independent lane using the current creation rules.
+3. The action, primary tabs and note viewport remain usable when clips are stacked.
+
+### US3 — Read and edit controller values consistently (P1)
+
+A musician uses the left-hand scale to relate curve position to MIDI values.
+**Independent test**: Compare graph and pointer mapping at scale endpoints and midpoint,
+then resize, zoom, scroll, fold Drum Rack rows and reopen the editor.
+
+**Acceptance scenarios**:
+1. Each CC lane shows 127 at the top, 64 near the middle and 0 at the bottom.
+2. Graph values and pointer edits align with the scale at every supported lane height.
+3. Resizing persists independent heights; layouts work docked and floating, with
+ several independent or stacked clips and folded Drum Rack rows.
+
+### Edge cases
+
+- Minimum-height lanes, narrow editors and long controller labels.
+- Pitch wheel and channel pressure entries (no invented CC numbers).
+- Stale dropdown callbacks after a clip changes or its lane is removed.
+- Many extra lanes require scrolling without hiding all notes.
+- Scale labels and lane controls must not obscure editable graph points.
+
+## Requirements
+
+### Functional Requirements
+
+- **FR-001**: Each visible controller lane MUST contain a dropdown showing its name
+ and CC number where applicable, and an adjacent × hide action.
+- **FR-002**: Controller selection and lane removal MUST retain their current routing,
+ reserved-controller restrictions, gesture cancellation and MIDI preservation.
+- **FR-003**: The left sidebar MUST offer a compact **+ lane** action below its entries;
+ the full-width **CC lanes** toolbar MUST be removed.
+- **FR-004**: Each CC lane MUST show 127, 64 and 0 aligned with its graph value mapping.
+- **FR-005**: Lane controls and the value scale MUST not trigger automation edits.
+- **FR-006**: Multiple lanes, independent resizing and saved heights MUST keep working.
+- **FR-007**: Notes and curves MUST stay aligned through zoom, scrolling, Drum Rack
+ folding, clip changes, stacked clips, and docked or floating editor layouts.
+- **FR-008**: The interface MUST follow Nota's themes, typography and localization.
+- **FR-009**: The change MUST append commits to PR #425's existing branch and preserve
+ all existing commits; it MUST NOT create or replace a pull request.
+
+### Key Entities
+
+- **Controller lane**: Selected controller, independent height and transient gesture.
+- **Controller curve**: Existing clip MIDI data, unaffected by lane visibility.
+- **Editor layout**: Shared time axis and gutter, primary tabs and scrollable extra lanes.
+
+## Success Criteria
+
+- **SC-001**: All visible CC lanes identify their controller and expose adjacent removal.
+- **SC-002**: The editor has one sidebar **+ lane** action and no **CC lanes** toolbar.
+- **SC-003**: Endpoint and midpoint edits agree with the value scale after resizing.
+- **SC-004**: Regression checks pass for MIDI preservation, saved heights, folded rows,
+ stacked clips, zoom/scroll and both editor hosts; Windows build/smoke gates pass.
+- **SC-005**: PR #425's head includes the redesign commit as a descendant of its
+ original head `957d52865886483dd63f81f1065c70915c3f3667`.
+
+## Assumptions and clarification
+
+- Reference: PR #425's design-review image, section “Proposed — controls inside the lane”
+ (`pr-assets/pr425-cc-lanes-review/cc-lanes-mockup.png`). Compact backed controls,
+ sidebar creation and gutter scales guide the layout. A shallow control row preserves
+ access to every graph point; its unused width uses the graph background.
+- Existing pitch wheel/channel pressure semantics and ranges remain intact; CC value
+ labels apply to CC controllers, with appropriate signed labels for pitch wheel.
+- Hiding the primary controller lane returns its existing panel to Velocity.
+- Scope excludes reordering, collapse controls and persistence of visible lane choices.
+- Clarification review: behavior, scope, data retention and validation are clear;
+ no blocking questions or unresolved markers remain.
diff --git a/specs/083-inline-cc-controls/tasks.md b/specs/083-inline-cc-controls/tasks.md
new file mode 100644
index 00000000..7dc36dc4
--- /dev/null
+++ b/specs/083-inline-cc-controls/tasks.md
@@ -0,0 +1,51 @@
+# Tasks: Controls inside MIDI CC lanes
+
+**Input**: [spec.md](spec.md), [plan.md](plan.md), research/data model/UI contract.
+
+## Phase 1: Setup
+
+- [x] T001 Check out PR #425's existing branch and record original head in research.md.
+- [x] T002 Complete spec/clarification/plan and quality checklist in this directory.
+- [x] T003 Build baseline and capture before with specs/071-multiple-cc-lanes/validation/Capture.
+
+## Phase 2: Shared foundation
+
+- [x] T004 Refactor shared controller shell in src/managed/Nota.App/PianoRollView.ControllerLanes.cs.
+
+## Phase 3: US1 — In-lane controls
+
+- [x] T005 [US1] Use shared header for extra lanes in PianoRollView.ControllerLanes.cs.
+- [x] T006 [US1] Host primary header and guard picker callbacks in PianoRollView.Expression.cs and PianoRollView.Controllers.cs.
+- [x] T007 [US1] Check selection/removal/pointer isolation in specs/071-multiple-cc-lanes/validation/Program.cs.
+
+## Phase 4: US2 — Sidebar creation
+
+- [x] T008 [US2] Place add action below primary tabs and remove toolbar row in PianoRollView.cs.
+- [x] T009 [US2] Budget sidebar and stacked clip heights in PianoRollView.ControllerLanes.cs and PianoRollView.ClipStrip.cs.
+- [x] T010 [US2] Check short docked/floating and stacked-clip layouts in validation/Program.cs.
+
+## Phase 5: US3 — Value scale
+
+- [x] T011 [US3] Draw non-interactive scale with graph mapping in PianoRollView.ControllerLanes.cs.
+- [x] T012 [US3] Check scale mapping, resized heights, zoom/scroll and folded gutters in validation/Program.cs.
+
+## Phase 6: Polish and submission
+
+- [x] T013 Update Languages/fr.json, CHANGELOG.md, FEATURES.md and EN/RU manual text.
+- [x] T014 Run build-win.ps1, CCProbe and fresh-process height checks; inspect before/after screenshots; record validation.md.
+- [x] T015 Run speckit-converge against these artifacts and resolve remaining work.
+- [x] T016 Commit and push to existing PR branch; verify PR #425 head includes the commit.
+
+## Dependencies and strategy
+
+Setup → shared foundation → US1 → US2 → US3 → polish. US1 is the first reviewable
+slice, then add sidebar and scale behavior, then full regression validation.
+Documentation and independent evidence capture can run alongside verification;
+same-file lane work is sequential. No additional agent delegation is needed.
+
+## Phase 7: Develop integration
+
+- [x] T017 Resolve controller/Shortcuts/translation-file conflicts with develop in PianoRollView.Controllers.cs, PreferencesWindow.cs and Localization/en.json, retaining both sets of behavior.
+- [x] T018 Run the existing CCProbe against the merged app and verify its new Bend-range Shortcuts check and fresh-process height restoration.
+- [x] T019 Run scripts/build-win.ps1 on the merged tree and record results in validation.md.
+- [x] T020 Recheck spec/plan convergence and verify no unresolved Git entries or PR-diff whitespace errors remain.
diff --git a/specs/083-inline-cc-controls/validation.md b/specs/083-inline-cc-controls/validation.md
new file mode 100644
index 00000000..e163ad0f
--- /dev/null
+++ b/specs/083-inline-cc-controls/validation.md
@@ -0,0 +1,121 @@
+# Validation: Controls inside MIDI CC lanes
+
+**Date**: 2026-11-04
+**Branch**: `feat/multiple-midi-cc-lanes`, existing nota-daw/nota PR #425.
+**Original head**: `957d52865886483dd63f81f1065c70915c3f3667`.
+
+## Implementation
+
+Primary and extra controller lanes share one compact controller-name/CC-number
+dropdown and adjacent close button. Controls have their own shallow row, leaving
+every graph point reachable. Unused header width retains the graph background.
+The former full-width CC lanes toolbar is replaced by a sidebar **+ lane** action.
+The gutter scale reads graph coordinates directly: 127/64/0 for ordinary MIDI
+controllers, signed normalized values for the pitch wheel. Resize hit zones retain
+their six-pixel extent and paint only a thin seam. Settings keys and MIDI routing
+are unchanged. Clip strips with many overlapping clips now scroll within the layout
+budget so they cannot consume the entire note viewport.
+
+## Checks
+
+| Check | Result |
+| --- | --- |
+| .NET Release solution build | Passed; no errors, existing compiler warnings |
+| Windows native engine and scanner build | Passed |
+| `scripts/build-win.ps1` full gate | Passed on final revision, including smoke, render-pool and scanner-scale suites |
+| Real Windows Avalonia CCProbe | **85 assertions passed** |
+| Separate-process lane-height restoration | Passed |
+| Controller picker, primary/extra removal and MIDI preservation | Passed |
+| Menus invalidated by clip reload or lane removal | Passed |
+| Close control in a 180 px wide roll | Passed |
+| Minimum/expanded value scale and inverse pointer mapping | Passed |
+| Folded Drum Rack, unfold/refold and re-added lane origins | Passed |
+| Zoom/scroll and independent duplicate-controller heights | Passed |
+| Floating and real docked editor, Mixer, restored heights, panel-edge resizing | Passed |
+| Twelve stacked clips, scrolling and active-clip changes in both hosts | Passed |
+| Preferences Shortcuts filtered to the controller rows | Passed; rendered and visually inspected |
+| Studio Dark/Light screenshots | Rendered and visually inspected |
+| `git diff --check` | Passed |
+| External manual `npm run build` / `npm run check` | Passed; 106 pages, zero errors, 72 existing warnings |
+| Manual screenshots | Clip editor, multi-clip editor and Shortcuts retaken in Dark/Light |
+| Manual publication patch | Zero-context patch reverse-checked against the locally updated EN/RU pages |
+
+Commands are in [quickstart.md](quickstart.md). Logs and generated harness output
+remain in ignored `build/`. The existing CCProbe is extended instead of adding a
+duplicate editor test harness.
+
+## Before and after
+
+Same 1100 × 850 window, Studio Dark, 100% scale, identical notes/controller curves;
+before uses the original PR head. Evidence is stored on the existing `pr-assets`
+branch of the PR author's fork, without adding images to the code branch.
+
+| Before | After |
+| --- | --- |
+| ![Before](https://raw.githubusercontent.com/thoi1/nota/pr-assets/issue-422-inline-controls/cc-controls-before.png) | ![After](https://raw.githubusercontent.com/thoi1/nota/pr-assets/issue-422-inline-controls/cc-controls-after.png) |
+
+Additional [Studio Light](https://raw.githubusercontent.com/thoi1/nota/pr-assets/issue-422-inline-controls/studio-light-cc.png)
+and [stacked-clip](https://raw.githubusercontent.com/thoi1/nota/pr-assets/issue-422-inline-controls/stacked-inline-cc.png) captures.
+
+## Limits and observed failures
+
+- Windows x64 was tested locally; macOS and Linux were not run.
+- The first smoke run found an obsolete French `CC lanes` key; it and the old
+ controller-tab instruction were removed. Localization guards then passed.
+- A concurrent rerun exceeded the render-pool timing limit (55/4125 late blocks)
+ while documentation screenshots were rendering. The previous full run passed;
+ the final quiet run passed with **0/4125** late blocks and completed the full gate.
+- `dotnet format whitespace --verify-no-changes` is not clean on the untouched PR
+ baseline either: 260 diagnostics in the same six files. This change follows the
+ surrounding compact formatting; no repository-wide reformat was made.
+- The separate manual repository contains pre-existing local work. Only relevant
+ pages/screenshots were updated; the shortcut generator used the existing workspace
+ source plus the new controller rows to preserve its other pending feature entries.
+ No manual commit or push is included in this app-only PR. Apply [manual.patch](manual.patch)
+ with `git apply --unidiff-zero` in nota-docs and regenerate shortcuts when publishing
+ its separate update.
+
+## Submission
+
+Implementation converged: nine functional requirements, four buildable success criteria,
+nine story acceptance scenarios and all eight constitution principles reviewed; zero
+remaining code findings. SC-005 and task T016 also passed: commit `54a69e30259e1ebb2de9bc87c6382a366ba213c3`
+was pushed with an ordinary fast forward and the GitHub API confirmed it as the head
+of the still-open PR #425 on the same fork/branch. The original PR head remains an
+ancestor. No new branch or PR was created. All 16 tasks are complete.
+
+Final quiet gate: `build/build-win-quiet.log` ends with `SMOKE TEST PASSED` and
+`SCAN SCALE PASSED` (exit 0). The concurrent timing failure was not reproduced.
+
+## Merge with develop — 2026-11-04
+
+Integrated develop at `d57d86dc839433c654ae17f67267a96b328fa35b` into the existing PR
+branch, preserving the prior PR head `273051768eabd99201810044a37ca0d5e610c623`.
+
+Three conflict paths were resolved:
+
+- `PianoRollView.Controllers.cs`: retain the PR's cache/gesture generation checks
+ while using develop's stable localization key for the clear menu.
+- `PreferencesWindow.cs`: retain develop's Bend-range instruction and key-based
+ strings, plus the PR's in-lane dropdown, sidebar action and divider instructions.
+- `Languages/fr.json`: accept develop's removal of bundled translations. Migrate
+ the lane UI's English texts to stable keys in `Nota.Application/Localization/en.json`;
+ translations follow develop's downloaded-language and English-fallback model.
+
+Validation after integration:
+
+- **86 real Windows UI checks passed**, including the retained Bend-range instruction.
+- Independent lane heights restored in a fresh process.
+- Final `scripts/build-win.ps1` **passed**, exit 0: native/managed build, scanner
+ self-test, full smoke suite and scan-scale suite. Logs are in ignored
+ `build/merge-develop-build-win-final.log`.
+- Localization guards passed: every key resolves, no reference entries are unused,
+ and translations are no longer bundled. The redesign has 11 new stable text keys;
+ the superseded primary-controller instruction key was removed.
+- The first full run missed one render timing guard (five late blocks in 50 ms,
+ limit four). A standalone recheck passed, and the final full run also passed
+ (maximum burst three). No guard thresholds or native code were changed relative
+ to develop.
+- No unresolved Git entries remain; the PR diff against develop passes whitespace
+ checks. The original redesign spec and integration plan converge with no remaining
+ implementation gaps. macOS and Linux were not run locally.
diff --git a/src/managed/Nota.App/MainWindow.Detail.cs b/src/managed/Nota.App/MainWindow.Detail.cs
index d4883242..eb100f81 100644
--- a/src/managed/Nota.App/MainWindow.Detail.cs
+++ b/src/managed/Nota.App/MainWindow.Detail.cs
@@ -131,13 +131,17 @@ public partial class MainWindow
// switching back to Clip restores the persisted size. The Devices tab also can't be
// resized at all (no splitter): its cards have a fixed layout, so extra height is wasted
// and less clips them.
+ // MIDI needs both headers, the roll's lane controls and a usable note viewport,
+ // including the multi-clip strip and horizontal scrollbar at the smallest size.
+ private double DetailMinimumHeight => DetailBody.Content is ClipEditorView ? 300 : 120;
+
private void ShowDetail(double height, bool honorPersist, bool resizable = true)
{
// A selection only follows the panel; it opens a closed one only with the
// "Open Detail panel on select" preference (#308). Hosts and tabs are already updated,
// so the panel shows the current selection when it is opened later.
if (_followOnly > 0 && !DetailPanel.IsVisible && !OpenDetailOnSelect) return;
- _detailDefault = height;
+ _detailDefault = Math.Max(height, DetailMinimumHeight);
// Filling the window, a clip tab keeps it; Devices goes back to the split.
if (_detailMaximized && resizable)
{
@@ -147,8 +151,8 @@ public partial class MainWindow
SetDetailMaximized(false);
DetailMaximizeBtn.IsVisible = resizable;
var row = _detailRow;
- row.MinHeight = 120;
- double h = honorPersist && _detailHeight > 120 ? _detailHeight : height;
+ row.MinHeight = DetailMinimumHeight;
+ double h = Math.Max(row.MinHeight, honorPersist && _detailHeight > 120 ? _detailHeight : height);
row.Height = new GridLength(h);
DetailSplitter.IsVisible = resizable;
DetailPanel.IsVisible = true;
@@ -679,6 +683,7 @@ public partial class MainWindow
PianoRollView roll = null!;
roll = new PianoRollView
{
+ LaneSettings = _vm.Settings,
BeatsPerBar = Timeline.BeatsPerBar, // bar lines and bar steps match the arrangement
// Each clip whose notes changed, as one undo step. The roll can outlive a clip: the
// track/clip may have been removed, shifted by a lower-index delete, undone, or
@@ -1107,10 +1112,12 @@ public partial class MainWindow
private bool _mixerDocked; // the Mixer is shown in MixerPanel
private double _mixerWanted; // its height before fitting into the window
private double _detailWanted; // the Detail panel's, likewise
+ private double _baseWindowMinHeight;
private double _edgeStartY, _edgeStartH; // a DetailEdge drag in progress
private void InitBottomPanels()
{
+ _baseWindowMinHeight = MinHeight;
var rows = BodyGrid.RowDefinitions;
_mainRow = rows[0];
_detailSplitRow = rows[1];
@@ -1214,8 +1221,8 @@ public partial class MainWindow
return;
}
if (Height(_detailRow) > 0) return; // ShowDetail sized it already
- _detailRow.MinHeight = 120;
- _detailRow.Height = new GridLength(_detailWanted > 120 ? _detailWanted : 240);
+ _detailRow.MinHeight = DetailMinimumHeight;
+ _detailRow.Height = new GridLength(Math.Max(_detailRow.MinHeight, _detailWanted > 120 ? _detailWanted : 240));
DetailSplitter.IsVisible = _detailSplitterWasVisible;
}
@@ -1297,11 +1304,17 @@ public partial class MainWindow
// minimum. The Mixer grows back toward the height the user chose; a fit never changes it.
private void FitBottomPanels()
{
- if (_detailMaximized) return; // the Detail row is all there is
+ if (_detailMaximized) { MinHeight = _baseWindowMinHeight; return; } // the Detail row is all there is
double total = BodyGrid.Bounds.Height;
double mixer = _mixerDocked ? Math.Max(_mixerWanted, _mixerRow.MinHeight) : 0;
if (total > 0)
{
+ // The visible panels' minima must fit as a whole. In particular, the MIDI
+ // editor must not be pushed below the window by a docked Mixer.
+ double minimumBody = _mainRow.MinHeight
+ + (DetailPanel.IsVisible ? _detailRow.MinHeight + _detailSplitRow.ActualHeight : 0)
+ + (_mixerDocked ? _mixerRow.MinHeight + _mixerSplitRow.ActualHeight : 0);
+ MinHeight = Math.Max(_baseWindowMinHeight, ClientSize.Height - total + minimumBody);
double room = total - _mainRow.MinHeight;
double detail = !DetailPanel.IsVisible ? 0 : _detailWanted > 0 ? Math.Max(_detailWanted, _detailRow.MinHeight) : Height(_detailRow);
double over = mixer + detail - room;
@@ -1353,6 +1366,7 @@ public partial class MainWindow
_editorRoll?.SettlePlacement();
var roll = new PianoRollView
{
+ LaneSettings = _vm.Settings,
BeatsPerBar = Timeline.BeatsPerBar, // bar lines and bar steps match the arrangement
Commit = notes =>
{
diff --git a/src/managed/Nota.App/PianoRollView.ClipStrip.cs b/src/managed/Nota.App/PianoRollView.ClipStrip.cs
index c1ab8fcf..3109ad08 100644
--- a/src/managed/Nota.App/PianoRollView.ClipStrip.cs
+++ b/src/managed/Nota.App/PianoRollView.ClipStrip.cs
@@ -21,6 +21,12 @@ namespace Nota.App;
public sealed partial class PianoRollView
{
+ private readonly ScrollViewer _clipStripScroll = new()
+ {
+ HorizontalScrollBarVisibility = Avalonia.Controls.Primitives.ScrollBarVisibility.Disabled,
+ VerticalScrollBarVisibility = Avalonia.Controls.Primitives.ScrollBarVisibility.Auto,
+ };
+
private sealed class ClipStrip : Control
{
public const double RowH = 18;
@@ -52,6 +58,7 @@ public sealed partial class PianoRollView
}
_rows = Math.Max(1, rowEnds.Count);
Height = _rows * RowH;
+ _o.FitControllerLanes();
InvalidateVisual();
}
diff --git a/src/managed/Nota.App/PianoRollView.ControllerLanes.cs b/src/managed/Nota.App/PianoRollView.ControllerLanes.cs
new file mode 100644
index 00000000..e0ad2972
--- /dev/null
+++ b/src/managed/Nota.App/PianoRollView.ControllerLanes.cs
@@ -0,0 +1,289 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+using Avalonia.Layout;
+using Avalonia.Input;
+using Avalonia.Media;
+using Nota.Application;
+using Nota.Application.Editing;
+using Nota.Application.Localization;
+
+namespace Nota.App;
+
+public sealed partial class PianoRollView
+{
+ // Extra lanes own only their view/gesture state. Curves stay in the active clip and
+ // use the primary controller editor's cache, time mapping and undo boundary.
+ private sealed record ExtraControllerLane(ControllerLane Lane, Grid Row, Control Container, int Slot)
+ {
+ public string HeightKey => $"extra:{Slot}:cc:{Lane.Controller ?? MidiController.Sustain}";
+ }
+ private readonly List<ExtraControllerLane> _controllerLanes = new();
+ private readonly StackPanel _controllerRows = new();
+ private readonly ScrollViewer _controllerScroll = new();
+ private readonly Dictionary<string, double> _laneHeights = new();
+ private ISettingsService? _laneSettings;
+ private const double ControllerHeaderH = 20, AddLaneH = 20;
+ private const double PrimaryLaneMinimum = VelH + AddLaneH;
+ private readonly Control _primaryControllerBody;
+ private readonly Button _primaryControllerPicker;
+ private readonly Control _primaryControllerScale;
+
+ public ISettingsService? LaneSettings
+ {
+ get => _laneSettings;
+ set
+ {
+ _laneSettings = value;
+ _laneHeights.Clear();
+ if (value?.Current.PianoRollLaneHeights is { } saved)
+ foreach (var pair in saved) _laneHeights[pair.Key] = pair.Value;
+ FitControllerLanes();
+ }
+ }
+
+ private string PrimaryLaneKey => _laneMode == LaneMode.Controller ? ControllerKey(_laneCtl)
+ : _laneMode.ToString();
+ private static string ControllerKey(int controller) => $"cc:{controller}";
+ private double LaneHeight(string key, double fallback)
+ => MidiLaneHeight.Normalize(_laneHeights.GetValueOrDefault(key, fallback), fallback);
+
+ // The divider captures its own pointer; no note/controller gesture is started.
+ // Saving happens once at release, never on every UI frame of a resize.
+ private Control ResizableLane(Grid row, Func<string> key)
+ {
+ var divider = new Border { Height = 6, Background = Brushes.Transparent,
+ BorderBrush = Divider, BorderThickness = new Thickness(0, 1, 0, 0),
+ Cursor = new Cursor(StandardCursorType.SizeNorthSouth) };
+ ToolTip.SetTip(divider, Loc.T("piano_roll.lanes.drag_to_resize"));
+ double startY = 0, startHeight = 0;
+ string? dragging = null;
+ void Finish()
+ {
+ if (dragging is null) return;
+ dragging = null;
+ if (_laneSettings is { } settings)
+ {
+ settings.Current.PianoRollLaneHeights = new Dictionary<string, double>(_laneHeights);
+ settings.Save();
+ }
+ }
+ divider.PointerPressed += (_, e) =>
+ {
+ if (!e.GetCurrentPoint(divider).Properties.IsLeftButtonPressed) return;
+ dragging = key(); startY = e.GetPosition(this).Y; startHeight = row.Height;
+ e.Pointer.Capture(divider); e.Handled = true;
+ };
+ divider.PointerMoved += (_, e) =>
+ {
+ if (dragging is null) return;
+ ResizeLane(dragging, startHeight + startY - e.GetPosition(this).Y);
+ e.Handled = true;
+ };
+ divider.PointerReleased += (_, e) =>
+ {
+ if (dragging is null) return;
+ Finish(); e.Pointer.Capture(null); e.Handled = true;
+ };
+ divider.PointerCaptureLost += (_, _) => Finish();
+ var container = new DockPanel();
+ DockPanel.SetDock(divider, Dock.Top);
+ container.Children.Add(divider); container.Children.Add(row);
+ return container;
+ }
+
+ private void ResizeLane(string key, double height)
+ {
+ _laneHeights[key] = MidiLaneHeight.Normalize(height, ExprH);
+ FitControllerLanes();
+ }
+
+ private Control AddControllerLaneButton()
+ {
+ var add = new Button
+ {
+ Name = "AddControllerLane", Classes = { "ghost" }, Height = AddLaneH,
+ Padding = new Thickness(0), HorizontalAlignment = HorizontalAlignment.Stretch,
+ Content = new StackPanel
+ {
+ Orientation = Orientation.Horizontal, Spacing = 2,
+ Children = { new Glyph(GlyphKind.Plus, 8), new TextBlock
+ { Text = Loc.T("piano_roll.lanes.lane"), FontFamily = NotaFonts.Sans.FontFamily, FontSize = 8 } },
+ },
+ };
+ ToolTip.SetTip(add, Loc.T("piano_roll.lanes.add"));
+ add.Click += (_, _) => AddControllerLane();
+ return add;
+ }
+
+ private Control ControllerLaneRows()
+ {
+ _controllerScroll.Name = "ControllerLanes";
+ _controllerScroll.Content = _controllerRows;
+ _controllerScroll.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
+ _controllerScroll.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
+ SizeChanged += (_, _) => FitControllerLanes();
+ FitControllerLanes();
+ return _controllerScroll;
+ }
+
+ private void FitControllerLanes()
+ {
+ // Leave room for notes even in the normal short docked detail panel.
+ double available = Math.Max(0, Bounds.Height - RulerH - 10 - 64 - 6);
+ // A large stack remains scrollable instead of consuming the entire note area.
+ _clipStripScroll.MaxHeight = Math.Max(ClipStrip.RowH, (available - PrimaryLaneMinimum) / 2);
+ double strip = _strip.IsVisible ? Math.Min(_strip.Height, _clipStripScroll.MaxHeight) : 0;
+ double space = Math.Max(0, available - strip);
+ // Five tabs and the sidebar action fit even when restoring an older saved height.
+ _laneRow.Height = Math.Max(PrimaryLaneMinimum, Math.Min(
+ LaneHeight(PrimaryLaneKey, _laneMode == LaneMode.Velocity ? VelH : ExprH), space));
+ foreach (var item in _controllerLanes)
+ item.Row.Height = LaneHeight(item.HeightKey, ExprH);
+ _controllerScroll.MaxHeight = Math.Max(0, space - _laneRow.Height);
+ }
+
+ private static Button LaneButton(GlyphKind glyph, string tip)
+ {
+ var button = new Button { Classes = { "icon" }, Width = 22, Height = 22,
+ Padding = new Thickness(3), Content = new Glyph(glyph, 12) };
+ ToolTip.SetTip(button, tip);
+ return button;
+ }
+
+ private void AddControllerLane()
+ {
+ int ctl = ControllersWithData().Concat(CommonControllers)
+ .Concat(Enumerable.Range(0, 128).Where(c => !MidiController.IsReserved(c)))
+ .FirstOrDefault(c => !_controllerLanes.Any(l => l.Lane.Controller == c)
+ && (_laneMode != LaneMode.Controller || c != _laneCtl), MidiController.Sustain);
+ var lane = new ControllerLane(this) { Controller = ctl, ClipToBounds = true, Focusable = true };
+ var scale = new ControllerValueScale(lane);
+ Button picker = null!;
+ void Select(int id)
+ {
+ lane.ResetGesture();
+ lane.Controller = id;
+ UpdateControllerPicker(picker, id);
+ lane.InvalidateVisual();
+ scale.InvalidateVisual();
+ FitControllerLanes();
+ }
+ var row = new Grid { ColumnDefinitions = new ColumnDefinitions($"{(_rowsArePads ? FoldedPadKeysW : KeysW)},*"), Height = ExprH };
+ int slot = Enumerable.Range(0, _controllerLanes.Count + 1).First(s => _controllerLanes.All(l => l.Slot != s));
+ var container = ResizableLane(row, () => $"extra:{slot}:cc:{lane.Controller ?? MidiController.Sustain}");
+ var item = new ExtraControllerLane(lane, row, container, slot);
+ row.Children.Add(new Border
+ {
+ Background = KeysBg, BorderBrush = Divider, BorderThickness = new Thickness(0, 1, 1, 0),
+ Child = scale,
+ });
+ var body = ControllerLaneBody(lane, Select, () => RemoveControllerLane(item),
+ () => _controllerLanes.Contains(item), out picker);
+ Grid.SetColumn(body, 1); row.Children.Add(body);
+ _keyColumns.Add(row.ColumnDefinitions[0]);
+ _controllerLanes.Add(item); _controllerRows.Children.Add(container);
+ FitControllerLanes();
+ }
+
+ // Controls are siblings of the graph, so they cannot start a drawing gesture or
+ // cover a curve point. Both the primary lane and extra lanes use this one shell.
+ private Control ControllerLaneBody(ControllerLane lane, Action<int> select,
+ Action remove, Func<bool> active, out Button picker)
+ {
+ var button = new Button
+ {
+ Name = "ControllerPicker", Classes = { "ghost" }, Height = ControllerHeaderH,
+ Padding = new Thickness(4, 0), HorizontalAlignment = HorizontalAlignment.Stretch,
+ MaxWidth = 260,
+ };
+ UpdateControllerPicker(button, lane.ControllerId);
+ button.Click += (_, _) =>
+ {
+ int generation = _controllerCacheGeneration;
+ ShowControllerPicker(button, id =>
+ {
+ if (active() && generation == _controllerCacheGeneration) select(id);
+ });
+ };
+ var close = LaneButton(GlyphKind.Close, Loc.T("piano_roll.lanes.hide_keep_data"));
+ close.Name = "RemoveControllerLane";
+ close.Height = ControllerHeaderH;
+ close.Click += (_, _) => remove();
+ var tools = new DockPanel { Background = KeysBg,
+ HorizontalAlignment = HorizontalAlignment.Left, MaxWidth = 282 };
+ // Reserve the close button before measuring the name, including narrow editors.
+ DockPanel.SetDock(close, Dock.Right); tools.Children.Add(close);
+ tools.Children.Add(button);
+ var body = new Grid { RowDefinitions = new RowDefinitions($"{ControllerHeaderH},*"),
+ Background = VelBg, ClipToBounds = true };
+ body.Children.Add(tools);
+ Grid.SetRow(lane, 1); body.Children.Add(lane);
+ picker = button;
+ return body;
+ }
+
+ private static void UpdateControllerPicker(Button picker, int controller)
+ {
+ string label = ControllerLabel(controller);
+ var caption = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto") };
+ caption.Children.Add(new TextBlock { Text = label, FontFamily = NotaFonts.Sans.FontFamily,
+ FontSize = 9, TextTrimming = TextTrimming.CharacterEllipsis });
+ var caret = new Glyph(GlyphKind.CaretDown, 8) { Margin = new Thickness(4, 0, 0, 0) };
+ Grid.SetColumn(caret, 1); caption.Children.Add(caret);
+ picker.Content = caption;
+ ToolTip.SetTip(picker, label);
+ }
+
+ private sealed class ControllerValueScale : Control
+ {
+ private readonly ControllerLane _lane;
+ public ControllerValueScale(ControllerLane lane)
+ {
+ _lane = lane; Name = "ControllerValueScale";
+ IsHitTestVisible = false; ClipToBounds = true;
+ lane.SizeChanged += (_, _) => InvalidateVisual();
+ }
+
+ public override void Render(DrawingContext context)
+ {
+ if (_lane.Bounds.Height <= 0) return;
+ bool wheel = _lane.ControllerId == MidiController.PitchWheel;
+ var (lo, hi) = MidiController.Range(_lane.ControllerId);
+ Draw(wheel ? "1" : "127", hi);
+ Draw(wheel ? "0" : "64", wheel ? 0 : 64f / 127);
+ Draw(wheel ? "−1" : "0", lo);
+
+ void Draw(string label, float value)
+ {
+ var text = new FormattedText(label, NotaNum.Culture, FlowDirection.LeftToRight,
+ Mono, _lane.Bounds.Height < 40 ? 7 : 8, LabelText);
+ if (_lane.TranslatePoint(new Point(0, _lane.ValueToY(value)), this) is { } point)
+ context.DrawText(text, new Point(Bounds.Width - text.Width - 3, point.Y - text.Height / 2));
+ }
+ }
+ }
+
+ private void RemoveControllerLane(ExtraControllerLane item)
+ {
+ item.Lane.ResetGesture();
+ _controllerRows.Children.Remove(item.Container);
+ _keyColumns.Remove(item.Row.ColumnDefinitions[0]);
+ _controllerLanes.Remove(item);
+ FitControllerLanes();
+ }
+
+ private void InvalidateControllerLanes()
+ {
+ _ctlLane.InvalidateVisual();
+ _primaryControllerScale.InvalidateVisual();
+ foreach (var item in _controllerLanes) item.Lane.InvalidateVisual();
+ foreach (var item in _controllerLanes) ((Border)item.Row.Children[0]).Child!.InvalidateVisual();
+ }
+}
diff --git a/src/managed/Nota.App/PianoRollView.Controllers.cs b/src/managed/Nota.App/PianoRollView.Controllers.cs
index 6fde9b1a..91c016fb 100644
--- a/src/managed/Nota.App/PianoRollView.Controllers.cs
+++ b/src/managed/Nota.App/PianoRollView.Controllers.cs
@@ -18,6 +18,7 @@ using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Media;
using Nota.Application;
@@ -40,13 +41,20 @@ public sealed partial class PianoRollView
private int _laneCtl = -1; // −1 until the lane is first shown
private readonly Dictionary<int, AutomationPoint[]> _ctlCache = new();
private int[]? _ctlInClip;
+ private int _controllerCacheGeneration;
private static readonly int[] CommonControllers =
{ MidiController.Sustain, MidiController.ModWheel, MidiController.PitchWheel, MidiController.ChannelPressure, 11, 2 };
// Every reload (undo, recording, another clip) and active-clip change re-reads the engine.
- private void DropControllerCache()
+ private void DropControllerCache(bool cancelGestures = true)
{
+ if (cancelGestures)
+ {
+ ++_controllerCacheGeneration;
+ _ctlLane.ResetGesture();
+ foreach (var item in _controllerLanes) item.Lane.ResetGesture();
+ }
_ctlCache.Clear();
_ctlInClip = null;
}
@@ -71,8 +79,8 @@ public sealed partial class PianoRollView
{
if (SetController is null) return;
SetController(ctl, pts.ToArray());
- DropControllerCache();
- _ctlLane.InvalidateVisual();
+ DropControllerCache(cancelGestures: false);
+ InvalidateControllerLanes();
_laneTabs.InvalidateVisual();
}
@@ -87,14 +95,17 @@ public sealed partial class PianoRollView
{
_laneCtl = ctl;
_ctlLane.ResetGesture();
+ UpdateControllerPicker(_primaryControllerPicker, ctl);
if (_laneMode != LaneMode.Controller) SetLaneMode(LaneMode.Controller);
+ FitControllerLanes();
_ctlLane.InvalidateVisual();
+ _primaryControllerScale.InvalidateVisual();
_laneTabs.InvalidateVisual();
}
/// <summary>The controller picker: what the clip holds first (marked), the common
/// controllers, then every other CC in groups of 16.</summary>
- internal void ShowControllerPicker(Control anchor)
+ internal void ShowControllerPicker(Control anchor, Action<int>? select = null)
{
var f = new MenuFlyout();
var data = ControllersWithData();
@@ -102,13 +113,13 @@ public sealed partial class PianoRollView
{
var it = new MenuItem { Header = header };
if (Array.IndexOf(data, ctl) >= 0) it.Icon = MenuKit.Icon(GlyphKind.Automation);
- it.Click += (_, _) => SelectController(ctl);
+ it.Click += (_, _) => (select ?? SelectController)(ctl);
return it;
}
foreach (int c in data) f.Items.Add(Item(c, ControllerLabel(c)));
if (data.Length > 0) f.Items.Add(new Separator());
foreach (int c in CommonControllers)
- if (Array.IndexOf(data, c) < 0) f.Items.Add(Item(c, MidiController.Name(c)));
+ if (Array.IndexOf(data, c) < 0) f.Items.Add(Item(c, ControllerLabel(c)));
f.Items.Add(new Separator());
var other = new MenuItem { Header = Loc.T("piano_roll.controllers.other_cc") };
for (int g = 0; g < 128; g += 16)
@@ -124,6 +135,7 @@ public sealed partial class PianoRollView
other.Items.Add(grp);
}
f.Items.Add(other);
+ FlyoutBase.SetAttachedFlyout(anchor, f);
f.ShowAt(anchor);
}
@@ -133,6 +145,7 @@ public sealed partial class PianoRollView
{
private readonly PianoRollView _o;
public ControllerLane(PianoRollView o) { _o = o; }
+ internal int? Controller { get; set; }
private const double Pad = 6, EdgePx = 5, PointPx = 7;
private const double Eps = 1.0 / 1024; // beats: where a drawn stretch meets the old curve
@@ -142,7 +155,8 @@ public sealed partial class PianoRollView
private static readonly IPen BlockEdge = new Pen(NotaPalette.VizInk, 1.5);
private static readonly IPen BlockEdgeHot = new Pen(NotaPalette.Accent, 1.5);
- private int Ctl => _o._laneCtl < 0 ? MidiController.Sustain : _o._laneCtl;
+ private int Ctl => Controller ?? (_o._laneCtl < 0 ? MidiController.Sustain : _o._laneCtl);
+ internal int ControllerId => Ctl;
private bool IsSwitch => MidiController.IsSwitch(Ctl);
private bool Editable => _o.SetController is not null;
@@ -158,12 +172,19 @@ public sealed partial class PianoRollView
private static readonly Cursor ResizeCursor = new(StandardCursorType.SizeWestEast);
private static readonly Cursor MoveCursor = new(StandardCursorType.SizeAll);
private int _hoverBlock = -1, _selBlock = -1;
+ private IPointer? _capturedPointer;
+ private int _gestureGeneration;
private double _hoverBeat = double.NaN;
internal void ResetGesture()
{
+ ++_gestureGeneration;
_drag = Drag.None; _work = null; _stroke.Clear();
_pt = _hoverPt = _hoverBlock = _selBlock = -1;
+ var pointer = _capturedPointer;
+ _capturedPointer = null;
+ if (pointer?.Captured == this) pointer.Capture(null);
+ InvalidateVisual();
}
private IReadOnlyList<AutomationPoint> Cur => (IReadOnlyList<AutomationPoint>?)_work ?? _o.ControllerPoints(Ctl);
@@ -177,7 +198,7 @@ public sealed partial class PianoRollView
=> _free ? local : _o._set.ToLocal(_o._set.Active, _o.SnapBeat(Ed(local)));
private double MinBlock => _free ? 1.0 / 32 : Math.Max(1.0 / 32, _o.SnapStep);
- private double ValueToY(float v)
+ internal double ValueToY(float v)
{
var (lo, hi) = MidiController.Range(Ctl);
double h = Bounds.Height;
@@ -376,8 +397,6 @@ public sealed partial class PianoRollView
_o.DrawOutsideClip(ctx, w, h);
- var name = new FormattedText(ControllerLabel(Ctl), NotaNum.Culture, FlowDirection.LeftToRight, NotaFonts.Sans, 9, LabelText);
- ctx.DrawText(name, new Point(4, 3));
if (c.Count == 0 && Editable && _drag == Drag.None)
{
var hint = new FormattedText(IsSwitch ? Loc.T("piano_roll.controllers.drag_to_draw_a_block") : Loc.T("piano_roll.controllers.drag_to_draw"), NotaNum.Culture, FlowDirection.LeftToRight, NotaFonts.Sans, 9, LabelText);
@@ -513,6 +532,7 @@ public sealed partial class PianoRollView
ApplyStroke(StrokeSamples());
}
}
+ _capturedPointer = e.Pointer;
e.Pointer.Capture(this);
InvalidateVisual();
e.Handled = true;
@@ -637,6 +657,7 @@ public sealed partial class PianoRollView
protected override void OnPointerCaptureLost(PointerCaptureLostEventArgs e)
{
+ _capturedPointer = null;
if (_drag != Drag.None) { _drag = Drag.None; _work = null; _stroke.Clear(); InvalidateVisual(); }
base.OnPointerCaptureLost(e);
}
@@ -667,8 +688,11 @@ public sealed partial class PianoRollView
private void ShowClearMenu()
{
int ctl = Ctl;
+ int generation = _o._controllerCacheGeneration, gesture = _gestureGeneration;
ClipEditorKit.ShowMenu(this, new[] { Loc.F("piano_roll.clear", MidiController.Name(ctl)) }, -1, _ =>
{
+ if (generation != _o._controllerCacheGeneration || gesture != _gestureGeneration
+ || TopLevel.GetTopLevel(this) is null) return;
_selBlock = -1;
_o.StoreController(ctl, new List<AutomationPoint>());
});
diff --git a/src/managed/Nota.App/PianoRollView.Expression.cs b/src/managed/Nota.App/PianoRollView.Expression.cs
index 10ad2b91..9714b980 100644
--- a/src/managed/Nota.App/PianoRollView.Expression.cs
+++ b/src/managed/Nota.App/PianoRollView.Expression.cs
@@ -80,10 +80,13 @@ public sealed partial class PianoRollView
internal void SetLaneMode(LaneMode m)
{
if (m == _laneMode) return;
+ _ctlLane.ResetGesture();
_laneMode = m;
if (m == LaneMode.Controller && _laneCtl < 0) _laneCtl = DefaultController();
- _velHost.Child = m switch { LaneMode.Velocity => _vel, LaneMode.Controller => _ctlLane, _ => _expr };
- _laneRow.Height = m == LaneMode.Velocity ? VelH : ExprH;
+ UpdateControllerPicker(_primaryControllerPicker, _laneCtl < 0 ? MidiController.Sustain : _laneCtl);
+ _primaryControllerScale.IsVisible = m == LaneMode.Controller;
+ _velHost.Child = m switch { LaneMode.Velocity => _vel, LaneMode.Controller => _primaryControllerBody, _ => _expr };
+ FitControllerLanes();
Invalidate();
_laneTabs.InvalidateVisual();
}
@@ -160,7 +163,7 @@ public sealed partial class PianoRollView
return c[^1].Value;
}
- // ---- the gutter: VEL · BEND · PRES · SLIDE · <controller> ----------------------------------
+ // ---- the gutter: velocity, expression and controller modes ------------------------------
private sealed class LaneTabs : Control
{
@@ -168,7 +171,6 @@ public sealed partial class PianoRollView
{ (LaneMode.Velocity, Loc.T("piano_roll.expression.vel")), (LaneMode.Bend, Loc.T("piano_roll.expression.bend")), (LaneMode.Pressure, Loc.T("piano_roll.expression.pres")), (LaneMode.Slide, Loc.T("piano_roll.expression.slide")), (LaneMode.Controller, "") };
// Five rows fit the velocity lane's 72 px.
private const double Top = 4, RowStep = 13;
- private const double ChevronW = 7;
private static readonly Typeface TabFace = new(NotaFonts.Mono.FontFamily, FontStyle.Normal, FontWeight.Bold);
private readonly PianoRollView _o;
private int _hover = -1;
@@ -176,16 +178,6 @@ public sealed partial class PianoRollView
private FormattedText Text(string s, IBrush ink) => new(s, NotaNum.Culture, FlowDirection.LeftToRight, TabFace, 9, ink);
- // The controller tab names the controller when it fits beside the picker chevron.
- private FormattedText ControllerLabel(IBrush ink)
- {
- int ctl = _o._laneCtl >= 0 ? _o._laneCtl : _o.DefaultController();
- var ft = Text(MidiController.ShortName(ctl), ink);
- if (ft.Width <= Bounds.Width - ChevronW - 6) return ft;
- ft = Text(ctl < 128 ? $"CC{ctl}" : "CC", ink);
- return ft.Width <= Bounds.Width - ChevronW - 6 ? ft : Text("CC", ink);
- }
-
public override void Render(DrawingContext ctx)
{
ctx.FillRectangle(Brushes.Transparent, new Rect(Bounds.Size));
@@ -194,16 +186,10 @@ public sealed partial class PianoRollView
bool on = Tabs[i].Mode == _o._laneMode;
var ink = on ? TabActive : i == _hover ? KeyLabelHot : LabelText;
bool ctl = Tabs[i].Mode == LaneMode.Controller;
- var ft = ctl ? ControllerLabel(ink) : Text(Tabs[i].Label, ink);
+ var ft = Text(ctl ? "CC" : Tabs[i].Label, ink);
double y = Top + i * RowStep;
- double x = (Bounds.Width - ft.Width - (ctl ? ChevronW : 0)) / 2;
+ double x = (Bounds.Width - ft.Width) / 2;
ctx.DrawText(ft, new Point(x, y));
- if (ctl)
- {
- // The caret marks that the tab opens the controller picker.
- double cx = x + ft.Width + 2;
- Glyph.Draw(ctx, GlyphKind.CaretDown, new Rect(cx, y + (ft.Height - 6) / 2, 6, 6), ink);
- }
if (on) ctx.FillRectangle(TabActive, new Rect(0, y + 1, 2, ft.Height - 2));
}
}
@@ -218,8 +204,7 @@ public sealed partial class PianoRollView
{
int i = RowAt(e.GetPosition(this));
if (i < 0 || !e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;
- if (Tabs[i].Mode == LaneMode.Controller && _o._laneMode == LaneMode.Controller) _o.ShowControllerPicker(this);
- else _o.SetLaneMode(Tabs[i].Mode);
+ _o.SetLaneMode(Tabs[i].Mode);
e.Handled = true;
}
diff --git a/src/managed/Nota.App/PianoRollView.cs b/src/managed/Nota.App/PianoRollView.cs
index 311fe37b..6f126a0c 100644
--- a/src/managed/Nota.App/PianoRollView.cs
+++ b/src/managed/Nota.App/PianoRollView.cs
@@ -423,6 +423,10 @@ public sealed partial class PianoRollView : UserControl
_vel = new VelocityLane(this) { ClipToBounds = true };
_expr = new ExpressionLane(this) { ClipToBounds = true };
_ctlLane = new ControllerLane(this) { ClipToBounds = true, Focusable = true };
+ _primaryControllerBody = ControllerLaneBody(_ctlLane, SelectController,
+ () => SetLaneMode(LaneMode.Velocity), () => _laneMode == LaneMode.Controller,
+ out _primaryControllerPicker);
+ _primaryControllerScale = new ControllerValueScale(_ctlLane) { Width = 18, IsVisible = false };
_velHost = new Border { BorderBrush = Divider, BorderThickness = new Thickness(0, 1, 0, 0), Child = _vel };
// Body: keys pinned left, grid fills; both scroll vertically together.
@@ -456,8 +460,9 @@ public sealed partial class PianoRollView : UserControl
var stripRow = new Grid { ColumnDefinitions = new ColumnDefinitions($"{KeysW},*") };
_keyColumns.Add(stripRow.ColumnDefinitions[0]);
stripRow.Children.Add(new Border { Background = KeysBg, BorderBrush = Divider, BorderThickness = new Thickness(0, 0, 1, 1) });
- Avalonia.Controls.Grid.SetColumn(_strip, 1);
- stripRow.Children.Add(_strip);
+ _clipStripScroll.Content = _strip;
+ Avalonia.Controls.Grid.SetColumn(_clipStripScroll, 1);
+ stripRow.Children.Add(_clipStripScroll);
stripRow.Bind(IsVisibleProperty, _strip.GetObservable(IsVisibleProperty));
var velRow = new Grid { ColumnDefinitions = new ColumnDefinitions($"{KeysW},*"), Height = VelH };
@@ -465,7 +470,15 @@ public sealed partial class PianoRollView : UserControl
_laneRow = velRow;
// The lane's gutter picks what it edits: velocity, or a recorded-MPE dimension.
var velLabelHost = new Border { Background = KeysBg, BorderBrush = Divider, BorderThickness = new Thickness(0, 1, 1, 0) };
- velLabelHost.Child = _laneTabs = new LaneTabs(this);
+ var sidebar = new Grid { RowDefinitions = new RowDefinitions($"*,{AddLaneH}"),
+ ColumnDefinitions = new ColumnDefinitions("*,Auto") };
+ sidebar.Children.Add(_laneTabs = new LaneTabs(this));
+ var addLane = AddControllerLaneButton();
+ Avalonia.Controls.Grid.SetRow(addLane, 1); sidebar.Children.Add(addLane);
+ Avalonia.Controls.Grid.SetColumn(_primaryControllerScale, 1);
+ Avalonia.Controls.Grid.SetRowSpan(_primaryControllerScale, 2);
+ sidebar.Children.Add(_primaryControllerScale);
+ velLabelHost.Child = sidebar;
velRow.Children.Add(velLabelHost);
Avalonia.Controls.Grid.SetColumn(_velHost, 1);
velRow.Children.Add(_velHost);
@@ -479,7 +492,7 @@ public sealed partial class PianoRollView : UserControl
Avalonia.Controls.Grid.SetColumn(_hScroll, 1);
scrollRow.Children.Add(_hScroll);
- var root = new Grid { RowDefinitions = new RowDefinitions("Auto,Auto,*,Auto,Auto") };
+ var root = new Grid { RowDefinitions = new RowDefinitions("Auto,Auto,*,Auto,Auto,Auto") };
root.Children.Add(rulerRow);
Avalonia.Controls.Grid.SetRow(stripRow, 1);
root.Children.Add(stripRow);
@@ -489,9 +502,13 @@ public sealed partial class PianoRollView : UserControl
Avalonia.Controls.Grid.SetRow(_overlayHost, 2);
_overlayHost.Margin = new Thickness(KeysW, 0, 0, 0);
root.Children.Add(_overlayHost);
- Avalonia.Controls.Grid.SetRow(velRow, 3);
- root.Children.Add(velRow);
- Avalonia.Controls.Grid.SetRow(scrollRow, 4);
+ var primaryLane = ResizableLane(velRow, () => PrimaryLaneKey);
+ Avalonia.Controls.Grid.SetRow(primaryLane, 3);
+ root.Children.Add(primaryLane);
+ var controllerRows = ControllerLaneRows();
+ Avalonia.Controls.Grid.SetRow(controllerRows, 4);
+ root.Children.Add(controllerRows);
+ Avalonia.Controls.Grid.SetRow(scrollRow, 5);
root.Children.Add(scrollRow);
Content = root;
@@ -1639,7 +1656,7 @@ public sealed partial class PianoRollView : UserControl
_gridControl.InvalidateVisual();
_vel.InvalidateVisual();
_expr.InvalidateVisual();
- _ctlLane.InvalidateVisual();
+ InvalidateControllerLanes();
NotifyGrid();
}
diff --git a/src/managed/Nota.App/PreferencesWindow.cs b/src/managed/Nota.App/PreferencesWindow.cs
index 9dbea175..41c49eb9 100644
--- a/src/managed/Nota.App/PreferencesWindow.cs
+++ b/src/managed/Nota.App/PreferencesWindow.cs
@@ -1542,9 +1542,12 @@ public sealed partial class PreferencesWindow : NotaWindow
(Loc.T("preferences.drag_in_the_bend_pres"), Loc.T("preferences.draw_the_selected_notes_mpe")),
(Loc.T("preferences.double_click_in_an_mpe"), Loc.T("preferences.add_a_point_on_a")),
(Loc.T("preferences.click_the_bend_lanes_range"), Loc.T("preferences.pick_how_far_the_bend")),
- (Loc.T("preferences.click_the_controller_tab"), Loc.T("preferences.show_a_midi_controller_under")),
+ (Loc.T("preferences.click_the_controller_tab"), Loc.T("preferences.show_primary_controller_lane")),
+ (Loc.T("preferences.click_lane_controller_dropdown"), Loc.T("preferences.choose_lane_controller")),
+ (Loc.T("preferences.controller_lane_buttons"), Loc.T("preferences.manage_controller_lanes")),
(Loc.T("preferences.drag_in_the_sustain_lane"), Loc.T("preferences.draw_a_pedal_block_on")),
(Loc.T("preferences.drag_in_a_controller_lane"), Loc.T("preferences.draw_the_controllers_curve_draws")),
+ (Loc.T("preferences.drag_lane_divider"), Loc.T("preferences.resize_lane_remember_height")),
(Loc.T("preferences.click_a_clip_in_the"), Loc.T("preferences.make_it_the_active_clip")),
("⌘⌥ + wheel", Loc.T("preferences.zoom_rows_vertical_zoom")),
(Loc.T("preferences.click_a_key"), Loc.T("preferences.play_it_on_the_tracks")),
diff --git a/src/managed/Nota.Application/Editing/MidiLaneHeight.cs b/src/managed/Nota.Application/Editing/MidiLaneHeight.cs
new file mode 100644
index 00000000..11de0b67
--- /dev/null
+++ b/src/managed/Nota.Application/Editing/MidiLaneHeight.cs
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+
+using System;
+
+namespace Nota.Application.Editing;
+
+public static class MidiLaneHeight
+{
+ public const double Minimum = 48, Maximum = 480;
+ public static double Normalize(double height, double fallback)
+ => double.IsFinite(height) ? Math.Clamp(height, Minimum, Maximum) : fallback;
+}
diff --git a/src/managed/Nota.Application/Localization/en.json b/src/managed/Nota.Application/Localization/en.json
index 6e2e8ac1..4e75e4fc 100644
--- a/src/managed/Nota.Application/Localization/en.json
+++ b/src/managed/Nota.Application/Localization/en.json
@@ -2878,6 +2878,10 @@
"piano_roll.expression.pressure": "Pressure",
"piano_roll.expression.slide": "Slide",
"piano_roll.expression.vel": "Vel",
+ "piano_roll.lanes.add": "Add controller lane",
+ "piano_roll.lanes.drag_to_resize": "Drag to resize lane",
+ "piano_roll.lanes.hide_keep_data": "Hide controller lane (keep its data)",
+ "piano_roll.lanes.lane": "lane",
"piano_roll.no_selection": "No selection",
"piano_roll.notes": "{0} notes",
"piano_roll.reset_velocity": "Reset velocity",
@@ -2940,6 +2944,7 @@
"preferences.channels_2_16_each_carry": "Channels 2–16 each carry one note with its own pitch bend, pressure and slide (CC74). A controller that announces its range overrides this one. Channel 1 plays as an ordinary keyboard, its pitch wheel and aftertouch moving the whole instrument. ",
"preferences.choose": "Choose…",
"preferences.choose_folder": "Choose {0} folder",
+ "preferences.choose_lane_controller": "Choose a CC, the pitch wheel or channel pressure for that lane",
"preferences.clear_the_device_selection_so": "Clear the device selection · so does a click on the chain's empty space",
"preferences.clear_the_route_volt_aurora": "Clear the route (Volt, Aurora) · pull the cable (Consort)",
"preferences.click_a_clip_in_the": "Click a clip in the clip strip",
@@ -2953,6 +2958,7 @@
"preferences.click_a_rhythm_step": "Click · ⇧ · ⌥ a Rhythm step",
"preferences.click_a_rhythm_voice": "Click a Rhythm voice",
"preferences.click_drag_the_ruler": "Click · drag the ruler",
+ "preferences.click_lane_controller_dropdown": "Click a lane's controller dropdown",
"preferences.click_play_button": "Click play button",
"preferences.click_section": "Click section",
"preferences.click_the_bend_lanes_range": "Click the Bend lane's range",
@@ -2969,6 +2975,7 @@
"preferences.content_folders": "Content folders",
"preferences.content_folders_and_version_history": "Content folders and version history",
"preferences.content_folders_are_unavailable_in": "Content folders are unavailable in this window.",
+ "preferences.controller_lane_buttons": "Controller lane buttons",
"preferences.controllers_nota_listens_to": "Controllers Nota listens to",
"preferences.copied": "Copied",
"preferences.copy_config": "Copy config",
@@ -3049,6 +3056,7 @@
"preferences.drag_in_the_sustain_lane": "Drag in the Sustain lane",
"preferences.drag_jack_jack": "Drag jack → jack",
"preferences.drag_knob": "Drag knob",
+ "preferences.drag_lane_divider": "Drag a lane divider",
"preferences.drag_loop_edge_drag_loop": "Drag loop edge · drag loop brace",
"preferences.drag_note_edge": "Drag note edge",
"preferences.drag_on_the_keys": "Drag on the keys",
@@ -3166,6 +3174,7 @@
"preferences.lower_raise_velocity": "Lower / raise velocity",
"preferences.make_it_the_active_clip": "Make it the active clip (several clips open) · its lock keeps it as a read-only reference",
"preferences.makes_the_whole_interface_larger": "Makes the whole interface larger or smaller. Timeline, piano roll and audio editor zoom work on top of it.",
+ "preferences.manage_controller_lanes": "Add a lane from the sidebar · hide it with the adjacent close button without deleting MIDI data",
"preferences.map_it_to_a_parameter": "Map it to a parameter or the selector · clear its mappings",
"preferences.mappable_as_continuous_controls_a": "Mappable as continuous controls (a knob, a fader); they play no notes",
"preferences.mappable_through_midi_learn_a": "Mappable through MIDI Learn — a mapped button drives the control instead",
@@ -3300,6 +3309,7 @@
"preferences.reset_velocity_from_a_menu": "Reset velocity from a menu · same as the double-click",
"preferences.resize_every_track_at_once": "Resize every track at once",
"preferences.resize_it_snapped_to_bars": "Resize it, snapped to bars",
+ "preferences.resize_lane_remember_height": "Resize that velocity or controller lane · height is remembered",
"preferences.resize_that_end_of_the": "Resize that end of the loop region · move the whole region · ⌥ off the grid",
"preferences.resize_that_row_header_or": "Resize that row (header or lane) · same snaps · double-click goes back to compact",
"preferences.resize_the_track_header_or": "Resize the track (header or lane) · snaps to compact / standard / large · a multi-selection resizes together",
@@ -3369,9 +3379,9 @@
"preferences.shortcuts": "Shortcuts",
"preferences.shorten_lengthen_the_notes_by": "Shorten / lengthen the notes by the grid",
"preferences.shoulder_buttons": "Shoulder buttons",
- "preferences.show_a_midi_controller_under": "Show a MIDI controller under the notes · click it again to pick another CC, the pitch wheel or channel pressure",
"preferences.show_fewer_parameters_on_every": "Show fewer parameters on every opened node",
"preferences.show_playhead_scroll_the_arrangement": "Show playhead · scroll the Arrangement to it without moving it · picks up a paused Follow",
+ "preferences.show_primary_controller_lane": "Show the primary MIDI controller lane",
"preferences.shows_every_note_name_c": "Shows every note name (C, D, E…) on the piano roll's keys instead of only C. Helpful when learning notes.",
"preferences.smooth": "Smooth",
"preferences.snap_to_grid_on_off": "Snap to grid on / off",
diff --git a/src/managed/Nota.Application/Settings.cs b/src/managed/Nota.Application/Settings.cs
index d5c33a62..86edfe50 100644
--- a/src/managed/Nota.Application/Settings.cs
+++ b/src/managed/Nota.Application/Settings.cs
@@ -182,6 +182,8 @@ public sealed class Settings
/// <summary>Piano-roll note audition (#46): notes sound while they are placed, clicked or
/// dragged. The speaker chip in the clip editor's header; on by default.</summary>
public bool PianoRollAudition { get; set; } = true;
+ /// <summary>Logical lane heights keyed by velocity, MPE dimension or MIDI controller.</summary>
+ public Dictionary<string, double> PianoRollLaneHeights { get; set; } = new();
/// <summary>Shift + wheel over a note in the piano roll (specs/063): false — wheel up raises
/// the velocity; true — wheel up lowers it.</summary>
public bool PianoRollVelocityWheelReversed { get; set; }
diff --git a/tests/Nota.SmokeTest/MidiLaneHeightTests.cs b/tests/Nota.SmokeTest/MidiLaneHeightTests.cs
new file mode 100644
index 00000000..6a0ddbf9
--- /dev/null
+++ b/tests/Nota.SmokeTest/MidiLaneHeightTests.cs
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+
+using System.Text.Json;
+using Nota.Application.Editing;
+
+namespace Nota.SmokeTest;
+
+internal static class MidiLaneHeightTests
+{
+ public static IEnumerable<(bool Ok, string Label)> Run()
+ {
+ yield return (JsonSerializer.Deserialize<Settings>("{}")!.PianoRollLaneHeights.Count == 0,
+ "lane heights: older preferences keep the original defaults");
+ foreach (double value in new[] { -10.0, 0, 48, 72, 112, 480, 99999, double.NaN, double.PositiveInfinity })
+ yield return (MidiLaneHeight.Normalize(value, 112) is >= 48 and <= 480,
+ $"lane heights: invalid and boundary size {value} remains usable");
+ var saved = new Settings { PianoRollLaneHeights = new()
+ { ["Velocity"] = 122, ["extra:0:cc:1"] = 157, ["extra:1:cc:11"] = 197 } };
+ var loaded = JsonSerializer.Deserialize<Settings>(JsonSerializer.Serialize(saved))!;
+ yield return (loaded.PianoRollLaneHeights.Count == 3 && saved.PianoRollLaneHeights.All(
+ pair => loaded.PianoRollLaneHeights.GetValueOrDefault(pair.Key) == pair.Value),
+ "lane heights: independently sized velocity and CC lanes survive settings reload");
+ }
+}
diff --git a/tests/Nota.SmokeTest/Program.cs b/tests/Nota.SmokeTest/Program.cs
index c261ae5e..3b18eeb8 100644
--- a/tests/Nota.SmokeTest/Program.cs
+++ b/tests/Nota.SmokeTest/Program.cs
@@ -134,6 +134,12 @@ if (args.Length >= 1 && args[0] == "--audiocheck")
return f == 0 ? 0 : 1;
}
+if (args.Length >= 1 && args[0] == "--midi-lane-heights")
+{
+ foreach (var (ok, label) in MidiLaneHeightTests.Run()) Check(ok, label);
+ return failures == 0 ? 0 : 1;
+}
+
// Design and localization checks alone, without the engine tests: `--localization`.
// NOTA_LOC_WRITE_BASELINE=1 rewrites LocalizationAllowList.txt; NOTA_LOC_STRICT=1 fails on any
// text French lacks.
@@ -15482,6 +15488,9 @@ foreach (var (ok, label) in TapTempoTests.Run()) Check(ok, label);
Console.WriteLine("-- transport display --");
foreach (var (ok, label) in TransportDisplayTests.Run()) Check(ok, label);
+Console.WriteLine("-- MIDI lane heights --");
+foreach (var (ok, label) in MidiLaneHeightTests.Run()) Check(ok, label);
+
Console.WriteLine("-- velocity wheel --");
foreach (var (ok, label) in VelocityWheelTests.Run()) Check(ok, label);
Console.WriteLine("-- velocity reset --");