Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.
Implementation Plan: Piano roll vertical zoom
Branch: 019-piano-roll-vertical-zoom | Date: 2026-10-16 | Spec: spec.md
Input: Feature specification from /specs/019-piano-roll-vertical-zoom/spec.md
Summary
Make the piano roll's row height variable (6–36 px, default 12) and drive it with
⌘⌥ + wheel, a vertical drag on the keys column and ⌥ + trackpad pinch, all anchored on
the pitch under the pointer, plus a Fit to notes command (⇧F, header button, command
palette). The fixed RowH constant in PianoRollView becomes instance state saved in the
existing per-clip view state. UI-only: no engine, ABI or project-format change.
Nota: Read Before Planning
- UI work →
DESIGN.md(Studio) and thenota-designskill — the Fit button is a neutral header control, not accent. - Anything →
CONTRIBUTING.md. - Engine / instrument / build docs: not touched.
Technical Context
Language/Version: C# / .NET 10 (managed app only)
Primary Dependencies: Avalonia 12.0.3 (existing) — uses
InputElement.PointerTouchPadGestureMagnifyEvent; no new dependency
Storage: N/A — per-clip view state stays in memory for the app session
Audio-Thread Impact: None: UI-only change; no engine calls added
Testing: Smoke test unchanged (no engine change); feature verified with the headless Avalonia harness and manual scenarios in quickstart.md
Target Platform: macOS, Windows, Linux desktop (pinch: wherever Avalonia raises the touchpad magnify event — macOS)
Project Type: desktop app
Performance Goals: Zoom follows the wheel/drag at display rate; the grid already redraws all 88 rows per frame, unchanged in cost
Constraints: Existing wheel meanings unchanged; ⇧F must not sound a note while the grid has focus; zoom ignored mid note-gesture
Scale/Scope: ~4 files edited, no new source files
Constitution Check
GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.
| Principle | Status | Note |
|---|---|---|
| I. Real-time audio safety | ✅ Pass | No audio-thread code touched |
| II. Boundary discipline | ✅ Pass | No ABI change, no JUCE |
| III. Licensing hygiene | ✅ Pass | No new files expected; any new file gets the SPDX header; no dependency |
| IV. Verification gate | ✅ Pass | scripts/build.sh must stay green; no engine behaviour change → no smoke-test extension |
| V. One logical change per PR | ✅ Pass | One feature, one PR |
| VI. Docs in sync | ✅ Planned | CHANGELOG [Unreleased] Added entry; nota-features, nota-docs, nota-shortcuts skills |
| VII. Spec-first | ✅ Pass | spec → clarify → plan done |
| VIII. Safety rules not weakened | ✅ Pass | — |
Post-design re-check: still all pass — the design (research R1–R10) stays inside
Nota.App and Nota.Application/Palette.
Design
See research.md for decisions and alternatives. In short:
- Row height as state (R1):
RowH→ instance property;MinRowH/DefaultRowH/MaxRowH= 6/12/36;RangeH,PitchToY,YToPitchbecome instance members; nestedKeysColumn/NoteGridread_o.RowH. - Anchored zoom (R2):
ZoomRowsAt(factor, viewportY)andSetRowHeightAt(h, viewportY)resize_keys/_gridControland queue the anchored offset via the existing_pendingVOffset/ApplyPendingVOffsetpath;SaveView. - Inputs (R3–R6): ⌘⌥ branch first in
NoteGrid.OnPointerWheelChanged+ newKeysColumn.OnPointerWheelChanged; keys-column press/drag/release with capture (exponential 0.01/px); ⌥ +PointerTouchPadGestureMagnifyon the grid; all ignored while_drag != Mode.None. - Fit to notes (R7):
FitToNotes()on the view; ⇧F inNoteGrid.OnKeyDown(handled, so the window's note map never sees it);roll.fitNotesinCommandCatalog+MainWindow.Commands; a Fit icon button inClipEditorView's header. - Persistence (R8):
ViewStategainsRowH; restored and clamped inSetNotes; default 12 for new clips. - Shortcuts list: four rows in
PreferencesWindow's "Piano roll" section (contract).
Project Structure
Documentation (this feature)
specs/019-piano-roll-vertical-zoom/
├── plan.md # this file
├── research.md # Phase 0
├── data-model.md # Phase 1
├── quickstart.md # Phase 1
├── contracts/
│ └── ui-gestures.md # Phase 1: gestures, command, header control, shortcuts rows
└── tasks.md # Phase 2 (/speckit-tasks)
Source Code (repository root)
src/managed/
├── Nota.App/
│ ├── PianoRollView.cs # RowH state, zoom/fit, wheel/drag/pinch/⇧F, view state
│ ├── ClipEditorView.cs # header Fit button
│ ├── MainWindow.Commands.cs # bind roll.fitNotes
│ └── PreferencesWindow.cs # Shortcuts rows
└── Nota.Application/
└── Palette/CommandCatalog.cs # roll.fitNotes entry
CHANGELOG.md, FEATURES.md # docs; ../nota-docs via the nota-docs skill
Structure Decision: Presentation-only change inside the existing Nota.App piano
roll and the palette catalog in Nota.Application; no new projects or files.
Complexity Tracking
No constitution violations — nothing to justify.