Reflect M0 landing in docs

Retarget README to ReaSampler and current build targets; reconcile
CLAUDE.md repo-identity + targets table to reaper_reasampler; archive
Milestone 0 from PLAN.md into new COMPLETED.md.
This commit is contained in:
2026-07-21 21:27:31 -04:00
parent acfc9daabc
commit c60b3acc2b
4 changed files with 118 additions and 32 deletions
+3 -3
View File
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Repo identity and current state
The on-disk scaffold is named `reaper_mpeview` (CMake project name, binary prefix, source filenames). CONTEXT.md repurposes it into **ReaSampler** — a per-project audio sample-bank capture tool. The existing MPE modules (`mpe_model`, `mpe_view`) are being **replaced** by the sampler module set (`bank_model`, `peaks`, `capture`, `insert`, `bank_panel`, `persist`, `actions`). The *discipline* — pure REAPER-free testable core split from REAPER-facing shells — is being **preserved**, not replaced. When the code says "mpe" and the spec says "sampler", this is why.
The CMake project and binary are now named `reaper_reasampler`. This is **ReaSampler** — a per-project audio sample-bank capture tool. The MPE modules (`mpe_model`, `mpe_view`) have been removed; `bank_model` exists as a pure-core placeholder (Milestone 0). The remaining sampler module set (`peaks`, `capture`, `insert`, `bank_panel`, `persist`, `actions`) is being built out per CONTEXT.md / PLAN.md. 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.
@@ -26,8 +26,8 @@ Two targets:
| Target | Kind | Purpose |
|---|---|---|
| `mpe_model_tests` | executable | Pure unit tests — no REAPER, no DAW. This is the fast iteration loop. |
| `reaper_mpeview` | loadable module | The actual extension binary (`.dll` / `.dylib` / `.so`). |
| `bank_model_tests` | executable | Pure unit tests — no REAPER, no DAW. This is the fast iteration loop. |
| `reaper_reasampler` | loadable module | The actual extension binary (`.dll` / `.dylib` / `.so`). |
### macOS / Linux: SWELL dialog resources
+32
View File
@@ -0,0 +1,32 @@
# COMPLETED.md — ReaSampler landed milestones
Completed milestone entries removed from `PLAN.md`. Each entry preserves its
original Goal, Verify, and checklist points with boxes marked done.
---
## Milestone 0 — Transition scaffold: reaper_mpeview → ReaSampler
**Goal:** Retire the MPE scaffold and stand up the sampler's pure core in its
place, preserving the pure-core / REAPER-shell split.
**Verify:** `cmake -B build -S .` configures clean; `cmake --build build` builds
the renamed extension target and the pure-core test target; `ctest --test-dir
build` is green with the new `bank_model` + `peaks` suites present.
- [x] Delete `src/mpe_model.{h,cpp}` and `src/mpe_view.{h,cpp}`; remove
`tests/test_mpe_model.cpp`.
- [x] Rename the CMake `project()` and the extension MODULE target from
`reaper_mpeview` to `reaper_reasampler` (binary `OUTPUT_NAME` likewise);
update `PREFIX ""` / platform SUFFIX blocks to the new target name.
- [x] Replace the pure `mpe_model` static lib + `mpe_model_tests` executable with
`bank_model` (pure static lib) + `bank_model_tests`; keep the CTest wiring.
- [x] Repoint `src/main.cpp`: drop the `mpe_view.h` include and all `MpeView_*`
calls (toggle / IsOpen / OnTimer / Cleanup); stub the extension entry so it
loads, logs to console, and registers nothing MPE-specific. The
`command_id` / `gaccel` / `hookcommand` registration *pattern* is preserved for
reuse (CLAUDE.md §REAPER extension contract) — the MPE action string is removed.
- [x] Choose and record the persistent action-id prefix for the sampler family
(replaces `CEREBELLUM_MPEVIEW_TOGGLE`); this string is forever-stable once
shipped (CLAUDE.md §action registration).
- [x] Refresh `README.md` layout/next-step sections to the sampler module set.
(Landed-work reflection is doc-keeper's; this point exists so the stale MPE
README does not mislead the first implementer.)
-29
View File
@@ -14,35 +14,6 @@ it here and appends it to `COMPLETED.md`.
---
## Milestone 0 — Transition scaffold: reaper_mpeview → ReaSampler
**Goal:** Retire the MPE scaffold and stand up the sampler's pure core in its
place, preserving the pure-core / REAPER-shell split.
**Verify:** `cmake -B build -S .` configures clean; `cmake --build build` builds
the renamed extension target and the pure-core test target; `ctest --test-dir
build` is green with the new `bank_model` + `peaks` suites present.
- [ ] Delete `src/mpe_model.{h,cpp}` and `src/mpe_view.{h,cpp}`; remove
`tests/test_mpe_model.cpp`.
- [ ] Rename the CMake `project()` and the extension MODULE target from
`reaper_mpeview` to `reaper_reasampler` (binary `OUTPUT_NAME` likewise);
update `PREFIX ""` / platform SUFFIX blocks to the new target name.
- [ ] Replace the pure `mpe_model` static lib + `mpe_model_tests` executable with
`bank_model` (pure static lib) + `bank_model_tests`; keep the CTest wiring.
- [ ] Repoint `src/main.cpp`: drop the `mpe_view.h` include and all `MpeView_*`
calls (toggle / IsOpen / OnTimer / Cleanup); stub the extension entry so it
loads, logs to console, and registers nothing MPE-specific. The
`command_id` / `gaccel` / `hookcommand` registration *pattern* is preserved for
reuse (CLAUDE.md §REAPER extension contract) — the MPE action string is removed.
- [ ] Choose and record the persistent action-id prefix for the sampler family
(replaces `CEREBELLUM_MPEVIEW_TOGGLE`); this string is forever-stable once
shipped (CLAUDE.md §action registration).
- [ ] Refresh `README.md` layout/next-step sections to the sampler module set.
(Landed-work reflection is doc-keeper's; this point exists so the stale MPE
README does not mislead the first implementer.)
> After Milestone 0, Milestones 1 and 2 below are the pure-core heart. They are
> also the near-term slice tracked in `TODO.md`.
## Milestone 1 — bank_model + JSON round-trip (pure)
**Goal:** The `Sample` metadata struct and `BankIndex` (add / remove / query /
tier moves / dedup-by-hash) with JSON serialize/deserialize to `std::string`.
+83
View File
@@ -0,0 +1,83 @@
# ReaSampler
A native C++ REAPER extension that captures any arbitrary audio source into a
per-project **sample bank** (cached files + a docked grid), decoupled from the
arrange view, with keyboard/MIDI-bindable capture and placement. Built as a
precision tool: deterministic, non-destructive, no clutter.
This is a **skeleton**: the loading contract, build system, and the testable
pure-core library are wired up. The bank panel, capture backend, and remaining
module set are stubbed with clearly marked seams.
## Layout
src/main.cpp The REAPER<->extension contract: the single file that
#defines REAPERAPI_IMPLEMENT, resolves API pointers,
and holds the action-registration seam (commented,
ready to reinstate under the CEREBELLUM_REASAMPLER_
prefix). Logs "ReaSampler loaded." on startup.
src/bank_model.{h,cpp} Pure, REAPER-free core: the Sample metadata struct and
BankIndex (add / remove / query / tier moves /
dedup-by-hash + JSON round-trip). This is the heart;
everything else hangs off it. Currently an M0
placeholder — the full implementation is Milestone 1.
tests/test_bank_model.cpp Standalone tests for bank_model — no REAPER needed.
vendor/ git submodules go here (see below).
Target module set (milestones ahead — see PLAN.md):
bank_model Sample metadata + BankIndex + JSON (pure)
peaks Waveform min/max bins from raw PCM (pure)
capture ICaptureBackend: OfflineRenderBackend + RealtimeRecordBackend
insert InsertMedia-based placement (explicit tempo-conform flag)
bank_panel Docked LICE-drawn grid: thumbnails, audition, multi-select
persist Project ext state <-> bank_model JSON; project-relative paths
actions Bindable capture / placement / slot action family
## One-time setup
git submodule update --init
Vendors two submodules:
- `vendor/reaper-sdk``sdk/reaper_plugin.h`, `sdk/reaper_plugin_functions.h`, SWELL headers
- `vendor/WDL` — WDL utilities and the SWELL cross-platform Win32 layer
## Build
cmake -B build -S .
cmake --build build
Targets:
- `bank_model_tests` — run with `ctest --test-dir build` (or run the binary).
This is your fast loop: iterate the pure core without touching REAPER.
- `reaper_reasampler` — the extension binary.
### macOS / Linux dialog resources
When `bank_panel` is added (Milestone 5), `resource.rc` will need SWELL's resgen
once (Win32 compiles it directly). Generate the SWELL dialog source and add it to
the non-Windows build:
php vendor/WDL/WDL/swell/mac_resgen.php src/resource.rc # macOS
# (Linux uses the same generated output.)
Then add the generated file to the `APPLE` / Linux `target_sources` blocks in
CMakeLists.txt. The SWS extension's build is the canonical reference if you get
stuck here — it's the fiddliest step and only bites once.
## Install / test
Copy the built binary into REAPER's `UserPlugins/` folder
(Options -> Show REAPER resource path), then **restart REAPER** (extensions load
at startup; there is no hot reload). The extension logs "ReaSampler loaded." to
the REAPER console on startup; no actions are registered yet.
Debug by attaching your debugger to the REAPER process. `ShowConsoleMsg` is a
quick printf.
## Where to build next
See `PLAN.md` for the full milestone roadmap and `TODO.md` for the near-term slice.
The current first work is **Milestone 1** — flesh out `bank_model`: define the full
`Sample` field set, implement `BankIndex` (add / remove / query / tier / dedup),
add JSON serialize/deserialize, and drive it all through the existing CTest harness.