Skip to content

Art and animation, written as code. Illustrations, loops, interactive web art, launch-videos and scored films in dozens of styles, identical on every render.

motion names: review fixes (find ranks the right move first, honest refusals, freeze guard on near-zero speed, shake under a lens tested)

Alex Greenshpun57aff1f34f63
diff --git a/plugins/anidoodle/skills/anidoodle/SKILL.md b/plugins/anidoodle/skills/anidoodle/SKILL.md
index f893180..76f893f 100644
--- a/plugins/anidoodle/skills/anidoodle/SKILL.md
+++ b/plugins/anidoodle/skills/anidoodle/SKILL.md
@@ -102,7 +102,7 @@ draws itself declares `kind: "drawing"` and is judged on a finer floor; a freeze
`engine/` is the portable art core plus the tooling. `engine/src/canvas-core` knows nothing
about the DOM or any backend. `W`, `H`, `fps` and `durationFrames` come from the film's `meta`.
-Camera moves (pans, dollies, lens and dolly zooms, parallax, shake) and slow motion or freeze frames (`timeRemap.ts`): `engine/src/canvas-core/camera.ts`, `references/camera.md`.
+Camera moves (pans, dollies, lens and dolly zooms, parallax, shake) and slow motion or freeze frames: `engine/src/canvas-core/camera.ts`, `engine/src/canvas-core/timeRemap.ts`, `references/camera.md`.
Seams between scenes: `references/motion-grammar.md` (cuts that carry motion: `seams.ts`; `tools/deck.mjs deal` deals each film different moves; `deck.mjs find "<name>"` turns a move's everyday name into its card). `render.mjs --blur auto` renders with motion blur (subframes per frame
from its measured on-screen speed, averaged in linear light, `--shutter 180`); the default path is untouched.
diff --git a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/calloutDemo.ts b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/calloutDemo.ts
index 5a12887..446a708 100644
--- a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/calloutDemo.ts
+++ b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/calloutDemo.ts
@@ -9,7 +9,7 @@
// a second callout names the full moon from the calm ground under the card, then leaves.
import type { Ctx, Env, P } from "./core";
import type { Film } from "./film";
-import { Camera } from "./camera";
+import { Camera, heroScale } from "./camera";
import { out3, plateLayer, ramp, rr } from "./launchKit";
import { calloutPose, checkHandoff, drawCallout, drawLabel, type Callout, type LabelPose } from "./callout";
import { iris, seam } from "./transitions";
@@ -27,7 +27,7 @@ const CARD = { x: 60, y: 300, w: 960, h: 545, sx: 20, sy: 170, sw: 1040, sh: 590
const full: Callout = { text: "FULL, DAY 15", anchor: () => [CARD.x + ((540 - CARD.sx) / CARD.sw) * CARD.w, CARD.y + ((372 - CARD.sy) / CARD.sh) * CARD.h], label: { p: [610, 960], size: 38 }, t0: 178, out: 250, color: CREAM, accent: GOLD };
const scene1 = (env: Env, f: number) => (c: Ctx) => {
- const L = plateLayer(env, "calloutdemo:fox", fox, 0, Math.round(W * env.scale * 1.3), true).canvas, o = cam.toScreen([0, 0], f), k = cam.at(f).zoom;
+ const L = plateLayer(env, "calloutdemo:fox", fox, 0, Math.round(W * env.scale * 1.3), true).canvas, o = cam.toScreen([0, 0], f), k = heroScale(cam.at(f));
c.setTransform(env.scale, 0, 0, env.scale, 0, 0); c.globalAlpha = 1; c.drawImage(L, o[0], o[1], W * k, H * k);
};
const scene2 = (env: Env, f: number) => (c: Ctx) => {
diff --git a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/camera.ts b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/camera.ts
index 97d2f29..4a05555 100644
--- a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/camera.ts
+++ b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/camera.ts
@@ -30,7 +30,8 @@
import { fractal, Gfx, P } from "./core";
// look: world point at the frame's centre; zoom: the dolly, screen px per world unit on the hero plane
-// at lens 1; lens: the focal length as a factor (default 1), scaling every plane equally
+// at lens 1; lens: the focal length as a factor, scaling every plane equally (1 when no key sets it;
+// once one does, frames before the first lens key hold that key's value, so key lens: 1 where it starts)
export type Cam = { look: P; zoom: number; lens?: number };
export type EaseName = "linear" | "in" | "out" | "inout";
export const EASE: Record<EaseName, (u: number) => number> = {
@@ -93,7 +94,7 @@ export const strokeWeight = (c: Cam, exp = 0.35): number => Math.pow(heroScale(c
export const dollyZoom = (path: (f: number) => Cam, opts: { hold?: number; at?: number } = {}): ((f: number) => Cam) => {
const hold = opts.hold ?? heroScale(path(opts.at ?? 0)); // the path's own lens counts here; after this the lens is solved
if (!(hold > 0) || !Number.isFinite(hold)) throw new Error(`dollyZoom: the scale to hold must be a positive number (got ${hold})`);
- return (f) => { const c = path(f); if (!(c.zoom > 0)) throw new Error(`dollyZoom: zoom must be positive (got ${c.zoom} at frame ${f})`); return { look: c.look, zoom: c.zoom, lens: hold / c.zoom }; };
+ return (f) => { const c = path(f); if (!(c.zoom > 0 && Number.isFinite(c.zoom))) throw new Error(`dollyZoom: zoom must be positive (got ${c.zoom} at frame ${f})`); return { look: c.look, zoom: c.zoom, lens: hold / c.zoom }; };
};
export class Camera {
@@ -112,14 +113,14 @@ export class Camera {
for (const k of this.keys) {
if (!Number.isInteger(k.f) || k.f < 0) throw new Error(`camera key at non-integral or negative frame ${k.f}`);
if (k.f <= last) throw new Error(`camera keys must increase: ${last} then ${k.f}`);
- if (k.zoom !== undefined && !(k.zoom > 0)) throw new Error(`camera zoom must be positive, got ${k.zoom} at frame ${k.f}`);
+ if (k.zoom !== undefined && !(k.zoom > 0 && Number.isFinite(k.zoom))) throw new Error(`camera zoom must be positive, got ${k.zoom} at frame ${k.f}`);
if (k.lens !== undefined && !(k.lens > 0 && Number.isFinite(k.lens))) throw new Error(`camera lens must be a positive number, got ${k.lens} at frame ${k.f}`);
last = k.f;
}
}
// one channel of the keys, eased per segment. Missing values hold the nearest given one, so a
- // key may set only look or only zoom.
+ // key may set only look, only zoom or only lens.
private channel(f: number, get: (k: CamKey) => number | undefined, log2: boolean, mono = log2): number {
const ks = this.keys.map((k, i) => ({ k, v: get(k), i })).filter((e) => e.v !== undefined) as { k: CamKey; v: number; i: number }[];
if (!ks.length) throw new Error("camera keys never set this channel");
@@ -167,7 +168,9 @@ export class Camera {
// [dx, dy] is the camera's look point stepping BACK by that much, in world units.
shaken(f: number): Cam & { rot: number } {
const c = this.at(f), [dx, dy, dr] = this.shakeAt(f), k = heroScale(c);
- return { ...c, look: [c.look[0] - dx / k, c.look[1] - dy / k], rot: dr };
+ const out: Cam & { rot: number } = { look: [c.look[0] - dx / k, c.look[1] - dy / k], zoom: c.zoom, rot: dr };
+ if (c.lens !== undefined) out.lens = c.lens;
+ return out;
}
// plane scale at depth z for a camera state: the hero plane (z = 0) scales by zoom x lens exactly.
diff --git a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/timeRemap.ts b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/timeRemap.ts
index 1bfcf99..54e8d8c 100644
--- a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/timeRemap.ts
+++ b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/timeRemap.ts
@@ -28,7 +28,7 @@
export type TimeKey = {
f: number; // the film frame this speed starts from (whole, increasing)
- speed: number; // scene frames per film frame from here on: 1 real time, 0.25 slow motion, 0 a freeze, 2 fast
+ speed: number; // scene frames per film frame from here on: 1 real time, 0.25 slow motion, 0 a freeze, 2 fast (0 or at least MIN_SPEED)
ramp?: number; // frames over which the speed glides from the old value to this one (default 0, a hard change)
curve?: "smooth" | "linear"; // the glide's shape: smoothstep (default; no kick at either end) or a straight line
keepsMoving?: string; // required when speed is 0: what still moves, on the film's frame, through the freeze
@@ -51,15 +51,23 @@ const CURVES = {
linear: { e: (u: number) => u, area: (u: number) => (u * u) / 2 },
} as const;
+/** The slowest a scene may run without being a freeze. Below it the world looks stopped, so it must be a declared freeze. */
+export const MIN_SPEED = 0.01;
+
type Seg = { f: number; from: number; to: number; ramp: number; curve: (typeof CURVES)["smooth"]; t0: number };
export const timeRemap = (keys: readonly TimeKey[]): TimeRemap => {
let last = -1, prevSpeed = 1;
const segs: Seg[] = [], freezes: Freeze[] = [];
+ // the frames first, all of them, so a later check never reports a symptom of keys out of order
for (const [i, k] of keys.entries()) {
if (!Number.isInteger(k.f) || k.f < 0) throw new Error(`timeRemap: key ${i} is at frame ${k.f}; keys sit on whole film frames from 0`);
if (k.f <= last) throw new Error(`timeRemap: keys must increase (${last} then ${k.f})`);
+ last = k.f;
+ }
+ for (const [i, k] of keys.entries()) {
if (!Number.isFinite(k.speed) || k.speed < 0) throw new Error(`timeRemap: speed at frame ${k.f} must be a number of 0 or more (got ${k.speed}); time never runs backwards`);
+ if (k.speed > 0 && k.speed < MIN_SPEED) throw new Error(`timeRemap: speed ${k.speed} at frame ${k.f} looks frozen; use speed 0 with keepsMoving, or at least ${MIN_SPEED}`);
const ramp = k.ramp ?? 0, curve = k.curve ?? "smooth", next = keys[i + 1]?.f;
if (!Number.isFinite(ramp) || ramp < 0) throw new Error(`timeRemap: ramp at frame ${k.f} must be 0 or more frames (got ${ramp})`);
if (!(curve in CURVES)) throw new Error(`timeRemap: curve at frame ${k.f} is "smooth" or "linear" (got ${curve})`);
@@ -68,12 +76,13 @@ export const timeRemap = (keys: readonly TimeKey[]): TimeRemap => {
// scene time at this key: the previous segment's area up to here
const t = segs.length ? sceneAt(segs[segs.length - 1], k.f) : k.f;
segs.push({ f: k.f, from: prevSpeed, to: k.speed, ramp, curve: CURVES[curve], t0: t });
- if (k.speed === 0) freezes.push({ from: k.f + ramp, to: next ?? Infinity, keepsMoving: k.keepsMoving!.trim() });
- prevSpeed = k.speed; last = k.f;
+ if (k.speed === 0 && (next ?? Infinity) > k.f + ramp) freezes.push({ from: k.f + ramp, to: next ?? Infinity, keepsMoving: k.keepsMoving!.trim() });
+ prevSpeed = k.speed;
}
const segAt = (f: number): Seg | undefined => { let s: Seg | undefined; for (const x of segs) { if (x.f <= f) s = x; else break; } return s; };
- const at = (f: number): number => { const s = segAt(f); return s ? sceneAt(s, f) : f; };
+ const at = (f: number): number => { if (!Number.isFinite(f)) throw new Error(`timeRemap: frame must be a number (got ${f})`); const s = segAt(f); return s ? sceneAt(s, f) : f; };
const speedAt = (f: number): number => {
+ if (!Number.isFinite(f)) throw new Error(`timeRemap: frame must be a number (got ${f})`);
const s = segAt(f); if (!s) return 1;
const x = f - s.f; return s.ramp > 0 && x < s.ramp ? s.from + (s.to - s.from) * s.curve.e(x / s.ramp) : s.to;
};
@@ -87,6 +96,7 @@ export const timeRemap = (keys: readonly TimeKey[]): TimeRemap => {
if (tail && tail.to === 0) throw new Error(`filmFrameOf: scene frame ${target} is never shown; the film stays frozen at scene frame ${at(hi).toFixed(2)}`);
const rate = tail ? tail.to : 1; hi += Math.ceil((target - at(hi)) / rate) + 1;
while (!reached(hi)) hi += Math.ceil(1 / rate) + 1; // guards rounding only
+ if (!Number.isSafeInteger(hi)) throw new Error(`filmFrameOf: scene frame ${target} is past any film frame`);
}
while (hi - lo > 1) { const mid = Math.floor((lo + hi) / 2); if (reached(mid)) hi = mid; else lo = mid; }
return hi;
diff --git a/plugins/anidoodle/skills/anidoodle/engine/test/camera.test.ts b/plugins/anidoodle/skills/anidoodle/engine/test/camera.test.ts
index c56cbd3..8fe8a50 100644
--- a/plugins/anidoodle/skills/anidoodle/engine/test/camera.test.ts
+++ b/plugins/anidoodle/skills/anidoodle/engine/test/camera.test.ts
@@ -76,15 +76,15 @@ export const run = (ok: (cond: boolean, label: string) => void) => {
const lc = new Camera([540, 540], [{ f: 0, look: [0, 0], zoom: 1 }, { f: 60, lens: 1 }, { f: 120, lens: 4 }]);
ok(near(lc.at(90).lens!, 2) && near(lc.at(90).zoom, 1) && near(lc.at(0).lens!, 1), "lens keys ease in log2 like the dolly (midpoint of 1 -> 4 is 2) and hold before their first key");
ok(JSON.stringify(Object.keys(cam.at(45))) === JSON.stringify(["look", "zoom"]), "a camera that never sets a lens answers exactly as before (no lens field)");
- lc.shake({ from: 0, to: 30, amp: 10, seed: 3 });
+ lc.shake({ from: 80, to: 110, amp: 10, seed: 3 }); // inside the lens move, so the lens is not 1 where the shake is measured
let lensErr = 0, lensTrip = 0, shakePx = 0;
- for (const f of [5, 70, 100]) for (const z of [0, 1.5, -0.25]) {
+ for (const f of [5, 70, 85, 100]) for (const z of [0, 1.5, -0.25]) {
lc.begin(g, f, z); const [a, b, c, d, e, ff] = T; lc.end(g);
for (const q of [[0, 0], [300, -120]] as P[]) { const s = lc.toScreen(q, f, z), m = [a * q[0] + c * q[1] + e, b * q[0] + d * q[1] + ff]; lensErr = Math.max(lensErr, Math.hypot(s[0] - m[0], s[1] - m[1])); const w = lc.toWorld(s, f, z); lensTrip = Math.max(lensTrip, Math.hypot(w[0] - q[0], w[1] - q[1])); }
}
- { const sh = lc.shaken(5), cl = lc.at(5), [dx, dy] = lc.shakeAt(5); shakePx = Math.hypot((cl.look[0] - sh.look[0]) * heroScale(sh) - dx, (cl.look[1] - sh.look[1]) * heroScale(sh) - dy); }
+ { const sh = lc.shaken(85), cl = lc.at(85), [dx, dy] = lc.shakeAt(85); shakePx = Math.hypot((cl.look[0] - sh.look[0]) * heroScale(sh) - dx, (cl.look[1] - sh.look[1]) * heroScale(sh) - dy); }
ok(lensErr < 1e-6 && lensTrip < 1e-6, "with a lens, begin() and toScreen() still agree and toWorld inverts them");
- ok(shakePx < 1e-9 && lc.shaken(70).lens !== undefined, "shake stays in screen px under a lens, and the shaken camera keeps its lens");
+ ok(lc.at(85).lens! > 1.2 && Math.hypot(...lc.shakeAt(85).slice(0, 2) as [number, number]) > 0.5 && shakePx < 1e-9 && lc.shaken(70).lens !== undefined, "shake stays in screen px under a lens, and the shaken camera keeps its lens");
// 9. the dolly zoom: the hero plane holds its size while the depth stretches
const dolly = new Camera([540, 540], [{ f: 0, look: [0, 0], zoom: 1 }, { f: 60, zoom: 3 }]), vz = dollyZoom((f) => dolly.at(f));
@@ -104,6 +104,8 @@ export const run = (ok: (cond: boolean, label: string) => void) => {
ok(throws(() => new Camera([0, 0], [])), "rejects a camera with neither keys nor path");
ok(throws(() => cam.shake({ from: 10, to: 10, amp: 1, seed: 1 })), "rejects an empty shake window");
ok(throws(() => monoPath([[0, 1], [0, 2]])), "monoPath rejects non-increasing keys");
+ { const extra = new Camera([0, 0], [], { path: () => ({ look: [0, 0], zoom: 1, extra: 1 } as unknown as Cam) }); ok(JSON.stringify(Object.keys(extra.shaken(0))) === JSON.stringify(["look", "zoom", "rot"]), "shaken() returns only the camera's own fields"); }
+ ok(throws(() => new Camera([0, 0], [{ f: 0, zoom: Infinity }])), "rejects an endless zoom");
ok(throws(() => new Camera([0, 0], [{ f: 0, zoom: 1, lens: 0 }])) && throws(() => new Camera([0, 0], [{ f: 0, zoom: 1, lens: NaN }])) && throws(() => new Camera([0, 0], [{ f: 0, zoom: NaN }])), "rejects a lens <= 0, or a lens or zoom that is not a number");
ok(throws(() => dollyZoom((f) => dolly.at(f), { hold: 0 })) && throws(() => dollyZoom(() => ({ look: [0, 0], zoom: 0 }))), "dollyZoom refuses a size of 0 to hold, or a dolly at zoom 0");
};
diff --git a/plugins/anidoodle/skills/anidoodle/engine/test/timeRemap.test.ts b/plugins/anidoodle/skills/anidoodle/engine/test/timeRemap.test.ts
index 3c997ca..3293528 100644
--- a/plugins/anidoodle/skills/anidoodle/engine/test/timeRemap.test.ts
+++ b/plugins/anidoodle/skills/anidoodle/engine/test/timeRemap.test.ts
@@ -57,4 +57,8 @@ export const run = (ok: (cond: boolean, label: string) => void) => {
ok(throws(() => timeRemap([{ f: 30, speed: 1 }, { f: 30, speed: 2 }])) && throws(() => timeRemap([{ f: 3.5, speed: 1 }])) && throws(() => timeRemap([{ f: -1, speed: 1 }])), "keys on repeated, fractional or negative frames are refused");
ok(throws(() => timeRemap([{ f: 30, speed: 0.5, ramp: 20 }, { f: 40, speed: 1 }])) && throws(() => timeRemap([{ f: 30, speed: 0.5, ramp: -2 }])), "a ramp that runs past the next key, or a negative ramp, is refused");
ok(throws(() => timeRemap([{ f: 30, speed: 0.5, curve: "bounce" as "smooth" }])), "an unknown ramp curve is refused");
+ ok(throws(() => timeRemap([{ f: 30, speed: 1e-9 }])) && throws(() => timeRemap([{ f: 30, speed: 0.005 }])), "a speed so slow it looks frozen is refused: declare a freeze instead");
+ ok(timeRemap([{ f: 0, speed: 0, ramp: 10, keepsMoving: "dust" }, { f: 10, speed: 1 }]).freezes.length === 0, "a ramp that fills the gap to the next key lists no empty freeze");
+ { let msg = ""; try { timeRemap([{ f: 5, speed: 1 }, { f: 3, speed: 2 }]); } catch (e) { msg = String(e); } ok(msg.includes("must increase"), "keys out of order are reported as out of order"); }
+ ok(throws(() => t.at(Infinity)) && throws(() => t.at(NaN)) && throws(() => t.speedAt(NaN)), "a frame that is not a number is refused");
};
diff --git a/plugins/anidoodle/skills/anidoodle/engine/tools/deck.mjs b/plugins/anidoodle/skills/anidoodle/engine/tools/deck.mjs
index fcf3e89..6b750fa 100644
--- a/plugins/anidoodle/skills/anidoodle/engine/tools/deck.mjs
+++ b/plugins/anidoodle/skills/anidoodle/engine/tools/deck.mjs
@@ -43,27 +43,30 @@ export const deal = ({ kind, energy, seconds = 20, seed = 1, n, cat, avoid = []
// FIND. People ask for a move by the name they know ("a whip pan", "do the Vertigo thing"). Each card's
// aka, the deck's calls and its refused names hold those names; find routes the words to what anidoodle
// builds, or to the reason it will not and what it makes instead, so nothing is improvised from a word.
-const STOP = new Set(["a", "an", "the", "please", "do", "make", "me", "some", "use", "add", "like", "effect", "shot", "move", "thing"]);
+const STOP = new Set(["a", "an", "the", "please", "do", "make", "me", "some", "use", "add", "like", "effect", "shot", "move", "thing", "in", "out", "up", "to", "on", "of", "into", "at", "can", "you"]);
+const KIND_ORDER = { card: 0, call: 1, refused: 2 };
export const norm = (x) => ` ${String(x).normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, " ").trim()} `;
const entries = () => [
...DECK.moves.map((m) => ({ kind: "card", id: m.id, names: [m.id, ...(m.aka ?? [])], item: m })),
...(DECK.calls ?? []).map((c) => ({ kind: "call", id: c.id, names: [c.id, ...c.aka], item: c })),
...(DECK.refused ?? []).map((r) => ({ kind: "refused", id: r.name, names: [r.name, ...r.aka], item: r })),
];
-/** Every entry whose names match the words, best first: an exact name, a name inside the words, the words inside a name, then shared words. */
+/** Every entry whose names match the words, best first: an exact name, a name inside the words, the words inside a name, then shared
+ * words (scored on the share of both the asked words and the name's words, so a long name does not win on one common word).
+ * Ties go to the longer matched name, then card before engine call before refusal. Ids match exactly or inside the words only. */
export const find = (query) => {
const q = norm(query), words = q.trim().split(" ").filter((w) => w && !STOP.has(w)), out = [];
if (!q.trim()) return out;
for (const e of entries()) {
let best = 0, via = "";
- for (const n of e.names) {
- const a = norm(n), aw = a.trim().split(" ");
- const score = a === q ? 100 : q.includes(a) ? 50 + aw.length : a.includes(q) ? 30 : words.length ? (10 * words.filter((w) => aw.includes(w)).length) / words.length : 0;
- if (score > best) { best = score; via = n; }
+ for (const [i, n] of e.names.entries()) {
+ const a = norm(n), aw = a.trim().split(" ").filter((w) => !STOP.has(w)), hit = words.filter((w) => aw.includes(w)).length;
+ const score = a === q ? 100 : q.includes(a) ? 50 + aw.length : a.includes(q) ? 30 : i > 0 && words.length && aw.length ? 5 * (hit / words.length + hit / aw.length) : 0;
+ if (score > best || (score === best && score > 0 && n.length > via.length)) { best = score; via = n; }
}
if (best >= 5) out.push({ kind: e.kind, id: e.id, score: best, via, item: e.item });
}
- return out.sort((a, b) => b.score - a.score || a.id.localeCompare(b.id));
+ return out.sort((a, b) => b.score - a.score || b.via.length - a.via.length || KIND_ORDER[a.kind] - KIND_ORDER[b.kind] || a.id.localeCompare(b.id));
};
const showFound = (r) => r.kind === "card" ? `${card(r.item)}\n (matched "${r.via}")`
: r.kind === "call" ? ` ${r.id} [engine call · ${r.item.where}]\n ${r.item.call}\n ${r.item.use}\n (matched "${r.via}")`
@@ -91,12 +94,12 @@ const selfTest = () => {
say(!dup.length, `no name leads to two places${dup.length ? ` ${dup.slice(0, 4).join("; ")}` : ""}`); }
{ const grammar = readFileSync(join(ROOT, "references", "motion-grammar.md"), "utf8"), table = grammar.slice(grammar.indexOf("## Names we refuse")), missing = R.filter((r) => !table.includes(`| ${r.name} |`));
say(grammar.includes("## Names we refuse") && !missing.length, `motion-grammar.md's "Names we refuse" table holds every refused name${missing.length ? ` missing: ${missing.map((r) => r.name).join(", ")}` : ""}`); }
- { const named = R.flatMap((r) => r.instead.match(/\b(?:open|seam|cam|reveal|type|act|emph|close|time)-[a-z-]+[a-z]/g) ?? []), bad = named.filter((id) => !ids.includes(id));
+ { const named = R.flatMap((r) => r.instead.match(/\b(?:open|seam|cam|reveal|type|act|emph|close)-[a-z-]+[a-z]/g) ?? []), bad = named.filter((id) => !ids.includes(id));
say(named.length >= 6 && !bad.length, `every card a refused name points to exists (${named.length})${bad.length ? ` missing: ${bad.join(", ")}` : ""}`); }
const ROUTES = [["whip pan", "cam-whip-to-rest"], ["mask reveal", "reveal-from-behind"], ["Vertigo", "cam-vertigo-realisation"], ["a dolly zoom", "cam-vertigo-realisation"], ["the vertigo effect", "cam-vertigo-realisation"],
- ["speed ramp", "time-ramp-at-peak"], ["slow-mo", "time-ramp-at-peak"], ["freeze frame", "time-freeze-and-name"], ["J-cut", "seam-sound-leads"], ["l cut", "seam-sound-leads"], ["rack focus", "cam-rack-of-attention"],
- ["pop-in", "act-settle"], ["count-up", "reveal-count-during"], ["zoom in", "call-lens"], ["crash zoom", "call-lens"], ["dolly in", "cam-slow-push"], ["circle wipe", "call-iris"], ["smash cut", "call-flash-cut"],
- ["typewriter", "call-typewriter"], ["can you do a whip pan to the cat", "cam-whip-to-rest"], ["glitch", "glitch"], ["Lens Flare", "lens flare"], ["fade in", "fade-in"], ["crossfade", "cross dissolve"], ["confetti", "particle burst"], ["shine", "light sweep"]];
+ ["speed ramp", "emph-time-ramp"], ["slow-mo", "emph-time-ramp"], ["freeze frame", "type-freeze-and-name"], ["J-cut", "seam-sound-leads"], ["l cut", "seam-sound-leads"], ["rack focus", "cam-rack-of-attention"],
+ ["count-up", "reveal-count-during"], ["zoom in", "call-lens"], ["crash zoom", "call-lens"], ["dolly in", "cam-slow-push"], ["circle wipe", "call-iris"], ["smash cut", "seam-cut-on-beat"], ["flash cut", "call-flash-cut"],
+ ["typewriter", "call-typewriter"], ["can you do a whip pan to the cat", "cam-whip-to-rest"], ["glitch", "glitch"], ["Lens Flare", "lens flare"], ["fade in", "fade-in"], ["cross-fade", "cross dissolve"], ["dolly zoom in", "cam-vertigo-realisation"], ["slow zoom", "cam-slow-push"], ["masked reveal", "reveal-from-behind"], ["cut", "seam-cut-on-beat"], ["fade out", "fade-in"], ["fade to black", "fade-in"], ["pop-in", "fade-in"], ["time lapse", "reveal-drawn-on"], ["slow pan across the city", "cam-parallax-travel"], ["tilt up", "cam-parallax-travel"], ["fast motion", "call-time-remap"], ["rewind", "call-time-remap"], ["on twos", "call-on-twos"], ["bloom", "call-gentle-move"], ["jcut", "seam-sound-leads"], ["depth of field", "cam-rack-of-attention"], ["bokeh", "lens flare"], ["zoom out to reveal the city", "cam-pull-back-reveal"], ["confetti", "particle burst"], ["shine", "light sweep"]];
const wrong = ROUTES.filter(([q, id]) => find(q)[0]?.id !== id).map(([q, id]) => `"${q}" -> ${find(q)[0]?.id ?? "nothing"} (want ${id})`);
say(!wrong.length, `${ROUTES.length} everyday names resolve to the right card, call or refusal${wrong.length ? ` ${wrong.join("; ")}` : ""}`);
say(find("zzqx plorb").length === 0 && find(" ").length === 0, "a name nobody uses finds nothing, and says so");
@@ -143,7 +146,7 @@ if (isMain(import.meta.url)) {
const all = find(q), top = all[0], hits = all.filter((r) => r.score >= Math.max(5, (top?.score ?? 0) / 2)).slice(0, 5);
if (args.includes("--json")) console.log(JSON.stringify({ query: q, found: hits.map(({ kind, id, via, item }) => ({ kind, id, via, ...item })) }, null, 1));
else if (!hits.length) console.log(`FIND "${q}": no card, call or refused name goes by that. List the deck with deck.mjs list, or describe the move in plain words in the brief.`);
- else { console.log(`FIND "${q}" · ${hits.length} ${hits.length === 1 ? "match" : "matches"}, best first\n`); console.log(hits.map(showFound).join("\n\n")); console.log(`\nA card is a prompt, never an order: its numbers are the default unless the person named their own (workflows/start-here.md).`); }
+ else { console.log(`FIND "${q}" · ${hits.length} ${hits.length === 1 ? "match" : "matches"}, best first\n`); console.log(hits.map(showFound).join("\n\n")); if (hits.some((r) => r.kind === "card")) console.log(`\nA card is a prompt, never an order: its numbers are the default unless the person named their own (workflows/start-here.md).`); }
if (!hits.length) process.exit(1);
} else die("usage: deck.mjs deal|list|find|test (see the header of this file)");
}
diff --git a/plugins/anidoodle/skills/anidoodle/references/camera.md b/plugins/anidoodle/skills/anidoodle/references/camera.md
index 47aae14..0d997ee 100644
--- a/plugins/anidoodle/skills/anidoodle/references/camera.md
+++ b/plugins/anidoodle/skills/anidoodle/references/camera.md
@@ -50,8 +50,9 @@ Two different moves make the subject bigger, and directors name them apart:
- **A dolly** moves the camera: the `zoom` key, distance D = 1/zoom. Near planes grow faster than
far ones, so the depth changes as it goes. This is a push-in, a pull-back, a dolly in or out.
-- **A lens zoom** changes the focal length with the camera standing still: the `lens` key
- (default 1). It multiplies every plane by the same factor about the frame's centre, so nothing
+- **A lens zoom** changes the focal length with the camera standing still: the `lens` key (1
+ when no key sets it; once one does, frames before the first lens key hold that key's value, so
+ key `lens: 1` where the zoom starts, as below). It multiplies every plane by the same factor about the frame's centre, so nothing
shifts against anything else; the picture is magnified, flat. A crash zoom or punch-in is this.
It reads as an operator's or a documentary's move, more noticed than a dolly. Use it when that
is the voice; for travelling into a world, dolly.
@@ -59,7 +60,7 @@ Two different moves make the subject bigger, and directors name them apart:
every frame so the hero plane keeps its size, and the planes behind stretch away (dolly in) or
loom (dolly out). The subject holds still in a world that has just changed shape: the moment of
realisation (deck card `cam-vertigo-realisation`). It needs at least two planes behind the
- subject; with nothing behind it, it is only a zoom.
+ subject; with nothing behind it, nothing visibly happens.
```ts
import { Camera, dollyZoom, heroScale } from "./camera";
@@ -70,8 +71,8 @@ const vertigo = new Camera(c, [], { path: dollyZoom((f) => dolly.at(f)) }); // h
// dollyZoom(path, { hold: 1.5 }) holds a given scale; { at: 30 } holds the scale the path has at frame 30
```
-`heroScale(cam)` is the hero plane's screen scale (dolly times lens), and `weight(cam)` follows
-it, so a lens zoom thins the line just as a dolly does.
+`heroScale(cam)` is the hero plane's screen scale (dolly times lens), and the line-weight
+compensation `weight(cam)` follows it, for a lens zoom as for a dolly.
## Time: speed ramps, slow motion, freeze frames
@@ -92,18 +93,18 @@ name(g, f); // the writing, on the film's own frame
cues.push({ frame: t.filmFrameOf(LANDING), kind: "paper" }); // a sound on a remapped event
```
-- **A ramp eases the speed**, on a smoothstep, so it starts and ends with no kick; `ramp: 0` is a
- deliberate hard change. A slowed scene is asked for frames between its frames, so it must
+- **A ramp eases the speed**, on a smoothstep (or `curve: "linear"`), so it starts and ends with
+ no kick. `ramp` defaults to 0, a deliberate hard change of speed; give it frames to glide. A slowed scene is asked for frames between its frames, so it must
draw at fractional time (motion is a function of time, never of a frame counter).
- **Score and sound stay on real time.** The score never slows; effects are cued by film frame.
`filmFrameOf(sceneFrame)` gives the first film frame that shows a scene event, which is where
its sound goes.
- **A freeze must keep something moving.** A `speed: 0` key without `keepsMoving` (in words)
- throws: a frozen frame with nothing moving is dead air, and the gate fails it. Drive the thing
+ throws, and so does a speed under 0.01 (`MIN_SPEED`), which looks frozen without saying so: a frozen frame with nothing moving is dead air, and the gate fails it. Drive the thing
that moves (the name being written, the camera still creeping in) from the film's frame `f`.
`t.freezes` lists each stop with what keeps moving.
- **Once a film for each.** One slow motion at the peak, one freeze on the telling pose (deck
- cards `time-ramp-at-peak`, `time-freeze-and-name`). The second halves the first.
+ cards `emph-time-ramp`, `type-freeze-and-name`). The second halves the first.
## Shake
diff --git a/plugins/anidoodle/skills/anidoodle/references/motion-deck.json b/plugins/anidoodle/skills/anidoodle/references/motion-deck.json
index 67dce3d..52c40d9 100644
--- a/plugins/anidoodle/skills/anidoodle/references/motion-deck.json
+++ b/plugins/anidoodle/skills/anidoodle/references/motion-deck.json
@@ -47,9 +47,9 @@
"move": "A loaded brush is pulled across in the direction the story is already moving, wet ink running ahead of the new picture, 0.6 to 0.9 s.",
"build": "brushWipe(ctx, env, p, from, to, { angle, ink }) in transitions.ts.",
"not": "A clean, set register. Or more than twice." },
- { "id": "seam-cut-on-beat", "cat": "seam", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["cut on the beat", "match cut", "graphic match", "hard cut"],
+ { "id": "seam-cut-on-beat", "cat": "seam", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["cut on the beat", "match cut", "graphic match", "hard cut", "smash cut", "cut"],
"move": "A plain hard cut with both sides at rest, on a strong beat, between two frames that match in one thing: a shape, a position, a direction of gaze.",
- "build": "No call. Put the cut frame on the cue table's downbeat and check the pair as stills: one thing sits in the same place on both.",
+ "build": "No call (and not seam-matched-cut, which hides the cut in travel). Put the cut frame on the cue table's downbeat and check the pair as stills: one thing sits in the same place on both.",
"not": "Nothing matches, or the music has no beat there. Then use the gentle move." },
{ "id": "seam-one-canvas", "cat": "seam", "role": "workhorse", "energy": "calm", "kinds": ["explainer", "launch", "story", "interactive"], "aka": ["oner", "one take", "infinite canvas", "continuous shot"],
"move": "The scenes sit side by side in one layout larger than the frame and the camera travels between them; the route says how they relate.",
@@ -59,16 +59,16 @@
"move": "A thing leaves the way it came, mirrored in time and shorter: what arrived over 0.5 s on a settling curve leaves over 0.25 s on an accelerating one, along the same path.",
"build": "Run the entrance's own progress backwards through easeIn (seams.ts); if it was revealed from behind an edge it tucks back behind that edge where the edge is now.",
"not": "The exit is the point of the scene. Then it gets a move of its own." },
- { "id": "seam-sound-leads", "cat": "seam", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["J-cut", "L-cut", "sound bridge", "pre-lap", "audio lead", "split edit"],
+ { "id": "seam-sound-leads", "cat": "seam", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["J-cut", "L-cut", "jcut", "lcut", "sound bridge", "pre-lap", "audio lead", "split edit"],
"move": "The sound crosses the cut ahead of the picture or behind it: the next scene is heard 0.3 to 0.8 s before it is seen (a J-cut), or the last scene is still heard 0.5 to 1.5 s into the next (an L-cut). The ear makes the join before the eye does.",
"build": "Cue the incoming scene's first sound at CUT minus the lead in the SfxPlan (filmSfx cues are film frames), or let the outgoing scene's sound run past CUT with lengthS; the score can enter its next section a beat early (music/sound-design.md, Sound across a cut).",
"not": "A hit or a contact: its sound belongs on its own frame, and one that trails its picture reads as lag." },
- { "id": "cam-slow-push", "cat": "camera", "role": "workhorse", "energy": "calm", "kinds": ["any"], "aka": ["slow push", "push in", "dolly in", "creep in", "Ken Burns"],
+ { "id": "cam-slow-push", "cat": "camera", "role": "workhorse", "energy": "calm", "kinds": ["any"], "aka": ["slow push", "push in", "dolly in", "creep in", "Ken Burns", "slow zoom"],
"move": "A hold that is never still: the camera pushes in 3 to 6 percent over the whole shot, so a quiet shot still changes every second.",
"build": "Two Camera keys, zoom 1 to 1.04, ease \"linear\" for this one move only: an eased drift stops at both ends and the stop is the dead air.",
"not": "A shot with a lot of its own motion. Two moves at once fight." },
- { "id": "cam-parallax-travel", "cat": "camera", "role": "workhorse", "energy": "medium", "kinds": ["story", "loop", "explainer"], "aka": ["parallax", "truck shot", "lateral track", "multiplane", "parallax scroll"],
+ { "id": "cam-parallax-travel", "cat": "camera", "role": "workhorse", "energy": "medium", "kinds": ["story", "loop", "explainer"], "aka": ["parallax", "truck shot", "lateral track", "multiplane", "parallax scroll", "pan", "slow pan", "pan across", "tilt", "tilt up", "tilt down"],
"move": "The camera travels sideways and depth does the work: near things swing wide, far things barely stir, and something crosses the lens in front of the subject.",
"build": "One Camera, planes at z from -0.3 (across the glass) to 4 or more (camera.md, depth planes). Never a hand-set drift per layer.",
"not": "A flat style whose point is the flatness (a print, a diagram)." },
@@ -84,7 +84,7 @@
"move": "The camera pulls back and the thing we were looking at turns out to be a small part of something larger.",
"build": "A dolly out: Camera zoom keys (eased in log2), monoZoom: true, 1.5 to 3 s; the large thing is painted in the world from the start, never faded in at the end.",
"not": "The larger thing adds nothing to the story. Then it is only a pull-back." },
- { "id": "cam-rack-of-attention", "cat": "camera", "role": "accent", "energy": "calm", "kinds": ["story", "explainer", "launch"], "aka": ["rack focus", "focus pull", "pull focus", "shift focus"],
+ { "id": "cam-rack-of-attention", "cat": "camera", "role": "accent", "energy": "calm", "kinds": ["story", "explainer", "launch"], "aka": ["rack focus", "focus pull", "pull focus", "shift focus", "depth of field", "background blur"],
"move": "Attention moves from one thing to another in the same frame without the camera moving: the first dims and softens its edges, the second gains contrast and line weight.",
"build": "Draw both from one emphasis value 0..1: stroke weight, saturation and value contrast (no ctx.filter, the contract forbids it).",
"not": "The two things are in different places in the story. That is a seam." },
@@ -95,13 +95,13 @@
{ "id": "cam-vertigo-realisation", "cat": "camera", "role": "accent", "energy": "medium", "kinds": ["story", "explainer", "launch"], "aka": ["dolly zoom", "Vertigo", "vertigo effect", "zolly", "trombone shot", "Hitchcock zoom"],
"move": "The moment of realisation: the subject keeps its size in the frame while the world behind it stretches away (or closes in), over 1 to 2.5 s, slow enough to be felt before it is noticed.",
"build": "dollyZoom((f) => cam.at(f)) in camera.ts, used as a path camera, on a dolly of 1.6 to 3 times; the subject on the hero plane and at least two planes behind it at real depths (camera.md, Lens and dolly).",
- "not": "Fewer than two depth planes (with nothing behind the subject it is only a zoom), or a beat that is not a realisation. Once a film." },
+ "not": "Fewer than two depth planes (with nothing behind the subject nothing visibly happens), or a beat that is not a realisation. Once a film." },
- { "id": "reveal-drawn-on", "cat": "reveal", "role": "signature", "energy": "any", "kinds": ["any"], "aka": ["line draw", "draw on", "stroke reveal", "self-drawing", "path animation", "timelapse", "speed paint"],
+ { "id": "reveal-drawn-on", "cat": "reveal", "role": "signature", "energy": "any", "kinds": ["any"], "aka": ["line draw", "draw on", "stroke reveal", "self-drawing", "path animation", "timelapse", "time lapse", "speed paint"],
"move": "The thing is drawn into the picture in the order a hand would make it, the tool visible, each stroke taking the time its length asks for.",
"build": "kind: \"drawing\" and the style plate's own draw order (workflows/drawing-process.md).",
"not": "A fade standing in for drawing. If it cannot be drawn on, it arrives some other honest way." },
- { "id": "reveal-from-behind", "cat": "reveal", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["mask reveal", "masked rise", "reveal from below", "wipe reveal"],
+ { "id": "reveal-from-behind", "cat": "reveal", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["mask reveal", "masked reveal", "masked rise", "reveal from below", "wipe reveal"],
"move": "A thing comes out from behind something already in the picture (a hill, a card's edge, another figure), so the picture supplies the mask.",
"build": "Clip with the occluder's own outline (pathShape in morph.ts) and move the thing out from under it on a settling curve, 0.4 to 0.7 s.",
"not": "A mask in mid-air with nothing drawn where its edge is." },
@@ -118,7 +118,7 @@
"build": "Drive the digits and the action from the same progress value (productUI.ts counts values this way).",
"not": "A figure that is not true of the data on screen." },
- { "id": "type-written", "cat": "type", "role": "workhorse", "energy": "any", "kinds": ["launch", "explainer", "infographic"], "aka": ["write on", "handwriting", "handwritten text", "signature animation"],
+ { "id": "type-written", "cat": "type", "role": "workhorse", "energy": "any", "kinds": ["launch", "explainer", "infographic"], "aka": ["write on", "handwriting", "handwritten text", "signature animation", "lower third"],
"move": "A line is written by its tool, one stroke after another, at the speed of a hand, and holds long enough to be read twice.",
"build": "writeOn or sentence in kinetic.ts; on its own frame, or over a calm area where the frame would pass as a poster (workflows/launch-video.md, Type).",
"not": "Over a face, the focal detail or busy texture. In doubt the line gets its own frame." },
@@ -138,7 +138,7 @@
"move": "The one word that matters is underlined by hand after the line has landed, 0.25 s, on a beat. Underlined, never struck through.",
"build": "caption(..., \"underline\") in kinetic.ts, started when the line's progress reaches 1.",
"not": "More than one word a line, or more than twice a film." },
- { "id": "time-freeze-and-name", "cat": "type", "role": "accent", "energy": "medium", "kinds": ["story", "explainer", "launch"], "aka": ["freeze frame", "freeze and name", "character intro freeze", "freeze title"],
+ { "id": "type-freeze-and-name", "cat": "type", "role": "accent", "energy": "medium", "kinds": ["story", "explainer", "launch"], "aka": ["freeze frame", "freeze and name", "character intro freeze", "freeze title"],
"move": "The world stops on a telling pose and a name or a word is written by hand beside it; the camera keeps creeping in while it is written, then time picks up exactly where it stopped.",
"build": "A speed 0 key in timeRemap (timeRemap.ts) whose keepsMoving names the writing; writeOn in kinetic.ts and a slow push, both on the film's own frame; hold for as long as the word takes to write plus one beat to read it.",
"not": "Nothing is written or moving during the stop (dead air, and timeRemap refuses it), or a calm film where a hard stop is a jolt." },
@@ -151,7 +151,7 @@
"move": "Loose parts arrive late and go further: a tail, hair, a sleeve follow the body by 0.05 to 0.1 s a segment, each segment wider than the one before.",
"build": "Sample the driving angle at f - lag * i down the chain and scale its swing by 1 + 0.15 to 0.2 * i.",
"not": "A stiff material. Wood and metal do not whip." },
- { "id": "act-settle", "cat": "acting", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["overshoot", "settle", "pop-in", "spring settle", "back ease"],
+ { "id": "act-settle", "cat": "acting", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["overshoot", "settle", "spring settle", "back ease", "bounce", "squash and stretch"],
"move": "Nothing stops dead. A thing that lands goes a little past, comes back, and is at rest by 0.3 to 0.5 s; weight decides how far past.",
"build": "One overshoot of 4 to 8 percent then a decay on easeOut; heavier things overshoot less and take longer.",
"not": "Type meant to be read while it lands, and anything in a clean set register that should simply arrive." },
@@ -176,10 +176,10 @@
"move": "After the biggest change in the film the result is held, alive but unbroken, for 1 to 2 s before anything else happens.",
"build": "A hold in the cue table after the payoff with only breathing motion in it (cam-slow-push, act-blink-and-breathe).",
"not": "A loop under 6 s, where the hold would be most of it." },
- { "id": "time-ramp-at-peak", "cat": "emphasis", "role": "accent", "energy": "high", "kinds": ["story", "launch", "loop"], "aka": ["speed ramp", "slow motion", "slow-mo", "time ramp", "bullet time"],
+ { "id": "emph-time-ramp", "cat": "emphasis", "role": "accent", "energy": "high", "kinds": ["story", "launch"], "aka": ["speed ramp", "slow motion", "slow-mo", "slowmo", "time ramp", "bullet time"],
"move": "At the top of the action (the peak of a jump, the instant before contact) time slows and stays slow long enough to read the shape, then gathers back into real time. The score keeps its own tempo throughout.",
"build": "timeRemap in timeRemap.ts: ease down over 0.2 to 0.35 s to a speed of 0.2 to 0.4, hold 0.5 to 1.2 s, ease back over 0.3 to 0.6 s; draw the scene at t.at(f) (it must draw between its frames) and cue the contact sound at t.filmFrameOf(contact) (camera.md, Time).",
- "not": "Nothing is in flight, or a second time in one film: the second slow motion halves the first." },
+ "not": "Nothing is in flight, a loop (a remap changes how much scene time the film covers, so the loop stops closing), or a second time in one film: the second slow motion halves the first." },
{ "id": "close-returns-to-open", "cat": "close", "role": "signature", "energy": "any", "kinds": ["story", "loop", "launch"], "aka": ["bookend", "full circle", "callback ending", "loop back"],
"move": "The last frame is the first frame, earned: the film ends where it began and the viewer now knows what it means.",
@@ -197,7 +197,7 @@
"calls": [
{ "id": "call-iris", "where": "transitions.ts", "call": "iris(ctx, env, p, from, to, { center, shape })", "aka": ["iris", "iris out", "circle wipe", "circle transition", "mask transition"],
"use": "A round opening from a point or closing to one; open it from what the next scene is about (motion-grammar.md, Three ready-made seams)." },
- { "id": "call-flash-cut", "where": "transitions.ts", "call": "flashCut(ctx, env, local, cut, from, to)", "aka": ["smash cut", "flash cut", "flash transition", "white flash"],
+ { "id": "call-flash-cut", "where": "transitions.ts", "call": "flashCut(ctx, env, local, cut, from, to)", "aka": ["flash cut", "flash transition", "white flash"],
"use": "A hard cut under a short burst of light, on a strong beat; declare the film's flashes to checkFlashes." },
{ "id": "call-lens", "where": "camera.ts", "call": "Camera keys with lens (a true lens zoom), or dollyZoom", "aka": ["zoom in", "zoom out", "lens zoom", "crash zoom", "punch in", "snap zoom"],
"use": "A lens zoom magnifies every plane by one factor and changes no parallax; to move closer through the world, key the dolly (zoom) instead (camera.md, Lens and dolly)." },
@@ -206,26 +206,32 @@
{ "id": "call-motion-blur", "where": "render.mjs", "call": "node tools/render.mjs <film> --blur auto", "aka": ["motion blur", "motion trail", "shutter blur"],
"use": "Subframes per frame from each frame's measured speed, averaged in linear light; the film's own code is untouched." },
{ "id": "call-typewriter", "where": "launchKit.ts", "call": "typedAt(text, f, times) and caretAt", "aka": ["typewriter", "typing effect", "type on", "typing text"],
- "use": "Characters appear on a typing cadence with a caret, one tick sound per character (music/sound-design.md)." }
+ "use": "Characters appear on a typing cadence with a caret, one tick sound per character (music/sound-design.md)." },
+ { "id": "call-time-remap", "where": "timeRemap.ts", "call": "timeRemap([{ f, speed, ramp }]) with speed above 1, or your own falling time", "aka": ["fast motion", "speed up", "sped up", "undercrank", "rewind", "reverse time"],
+ "use": "Speed above 1 runs the scene fast; timeRemap never runs time backwards, so for a rewind draw the scene at a falling time yourself, scene(g, t0 - (f - f0)), which the contract allows (camera.md, Time)." },
+ { "id": "call-on-twos", "where": "film.ts", "call": "onTwos: true in the film's meta", "aka": ["on twos", "stop motion", "stop-motion look", "choppy animation"],
+ "use": "Each drawing is held for two frames, the rhythm of paper and stop-motion; motion blur leaves it alone (formats.md)." },
+ { "id": "call-gentle-move", "where": "launch-video.md", "call": "the gentle move: a bloom, a card flip, a push, the card growing into the scene", "aka": ["bloom", "flip", "card flip", "gentle transition", "default transition"],
+ "use": "The standard seam when no designed one clearly fits (motion-grammar.md, the default does not change)." }
],
"refused": [
{ "name": "glitch", "aka": ["glitch", "datamosh", "RGB split", "chromatic aberration"],
- "why": "Colour split and torn pixels need ctx.filter or pixel tricks the contract forbids, and they read as a template effect.",
+ "why": "Colour split and torn pixels are a template overlay with no cause in the picture; they read as stock, not as a made mark.",
"instead": "a cut on the beat (seam-cut-on-beat), or one shake on a real impact (cam-impact-shake)" },
{ "name": "light sweep", "aka": ["light sweep", "shine", "sheen", "glare sweep"],
"why": "A shine sliding across chrome is a stock overlay; nothing in the picture casts it.",
"instead": "reveal-by-light: the light belongs to the world and finds the subject" },
- { "name": "fade-in", "aka": ["fade in", "fade up", "fade in on scroll", "opacity fade"],
- "why": "Marks are made, not faded: a fade standing in for drawing is the first tell on the craft bar.",
+ { "name": "fade-in", "aka": ["fade in", "fade up", "fade in on scroll", "opacity fade", "fade out", "fade to black", "fade to white", "fade", "pop-in", "scale in"],
+ "why": "Marks are made, not faded or scaled up from nothing: a fade standing in for drawing is a tell on the craft bar.",
"instead": "reveal-drawn-on, reveal-from-behind or type-written" },
{ "name": "particle burst", "aka": ["particle burst", "particles", "confetti", "sparkle burst"],
"why": "A burst on everything is decoration with no force behind it, so it is never a default.",
"instead": "emph-contact: dust or a splash born on a real contact, from the contact point" },
- { "name": "cross dissolve", "aka": ["cross dissolve", "crossfade", "dissolve"],
- "why": "Two copies of one thing, each half there, read as a ghost.",
+ { "name": "cross dissolve", "aka": ["cross dissolve", "cross fade", "dissolve"],
+ "why": "Two copies of one thing, each half there, read as a ghost; between unrelated pictures a dissolve is a slideshow join. A poster-frame dissolve and a reduced-motion fallback are the exceptions (formats.md, interactive.md).",
"instead": "seam-shape-becomes or seam-actor-carries (move one object, change what it is mid-trip); between unrelated scenes, the gentle move" },
{ "name": "lens flare", "aka": ["lens flare", "light leak", "bokeh", "anamorphic flare"],
- "why": "Lens faults painted onto a drawing read as stock overlays, not as light.",
+ "why": "Lens artefacts (flare, light leaks, bokeh discs) painted onto a drawing read as stock overlays, not as light.",
"instead": "one named light in the scene (realism-and-craft.md), or reveal-by-light" }
]
}
diff --git a/plugins/anidoodle/skills/anidoodle/references/motion-grammar.md b/plugins/anidoodle/skills/anidoodle/references/motion-grammar.md
index 815009a..d252743 100644
--- a/plugins/anidoodle/skills/anidoodle/references/motion-grammar.md
+++ b/plugins/anidoodle/skills/anidoodle/references/motion-grammar.md
@@ -145,8 +145,8 @@ roughest. The difference is arithmetic, and `engine/src/canvas-core/seams.ts` do
The incoming shot owns the cut frame: the outgoing shot's last frame on screen is the one
before it, and that is its fastest.
- **Through the cut, in depth.** `matchedZoom({ push, exitF, entryF })` does the same for a
- camera that flies into one shot and out in the next. A zoom is a ratio, so both sides run in
- log space and grow at the same rate per frame across the cut. With the default push the
+ camera that flies into one shot and out in the next: a dolly push through the cut. A push is a
+ ratio, so both sides run in log space and grow at the same rate per frame across the cut. With the default push the
incoming shot opens at about two thirds of its size, so its scene must be painted that much
wider than the frame; a zoom that would open it under 0.4 is refused.
- **There is a top speed.** Past about two and a half frame widths a second
@@ -194,12 +194,12 @@ offer the alternative; `deck.mjs find` prints the same reason.
| Name | Why not | Make instead |
|---|---|---|
-| glitch | colour split and torn pixels need `ctx.filter` or pixel tricks the contract forbids | a cut on the beat, or one shake on a real impact |
+| glitch | colour split and torn pixels are a template overlay with no cause in the picture | a cut on the beat, or one shake on a real impact |
| light sweep | a shine sliding over chrome that nothing in the picture casts | `reveal-by-light`: the light belongs to the world |
-| fade-in | marks are made, not faded; the first tell on the craft bar | drawn on, revealed from behind, or written |
+| fade-in | marks are made, not faded or scaled up from nothing; a tell on the craft bar | drawn on, revealed from behind, or written |
| particle burst | decoration with no force behind it, never a default | `emph-contact`: dust or splash born on a real contact |
-| cross dissolve | two copies of one thing, each half there, read as a ghost | one object moving and changing mid-trip; the gentle move |
-| lens flare | lens faults painted onto a drawing read as stock overlays | one named light in the scene, or `reveal-by-light` |
+| cross dissolve | two copies of one thing read as a ghost; unrelated pictures, a slideshow join (a poster frame or a reduced-motion fallback may still dissolve) | one object moving and changing mid-trip; the gentle move |
+| lens flare | lens artefacts (flare, leaks, bokeh discs) painted onto a drawing read as stock overlays | one named light in the scene, or `reveal-by-light` |
## Callouts and the label handoff
diff --git a/plugins/anidoodle/skills/anidoodle/references/music/sound-design.md b/plugins/anidoodle/skills/anidoodle/references/music/sound-design.md
index a8c9915..d2955c0 100644
--- a/plugins/anidoodle/skills/anidoodle/references/music/sound-design.md
+++ b/plugins/anidoodle/skills/anidoodle/references/music/sound-design.md
@@ -92,14 +92,15 @@ export const audio = filmSfx(filmAudio(score, 15), plan); // Film.audio: score
The cheapest smooth seam works on the ear: the sound crosses the cut ahead of the picture or
behind it. In a **J-cut** the next scene is heard before it is seen, 0.3 to 0.8 s early (the
pond's bubbles under the last shot of the room, the nib scratching before the page appears). In an
-**L-cut** the last scene is still heard 0.5 to 1.5 s into the next (a page still rustling, a pile
-of bricks still settling). The ear makes the join first, so the picture cut lands as an answer. It
-uses the same cue table: cue the incoming scene's sound at `CUT - lead` (`{ frame: CUT - 15, kind:
-"bubble" }`), or let the outgoing one run past the cut with a longer `lengthS` or its own
-tail. The score can do it too, entering its next section a beat before the cut
-(a pre-lap), or letting the old chord ring over the first beat of the new scene. This never moves
-a hit: a contact's sound stays on its own frame (Land on the frame, below). What crosses the cut
-is a place's sound, never an event's. Deck card `seam-sound-leads`.
+**L-cut** the last scene is still heard 0.5 to 1.5 s into the next (a page still rustling, a pen
+still scratching). The ear makes the join first, so the picture cut lands as an answer. It uses
+the same cue table: cue the incoming scene's sound at `CUT - lead` (`{ frame: CUT - 15, kind:
+"bubble" }`). To carry the outgoing sound past the cut, give it a longer `lengthS` where the kind
+takes one (scratch, paper, whoosh, swish, riser, thread); for the others, place a few quieter cues
+of that scene's sound after the cut. The score can do it too, entering its next section a beat
+before the cut (a pre-lap), or letting the old chord ring over the first beat of the new scene.
+This never moves a hit: a contact's sound stays on its own frame (Land on the frame, below). What
+crosses the cut is a scene's ongoing sound, never a hit's. Deck card `seam-sound-leads`.
## Levels and the audibility rule
@@ -138,8 +139,9 @@ nothing: test that it is heard over the music at its own moment.
press, an arrival, a landing, the reveal. Picture changes that are only edits stay silent. Count
your cues against the film's length; if you cannot say what each one marks, cut it.
- **Land on the frame.** A hit belongs on the frame where the thing happens; within a frame either
- side reads as one event. A soft lead into the hit reads as anticipation. A sound after its picture
- reads as lag, which is the one error a viewer always notices.
+ side reads as one event. A soft lead into the hit reads as anticipation. A hit's sound after its
+ picture reads as lag, which is the one error a viewer always notices. (A place's sound may run
+ past a cut: Sound across a cut, above.)
- **One voice per job.** Every press of every button is the same click, at the same level, so the UI
feels like one object. Variety goes to the story moments, not to repeats of the same action.
- **The ending breathes.** The music settles on the tonic or lets its last chord ring, a beat of
diff --git a/plugins/anidoodle/skills/anidoodle/references/workflows/start-here.md b/plugins/anidoodle/skills/anidoodle/references/workflows/start-here.md
index fc951f4..b846746 100644
--- a/plugins/anidoodle/skills/anidoodle/references/workflows/start-here.md
+++ b/plugins/anidoodle/skills/anidoodle/references/workflows/start-here.md
@@ -43,7 +43,9 @@ an overshoot) and **what moves** (which element, camera or layer). Fill only wha
every part they left open, the card's own numbers are the default, written down and marked as
defaults: "whip pan (cam-whip-to-rest) · 0.4 to 0.7 s, card default · peak under the speed
ceiling, card default · the camera, onto the cat, theirs". A vague ask becomes a spec someone can
-check against the render.
+check against the render. When `find` returns an engine call, there are no card numbers: record
+the four parts with your own numbers, marked as yours. When it returns a refusal, tell the person
+the reason in one line, record the alternative you will build, and let them veto it.
## Defaults when they do not say
diff --git a/skills/anidoodle/SKILL.md b/skills/anidoodle/SKILL.md
index f893180..76f893f 100644
--- a/skills/anidoodle/SKILL.md
+++ b/skills/anidoodle/SKILL.md
@@ -102,7 +102,7 @@ draws itself declares `kind: "drawing"` and is judged on a finer floor; a freeze
`engine/` is the portable art core plus the tooling. `engine/src/canvas-core` knows nothing
about the DOM or any backend. `W`, `H`, `fps` and `durationFrames` come from the film's `meta`.
-Camera moves (pans, dollies, lens and dolly zooms, parallax, shake) and slow motion or freeze frames (`timeRemap.ts`): `engine/src/canvas-core/camera.ts`, `references/camera.md`.
+Camera moves (pans, dollies, lens and dolly zooms, parallax, shake) and slow motion or freeze frames: `engine/src/canvas-core/camera.ts`, `engine/src/canvas-core/timeRemap.ts`, `references/camera.md`.
Seams between scenes: `references/motion-grammar.md` (cuts that carry motion: `seams.ts`; `tools/deck.mjs deal` deals each film different moves; `deck.mjs find "<name>"` turns a move's everyday name into its card). `render.mjs --blur auto` renders with motion blur (subframes per frame
from its measured on-screen speed, averaged in linear light, `--shutter 180`); the default path is untouched.
diff --git a/skills/anidoodle/engine/src/canvas-core/calloutDemo.ts b/skills/anidoodle/engine/src/canvas-core/calloutDemo.ts
index 5a12887..446a708 100644
--- a/skills/anidoodle/engine/src/canvas-core/calloutDemo.ts
+++ b/skills/anidoodle/engine/src/canvas-core/calloutDemo.ts
@@ -9,7 +9,7 @@
// a second callout names the full moon from the calm ground under the card, then leaves.
import type { Ctx, Env, P } from "./core";
import type { Film } from "./film";
-import { Camera } from "./camera";
+import { Camera, heroScale } from "./camera";
import { out3, plateLayer, ramp, rr } from "./launchKit";
import { calloutPose, checkHandoff, drawCallout, drawLabel, type Callout, type LabelPose } from "./callout";
import { iris, seam } from "./transitions";
@@ -27,7 +27,7 @@ const CARD = { x: 60, y: 300, w: 960, h: 545, sx: 20, sy: 170, sw: 1040, sh: 590
const full: Callout = { text: "FULL, DAY 15", anchor: () => [CARD.x + ((540 - CARD.sx) / CARD.sw) * CARD.w, CARD.y + ((372 - CARD.sy) / CARD.sh) * CARD.h], label: { p: [610, 960], size: 38 }, t0: 178, out: 250, color: CREAM, accent: GOLD };
const scene1 = (env: Env, f: number) => (c: Ctx) => {
- const L = plateLayer(env, "calloutdemo:fox", fox, 0, Math.round(W * env.scale * 1.3), true).canvas, o = cam.toScreen([0, 0], f), k = cam.at(f).zoom;
+ const L = plateLayer(env, "calloutdemo:fox", fox, 0, Math.round(W * env.scale * 1.3), true).canvas, o = cam.toScreen([0, 0], f), k = heroScale(cam.at(f));
c.setTransform(env.scale, 0, 0, env.scale, 0, 0); c.globalAlpha = 1; c.drawImage(L, o[0], o[1], W * k, H * k);
};
const scene2 = (env: Env, f: number) => (c: Ctx) => {
diff --git a/skills/anidoodle/engine/src/canvas-core/camera.ts b/skills/anidoodle/engine/src/canvas-core/camera.ts
index 97d2f29..4a05555 100644
--- a/skills/anidoodle/engine/src/canvas-core/camera.ts
+++ b/skills/anidoodle/engine/src/canvas-core/camera.ts
@@ -30,7 +30,8 @@
import { fractal, Gfx, P } from "./core";
// look: world point at the frame's centre; zoom: the dolly, screen px per world unit on the hero plane
-// at lens 1; lens: the focal length as a factor (default 1), scaling every plane equally
+// at lens 1; lens: the focal length as a factor, scaling every plane equally (1 when no key sets it;
+// once one does, frames before the first lens key hold that key's value, so key lens: 1 where it starts)
export type Cam = { look: P; zoom: number; lens?: number };
export type EaseName = "linear" | "in" | "out" | "inout";
export const EASE: Record<EaseName, (u: number) => number> = {
@@ -93,7 +94,7 @@ export const strokeWeight = (c: Cam, exp = 0.35): number => Math.pow(heroScale(c
export const dollyZoom = (path: (f: number) => Cam, opts: { hold?: number; at?: number } = {}): ((f: number) => Cam) => {
const hold = opts.hold ?? heroScale(path(opts.at ?? 0)); // the path's own lens counts here; after this the lens is solved
if (!(hold > 0) || !Number.isFinite(hold)) throw new Error(`dollyZoom: the scale to hold must be a positive number (got ${hold})`);
- return (f) => { const c = path(f); if (!(c.zoom > 0)) throw new Error(`dollyZoom: zoom must be positive (got ${c.zoom} at frame ${f})`); return { look: c.look, zoom: c.zoom, lens: hold / c.zoom }; };
+ return (f) => { const c = path(f); if (!(c.zoom > 0 && Number.isFinite(c.zoom))) throw new Error(`dollyZoom: zoom must be positive (got ${c.zoom} at frame ${f})`); return { look: c.look, zoom: c.zoom, lens: hold / c.zoom }; };
};
export class Camera {
@@ -112,14 +113,14 @@ export class Camera {
for (const k of this.keys) {
if (!Number.isInteger(k.f) || k.f < 0) throw new Error(`camera key at non-integral or negative frame ${k.f}`);
if (k.f <= last) throw new Error(`camera keys must increase: ${last} then ${k.f}`);
- if (k.zoom !== undefined && !(k.zoom > 0)) throw new Error(`camera zoom must be positive, got ${k.zoom} at frame ${k.f}`);
+ if (k.zoom !== undefined && !(k.zoom > 0 && Number.isFinite(k.zoom))) throw new Error(`camera zoom must be positive, got ${k.zoom} at frame ${k.f}`);
if (k.lens !== undefined && !(k.lens > 0 && Number.isFinite(k.lens))) throw new Error(`camera lens must be a positive number, got ${k.lens} at frame ${k.f}`);
last = k.f;
}
}
// one channel of the keys, eased per segment. Missing values hold the nearest given one, so a
- // key may set only look or only zoom.
+ // key may set only look, only zoom or only lens.
private channel(f: number, get: (k: CamKey) => number | undefined, log2: boolean, mono = log2): number {
const ks = this.keys.map((k, i) => ({ k, v: get(k), i })).filter((e) => e.v !== undefined) as { k: CamKey; v: number; i: number }[];
if (!ks.length) throw new Error("camera keys never set this channel");
@@ -167,7 +168,9 @@ export class Camera {
// [dx, dy] is the camera's look point stepping BACK by that much, in world units.
shaken(f: number): Cam & { rot: number } {
const c = this.at(f), [dx, dy, dr] = this.shakeAt(f), k = heroScale(c);
- return { ...c, look: [c.look[0] - dx / k, c.look[1] - dy / k], rot: dr };
+ const out: Cam & { rot: number } = { look: [c.look[0] - dx / k, c.look[1] - dy / k], zoom: c.zoom, rot: dr };
+ if (c.lens !== undefined) out.lens = c.lens;
+ return out;
}
// plane scale at depth z for a camera state: the hero plane (z = 0) scales by zoom x lens exactly.
diff --git a/skills/anidoodle/engine/src/canvas-core/timeRemap.ts b/skills/anidoodle/engine/src/canvas-core/timeRemap.ts
index 1bfcf99..54e8d8c 100644
--- a/skills/anidoodle/engine/src/canvas-core/timeRemap.ts
+++ b/skills/anidoodle/engine/src/canvas-core/timeRemap.ts
@@ -28,7 +28,7 @@
export type TimeKey = {
f: number; // the film frame this speed starts from (whole, increasing)
- speed: number; // scene frames per film frame from here on: 1 real time, 0.25 slow motion, 0 a freeze, 2 fast
+ speed: number; // scene frames per film frame from here on: 1 real time, 0.25 slow motion, 0 a freeze, 2 fast (0 or at least MIN_SPEED)
ramp?: number; // frames over which the speed glides from the old value to this one (default 0, a hard change)
curve?: "smooth" | "linear"; // the glide's shape: smoothstep (default; no kick at either end) or a straight line
keepsMoving?: string; // required when speed is 0: what still moves, on the film's frame, through the freeze
@@ -51,15 +51,23 @@ const CURVES = {
linear: { e: (u: number) => u, area: (u: number) => (u * u) / 2 },
} as const;
+/** The slowest a scene may run without being a freeze. Below it the world looks stopped, so it must be a declared freeze. */
+export const MIN_SPEED = 0.01;
+
type Seg = { f: number; from: number; to: number; ramp: number; curve: (typeof CURVES)["smooth"]; t0: number };
export const timeRemap = (keys: readonly TimeKey[]): TimeRemap => {
let last = -1, prevSpeed = 1;
const segs: Seg[] = [], freezes: Freeze[] = [];
+ // the frames first, all of them, so a later check never reports a symptom of keys out of order
for (const [i, k] of keys.entries()) {
if (!Number.isInteger(k.f) || k.f < 0) throw new Error(`timeRemap: key ${i} is at frame ${k.f}; keys sit on whole film frames from 0`);
if (k.f <= last) throw new Error(`timeRemap: keys must increase (${last} then ${k.f})`);
+ last = k.f;
+ }
+ for (const [i, k] of keys.entries()) {
if (!Number.isFinite(k.speed) || k.speed < 0) throw new Error(`timeRemap: speed at frame ${k.f} must be a number of 0 or more (got ${k.speed}); time never runs backwards`);
+ if (k.speed > 0 && k.speed < MIN_SPEED) throw new Error(`timeRemap: speed ${k.speed} at frame ${k.f} looks frozen; use speed 0 with keepsMoving, or at least ${MIN_SPEED}`);
const ramp = k.ramp ?? 0, curve = k.curve ?? "smooth", next = keys[i + 1]?.f;
if (!Number.isFinite(ramp) || ramp < 0) throw new Error(`timeRemap: ramp at frame ${k.f} must be 0 or more frames (got ${ramp})`);
if (!(curve in CURVES)) throw new Error(`timeRemap: curve at frame ${k.f} is "smooth" or "linear" (got ${curve})`);
@@ -68,12 +76,13 @@ export const timeRemap = (keys: readonly TimeKey[]): TimeRemap => {
// scene time at this key: the previous segment's area up to here
const t = segs.length ? sceneAt(segs[segs.length - 1], k.f) : k.f;
segs.push({ f: k.f, from: prevSpeed, to: k.speed, ramp, curve: CURVES[curve], t0: t });
- if (k.speed === 0) freezes.push({ from: k.f + ramp, to: next ?? Infinity, keepsMoving: k.keepsMoving!.trim() });
- prevSpeed = k.speed; last = k.f;
+ if (k.speed === 0 && (next ?? Infinity) > k.f + ramp) freezes.push({ from: k.f + ramp, to: next ?? Infinity, keepsMoving: k.keepsMoving!.trim() });
+ prevSpeed = k.speed;
}
const segAt = (f: number): Seg | undefined => { let s: Seg | undefined; for (const x of segs) { if (x.f <= f) s = x; else break; } return s; };
- const at = (f: number): number => { const s = segAt(f); return s ? sceneAt(s, f) : f; };
+ const at = (f: number): number => { if (!Number.isFinite(f)) throw new Error(`timeRemap: frame must be a number (got ${f})`); const s = segAt(f); return s ? sceneAt(s, f) : f; };
const speedAt = (f: number): number => {
+ if (!Number.isFinite(f)) throw new Error(`timeRemap: frame must be a number (got ${f})`);
const s = segAt(f); if (!s) return 1;
const x = f - s.f; return s.ramp > 0 && x < s.ramp ? s.from + (s.to - s.from) * s.curve.e(x / s.ramp) : s.to;
};
@@ -87,6 +96,7 @@ export const timeRemap = (keys: readonly TimeKey[]): TimeRemap => {
if (tail && tail.to === 0) throw new Error(`filmFrameOf: scene frame ${target} is never shown; the film stays frozen at scene frame ${at(hi).toFixed(2)}`);
const rate = tail ? tail.to : 1; hi += Math.ceil((target - at(hi)) / rate) + 1;
while (!reached(hi)) hi += Math.ceil(1 / rate) + 1; // guards rounding only
+ if (!Number.isSafeInteger(hi)) throw new Error(`filmFrameOf: scene frame ${target} is past any film frame`);
}
while (hi - lo > 1) { const mid = Math.floor((lo + hi) / 2); if (reached(mid)) hi = mid; else lo = mid; }
return hi;
diff --git a/skills/anidoodle/engine/test/camera.test.ts b/skills/anidoodle/engine/test/camera.test.ts
index c56cbd3..8fe8a50 100644
--- a/skills/anidoodle/engine/test/camera.test.ts
+++ b/skills/anidoodle/engine/test/camera.test.ts
@@ -76,15 +76,15 @@ export const run = (ok: (cond: boolean, label: string) => void) => {
const lc = new Camera([540, 540], [{ f: 0, look: [0, 0], zoom: 1 }, { f: 60, lens: 1 }, { f: 120, lens: 4 }]);
ok(near(lc.at(90).lens!, 2) && near(lc.at(90).zoom, 1) && near(lc.at(0).lens!, 1), "lens keys ease in log2 like the dolly (midpoint of 1 -> 4 is 2) and hold before their first key");
ok(JSON.stringify(Object.keys(cam.at(45))) === JSON.stringify(["look", "zoom"]), "a camera that never sets a lens answers exactly as before (no lens field)");
- lc.shake({ from: 0, to: 30, amp: 10, seed: 3 });
+ lc.shake({ from: 80, to: 110, amp: 10, seed: 3 }); // inside the lens move, so the lens is not 1 where the shake is measured
let lensErr = 0, lensTrip = 0, shakePx = 0;
- for (const f of [5, 70, 100]) for (const z of [0, 1.5, -0.25]) {
+ for (const f of [5, 70, 85, 100]) for (const z of [0, 1.5, -0.25]) {
lc.begin(g, f, z); const [a, b, c, d, e, ff] = T; lc.end(g);
for (const q of [[0, 0], [300, -120]] as P[]) { const s = lc.toScreen(q, f, z), m = [a * q[0] + c * q[1] + e, b * q[0] + d * q[1] + ff]; lensErr = Math.max(lensErr, Math.hypot(s[0] - m[0], s[1] - m[1])); const w = lc.toWorld(s, f, z); lensTrip = Math.max(lensTrip, Math.hypot(w[0] - q[0], w[1] - q[1])); }
}
- { const sh = lc.shaken(5), cl = lc.at(5), [dx, dy] = lc.shakeAt(5); shakePx = Math.hypot((cl.look[0] - sh.look[0]) * heroScale(sh) - dx, (cl.look[1] - sh.look[1]) * heroScale(sh) - dy); }
+ { const sh = lc.shaken(85), cl = lc.at(85), [dx, dy] = lc.shakeAt(85); shakePx = Math.hypot((cl.look[0] - sh.look[0]) * heroScale(sh) - dx, (cl.look[1] - sh.look[1]) * heroScale(sh) - dy); }
ok(lensErr < 1e-6 && lensTrip < 1e-6, "with a lens, begin() and toScreen() still agree and toWorld inverts them");
- ok(shakePx < 1e-9 && lc.shaken(70).lens !== undefined, "shake stays in screen px under a lens, and the shaken camera keeps its lens");
+ ok(lc.at(85).lens! > 1.2 && Math.hypot(...lc.shakeAt(85).slice(0, 2) as [number, number]) > 0.5 && shakePx < 1e-9 && lc.shaken(70).lens !== undefined, "shake stays in screen px under a lens, and the shaken camera keeps its lens");
// 9. the dolly zoom: the hero plane holds its size while the depth stretches
const dolly = new Camera([540, 540], [{ f: 0, look: [0, 0], zoom: 1 }, { f: 60, zoom: 3 }]), vz = dollyZoom((f) => dolly.at(f));
@@ -104,6 +104,8 @@ export const run = (ok: (cond: boolean, label: string) => void) => {
ok(throws(() => new Camera([0, 0], [])), "rejects a camera with neither keys nor path");
ok(throws(() => cam.shake({ from: 10, to: 10, amp: 1, seed: 1 })), "rejects an empty shake window");
ok(throws(() => monoPath([[0, 1], [0, 2]])), "monoPath rejects non-increasing keys");
+ { const extra = new Camera([0, 0], [], { path: () => ({ look: [0, 0], zoom: 1, extra: 1 } as unknown as Cam) }); ok(JSON.stringify(Object.keys(extra.shaken(0))) === JSON.stringify(["look", "zoom", "rot"]), "shaken() returns only the camera's own fields"); }
+ ok(throws(() => new Camera([0, 0], [{ f: 0, zoom: Infinity }])), "rejects an endless zoom");
ok(throws(() => new Camera([0, 0], [{ f: 0, zoom: 1, lens: 0 }])) && throws(() => new Camera([0, 0], [{ f: 0, zoom: 1, lens: NaN }])) && throws(() => new Camera([0, 0], [{ f: 0, zoom: NaN }])), "rejects a lens <= 0, or a lens or zoom that is not a number");
ok(throws(() => dollyZoom((f) => dolly.at(f), { hold: 0 })) && throws(() => dollyZoom(() => ({ look: [0, 0], zoom: 0 }))), "dollyZoom refuses a size of 0 to hold, or a dolly at zoom 0");
};
diff --git a/skills/anidoodle/engine/test/timeRemap.test.ts b/skills/anidoodle/engine/test/timeRemap.test.ts
index 3c997ca..3293528 100644
--- a/skills/anidoodle/engine/test/timeRemap.test.ts
+++ b/skills/anidoodle/engine/test/timeRemap.test.ts
@@ -57,4 +57,8 @@ export const run = (ok: (cond: boolean, label: string) => void) => {
ok(throws(() => timeRemap([{ f: 30, speed: 1 }, { f: 30, speed: 2 }])) && throws(() => timeRemap([{ f: 3.5, speed: 1 }])) && throws(() => timeRemap([{ f: -1, speed: 1 }])), "keys on repeated, fractional or negative frames are refused");
ok(throws(() => timeRemap([{ f: 30, speed: 0.5, ramp: 20 }, { f: 40, speed: 1 }])) && throws(() => timeRemap([{ f: 30, speed: 0.5, ramp: -2 }])), "a ramp that runs past the next key, or a negative ramp, is refused");
ok(throws(() => timeRemap([{ f: 30, speed: 0.5, curve: "bounce" as "smooth" }])), "an unknown ramp curve is refused");
+ ok(throws(() => timeRemap([{ f: 30, speed: 1e-9 }])) && throws(() => timeRemap([{ f: 30, speed: 0.005 }])), "a speed so slow it looks frozen is refused: declare a freeze instead");
+ ok(timeRemap([{ f: 0, speed: 0, ramp: 10, keepsMoving: "dust" }, { f: 10, speed: 1 }]).freezes.length === 0, "a ramp that fills the gap to the next key lists no empty freeze");
+ { let msg = ""; try { timeRemap([{ f: 5, speed: 1 }, { f: 3, speed: 2 }]); } catch (e) { msg = String(e); } ok(msg.includes("must increase"), "keys out of order are reported as out of order"); }
+ ok(throws(() => t.at(Infinity)) && throws(() => t.at(NaN)) && throws(() => t.speedAt(NaN)), "a frame that is not a number is refused");
};
diff --git a/skills/anidoodle/engine/tools/deck.mjs b/skills/anidoodle/engine/tools/deck.mjs
index fcf3e89..6b750fa 100644
--- a/skills/anidoodle/engine/tools/deck.mjs
+++ b/skills/anidoodle/engine/tools/deck.mjs
@@ -43,27 +43,30 @@ export const deal = ({ kind, energy, seconds = 20, seed = 1, n, cat, avoid = []
// FIND. People ask for a move by the name they know ("a whip pan", "do the Vertigo thing"). Each card's
// aka, the deck's calls and its refused names hold those names; find routes the words to what anidoodle
// builds, or to the reason it will not and what it makes instead, so nothing is improvised from a word.
-const STOP = new Set(["a", "an", "the", "please", "do", "make", "me", "some", "use", "add", "like", "effect", "shot", "move", "thing"]);
+const STOP = new Set(["a", "an", "the", "please", "do", "make", "me", "some", "use", "add", "like", "effect", "shot", "move", "thing", "in", "out", "up", "to", "on", "of", "into", "at", "can", "you"]);
+const KIND_ORDER = { card: 0, call: 1, refused: 2 };
export const norm = (x) => ` ${String(x).normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, " ").trim()} `;
const entries = () => [
...DECK.moves.map((m) => ({ kind: "card", id: m.id, names: [m.id, ...(m.aka ?? [])], item: m })),
...(DECK.calls ?? []).map((c) => ({ kind: "call", id: c.id, names: [c.id, ...c.aka], item: c })),
...(DECK.refused ?? []).map((r) => ({ kind: "refused", id: r.name, names: [r.name, ...r.aka], item: r })),
];
-/** Every entry whose names match the words, best first: an exact name, a name inside the words, the words inside a name, then shared words. */
+/** Every entry whose names match the words, best first: an exact name, a name inside the words, the words inside a name, then shared
+ * words (scored on the share of both the asked words and the name's words, so a long name does not win on one common word).
+ * Ties go to the longer matched name, then card before engine call before refusal. Ids match exactly or inside the words only. */
export const find = (query) => {
const q = norm(query), words = q.trim().split(" ").filter((w) => w && !STOP.has(w)), out = [];
if (!q.trim()) return out;
for (const e of entries()) {
let best = 0, via = "";
- for (const n of e.names) {
- const a = norm(n), aw = a.trim().split(" ");
- const score = a === q ? 100 : q.includes(a) ? 50 + aw.length : a.includes(q) ? 30 : words.length ? (10 * words.filter((w) => aw.includes(w)).length) / words.length : 0;
- if (score > best) { best = score; via = n; }
+ for (const [i, n] of e.names.entries()) {
+ const a = norm(n), aw = a.trim().split(" ").filter((w) => !STOP.has(w)), hit = words.filter((w) => aw.includes(w)).length;
+ const score = a === q ? 100 : q.includes(a) ? 50 + aw.length : a.includes(q) ? 30 : i > 0 && words.length && aw.length ? 5 * (hit / words.length + hit / aw.length) : 0;
+ if (score > best || (score === best && score > 0 && n.length > via.length)) { best = score; via = n; }
}
if (best >= 5) out.push({ kind: e.kind, id: e.id, score: best, via, item: e.item });
}
- return out.sort((a, b) => b.score - a.score || a.id.localeCompare(b.id));
+ return out.sort((a, b) => b.score - a.score || b.via.length - a.via.length || KIND_ORDER[a.kind] - KIND_ORDER[b.kind] || a.id.localeCompare(b.id));
};
const showFound = (r) => r.kind === "card" ? `${card(r.item)}\n (matched "${r.via}")`
: r.kind === "call" ? ` ${r.id} [engine call · ${r.item.where}]\n ${r.item.call}\n ${r.item.use}\n (matched "${r.via}")`
@@ -91,12 +94,12 @@ const selfTest = () => {
say(!dup.length, `no name leads to two places${dup.length ? ` ${dup.slice(0, 4).join("; ")}` : ""}`); }
{ const grammar = readFileSync(join(ROOT, "references", "motion-grammar.md"), "utf8"), table = grammar.slice(grammar.indexOf("## Names we refuse")), missing = R.filter((r) => !table.includes(`| ${r.name} |`));
say(grammar.includes("## Names we refuse") && !missing.length, `motion-grammar.md's "Names we refuse" table holds every refused name${missing.length ? ` missing: ${missing.map((r) => r.name).join(", ")}` : ""}`); }
- { const named = R.flatMap((r) => r.instead.match(/\b(?:open|seam|cam|reveal|type|act|emph|close|time)-[a-z-]+[a-z]/g) ?? []), bad = named.filter((id) => !ids.includes(id));
+ { const named = R.flatMap((r) => r.instead.match(/\b(?:open|seam|cam|reveal|type|act|emph|close)-[a-z-]+[a-z]/g) ?? []), bad = named.filter((id) => !ids.includes(id));
say(named.length >= 6 && !bad.length, `every card a refused name points to exists (${named.length})${bad.length ? ` missing: ${bad.join(", ")}` : ""}`); }
const ROUTES = [["whip pan", "cam-whip-to-rest"], ["mask reveal", "reveal-from-behind"], ["Vertigo", "cam-vertigo-realisation"], ["a dolly zoom", "cam-vertigo-realisation"], ["the vertigo effect", "cam-vertigo-realisation"],
- ["speed ramp", "time-ramp-at-peak"], ["slow-mo", "time-ramp-at-peak"], ["freeze frame", "time-freeze-and-name"], ["J-cut", "seam-sound-leads"], ["l cut", "seam-sound-leads"], ["rack focus", "cam-rack-of-attention"],
- ["pop-in", "act-settle"], ["count-up", "reveal-count-during"], ["zoom in", "call-lens"], ["crash zoom", "call-lens"], ["dolly in", "cam-slow-push"], ["circle wipe", "call-iris"], ["smash cut", "call-flash-cut"],
- ["typewriter", "call-typewriter"], ["can you do a whip pan to the cat", "cam-whip-to-rest"], ["glitch", "glitch"], ["Lens Flare", "lens flare"], ["fade in", "fade-in"], ["crossfade", "cross dissolve"], ["confetti", "particle burst"], ["shine", "light sweep"]];
+ ["speed ramp", "emph-time-ramp"], ["slow-mo", "emph-time-ramp"], ["freeze frame", "type-freeze-and-name"], ["J-cut", "seam-sound-leads"], ["l cut", "seam-sound-leads"], ["rack focus", "cam-rack-of-attention"],
+ ["count-up", "reveal-count-during"], ["zoom in", "call-lens"], ["crash zoom", "call-lens"], ["dolly in", "cam-slow-push"], ["circle wipe", "call-iris"], ["smash cut", "seam-cut-on-beat"], ["flash cut", "call-flash-cut"],
+ ["typewriter", "call-typewriter"], ["can you do a whip pan to the cat", "cam-whip-to-rest"], ["glitch", "glitch"], ["Lens Flare", "lens flare"], ["fade in", "fade-in"], ["cross-fade", "cross dissolve"], ["dolly zoom in", "cam-vertigo-realisation"], ["slow zoom", "cam-slow-push"], ["masked reveal", "reveal-from-behind"], ["cut", "seam-cut-on-beat"], ["fade out", "fade-in"], ["fade to black", "fade-in"], ["pop-in", "fade-in"], ["time lapse", "reveal-drawn-on"], ["slow pan across the city", "cam-parallax-travel"], ["tilt up", "cam-parallax-travel"], ["fast motion", "call-time-remap"], ["rewind", "call-time-remap"], ["on twos", "call-on-twos"], ["bloom", "call-gentle-move"], ["jcut", "seam-sound-leads"], ["depth of field", "cam-rack-of-attention"], ["bokeh", "lens flare"], ["zoom out to reveal the city", "cam-pull-back-reveal"], ["confetti", "particle burst"], ["shine", "light sweep"]];
const wrong = ROUTES.filter(([q, id]) => find(q)[0]?.id !== id).map(([q, id]) => `"${q}" -> ${find(q)[0]?.id ?? "nothing"} (want ${id})`);
say(!wrong.length, `${ROUTES.length} everyday names resolve to the right card, call or refusal${wrong.length ? ` ${wrong.join("; ")}` : ""}`);
say(find("zzqx plorb").length === 0 && find(" ").length === 0, "a name nobody uses finds nothing, and says so");
@@ -143,7 +146,7 @@ if (isMain(import.meta.url)) {
const all = find(q), top = all[0], hits = all.filter((r) => r.score >= Math.max(5, (top?.score ?? 0) / 2)).slice(0, 5);
if (args.includes("--json")) console.log(JSON.stringify({ query: q, found: hits.map(({ kind, id, via, item }) => ({ kind, id, via, ...item })) }, null, 1));
else if (!hits.length) console.log(`FIND "${q}": no card, call or refused name goes by that. List the deck with deck.mjs list, or describe the move in plain words in the brief.`);
- else { console.log(`FIND "${q}" · ${hits.length} ${hits.length === 1 ? "match" : "matches"}, best first\n`); console.log(hits.map(showFound).join("\n\n")); console.log(`\nA card is a prompt, never an order: its numbers are the default unless the person named their own (workflows/start-here.md).`); }
+ else { console.log(`FIND "${q}" · ${hits.length} ${hits.length === 1 ? "match" : "matches"}, best first\n`); console.log(hits.map(showFound).join("\n\n")); if (hits.some((r) => r.kind === "card")) console.log(`\nA card is a prompt, never an order: its numbers are the default unless the person named their own (workflows/start-here.md).`); }
if (!hits.length) process.exit(1);
} else die("usage: deck.mjs deal|list|find|test (see the header of this file)");
}
diff --git a/skills/anidoodle/references/camera.md b/skills/anidoodle/references/camera.md
index 47aae14..0d997ee 100644
--- a/skills/anidoodle/references/camera.md
+++ b/skills/anidoodle/references/camera.md
@@ -50,8 +50,9 @@ Two different moves make the subject bigger, and directors name them apart:
- **A dolly** moves the camera: the `zoom` key, distance D = 1/zoom. Near planes grow faster than
far ones, so the depth changes as it goes. This is a push-in, a pull-back, a dolly in or out.
-- **A lens zoom** changes the focal length with the camera standing still: the `lens` key
- (default 1). It multiplies every plane by the same factor about the frame's centre, so nothing
+- **A lens zoom** changes the focal length with the camera standing still: the `lens` key (1
+ when no key sets it; once one does, frames before the first lens key hold that key's value, so
+ key `lens: 1` where the zoom starts, as below). It multiplies every plane by the same factor about the frame's centre, so nothing
shifts against anything else; the picture is magnified, flat. A crash zoom or punch-in is this.
It reads as an operator's or a documentary's move, more noticed than a dolly. Use it when that
is the voice; for travelling into a world, dolly.
@@ -59,7 +60,7 @@ Two different moves make the subject bigger, and directors name them apart:
every frame so the hero plane keeps its size, and the planes behind stretch away (dolly in) or
loom (dolly out). The subject holds still in a world that has just changed shape: the moment of
realisation (deck card `cam-vertigo-realisation`). It needs at least two planes behind the
- subject; with nothing behind it, it is only a zoom.
+ subject; with nothing behind it, nothing visibly happens.
```ts
import { Camera, dollyZoom, heroScale } from "./camera";
@@ -70,8 +71,8 @@ const vertigo = new Camera(c, [], { path: dollyZoom((f) => dolly.at(f)) }); // h
// dollyZoom(path, { hold: 1.5 }) holds a given scale; { at: 30 } holds the scale the path has at frame 30
```
-`heroScale(cam)` is the hero plane's screen scale (dolly times lens), and `weight(cam)` follows
-it, so a lens zoom thins the line just as a dolly does.
+`heroScale(cam)` is the hero plane's screen scale (dolly times lens), and the line-weight
+compensation `weight(cam)` follows it, for a lens zoom as for a dolly.
## Time: speed ramps, slow motion, freeze frames
@@ -92,18 +93,18 @@ name(g, f); // the writing, on the film's own frame
cues.push({ frame: t.filmFrameOf(LANDING), kind: "paper" }); // a sound on a remapped event
```
-- **A ramp eases the speed**, on a smoothstep, so it starts and ends with no kick; `ramp: 0` is a
- deliberate hard change. A slowed scene is asked for frames between its frames, so it must
+- **A ramp eases the speed**, on a smoothstep (or `curve: "linear"`), so it starts and ends with
+ no kick. `ramp` defaults to 0, a deliberate hard change of speed; give it frames to glide. A slowed scene is asked for frames between its frames, so it must
draw at fractional time (motion is a function of time, never of a frame counter).
- **Score and sound stay on real time.** The score never slows; effects are cued by film frame.
`filmFrameOf(sceneFrame)` gives the first film frame that shows a scene event, which is where
its sound goes.
- **A freeze must keep something moving.** A `speed: 0` key without `keepsMoving` (in words)
- throws: a frozen frame with nothing moving is dead air, and the gate fails it. Drive the thing
+ throws, and so does a speed under 0.01 (`MIN_SPEED`), which looks frozen without saying so: a frozen frame with nothing moving is dead air, and the gate fails it. Drive the thing
that moves (the name being written, the camera still creeping in) from the film's frame `f`.
`t.freezes` lists each stop with what keeps moving.
- **Once a film for each.** One slow motion at the peak, one freeze on the telling pose (deck
- cards `time-ramp-at-peak`, `time-freeze-and-name`). The second halves the first.
+ cards `emph-time-ramp`, `type-freeze-and-name`). The second halves the first.
## Shake
diff --git a/skills/anidoodle/references/motion-deck.json b/skills/anidoodle/references/motion-deck.json
index 67dce3d..52c40d9 100644
--- a/skills/anidoodle/references/motion-deck.json
+++ b/skills/anidoodle/references/motion-deck.json
@@ -47,9 +47,9 @@
"move": "A loaded brush is pulled across in the direction the story is already moving, wet ink running ahead of the new picture, 0.6 to 0.9 s.",
"build": "brushWipe(ctx, env, p, from, to, { angle, ink }) in transitions.ts.",
"not": "A clean, set register. Or more than twice." },
- { "id": "seam-cut-on-beat", "cat": "seam", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["cut on the beat", "match cut", "graphic match", "hard cut"],
+ { "id": "seam-cut-on-beat", "cat": "seam", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["cut on the beat", "match cut", "graphic match", "hard cut", "smash cut", "cut"],
"move": "A plain hard cut with both sides at rest, on a strong beat, between two frames that match in one thing: a shape, a position, a direction of gaze.",
- "build": "No call. Put the cut frame on the cue table's downbeat and check the pair as stills: one thing sits in the same place on both.",
+ "build": "No call (and not seam-matched-cut, which hides the cut in travel). Put the cut frame on the cue table's downbeat and check the pair as stills: one thing sits in the same place on both.",
"not": "Nothing matches, or the music has no beat there. Then use the gentle move." },
{ "id": "seam-one-canvas", "cat": "seam", "role": "workhorse", "energy": "calm", "kinds": ["explainer", "launch", "story", "interactive"], "aka": ["oner", "one take", "infinite canvas", "continuous shot"],
"move": "The scenes sit side by side in one layout larger than the frame and the camera travels between them; the route says how they relate.",
@@ -59,16 +59,16 @@
"move": "A thing leaves the way it came, mirrored in time and shorter: what arrived over 0.5 s on a settling curve leaves over 0.25 s on an accelerating one, along the same path.",
"build": "Run the entrance's own progress backwards through easeIn (seams.ts); if it was revealed from behind an edge it tucks back behind that edge where the edge is now.",
"not": "The exit is the point of the scene. Then it gets a move of its own." },
- { "id": "seam-sound-leads", "cat": "seam", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["J-cut", "L-cut", "sound bridge", "pre-lap", "audio lead", "split edit"],
+ { "id": "seam-sound-leads", "cat": "seam", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["J-cut", "L-cut", "jcut", "lcut", "sound bridge", "pre-lap", "audio lead", "split edit"],
"move": "The sound crosses the cut ahead of the picture or behind it: the next scene is heard 0.3 to 0.8 s before it is seen (a J-cut), or the last scene is still heard 0.5 to 1.5 s into the next (an L-cut). The ear makes the join before the eye does.",
"build": "Cue the incoming scene's first sound at CUT minus the lead in the SfxPlan (filmSfx cues are film frames), or let the outgoing scene's sound run past CUT with lengthS; the score can enter its next section a beat early (music/sound-design.md, Sound across a cut).",
"not": "A hit or a contact: its sound belongs on its own frame, and one that trails its picture reads as lag." },
- { "id": "cam-slow-push", "cat": "camera", "role": "workhorse", "energy": "calm", "kinds": ["any"], "aka": ["slow push", "push in", "dolly in", "creep in", "Ken Burns"],
+ { "id": "cam-slow-push", "cat": "camera", "role": "workhorse", "energy": "calm", "kinds": ["any"], "aka": ["slow push", "push in", "dolly in", "creep in", "Ken Burns", "slow zoom"],
"move": "A hold that is never still: the camera pushes in 3 to 6 percent over the whole shot, so a quiet shot still changes every second.",
"build": "Two Camera keys, zoom 1 to 1.04, ease \"linear\" for this one move only: an eased drift stops at both ends and the stop is the dead air.",
"not": "A shot with a lot of its own motion. Two moves at once fight." },
- { "id": "cam-parallax-travel", "cat": "camera", "role": "workhorse", "energy": "medium", "kinds": ["story", "loop", "explainer"], "aka": ["parallax", "truck shot", "lateral track", "multiplane", "parallax scroll"],
+ { "id": "cam-parallax-travel", "cat": "camera", "role": "workhorse", "energy": "medium", "kinds": ["story", "loop", "explainer"], "aka": ["parallax", "truck shot", "lateral track", "multiplane", "parallax scroll", "pan", "slow pan", "pan across", "tilt", "tilt up", "tilt down"],
"move": "The camera travels sideways and depth does the work: near things swing wide, far things barely stir, and something crosses the lens in front of the subject.",
"build": "One Camera, planes at z from -0.3 (across the glass) to 4 or more (camera.md, depth planes). Never a hand-set drift per layer.",
"not": "A flat style whose point is the flatness (a print, a diagram)." },
@@ -84,7 +84,7 @@
"move": "The camera pulls back and the thing we were looking at turns out to be a small part of something larger.",
"build": "A dolly out: Camera zoom keys (eased in log2), monoZoom: true, 1.5 to 3 s; the large thing is painted in the world from the start, never faded in at the end.",
"not": "The larger thing adds nothing to the story. Then it is only a pull-back." },
- { "id": "cam-rack-of-attention", "cat": "camera", "role": "accent", "energy": "calm", "kinds": ["story", "explainer", "launch"], "aka": ["rack focus", "focus pull", "pull focus", "shift focus"],
+ { "id": "cam-rack-of-attention", "cat": "camera", "role": "accent", "energy": "calm", "kinds": ["story", "explainer", "launch"], "aka": ["rack focus", "focus pull", "pull focus", "shift focus", "depth of field", "background blur"],
"move": "Attention moves from one thing to another in the same frame without the camera moving: the first dims and softens its edges, the second gains contrast and line weight.",
"build": "Draw both from one emphasis value 0..1: stroke weight, saturation and value contrast (no ctx.filter, the contract forbids it).",
"not": "The two things are in different places in the story. That is a seam." },
@@ -95,13 +95,13 @@
{ "id": "cam-vertigo-realisation", "cat": "camera", "role": "accent", "energy": "medium", "kinds": ["story", "explainer", "launch"], "aka": ["dolly zoom", "Vertigo", "vertigo effect", "zolly", "trombone shot", "Hitchcock zoom"],
"move": "The moment of realisation: the subject keeps its size in the frame while the world behind it stretches away (or closes in), over 1 to 2.5 s, slow enough to be felt before it is noticed.",
"build": "dollyZoom((f) => cam.at(f)) in camera.ts, used as a path camera, on a dolly of 1.6 to 3 times; the subject on the hero plane and at least two planes behind it at real depths (camera.md, Lens and dolly).",
- "not": "Fewer than two depth planes (with nothing behind the subject it is only a zoom), or a beat that is not a realisation. Once a film." },
+ "not": "Fewer than two depth planes (with nothing behind the subject nothing visibly happens), or a beat that is not a realisation. Once a film." },
- { "id": "reveal-drawn-on", "cat": "reveal", "role": "signature", "energy": "any", "kinds": ["any"], "aka": ["line draw", "draw on", "stroke reveal", "self-drawing", "path animation", "timelapse", "speed paint"],
+ { "id": "reveal-drawn-on", "cat": "reveal", "role": "signature", "energy": "any", "kinds": ["any"], "aka": ["line draw", "draw on", "stroke reveal", "self-drawing", "path animation", "timelapse", "time lapse", "speed paint"],
"move": "The thing is drawn into the picture in the order a hand would make it, the tool visible, each stroke taking the time its length asks for.",
"build": "kind: \"drawing\" and the style plate's own draw order (workflows/drawing-process.md).",
"not": "A fade standing in for drawing. If it cannot be drawn on, it arrives some other honest way." },
- { "id": "reveal-from-behind", "cat": "reveal", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["mask reveal", "masked rise", "reveal from below", "wipe reveal"],
+ { "id": "reveal-from-behind", "cat": "reveal", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["mask reveal", "masked reveal", "masked rise", "reveal from below", "wipe reveal"],
"move": "A thing comes out from behind something already in the picture (a hill, a card's edge, another figure), so the picture supplies the mask.",
"build": "Clip with the occluder's own outline (pathShape in morph.ts) and move the thing out from under it on a settling curve, 0.4 to 0.7 s.",
"not": "A mask in mid-air with nothing drawn where its edge is." },
@@ -118,7 +118,7 @@
"build": "Drive the digits and the action from the same progress value (productUI.ts counts values this way).",
"not": "A figure that is not true of the data on screen." },
- { "id": "type-written", "cat": "type", "role": "workhorse", "energy": "any", "kinds": ["launch", "explainer", "infographic"], "aka": ["write on", "handwriting", "handwritten text", "signature animation"],
+ { "id": "type-written", "cat": "type", "role": "workhorse", "energy": "any", "kinds": ["launch", "explainer", "infographic"], "aka": ["write on", "handwriting", "handwritten text", "signature animation", "lower third"],
"move": "A line is written by its tool, one stroke after another, at the speed of a hand, and holds long enough to be read twice.",
"build": "writeOn or sentence in kinetic.ts; on its own frame, or over a calm area where the frame would pass as a poster (workflows/launch-video.md, Type).",
"not": "Over a face, the focal detail or busy texture. In doubt the line gets its own frame." },
@@ -138,7 +138,7 @@
"move": "The one word that matters is underlined by hand after the line has landed, 0.25 s, on a beat. Underlined, never struck through.",
"build": "caption(..., \"underline\") in kinetic.ts, started when the line's progress reaches 1.",
"not": "More than one word a line, or more than twice a film." },
- { "id": "time-freeze-and-name", "cat": "type", "role": "accent", "energy": "medium", "kinds": ["story", "explainer", "launch"], "aka": ["freeze frame", "freeze and name", "character intro freeze", "freeze title"],
+ { "id": "type-freeze-and-name", "cat": "type", "role": "accent", "energy": "medium", "kinds": ["story", "explainer", "launch"], "aka": ["freeze frame", "freeze and name", "character intro freeze", "freeze title"],
"move": "The world stops on a telling pose and a name or a word is written by hand beside it; the camera keeps creeping in while it is written, then time picks up exactly where it stopped.",
"build": "A speed 0 key in timeRemap (timeRemap.ts) whose keepsMoving names the writing; writeOn in kinetic.ts and a slow push, both on the film's own frame; hold for as long as the word takes to write plus one beat to read it.",
"not": "Nothing is written or moving during the stop (dead air, and timeRemap refuses it), or a calm film where a hard stop is a jolt." },
@@ -151,7 +151,7 @@
"move": "Loose parts arrive late and go further: a tail, hair, a sleeve follow the body by 0.05 to 0.1 s a segment, each segment wider than the one before.",
"build": "Sample the driving angle at f - lag * i down the chain and scale its swing by 1 + 0.15 to 0.2 * i.",
"not": "A stiff material. Wood and metal do not whip." },
- { "id": "act-settle", "cat": "acting", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["overshoot", "settle", "pop-in", "spring settle", "back ease"],
+ { "id": "act-settle", "cat": "acting", "role": "workhorse", "energy": "any", "kinds": ["any"], "aka": ["overshoot", "settle", "spring settle", "back ease", "bounce", "squash and stretch"],
"move": "Nothing stops dead. A thing that lands goes a little past, comes back, and is at rest by 0.3 to 0.5 s; weight decides how far past.",
"build": "One overshoot of 4 to 8 percent then a decay on easeOut; heavier things overshoot less and take longer.",
"not": "Type meant to be read while it lands, and anything in a clean set register that should simply arrive." },
@@ -176,10 +176,10 @@
"move": "After the biggest change in the film the result is held, alive but unbroken, for 1 to 2 s before anything else happens.",
"build": "A hold in the cue table after the payoff with only breathing motion in it (cam-slow-push, act-blink-and-breathe).",
"not": "A loop under 6 s, where the hold would be most of it." },
- { "id": "time-ramp-at-peak", "cat": "emphasis", "role": "accent", "energy": "high", "kinds": ["story", "launch", "loop"], "aka": ["speed ramp", "slow motion", "slow-mo", "time ramp", "bullet time"],
+ { "id": "emph-time-ramp", "cat": "emphasis", "role": "accent", "energy": "high", "kinds": ["story", "launch"], "aka": ["speed ramp", "slow motion", "slow-mo", "slowmo", "time ramp", "bullet time"],
"move": "At the top of the action (the peak of a jump, the instant before contact) time slows and stays slow long enough to read the shape, then gathers back into real time. The score keeps its own tempo throughout.",
"build": "timeRemap in timeRemap.ts: ease down over 0.2 to 0.35 s to a speed of 0.2 to 0.4, hold 0.5 to 1.2 s, ease back over 0.3 to 0.6 s; draw the scene at t.at(f) (it must draw between its frames) and cue the contact sound at t.filmFrameOf(contact) (camera.md, Time).",
- "not": "Nothing is in flight, or a second time in one film: the second slow motion halves the first." },
+ "not": "Nothing is in flight, a loop (a remap changes how much scene time the film covers, so the loop stops closing), or a second time in one film: the second slow motion halves the first." },
{ "id": "close-returns-to-open", "cat": "close", "role": "signature", "energy": "any", "kinds": ["story", "loop", "launch"], "aka": ["bookend", "full circle", "callback ending", "loop back"],
"move": "The last frame is the first frame, earned: the film ends where it began and the viewer now knows what it means.",
@@ -197,7 +197,7 @@
"calls": [
{ "id": "call-iris", "where": "transitions.ts", "call": "iris(ctx, env, p, from, to, { center, shape })", "aka": ["iris", "iris out", "circle wipe", "circle transition", "mask transition"],
"use": "A round opening from a point or closing to one; open it from what the next scene is about (motion-grammar.md, Three ready-made seams)." },
- { "id": "call-flash-cut", "where": "transitions.ts", "call": "flashCut(ctx, env, local, cut, from, to)", "aka": ["smash cut", "flash cut", "flash transition", "white flash"],
+ { "id": "call-flash-cut", "where": "transitions.ts", "call": "flashCut(ctx, env, local, cut, from, to)", "aka": ["flash cut", "flash transition", "white flash"],
"use": "A hard cut under a short burst of light, on a strong beat; declare the film's flashes to checkFlashes." },
{ "id": "call-lens", "where": "camera.ts", "call": "Camera keys with lens (a true lens zoom), or dollyZoom", "aka": ["zoom in", "zoom out", "lens zoom", "crash zoom", "punch in", "snap zoom"],
"use": "A lens zoom magnifies every plane by one factor and changes no parallax; to move closer through the world, key the dolly (zoom) instead (camera.md, Lens and dolly)." },
@@ -206,26 +206,32 @@
{ "id": "call-motion-blur", "where": "render.mjs", "call": "node tools/render.mjs <film> --blur auto", "aka": ["motion blur", "motion trail", "shutter blur"],
"use": "Subframes per frame from each frame's measured speed, averaged in linear light; the film's own code is untouched." },
{ "id": "call-typewriter", "where": "launchKit.ts", "call": "typedAt(text, f, times) and caretAt", "aka": ["typewriter", "typing effect", "type on", "typing text"],
- "use": "Characters appear on a typing cadence with a caret, one tick sound per character (music/sound-design.md)." }
+ "use": "Characters appear on a typing cadence with a caret, one tick sound per character (music/sound-design.md)." },
+ { "id": "call-time-remap", "where": "timeRemap.ts", "call": "timeRemap([{ f, speed, ramp }]) with speed above 1, or your own falling time", "aka": ["fast motion", "speed up", "sped up", "undercrank", "rewind", "reverse time"],
+ "use": "Speed above 1 runs the scene fast; timeRemap never runs time backwards, so for a rewind draw the scene at a falling time yourself, scene(g, t0 - (f - f0)), which the contract allows (camera.md, Time)." },
+ { "id": "call-on-twos", "where": "film.ts", "call": "onTwos: true in the film's meta", "aka": ["on twos", "stop motion", "stop-motion look", "choppy animation"],
+ "use": "Each drawing is held for two frames, the rhythm of paper and stop-motion; motion blur leaves it alone (formats.md)." },
+ { "id": "call-gentle-move", "where": "launch-video.md", "call": "the gentle move: a bloom, a card flip, a push, the card growing into the scene", "aka": ["bloom", "flip", "card flip", "gentle transition", "default transition"],
+ "use": "The standard seam when no designed one clearly fits (motion-grammar.md, the default does not change)." }
],
"refused": [
{ "name": "glitch", "aka": ["glitch", "datamosh", "RGB split", "chromatic aberration"],
- "why": "Colour split and torn pixels need ctx.filter or pixel tricks the contract forbids, and they read as a template effect.",
+ "why": "Colour split and torn pixels are a template overlay with no cause in the picture; they read as stock, not as a made mark.",
"instead": "a cut on the beat (seam-cut-on-beat), or one shake on a real impact (cam-impact-shake)" },
{ "name": "light sweep", "aka": ["light sweep", "shine", "sheen", "glare sweep"],
"why": "A shine sliding across chrome is a stock overlay; nothing in the picture casts it.",
"instead": "reveal-by-light: the light belongs to the world and finds the subject" },
- { "name": "fade-in", "aka": ["fade in", "fade up", "fade in on scroll", "opacity fade"],
- "why": "Marks are made, not faded: a fade standing in for drawing is the first tell on the craft bar.",
+ { "name": "fade-in", "aka": ["fade in", "fade up", "fade in on scroll", "opacity fade", "fade out", "fade to black", "fade to white", "fade", "pop-in", "scale in"],
+ "why": "Marks are made, not faded or scaled up from nothing: a fade standing in for drawing is a tell on the craft bar.",
"instead": "reveal-drawn-on, reveal-from-behind or type-written" },
{ "name": "particle burst", "aka": ["particle burst", "particles", "confetti", "sparkle burst"],
"why": "A burst on everything is decoration with no force behind it, so it is never a default.",
"instead": "emph-contact: dust or a splash born on a real contact, from the contact point" },
- { "name": "cross dissolve", "aka": ["cross dissolve", "crossfade", "dissolve"],
- "why": "Two copies of one thing, each half there, read as a ghost.",
+ { "name": "cross dissolve", "aka": ["cross dissolve", "cross fade", "dissolve"],
+ "why": "Two copies of one thing, each half there, read as a ghost; between unrelated pictures a dissolve is a slideshow join. A poster-frame dissolve and a reduced-motion fallback are the exceptions (formats.md, interactive.md).",
"instead": "seam-shape-becomes or seam-actor-carries (move one object, change what it is mid-trip); between unrelated scenes, the gentle move" },
{ "name": "lens flare", "aka": ["lens flare", "light leak", "bokeh", "anamorphic flare"],
- "why": "Lens faults painted onto a drawing read as stock overlays, not as light.",
+ "why": "Lens artefacts (flare, light leaks, bokeh discs) painted onto a drawing read as stock overlays, not as light.",
"instead": "one named light in the scene (realism-and-craft.md), or reveal-by-light" }
]
}
diff --git a/skills/anidoodle/references/motion-grammar.md b/skills/anidoodle/references/motion-grammar.md
index 815009a..d252743 100644
--- a/skills/anidoodle/references/motion-grammar.md
+++ b/skills/anidoodle/references/motion-grammar.md
@@ -145,8 +145,8 @@ roughest. The difference is arithmetic, and `engine/src/canvas-core/seams.ts` do
The incoming shot owns the cut frame: the outgoing shot's last frame on screen is the one
before it, and that is its fastest.
- **Through the cut, in depth.** `matchedZoom({ push, exitF, entryF })` does the same for a
- camera that flies into one shot and out in the next. A zoom is a ratio, so both sides run in
- log space and grow at the same rate per frame across the cut. With the default push the
+ camera that flies into one shot and out in the next: a dolly push through the cut. A push is a
+ ratio, so both sides run in log space and grow at the same rate per frame across the cut. With the default push the
incoming shot opens at about two thirds of its size, so its scene must be painted that much
wider than the frame; a zoom that would open it under 0.4 is refused.
- **There is a top speed.** Past about two and a half frame widths a second
@@ -194,12 +194,12 @@ offer the alternative; `deck.mjs find` prints the same reason.
| Name | Why not | Make instead |
|---|---|---|
-| glitch | colour split and torn pixels need `ctx.filter` or pixel tricks the contract forbids | a cut on the beat, or one shake on a real impact |
+| glitch | colour split and torn pixels are a template overlay with no cause in the picture | a cut on the beat, or one shake on a real impact |
| light sweep | a shine sliding over chrome that nothing in the picture casts | `reveal-by-light`: the light belongs to the world |
-| fade-in | marks are made, not faded; the first tell on the craft bar | drawn on, revealed from behind, or written |
+| fade-in | marks are made, not faded or scaled up from nothing; a tell on the craft bar | drawn on, revealed from behind, or written |
| particle burst | decoration with no force behind it, never a default | `emph-contact`: dust or splash born on a real contact |
-| cross dissolve | two copies of one thing, each half there, read as a ghost | one object moving and changing mid-trip; the gentle move |
-| lens flare | lens faults painted onto a drawing read as stock overlays | one named light in the scene, or `reveal-by-light` |
+| cross dissolve | two copies of one thing read as a ghost; unrelated pictures, a slideshow join (a poster frame or a reduced-motion fallback may still dissolve) | one object moving and changing mid-trip; the gentle move |
+| lens flare | lens artefacts (flare, leaks, bokeh discs) painted onto a drawing read as stock overlays | one named light in the scene, or `reveal-by-light` |
## Callouts and the label handoff
diff --git a/skills/anidoodle/references/music/sound-design.md b/skills/anidoodle/references/music/sound-design.md
index a8c9915..d2955c0 100644
--- a/skills/anidoodle/references/music/sound-design.md
+++ b/skills/anidoodle/references/music/sound-design.md
@@ -92,14 +92,15 @@ export const audio = filmSfx(filmAudio(score, 15), plan); // Film.audio: score
The cheapest smooth seam works on the ear: the sound crosses the cut ahead of the picture or
behind it. In a **J-cut** the next scene is heard before it is seen, 0.3 to 0.8 s early (the
pond's bubbles under the last shot of the room, the nib scratching before the page appears). In an
-**L-cut** the last scene is still heard 0.5 to 1.5 s into the next (a page still rustling, a pile
-of bricks still settling). The ear makes the join first, so the picture cut lands as an answer. It
-uses the same cue table: cue the incoming scene's sound at `CUT - lead` (`{ frame: CUT - 15, kind:
-"bubble" }`), or let the outgoing one run past the cut with a longer `lengthS` or its own
-tail. The score can do it too, entering its next section a beat before the cut
-(a pre-lap), or letting the old chord ring over the first beat of the new scene. This never moves
-a hit: a contact's sound stays on its own frame (Land on the frame, below). What crosses the cut
-is a place's sound, never an event's. Deck card `seam-sound-leads`.
+**L-cut** the last scene is still heard 0.5 to 1.5 s into the next (a page still rustling, a pen
+still scratching). The ear makes the join first, so the picture cut lands as an answer. It uses
+the same cue table: cue the incoming scene's sound at `CUT - lead` (`{ frame: CUT - 15, kind:
+"bubble" }`). To carry the outgoing sound past the cut, give it a longer `lengthS` where the kind
+takes one (scratch, paper, whoosh, swish, riser, thread); for the others, place a few quieter cues
+of that scene's sound after the cut. The score can do it too, entering its next section a beat
+before the cut (a pre-lap), or letting the old chord ring over the first beat of the new scene.
+This never moves a hit: a contact's sound stays on its own frame (Land on the frame, below). What
+crosses the cut is a scene's ongoing sound, never a hit's. Deck card `seam-sound-leads`.
## Levels and the audibility rule
@@ -138,8 +139,9 @@ nothing: test that it is heard over the music at its own moment.
press, an arrival, a landing, the reveal. Picture changes that are only edits stay silent. Count
your cues against the film's length; if you cannot say what each one marks, cut it.
- **Land on the frame.** A hit belongs on the frame where the thing happens; within a frame either
- side reads as one event. A soft lead into the hit reads as anticipation. A sound after its picture
- reads as lag, which is the one error a viewer always notices.
+ side reads as one event. A soft lead into the hit reads as anticipation. A hit's sound after its
+ picture reads as lag, which is the one error a viewer always notices. (A place's sound may run
+ past a cut: Sound across a cut, above.)
- **One voice per job.** Every press of every button is the same click, at the same level, so the UI
feels like one object. Variety goes to the story moments, not to repeats of the same action.
- **The ending breathes.** The music settles on the tonic or lets its last chord ring, a beat of
diff --git a/skills/anidoodle/references/workflows/start-here.md b/skills/anidoodle/references/workflows/start-here.md
index fc951f4..b846746 100644
--- a/skills/anidoodle/references/workflows/start-here.md
+++ b/skills/anidoodle/references/workflows/start-here.md
@@ -43,7 +43,9 @@ an overshoot) and **what moves** (which element, camera or layer). Fill only wha
every part they left open, the card's own numbers are the default, written down and marked as
defaults: "whip pan (cam-whip-to-rest) · 0.4 to 0.7 s, card default · peak under the speed
ceiling, card default · the camera, onto the cat, theirs". A vague ask becomes a spec someone can
-check against the render.
+check against the render. When `find` returns an engine call, there are no card numbers: record
+the four parts with your own numbers, marked as yours. When it returns a refusal, tell the person
+the reason in one line, record the alternative you will build, and let them veto it.
## Defaults when they do not say