commit e7def98c5e27f73b0aac60ef61874a3829633987
parent 5e205b6d1203909a3565fafe946199adea7741b4
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 6 Nov 2026 02:26:22 -0500
umtool: the instruments -- on with a measure, a pre-state, ranges, a readable wedge, the finale's ghost and crossfade
rev9-panel's list (6 Nov):
- A. With a measure (`deck.measure` set) the dial, the odometer and the trail
are ON unless they say `false` -- as the measure extras are; without one
only when named (a cut without them is the cut it was).
- B. Before he states a weight the dial says "NO WEIGHT STATED YET", its
needle parked at the scale's foot at 30 %, brought up with the first
stated weight; the remembered ghosts still draw. Never a number.
- D. A range stays a range: a stated range's wedge spans it and its digits
read "330–340"; a remembered range draws a ghost band and "330–340" by its
ghost; a goal he gave as a range reads "GOAL 230–240" with an amber band
on the bezel across it. An unresolved loss goal reads "LOSE 75".
- The wedge: a strong fill (78 %) outlined in the face's dark, and its words
(">300", "330–340") inward of it -- no longer lost against the 300 mark.
- G (count). The moving start's count rides on the dial's ghost label:
"≈390 · AS OF FEB 2025 · TOLD 4×".
- E. The finale's long ghost stands on the LATEST remembered row (the last
state's "AS OF FEB 2025"), not the first telling of the highest number.
- I. The dial's finale comes in over the finale's grow from its first
frame, while the column goes under the finale over the same 0.8 s: a
crossfade, no frame of the finale's ground alone (rev 9: 779.3 s).
- `deck.dial.finaleEnd` "auto" (the new default): the promise clock takes
the finale's lower column when a promise is on camera; in a short finale
NET's hold shortens so the clock still has 2.5 s (never before NET).
- K (half). The trail yields (fades) while the promise clock stands in its
slot (`trailYields`, measure-extras' `promise.slot: "column"`).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
7 files changed, 159 insertions(+), 53 deletions(-)
diff --git a/umtool/report-to-video/chrome-instruments.mjs b/umtool/report-to-video/chrome-instruments.mjs
@@ -18,9 +18,11 @@ import { mix, rgba } from "./chrome-deck.mjs";
import { finaleLayout } from "./chrome-finale.mjs";
import { FINALE_MOTION } from "./finale.mjs";
import { resolveDial, resolveOdometer, resolveTrail } from "./instruments.mjs";
+import { promiseStates, upSpans } from "./measure-extras.mjs";
+import { resolveMeasureExtra } from "./modules/measure-extras-settings.mjs";
import {
cueList, dayNumber, dialAngle, dialFaceSvg, DIAL_SWEEP, esc, fmtDate, fmtSigned, fmtWeight, INSTANT, measureTrack,
- pageHtml, polar, qualifierMark, r4, sectorPath, wedgeRange, wheelCount, wheelRoll, wheelStrip,
+ pageHtml, polar, qualifierMark, r4, sectorPath, wedgeRange, weightWords, wheelCount, wheelRoll, wheelStrip,
} from "./measure-draw.mjs";
/** The motion's seconds: the needle's swing, a ghost's move, the odometer's roll, a block's fade. */
@@ -77,9 +79,13 @@ function windowOf(schedule, opts, what) {
/** The instruments come and go with the deck (a card, the finale): its root `k` on the deck's own visibility. */
function withDeck(L, schedule, render, k) {
L.set(k, { autoAlpha: 1 });
+ const fin = Number.isFinite(schedule?.finale?.from) ? schedule.finale.from : null;
for (const v of deckChoreography(schedule, render).visibility) {
const [a, b] = v.at;
- L.add(k, a, Math.max(INSTANT, b - a), { autoAlpha: v.hide ? 0 : 1 }, v.hide ? "power1.in" : "power2.out");
+ // Going under the finale: over its grow, as the dial's finale comes in (dialFinaleHtml) -- a crossfade.
+ const intoFinale = v.hide && fin !== null && Math.abs(a - fin) < 0.6;
+ const dur = intoFinale ? Math.max(b - a, FINALE_MOTION.grow) : Math.max(INSTANT, b - a);
+ L.add(k, a, dur, { autoAlpha: v.hide ? 0 : 1 }, v.hide ? "power1.in" : "power2.out");
}
}
@@ -99,13 +105,16 @@ function blocks(L, list, key, { fade = INSTANT, shown = (x) => true } = {}) {
});
}
-const goalWords = (g) => {
+export const goalWords = (g) => {
if (!g) return "";
const loss = Number.isFinite(g.loss) ? Math.abs(g.loss) : null;
- // A loss goal resolved against its run's start (`base`) reads as both: "GOAL 250 · LOSE 50".
- const what = Number.isFinite(g.value)
- ? `GOAL ${fmtWeight(g.value)}${loss !== null && g.base ? ` · LOSE ${fmtWeight(loss)}` : ""}`
- : loss !== null ? `GOAL: LOSE ${fmtWeight(loss)}` : "GOAL";
+ // A loss goal resolved against its run's start (`base`) reads as both: "GOAL 250 · LOSE 50"; a range he gave
+ // stays a range ("GOAL 230–240"); an unresolved loss is his words alone ("LOSE 75").
+ const what = Array.isArray(g.range) && g.range.length === 2
+ ? `GOAL ${fmtWeight(g.range[0])}–${fmtWeight(g.range[1])}`
+ : Number.isFinite(g.value)
+ ? `GOAL ${fmtWeight(g.value)}${loss !== null && g.base ? ` · LOSE ${fmtWeight(loss)}` : ""}`
+ : loss !== null ? `LOSE ${fmtWeight(loss)}` : "GOAL";
const when = g.deadline ?? g.due ?? null;
return when ? `${what} · ${String(when).toUpperCase()}` : what;
};
@@ -120,7 +129,7 @@ const goalWords = (g) => {
* the hub and the readout blocks. Shared by the column's dial and the
* finale's. Returns its markup and css; its cues are the caller's.
*/
-function dialParts({ size, ox, oy, scale, cfg, colors, fonts, track, prefix = "" }) {
+function dialParts({ size, ox, oy, scale, cfg, colors, fonts, track, prefix = "", preState = true }) {
const face = dialFaceSvg({ size, scale, mark: cfg.mark, colors: { ...colors, mark: colors.accent }, labelFont: fontStack(fonts, "condensed") });
const { C, R, Rf, u } = face;
const px = (v) => Math.round(v * u * 100) / 100;
@@ -132,17 +141,34 @@ function dialParts({ size, ox, oy, scale, cfg, colors, fonts, track, prefix = ""
if (cfg.ghosts) {
track.remembered.forEach((g, j) => {
parts.push(layer(`g${j}`, `<line x1="${C}" y1="${C - Rf + 6 * u}" x2="${C}" y2="${C - Rf + 46 * u}" stroke="${colors.ghost}" stroke-width="${px(3.5)}" stroke-linecap="round"/>`));
+ // A remembered RANGE ("330-340"): a ghost band across it, not its middle alone.
+ if (Array.isArray(g.range)) {
+ const b0 = dialAngle(g.range[0], scale), b1 = dialAngle(g.range[1], scale);
+ if (b1 > b0) parts.push(`<div class="ly" data-k="${prefix}gb${j}"><svg width="${size}" height="${size}" viewBox="0 0 ${size} ${size}"><path d="${sectorPath(C, C, Rf - 46 * u, Rf - 6 * u, b0, b1)}" fill="${colors.ghost}" fill-opacity="0.35" stroke="${colors.ghost}" stroke-width="${px(1.5)}"/></svg></div>`);
+ }
});
}
track.current.forEach((c, j) => {
- const w = Number.isFinite(c.value) ? wedgeRange(c.value, c.qualifier) : null;
+ const w = Number.isFinite(c.value) ? wedgeRange(c.value, c.qualifier, c.range) : null;
if (!w) return;
const a0 = dialAngle(w[0], scale), a1 = dialAngle(w[1], scale);
if (!(a1 > a0)) return;
- parts.push(layer(`q${j}`, `<path d="${sectorPath(C, C, Rf - 38 * u, Rf - 4 * u, a0, a1)}" fill="${colors.accent}" fill-opacity="0.5" stroke="${colors.accent}" stroke-width="${px(1.5)}"/>`));
+ // The wedge reads at a glance (rev 9: ">300" was lost against the 300 mark): a strong fill, an outline in the
+ // face's own dark around the accent, and its words -- the glyph and the digits -- at its outer edge.
+ parts.push(layer(`q${j}`, `<path d="${sectorPath(C, C, Rf - 48 * u, Rf - 2 * u, a0, a1)}" fill="${colors.accent}" fill-opacity="0.78" stroke="${colors.face}" stroke-width="${px(4)}"/>` +
+ `<path d="${sectorPath(C, C, Rf - 48 * u, Rf - 2 * u, a0, a1)}" fill="none" stroke="${colors.accent}" stroke-width="${px(2)}"/>`));
+ const [lx, ly] = polar(C, C, Rf - 108 * u, (a0 + a1) / 2);
+ parts.push(`<div class="qlab" data-k="${prefix}ql${j}" style="left:${lx}px; top:${ly}px">${esc(weightWords(c))}</div>`);
});
if (cfg.goal) {
parts.push(layer("gl", `<polygon points="${C - 11 * u},${C - R - 2 * u} ${C + 11 * u},${C - R - 2 * u} ${C},${C - Rf + 16 * u}" fill="${colors.amber}" stroke="${colors.bg}" stroke-width="${px(2)}"/>`));
+ // A goal he gave as a range: the tick spans it, an amber band on the bezel.
+ track.goals.forEach((g, j) => {
+ const r = g.goal?.range;
+ if (!Array.isArray(r)) return;
+ const b0 = dialAngle(r[0], scale), b1 = dialAngle(r[1], scale);
+ if (b1 > b0) parts.push(`<div class="ly" data-k="${prefix}gr${j}"><svg width="${size}" height="${size}" viewBox="0 0 ${size} ${size}"><path d="${sectorPath(C, C, Rf + 2 * u, R + 4 * u, b0, b1)}" fill="${colors.amber}" fill-opacity="0.9"/></svg></div>`);
+ });
}
if (cfg.ghosts && track.remembered.length) {
parts.push(layer("gn", `<line x1="${C}" y1="${C + 22 * u}" x2="${C}" y2="${C - Rf + 66 * u}" stroke="${colors.ghost}" stroke-width="${px(5)}" stroke-linecap="round"/>`));
@@ -159,7 +185,9 @@ function dialParts({ size, ox, oy, scale, cfg, colors, fonts, track, prefix = ""
// Along its ghost, but never down into the readout's words under the hub.
const [x, y0] = polar(C, C, Rf * 0.52, a);
const y = Math.min(y0, Math.round((C + 30 * u) * 100) / 100);
- parts.push(`<div class="asof" data-k="${prefix}ga${j}" style="left:${x}px; top:${y}px"><b>${esc(qualifierMark(g.qualifier))}${esc(fmtWeight(g.value))}</b><span>${g.asOf ? `AS OF ${esc(fmtDate(g.asOf))}` : "REMEMBERED"}</span></div>`);
+ // The moving start's count rides on its ghost (rev 9: "≈390 · TOLD 5×", the peak module off beside the dial).
+ const told = g.told > 1 ? ` · TOLD ${g.told}×` : "";
+ parts.push(`<div class="asof" data-k="${prefix}ga${j}" style="left:${x}px; top:${y}px"><b>${esc(weightWords(g))}</b><span>${g.asOf ? `AS OF ${esc(fmtDate(g.asOf))}` : "REMEMBERED"}${told}</span></div>`);
});
}
// The readout under the hub: the words, the weight, the weighing's date, the goal.
@@ -167,7 +195,9 @@ function dialParts({ size, ox, oy, scale, cfg, colors, fonts, track, prefix = ""
parts.push(`<div class="rlab" style="top:${C + 72 * u}px">${esc(cfg.label)}</div>`);
track.current.forEach((c, j) => {
const has = Number.isFinite(c.value);
- parts.push(`<div class="read" data-k="${prefix}cv${j}" style="top:${C + 86 * u}px"><div class="big">${has ? `${esc(qualifierMark(c.qualifier))}${esc(fmtWeight(c.value))}<i>LB</i>` : "—"}</div>${has && c.date ? `<div class="when" style="top:${78 * u}px">${esc(fmtDate(c.date))}</div>` : ""}</div>`);
+ // Before he states a weight: the pre-state, in words -- never a number he did not give.
+ const pre = !has && preState && j === 0;
+ parts.push(`<div class="read${pre ? " pre" : ""}" data-k="${prefix}cv${j}" style="top:${C + 86 * u}px"><div class="big">${has ? `${esc(weightWords(c))}<i>LB</i>` : pre ? "NO WEIGHT<br>STATED YET" : "—"}</div>${has && c.date ? `<div class="when" style="top:${78 * u}px">${esc(fmtDate(c.date))}</div>` : ""}</div>`);
});
if (cfg.goal) {
track.goals.forEach((g, j) => {
@@ -192,6 +222,9 @@ function dialParts({ size, ox, oy, scale, cfg, colors, fonts, track, prefix = ""
color: ${colors.muted}; margin-left: ${px(6)}px; }
.dial .read .when { position: absolute; left: 0; width: ${size}px; font-family: ${fontStack(fonts, "condensed")}; font-size: ${fpx(16)}px;
line-height: ${Math.max(15, px(20))}px; letter-spacing: 0.1em; color: ${colors.muted}; }
+ .dial .read.pre .big { font-size: ${px(30)}px; line-height: ${px(34)}px; letter-spacing: 0.06em; color: ${colors.muted}; padding-top: ${px(6)}px; }
+ .dial .qlab { position: absolute; transform: translate(-50%, -50%); font-family: ${fontStack(fonts, "display")}; font-size: ${px(26)}px;
+ color: ${colors.accent}; white-space: nowrap; padding: ${px(1)}px ${px(6)}px; border-radius: ${px(5)}px; background: ${rgba(colors.face, 0.9)}; }
.dial .goalw { position: absolute; left: 0; width: ${size}px; text-align: center; font-family: ${fontStack(fonts, "bold")};
font-size: ${fpx(17)}px; line-height: ${Math.max(15, px(20))}px; letter-spacing: 0.05em; color: ${colors.amber}; white-space: nowrap; }`;
return { html: `<div class="dial">${parts.join("\n ")}</div>`, css, face };
@@ -206,16 +239,25 @@ function dialCues(L, { track, scale, cfg, prefix = "", finale = false }) {
const a0 = DIAL_SWEEP.a0;
const k = (s) => `${prefix}${s}`;
// The finale drives its own needle (dialFinaleHtml).
- if (!finale) L.set(k("nd"), { rotation: a0 });
+ // Before any stated weight the needle rests at the scale's foot, dimmed (the pre-state); it comes up with the first.
+ const pre = !finale && track.current.length && !Number.isFinite(track.current[0].value);
+ if (!finale) L.set(k("nd"), { rotation: a0, opacity: pre ? 0.3 : 1 });
+ let lit = !pre;
track.current.forEach((c, j) => {
- if (j > 0 && !finale) L.add(k("nd"), c.t, M.needle, { rotation: Number.isFinite(c.value) ? dialAngle(c.value, scale) : a0 }, needleEase(cfg));
- // The wedge once the needle is all but there, gone with its state.
- const w = Number.isFinite(c.value) ? wedgeRange(c.value, c.qualifier) : null;
+ if (j > 0 && !finale) {
+ const has = Number.isFinite(c.value);
+ L.add(k("nd"), c.t, M.needle, { rotation: has ? dialAngle(c.value, scale) : a0, ...(has && !lit ? { opacity: 1 } : {}) }, needleEase(cfg));
+ if (has) lit = true;
+ }
+ // The wedge once the needle is all but there, gone with its state -- and its words with it.
+ const w = Number.isFinite(c.value) ? wedgeRange(c.value, c.qualifier, c.range) : null;
if (w && dialAngle(w[1], scale) > dialAngle(w[0], scale)) {
- L.set(k(`q${j}`), { autoAlpha: 0 });
- L.add(k(`q${j}`), c.t + M.needle * 0.6, M.fade, { autoAlpha: 1 }, "power1.out");
- const next = track.current[j + 1];
- if (next) L.add(k(`q${j}`), next.t, M.fade * 0.6, { autoAlpha: 0 }, "power1.in");
+ for (const key of [`q${j}`, `ql${j}`]) {
+ L.set(k(key), { autoAlpha: 0 });
+ L.add(k(key), c.t + M.needle * 0.6, M.fade, { autoAlpha: 1 }, "power1.out");
+ const next = track.current[j + 1];
+ if (next) L.add(k(key), next.t, M.fade * 0.6, { autoAlpha: 0 }, "power1.in");
+ }
}
});
blocks(L, track.current, k("cv"));
@@ -223,6 +265,10 @@ function dialCues(L, { track, scale, cfg, prefix = "", finale = false }) {
track.remembered.forEach((g, j) => {
L.set(k(`g${j}`), { rotation: dialAngle(g.value, scale), autoAlpha: 0 });
L.add(k(`g${j}`), g.t, M.fade, { autoAlpha: 0.55 }, "power1.out");
+ if (Array.isArray(g.range) && dialAngle(g.range[1], scale) > dialAngle(g.range[0], scale)) {
+ L.set(k(`gb${j}`), { autoAlpha: 0 });
+ L.add(k(`gb${j}`), g.t, M.fade, { autoAlpha: 1 }, "power1.out");
+ }
});
if (track.remembered.length && finale) {
// All at once: the long ghost and its words on the last (the finale puts his highest there).
@@ -262,6 +308,15 @@ function dialCues(L, { track, scale, cfg, prefix = "", finale = false }) {
}
}
blocks(L, track.goals, k("gw"), { shown: (g) => !!g.goal });
+ // A range goal's band, up while it is the latest goal.
+ track.goals.forEach((g, j) => {
+ const r = g.goal?.range;
+ if (!Array.isArray(r) || !(dialAngle(r[1], scale) > dialAngle(r[0], scale))) return;
+ L.set(k(`gr${j}`), { autoAlpha: 0 });
+ L.add(k(`gr${j}`), g.t, M.fade, { autoAlpha: 1 }, "power1.out");
+ const next = track.goals[j + 1];
+ if (next) L.add(k(`gr${j}`), next.t, M.fade, { autoAlpha: 0 }, "power1.in");
+ });
}
}
@@ -465,9 +520,17 @@ export function trailHtml(schedule, render, opts = {}) {
const counts = cfg.count && mark === 300 ? track.under.slice().sort((a, b) => a.t - b.t).map((x, n) => ({ t: x.t, n: n + 1 })) : [];
counts.forEach((c) => parts.push(`<div class="cnt" data-k="uc${c.n - 1}">UNDER ${mark} · SAID ${c.n}×</div>`));
if (counts.length) blocks(L, counts, "uc");
+ // THE TRAIL YIELDS to the promise clock (measure-extras' `promise.slot: "column"`, the default beside the
+ // instruments): faded out while the clock stands in its slot, back when it goes.
+ for (const sp of trailYields(schedule, render)) {
+ L.add("ty", sp.in, 0.4, { autoAlpha: 0 }, "power1.in");
+ if (sp.out < schedule.total - 0.05) L.add("ty", sp.out, 0.4, { autoAlpha: 1 }, "power1.out");
+ }
+ L.set("ty", { autoAlpha: 1 });
const { init, cues } = L.build();
const css = `
#rt { position: absolute; inset: 0; }
+ .ty { position: absolute; inset: 0; }
.trail { position: absolute; inset: 0; border-radius: ${px(10)}px; background: ${colors.card}; }
.trail .lab { position: absolute; left: ${px(14)}px; top: ${px(10)}px; font-family: ${fontStack(fonts, "condensed")}; font-size: ${px(14)}px;
letter-spacing: 0.12em; color: ${colors.muted}; white-space: nowrap; }
@@ -490,10 +553,18 @@ export function trailHtml(schedule, render, opts = {}) {
id: "trail", W, H, fps, fonts, gsap: opts.gsap,
data: { total: r4(schedule.total), window: windowOf(schedule, opts, "trail"), init, cues },
css,
- body: `<div id="rt" data-k="rt"><div class="trail"><div class="lab">${esc(cfg.label)}</div>${parts.join("")}</div></div>`,
+ body: `<div id="rt" data-k="rt"><div class="ty" data-k="ty"><div class="trail"><div class="lab">${esc(cfg.label)}</div>${parts.join("")}</div></div></div>`,
});
}
+/** When the promise clock stands in the trail's slot (its up spans, `promise.slot` "column"): the trail yields then. */
+export function trailYields(schedule, render) {
+ const cfg = resolveMeasureExtra("promise", render);
+ if (!cfg || cfg.slot !== "column") return [];
+ const states = promiseStates(schedule, render);
+ return states.length ? upSpans(states.map((x) => x.at), { ...cfg, finale: "show" }, schedule) : [];
+}
+
// ---------------------------------------------------------------------------
// The dial's finale.
// ---------------------------------------------------------------------------
@@ -530,6 +601,7 @@ export function finaleNumbers(measure) {
return {
weight: Number.isFinite(to) ? to : null,
qualifier: lastCur && lastCur.value === to ? lastCur.qualifier : null,
+ range: lastCur && lastCur.value === to && Array.isArray(lastCur.range) ? lastCur.range : null,
lost, runs, from: Number.isFinite(from) ? from : null,
peak: peaks.length ? Math.max(...peaks) : null,
goal: [...track.goals].reverse().find((g) => g.goal)?.goal ?? null,
@@ -537,7 +609,7 @@ export function finaleNumbers(measure) {
}
/** The handoff to the promise clock: NET's beat (in at the grow + 3.2 s) held `hold` s, then a `fade`. */
-export const FINALE_HANDOFF = Object.freeze({ net: 3.2, hold: 2.3, fade: 0.5 });
+export const FINALE_HANDOFF = Object.freeze({ net: 3.2, hold: 2.3, fade: 0.5, clock: 2.5 });
/**
* When the dial's finale hands the finale's lower column to the promise clock
@@ -549,10 +621,17 @@ export const FINALE_HANDOFF = Object.freeze({ net: 3.2, hold: 2.3, fade: 0.5 });
*/
export function dialFinaleHandoff(schedule, render) {
const fin = schedule?.finale;
- if (!fin || resolveDial(render)?.finaleEnd !== "promise") return null;
- // On the cue grid, so the promise clock's cue and the instruments' land on the same frame.
- const at = cueTime(fin.from + FINALE_MOTION.grow + FINALE_HANDOFF.net + 0.5 + FINALE_HANDOFF.hold, schedule.fps ?? render.fps ?? 30);
- return at + FINALE_HANDOFF.fade < fin.to ? at : null;
+ const end = resolveDial(render)?.finaleEnd;
+ // "auto": the promise clock's when a promise is on camera.
+ const promised = (schedule?.measure?.events ?? []).some((e) => e?.kind === "promise" && Number.isFinite(e.t));
+ if (!fin || !(end === "promise" || (end === "auto" && promised))) return null;
+ // On the cue grid, so the promise clock's cue and the instruments' land on the same frame. NET's hold shortens
+ // in a short finale so the clock still has FINALE_HANDOFF.clock seconds (rev 9: a 7.2 s finale left it none),
+ // but never before NET has come in.
+ const fps = schedule.fps ?? render.fps ?? 30;
+ const netIn = fin.from + FINALE_MOTION.grow + FINALE_HANDOFF.net + 0.5;
+ const at = cueTime(Math.min(netIn + FINALE_HANDOFF.hold, fin.to - FINALE_HANDOFF.clock), fps);
+ return at >= netIn - 1e-6 && at + FINALE_HANDOFF.fade < fin.to ? at : null;
}
/**
@@ -579,18 +658,18 @@ export function dialFinaleHtml(schedule, render, window, opts = {}) {
const full = measureTrack(M);
// The dial's track in the finale: every ghost already there, one state of the needle, the latest goal.
const A = from + FINALE_MOTION.grow;
- // His highest remembered weight last, so the long ghost stands on it.
+ // The ghosts in the order the cut told them, so the long ghost and its words stand on the LATEST remembered row --
+ // the one the cut's last state shows ("≈390 AS OF FEB 2025"), never an earlier telling of the same number.
const rem = full.remembered.map((r, n) => ({ ...r, t: A, n }));
- const peakAt = rem.reduce((b, r, n) => (r.value > rem[b].value ? n : b), 0);
const track = {
...full,
- current: [{ t: from, value: null }, { t: A + 0.4, value: nums.weight, qualifier: nums.qualifier, date: null }],
- remembered: rem.length ? [...rem.filter((_, n) => n !== peakAt), rem[peakAt]] : [],
+ current: [{ t: from, value: null }, { t: A + 0.4, value: nums.weight, qualifier: nums.qualifier, date: null, ...(nums.range ? { range: nums.range } : {}) }],
+ remembered: rem,
goals: nums.goal ? [{ t: from, goal: null }, { t: A + 0.4, goal: nums.goal }] : [{ t: from, goal: null }],
};
const size = even(Math.min(H, Math.round(W * 0.56)));
const k = size / 524;
- const dial = dialParts({ size, ox: 0, oy: Math.floor((H - size) / 2), scale: M.scale, cfg, colors, fonts, track, prefix: "f" });
+ const dial = dialParts({ size, ox: 0, oy: Math.floor((H - size) / 2), scale: M.scale, cfg, colors, fonts, track, prefix: "f", preState: false });
const rw = W - size - Math.round(40 * k);
const top = Math.max(Number(M.totals?.lost) || 0, nums.lost);
const wheels = wheelCount(top);
@@ -602,8 +681,10 @@ export function dialFinaleHtml(schedule, render, window, opts = {}) {
prefix: "o", big: true,
});
const L = cueList(fps);
+ // In with the finale itself, over its grow, as the column's instruments go under it (withDeck): a crossfade, no
+ // empty frame between them (rev 9: 0.8 s of the finale's ground alone at 779.3 s).
L.set("rt", { autoAlpha: 0 });
- L.add("rt", A, 0.4, { autoAlpha: 1 }, "power2.out");
+ L.add("rt", from, FINALE_MOTION.grow, { autoAlpha: 1 }, "power1.inOut");
const D = Number(schedule.transition) || 0;
// The last beat: the promise clock's (deck.dial.finaleEnd "promise", a promise module on the cut) --
// the instruments go at the handoff and leave it the column -- else theirs, out through the dissolve.
diff --git a/umtool/report-to-video/instruments.mjs b/umtool/report-to-video/instruments.mjs
@@ -13,8 +13,9 @@
// up to the playhead, the 300 lb line, a count
// of the times he says he is under it
//
-// Each is `true` (its defaults), an object of its settings, or absent/false
-// (off). With any of them on the frame changes: the footage box moves to the
+// Each is `true` (its defaults), an object of its settings, or `false` (off);
+// absent, it is ON when the cut draws a measure (`deck.measure` set) and off
+// when it does not. With any of them on the frame changes: the footage box moves to the
// left edge and the column takes the right (deck.mjs deckGeometry,
// instrumentsGeometry); the posts stay in the footage box (`posts.shift` does
// not apply) and the side panel (threads, flips) and the feed are refused.
@@ -59,13 +60,15 @@ export const DIAL_DEFAULTS = Object.freeze({
// "promise" -- the instruments hand off to the promise clock (module `promise`):
// they fade out at the handoff (dialFinaleHandoff) and the clock takes the column.
// With no promise module on the cut it ends as "odometer".
- finaleEnd: "odometer",
+ // "auto" (the default): "promise" when a promise is on camera, else "odometer" --
+ // the contract's finale: the dial drops, the odometer rolls, NET holds, THEN the promise clock.
+ finaleEnd: "auto",
});
export const DIAL_PLACEMENTS = Object.freeze(["column", "corner"]);
export const DIAL_CORNERS = Object.freeze(["bottom-right", "bottom-left", "top-right", "top-left"]);
export const DIAL_MOTIONS = Object.freeze(["spring", "ease"]);
-export const DIAL_FINALE_ENDS = Object.freeze(["odometer", "promise"]);
+export const DIAL_FINALE_ENDS = Object.freeze(["auto", "odometer", "promise"]);
/** A corner dial's size bounds, px at 1920 wide. */
export const DIAL_SIZE = Object.freeze([200, 540]);
@@ -92,16 +95,25 @@ const isObj = (v) => v !== null && typeof v === "object" && !Array.isArray(v);
const HEX_RE = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
const numIn = (v, lo, hi) => typeof v === "number" && Number.isFinite(v) && v >= lo && v <= hi;
-/** An instrument's settings, its defaults filled, or null when it is off. */
-function resolveOne(v, defaults) {
- if (v === true) return { ...defaults };
+/**
+ * Does the cut draw a measure (`render.chrome.deck.measure` set -- the build
+ * writes the measure slice only then)? With one, every instrument is ON unless
+ * it says otherwise -- as the measure extras are (rev 9, 6 Nov: the contract's
+ * "on by default"); without one, an instrument is on only when it is named.
+ */
+export const measureAsked = (render) => isObj(render?.chrome?.deck?.measure);
+
+/** An instrument's settings, its defaults filled, or null when it is off (`false`; absent without a measure). */
+function resolveOne(v, defaults, render) {
+ if (v === false) return null;
+ if (v === true || (v === undefined && measureAsked(render))) return { ...defaults };
if (!isObj(v)) return null;
return { ...defaults, ...v };
}
-export const resolveDial = (render) => resolveOne(render?.chrome?.deck?.dial, DIAL_DEFAULTS);
-export const resolveOdometer = (render) => resolveOne(render?.chrome?.deck?.odometer, ODOMETER_DEFAULTS);
-export const resolveTrail = (render) => resolveOne(render?.chrome?.deck?.trail, TRAIL_DEFAULTS);
+export const resolveDial = (render) => resolveOne(render?.chrome?.deck?.dial, DIAL_DEFAULTS, render);
+export const resolveOdometer = (render) => resolveOne(render?.chrome?.deck?.odometer, ODOMETER_DEFAULTS, render);
+export const resolveTrail = (render) => resolveOne(render?.chrome?.deck?.trail, TRAIL_DEFAULTS, render);
/** Which instruments the render block asks for, in the column's order (top first). */
export function instrumentsWanted(render) {
diff --git a/umtool/report-to-video/instruments.test.mjs b/umtool/report-to-video/instruments.test.mjs
@@ -107,12 +107,12 @@ test("the instruments' settings: true, an object of known keys, or off; the side
const side = validateChrome({ ...chromeWith({ trail: true }), threads: { list: [{ id: "a", label: "A" }] } }, {});
assert.ok(side.some((e) => /render\.chrome\.threads and render\.chrome\.deck\.trail both need the frame/.test(e)), side.join("\n"));
assert.deepEqual(resolveDial(RENDER), {
- mark: 300, ghosts: true, goal: true, needle: "#ff5a4e", finale: true, label: "HE SAYS HE WEIGHS", placement: "column", size: 340, corner: "bottom-right", motion: "spring", finaleEnd: "odometer",
+ mark: 300, ghosts: true, goal: true, needle: "#ff5a4e", finale: true, label: "HE SAYS HE WEIGHS", placement: "column", size: 340, corner: "bottom-right", motion: "spring", finaleEnd: "auto",
});
assert.match(validateDial({ placement: "left" })[0], /placement must be "column" or "corner"/);
assert.match(validateDial({ size: 100 })[0], /size must be a whole number of pixels from 200 to 540/);
assert.match(validateDial({ motion: "bounce" })[0], /motion must be "spring" or "ease"/);
- assert.match(validateDial({ finaleEnd: "net" })[0], /finaleEnd must be "odometer" or "promise"/);
+ assert.match(validateDial({ finaleEnd: "net" })[0], /finaleEnd must be "auto" or "odometer" or "promise"/);
assert.equal(resolveDial({ chrome: chromeWith({ dial: false }) }), null);
assert.deepEqual(moduleProblems({ render: { ...RENDER, chrome: chromeWith({ dial: { ghost: true } }) } }).dial, ["render.chrome.deck.dial.ghost is not a setting of it (mark, ghosts, goal, needle, finale, label, placement, size, corner, motion, finaleEnd)"]);
});
diff --git a/umtool/report-to-video/measure-draw.mjs b/umtool/report-to-video/measure-draw.mjs
@@ -107,6 +107,11 @@ export function fmtSigned(v) {
/** The qualifier as the dial prints it before the digits. */
export const qualifierMark = (q) => (q === "≈" ? "≈" : q === ">" ? ">" : q === "<" ? "<" : "");
+/** A weight as the dial writes it: a range "330–340" (never its middle alone), else its qualifier and number. */
+export const weightWords = (x) => (Array.isArray(x?.range) && x.range.length === 2
+ ? `${fmtWeight(x.range[0])}–${fmtWeight(x.range[1])}`
+ : `${qualifierMark(x?.qualifier)}${fmtWeight(x?.value)}`);
+
/** A day number for an ISO date (for spacing by date). */
export const dayNumber = (iso) => {
const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso ?? ""));
@@ -162,13 +167,17 @@ export function measureTrack(measure) {
if (!i || !sameCurrent(prev.current, s.current)) {
const c = s.current ?? null;
const ev = c ? byRow.get(c.row) : null;
- current.push({ t, value: c?.value ?? null, qualifier: c?.qualifier ?? null, row: c?.row ?? null, date: ev?.asOf ?? c?.date ?? null });
+ const range = Array.isArray(c?.range) ? c.range : Array.isArray(ev?.range) ? ev.range : null;
+ current.push({ t, value: c?.value ?? null, qualifier: c?.qualifier ?? null, row: c?.row ?? null, date: ev?.asOf ?? c?.date ?? null, ...(range ? { range } : {}) });
}
const rem = Array.isArray(s.remembered) ? s.remembered : [];
const had = prev && Array.isArray(prev.remembered) ? prev.remembered.length : 0;
for (let j = had; j < rem.length; j += 1) {
const ev = byRow.get(rem[j].row);
- remembered.push({ t, value: rem[j].value, asOf: rem[j].asOf ?? null, row: rem[j].row, qualifier: ev?.qualifier ?? null });
+ const range = Array.isArray(rem[j].range) ? rem[j].range : Array.isArray(ev?.range) ? ev.range : null;
+ // How many times he has told this start so far (the moving start's count, on the dial's ghost: "told 5×").
+ const told = remembered.filter((r) => Math.abs(r.value - rem[j].value) < 0.05).length + 1;
+ remembered.push({ t, value: rem[j].value, asOf: rem[j].asOf ?? null, row: rem[j].row, qualifier: ev?.qualifier ?? rem[j].qualifier ?? null, told, ...(range ? { range } : {}) });
}
if (!i || !sameGoal(prev.goal, s.goal)) goals.push({ t, goal: s.goal ?? null });
const total = Number(s.lost?.total) || 0;
@@ -214,8 +223,12 @@ export function sectorPath(cx, cy, r0, r1, a0, a1) {
return `M${p} A${r1},${r1} 0 ${lg} 1 ${q} L${s} A${r0},${r0} 0 ${lg} 0 ${t}Z`;
}
-/** A qualifier's wedge, in pounds: "≈" 3 under to 1 over, ">" 10 up, "<" 10 down. */
-export function wedgeRange(value, q) {
+/**
+ * A weight's wedge, in pounds: a RANGE he gave, the range itself ("330-340");
+ * else a qualifier's -- "≈" 3 under to 1 over, ">" 10 up, "<" 10 down.
+ */
+export function wedgeRange(value, q, range = null) {
+ if (Array.isArray(range) && range.length === 2 && range[1] > range[0]) return [range[0], range[1]];
if (q === "≈") return [value - 3, value + 1];
if (q === ">") return [value, value + 10];
if (q === "<") return [value - 10, value];
diff --git a/umtool/report-to-video/modules/dial.mjs b/umtool/report-to-video/modules/dial.mjs
@@ -36,13 +36,13 @@ export default defineModule({
{ key: "size", type: "number", min: 200, max: 540, step: 10, label: "The corner dial's size (px at 1920)", default: 340 },
{ key: "corner", type: "enum", options: ["bottom-right", "bottom-left", "top-right", "top-left"], label: "The corner", default: "bottom-right" },
{ key: "motion", type: "enum", options: ["spring", "ease"], label: "The needle's move", default: "spring" },
- { key: "finaleEnd", type: "enum", options: ["odometer", "promise"], label: "The finale's last beat", default: "odometer" },
+ { key: "finaleEnd", type: "enum", options: ["auto", "odometer", "promise"], label: "The finale's last beat", default: "auto" },
],
docs: {
heading: "Scale dial",
intro: "A bathroom-scale face at the top of the instruments' column (the right of the frame; the clip moves to the left -- `instrumentsGeometry`, 1248×702 footage beside a 600 px column at 1920×1080). It reads the schedule's `measure` (the measure ledger's slice): the red needle swings to each STATED weight at its event's `t` (the spoken word) with a spring (`back.out`, 0.9 s) and rests there -- a frame at rest is reused, not captured again; a qualifier draws a wedge in pounds (≈ 3 under to 1 over, `>` 10 up, `<` 10 down); every REMEMBERED weight is a grey tick, the latest a long ghost needle with its as-of date; the latest goal is an amber tick on the bezel and its words under the digits. It comes and goes with the deck (a card, the finale). With any instrument on, the posts stay in the footage box (`posts.shift` does not apply), and the side panel (`threads`, `flips`) and the posts feed are refused.",
rows: [
- ["`deck.dial`", "`true` · an object of the knobs below · absent or `false` off", "`umtool look <p> deck.dial=true`"],
+ ["`deck.dial`", "`true` · an object of the knobs below · `false` off · absent: ON when the cut draws a measure (`deck.measure` set), else off", "`umtool look <p> deck.dial=false`"],
["`deck.dial.mark`", "a weight, or `null` · default `300` (its tick and label in the accent)", "`umtool look <p> deck.dial.mark=300`"],
["`deck.dial.ghosts`, `.goal`", "bool · default `true` each", "`umtool look <p> deck.dial.ghosts=false`"],
["`deck.dial.needle`", "a #hex · default `#ff5a4e`", "`umtool look <p> deck.dial.needle='\"#ff5a4e\"'`"],
@@ -52,7 +52,7 @@ export default defineModule({
["`deck.dial.size`", "200–540 px at 1920 wide · default `340` (the corner dial only)", "`umtool look <p> deck.dial.size=300`"],
["`deck.dial.corner`", "`bottom-right` `bottom-left` `top-right` `top-left` · default `bottom-right` (the corner only): the dial in that corner, the odometer and the trail up the same side. The measure extras stand at their own anchors in the footage (goals bottom-right, peak top-right, promise top-centre, diet bottom-left, streak bottom-centre): a corner instrument over one that is on is REFUSED by the build, naming it -- move one (`deck.goals.position`, …) or the corner; `top-left` is clear of all five", "`umtool look <p> deck.dial.corner=top-left`"],
["`deck.dial.motion`", "`spring` `ease` · default `spring`. A VARIANT: the needle's `back.out` overshoot and settle, or a plain `power2.inOut` (the finale's drop too)", "`umtool look <p> deck.dial.motion=ease`"],
- ["`deck.dial.finaleEnd`", "`odometer` `promise` · default `odometer`. A VARIANT: `promise` hands the finale's last beat to the promise clock (module `promise`) -- the instruments fade out once NET has held (`dialFinaleHandoff`); with no promise module on the cut it ends on the odometer", "`umtool look <p> deck.dial.finaleEnd=promise`"],
+ ["`deck.dial.finaleEnd`", "`auto` `odometer` `promise` · default `auto` (`promise` when a promise is on camera, else `odometer`): `promise` hands the finale's last beat to the promise clock (module `promise`) -- the instruments fade out once NET has held (`dialFinaleHandoff`) and the clock takes their place in the finale's lower column, clear of the rail; with no promise module on the cut it ends on the odometer", "`umtool look <p> deck.dial.finaleEnd=promise`"],
],
},
region: "dial",
diff --git a/umtool/report-to-video/modules/odometer.mjs b/umtool/report-to-video/modules/odometer.mjs
@@ -34,7 +34,7 @@ export default defineModule({
heading: "Lost odometer",
intro: "Under the dial: the measure's `state.lost.total` (the highest real-time loss claim in each run, summed) on mechanical wheels to a tenth, rolling forward at each claim that raises it (1.3 s) and never back -- a lower total is held at the highest so far. NET (`state.net`: the first stated weight of the record to the latest) in plain digits beside it, `−76.5 · 368 → 291.5`; `ACROSS 8 RUNS` under the wheels.",
rows: [
- ["`deck.odometer`", "`true` · an object of the knobs below · absent or `false` off", "`umtool look <p> deck.odometer=true`"],
+ ["`deck.odometer`", "`true` · an object of the knobs below · `false` off · absent: ON when the cut draws a measure (`deck.measure` set), else off", "`umtool look <p> deck.odometer=false`"],
["`deck.odometer.label`", "words over the wheels, ≤ 40 · default `POUNDS HE SAYS HE'S LOST`", "`umtool look <p> deck.odometer.label='\"…\"'`"],
["`deck.odometer.net`, `.runs`", "bool · default `true` each", "`umtool look <p> deck.odometer.net=false`"],
],
diff --git a/umtool/report-to-video/modules/trail.mjs b/umtool/report-to-video/modules/trail.mjs
@@ -33,7 +33,7 @@ export default defineModule({
heading: "Weight trail",
intro: "At the foot of the instruments' column: every STATED weight the cut shows, placed by the date he was weighed (its `asOf`, else its date) across the span of them, a dot appearing at its event's `t` and the line between two neighbours drawn once both are said; a red ring on the latest said. The `mark` line (300) dashed across; with `count` and the mark at 300, `UNDER 300 · SAID n×` counts the measure's `totals.under300` rows as the cut reaches each.",
rows: [
- ["`deck.trail`", "`true` · an object of the knobs below · absent or `false` off", "`umtool look <p> deck.trail=true`"],
+ ["`deck.trail`", "`true` · an object of the knobs below · `false` off · absent: ON when the cut draws a measure (`deck.measure` set), else off", "`umtool look <p> deck.trail=false`"],
["`deck.trail.mark`", "a weight, or `null` · default `300`", "`umtool look <p> deck.trail.mark=300`"],
["`deck.trail.count`", "bool · default `true`", "`umtool look <p> deck.trail.count=false`"],
["`deck.trail.label`", "its title, ≤ 40 · default `WHAT HE SAYS HE WEIGHS, BY DATE`", "`umtool look <p> deck.trail.label='\"…\"'`"],