Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.
Tasks: Reset a note's velocity to the default
Input: spec.md, plan.md, research.md, data-model.md, contracts/velocity-lane.md
Tests: the pure rule gets smoke checks (spec SC-003). The lane's pointer wiring has no headless harness; it is checked by hand from quickstart.md.
Format: [ID] [P?] [Story] Description. Paths are from the repo root.
Phase 1: Setup
- T001 Branch
feat/velocity-reset-defaultfromdevelop(done with the spec); confirmscripts/build.shis green before the first edit (baseline).
Phase 2: Foundational (blocks every story)
- T002 Create
src/managed/Nota.Application/Editing/VelocityReset.cs(SPDX header, comment header saying why it exists, namespaceNota.Application.Editing):public const float Default = 0.8f;IsDefault(float v)true when|v − Default| < 0.5 / 127;Targets(IReadOnlyCollection<int> selection, int hit, int count, Func<int,bool> isLocked, IReadOnlyList<float> velocities)returning the indices to reset: the selection's unlocked notes whenhitis in it, else{hit}; locked and out-of-range indices excluded; notes already at the default excluded (data-model: "Reset targets"). The view writesDefaultitself; there is noApply. - T003 [P] Create
tests/Nota.SmokeTest/VelocityResetTests.cswithpublic static IEnumerable<(bool Ok, string Label)> Run()in the style ofVelocityWheelTests.cs: default is 0.8; stem outside the selection → only that note; stem inside → every selected note; a locked note is never a target; a note at 0.8 and one within half a MIDI step of it are not targets (nothing to do → empty); a note one MIDI step away is a target; out-of-range indices are dropped. Register it intests/Nota.SmokeTest/Program.csat both placesVelocityWheelTests.Run()is called (the full run and the--alone run, lines ≈308 and ≈15323). - T004 Make the default single-sourced in
src/managed/Nota.App/PianoRollView.cs:s_lastVelstarts atVelocityReset.Default(line ≈241) andKeyVelocity(line ≈1850) reads it; update the comment aboves_lastVel("0.8") to point at the constant.
Checkpoint: dotnet run --project tests/Nota.SmokeTest -c Release -- --velocity-reset (add the alone-run flag next to the others in Program.cs) passes.
Phase 3: User Story 1 — Put one velocity back (P1) 🎯 MVP
Goal: double-click a stem → that note goes to 0.8; one ⌘Z returns to the value before the double-click.
Independent test: quickstart §2, steps 1–3, 6, 7.
- T005 [US1] In
PianoRollView.VelocityLane.OnPointerPressed(src/managed/Nota.App/PianoRollView.cs, ≈line 2815): stop closing the burst unconditionally. Close it (_o.EndVelocityWheel()) unless this is the second press of a double-click (e.ClickCount == 2) on the same stem as the open lane burst; remember that stem when a lane gesture opens the burst. - T006 [US1] Make the lane's click/drag a velocity burst (research R3): on the first press of a gesture, open
_velWheelBurstand, whenHasLivePath, seed the undo step withCommitNotes(_notes.ToList(), _owner.ToList(), seed: true)beforeApply; push changes withPushLiveinstead of committing at release whenHasLivePath; a Session slot (no live path) keeps its notes in the view and commits when the burst closes (EndVelocityWheelalready does). Restart_velWheelTimeron release (extract the timer start fromWheelVelocityinto a smallRestartVelocityBurstTimer()and call it from both). Set_velWheelNote = _velNotesoRememberruns at close.OnPointerReleasedno longer callsCommitNotes()itself. - T007 [US1] On
ClickCount == 2(after T005's guard): computeVelocityReset.Targets(...)for the hit stem, set each target's velocity toVelocityReset.Default,PushLive/hold as T006,Invalidate(),Changed?.Invoke(); no targets → do nothing (no seed, no step). Keep the burst open; do not start a drag for the second press (_drag = false). - T008 [US1] Verify by hand (quickstart §2 steps 1–3, 6, 7; §4 playing loop and locked clip). Fix what the pass finds.
Checkpoint: a single note resets with one double-click and one undo.
Phase 4: User Story 2 — Put a selection back (P2)
Goal: the stem of a selected note resets the whole selection; a stem outside the selection resets only itself and becomes the selection.
Independent test: quickstart §2 steps 4–5.
- T009 [US2] In the double-click branch of T007, apply the selection rule from
VelocityReset.Targets(selected stem → whole selection kept; other stem →_selection.Clear(); _selection.Add(hit)as a single press already does, afterSettlePlacement()as the existing press code does). Do not let the first press's group-drag state (_grabbed) carry into the reset. - T010 [US2] Verify by hand (quickstart §2 steps 4–5): both notes at 0.8 after one double-click; one ⌘Z restores both; the unselected stem case moves the selection.
Phase 5: User Story 3 — Reset from a menu (P2)
Goal: right-click a stem → Reset velocity.
Independent test: quickstart §3.
- T011 [US3] In
VelocityLane, handle the right press: pick the stem withNearest, none → return (no menu); apply the selection rule of T009; open aMenuFlyoutwithMenuKit.Item(Loc.T("Reset velocity"), click: …, enabled: targets.Count > 0)anchored on the lane (pattern:PianoRollView.Expression.csShowClearMenu, but withMenuKit.Itemfor the disabled state). The click handler runs the same reset path as T007 as its own burst (open, seed, apply, close at once:EndVelocityWheel()). - T012 [P] [US3] Add the French entry for
Reset velocitytosrc/managed/Nota.App/Languages/fr.json(Réinitialiser la vélocité). - T013 [US3] Verify by hand (quickstart §3) including: the Pres / Bend tabs keep their own menus; English and French (
NOTA_UI_LANGUAGE=fr).
Phase 6: User Story 4 — Documented (P3)
Goal: the gestures are findable.
- T014 [US4] Run the
nota-shortcutsskill. Insrc/managed/Nota.App/PreferencesWindow.cs(Piano roll group, next toDrag velocity stem, ≈line 1529) add two rows:Double-click a velocity stem→Put the note back to the default velocity (0.8) · the whole selection's when the note is selected;Right-click a velocity stem→Reset velocity from a menu. Add both rows' texts tofr.json(T014 and T012 may share one edit pass). Check the pane on screen at 100 % in English and French. - T015 [P] [US4]
CHANGELOG.md[Unreleased]Added entry (user-facing, in the file's voice); run thenota-featuresskill forFEATURES.md(the Piano Roll bullet list: add the reset next to the velocity stem line). - T016 [P] [US4] Run the
nota-docsskill: piano-roll page of the user manual in../nota-docs, EN + RU, pluscoverage.yml(sources:PianoRollView.cs,VelocityReset.cs);npm run build && npm run checkthere. A separate PR in that repo. Also:scripts/shortcuts.mjscould not read the app's Shortcuts list since the strings went throughLoc.T; it now reads through the wrapper andnpm run shortcutsregeneratesreference/shortcuts(EN + RU), which had drifted from the app.
Phase 7: Polish and gate
- T017
scripts/build.shgreen (macOS; run it withMSBUILDDISABLENODEREUSE=1 DOTNET_CLI_USE_MSBUILD_SERVER=0and an idle machine — the two "overloaded" timing checks are load-sensitive). - T018
/speckit-convergereports Converged; tick the boxes above. - T019 Take before/after screenshots of the lane (the menu open on a stem, English) for the PR description, crop to the window; open the PR with the
nota-prskill (branch offdevelop,(feat) …, your noreply email, no AI trailer); the docs PR follows.
Dependencies
- T001 → T002 → T003, T004 (T003 and T004 are independent files).
- US1 (T005–T008) needs T002 and T004. US2 (T009–T010) needs US1. US3 (T011–T013) needs T006's burst helpers and T002. US4 (T014–T016) can start once the gesture texts are fixed (after T011).
- Polish needs everything above.
Parallel opportunities
- T003 ∥ T004 (different files).
- T012 ∥ T011 once the key text is fixed; T015 ∥ T016.
Implementation strategy
MVP = Phase 2 + User Story 1: a working double-click on one stem with one undo step, shippable on its own. Add the selection rule (US2), the menu (US3), then the docs (US4); the PR can carry all four since they are one small feature in one file plus a helper.
Phase 8: Convergence
- T020 Leave tool-preview (ghost) notes out of the reset: in
src/managed/Nota.App/PianoRollView.csVelocityLane.ResetVelocityandCanReset, passi => _o.IsLocked(i) || _o.IsGhost(i)instead of_o.IsLockedtoVelocityReset.Targets, per FR-007 and the Edge Cases ("ghost notes … are not reset") (partial) - T021 Review follow-up (nota-daw/nota#418): a press within 6 px of a stem's cap is a grab, not a set (
VelocityLane._grabCapinsrc/managed/Nota.App/PianoRollView.cs), so a double-click on a note at the default adds no undo step, per FR-003 and FR-005 (partial);VelocityReset.Targetstracks duplicates in aHashSetinstead of scanning the result list.