diff --git a/CLAUDE.md b/CLAUDE.md index 5214a3a..73b9e8a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Repo identity and current state -The CMake project and binary are now named `reaper_reasampler`. This is **ReaSampler** — a per-project audio sample-bank capture tool that now builds TWO artifacts: the REAPER extension (`reaper_reasampler`) AND **ReaSampler 9000**, a Windows-only VST3 sampler instrument (`reasampler_9000.vst3`, `src/vst/`, second CMake target `reasampler_vst`, gated on the vendored `vendor/vst3sdk` submodule slice). The MPE modules (`mpe_model`, `mpe_view`) have been removed. M0–M8 are complete (bank_model, peaks, capture offline+realtime, persist, bank_panel, insert, capture action family, RealtimeRecordBackend, tail T1+T2+T1-followons). Phase B multi-bank (B1–B5, B-cap), Phase D1/D2 Design View (D1–D5, D2-W1–W3-B), Phase V versioning/beta-channel (V1/V3, V4), M10 provenance + re-capture from source, Phase R Reclaim (R1–R3: prune-reconcile core, dry-run shell, guarded deletion + action + panel button), M11 in full (batch capture, action-button strip + keybinding labels, conform-on-insert verified-extant, native OS drag-out), Phase L L1 (shared LICE drawing kit: `theme`/palette module, `component_geometry` geometry helpers, `draw_kit` shell, GDI DrawText retired in `bank_panel`), Phase L L2 (dock-panel layout redesign: `action_bar` pure task-grouped layout module, full M11-aware button inventory placed by task cluster, `bank_panel` redesigned through the L1 kit), Phase L L4 (dock-panel button layout enhancement: three-zone layout — top capture/placement/maintenance toolbar, bottom Design-View tagging/switching toolbar, footer narrow-toggle + Tail-button + Prune; `footer_bar` pure module + `footer_bar_tests`; `ActionCluster::Tagging`/`Switching` in `action_bar`), Phase L L5 (dock-panel button refinements: top-bar overflow menu for Batch Items/Batch Razor/Capture RT via `overflow_menu` pure module; custom LICE-kit hover-delay tooltips via `tooltip` pure module; four opposite-mode Item/Track tag buttons + Show Both on the bottom toolbar; Toggle + Activate-Arrange/Design buttons removed; grouping spacing widened — `mode_enable` pure opposite-mode enablement predicate), Phase L L6 (toolbar polish: single-row short-label button faces — keybinding micro sub-row removed from `ActionBarSlot`, keybinding now shown in hover tooltip as "`phrase — binding`"; Cancel RT moved from visible bar into the overflow menu — More (⋯) now lists Batch Items / Batch Razor / Capture RT / Cancel RT; visible top-bar cluster order Capture → Maintenance → Placement; toolbar height 40→28 px), Phase L L7 (capture ordering, card metadata, and selection styling: per-bank `SlotMap` (id→slot) in `bank_book` — gap-preserving persisted display order, `reorderSample`/`replaceSample`/`orderedSampleIds`/`reconcileSlots` mutators; `captureTimeSigNum`/`captureTimeSigDenom` stamped on `Sample` at capture via `TimeMap_GetTimeSigAtTime`; `card_drag` pure module — gesture precedence + SWELL stock cursor cues; `card_meta` pure module — bars.beats.subdivisions + s.ms formatters; `bank_panel` sparse-grid rendering with gap cells, drop dispatch + cursor cues, metadata overlay, tertiary-border selection), Phase L L3 (VST editor + embed-strip restyle: `reasampler_editor.cpp` + `reasampler_embed.cpp` restyled through the L1 kit — REAPER-grey neutrals + three pastel accents, pastel spectral keyboard strip + zone bars as the signature surface with active zone lifting to `accent/primary` + static glow, hover/pressed/drag states throughout; local `kCol*` forest-green palette retired; GDI `DrawTextA` path retired in both VST shells; VST3 class UID unchanged; Phase L now complete), and Phase S (S1–S18 complete; S13 cross-artifact relay deferred): VST3 sampler instrument `reasampler_9000.vst3` — voice engine (`sampler_core`), zone payload (`sample_map`), pitch-preserve OLA (`pitch_shift`), bank change-detection (`bank_sync`), IPC bridge (`bridge_marshal`), editor UI modules (`editor_geometry`, `keyboard_strip`, `waveform_view`, `capture_browser`, `browser_scroll`, `note_entry`, `param_slider`, `embed_strip`), VST3 shells (`reasampler_processor`, `reasampler_editor`, `reasampler_embed`, `reaper_bridge` READ-ONLY bank consumer, `vst_entry`); extension additions: `instrument_drop` pure FX-button blob builder (S17), `assignment_request` pure ingest-assign wire (S8), `ingest` shell (S8: docked-panel drop → capture/import + assign), `instrument_drop_win` shell (S17: `TrackFX_AddByName` + vst_chunk inject, rollback on fail); `drag_out` extended with `InstrumentDrop` third gesture; S18 channel isolation forks VST3 binary to `reasampler_9000_beta.vst3` alongside the beta extension have all landed. M9 slots abandoned (Daniel, 2026-07-27). Phase S S-VIEW Wave 1 + Wave 2 fully landed (2026-07-27, `Merge pS-w2-t1-shell` + `Merge pS-w2-t2-velcurve`, 52/52 green): three-view editor (Sample home face — hero waveform + envelope overlay + draggable nodes + fenced root + preview-trigger + velocity knob + Modes-and-down control strip; Browse full-window modal picker with confirm/cancel; Zone view retained + wired with piano-key pattern + key-track control); `envelope_overlay` (params→polyline) + `envelope_edit` (node hit-test + clamped/monotonic inverse map) wired in `reasampler_editor.cpp`; `trigger_seam` pure module (Trigger frames↔fraction converter, startFrame-aware, unit-tested); preview button + velocity knob UI wired (RT-safe off-thread preview-note mailbox); key-track UI control on Zone + Sample; two-tone piano-key overlay drawn; `velocity_curve` pure module (Fritsch–Carlson monotone cubic Hermite spline eval + control-point editing + hit-test/inverse-map; `velocity_curve_tests`); zones payload bumped to v7 (`velocityCurve` on `PerformanceZone`, pre-v7 blobs lift to flat y=1); `Voice::start()` now applies `curve.eval(velocity)` — default is flat y=1 (replaces prior linear `velocity/127`, deliberate non-back-compat change, Daniel-approved). S-VIEW-10 (velocity-curve editor UI, Wave 3) remains open. The *discipline* — pure REAPER-free testable core split from REAPER-facing shells — is **preserved** throughout. +The CMake project and binary are now named `reaper_reasampler`. This is **ReaSampler** — a per-project audio sample-bank capture tool that now builds TWO artifacts: the REAPER extension (`reaper_reasampler`) AND **ReaSampler 9000**, a Windows-only VST3 sampler instrument (`reasampler_9000.vst3`, `src/vst/`, second CMake target `reasampler_vst`, gated on the vendored `vendor/vst3sdk` submodule slice). The MPE modules (`mpe_model`, `mpe_view`) have been removed. M0–M8 are complete (bank_model, peaks, capture offline+realtime, persist, bank_panel, insert, capture action family, RealtimeRecordBackend, tail T1+T2+T1-followons). Phase B multi-bank (B1–B5, B-cap), Phase D1/D2 Design View (D1–D5, D2-W1–W3-B), Phase V versioning/beta-channel (V1/V3, V4), M10 provenance + re-capture from source, Phase R Reclaim (R1–R3: prune-reconcile core, dry-run shell, guarded deletion + action + panel button), M11 in full (batch capture, action-button strip + keybinding labels, conform-on-insert verified-extant, native OS drag-out), Phase L L1 (shared LICE drawing kit: `theme`/palette module, `component_geometry` geometry helpers, `draw_kit` shell, GDI DrawText retired in `bank_panel`), Phase L L2 (dock-panel layout redesign: `action_bar` pure task-grouped layout module, full M11-aware button inventory placed by task cluster, `bank_panel` redesigned through the L1 kit), Phase L L4 (dock-panel button layout enhancement: three-zone layout — top capture/placement/maintenance toolbar, bottom Design-View tagging/switching toolbar, footer narrow-toggle + Tail-button + Prune; `footer_bar` pure module + `footer_bar_tests`; `ActionCluster::Tagging`/`Switching` in `action_bar`), Phase L L5 (dock-panel button refinements: top-bar overflow menu for Batch Items/Batch Razor/Capture RT via `overflow_menu` pure module; custom LICE-kit hover-delay tooltips via `tooltip` pure module; four opposite-mode Item/Track tag buttons + Show Both on the bottom toolbar; Toggle + Activate-Arrange/Design buttons removed; grouping spacing widened — `mode_enable` pure opposite-mode enablement predicate), Phase L L6 (toolbar polish: single-row short-label button faces — keybinding micro sub-row removed from `ActionBarSlot`, keybinding now shown in hover tooltip as "`phrase — binding`"; Cancel RT moved from visible bar into the overflow menu — More (⋯) now lists Batch Items / Batch Razor / Capture RT / Cancel RT; visible top-bar cluster order Capture → Maintenance → Placement; toolbar height 40→28 px), Phase L L7 (capture ordering, card metadata, and selection styling: per-bank `SlotMap` (id→slot) in `bank_book` — gap-preserving persisted display order, `reorderSample`/`replaceSample`/`orderedSampleIds`/`reconcileSlots` mutators; `captureTimeSigNum`/`captureTimeSigDenom` stamped on `Sample` at capture via `TimeMap_GetTimeSigAtTime`; `card_drag` pure module — gesture precedence + SWELL stock cursor cues; `card_meta` pure module — bars.beats.subdivisions + s.ms formatters; `bank_panel` sparse-grid rendering with gap cells, drop dispatch + cursor cues, metadata overlay, tertiary-border selection), Phase L L3 (VST editor + embed-strip restyle: `reasampler_editor.cpp` + `reasampler_embed.cpp` restyled through the L1 kit — REAPER-grey neutrals + three pastel accents, pastel spectral keyboard strip + zone bars as the signature surface with active zone lifting to `accent/primary` + static glow, hover/pressed/drag states throughout; local `kCol*` forest-green palette retired; GDI `DrawTextA` path retired in both VST shells; VST3 class UID unchanged; Phase L now complete), and Phase S (S1–S18 complete; S13 cross-artifact relay deferred): VST3 sampler instrument `reasampler_9000.vst3` — voice engine (`sampler_core`), zone payload (`sample_map`), pitch-preserve OLA (`pitch_shift`), bank change-detection (`bank_sync`), IPC bridge (`bridge_marshal`), editor UI modules (`editor_geometry`, `keyboard_strip`, `waveform_view`, `capture_browser`, `browser_scroll`, `note_entry`, `param_slider`, `embed_strip`), VST3 shells (`reasampler_processor`, `reasampler_editor`, `reasampler_embed`, `reaper_bridge` READ-ONLY bank consumer, `vst_entry`); extension additions: `instrument_drop` pure FX-button blob builder (S17), `assignment_request` pure ingest-assign wire (S8), `ingest` shell (S8: docked-panel drop → capture/import + assign), `instrument_drop_win` shell (S17: `TrackFX_AddByName` + vst_chunk inject, rollback on fail); `drag_out` extended with `InstrumentDrop` third gesture; S18 channel isolation forks VST3 binary to `reasampler_9000_beta.vst3` alongside the beta extension have all landed. M9 slots abandoned (Daniel, 2026-07-27). Phase S S-VIEW Wave 1 + Wave 2 + Wave 3 fully landed (2026-07-27, `Merge pS-w2-t1-shell` + `Merge pS-w2-t2-velcurve` + `Merge pS-w3-velcurve-ui`): three-view editor (Sample home face — hero waveform + envelope overlay + draggable nodes + fenced root + preview-trigger + velocity knob + Modes-and-down control strip; Browse full-window modal picker with confirm/cancel; Zone view retained + wired with piano-key pattern + key-track control); `envelope_overlay` (params→polyline) + `envelope_edit` (node hit-test + clamped/monotonic inverse map) wired in `reasampler_editor.cpp`; `trigger_seam` pure module (Trigger frames↔fraction converter, startFrame-aware, unit-tested); preview button + velocity knob UI wired (RT-safe off-thread preview-note mailbox); key-track UI control on Zone + Sample; two-tone piano-key overlay drawn; `velocity_curve` pure module (Fritsch–Carlson monotone cubic Hermite spline eval + control-point editing + hit-test/inverse-map + `pixelFromPoint`/`pointFromPixel` coordinate helpers; `velocity_curve_tests`); zones payload bumped to v7 (`velocityCurve` on `PerformanceZone`, pre-v7 blobs lift to flat y=1); `Voice::start()` now applies `curve.eval(velocity)` — default is flat y=1 (replaces prior linear `velocity/127`, deliberate non-back-compat change, Daniel-approved); S-VIEW-10 velocity-curve editor UI landed (Wave 3) — draggable spline-point editor drawn through the L1 kit in both the Sample view and Zone per-zone param panel, coordinate math via `pixelFromPoint`/`pointFromPixel`, snapshot-at-grab → off-audio-thread commit, no schema change. **Phase S S-VIEW complete (S-VIEW-1 through S-VIEW-10 all landed).** The *discipline* — pure REAPER-free testable core split from REAPER-facing shells — is **preserved** throughout. CONTEXT.md is the authoritative spec and build roadmap. Read it first for any non-trivial task. Every REAPER API name cited there is correct-by-intent; verify argument order, types, and flag values against `vendor/reaper-sdk/sdk/reaper_plugin_functions.h` before use. diff --git a/COMPLETED.md b/COMPLETED.md index 1675bb6..58b5a09 100644 --- a/COMPLETED.md +++ b/COMPLETED.md @@ -2277,8 +2277,9 @@ shrink below the floor. Final tuning deferred to T-SHELL. # Phase S — editor view-model redesign (three views: Sample / Browse / Zone) > **Additive Phase S sub-phase (S-VIEW; Daniel, 2026-07-27, r9).** Merged to dev (Wave 1 -> 2026-07-27, Wave 2 2026-07-27 — `Merge pS-w2-t1-shell` + `Merge pS-w2-t2-velcurve`). -> Integrated suite 52/52 green. S-VIEW-10 (velocity-curve editor UI) remains open in `PLAN.md`. +> 2026-07-27, Wave 2 2026-07-27 — `Merge pS-w2-t1-shell` + `Merge pS-w2-t2-velcurve`, +> Wave 3 2026-07-27 — `Merge pS-w3-velcurve-ui`). Integrated suite green. +> **S-VIEW complete — all ten points landed.** ## S-VIEW-1 — three-view navigation model **Goal:** Retire the flat Browser|Zones toggle; introduce Sample (home/default), Browse (modal @@ -2416,3 +2417,27 @@ accepted by Daniel. flat y=1; `velocity_curve_tests` CTest target. - [x] Applied at `Voice::start()` — `velocityGain_` now set from `curve.eval(velocity)`. - [x] Default flat y=1 — back-compat caveat documented and accepted. + +--- + +## S-VIEW-10 — velocity-curve editor UI (shell, Sample + Zone views) +**Goal:** Draggable transfer-curve editor rendered through the L1 kit in BOTH the Sample view (a +curve box beside the hero band) and the Zone per-zone param panel: the velocity→amp spline drawn +as the `eval` polyline over a 0–127 × 0–1 box, with draggable control points — add on empty-click +(inside the mapping box), move, Alt-click delete interior, drag-off-box delete with a warn-state +affordance. All coordinate math in the pure `velocity_curve` module (two new tested helpers +`pixelFromPoint`/`pointFromPixel`); reads/writes the existing per-`PerformanceZone` +`velocityCurve` field (zones payload v7 — no schema change). Mirrors the S-VIEW-3 envelope-node +interaction grammar (snapshot-at-grab → off-audio-thread commit). Shell: `reasampler_editor.cpp`. + +- [x] `pixelFromPoint` / `pointFromPixel` helpers added to `velocity_curve` — coordinate mapping + between curve-point space (velocity 0–127, amp 0–1) and pixel box; unit-tested in + `velocity_curve_tests`. +- [x] Curve editor drawn in Sample view (curve box beside hero waveform band): `eval` polyline in + accent hue over 0–127 × 0–1 grid, draggable node markers per control point. +- [x] Add on empty-space click inside the box; move on drag; Alt-click to delete interior points; + drag-off-box delete with warn-state affordance. +- [x] Same editor in Zone per-zone param panel (one curve per zone, same interaction grammar). +- [x] Snapshot-at-grab → off-audio-thread commit, matching S-VIEW-3 envelope-node pattern. +- [x] Reads/writes existing `velocityCurve` on `PerformanceZone`; zones payload remains v7 — no + schema change. diff --git a/PLAN.md b/PLAN.md index 3043223..4242dda 100644 --- a/PLAN.md +++ b/PLAN.md @@ -207,16 +207,8 @@ fenced root + preview-trigger + control strip) with no scroll; Browse opens as a Sample, select+confirm loads a new capture; Zone opens on its own button, key-tracking + the piano-key pattern work; drop-a-capture-onto-FX instantiates a playing instance. -- [x] **S-VIEW-1 through S-VIEW-9** — all landed (Wave 1 core + Wave 2 shell). See `COMPLETED.md` +- [x] **S-VIEW-1 through S-VIEW-10** — all landed (Wave 1 core + Wave 2 shell + Wave 3 velocity-curve editor UI). See `COMPLETED.md` §S-VIEW for the full entry set. -- [ ] **S-VIEW-10 — velocity-curve editor UI (shell, Sample + Zone views, r10).** A compact transfer- - curve editor band on the **Sample view** adjacent to the envelope overlay (X = velocity 0–127, Y = - amp 0–1; spline curve traced in an accent hue; draggable node markers per control point; add on - empty-space click, delete on modifier-click/drag-off), drawn through the **L1 kit**; the same - editor in the Zone per-zone param panel (one curve per zone). Shell (`reasampler_editor.cpp`) does - the LICE draw + mouse routing; **all geometry/hit-test/clamp math in the pure `velocity_curve` - module**. Foundation (S-VIEW-9) is landed — unblocked on the module; needs the Sample-view - curve-editor UI. ### Phase S editor prerequisites — routed to staff-engineer (bug + default; NOT design forks)