Commit df9671aa by PLN (Algolia)

TODO.d: capture-the-moment design, stems ring, hands and code in one bundle

parent 0292a7f3
# Capture the moment: stems + hands + code, saved after the fact (2026-11-01)
Owner's wish: do not ask "record?", ask "keep what just happened". After a good stretch,
`moment last 30m` must leave a bundle from which that stretch can be reconstructed:
every stem (the keyboard included), every MIDI press, and the exact code that was
playing. The stereo black box already works that way; nothing else does yet.
## Where the rig stands (measured 2026-11-01)
- **Stereo black box**: always on, opus, ~67 MB/h, hourly segments, `gig_record.sh slice`
cuts one segment by hand. Follows Ardour Master's sink. No stems, no code, no MIDI.
- **Ardour stems**: only while a track is armed AND the transport rolls (`take-rec arm`).
Nothing written since Take109 (2026-09-28). `Keys` has NEVER produced a stem file in any
take; `take-rec` only knows `Tidal NN` (`take-lens.SRC_RE`), so `Keys` and `Mic` fall
outside arm, verify and `take-master`. Float32 WAV costs ~17 GB/h (Take109: 2.9 GB for
10 min), so "always roll Ardour" is out: 161 GB free, 92% full.
- **gig-log** already records: `eval` (path + dN names, from `eval-events.jsonl` written by
the Pulsar package), `track`, `cc` (coalesced 1 Hz), `health`, `mark`, system samples.
It supports `note` events at full resolution, but its MIDI lens binds ONE port (the
LCXL3), so the KeyStep's presses are not logged (0 `note` rows in today's log).
`eval` carries no code, no commit, no file hash.
## Shape
1. **Stem ring** (new unit, e.g. `gig-stems`): taps the orbit outputs of SuperCollider plus
`ardour:Keys` and `ardour:Mic` (when Ardour is up), writes lossless FLAC per orbit in
short segments, and deletes anything older than the window (default 45 min, hard cap in
GB). Independent of Ardour, so it works dawless. Ardour's own take path stays for
deliberate full-quality takes.
2. **Hands**: a second MIDI lens in gig-log for the KeyStep, notes at full resolution.
3. **Code**: each `eval` record gains `rev` (git HEAD), `dirty`, and `sha` of the file, with
the bytes stored once per sha in a code store. Exact block text needs the Pulsar package
to send it (the file on disk can lag the buffer): a later step, said out loud in the
manifest until then.
4. **`moment`**: `moment last 30m [name]` / `moment since HH:MM`. Resolves the window, then
writes one bundle outside any prune: stem slices (cut across segments), stereo slice,
the gig-log lines of the window, the evals' code blobs and `git rev`, and a manifest
(window, what was present, what was missing, sizes).
5. **Button**: Bridge/tray "Save last 30 min"; maybe an LCXL3 pad later.
## Order and acceptance
0. **Measure the ring first** (before any mechanism): FLAC MB/min, CPU %, xruns over
10 min of real playing, on the fan-sensitive laptop. No ring unit until this is written
down. Disk rule: bounded by construction, report anything over 500 MB.
1. **KeyStep lens**: tiny change; accept = notes from the KeyStep appear in the log with
`p` = its port, survive a replug (like the LCXL3 lens).
2. **Eval enrichment** (`rev`, `dirty`, `sha`, code store); accept = a past eval can be
rebuilt to the exact file bytes.
3. **Arm/verify/summary/master learn `Keys` and `Mic`** (by track name, not orbit number);
accept = a real roll produces a Keys stem and `verify` says so. Arm uses strip ids
guessed from the XML route order, never confirmed by a live roll: confirm it.
4. **Ring unit**; accept = after 20 min of playing, the ring holds the last N minutes of
every stem, silence in none of the live ones, and size stays under the cap.
5. **`moment`** with a manifest; accept = from a clean state, `moment last 10m` yields a
bundle whose stems line up with the stereo slice (sample offset reported).
6. Button.
## Open questions
- How to tap 28+ ports cheaply: one `pw-record`/jack client per pair vs one multichannel
capture split by ffmpeg. Phase 0 decides by measurement.
- FLAC is 24-bit; SuperCollider output is float and could exceed 0 dBFS. Check peaks, or
use a float container for the ring.
- Window length N and the hard cap (disk floor is 25 GB, 100 GB is the keep-scratch line).
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment