Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit d2f09bc5d15523691e76c997ae27d5495ba25add
parent 2ad96a50e005328c20b235b31255ed2eba16b65b
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Mon,  2 Nov 2026 11:19:43 -0500

umtool fx: a receipt can fly in at a moment -- `at` (a source second inside the clip, gap-aware) and `hold` (0.5-10 s once landed, on every one: they leave then, not with the clip); without them a receipt fans in as the clip comes up, as before

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Mumtool/docs/knobs.md | 4++--
Mumtool/report-to-video/fx.mjs | 34++++++++++++++++++++++++++++------
Mumtool/report-to-video/fx.test.mjs | 21+++++++++++++++++++++
Mumtool/report-to-video/modules/fx.mjs | 2+-
4 files changed, 52 insertions(+), 9 deletions(-)

diff --git a/umtool/docs/knobs.md b/umtool/docs/knobs.md @@ -36,7 +36,7 @@ that generates it ([notes.md](notes.md)). | `layout` — `finale`: the deck's finale layout for this clip (`render.chrome.deck.finale`); `clip` is the default | — | `umtool set <p> <clip> layout=finale` | — | | `chat` — `on`: the clip's live chat (its video's `live_chat.cues.json`, for the clip's source span, timed through its gaps) in a column beside the footage; `off` or `chat=` (the default): none. A video with no chat draws nothing and the build log says so ([Live chat](#live-chat)) | — | `umtool set <p> <clip> chat=on` (`chat=` clears it) | — | | `fx.zoom` — `{shot, focus, at?, hold?}`: a screenshot (a file in the project; a bare name under its `shots/` is written as `shots/<name>`) that comes up over the footage and pushes in on `focus` (`[left, top, right, bottom]`, fractions of the shot) — drawn once `render.chrome.fx.zoom` is on ([Effects](#effects)). **How long it stays**: up 0.2 s into the clip's clean span (rising in over 0.38 s), its focus box drawn 0.55 s later, the push at `at` (seconds into the clip; default as soon as the box has drawn) over 1 s, then a slow drift on the detail; it leaves with a 0.3 s fade 0.3 s before the clip's clean span ends — or, with `hold` (0.5–10 s), that long after the push lands (never past the clip's own leave) | — | `umtool set <p> <clip> fx.zoom='{"shot":"shots/x.png","focus":[0.1,0.2,0.9,0.4],"at":5.9,"hold":4}'` (`fx.zoom=` clears it) | `PUT /api/report/window {project, clip, "fx.zoom": {…} \| null}` | -| `fx.receipts`, `fx.punch`, `fx.quote`, `fx.punchIn`, `fx.speakers` — the clip's other effect fields (`[{shot, mark?}]` 1–4; the words to punch; `false`: no line; 1–8 source seconds inside the clip; `[{at, who: 0\|1}]`), each inert until its effect is on; `fx` is all of them at once. Checked by the build's own `validateFxEntries` | — | `fx.punch="the words"` `fx.punchIn='[231.4]'` · `fx='{…}'` sets them all, `fx=` clears every one | `PUT /api/report/window {project, clip, fx}` (or one `"fx.<field>"`) | +| `fx.receipts`, `fx.punch`, `fx.quote`, `fx.punchIn`, `fx.speakers` — the clip's other effect fields (`[{shot, mark?, at?, hold?}]` 1–4, `at` the source second a receipt flies in at (default: as the clip comes up), `hold` 0.5–10 s it stays once landed (on every one: they leave then, not with the clip); the words to punch; `false`: no line; 1–8 source seconds inside the clip; `[{at, who: 0\|1}]`), each inert until its effect is on; `fx` is all of them at once. Checked by the build's own `validateFxEntries` | — | `fx.punch="the words"` `fx.punchIn='[231.4]'` · `fx='{…}'` sets them all, `fx=` clears every one | `PUT /api/report/window {project, clip, fx}` (or one `"fx.<field>"`) | | `gaps` — `[{from, to}]`, SOURCE seconds cut out of the clip's middle: it renders as ONE segment of jump cuts (one pip, one card), not two clips with a crossfade ([below](#gaps-inside-a-clip)) | clip bench (Edit this clip), the waveform: **Select a gap** (`g`) or Alt + drag a span, **Cut gap** (`g`), **Hear it**; a click on a gap's band puts it back (`G`: the one at the playhead); **Undo** | `umtool window <p> <clip> --gap 12.3-15.1` (repeatable) · `--gap-remove 12.3` · `--gaps '12.3-15.1,20-20.6'` (`--gaps ''` clears) · `umtool set <p> <clip> gap.add=12.3-15.1 gap.remove=12.3 gaps=` | `PUT /api/report/window {project, clip, token, gapAdd \| gapRemove \| gaps}` | `key=` (nothing after the `=`) clears a knob; in umtool, **Clear** beside a field (Audio: **Clear all**). A @@ -1064,7 +1064,7 @@ Overlays on the picture -- receipts, a zoom, the scrubber, a kinetic quote, punc |---|---|---| | `render.chrome.fx.<effect>` | scrubber · receipts · zoom · kineticQuote · redact · odometer · punchIn · thenNow · whip · glitch | a take: `umtool take <p> --effect <name>` | | `render.chrome.fx.glitch.on`, `.clips` | `year` (a tear at each cut between years) · `every` (each cut between clips) · `clips` (only the cut INTO each clip `clips` names: 1–60 ids, each with a clip right before it) · default `year`; `clips` only with `on: "clips"`. `.seconds` 0.2–1.5 · 0.5, `.stamp` (the `PLAY ▶` date) · `true`, `.year` (the new year big over the tear; `false` with `stamp: false` is a bare tear, no text) · `true` | manifest | -| a clip's `fx` — what an effect draws on it, inert until that effect is on: `zoom` `{shot, focus, at?, hold?}`, `receipts` `[{shot, mark?}]` (1–4), `punch` (the words), `quote` (false: no line), `punchIn` `[source s…]` (1–8, inside the clip), `speakers` `[{at, who: 0|1}]`. A `shot` is a file in the project (a bare name under its `shots/` is written as `shots/<name>`); `focus`/`mark` are `[left, top, right, bottom]` fractions of it | `fx.<field>=<json>` sets one and keeps the rest · `fx=<json>` all · `fx=` none; checked by the build's own `validateFxEntries` | `umtool set <p> <clip> fx.zoom='{"shot":"shots/x.png","focus":[0.1,0.2,0.9,0.4],"at":5.9}'` · `PUT /api/report/window {project, clip, fx}` (or `"fx.zoom"`, …) | +| a clip's `fx` — what an effect draws on it, inert until that effect is on: `zoom` `{shot, focus, at?, hold?}`, `receipts` `[{shot, mark?, at?, hold?}]` (1–4; `at` a source second inside the clip, gap-aware, `hold` 0.5–10 s once landed), `punch` (the words), `quote` (false: no line), `punchIn` `[source s…]` (1–8, inside the clip), `speakers` `[{at, who: 0|1}]`. A `shot` is a file in the project (a bare name under its `shots/` is written as `shots/<name>`); `focus`/`mark` are `[left, top, right, bottom]` fractions of it | `fx.<field>=<json>` sets one and keeps the rest · `fx=<json>` all · `fx=` none; checked by the build's own `validateFxEntries` | `umtool set <p> <clip> fx.zoom='{"shot":"shots/x.png","focus":[0.1,0.2,0.9,0.4],"at":5.9}'` · `PUT /api/report/window {project, clip, fx}` (or `"fx.zoom"`, …) | | beside popup posts that move the footage (`deck.posts.shift`) | the effects are drawn over the footage box where it stays, so an effect on screen WHILE the posts hold the footage aside is refused, naming both and their seconds — a zoom, receipts, a quote or a punch-in on its own clip's span; a whip, glitch or THEN/NOW wipe around its cut; the scrubber and the odometer over every clip (so beside any shift). A persisting bar holds it aside from its first post to its glide back. Apart in time, both are drawn. `umtool check` reads the estimated schedule; the build checks again on the measured one before any chrome is drawn | `deck.posts.shift=false`, the feed, or move one of them | | the zoom's timing (`fx.zoom.at`, `.hold`) | up 0.2 s into the clip's clean span (the card rises in over 0.38 s, `back.out`); its focus box draws 0.55 s later (0.45 s); it pushes in on the box at `at` — seconds into the clip, default as soon as the box has drawn — over 1 s (`power2.inOut`), then drifts slowly on the detail. It leaves with a 0.3 s fade 0.3 s before the clip's clean span ends, or with `hold` (0.5–10 s) that long after the push lands (never past the clip's own leave) | `fx.zoom='{…,"hold":4}'` | diff --git a/umtool/report-to-video/fx.mjs b/umtool/report-to-video/fx.mjs @@ -18,7 +18,7 @@ // } // timeline entry: "fx": { "punch": "…", "quote": false, "punchIn": [<source s>, …], // "speakers": [{ "at": <source s>, "who": 0 | 1 }], -// "receipts": [{ "shot": "shots/a.png", "mark": [x0, y0, x1, y1] }], +// "receipts": [{ "shot": "shots/a.png", "mark": [x0, y0, x1, y1], "at"?: <source s>, "hold"?: s }], // "zoom": { "shot": "shots/b.png", "focus": [x0, y0, x1, y1], "at": 1.2, "hold": 4 } } // (a zoom is up from 0.2 s into its clip's clean span -- the card rising in // over 0.38 s, its focus box drawing at +0.55 s -- pushes in at `at` (seconds @@ -325,8 +325,17 @@ export function validateFxEntries(manifest, { schedule = undefined } = {}) { errors.push(`${w}.receipts must be a list of 1 to ${FX_RECEIPTS_MAX} screenshots`); } else { r.forEach((c, i) => { - if (!isObj(c)) { errors.push(`${w}.receipts[${i}] must be { shot, mark? }`); return; } - for (const k of Object.keys(c)) if (k !== "shot" && k !== "mark") errors.push(`${w}.receipts[${i}].${k} is not a receipt field`); + if (!isObj(c)) { errors.push(`${w}.receipts[${i}] must be { shot, mark?, at?, hold? }`); return; } + for (const k of Object.keys(c)) if (!["shot", "mark", "at", "hold"].includes(k)) errors.push(`${w}.receipts[${i}].${k} is not a receipt field`); + if (c.at !== undefined) { + if (!(typeof c.at === "number" && Number.isFinite(c.at))) errors.push(`${w}.receipts[${i}].at must be a source second`); + else if (e.type === "clip" && Number.isFinite(e.start) && Number.isFinite(e.end) && (c.at < e.start || c.at > e.end)) { + errors.push(`${w}.receipts[${i}].at is outside the clip (${e.start}–${e.end})`); + } + } + if (c.hold !== undefined && !numIn(c.hold, FX_ZOOM_HOLD.min, FX_ZOOM_HOLD.max)) { + errors.push(`${w}.receipts[${i}].hold must be from ${FX_ZOOM_HOLD.min} to ${FX_ZOOM_HOLD.max} seconds (up after it lands), or absent for the rest of the clip`); + } const se = shotError(c.shot, `${w}.receipts[${i}].shot`); if (se) errors.push(se); if (c.mark !== undefined && !rect01(c.mark)) errors.push(`${w}.receipts[${i}].mark must be [left, top, right, bottom], fractions of the shot`); @@ -883,10 +892,23 @@ export function fxSchedule({ segments, entries, metas = [], render, D, total, wo if (!Array.isArray(list) || !list.length) continue; const inn = c.in + 0.3, outT = c.out - 0.25; if (outT - inn < 1) continue; + // A receipt with `at` (a source second, gap-aware) flies in then rather + // than as the clip comes up; with `hold` on every one, they leave that + // long after the last lands, not as the clip goes. + const f0 = sourceFrom(c.entry), g = gapsOf(c.entry); + const cards = list.map((x, j) => ({ + shot: x.shot, mark: x.mark ?? null, + at: r3(Number.isFinite(x.at) ? Math.min(outT - 1, Math.max(inn, c.start + offsetIn(x.at, f0, g))) : inn + j * FX_MOTION.fanGap), + })); + const timed = list.some((x) => Number.isFinite(x.at)); + const first = Math.min(...cards.map((x) => x.at)), landed = Math.max(...cards.map((x) => x.at)) + FX_MOTION.fan; + const out = list.every((x) => Number.isFinite(x.hold)) + ? Math.min(outT, Math.max(...list.map((x, j) => cards[j].at + FX_MOTION.fan + x.hold)) + 0.38) : outT; rows.push({ - segment: c.id, in: r3(inn), out: r3(outT), - cards: list.map((x, j) => ({ shot: x.shot, mark: x.mark ?? null, at: r3(inn + j * FX_MOTION.fanGap) })), - markAt: r3(Math.min(outT - FX_MOTION.marker - 0.2, inn + list.length * FX_MOTION.fanGap + FX_MOTION.fan + 0.15)), + segment: c.id, in: r3(timed ? first : inn), out: r3(out), cards, + markAt: r3(timed + ? Math.min(out - FX_MOTION.marker - 0.2, landed + 0.15) + : Math.min(outT - FX_MOTION.marker - 0.2, inn + list.length * FX_MOTION.fanGap + FX_MOTION.fan + 0.15)), }); } out.receipts = { position: rc.position, width: rc.width, clips: rows }; diff --git a/umtool/report-to-video/fx.test.mjs b/umtool/report-to-video/fx.test.mjs @@ -355,6 +355,27 @@ test("receipts and the zoom: placed inside the clip, the marker after the cards assert.ok(z.in < z.outline && z.outline < z.push && z.push + 1 < z.out); }); +test("receipts: `at` flies one in at its source second (past a gap), `hold` sends it off that long after", () => { + const timeline = [ + clip("c1", "2019-05-02"), + clip("c2", "2020-06-11", { gaps: [{ from: 12, to: 13 }], fx: { receipts: [{ shot: "shots/b.png", mark: [0.04, 0.3, 0.9, 0.5], at: 15, hold: 1.5 }] } }), + clip("c3", "2021-01-01"), + ]; + const s = sched({ receipts: {} }, { timeline, durs: [6.4, 7.4, 6.4] }); + const r = s.fx.receipts.clips[0]; + const seg = s.segments.find((x) => x.id === "c2"); + // Source 15, the picture from 10.6 with 1 s cut out at 12-13: 3.4 s into the segment. + near(r.cards[0].at, seg.start + 3.4, 1e-9, "the card flies in at its word"); + near(r.in, r.cards[0].at, 1e-9, "nothing on screen before it"); + near(r.out, r.cards[0].at + 0.42 + 1.5 + 0.38, 1e-9, "it leaves after its hold"); + assert.ok(r.markAt >= r.cards[0].at + 0.42 && r.markAt + 0.55 <= r.out, "the marker swipes while it is up"); + // Without at/hold the schedule is what it was. + const plain = sched(ALL).fx.receipts.clips[0]; + near(plain.cards[1].at - plain.cards[0].at, 0.18, 1e-9, "fanned in from the clip's start"); + assert.deepEqual(validateFxEntries({ render: render({}), timeline: [clip("c9", "2020-01-01", { fx: { receipts: [{ shot: "shots/a.png", at: 30, hold: 20, when: 1 }] } })] }).map((x) => x.replace(/^.*receipts\[0\]\./, "")).sort(), + ["at is outside the clip (10–18)", "hold must be from 0.5 to 10 seconds (up after it lands), or absent for the rest of the clip", "when is not a receipt field"]); +}); + test("no effect is drawn over a segment the deck hides (a card)", () => { const timeline = [clip("c1", "2019-05-02"), { type: "card", id: "k1", seconds: 4, heading: "x" }, clip("c2", "2021-01-01")]; const s = sched({ glitch: { on: "every" }, odometer: {}, kineticQuote: {} }, { timeline, durs: [6.4, 4, 6.4] }); diff --git a/umtool/report-to-video/modules/fx.mjs b/umtool/report-to-video/modules/fx.mjs @@ -22,7 +22,7 @@ export default defineModule({ rows: [ ["`render.chrome.fx.<effect>`", "scrubber · receipts · zoom · kineticQuote · redact · odometer · punchIn · thenNow · whip · glitch", "a take: `umtool take <p> --effect <name>`"], ["`render.chrome.fx.glitch.on`, `.clips`", "`year` (a tear at each cut between years) · `every` (each cut between clips) · `clips` (only the cut INTO each clip `clips` names: 1–60 ids, each with a clip right before it) · default `year`; `clips` only with `on: \"clips\"`. `.seconds` 0.2–1.5 · 0.5, `.stamp` (the `PLAY ▶` date) · `true`, `.year` (the new year big over the tear; `false` with `stamp: false` is a bare tear, no text) · `true`", "manifest"], - ["a clip's `fx` — what an effect draws on it, inert until that effect is on: `zoom` `{shot, focus, at?, hold?}`, `receipts` `[{shot, mark?}]` (1–4), `punch` (the words), `quote` (false: no line), `punchIn` `[source s…]` (1–8, inside the clip), `speakers` `[{at, who: 0|1}]`. A `shot` is a file in the project (a bare name under its `shots/` is written as `shots/<name>`); `focus`/`mark` are `[left, top, right, bottom]` fractions of it", "`fx.<field>=<json>` sets one and keeps the rest · `fx=<json>` all · `fx=` none; checked by the build's own `validateFxEntries`", "`umtool set <p> <clip> fx.zoom='{\"shot\":\"shots/x.png\",\"focus\":[0.1,0.2,0.9,0.4],\"at\":5.9}'` · `PUT /api/report/window {project, clip, fx}` (or `\"fx.zoom\"`, …)"], + ["a clip's `fx` — what an effect draws on it, inert until that effect is on: `zoom` `{shot, focus, at?, hold?}`, `receipts` `[{shot, mark?, at?, hold?}]` (1–4; `at` a source second inside the clip, gap-aware, `hold` 0.5–10 s once landed), `punch` (the words), `quote` (false: no line), `punchIn` `[source s…]` (1–8, inside the clip), `speakers` `[{at, who: 0|1}]`. A `shot` is a file in the project (a bare name under its `shots/` is written as `shots/<name>`); `focus`/`mark` are `[left, top, right, bottom]` fractions of it", "`fx.<field>=<json>` sets one and keeps the rest · `fx=<json>` all · `fx=` none; checked by the build's own `validateFxEntries`", "`umtool set <p> <clip> fx.zoom='{\"shot\":\"shots/x.png\",\"focus\":[0.1,0.2,0.9,0.4],\"at\":5.9}'` · `PUT /api/report/window {project, clip, fx}` (or `\"fx.zoom\"`, …)"], ["beside popup posts that move the footage (`deck.posts.shift`)", "the effects are drawn over the footage box where it stays, so an effect on screen WHILE the posts hold the footage aside is refused, naming both and their seconds — a zoom, receipts, a quote or a punch-in on its own clip's span; a whip, glitch or THEN/NOW wipe around its cut; the scrubber and the odometer over every clip (so beside any shift). A persisting bar holds it aside from its first post to its glide back. Apart in time, both are drawn. `umtool check` reads the estimated schedule; the build checks again on the measured one before any chrome is drawn", "`deck.posts.shift=false`, the feed, or move one of them"], ["the zoom's timing (`fx.zoom.at`, `.hold`)", "up 0.2 s into the clip's clean span (the card rises in over 0.38 s, `back.out`); its focus box draws 0.55 s later (0.45 s); it pushes in on the box at `at` — seconds into the clip, default as soon as the box has drawn — over 1 s (`power2.inOut`), then drifts slowly on the detail. It leaves with a 0.3 s fade 0.3 s before the clip's clean span ends, or with `hold` (0.5–10 s) that long after the push lands (never past the clip's own leave)", "`fx.zoom='{…,\"hold\":4}'`"], ],