Art and animation, written as code. Illustrations, loops, interactive web art, launch-videos and scored films in dozens of styles, identical on every render.
TypeScript agent-skillsanimationcanvasclaude-codeclaude-pluginclaude-skillscodex-plugincreative-codecreative-codingcreative-toolsdeterministicgenerative-arthand-drawnillustrationlaunch-videomotion-designmotion-graphicspluginprocedural-generationskill
chore: resync Codex mirror
Alex Greenshpun986bce1a66cc
diff --git a/plugins/anidoodle/skills/anidoodle/SKILL.md b/plugins/anidoodle/skills/anidoodle/SKILL.mdindex 5661628..5e5c665 100644--- a/plugins/anidoodle/skills/anidoodle/SKILL.md+++ b/plugins/anidoodle/skills/anidoodle/SKILL.md@@ -106,7 +106,7 @@ Camera moves (pans, zooms, parallax, shake) come from `engine/src/canvas-core/calinear light per frame); the default path is untouched.```bash-node <skill>/engine/tools/scaffold.mjs ~/art --film intro --format 9x16 --duration 180+node <skill>/engine/tools/scaffold.mjs ~/art --film intro --format 9x16 --duration 12 # secondscd ~/art && npm install && npx playwright-core install chromiumnode tools/still.mjs intro --frame 0 --out out/look.png --scale 2 # a still, with its hashnode tools/render.mjs intro # MP4; --out x.gif|x.webm|x.apngdiff --git a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/film.ts b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/film.tsindex 64a8602..0dac60c 100644--- a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/film.ts+++ b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/film.ts@@ -18,6 +18,8 @@ export type Film = { meta: {holds?: [from: number, to: number][];onTwos?: boolean;step?: 1 | 2 | 3;+ // the score as fitted to this film (fitScore): its tempo and form; render prints it next to the grid's bpm+ score?: { tempo: number; form: string };}; assets: Assets; shots: Shot[]; audio?: (sampleRate: number) => [Float32Array, Float32Array] };// Cheap structural checks every adapter runs before frame 0. (The full gate is Phase 2.)diff --git a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/launchTemplate.ts b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/launchTemplate.tsindex 8a32921..b053245 100644--- a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/launchTemplate.ts+++ b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/launchTemplate.ts@@ -24,7 +24,7 @@ import {} from "./launchKit";import { beatGrid, bloomFrame, bloomRadius, makeCut, pic, type, typeFrame, type Seg, type TypeLine } from "./launchCut";import { measure, writeOn } from "./kinetic";-import { renderPiece } from "./music/render";+import { fitScore, limiter, renderPiece } from "./music/render";import { loudness, truePeak } from "./music/meter";import * as families from "./music/pieces/families";import * as launchPieces from "./music/pieces/launch";@@ -61,6 +61,7 @@ export type LaunchSpec = {// A Material (what compose.md writes) is composed here; a finished Piece is used as is.score: (() => Piece | Material) | null;audio?: Film["audio"]; // or your own finished mix; wins over score+ limit?: boolean; // let a look-ahead limiter take the score's last peaks so it reaches -14 LUFS (default off: the peak ceiling wins)};const W = 1920, H = 1080;@@ -207,24 +208,39 @@ export const makeLaunchFilm = (spec: LaunchSpec): Film & { cut: ReturnType<typeoholds.push([cut.STARTS[k] + written + 1, cut.STARTS[k] + open + 1]);});holds.push([cut.N - END + 53, cut.N]); // the end card, all on: read it, screenshot it+ // the score, fitted to the film's exact length so it ends on its phrase (fitScore: its stretch section+ // repeated or dropped, then the tempo trimmed); the fitted tempo goes in meta so render prints it+ // beside the grid's bpm (compose at the film's bpm and they stay within a few percent)+ const bed = !spec.audio && spec.score ? scoreFit(asPiece(spec.score), cut.N, fps) : null;return {- meta: { title: `${spec.title} · launch`, W, H, fps, bpm: spec.bpm, durationFrames: cut.N, raster: "cpu", kind: "launch", holds },+ meta: { title: `${spec.title} · launch`, W, H, fps, bpm: spec.bpm, durationFrames: cut.N, raster: "cpu", kind: "launch", holds, ...(bed ? { score: { tempo: bed.fit.tempo, form: bed.fit.form } } : {}) },assets: { images: {} },shots: [{ id: "cut", start: 0, end: cut.N, draw }],- audio: spec.audio ?? (spec.score ? musicBed(asPiece(spec.score), cut.N, fps) : undefined),+ audio: spec.audio ?? (bed ? musicBed(() => bed.fit, cut.N, fps, -14, { limit: spec.limit }) : undefined),cut,};};-// A music bed: the first `frames` of a composed piece, faded out over the last 1.2 s, then set to-// `lufs` integrated (default -14, the one published cross-platform target) with the true peak held-// at or under -1 dBTP. Compose the piece for this film, at the film's bpm, so the cuts sit on its downbeats.-export const musicBed = (piece: () => Piece, frames: number, fps = 30, lufs = -14) => (sr: number): [Float32Array, Float32Array] => {- const n = Math.round((frames / fps) * sr), L = new Float32Array(n), R = new Float32Array(n), m = renderPiece(piece(), sr);- for (let i = 0; i < n && i < m.L.length; i++) { L[i] = m.L[i]; R[i] = m.R[i]; }- const fade = Math.round(1.2 * sr); for (let i = 0; i < fade && i < n; i++) { const g = i / fade; L[n - 1 - i] *= g; R[n - 1 - i] *= g; }+type Fit = ReturnType<typeof fitScore>;+const scoreFit = (piece: () => Piece, frames: number, fps: number) => ({ fit: fitScore(piece(), frames / fps) });++// A music bed: the piece FITTED to the film (fitScore, exactly as filmAudio: its stretch section+// repeated or dropped so it lands on its outro, the tempo trimmed so the tail rings out on the last+// frame; never cut and faded), then set to `lufs` integrated (default -14, the one published+// cross-platform target) with the true peak held at or under -1 dBTP. A dynamic piece stops at the+// peak ceiling first (render prints how far short); `limit: true` lets a look-ahead limiter take+// those few peaks instead so the bed reaches the target. Compose the piece for this film at the+// film's bpm, so the cuts sit on its downbeats. `piece` may return a Piece or a fitScore result.+export const musicBed = (piece: () => Piece | Fit, frames: number, fps = 30, lufs = -14, o: { limit?: boolean } = {}) => (sr: number): [Float32Array, Float32Array] => {+ const seconds = frames / fps, x = piece(), fit = "order" in x ? x : fitScore(x, seconds);+ const m = renderPiece(fit.piece, sr, { seconds, tempo: fit.tempo }), n = Math.round(seconds * sr);+ const L = new Float32Array(n), R = new Float32Array(n); L.set(m.L.subarray(0, n)); R.set(m.R.subarray(0, n));+ const gain = (dB: number) => { const g = Math.pow(10, dB / 20); for (let i = 0; i < n; i++) { L[i] *= g; R[i] *= g; } };const now = loudness([L, R], sr).integrated, peak = truePeak([L, R]).dbtp;- const gainDb = Math.min(lufs - now, -1 - peak), g = Math.pow(10, gainDb / 20); // loudness first, never past -1 dBTP- for (let i = 0; i < n; i++) { L[i] *= g; R[i] *= g; }+ if (!o.limit || lufs - now <= -1 - peak) { gain(Math.min(lufs - now, -1 - peak)); return [L, R]; } // loudness first, never past -1 dBTP+ gain(lufs - now); limiter(L, R, sr, Math.pow(10, -1.3 / 20)); // the limiter takes the peaks+ const again = lufs - loudness([L, R], sr).integrated; if (again > 0) { gain(Math.min(again, 1)); limiter(L, R, sr, Math.pow(10, -1.3 / 20)); }+ const tp = truePeak([L, R]).dbtp; if (tp > -1) gain(-1.05 - tp); // an inter-sample overshoot: a last static trimreturn [L, R];};+diff --git a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/lessonOwlScore.ts b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/lessonOwlScore.tsindex b36485e..aba6c2b 100644--- a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/lessonOwlScore.ts+++ b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/lessonOwlScore.ts@@ -30,6 +30,7 @@ export type FoleyEvent = { t0: number; t1: number; kind: "guide" | "line" | "filexport type OwlSoundPlan = { bpm: number; seconds: number; stepBeats: number[]; revealBeat: number; endBeat: number; foley: FoleyEvent[] };const bar = (t: number, src: string, role: Role, v: number, roll?: number) => line(t, src, { role, v, bpb: 4, roll });+const hit = (t: number, src: string, role: Role, v: number) => line(t, src, { role, v, bpb: 4, hit: true }); // a ping or a sting on any beatconst eighths = (names: string) => names.split(" ").map((n) => `${n}:.5`).join(" ");type Bar = { ost: string; mel: string; bass: string };const G: Bar = { ost: "G3 D4 G4 B4 D4 G4 B4 D4", mel: "r:.5 D5:.5 G5:.5 A5:.5 B5:1 G5:1", bass: "G2:2 D3:2" };@@ -59,9 +60,9 @@ export const owlPiece = (sp: OwlSoundPlan): Piece => {bass.push(...keep(bar(b, B.bass, "bass", 0.62)));(cyc % 2 === 0 ? pl : mar).push(...keep(bar(b, B.mel, "melody", 0.8)));}- sp.stepBeats.forEach((b, i) => ping.push(...bar(b, `${PINGS[Math.min(i, PINGS.length - 1)]}:1`, "color", 0.62)));+ sp.stepBeats.forEach((b, i) => ping.push(...hit(b, `${PINGS[Math.min(i, PINGS.length - 1)]}:1`, "color", 0.62)));// da-DAH- pl.push(...bar(cut, "[D5 F#5 A5]:.5", "melody", 0.75));+ pl.push(...hit(cut, "[D5 F#5 A5]:.5", "melody", 0.75));// peaks are a composing problem: the chord is rolled upward (a strum, not a slab), the bass lands an// eighth late and the bell a sixteenth late, so no two loud attacks share a samplemar.push(...bar(R, "[G3 D4 B4]:4", "melody", 0.64, 0.03)); pl.push(...bar(R, "[G4 D5 G5]:2 r:2", "melody", 0.78, 0.036)); // no doubled notes between the two@@ -69,7 +70,7 @@ export const owlPiece = (sp: OwlSoundPlan): Piece => {// end card: a rising arpeggio, then the chord rings outconst E = sp.endBeat;ost.push(...bar(E, eighths("G3 B3 D4 G4 B4 D5 G5 B5"), "accomp", 0.5));- mar.push(...bar(E + 4, "[G3 D4 G4 B4]:3", "melody", 0.55)); pl.push(...bar(E + 4, "G5:3", "melody", 0.5)); bass.push(...bar(E + 4, "G2:3", "bass", 0.5));+ mar.push(...bar(E + 4, "[G3 D4 G4 B4]:3 r:1", "melody", 0.55)); pl.push(...bar(E + 4, "G5:3 r:1", "melody", 0.5)); bass.push(...bar(E + 4, "G2:3 r:1", "bass", 0.5));const grid = { grid: true };const parts: Part[] = [{ id: "ostinato", inst: "marimba", role: "accomp", notes: ost, gainDb: -6, opts: grid },diff --git a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/compose.ts b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/compose.tsindex aca83ca..7d0f296 100644--- a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/compose.ts+++ b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/compose.ts@@ -42,6 +42,8 @@ export type Material = {/** seconds of ring-out after the last onset (default 3.2) */ tail?: number; loop?: boolean;};+/** line() with the composer's context on its error: which section, slot or chord wrote the bad bar. */+const lineIn = (where: string, ...a: Parameters<typeof line>) => { try { return line(...a); } catch (e) { throw new Error(`compose: ${where}: ${(e as Error).message}`); } };const need = (ok: unknown, msg: string) => { if (!ok) throw new Error(`compose: ${msg} The style supplies sound, never notes: compose it yourself (references/music/compose.md).`); };const fmt = (x: number) => String(+x.toFixed(4));const lanes: Lane[] = ["kick", "snare", "ghost", "hat", "perc"];@@ -82,11 +84,11 @@ export const composePiece = (m: Material): Piece => {for (let b = 0; b < B; b++) {const x = at(b), cv = x.s.chordVel, names = chordAt[b], d = bpb / names.length;const src = names.map((n) => `${m.chords[n].voicing}:${fmt(d)}${cv !== undefined ? `@${fmt(cv)}` : ""}`).join(" ");- push("chords", line(b * bpb, src, { role: "accomp", v: vel.chords, bpb, roll: 0.03 }));+ push("chords", lineIn(`section "${x.id}" chords (bar ${b})`, b * bpb, src, { role: "accomp", v: vel.chords, bpb, roll: 0.03 }));if (KINDS[x.s.kind].bass) {const ov = x.s.bass, bl = ov !== undefined ? (Array.isArray(ov) ? ov[(b - x.from) % ov.length] : ov) : names.length === 1 ? m.chords[names[0]].bass : undefined;need(bl !== undefined, names.length > 1 ? `bar ${b} splits into ${names.join(" + ")}: give section "${x.id}" a bass override for it.` : `chord "${names[0]}" (section "${x.id}") has no bass line: add chords["${names[0]}"].bass (one bar), or a section bass override.`);- if (bl) push("bass", line(b * bpb, bl, { role: "bass", v: vel.bass, bpb }));+ if (bl) push("bass", lineIn(`section "${x.id}" bass (bar ${b}${names.length === 1 && ov === undefined ? `, chords["${names[0]}"].bass` : ""})`, b * bpb, bl, { role: "bass", v: vel.bass, bpb }));}// drumsconst def = KINDS[x.s.kind].drums, gname = x.s.groove === undefined ? def : x.s.groove;@@ -94,7 +96,7 @@ export const composePiece = (m: Material): Piece => {const g = m.grooves?.[gname];need(g, `section "${x.id}" (${x.s.kind}) needs a groove "${gname}": add grooves["${gname}"] = { family: one of ${vocab.grooves.join(", ")}, density, variation } or write it (kick/snare/ghost/hat bars), or set groove: null.`);const bar = drumBar(g!, meter, m.seed, b, b - x.from, x.s.bars, x.s.energy ?? 0.5);- for (const ln of lanes) if (bar[ln]) push(ln, line(b * bpb, bar[ln]!, { role: "drum", v: vel[ln], bpb }));+ for (const ln of lanes) if (bar[ln]) push(ln, lineIn(`section "${x.id}" ${ln} (bar ${b})`, b * bpb, bar[ln]!, { role: "drum", v: vel[ln], bpb }));}}const warnings: string[] = [];@@ -105,7 +107,7 @@ export const composePiece = (m: Material): Piece => {if (x.s.loopLines) { const reps = Math.ceil(x.s.bars / lb), all = Array.from({ length: reps }, () => src).join(" | ").split("|").map((z) => z.trim()).filter(Boolean); src = all.slice(0, x.s.bars).join(" | "); }else if (x.pass === 0) warnings.push(`section "${x.id}": the ${slot} is ${lb} bar(s) in a ${x.s.bars}-bar section; it plays once, then rests (set loopLines: true to repeat it)`);}- const ns = line(x.from * bpb, src, { role: role(slot), v: vel[slot], bpb });+ const ns = lineIn(`section "${x.id}" ${slot}`, x.from * bpb, src, { role: role(slot), v: vel[slot], bpb });need(ns.every((n) => n.t < x.to * bpb - 1e-9), `the ${slot} line of section "${x.id}" is longer than its ${x.s.bars} bars.`);push(slot, ns);}diff --git a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/pieces/families.ts b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/pieces/families.tsindex b3832b5..81487fc 100644--- a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/pieces/families.ts+++ b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/pieces/families.ts@@ -11,10 +11,10 @@ const rep = (cell: string, n: number) => Array.from({ length: n }, () => cell).jexport const marimbaCurious = (): Piece => {const B = 4;const ost = L(0, ["D4:.5 A4:.5 E5:.5 F5:.5 A4:.5 E5:.5 D5:.5 A4:.5", "D4:.5 B4:.5 E5:.5 G5:.5 B4:.5 E5:.5 D5:.5 B4:.5",- "D4:.5 A4:.5 E5:.5 F5:.5 A4:.5 E5:.5 D5:.5 A4:.5", "[D4 A4]:1"].join(" | "), "accomp", B, 0.55);+ "D4:.5 A4:.5 E5:.5 F5:.5 A4:.5 E5:.5 D5:.5 A4:.5", "[D4 A4]:1 r:3"].join(" | "), "accomp", B, 0.55);// the hook asks (up to D6, then B natural), answers stepwise down to the tonic- const hook = L(0, "r:1 A5:.5 C6:.5 D6:1 C6:.5 A5:.5 | B5:1.5 G5:.5 A5:1 r:1 | F5:.5 E5:.5 D5:.5 E5:.5 F5:1 E5:1 | D5:1", "melody", B, 0.8);- const low = L(0, "D3:2 A2:2 | G2:2 D3:2 | D3:2 A2:2 | D3:1", "bass", B, 0.7);+ const hook = L(0, "r:1 A5:.5 C6:.5 D6:1 C6:.5 A5:.5 | B5:1.5 G5:.5 A5:1 r:1 | F5:.5 E5:.5 D5:.5 E5:.5 F5:1 E5:1 | D5:1 r:3", "melody", B, 0.8);+ const low = L(0, "D3:2 A2:2 | G2:2 D3:2 | D3:2 A2:2 | D3:1 r:3", "bass", B, 0.7);return {title: "Marimba, curious (D dorian)", seed: 404, tail: 1.2, harmony: H([[0, "Dm"], [4, "G/D"], [8, "Dm"], [12, "Dm"]]),plan: { style: "minimalist", tempo: 108, meter: "4/4", ritard: 0.9, sections: [{ id: "a", bars: 4, mood: "curious", key: "D", mode: "dorian", melody: ["ostinato", "hook"], dyn: [0.65, 0.72], ending: "button", repeatable: true }] },@@ -22,7 +22,7 @@ export const marimbaCurious = (): Piece => {{ id: "ostinato", inst: "marimba", role: "accomp", notes: ost, gainDb: -3 },{ id: "hook", inst: "marimba", role: "melody", notes: hook, gainDb: 1 },{ id: "low", inst: "marimba", role: "bass", notes: low, gainDb: -1 },- { id: "halo", inst: "vibes", role: "color", notes: L(0, "[F4 A4 E5]:4 | [G4 B4 E5]:4 | [F4 A4 E5]:4 | [F4 A4 D5]:1", "color", B, 0.35), gainDb: -12, opts: { trem: 4.5 } },+ { id: "halo", inst: "vibes", role: "color", notes: L(0, "[F4 A4 E5]:4 | [G4 B4 E5]:4 | [F4 A4 E5]:4 | [F4 A4 D5]:1 r:3", "color", B, 0.35), gainDb: -12, opts: { trem: 4.5 } },],};};@@ -42,8 +42,8 @@ export const harpTender = (): Piece => {/** Guitar (Karplus-Strong), WISTFUL. E dorian fingerpicking, Em - A (the dorian IV) - Em, 4/4 at 84. */export const guitarWistful = (): Piece => {const B = 4;- const pick = L(0, "E2:.5 G3:.5 B3:.5 E4:.5 B2:.5 G3:.5 B3:.5 E4:.5 | A2:.5 E3:.5 C#4:.5 E4:.5 E2:.5 E3:.5 A3:.5 C#4:.5 | [E2 B2 E3 G3 B3 F#4]:1", "accomp", B, 0.55, { roll: 0.022 });- const mel = L(0, "B4:1.5 A4:.5 G4:1 F#4:1 | E4:1 C#5:1.5 B4:.5 A4:1 | B4:1", "melody", B, 0.8);+ const pick = L(0, "E2:.5 G3:.5 B3:.5 E4:.5 B2:.5 G3:.5 B3:.5 E4:.5 | A2:.5 E3:.5 C#4:.5 E4:.5 E2:.5 E3:.5 A3:.5 C#4:.5 | [E2 B2 E3 G3 B3 F#4]:1 r:3", "accomp", B, 0.55, { roll: 0.022 });+ const mel = L(0, "B4:1.5 A4:.5 G4:1 F#4:1 | E4:1 C#5:1.5 B4:.5 A4:1 | B4:1 r:3", "melody", B, 0.8);return {title: "Guitar, wistful (E dorian)", seed: 77, tail: 2.0, harmony: H([[0, "Em"], [4, "A"], [8, "Em9"]]),plan: { style: "folk", tempo: 84, meter: "4/4", ritard: 0.8, sections: [{ id: "a", bars: 3, mood: "wistful", key: "E", mode: "dorian", melody: ["stepwise"], dyn: [0.6, 0.55], ending: "tail", repeatable: true }] },@@ -66,8 +66,8 @@ export const celestaWonder = (): Piece => {/** FM bell over FM e-piano, HOPEFUL. C major IV-V-vi-V/3 -> I, the bell line climbing in sequence A5 B5 C6 D6 -> E6. 4/4 at 100. */export const bellsHopeful = (): Piece => {const B = 4;- const bell = L(0, "C5:.5 F5:.5 A5:1 D5:.5 G5:.5 B5:1 | E5:.5 A5:.5 C6:1 D5:.5 G5:.5 D6:1 | E6:2", "melody", B, 0.75);- const keys = L(0, "[F3 A3 C4 E4]:2 [G3 B3 D4]:2 | [A3 C4 E4]:2 [B2 D4 G4]:2 | [C3 G3 C4 E4]:2", "accomp", B, 0.6, { roll: 0.02 });+ const bell = L(0, "C5:.5 F5:.5 A5:1 D5:.5 G5:.5 B5:1 | E5:.5 A5:.5 C6:1 D5:.5 G5:.5 D6:1 | E6:2 r:2", "melody", B, 0.75);+ const keys = L(0, "[F3 A3 C4 E4]:2 [G3 B3 D4]:2 | [A3 C4 E4]:2 [B2 D4 G4]:2 | [C3 G3 C4 E4]:2 r:2", "accomp", B, 0.6, { roll: 0.02 });return {title: "Bells and e-piano, hopeful (C major)", seed: 31, tail: 2.6, harmony: H([[0, "Fmaj7"], [2, "G"], [4, "Am"], [6, "G/B"], [8, "C"]]),plan: { style: "cinematic", tempo: 100, meter: "4/4", ritard: 0.85, sections: [{ id: "a", bars: 3, mood: "hopeful", key: "C", mode: "major", melody: ["sequence"], dyn: [0.5, 0.8], ending: "tail", repeatable: true }] },@@ -78,11 +78,11 @@ export const bellsHopeful = (): Piece => {/** Drive / electronic, DRIVE. A minor i-VI-III-VII at 128: pluck arps and 8th bass from bar 1, the lead hook drops in at bar 3, a stab button. */export const driveElectronic = (): Piece => {const B = 4, a16 = (x: string) => rep(x.split(" ").map((n) => `${n}:.25`).join(" "), 4);- const pluckL = L(0, [a16("A4 C5 E5 A5"), a16("F4 A4 C5 F5"), a16("E4 G4 C5 E5"), a16("D4 G4 B4 D5"), "[A4 C5 E5]:.5"].join(" | "), "accomp", B, 0.6);- const bassL = L(0, [rep("A1:.5 A2:.5", 4), rep("F1:.5 F2:.5", 4), rep("C2:.5 C3:.5", 4), rep("G1:.5 G2:.5", 4), "A1:.5"].join(" | "), "bass", B, 0.85);- const lead = L(8, "E5:.75 D5:.25 C5:.5 E5:.5 G5:1.5 E5:.5 | D5:.75 C5:.25 B4:.5 D5:.5 G5:1 B4:1 | A5:.5", "melody", B, 0.8);+ const pluckL = L(0, [a16("A4 C5 E5 A5"), a16("F4 A4 C5 F5"), a16("E4 G4 C5 E5"), a16("D4 G4 B4 D5"), "[A4 C5 E5]:.5 r:3.5"].join(" | "), "accomp", B, 0.6);+ const bassL = L(0, [rep("A1:.5 A2:.5", 4), rep("F1:.5 F2:.5", 4), rep("C2:.5 C3:.5", 4), rep("G1:.5 G2:.5", 4), "A1:.5 r:3.5"].join(" | "), "bass", B, 0.85);+ const lead = L(8, "E5:.75 D5:.25 C5:.5 E5:.5 G5:1.5 E5:.5 | D5:.75 C5:.25 B4:.5 D5:.5 G5:1 B4:1 | A5:.5 r:3.5", "melody", B, 0.8);const pad = L(0, "[A3 C4 E4]:4 | [F3 A3 C4]:4 | [G3 C4 E4]:4 | [G3 B3 D4]:4", "color", B, 0.45);- const kick = L(0, [rep("C4:1", 4), rep("C4:1", 4), rep("C4:1", 4), rep("C4:1", 4), "C4:.5"].join(" | "), "drum", B, 0.9);+ const kick = L(0, [rep("C4:1", 4), rep("C4:1", 4), rep("C4:1", 4), rep("C4:1", 4), "C4:.5 r:3.5"].join(" | "), "drum", B, 0.9);const clap = L(0, "r:1 C4:1 r:1 C4:1 | r:1 C4:1 r:1 C4:1 | r:1 C4:1 r:1 C4:1 | r:1 C4:1 r:1 C4:.5 C4:.5", "drum", B, 0.7);const hats = L(0, [1, 2, 3, 4].map(() => rep("r:.5 C4:.5", 4)).join(" | "), "drum", B, 0.7, { kind: "o" });return {diff --git a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/pieces/samplers.ts b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/pieces/samplers.tsindex 75794c4..ae66ae8 100644--- a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/pieces/samplers.ts+++ b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/pieces/samplers.ts@@ -9,13 +9,13 @@ const H = (xs: [number, string][]) => xs.map(([t, name]) => ({ t, name }));export const musicBoxJoy = (): Piece => {const B = 4;// melody: the hook is a long-short-short skip (F#-A-B-A); bar 2 repeats its rhythm a fourth up, bar 3 answers on the dominant- const melody = L(0, "F#5:1 A5:2/3 B5:1/3 A5:1 F#5:1 | B5:1 D6:2/3 B5:1/3 G5:2 | A5:1 B5:2/3 A5:1/3 E5:1 C#6:1 | D6:1", "melody", B, 0.75);+ const melody = L(0, "F#5:1 A5:2/3 B5:1/3 A5:1 F#5:1 | B5:1 D6:2/3 B5:1/3 G5:2 | A5:1 B5:2/3 A5:1/3 E5:1 C#6:1 | D6:1 r:3", "melody", B, 0.75);// rolling 1-5-3-5 arpeggio on the triplets (4-note cell over 3-note groups: a gentle hemiola)const arpBar = (r: string, f: string, t: string) => Array.from({ length: 12 }, (_, i) => `${[r, f, t, f][i % 4]}:1/3`).join(" ");- const arp = L(0, [arpBar("D5", "A5", "F#5"), arpBar("D5", "G5", "B5"), arpBar("C#5", "A5", "E5"), "D5:1/3 A5:1/3 F#5:1/3"].join(" | "), "accomp", B, 0.5); // up an octave: brightness- const bassL = L(0, "D3:2 F#3:2 | G3:2 D3:2 | E3:2 C#3:2 | D3:1", "bass", B, 0.62); // the recipe's bass register, C3-G3- const sparkle = L(8, "A6:1 B6:2/3 A6:1/3 E6:1 C#7:1 | D7:1", "color", B, 0.3);- const bell = L(12, "D6:1", "color", B, 0.8);+ const arp = L(0, [arpBar("D5", "A5", "F#5"), arpBar("D5", "G5", "B5"), arpBar("C#5", "A5", "E5"), "D5:1/3 A5:1/3 F#5:1/3 r:3"].join(" | "), "accomp", B, 0.5); // up an octave: brightness+ const bassL = L(0, "D3:2 F#3:2 | G3:2 D3:2 | E3:2 C#3:2 | D3:1 r:3", "bass", B, 0.62); // the recipe's bass register, C3-G3+ const sparkle = L(8, "A6:1 B6:2/3 A6:1/3 E6:1 C#7:1 | D7:1 r:3", "color", B, 0.3);+ const bell = L(12, "D6:1 r:3", "color", B, 0.8);return {title: "Music box, joy", seed: 7, tail: 2,harmony: H([[0, "D"], [4, "G"], [8, "A"], [12, "D"]]),@@ -49,8 +49,8 @@ export const minorPianoMelancholy = (): Piece => {export const cinematicAwe = (): Piece => {const B = 4;// strings: Cadd9 -> D/C (the lydian #4, F#, in the top voice) -> E major held through the arrival- const hi = [...L(0, "[C4 G4 D5 E5]:4 | [D4 A4 F#5]:2", "accomp", B, 0.7), ...L(6, "[E4 B4 E5 G#5]:4", "accomp", B, 0.7)];- const low = [...L(0, "[C2 C3]:4 | [C2 C3]:2", "bass", B, 0.7), ...L(6, "[E2 E3]:4", "bass", B, 0.7)];+ const hi = [...L(0, "[C4 G4 D5 E5]:4 | [D4 A4 F#5]:2 r:2", "accomp", B, 0.7), ...L(6, "[E4 B4 E5 G#5]:4", "accomp", B, 0.7)];+ const low = [...L(0, "[C2 C3]:4 | [C2 C3]:2 r:2", "bass", B, 0.7), ...L(6, "[E2 E3]:4", "bass", B, 0.7)];// harp shimmer: rising eighths over the swell; the piano rolls the arrival chord wideconst shimmer = L(0, "C5:.5 G5:.5 D6:.5 E6:.5 G6:.5 E6:.5 D6:.5 G5:.5 | D5:.5 A5:.5 E6:.5 F#6:.5 B6:.5 G#6:.5 E6:.5 B5:.5", "color", B, 0.55);const arrival = L(6, "[E1 E2 B2 G#3 E4]:2", "bass", B, 0.85, { roll: 0.05 });@@ -72,13 +72,13 @@ export const cinematicAwe = (): Piece => {/** Chiptune, PLAYFUL. C major, 4/4 at 140. Call (bar 1, high) and response (bar 2, low); 16th arps fake the chords; 4 voices. */export const chiptunePlayful = (): Piece => {const B = 4;- const lead = L(0, "E5:.5 G5:.5 C6:.75 B5:.25 C6:.5 G5:.5 E5:1 | A4:.5 C5:.5 E5:.5 A5:.5 G5:1 E5:1 | F5:.5 A5:.5 C6:.75 B5:.25 A5:.5 F5:.5 D5:1 | G5:.5 B5:.5 D6:.5 B5:.5 G5:.5 A5:.25 B5:.25 r:1 | C6:1.5", "melody", B, 0.85);+ const lead = L(0, "E5:.5 G5:.5 C6:.75 B5:.25 C6:.5 G5:.5 E5:1 | A4:.5 C5:.5 E5:.5 A5:.5 G5:1 E5:1 | F5:.5 A5:.5 C6:.75 B5:.25 A5:.5 F5:.5 D5:1 | G5:.5 B5:.5 D6:.5 B5:.5 G5:.5 A5:.25 B5:.25 r:1 | C6:1.5 r:2.5", "melody", B, 0.85);const arp16 = (a: string, b: string, c: string, d: string) => Array.from({ length: 16 }, (_, i) => `${[a, b, c, d][i % 4]}:.25`).join(" ");- const arps = L(0, [arp16("C4", "E4", "G4", "C5"), arp16("A3", "C4", "E4", "A4"), arp16("F3", "A3", "C4", "F4"), arp16("G3", "B3", "D4", "G4"), "C4:.25 E4:.25 G4:.25 C5:.25"].join(" | "), "accomp", B, 0.55);+ const arps = L(0, [arp16("C4", "E4", "G4", "C5"), arp16("A3", "C4", "E4", "A4"), arp16("F3", "A3", "C4", "F4"), arp16("G3", "B3", "D4", "G4"), "C4:.25 E4:.25 G4:.25 C5:.25 r:3"].join(" | "), "accomp", B, 0.55);const oct = (a: string, b: string) => Array.from({ length: 8 }, (_, i) => `${i % 2 ? b : a}:.5`).join(" ");- const tri = L(0, [oct("C2", "C3"), oct("A1", "A2"), oct("F2", "F3"), oct("G2", "G3"), "C2:1.5"].join(" | "), "bass", B, 1);- const kick = L(0, "C4:1 r:1 C4:.5 C4:.5 r:1 | C4:1 r:1 C4:1 r:1 | C4:1 r:1 C4:.5 C4:.5 r:1 | C4:1 r:1 C4:1 r:1 | C4:1", "drum", B, 0.9, { kind: "k" });- const snare = L(0, "r:1 C4:1 r:1 C4:1 | r:1 C4:1 r:1 C4:1 | r:1 C4:1 r:1 C4:1 | r:1 C4:1 r:1 C4:.25 C4:.25 C4:.25 C4:.25 | C4:1.5", "drum", B, 0.75, { kind: "s" });+ const tri = L(0, [oct("C2", "C3"), oct("A1", "A2"), oct("F2", "F3"), oct("G2", "G3"), "C2:1.5 r:2.5"].join(" | "), "bass", B, 1);+ const kick = L(0, "C4:1 r:1 C4:.5 C4:.5 r:1 | C4:1 r:1 C4:1 r:1 | C4:1 r:1 C4:.5 C4:.5 r:1 | C4:1 r:1 C4:1 r:1 | C4:1 r:3", "drum", B, 0.9, { kind: "k" });+ const snare = L(0, "r:1 C4:1 r:1 C4:1 | r:1 C4:1 r:1 C4:1 | r:1 C4:1 r:1 C4:1 | r:1 C4:1 r:1 C4:.25 C4:.25 C4:.25 C4:.25 | C4:1.5 r:2.5", "drum", B, 0.75, { kind: "s" });const hats = L(0, [..."1234"].map(() => Array.from({ length: 8 }, () => "C4:.5").join(" ")).join(" | "), "drum", B, 0.6, { kind: "h" });return {title: "Chiptune, playful", seed: 1985, tail: 1.1,@@ -96,13 +96,13 @@ export const chiptunePlayful = (): Piece => {/** Lo-fi e-piano, NOSTALGIC. F major, 4/4 at 80, swing 58 %. Fmaj9 - Dm9 | Bbmaj7 - C9sus | Fmaj9. */export const lofiNostalgic = (): Piece => {const B = 4;- const chords = L(0, "[A3 C4 E4 G4]:1.5 [A3 C4 E4 G4]:.5 [F3 A3 C4 E4]:2 | [A3 D4 F4]:1.5 [A3 D4 F4]:.5 [Bb3 D4 E4 G4]:2 | [A3 C4 E4 G4]:3", "accomp", B, 0.62, { roll: 0.018 });- const melody = L(0, "r:.5 C5:.5 E5:1 D5:.5 C5:.5 A4:1 | r:.5 F5:.5 D5:1 E5:.5 D5:.5 C5:1 | A4:3", "melody", B, 0.72);- const bassL = L(0, "F2:1.5 F2:.5 D2:2 | Bb1:1.5 Bb1:.5 C2:2 | F2:3", "bass", B, 0.8);- const kick = L(0, "C4:1 r:1.5 C4:1 r:.5 | C4:1 r:1.5 C4:1 r:.5 | C4:1", "drum", B, 0.8);- const rim = L(0, "r:1 C4:1 r:1 C4:1 | r:1 C4:1 r:1 C4:1 | r:1", "drum", B, 0.6);- const hats = L(0, "C4:.5@1 C4:[email protected] C4:.5@1 C4:[email protected] C4:.5@1 C4:[email protected] C4:.5@1 C4:[email protected] | C4:.5@1 C4:[email protected] C4:.5@1 C4:[email protected] C4:.5@1 C4:[email protected] C4:.5@1 C4:[email protected] | C4:.5", "drum", B, 0.55);- const crackle = L(0, "C4:4 | C4:4 | C4:3", "color", B, 1);+ const chords = L(0, "[A3 C4 E4 G4]:1.5 [A3 C4 E4 G4]:.5 [F3 A3 C4 E4]:2 | [A3 D4 F4]:1.5 [A3 D4 F4]:.5 [Bb3 D4 E4 G4]:2 | [A3 C4 E4 G4]:3 r:1", "accomp", B, 0.62, { roll: 0.018 });+ const melody = L(0, "r:.5 C5:.5 E5:1 D5:.5 C5:.5 A4:1 | r:.5 F5:.5 D5:1 E5:.5 D5:.5 C5:1 | A4:3 r:1", "melody", B, 0.72);+ const bassL = L(0, "F2:1.5 F2:.5 D2:2 | Bb1:1.5 Bb1:.5 C2:2 | F2:3 r:1", "bass", B, 0.8);+ const kick = L(0, "C4:1 r:1.5 C4:1 r:.5 | C4:1 r:1.5 C4:1 r:.5 | C4:1 r:3", "drum", B, 0.8);+ const rim = L(0, "r:1 C4:1 r:1 C4:1 | r:1 C4:1 r:1 C4:1 | r:4", "drum", B, 0.6);+ const hats = L(0, "C4:.5@1 C4:[email protected] C4:.5@1 C4:[email protected] C4:.5@1 C4:[email protected] C4:.5@1 C4:[email protected] | C4:.5@1 C4:[email protected] C4:.5@1 C4:[email protected] C4:.5@1 C4:[email protected] C4:.5@1 C4:[email protected] | C4:.5 r:3.5", "drum", B, 0.55);+ const crackle = L(0, "C4:4 | C4:4 | C4:3 r:1", "color", B, 1);return {title: "Lo-fi, nostalgic", seed: 1978, tail: 2.2,harmony: H([[0, "Fmaj9"], [2, "Dm9"], [4, "Bbmaj7"], [6, "C9sus"], [8, "Fmaj9"]]),diff --git a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/plan.ts b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/plan.tsindex 6b911a0..c7fd979 100644--- a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/plan.ts+++ b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/plan.ts@@ -37,10 +37,15 @@ export type Piece = { title: string; plan: MusicPlan; parts: Part[]; harmony: Ch// ---------------------------------------------------------------- notation// "Eb4:1 | C5:2 Bb4:.5 Ab4:.5 | [Ab2 Eb3]:1 r:2 | G5:1/[email protected] ..." ; a token is NOTE:DUR[@VEL] or-// [CHORD]:DUR[@VEL] or r:DUR. Every complete bar must sum to the meter: a wrong bar throws.+// [CHORD]:DUR[@VEL] or r:DUR. Every bar must sum to the meter, the last one too (a line that ends+// mid-bar writes its rest: "C2:3 r:1"): a wrong bar throws, so a gap is always written, never+// silent. The first bar may instead be a declared `pickup`, or, when the line starts off the+// barline, exactly the beats left to the next barline. A `hit` (a ping, a sting placed on any beat)+// is one bar no longer than the meter, said out loud with `hit: true`.const dur = (s: string) => { if (s.includes("/")) { const [a, b] = s.split("/").map(Number); return a / b; } return Number(s); };-export const line = (start: number, src: string, o: { role: Role; v?: number; bpb: number; pickup?: number; roll?: number; kind?: string }): Note[] => {+export const line = (start: number, src: string, o: { role: Role; v?: number; bpb: number; pickup?: number; roll?: number; kind?: string; hit?: boolean }): Note[] => {const out: Note[] = []; let t = start; const bars = src.split("|").map((b) => b.trim()).filter((b, i, a) => b.length || (i > 0 && i < a.length - 1));+ if (o.hit && bars.length !== 1) throw new Error(`a hit is one bar, got ${bars.length}: "${src}"`);bars.forEach((bar, bi) => {let sum = 0;for (const tok of bar.split(/\s+(?![^\[]*\])/).filter(Boolean)) {@@ -52,9 +57,9 @@ export const line = (start: number, src: string, o: { role: Role; v?: number; bp}t += d; sum += d;}- const first = bi === 0, last = bi === bars.length - 1;- const ok = Math.abs(sum - o.bpb) < 1e-6 || (first && o.pickup !== undefined && Math.abs(sum - o.pickup) < 1e-6) || (last && sum <= o.bpb + 1e-6);- if (!ok) throw new Error(`bar ${bi} sums to ${sum} beats, meter wants ${o.bpb}: "${bar}"`);+ const first = bi === 0, toBarline = o.bpb - (((start % o.bpb) + o.bpb) % o.bpb);+ const ok = Math.abs(sum - o.bpb) < 1e-6 || (first && o.pickup !== undefined && Math.abs(sum - o.pickup) < 1e-6) || (first && toBarline < o.bpb - 1e-6 && Math.abs(sum - toBarline) < 1e-6) || (o.hit === true && sum <= o.bpb + 1e-6);+ if (!ok) throw new Error(`bar ${bi} sums to ${+sum.toFixed(4)} beats, meter wants ${o.bpb}: "${bar}"${sum < o.bpb && bi === bars.length - 1 ? ` (a line that ends mid-bar writes its rest: "${bar} r:${+(o.bpb - sum).toFixed(4)}")` : ""}`);});return out;};diff --git a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/render.ts b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/render.tsindex d14a4fb..f9fa296 100644--- a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/render.ts+++ b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/render.ts@@ -141,8 +141,8 @@ export const measureStems = (piece: Piece, sr: number, o: RenderOpts = {}, tolDbreturn stemBalance(r.stems, piece.stemTargets ?? {}, tolDb);};-/** Look-ahead peak limiter (1.5 ms look-ahead, 120 ms release), used by dense styles only. */-const limiter = (L: Float32Array, R: Float32Array, sr: number, ceil: number) => {+/** Look-ahead peak limiter (1.5 ms look-ahead, 120 ms release), used by dense styles only; `ceil` is linear. */+export const limiter = (L: Float32Array, R: Float32Array, sr: number, ceil: number) => {const n = L.length, la = Math.round(0.0015 * sr), rel = Math.exp(-1 / (0.12 * sr)), need = new Float32Array(n);for (let i = 0; i < n; i++) { const a = Math.max(Math.abs(L[i]), Math.abs(R[i])) * 1.12; need[i] = a > ceil ? ceil / a : 1; } // 1.12: inter-sample marginconst g = new Float32Array(n); let cur = 1;diff --git a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/sfxMix.ts b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/sfxMix.tsindex aa75d4a..d756727 100644--- a/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/sfxMix.ts+++ b/plugins/anidoodle/skills/anidoodle/engine/src/canvas-core/music/sfxMix.ts@@ -11,7 +11,7 @@ import { loudness, truePeak } from "./meter";export type SfxSnap = "none" | "bar" | "beat" | "8th" | "16th";export type SfxCue = SfxOpts & {- /** the frame the sound's sync point lands on (the hit; the pass-by of a whoosh; the END of a riser). */+ /** the whole frame the sound's sync point lands on (the hit; the pass-by of a whoosh; the END of a riser). A fractional frame throws. */frame: number; kind: SfxKind; label?: string;/** snap the sync point to the beat grid (needs plan.bpm). Default: plan.snap ?? "none". */snap?: SfxSnap;@@ -64,6 +64,7 @@ export const validateSfxPlan = (plan: SfxPlan) => {if (!c || typeof c !== "object") throw new Error(`sfx plan: cue #${i} is not an object`);if (!(c.kind in SFX)) throw new Error(`sfx plan: cue #${i} has unknown kind "${String(c.kind)}" (kinds: ${SFX_KINDS.join(", ")})`);if (typeof c.frame !== "number" || !Number.isFinite(c.frame) || c.frame < 0 || c.frame >= p.frames) throw new Error(`sfx plan: ${name(c, i)}: frame must be 0..${p.frames - 1}`);+ if (!Number.isInteger(c.frame)) throw new Error(`sfx plan: ${name(c, i)}: frame must be a whole frame (cues are addressed by the frame the picture shows; for a hit between frames, snap it to the beat grid)`);const snap = c.snap ?? p.snap ?? "none";if (!(snap === "none" || snap in GRID)) throw new Error(`sfx plan: ${name(c, i)}: snap must be none|bar|beat|8th|16th`);if ((snap !== "none" || c.beats !== undefined) && p.bpm === undefined && c.bpm === undefined) throw new Error(`sfx plan: ${name(c, i)}: snap/beats need a bpm (plan.bpm)`);diff --git a/plugins/anidoodle/skills/anidoodle/engine/styles.gen.json b/plugins/anidoodle/skills/anidoodle/engine/styles.gen.jsonindex b811370..84f057e 100644--- a/plugins/anidoodle/skills/anidoodle/engine/styles.gen.json+++ b/plugins/anidoodle/skills/anidoodle/engine/styles.gen.json@@ -8,7 +8,6 @@"hero": "a hot-air balloon","module": "engine/src/canvas-core/balloon.ts","drawFilm": "balloonDraw",- "samples": "anidoodle-research/samples/balloon/","source": "legacy"},{@@ -20,7 +19,6 @@"hero": "a watch movement's going train, plan and section A-A","module": "engine/src/canvas-core/blueprint.ts","drawFilm": "blueprint",- "samples": "anidoodle-research/samples/blueprint/","source": "scanned"},{@@ -32,7 +30,6 @@"hero": "a small harbour at sunrise","module": "engine/src/canvas-core/brokenColour.ts","drawFilm": "brokenColour",- "samples": "anidoodle-research/samples/brokenColour/","source": "scanned"},{@@ -44,7 +41,6 @@"hero": "one oak through four seasons on one sheet","module": "engine/src/canvas-core/charcoalErasure.ts","drawFilm": "charcoalErasure",- "samples": "anidoodle-research/samples/charcoalErasure/","source": "scanned"},{@@ -56,7 +52,6 @@"hero": "a wind-up tin robot mending a music box while a crow steals a screw","module": "engine/src/canvas-core/colouredPencil.ts","drawFilm": "colouredPencil",- "samples": "anidoodle-research/samples/colouredPencil/","source": "scanned"},{@@ -68,7 +63,6 @@"hero": "a botanical wreath with a honeybee","module": "engine/src/canvas-core/embroidery.ts","drawFilm": "embroidery",- "samples": "anidoodle-research/samples/embroidery/","source": "scanned"},{@@ -80,7 +74,6 @@"hero": "a regatta of small sailboats on a bay under hills, the leader rounding the mark","module": "engine/src/canvas-core/flatVector.ts","drawFilm": "flatVector",- "samples": "anidoodle-research/samples/flatVector/","source": "scanned"},{@@ -92,7 +85,6 @@"hero": "a boy carrying a rooster through a village kitchen garden at the edge of a birch wood","module": "engine/src/canvas-core/folkTale.ts","drawFilm": "folkTale",- "samples": "anidoodle-research/samples/folkTale/","source": "scanned"},{@@ -104,7 +96,6 @@"hero": "a fox at dusk","module": "engine/src/canvas-core/fox.ts","drawFilm": "foxDraw",- "samples": "anidoodle-research/samples/fox/","source": "legacy"},{@@ -116,7 +107,6 @@"hero": "a steam train crossing a stone viaduct at golden hour","module": "engine/src/canvas-core/halftone.ts","drawFilm": "halftone",- "samples": "anidoodle-research/samples/halftone/","source": "scanned"},{@@ -128,7 +118,6 @@"hero": "a two-floor bakery cutaway at night, lit by its oven, the baker turning with a fresh loaf","module": "engine/src/canvas-core/isometric.ts","drawFilm": "isometric",- "samples": "anidoodle-research/samples/isometric/","source": "scanned"},{@@ -140,7 +129,6 @@"hero": "a Sanke koi turning under lily pads","module": "engine/src/canvas-core/koi.ts","drawFilm": "koiDraw",- "samples": "anidoodle-research/samples/koi/","source": "legacy"},{@@ -152,7 +140,6 @@"hero": "a lighthouse at sunset","module": "engine/src/canvas-core/lighthouse.ts","drawFilm": "lighthouseDraw",- "samples": "anidoodle-research/samples/lighthouse/","source": "legacy"},{@@ -164,7 +151,6 @@"hero": "A mountain lake at dawn: pink-lit range, spruce shores, a red canoe, reflections","module": "engine/src/canvas-core/lowPoly.ts","drawFilm": "lowPoly",- "samples": "anidoodle-research/samples/lowPoly/","source": "scanned"},{@@ -176,7 +162,6 @@"hero": "a moon spiralled out of one line","module": "engine/src/canvas-core/mellan.ts","drawFilm": "mellanUnspool",- "samples": "anidoodle-research/samples/mellan/","source": "legacy"},{@@ -188,7 +173,6 @@"hero": "a hillside village where a girl flies a kite","module": "engine/src/canvas-core/midCentury.ts","drawFilm": "midCentury",- "samples": "anidoodle-research/samples/midCentury/","source": "scanned"},{@@ -200,7 +184,6 @@"hero": "the phases of the moon","module": "engine/src/canvas-core/moonPhases.ts","drawFilm": "moonPhasesDraw",- "samples": "anidoodle-research/samples/moonPhases/","source": "legacy"},{@@ -212,7 +195,6 @@"hero": "two pears and a copper pot by a window","module": "engine/src/canvas-core/paintedOil.ts","drawFilm": "paintedOil",- "samples": "anidoodle-research/samples/paintedOil/","source": "scanned"},{@@ -224,7 +206,6 @@"hero": "A seaside town on a toy-theatre stage: sea rows, harbour houses, a newspaper boat, a sun on a stick","module": "engine/src/canvas-core/paperCraft.ts","drawFilm": "paperCraft",- "samples": "anidoodle-research/samples/paperCraft/","source": "scanned"},{@@ -236,7 +217,6 @@"hero": "a cat mid-pounce after fireflies in a moonlit garden","module": "engine/src/canvas-core/pixelArt.ts","drawFilm": "pixelArt",- "samples": "anidoodle-research/samples/pixelArt/","source": "scanned"},{@@ -248,7 +228,6 @@"hero": "a pocket watch lying on a table","module": "engine/src/canvas-core/pocketWatch.ts","drawFilm": "pocketWatchDraw",- "samples": "anidoodle-research/samples/pocketWatch/","source": "legacy"},{@@ -260,7 +239,6 @@"hero": "a ranunculus in bloom","module": "engine/src/canvas-core/ranunculus.ts","drawFilm": "ranunculusDraw",- "samples": "anidoodle-research/samples/ranunculus/","source": "legacy"},{@@ -272,7 +250,6 @@"hero": "a coffee pot mid-dance-step on a kitchen counter, steam curling","module": "engine/src/canvas-core/rubberHose.ts","drawFilm": "rubberHose",- "samples": "anidoodle-research/samples/rubberHose/","source": "scanned"},{@@ -284,7 +261,6 @@"hero": "How a honeybee finds flowers: the forager, the rose, the waggle dance, the evidence","module": "engine/src/canvas-core/scrapbook.ts","drawFilm": "scrapbook",- "samples": "anidoodle-research/samples/scrapbook/","source": "scanned"},{@@ -296,7 +272,6 @@"hero": "a lynx, head and shoulders, in moonlight","module": "engine/src/canvas-core/scratchboard.ts","drawFilm": "scratchboard",- "samples": "anidoodle-research/samples/scratchboard/","source": "scanned"},{@@ -308,7 +283,6 @@"hero": "a nautilus shell sawn in half, chambers lit from the upper left, cast shadow in dots","module": "engine/src/canvas-core/stipple.ts","drawFilm": "stipple",- "samples": "anidoodle-research/samples/stipple/","source": "scanned"},{@@ -320,7 +294,6 @@"hero": "Bit, waving, in storybook pencil and watercolour","module": "engine/src/canvas-core/storybook.ts","drawFilm": "storybookDraw",- "samples": "anidoodle-research/samples/storybook/","source": "legacy"},{@@ -332,7 +305,6 @@"hero": "bamboo in wind with a tree sparrow","module": "engine/src/canvas-core/sumiE.ts","drawFilm": "sumiE",- "samples": "anidoodle-research/samples/sumiE/","source": "scanned"},{@@ -344,7 +316,6 @@"hero": "a brick-built harbour tugboat on a baseplate","module": "engine/src/canvas-core/toyBrick.ts","drawFilm": "toyBrick",- "samples": "anidoodle-research/samples/toyBrick/","source": "scanned"},{@@ -356,7 +327,6 @@"hero": "two grey herons in rain on a wooden drum bridge","module": "engine/src/canvas-core/woodcut.ts","drawFilm": "woodcut",- "samples": "anidoodle-research/samples/woodcut/","source": "scanned"},{@@ -368,7 +338,6 @@"hero": "a wren","module": "engine/src/canvas-core/wren.ts","drawFilm": "wrenDraw",- "samples": "anidoodle-research/samples/wren/","source": "legacy"}]diff --git a/plugins/anidoodle/skills/anidoodle/engine/test/launchTemplate.test.ts b/plugins/anidoodle/skills/anidoodle/engine/test/launchTemplate.test.tsindex 446e5d6..4955006 100644--- a/plugins/anidoodle/skills/anidoodle/engine/test/launchTemplate.test.ts+++ b/plugins/anidoodle/skills/anidoodle/engine/test/launchTemplate.test.ts@@ -2,7 +2,7 @@// compose.md writes) or a Piece. anidoodle's own pieces are refused by identity, by title and by// content, so a retitled or transposed copy of our launch score cannot ship as a user's film.import { makeLaunchFilm } from "../src/canvas-core/launchTemplate";-import { chiptunePlayful, daylightCopy, launchLofi3, launchLofi3Material, type Material } from "../src/canvas-core/music";+import { chiptunePlayful, composePiece, daylightCopy, filmAudio, fitScore, launchLofi3, launchLofi3Material, loudness, perform, truePeak, type Material } from "../src/canvas-core/music";import type { Film } from "../src/canvas-core/film";export const name = "launchTemplate";@@ -26,4 +26,24 @@ export const run = (ok: (cond: boolean, label: string) => void) => {ok(refused(() => ({ ...launchLofi3Material(), title: "Mine" })), "refuses retitled launch material");ok(refused(daylightCopy), "refuses the transposed copy of our launch score (the Daylight fixture)");ok(refused(undefined, /required/), "a missing score is an error, never a default");++ // The bed is the score FITTED to the film (fitScore via filmAudio), never the first N seconds cut+ // and faded: it is filmAudio's render exactly, times one gain, and its last note lands so the tail+ // rings out on the last frame.+ const two = { ...base, asks: [base.asks[0], { prompt: "again", plate, label: "l" }], askBeats: 16, endBeats: 12, score: mine };+ const bedFilm = makeLaunchFilm(two), secs = bedFilm.meta.durationFrames / bedFilm.meta.fps, SR = 16000;+ const [L, R] = bedFilm.audio!(SR), [fL] = filmAudio(composePiece(mine()), secs)(SR);+ let k = 0; for (let i = 0; i < fL.length; i++) if (Math.abs(fL[i]) > Math.abs(fL[k])) k = i;+ const g = L[k] / fL[k]; let dev = 0; for (let i = 0; i < L.length; i++) dev = Math.max(dev, Math.abs(L[i] - g * fL[i]));+ ok(L.length === Math.round(secs * SR) && dev < 1e-5, `the bed is filmAudio (fitScore) at one gain, exactly the film's ${secs} s (max deviation ${dev.toExponential(1)})`);+ const sc = bedFilm.meta.score, f = fitScore(composePiece(mine()), secs), end = perform(f.piece, f.tempo, { expressive: true }).lastOnset + f.piece.tail;+ ok(!!sc && sc.form === f.form && Math.abs(sc.tempo - f.tempo) < 1e-9, `meta.score reports the fit (${sc?.tempo.toFixed(1)} bpm, ${sc?.form}) for render to print beside the grid's 120 bpm`);+ ok(f.piece.arrangement?.at(-1)?.kind === "outro" && Math.abs(end - secs) < 0.25, `it ends on its outro: last note + tail = ${end.toFixed(2)} s of ${secs} s`);+ const lu = loudness([L, R], SR).integrated, tp = truePeak([L, R]).dbtp;+ ok(tp <= -0.99 && (Math.abs(lu + 14) < 0.3 || tp > -1.05), `bed at -14 LUFS or held by the -1 dBTP ceiling (${lu.toFixed(2)} LUFS, ${tp.toFixed(2)} dBTP)`);+ // a dynamic bed stops at the peak ceiling; limit: true lets the limiter take those peaks instead+ const long = { ...two, askBeats: 24, endBeats: 16 }, [cL, cR] = makeLaunchFilm(long).audio!(SR), [lL, lR] = makeLaunchFilm({ ...long, limit: true }).audio!(SR);+ const cu = loudness([cL, cR], SR).integrated, lu2 = loudness([lL, lR], SR).integrated, tp2 = truePeak([lL, lR]).dbtp;+ ok(cu < -14.5 && truePeak([cL, cR]).dbtp > -1.05, `without limit the ceiling wins and says so in the loudness (${cu.toFixed(2)} LUFS)`);+ ok(Math.abs(lu2 + 14) < 0.3 && tp2 <= -1, `limit: true reaches -14 LUFS under -1 dBTP (${lu2.toFixed(2)} LUFS, ${tp2.toFixed(2)} dBTP)`);};diff --git a/plugins/anidoodle/skills/anidoodle/engine/tools/build-page.mjs b/plugins/anidoodle/skills/anidoodle/engine/tools/build-page.mjsindex cd772be..8c5189f 100644--- a/plugins/anidoodle/skills/anidoodle/engine/tools/build-page.mjs+++ b/plugins/anidoodle/skills/anidoodle/engine/tools/build-page.mjs@@ -5,6 +5,7 @@ import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";import { createHash } from "node:crypto";import { extname, join, relative, resolve } from "node:path";import { overlay, resolveOverlay } from "./overlay.mjs";+import { requireFilm } from "./names.mjs";// BAKE KEYS (see Env.bake and hosts/page.ts). Every module that exports `const X: Film` is tagged// in the bundle with its own path, and each tagged module gets a hash of its WHOLE import closure@@ -43,6 +44,7 @@ const MIME = { ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".png": "image/png",export const buildPage = async ({ entry, out, title, plugins: extra = [] }) => {const plugins = [...extra, overlay]; // extra first: a caller's shim (snap --only) outranks the overlayif (!existsSync(entry)) entry = resolveOverlay("./" + entry, process.cwd()) ?? entry; // e.g. the example's own host page+ if (!existsSync(entry) && title) requireFilm(title, "build", "a film name: src/hosts/page-<film>.ts"); // a clear exit with the known films, not an esbuild traceconst main = await build({ entryPoints: [entry], bundle: true, format: "iife", target: "es2020", minify: true, write: false, legalComments: "none", metafile: true, plugins: [...plugins, tagFilms] });const js = main.outputFiles[0].text;// read the manifest out of the film module itself, so the page and the film can never disagree@@ -58,4 +60,4 @@ export const buildPage = async ({ entry, out, title, plugins: extra = [] }) => {mkdirSync(join(out, ".."), { recursive: true }); writeFileSync(out, html);return { out, bytes: html.length, meta: film.meta, assets: Object.keys(film.assets.images) };};-if (import.meta.url === `file://${process.argv[1]}`) { const title = process.argv[2] ?? "fixtures"; const r = await buildPage({ entry: `src/hosts/page-${title}.ts`, out: `dist/${title}.html`, title }); console.log(`built ${r.out} (${(r.bytes / 1024).toFixed(0)} KB, self-contained)`); }+if (import.meta.url === `file://${process.argv[1]}`) { const title = requireFilm(process.argv[2], "build-page", "node tools/build-page.mjs <film>"); const r = await buildPage({ entry: `src/hosts/page-${title}.ts`, out: `dist/${title}.html`, title }); console.log(`built ${r.out} (${(r.bytes / 1024).toFixed(0)} KB, self-contained)`); }diff --git a/plugins/anidoodle/skills/anidoodle/engine/tools/detect.mjs b/plugins/anidoodle/skills/anidoodle/engine/tools/detect.mjsindex 884a14e..9fcf002 100644--- a/plugins/anidoodle/skills/anidoodle/engine/tools/detect.mjs+++ b/plugins/anidoodle/skills/anidoodle/engine/tools/detect.mjs@@ -18,9 +18,19 @@ export const findPlaywright = () => {for (const [id, from] of candidates) { const lib = tryRequire(id, from); tried.push(`${id} from ${from}`); if (lib?.chromium) { const version = tryRequire(`${id}/package.json`, from)?.version; return { ok: true, lib, id, from, version }; } }return { ok: false, why: `no playwright found (looked in: ${tried.join("; ")})` };};+// The binary playwright really starts headless. Since 1.49 that is chrome-headless-shell (its own+// download, chromium_headless_shell-<rev>), not the Chrome for Testing that executablePath() names;+// the two rasterise differently, so the report must name the one that draws.+const headlessShellOf = (chrome) => {+ const m = chrome.match(/^(.*[\\/])chromium-(\d+)[\\/]/); if (!m) return null;+ const root = join(m[1], `chromium_headless_shell-${m[2]}`); if (!existsSync(root)) return null;+ const stack = [root];+ while (stack.length) { const dir = stack.pop(); for (const e of readdirSync(dir, { withFileTypes: true })) { const f = join(dir, e.name); if (e.isDirectory()) stack.push(f); else if (/^(chrome-headless-shell|headless_shell)(\.exe)?$/.test(e.name)) return f; } }+ return null;+};// Prefer the browser playwright expects; otherwise the newest cached headless shell or chromium.export const findBrowser = (lib) => {- try { const p = lib.chromium.executablePath(); if (p && existsSync(p)) return { ok: true, executablePath: undefined, why: `playwright default: ${p}` }; } catch { /* fall through */ }+ try { const p = lib.chromium.executablePath(); if (p && existsSync(p)) { const shell = headlessShellOf(p); return { ok: true, executablePath: undefined, launches: shell ?? p, why: shell ? `playwright default, headless: ${shell}` : `playwright default: ${p}` }; } } catch { /* fall through */ }const cache = process.env.PLAYWRIGHT_BROWSERS_PATH || join(homedir(), process.platform === "darwin" ? "Library/Caches/ms-playwright" : ".cache/ms-playwright");if (!existsSync(cache)) {const local = remotionShell();diff --git a/plugins/anidoodle/skills/anidoodle/engine/tools/emit.mjs b/plugins/anidoodle/skills/anidoodle/engine/tools/emit.mjsindex ec4dd10..b8aa7c6 100644--- a/plugins/anidoodle/skills/anidoodle/engine/tools/emit.mjs+++ b/plugins/anidoodle/skills/anidoodle/engine/tools/emit.mjs@@ -20,13 +20,14 @@ import { readFileSync, statSync } from "node:fs";import { resolve } from "node:path";import { pathToFileURL } from "node:url";import { buildPage } from "./build-page.mjs";+import { requireFilm } from "./names.mjs";import { pageChecks, probe } from "./adapters/html-player.mjs";const VAL = new Set(["out", "frames", "scale"]);const pos = [], opt = {};for (let i = 2; i < process.argv.length; i++) { const a = process.argv[i]; if (a.startsWith("--")) opt[a.slice(2)] = VAL.has(a.slice(2)) ? process.argv[++i] : true; else pos.push(a); }const die = (m) => { console.error(`emit: ${m}`); process.exit(1); };-const film = pos[0] ?? die("usage: node tools/emit.mjs <film> [--out out/x.html] [--frames 24]");+const film = requireFilm(pos[0], "emit", "node tools/emit.mjs <film> [--out out/x.html] [--frames 24]");const kebab = film.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();const out = resolve(opt.out ?? `out/${kebab}.html`);const N = Math.max(4, +(opt.frames ?? 24)), SCALE = +(opt.scale ?? 1);diff --git a/plugins/anidoodle/skills/anidoodle/engine/tools/gate.mjs b/plugins/anidoodle/skills/anidoodle/engine/tools/gate.mjsindex 98902cf..fdc6b9a 100644--- a/plugins/anidoodle/skills/anidoodle/engine/tools/gate.mjs+++ b/plugins/anidoodle/skills/anidoodle/engine/tools/gate.mjs@@ -15,13 +15,13 @@ import { createHash } from "node:crypto";import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";import { resolve } from "node:path";import { readdirSync } from "node:fs";-import { defaultOutput } from "./names.mjs";+import { defaultOutput, requireFilm } from "./names.mjs";import { changedArea } from "./motion.mjs";const VAL = new Set(["adapter", "mp4", "samples", "scale", "workers"]);const pos = [], opt = {};for (let i = 2; i < process.argv.length; i++) { const a = process.argv[i]; if (a.startsWith("--")) opt[a.slice(2)] = VAL.has(a.slice(2)) ? process.argv[++i] : true; else pos.push(a); }-const film = pos[0] ?? "mechanicalLepidoptera";+const film = opt["self-test"] ? null : requireFilm(pos[0], "gate", "node tools/gate.mjs <film> [--mp4 out/<film>.mp4] [--adapter html-player] [--samples 12] [--scale 1]\n node tools/gate.mjs --self-test");const adapterName = opt.adapter ?? "html-player";const SAMPLES = Math.max(4, +(opt.samples ?? 12)), SCALE = +(opt.scale ?? 1);const TMP = resolve(".tmp/gate"); mkdirSync(TMP, { recursive: true });diff --git a/plugins/anidoodle/skills/anidoodle/engine/tools/music-unit.mjs b/plugins/anidoodle/skills/anidoodle/engine/tools/music-unit.mjsindex 516e47c..a60c314 100644--- a/plugins/anidoodle/skills/anidoodle/engine/tools/music-unit.mjs+++ b/plugins/anidoodle/skills/anidoodle/engine/tools/music-unit.mjs@@ -45,6 +45,15 @@ for (const [what, m] of [{ const sjs = (await build({ entryPoints: [join(import.meta.dirname, "../src/canvas-core/score.ts")], bundle: true, write: false, platform: "neutral", format: "esm", logLevel: "error" })).outputFiles[0].text;const S = await import("data:text/javascript;base64," + Buffer.from(sjs).toString("base64")); assert.throws(() => S.filmScore(S.scoreSkeleton(), 30, 300), /skeleton/); }pass("missing harmony, melody, voicing, groove, form, mood: each throws; the score scaffold is empty and refuses to play");+// A bar that doesn't add up throws, the last one too: a short final bar is a silent gap nobody wrote.+{ const o = { role: "bass", bpb: 4 };+ assert.throws(() => M.line(0, "C2:3", o), /sums to 3 beats.*"C2:3 r:1"/, "a one-bar C2:3 in 4/4 must throw");+ assert.throws(() => M.line(0, "C2:4 | C2:3", o), /bar 1 sums to 3/);+ assert.equal(M.line(0, "C2:3 r:1", o).length, 1);+ assert.equal(M.line(6, "C2:2", o).length, 1, "a line starting off the barline may fill to it");+ const base = M.launchLofi3Material(), k = Object.keys(base.chords)[0];+ assert.throws(() => M.composePiece({ ...base, chords: { ...base.chords, [k]: { ...base.chords[k], bass: "C2:3" } } }), /sums to 3 beats/, "a short bass bar must fail compose (and so check)"); }+pass("notation: a short final bar throws with the rest to write (C2:3 -> C2:3 r:1); compose refuses it");// 4. Groove families: every family parses in every meter, deterministic, and the seed varies the bars.{ const meters = ["2/4", "3/4", "4/4", "5/4", "6/8", "7/8", "9/8", "12/8"]; let n = 0;diff --git a/plugins/anidoodle/skills/anidoodle/engine/tools/names.mjs b/plugins/anidoodle/skills/anidoodle/engine/tools/names.mjsindex c71f98f..2d3a5c7 100644--- a/plugins/anidoodle/skills/anidoodle/engine/tools/names.mjs+++ b/plugins/anidoodle/skills/anidoodle/engine/tools/names.mjs@@ -1 +1,21 @@+// Names shared by the tools: where a film's MP4 lands by default, and which films exist.+import { existsSync, readdirSync } from "node:fs";+import { join } from "node:path";+import { ROOTS } from "./overlay.mjs";+export const defaultOutput = (film) => `out/${film}.mp4`;++/** Every film this project can build: one host page, src/hosts/page-<film>.ts (the worked example's too). */+export const knownFilms = () => [...new Set([join(process.cwd(), "src"), ...ROOTS].flatMap((r) => { const d = join(r, "hosts"); return existsSync(d) ? readdirSync(d).filter((f) => /^page-.+\.ts$/.test(f)).map((f) => f.slice(5, -3)) : []; }))].sort();+const hostOf = (film) => [join(process.cwd(), "src"), ...ROOTS].map((r) => join(r, "hosts", `page-${film}.ts`)).find((f) => existsSync(f));++/** The film named on the command line, or a clear exit: the usage when none is given, the known films when it is not one. */+export const requireFilm = (film, tool, usage) => {+ const list = () => { const k = knownFilms(); return `known films (${k.length}): ${k.join(", ")}`; };+ if (!film || film.startsWith("--")) { console.error(`usage: ${usage}\n${list()}`); process.exit(2); }+ if (!/^[A-Za-z_$][\w$]*$/.test(film) || !hostOf(film)) {+ const path = /[\\/.]/.test(film) ? `: '${film}' looks like a file path; ${tool} takes a film name (the module src/canvas-core/<film>.ts with its host page src/hosts/page-<film>.ts)` : `: no host page src/hosts/page-${film}.ts`;+ console.error(`${tool}: unknown film '${film}'${path}\n${list()}`); process.exit(2);+ }+ return film;+};diff --git a/plugins/anidoodle/skills/anidoodle/engine/tools/registry.mjs b/plugins/anidoodle/skills/anidoodle/engine/tools/registry.mjsindex f4027bb..c54dbf0 100644--- a/plugins/anidoodle/skills/anidoodle/engine/tools/registry.mjs+++ b/plugins/anidoodle/skills/anidoodle/engine/tools/registry.mjs@@ -52,21 +52,21 @@ const enrich = (s) => {else if (s.film === null) drawFilm = null;else if (existsSync(plate) && existsSync(host) && new RegExp(`export const ${s.id}\\s*:\\s*Film`).test(readFileSync(plate, "utf8"))) drawFilm = s.id;const module = existsSync(plate) ? `engine/src/canvas-core/${s.id}.ts` : s.module ?? null;- return { id: s.id, name: s.name, family: s.family, medium: s.medium, nearest: s.nearest, hero: s.hero, module, drawFilm, samples: `anidoodle-research/samples/${s.id}/`, source: s.source };+ return { id: s.id, name: s.name, family: s.family, medium: s.medium, nearest: s.nearest, hero: s.hero, module, drawFilm, source: s.source };};const writeOutputs = (styles) => {- const gen = styles.map((s) => ({ id: s.id, name: s.name, family: s.family, medium: s.medium, nearest: s.nearest, hero: s.hero, module: s.module, drawFilm: s.drawFilm, samples: s.samples, source: s.source }));+ const gen = styles.map((s) => ({ id: s.id, name: s.name, family: s.family, medium: s.medium, nearest: s.nearest, hero: s.hero, module: s.module, drawFilm: s.drawFilm, source: s.source }));writeFileSync(join(ENGINE, "styles.gen.json"), JSON.stringify(gen, null, 2) + "\n");const dir = join(ROOT, "references/styles");- const rows = styles.map((s, i) => `| ${i + 1} | ${s.name} (\`${s.id}\`) | ${s.medium} | ${s.module ? `\`${s.module}\`` : "—"} | ${s.drawFilm ? `\`engine/src/canvas-core/${s.drawFilm}.ts\`` : "—"} | \`${s.samples}\` |`);+ const rows = styles.map((s, i) => `| ${i + 1} | ${s.name} (\`${s.id}\`) | ${s.medium} | ${s.module ? `\`${s.module}\`` : "—"} | ${s.drawFilm ? `\`engine/src/canvas-core/${s.drawFilm}.ts\`` : "—"} |`);mkdirSync(dir, { recursive: true });writeFileSync(join(dir, "INDEX.md"), ["# Style index", "","Generated by `node tools/registry.mjs` (run from `engine/`) out of `export const STYLE`","blocks in `engine/src/canvas-core/` plus `engine/styles.legacy.json`. Do not edit by hand.", "",- "| # | style | medium | hero module | draw-film module | samples |",- "|---|---|---|---|---|---|",+ "| # | style | medium | hero module | draw-film module |",+ "|---|---|---|---|---|",...rows, "",`${styles.length} styles.`, "",].join("\n"));diff --git a/plugins/anidoodle/skills/anidoodle/engine/tools/render.mjs b/plugins/anidoodle/skills/anidoodle/engine/tools/render.mjsindex 8122217..58a90d9 100644--- a/plugins/anidoodle/skills/anidoodle/engine/tools/render.mjs+++ b/plugins/anidoodle/skills/anidoodle/engine/tools/render.mjs@@ -1,4 +1,4 @@-// node tools/render.mjs [film] [--scale 1] [--workers 4] [--out out/x.mp4|.gif|.webm|.apng] [--gif-fps 15] [--width 640]+// node tools/render.mjs <film> [--scale 1] [--workers 4] [--out out/x.mp4|.gif|.webm|.apng] [--gif-fps 15] [--width 640]// [--blur N] [--from F] [--to F]// --blur N motion blur (N an integer >= 1): every output frame is the average of N subframes over// a one-frame shutter, integrated in linear light and weighted by alpha inside the page.@@ -30,12 +30,12 @@ import { join, resolve } from "node:path";import { buildPage } from "./build-page.mjs";import { detect } from "./detect.mjs";import * as playwright from "./adapters/playwright.mjs";-import { defaultOutput } from "./names.mjs";+import { defaultOutput, requireFilm } from "./names.mjs";import { float32Wav } from "./audio.mjs";import { firstFrameBlank } from "./thumb.mjs";const arg = (k, d) => { const i = process.argv.indexOf(`--${k}`); return i > 0 ? process.argv[i + 1] : d; };-const film = process.argv[2] && !process.argv[2].startsWith("--") ? process.argv[2] : "fixtures";+const film = requireFilm(process.argv[2], "render", "node tools/render.mjs <film> [--scale 1] [--out out/x.mp4|.gif|.webm|.apng] [--from F] [--to F] [--poster-frame N] [--blur N]");const BLUR = Number(arg("blur", 1));if (!Number.isInteger(BLUR) || BLUR < 1) { console.error(`--blur wants a whole number of subframes >= 1, got '${arg("blur")}'`); process.exit(2); }const scale = Number(arg("scale", 1)), fmt = (arg("out", "").match(/\.(gif|webm|apng)$/i)?.[1] ?? "mp4").toLowerCase(), workers = Number(arg("workers", Math.max(1, Math.min(4, Math.floor(cpus().length / 2)))));@@ -53,15 +53,18 @@ console.log(`using: ${env.chosen}\n`);const page = await buildPage({ entry: `src/hosts/page-${film}.ts`, out: resolve(`dist/${film}.html`), title: film });console.log(`page: ${page.out} (${(page.bytes / 1024).toFixed(0)} KB)`);const t0 = Date.now(), session = await playwright.open(env, page.out, { scale, workers }), meta = await session.info(), N = meta.durationFrames;-const FROM = Math.max(0, Number(arg("from", 0))), TO = Math.min(N, Number(arg("to", N)));-if (!Number.isInteger(FROM) || !Number.isInteger(TO) || TO <= FROM) { console.error(`bad range: [${FROM}, ${TO}) of ${N}`); process.exit(2); }+// out of range is an error that names the valid range, never a silent clamp (the same rule as --poster-frame)+const FROM = Number(arg("from", 0)), TO = Number(arg("to", N)), bad = (m) => { console.error(`${m}; this film has frames 0-${N - 1}: --from 0..${N - 1}, --to 1..${N} (exclusive)`); process.exit(2); };+if (!Number.isInteger(FROM) || FROM < 0 || FROM >= N) bad(`--from ${arg("from")} ${Number.isInteger(FROM) ? "is outside the film" : "is not a whole frame number"}`);+if (!Number.isInteger(TO) || TO < 1 || TO > N) bad(`--to ${arg("to")} ${Number.isInteger(TO) ? "is outside the film" : "is not a whole frame number"}`);+if (TO <= FROM) bad(`--to ${TO} must be after --from ${FROM}`);const ranged = FROM !== 0 || TO !== N;// a passage never lands on the finished film's path: default to out/<film>.<from>-<to>.<ext>, and refuse an explicit --out that IS the filmconst full = resolve(defaultOutput(film).replace(/\.mp4$/, `.${fmt}`));const out = resolve(arg("out", ranged ? `out/${film}.${FROM}-${TO}.${fmt}` : full));if (ranged && out === resolve(defaultOutput(film))) { console.error(`refusing to write a range render over the finished film ${out}; pick another --out or drop --from/--to`); process.exit(2); }if (RANGE_ASKED && !ranged) console.log("range covers the whole film: rendering it complete, with its score");-if (POSTER !== null && POSTER >= N) { console.error(`--poster-frame ${POSTER} is past the film's last frame ${N - 1}`); process.exit(2); }+if (POSTER !== null && POSTER >= N) { console.error(`--poster-frame ${POSTER} is outside the film; this film has frames 0-${N - 1}`); process.exit(2); }if (POSTER !== null) console.log(`poster: frame 0 is frame ${POSTER}, dissolving into the opening by frame ${Math.max(1, FADE)}`);const posterAt = (n) => POSTER !== null && n < Math.max(1, FADE); // frames the poster dissolve touchesconst drawAt = (n, w) => (posterAt(n) ? session.poster(n, POSTER, FADE, BLUR, w) : BLUR > 1 ? session.blur(n, BLUR, w) : session.frame(n, w));@@ -72,6 +75,18 @@ if (ranged) console.log(`range render: frames [${FROM}, ${TO}) of ${N}, silent b// audio: pure JS in the page -> WAV here (skipped for a range render: the score would not line up)mkdirSync(resolve(".tmp"), { recursive: true }); const wav = resolve(`.tmp/${film}.wav`), a = ranged ? null : await session.audio(48000);if (a) writeFileSync(wav, float32Wav(a));+if (a) { // the audio report: loudness and true peak, and the score's fit against the picture's grid+ const { build } = await import("esbuild"), js = (await build({ entryPoints: [resolve("src/canvas-core/music/meter.ts")], bundle: true, write: false, format: "esm", platform: "neutral", logLevel: "error" })).outputFiles[0].text;+ const { loudness, truePeak } = await import("data:text/javascript;base64," + Buffer.from(js).toString("base64"));+ const pcm = new Float32Array(Uint8Array.from(Buffer.from(a.float32, "base64")).buffer), L = new Float32Array(a.frames), R = new Float32Array(a.frames);+ for (let i = 0; i < a.frames; i++) { L[i] = pcm[2 * i]; R[i] = pcm[2 * i + 1]; }+ const lu = loudness([L, R], a.sampleRate).integrated, tp = truePeak([L, R]).dbtp;+ console.log(`audio: ${lu.toFixed(1)} LUFS integrated, ${tp.toFixed(1)} dBTP true peak`);+ if (lu < -14.5 && tp > -1.1) console.log(` NOTE the -1 dBTP ceiling held the gain ${(-14 - lu).toFixed(1)} dB under -14 LUFS (the cross-platform target): peaks are a composing problem (stagger the bass under the loudest downbeat, roll the big chord); a launch template bed takes \`limit: true\``);+ if (meta.score) { const off = (meta.score.tempo / meta.bpm - 1) * 100;+ console.log(`score: fitted to the film at ${meta.score.tempo.toFixed(1)} bpm (${meta.score.form}); the picture's grid is ${meta.bpm} bpm (${off >= 0 ? "+" : ""}${off.toFixed(1)} %)`);+ if (Math.abs(off) > 2) console.log(" NOTE past 2 % the cuts drift off the score's downbeats: a 1-bar stretch section, or the Material's `tail`, lets the fit land nearer the grid"); }+}mkdirSync(join(out, ".."), { recursive: true });const input = ["-y", "-loglevel", "error", "-f", "image2pipe", "-framerate", String(meta.fps), "-c:v", "png", "-i", "-"];diff --git a/plugins/anidoodle/skills/anidoodle/engine/tools/scaffold.mjs b/plugins/anidoodle/skills/anidoodle/engine/tools/scaffold.mjsindex 45ab858..985975e 100644--- a/plugins/anidoodle/skills/anidoodle/engine/tools/scaffold.mjs+++ b/plugins/anidoodle/skills/anidoodle/engine/tools/scaffold.mjs@@ -10,10 +10,14 @@// --still <name> write a one-frame picture module (a still is a film one frame long, so every// tool works on it unchanged) and its host page, ready to render// --film <name> write a minimal film module and its host page, ready to render-// --example copy the mechanical-butterfly in as well, to READ. It is proof of craft, not-// a template: copying it gets you somebody else's film with your title on it.-import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";-import { dirname, join, resolve } from "node:path";+// --example copy the mechanical-butterfly in as well, to READ, and anidoodle's own launch+// films (launch, launch2, launch3, launchClip, which are built on it). They are+// proof of craft, not a template: copying one gets you somebody else's film with+// your title on it. Without --example they stay out, with every module only they+// use; the launch KIT (launchKit, kinetic, launchCut, launchTemplate, launchExample)+// always ships, because that is what your own launch film is built on.+import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";+import { dirname, join, resolve, sep } from "node:path";import { fileURLToPath } from "node:url";const HERE = dirname(fileURLToPath(import.meta.url));@@ -39,8 +43,30 @@ if (!Number.isFinite(bpm) || bpm <= 0 || !Number.isInteger(60 * fps / bpm)) die(if (!Number.isFinite(duration) || duration <= 0 || !Number.isSafeInteger(Math.round(duration * fps))) die("--duration must be positive seconds with a finite frame count");const durationFrames = Math.max(1, Math.round(duration * fps));+// anidoodle's own launch films: our film, not starter content. They import the worked example, so+// they only come in with it. Everything that imports them (their type sheets) goes with them, and+// so does every module nothing else imports; a plain scaffold then typechecks and renders.+const OWN_FILMS = ["launch", "launch2", "launch3", "launchClip"];+const ownFilmFiles = () => {+ const SRC = join(ENGINE, "src");+ const walk = (d) => readdirSync(d).flatMap((n) => { const p = join(d, n); return statSync(p).isDirectory() ? walk(p) : p.endsWith(".ts") ? [p] : []; });+ const files = walk(SRC);+ const res = (from, spec) => { const b = resolve(dirname(from), spec); for (const e of ["", ".ts", "/index.ts"]) if (existsSync(b + e) && statSync(b + e).isFile()) return b + e; return null; };+ const imp = new Map(files.map((f) => [f, new Set([...readFileSync(f, "utf8").matchAll(/(?:from|import)\s*\(?\s*"(\.[^"]+)"/g)].map((m) => res(f, m[1])).filter(Boolean))]));+ const page = (f) => join(SRC, "hosts", `page-${f.slice(f.lastIndexOf(sep) + 1)}`);+ const out = new Set(OWN_FILMS.map((n) => join(SRC, "canvas-core", `${n}.ts`)));+ for (let grew = true; grew;) { grew = false; for (const f of files) if (!out.has(f) && [...imp.get(f)].some((t) => out.has(t))) { out.add(f); grew = true; } }+ for (const f of [...out]) if (f.includes(`${sep}canvas-core${sep}`) && existsSync(page(f))) out.add(page(f));+ const users = (f) => files.filter((g) => imp.get(g).has(f));+ const roots = files.filter((f) => !out.has(f) && users(f).length === 0), reach = new Set(), st = [...roots];+ while (st.length) { const f = st.pop(); if (reach.has(f) || out.has(f)) continue; reach.add(f); st.push(...imp.get(f)); }+ for (const f of files) if (!reach.has(f)) out.add(f);+ return out;+};+const skip = opt.example ? new Set() : ownFilmFiles();+mkdirSync(target, { recursive: true });-cpSync(join(ENGINE, "src"), join(target, "src"), { recursive: true });+cpSync(join(ENGINE, "src"), join(target, "src"), { recursive: true, filter: (f) => !skip.has(f) });cpSync(join(ENGINE, "tools"), join(target, "tools"), { recursive: true });for (const f of ["package.json", "package-lock.json", "tsconfig.json"]) if (existsSync(join(ENGINE, f))) cpSync(join(ENGINE, f), join(target, f));@@ -50,6 +76,11 @@ if (opt.example) {cpSync(ex, join(target, "src"), { recursive: true });}+// Reference images (public-domain paintings with their PROVENANCE.json) come along when a module+// in the tree names one as an asset; a film loads its assets relative to the project root.+const tsIn = (d) => readdirSync(d).flatMap((n) => { const p = join(d, n); return statSync(p).isDirectory() ? tsIn(p) : p.endsWith(".ts") ? [p] : []; });+if (tsIn(join(target, "src")).some((f) => readFileSync(f, "utf8").includes('"assets/refs/'))) cpSync(join(ENGINE, "assets", "refs"), join(target, "assets", "refs"), { recursive: true });+// A film is data: meta, an empty asset manifest, and shots that tile [0, duration). The starter// draws something that MOVES on every frame, because a film whose first frame is blank teaches// the wrong habit and fails the dead-air gate on day one.diff --git a/plugins/anidoodle/skills/anidoodle/engine/tools/sfx.mjs b/plugins/anidoodle/skills/anidoodle/engine/tools/sfx.mjsindex 719d44e..1fb4e2f 100644--- a/plugins/anidoodle/skills/anidoodle/engine/tools/sfx.mjs+++ b/plugins/anidoodle/skills/anidoodle/engine/tools/sfx.mjs@@ -65,9 +65,9 @@ const baseline = (M) => {const FPS = 30, DEMO_FRAMES = 450;export const demoPlan = (M) => {const cues = [];- // typing "make a koi that swims" at a human cadence+ // typing "make a koi that swims" at a human cadence (a cue sits on a whole frame)const text = "make a koi that swims"; let f = 12;- for (let i = 0; i < text.length; i++) { cues.push({ frame: f, kind: "tick", variant: text[i] === " " ? "space" : "key", label: i === 0 ? "typing" : undefined }); f += 2.4 + ((i * 7) % 5) * 0.55 + (text[i] === " " ? 1.5 : 0); }+ for (let i = 0; i < text.length; i++) { cues.push({ frame: Math.round(f), kind: "tick", variant: text[i] === " " ? "space" : "key", label: i === 0 ? "typing" : undefined }); f += 2.4 + ((i * 7) % 5) * 0.55 + (text[i] === " " ? 1.5 : 0); }cues.push({ frame: 157, kind: "press", variant: "thock", snap: "beat", label: "Generate" },{ frame: 170, kind: "ink", variant: "bloom", label: "the drawing opens" },@@ -165,6 +165,7 @@ const test = async () => {throws(() => M.renderSfx("riser", { key: "C" }), /needs a bpm.*no default tempo/, "riser without a bpm");ok(M.renderSfx("press", {}).L.length > 0 && M.renderSfx("riser", { variant: "air", lengthS: 2 }).L.length > 0, "untuned kinds render without key/bpm");throws(() => M.mixSfx(null, { fps: 30, frames: 300, cues: [{ frame: 10, kind: "chime" }] }, SR), /cue #0 \(chime.*is tuned: set plan.key/, "plan cue: chime without a key names the cue");+ throws(() => M.mixSfx(null, { fps: 30, frames: 300, cues: [{ frame: 10.5, kind: "tick" }] }, SR), /cue #0 \(tick.*must be a whole frame/, "a fractional cue frame is rejected, not rounded");const noct = M.nocturne(), fromScore = M.placeSfx({ fps: 30, frames: 300, score: { piece: noct }, cues: [{ frame: 10, kind: "chime", variant: "bell" }, { frame: 200, kind: "riser", beats: 2 }] }, SR);const rp = M.resolveSfxPlan({ fps: 30, frames: 300, score: { piece: noct }, cues: [] });ok(rp.key === "Ab" && rp.bpm === noct.plan.tempo && rp.beatsPerBar === 3, `plan.score gives key/bpm/bar (got ${rp.key} ${rp.bpm} ${rp.beatsPerBar})`);diff --git a/plugins/anidoodle/skills/anidoodle/engine/tools/still.mjs b/plugins/anidoodle/skills/anidoodle/engine/tools/still.mjsindex 89df523..6b4e67a 100644--- a/plugins/anidoodle/skills/anidoodle/engine/tools/still.mjs+++ b/plugins/anidoodle/skills/anidoodle/engine/tools/still.mjs@@ -15,6 +15,7 @@ import { spawnSync } from "node:child_process";import { mkdirSync, rmSync, writeFileSync } from "node:fs";import { dirname, join, resolve } from "node:path";import { buildPage } from "./build-page.mjs";+import { requireFilm } from "./names.mjs";import { detect } from "./detect.mjs";import * as playwright from "./adapters/playwright.mjs";@@ -22,7 +23,7 @@ const VAL = new Set(["shot", "out", "scale", "frame", "frames", "sheet", "sheet-const pos = [], opt = {};for (let i = 2; i < process.argv.length; i++) { const a = process.argv[i]; if (a.startsWith("--")) opt[a.slice(2)] = VAL.has(a.slice(2)) ? process.argv[++i] : true; else pos.push(a); }const die = (m) => { console.error(`still: ${m}`); process.exit(1); };-const film = pos[0] ?? die("usage: node tools/still.mjs <film> [--shot <id>] [--frame N | --frames a,b,c] [--out out/x.png] [--scale 1] [--sheet out/sheet.jpg]");+const film = requireFilm(pos[0], "still", "node tools/still.mjs <film> [--shot <id>] [--frame N | --frames a,b,c] [--out out/x.png] [--scale 1] [--sheet out/sheet.jpg]");const scale = Number(opt.scale ?? 1);if (!(scale > 0)) die(`--scale wants a number > 0, got '${opt.scale}'`);if (opt.frame !== undefined && opt.frames !== undefined) die("give --frame N or --frames a,b,c, not both");diff --git a/plugins/anidoodle/skills/anidoodle/engine/tools/verify-export.mjs b/plugins/anidoodle/skills/anidoodle/engine/tools/verify-export.mjsindex 8c46e2a..b9a77a4 100644--- a/plugins/anidoodle/skills/anidoodle/engine/tools/verify-export.mjs+++ b/plugins/anidoodle/skills/anidoodle/engine/tools/verify-export.mjs@@ -5,6 +5,7 @@// colour to assert, and a one-shot film has no seam to hide.//// node tools/verify-export.mjs <film> [--file out/x.mp4] [--adapter html-player]+// node tools/verify-export.mjs out/<film>.mp4 [...] the file itself: the film is its name (out/<film>[.<from>-<to>].<ext>)// [--width W] expected pixel width of a .gif/.webm/.apng made with render --width// (default: the film's own; height follows the aspect). Not for .mp4:// render always writes the MP4 at the film's size (x --scale), so@@ -21,14 +22,21 @@// as long as the picture, and not silent. Everything else is asked for explicitly.import { execFileSync, spawnSync } from "node:child_process";import { existsSync, mkdirSync, writeFileSync } from "node:fs";-import { resolve } from "node:path";-import { defaultOutput } from "./names.mjs";+import { basename, resolve } from "node:path";+import { defaultOutput, requireFilm } from "./names.mjs";import { firstFrameBlank } from "./thumb.mjs";const VAL = new Set(["file", "adapter", "width", "first-frame", "tol", "fidelity-psnr", "scale", "frame"]);const pos = [], opt = {};for (let i = 2; i < process.argv.length; i++) { const a = process.argv[i]; if (a.startsWith("--")) opt[a.slice(2)] = VAL.has(a.slice(2)) ? process.argv[++i] : true; else pos.push(a); }-const film = pos[0] ?? "fixtures";+// a file path names its film: out/<film>.mp4 (or a range render's out/<film>.<from>-<to>.mp4)+const USAGE = "node tools/verify-export.mjs <film> [--file out/<film>.mp4] [--first-frame #rrggbb] [--loop] [--fidelity-psnr N] [--frame N] [--delivery]\n node tools/verify-export.mjs out/<film>.mp4 [...]";+if (pos[0] && /\.(mp4|gif|webm|apng|png)$/i.test(pos[0])) {+ if (opt.file) { console.error(`verify-export: give the file once: '${pos[0]}' or --file ${opt.file}`); process.exit(2); }+ if (!existsSync(pos[0])) { console.error(`verify-export: no file '${pos[0]}'`); process.exit(2); }+ opt.file = pos[0]; pos[0] = basename(pos[0]).split(".")[0];+}+const film = requireFilm(pos[0], "verify-export", USAGE);const adapterName = opt.adapter ?? "html-player";const SCALE = +(opt.scale ?? 1);const TMP = resolve(".tmp/verify"); mkdirSync(TMP, { recursive: true });diff --git a/plugins/anidoodle/skills/anidoodle/engine/tools/verify-frame-adapter.mjs b/plugins/anidoodle/skills/anidoodle/engine/tools/verify-frame-adapter.mjsindex 7c9683d..2846e92 100644--- a/plugins/anidoodle/skills/anidoodle/engine/tools/verify-frame-adapter.mjs+++ b/plugins/anidoodle/skills/anidoodle/engine/tools/verify-frame-adapter.mjs@@ -11,15 +11,16 @@// If the engine is ever installed, this stays useful: it isolates a page-side fault from an// engine-side one, which is the difference between an hour and a day.//-// node tools/verify-frame-adapter.mjs [film]+// node tools/verify-frame-adapter.mjs <film>import { mkdirSync, readFileSync, writeFileSync } from "node:fs";import { join, resolve } from "node:path";import { pathToFileURL } from "node:url";import { buildPage } from "./build-page.mjs";+import { requireFilm } from "./names.mjs";import { FRAME_ADAPTER, ENGINE, INSTALL, probe } from "./adapters/hyperframes.mjs";import { detect } from "./detect.mjs";-const film = process.argv[2] ?? "mechanicalLepidoptera";+const film = requireFilm(process.argv[2], "verify-frame-adapter", "node tools/verify-frame-adapter.mjs <film>");const dir = resolve(".tmp/hyperframes", film); mkdirSync(dir, { recursive: true });const out = join(dir, `${film}.html`);const built = await buildPage({ entry: `src/hosts/page-${film}.ts`, out, title: film });diff --git a/plugins/anidoodle/skills/anidoodle/references/anatomy.md b/plugins/anidoodle/skills/anidoodle/references/anatomy.mdindex 6e93245..c05f1ea 100644--- a/plugins/anidoodle/skills/anidoodle/references/anatomy.md+++ b/plugins/anidoodle/skills/anidoodle/references/anatomy.md@@ -79,8 +79,7 @@ Render the figure sheet and look, at full size, for: arms that hang in a gap (migirdle); rake hands; a thumb from the wrist; a face that turns but whose far eye does not narrow;a hand that covers the face; a pinch that does not meet; feet that float or sink; a coat that sitson the lap like a plate; a pointed finger that does not read as aimed. Each of those shipped in a-draft of our figure sheet and was caught only by eye. See `samples/characters/ANATOMY-CRITIQUE.md`-for the ones still open.+draft of our figure sheet and was caught only by eye.## Gatediff --git a/plugins/anidoodle/skills/anidoodle/references/music/compose.md b/plugins/anidoodle/skills/anidoodle/references/music/compose.mdindex 611007c..454e570 100644--- a/plugins/anidoodle/skills/anidoodle/references/music/compose.md+++ b/plugins/anidoodle/skills/anidoodle/references/music/compose.md@@ -132,7 +132,8 @@ what to compose. The engine then performs, synthesizes, mixes and masters, deter## The material format-Write the score in the film's own file, e.g. `engine/src/canvas-core/<film>Score.ts`, and export it:+Write the score in the film's own file, next to the film module: `src/canvas-core/<film>Score.ts`+in a scaffolded project (`engine/src/canvas-core/<film>Score.ts` inside the skill), and export it:```tsimport type { Material } from "./music";@@ -186,13 +187,15 @@ form to the exact length. `score.ts` is an empty skeleton to copy.- A timpani in a drum lane (orchestral, choral, suspense, world) is tuned to the tonic of `key`,generated grooves included (`epic`).-**Notation** (bar-checked; a bar that doesn't add up throws):+**Notation** (bar-checked; a bar that doesn't add up throws, the last bar too: a line that ends+mid-bar writes its rest, `C2:3 r:1`, never a silent gap):- A token is `NOTE:DUR[@VEL]` (a pitch name with an octave, e.g. `F#4`), `[NOTE NOTE ...]:DUR` (achord) or `r:DUR` (a rest).- Bars are separated by `|`, or given as array items.- Durations are in beats. In 6/8, 9/8 and 12/8 a beat is a dotted quarter, so an eighth is `1/3`.In 7/8 a beat is a quarter, so an eighth is `.5` and a bar is 3.5.- `@VEL` scales the line's velocity (0..1).+- In a hand-written piece, a one-bar sting on any beat says so: `line(t, "G6:1", { ..., hit: true })`.## Craft notes (what makes it good, not just valid)diff --git a/plugins/anidoodle/skills/anidoodle/references/music/sound-design.md b/plugins/anidoodle/skills/anidoodle/references/music/sound-design.mdindex 8106e06..27f1def 100644--- a/plugins/anidoodle/skills/anidoodle/references/music/sound-design.md+++ b/plugins/anidoodle/skills/anidoodle/references/music/sound-design.md@@ -49,7 +49,8 @@ speaking window (K-weighted, see below). Duck is how far the score dips under it## Placing effects in a film-Cues are addressed by **film frame**. The frame is where the sound's sync point lands: the hit;+Cues are addressed by **film frame**, a whole number (a fractional frame throws; to land a hit+between frames, `snap` it to the beat). The frame is where the sound's sync point lands: the hit;the pass-by of a whoosh; the landing of a paper slide; the END of a riser. Pre-roll (a whoosh'sapproach, a riser's build) is rendered before the frame. If it would start before frame 0,the plan throws and names the earliest legal frame.diff --git a/plugins/anidoodle/skills/anidoodle/references/styles/INDEX.md b/plugins/anidoodle/skills/anidoodle/references/styles/INDEX.mdindex 75644ce..33bf965 100644--- a/plugins/anidoodle/skills/anidoodle/references/styles/INDEX.md+++ b/plugins/anidoodle/skills/anidoodle/references/styles/INDEX.md@@ -3,38 +3,38 @@Generated by `node tools/registry.mjs` (run from `engine/`) out of `export const STYLE`blocks in `engine/src/canvas-core/` plus `engine/styles.legacy.json`. Do not edit by hand.-| # | style | medium | hero module | draw-film module | samples |-|---|---|---|---|---|---|-| 1 | Crayon (`balloon`) | wax crayon on toothed paper: back-and-forth scribble fills that skip the valleys, a darker crayon on the shade side, a white one burnishing the highlight, a fat contour gone over twice | `engine/src/canvas-core/balloon.ts` | `engine/src/canvas-core/balloonDraw.ts` | `anidoodle-research/samples/balloon/` |-| 2 | Cyanotype blueprint (`blueprint`) | ruling pen and spring-bow compass in white ink on Prussian-blue cyanotype stock | `engine/src/canvas-core/blueprint.ts` | `engine/src/canvas-core/blueprint.ts` | `anidoodle-research/samples/blueprint/` |-| 3 | Broken colour (`brokenColour`) | opaque oil dabs from a loaded flat hog brush on primed linen, unmixed colours side by side for the eye to mix | `engine/src/canvas-core/brokenColour.ts` | `engine/src/canvas-core/brokenColour.ts` | `anidoodle-research/samples/brokenColour/` |-| 4 | Charcoal, erased and redrawn (`charcoalErasure`) | vine and compressed charcoal on heavy rag paper, stumped, lifted with a kneaded eraser, redrawn over its own residue | `engine/src/canvas-core/charcoalErasure.ts` | `engine/src/canvas-core/charcoalErasure.ts` | `anidoodle-research/samples/charcoalErasure/` |-| 5 | Coloured pencil (`colouredPencil`) | wax coloured pencils hatched in one diagonal on toothy cream cartridge paper, hues layered, darks cross-hatched | `engine/src/canvas-core/colouredPencil.ts` | `engine/src/canvas-core/colouredPencil.ts` | `anidoodle-research/samples/colouredPencil/` |-| 6 | Hand embroidery (`embroidery`) | stranded cotton floss stitched through natural plain-weave linen in a beech hoop | `engine/src/canvas-core/embroidery.ts` | `engine/src/canvas-core/embroidery.ts` | `anidoodle-research/samples/embroidery/` |-| 7 | Flat vector (`flatVector`) | pen-tool paths in a vector app, flat fills that land when a path closes, long-shadow shapes with a transparency ramp, a raster grain brush over the shade sides | `engine/src/canvas-core/flatVector.ts` | `engine/src/canvas-core/flatVector.ts` | `anidoodle-research/samples/flatVector/` |-| 8 | Folk-tale storybook (`folkTale`) | gouache and watercolour over an HB pencil drawing on cream cartridge: opaque, dry-brushed paint in the foreground thinning to a pale wash and then to bare pencil in the distance | `engine/src/canvas-core/folkTale.ts` | `engine/src/canvas-core/folkTale.ts` | `anidoodle-research/samples/folkTale/` |-| 9 | Cut-paper collage (`fox`) | zero drawn lines: torn pieces with a white fibrous edge, scissor pieces crisp, each lifting a soft shadow off the piece below | `engine/src/canvas-core/fox.ts` | `engine/src/canvas-core/foxDraw.ts` | `anidoodle-research/samples/fox/` |-| 10 | Newsprint halftone (`halftone`) | web-offset newspaper print: black on a 45 degree AM screen plus one orange spot at 15 degrees, oil ink gaining into unbleached groundwood newsprint | `engine/src/canvas-core/halftone.ts` | `engine/src/canvas-core/halftone.ts` | `anidoodle-research/samples/halftone/` |-| 11 | Isometric cutaway (`isometric`) | flat vector planes on a true 2:1 isometric grid, three tones per material, crisp edges, pen-tool order | `engine/src/canvas-core/isometric.ts` | `engine/src/canvas-core/isometric.ts` | `anidoodle-research/samples/isometric/` |-| 12 | Marker comic (`koi`) | alcohol-marker cel fills with a hard shadow edge under one heavy contour that thickens away from the light | `engine/src/canvas-core/koi.ts` | `engine/src/canvas-core/koiDraw.ts` | `anidoodle-research/samples/koi/` |-| 13 | Risograph (`lighthouse`) | soy ink, one layer per drum multiplied through its own registration offset; every other colour an overprint, tone a halftone screen per ink angle, white is bare paper | `engine/src/canvas-core/lighthouse.ts` | `engine/src/canvas-core/lighthouseDraw.ts` | `anidoodle-research/samples/lighthouse/` |-| 14 | Low-poly (`lowPoly`) | triangle meshes projected by hand through a pinhole camera, each facet flat-shaded by its normal against one low sun, painter-sorted far to near; no 3D engine | `engine/src/canvas-core/lowPoly.ts` | `engine/src/canvas-core/lowPoly.ts` | `anidoodle-research/samples/lowPoly/` |-| 15 | Single-line engraving (`mellan`) | one unbroken engraved line whose width follows a procedural tone field: the whole picture is a single stroke | `engine/src/canvas-core/mellan.ts` | `engine/src/canvas-core/mellanUnspool.ts` | `anidoodle-research/samples/mellan/` |-| 16 | Mid-century gouache (`midCentury`) | opaque matte designer's gouache on warm illustration board, a dry brush dragged over the flats, a loose brush-and-ink line printed off register | `engine/src/canvas-core/midCentury.ts` | `engine/src/canvas-core/midCentury.ts` | `anidoodle-research/samples/midCentury/` |-| 17 | Chalkboard (`moonPhases`) | side-of-the-chalk scumble on a slate board, lit limbs worked twice, every stroke broken by the board's tooth with dust either side, ghosts of old lessons | `engine/src/canvas-core/moonPhases.ts` | `engine/src/canvas-core/moonPhasesDraw.ts` | `anidoodle-research/samples/moonPhases/` |-| 18 | Oil on canvas (`paintedOil`) | opaque oil paint with hog-bristle brushes on a toned linen canvas, lean block-in to fat impasto | `engine/src/canvas-core/paintedOil.ts` | `engine/src/canvas-core/paintedOil.ts` | `anidoodle-research/samples/paintedOil/` |-| 19 | Toy-theatre paper collage (`paperCraft`) | a cardboard toy theatre: patterned and sugar papers cut and torn, gouache-painted cut-outs with a white sticker margin, every piece with a card edge and a gap to the flat behind | `engine/src/canvas-core/paperCraft.ts` | `engine/src/canvas-core/paperCraft.ts` | `anidoodle-research/samples/paperCraft/` |-| 20 | Pixel art (`pixelArt`) | a 120x120 grid of cells, each one of 16 declared palette colours, laid one cell at a time and blown up by a whole number, no smoothing | `engine/src/canvas-core/pixelArt.ts` | `engine/src/canvas-core/pixelArt.ts` | `anidoodle-research/samples/pixelArt/` |-| 21 | Ballpoint sketch (`pocketWatch`) | one blue ballpoint on cream cartridge, near-constant weight; tone only from where the hatching sits, plus the blob where a firm stroke stops | `engine/src/canvas-core/pocketWatch.ts` | `engine/src/canvas-core/pocketWatchDraw.ts` | `anidoodle-research/samples/pocketWatch/` |-| 22 | Pencil & watercolour (`ranunculus`) | graphite and pan watercolour on cold-press: washes that never quite fill their outline, form shaded toward one light, graphite over the paint | `engine/src/canvas-core/ranunculus.ts` | `engine/src/canvas-core/ranunculusDraw.ts` | `anidoodle-research/samples/ranunculus/` |-| 23 | Rubber hose (`rubberHose`) | India ink at one pressure on a clear cel over a blue-pencil rough, flat grey paint on the back, photographed and printed on black-and-white film | `engine/src/canvas-core/rubberHose.ts` | `engine/src/canvas-core/rubberHose.ts` | `anidoodle-research/samples/rubberHose/` |-| 24 | Archival scrapbook (`scrapbook`) | foxed rag-paper album page; torn cards, cellulose tape, a clothespin on twine; copperplate engravings hand-tinted; typewriter, ransom-note cut letters, red pen, rubber stamp | `engine/src/canvas-core/scrapbook.ts` | `engine/src/canvas-core/scrapbook.ts` | `anidoodle-research/samples/scrapbook/` |-| 25 | Scratchboard (`scratchboard`) | white china clay under black India ink; every mark is ink scraped away with a knife or scratch nib | `engine/src/canvas-core/scratchboard.ts` | `engine/src/canvas-core/scratchboard.ts` | `anidoodle-research/samples/scratchboard/` |-| 26 | Pen-and-ink stipple (`stipple`) | one 0.25 mm technical pen dotted straight down onto hot-press bristol; tone is dot density only | `engine/src/canvas-core/stipple.ts` | `engine/src/canvas-core/stipple.ts` | `anidoodle-research/samples/stipple/` |-| 27 | Storybook pencil + watercolour (`storybook`) | storybook graphite and gentle pan watercolour, drawn for a recurring character | `engine/src/canvas-core/storybook.ts` | `engine/src/canvas-core/storybookDraw.ts` | `anidoodle-research/samples/storybook/` |-| 28 | Sumi-e ink painting (`sumiE`) | one loaded soft brush of sumi ink, five dilutions, on unsized absorbent xuan paper, with a cinnabar seal | `engine/src/canvas-core/sumiE.ts` | `engine/src/canvas-core/sumiE.ts` | `anidoodle-research/samples/sumiE/` |-| 29 | Toy brick (`toyBrick`) | moulded ABS toy bricks, rendered flat-plastic in orthographic view: face tones by the cube rule, bevel highlights, seam hairlines, real studs, a soft ground shadow | `engine/src/canvas-core/toyBrick.ts` | `engine/src/canvas-core/toyBrick.ts` | `anidoodle-research/samples/toyBrick/` |-| 30 | Ukiyo-e colour woodblock (`woodcut`) | water-based pigment printed by baren from hand-carved cherry blocks onto damp kozo washi: a sumi keyblock, flat colour blocks, bokashi wipes | `engine/src/canvas-core/woodcut.ts` | `engine/src/canvas-core/woodcut.ts` | `anidoodle-research/samples/woodcut/` |-| 31 | Ink & line-wash (`wren`) | wet washes first that flood past the line and settle along each shape's bottom edge, backruns, then a flexible nib thick on the press and hair-thin on the lift | `engine/src/canvas-core/wren.ts` | `engine/src/canvas-core/wrenDraw.ts` | `anidoodle-research/samples/wren/` |+| # | style | medium | hero module | draw-film module |+|---|---|---|---|---|+| 1 | Crayon (`balloon`) | wax crayon on toothed paper: back-and-forth scribble fills that skip the valleys, a darker crayon on the shade side, a white one burnishing the highlight, a fat contour gone over twice | `engine/src/canvas-core/balloon.ts` | `engine/src/canvas-core/balloonDraw.ts` |+| 2 | Cyanotype blueprint (`blueprint`) | ruling pen and spring-bow compass in white ink on Prussian-blue cyanotype stock | `engine/src/canvas-core/blueprint.ts` | `engine/src/canvas-core/blueprint.ts` |+| 3 | Broken colour (`brokenColour`) | opaque oil dabs from a loaded flat hog brush on primed linen, unmixed colours side by side for the eye to mix | `engine/src/canvas-core/brokenColour.ts` | `engine/src/canvas-core/brokenColour.ts` |+| 4 | Charcoal, erased and redrawn (`charcoalErasure`) | vine and compressed charcoal on heavy rag paper, stumped, lifted with a kneaded eraser, redrawn over its own residue | `engine/src/canvas-core/charcoalErasure.ts` | `engine/src/canvas-core/charcoalErasure.ts` |+| 5 | Coloured pencil (`colouredPencil`) | wax coloured pencils hatched in one diagonal on toothy cream cartridge paper, hues layered, darks cross-hatched | `engine/src/canvas-core/colouredPencil.ts` | `engine/src/canvas-core/colouredPencil.ts` |+| 6 | Hand embroidery (`embroidery`) | stranded cotton floss stitched through natural plain-weave linen in a beech hoop | `engine/src/canvas-core/embroidery.ts` | `engine/src/canvas-core/embroidery.ts` |+| 7 | Flat vector (`flatVector`) | pen-tool paths in a vector app, flat fills that land when a path closes, long-shadow shapes with a transparency ramp, a raster grain brush over the shade sides | `engine/src/canvas-core/flatVector.ts` | `engine/src/canvas-core/flatVector.ts` |+| 8 | Folk-tale storybook (`folkTale`) | gouache and watercolour over an HB pencil drawing on cream cartridge: opaque, dry-brushed paint in the foreground thinning to a pale wash and then to bare pencil in the distance | `engine/src/canvas-core/folkTale.ts` | `engine/src/canvas-core/folkTale.ts` |+| 9 | Cut-paper collage (`fox`) | zero drawn lines: torn pieces with a white fibrous edge, scissor pieces crisp, each lifting a soft shadow off the piece below | `engine/src/canvas-core/fox.ts` | `engine/src/canvas-core/foxDraw.ts` |+| 10 | Newsprint halftone (`halftone`) | web-offset newspaper print: black on a 45 degree AM screen plus one orange spot at 15 degrees, oil ink gaining into unbleached groundwood newsprint | `engine/src/canvas-core/halftone.ts` | `engine/src/canvas-core/halftone.ts` |+| 11 | Isometric cutaway (`isometric`) | flat vector planes on a true 2:1 isometric grid, three tones per material, crisp edges, pen-tool order | `engine/src/canvas-core/isometric.ts` | `engine/src/canvas-core/isometric.ts` |+| 12 | Marker comic (`koi`) | alcohol-marker cel fills with a hard shadow edge under one heavy contour that thickens away from the light | `engine/src/canvas-core/koi.ts` | `engine/src/canvas-core/koiDraw.ts` |+| 13 | Risograph (`lighthouse`) | soy ink, one layer per drum multiplied through its own registration offset; every other colour an overprint, tone a halftone screen per ink angle, white is bare paper | `engine/src/canvas-core/lighthouse.ts` | `engine/src/canvas-core/lighthouseDraw.ts` |+| 14 | Low-poly (`lowPoly`) | triangle meshes projected by hand through a pinhole camera, each facet flat-shaded by its normal against one low sun, painter-sorted far to near; no 3D engine | `engine/src/canvas-core/lowPoly.ts` | `engine/src/canvas-core/lowPoly.ts` |+| 15 | Single-line engraving (`mellan`) | one unbroken engraved line whose width follows a procedural tone field: the whole picture is a single stroke | `engine/src/canvas-core/mellan.ts` | `engine/src/canvas-core/mellanUnspool.ts` |+| 16 | Mid-century gouache (`midCentury`) | opaque matte designer's gouache on warm illustration board, a dry brush dragged over the flats, a loose brush-and-ink line printed off register | `engine/src/canvas-core/midCentury.ts` | `engine/src/canvas-core/midCentury.ts` |+| 17 | Chalkboard (`moonPhases`) | side-of-the-chalk scumble on a slate board, lit limbs worked twice, every stroke broken by the board's tooth with dust either side, ghosts of old lessons | `engine/src/canvas-core/moonPhases.ts` | `engine/src/canvas-core/moonPhasesDraw.ts` |+| 18 | Oil on canvas (`paintedOil`) | opaque oil paint with hog-bristle brushes on a toned linen canvas, lean block-in to fat impasto | `engine/src/canvas-core/paintedOil.ts` | `engine/src/canvas-core/paintedOil.ts` |+| 19 | Toy-theatre paper collage (`paperCraft`) | a cardboard toy theatre: patterned and sugar papers cut and torn, gouache-painted cut-outs with a white sticker margin, every piece with a card edge and a gap to the flat behind | `engine/src/canvas-core/paperCraft.ts` | `engine/src/canvas-core/paperCraft.ts` |+| 20 | Pixel art (`pixelArt`) | a 120x120 grid of cells, each one of 16 declared palette colours, laid one cell at a time and blown up by a whole number, no smoothing | `engine/src/canvas-core/pixelArt.ts` | `engine/src/canvas-core/pixelArt.ts` |+| 21 | Ballpoint sketch (`pocketWatch`) | one blue ballpoint on cream cartridge, near-constant weight; tone only from where the hatching sits, plus the blob where a firm stroke stops | `engine/src/canvas-core/pocketWatch.ts` | `engine/src/canvas-core/pocketWatchDraw.ts` |+| 22 | Pencil & watercolour (`ranunculus`) | graphite and pan watercolour on cold-press: washes that never quite fill their outline, form shaded toward one light, graphite over the paint | `engine/src/canvas-core/ranunculus.ts` | `engine/src/canvas-core/ranunculusDraw.ts` |+| 23 | Rubber hose (`rubberHose`) | India ink at one pressure on a clear cel over a blue-pencil rough, flat grey paint on the back, photographed and printed on black-and-white film | `engine/src/canvas-core/rubberHose.ts` | `engine/src/canvas-core/rubberHose.ts` |+| 24 | Archival scrapbook (`scrapbook`) | foxed rag-paper album page; torn cards, cellulose tape, a clothespin on twine; copperplate engravings hand-tinted; typewriter, ransom-note cut letters, red pen, rubber stamp | `engine/src/canvas-core/scrapbook.ts` | `engine/src/canvas-core/scrapbook.ts` |+| 25 | Scratchboard (`scratchboard`) | white china clay under black India ink; every mark is ink scraped away with a knife or scratch nib | `engine/src/canvas-core/scratchboard.ts` | `engine/src/canvas-core/scratchboard.ts` |+| 26 | Pen-and-ink stipple (`stipple`) | one 0.25 mm technical pen dotted straight down onto hot-press bristol; tone is dot density only | `engine/src/canvas-core/stipple.ts` | `engine/src/canvas-core/stipple.ts` |+| 27 | Storybook pencil + watercolour (`storybook`) | storybook graphite and gentle pan watercolour, drawn for a recurring character | `engine/src/canvas-core/storybook.ts` | `engine/src/canvas-core/storybookDraw.ts` |+| 28 | Sumi-e ink painting (`sumiE`) | one loaded soft brush of sumi ink, five dilutions, on unsized absorbent xuan paper, with a cinnabar seal | `engine/src/canvas-core/sumiE.ts` | `engine/src/canvas-core/sumiE.ts` |+| 29 | Toy brick (`toyBrick`) | moulded ABS toy bricks, rendered flat-plastic in orthographic view: face tones by the cube rule, bevel highlights, seam hairlines, real studs, a soft ground shadow | `engine/src/canvas-core/toyBrick.ts` | `engine/src/canvas-core/toyBrick.ts` |+| 30 | Ukiyo-e colour woodblock (`woodcut`) | water-based pigment printed by baren from hand-carved cherry blocks onto damp kozo washi: a sumi keyblock, flat colour blocks, bokashi wipes | `engine/src/canvas-core/woodcut.ts` | `engine/src/canvas-core/woodcut.ts` |+| 31 | Ink & line-wash (`wren`) | wet washes first that flood past the line and settle along each shape's bottom edge, backruns, then a flexible nib thick on the press and hair-thin on the lift | `engine/src/canvas-core/wren.ts` | `engine/src/canvas-core/wrenDraw.ts` |31 styles.diff --git a/plugins/anidoodle/skills/anidoodle/references/workflows/launch-video-kit.md b/plugins/anidoodle/skills/anidoodle/references/workflows/launch-video-kit.mdindex 7251aa9..1f55174 100644--- a/plugins/anidoodle/skills/anidoodle/references/workflows/launch-video-kit.md+++ b/plugins/anidoodle/skills/anidoodle/references/workflows/launch-video-kit.md@@ -46,9 +46,13 @@ muted), the camera easing out for the press, an ink drop arcing from Generate inand blooming open into a card where the plate draws itself live, the thread keeping earlieranswers and scrolling, a gentle lean onto each new card, full-frame word pages between asks,and the end card blooming open and holding. The corner mark (your name, hand-lettered) steps-aside before any lean. Real holds are declared, so the gate passes; the score is set to -14-LUFS with the true peak at or under -1 dBTP (`musicBed`; a very dynamic piece stops at the-peak ceiling first).+aside before any lean. Real holds are declared, so the gate passes. The score is fitted to the+film (`fitScore`: its stretch section repeated or dropped, the tempo trimmed) so it ends on its+outro at the last frame, then set to -14 LUFS with the true peak at or under -1 dBTP+(`musicBed`). Render prints the loudness and the fitted tempo beside the grid's bpm: compose at+the film's bpm with a 1-bar stretch section (or set the Material's `tail`) so they stay within+2 %, or the cuts drift off the downbeats. A dynamic piece stops at the peak ceiling first and+render says how far short; `limit: true` lets a look-ahead limiter take those peaks instead.**The plates and the score are made for this product, every time.** A style is a recipe appliedto the user's subject (`references/styles.md`): draw their dashboard, their mascot, their@@ -113,6 +117,8 @@ zooms to each click, with the pointer and input log driving the page's own statebrick balloon, the almond hand (Van Gogh's public-domain *Almond Blossom* as the attachedreference, `engine/assets/refs/` with its `PROVENANCE.json`; `adapt-a-style.md`), the embroideryloop, the web tour, the butterfly film, the end card); `launch3.ts` is the cut: data segments-spliced with type frames, 77 s on the score's 29 bars. Study them for pacing, then build yours on+spliced with type frames, 77 s on the score's 29 bars. They are anidoodle's own film, so a plain+scaffold leaves them out; `scaffold.mjs <dir> --example` brings them in (with the butterfly they+are built on) to study. Study them for pacing, then build yours onthe template with your own pictures and your own music; anidoodle's launch is one example of thegrammar, not a skin to reuse.diff --git a/plugins/anidoodle/skills/anidoodle/references/workflows/start-here.md b/plugins/anidoodle/skills/anidoodle/references/workflows/start-here.mdindex 060618a..4694b11 100644--- a/plugins/anidoodle/skills/anidoodle/references/workflows/start-here.md+++ b/plugins/anidoodle/skills/anidoodle/references/workflows/start-here.md@@ -53,6 +53,10 @@ Everything you decided is marked as yours so they can veto it in one line.- **Show options as one still sheet** when a choice is open (a transition, a lettering medium,a palette): three to six variants side by side, picked in one message. Then render.- **Review stills for design**, not only for things overlapping (`references/craft-bar.md`).+- **A picture that draws itself says so**: `kind: "drawing"` in the film's `meta`. A stipple dot+ or a hatch changes far less than 0.5 % of the frame, so without it the gate calls a drawing+ dead air; with it, dead air is judged over 1 s at a 0.02 % floor and a hand may rest half a+ second between passes. `meta: { title, W, H, fps, bpm, durationFrames, kind: "drawing" }`.## Alive means real motiondiff --git a/plugins/anidoodle/skills/anidoodle/references/workflows/teach-drawing.md b/plugins/anidoodle/skills/anidoodle/references/workflows/teach-drawing.mdindex f730a2e..54e610b 100644--- a/plugins/anidoodle/skills/anidoodle/references/workflows/teach-drawing.md+++ b/plugins/anidoodle/skills/anidoodle/references/workflows/teach-drawing.md@@ -79,4 +79,6 @@ at any frame, from ONE renderer, so the last frame of the timelapse is the finis| How to draw a cat sitting (graphite, blue col-erase, kneaded eraser) | a plain request | 8, including a measured ear correction | 844 || Clawd at the piano (coloured pencil) | the owner's crop of Kevin Ngo's piano film | 8, with the guides lifted to a ghost before colour | 9676 |-Outputs: `anidoodle-research/samples/adapt-teach/lesson-cat/`, `lesson-clawd/`.+The cat lesson ships: `node tools/lesson.mjs lessonCat --out out/lesson-cat` rebuilds its step+sheet, timelapse, contact sheet and LESSON.md (`engine/src/canvas-core/lessonCat.ts`). The Clawd+lesson was drawn from the owner's crop of another artist's film, so its outputs stay private.diff --git a/plugins/anidoodle/skills/anidoodle/styles/house/almond-blossom.json b/plugins/anidoodle/skills/anidoodle/styles/house/almond-blossom.jsonindex e361050..ca6615a 100644--- a/plugins/anidoodle/skills/anidoodle/styles/house/almond-blossom.json+++ b/plugins/anidoodle/skills/anidoodle/styles/house/almond-blossom.json@@ -12,7 +12,7 @@"subject rule": "high-key flat decorative ground, one step of shadow on forms, no modelling in depth; no black anywhere: the darkest note is the blue-green contour"},"params": { "groundStep": 19, "groundLen": 58, "groundW": 20, "patchNoise": 0.006, "contourW": 6.5, "contourSkip": 0.05 },- "profile": { "file": "anidoodle-research/launch-film/refs/vangogh-almond-blossom.profile.json", "summary": "analyzer's nearest (charcoalErasure, storybook) wrong by eye; nearest by eye paintedOil" },+ "profile": { "summary": "analyzer's nearest (charcoalErasure, storybook) wrong by eye; nearest by eye paintedOil" },"provenance": {"reference": "Vincent van Gogh, Almond Blossom (1890), Wikimedia Commons, public domain (File:Vincent van Gogh - Almond blossom - Google Art Project.jpg)","sha256": "6f640dcd79def4223bf16569fd29ca5e37ee9d6cde2670958636e259e2a1c9d0",@@ -21,5 +21,5 @@"embedded": false,"copied": "nothing but the hand: no branch, no blossom, no composition; the subject is the launch film's own koi and pond from koi.ts"},- "proof": ["anidoodle-research/samples/adapt-teach/almond/adaptAlmond-still.png", "anidoodle-research/samples/adapt-teach/almond/compare-almond.jpg"]+ "proof": ["node tools/still.mjs adaptAlmond (from engine/): the plate in this hand"]}diff --git a/plugins/anidoodle/skills/anidoodle/styles/house/pastel-blotch.json b/plugins/anidoodle/skills/anidoodle/styles/house/pastel-blotch.jsonindex 28cbc22..48e722d 100644--- a/plugins/anidoodle/skills/anidoodle/styles/house/pastel-blotch.json+++ b/plugins/anidoodle/skills/anidoodle/styles/house/pastel-blotch.json@@ -12,7 +12,7 @@"subject rule": "the focal subject is painted in the same puddles but a full value step darker than the ground, in the opposite temperature (warm magentas on a cool ground in the proof), with a bare-paper reserve round it"},"params": { "puddleAlpha": 0.62, "rim": 0.8, "rimDarken": 0.72, "fringePx": 13, "firstPassBlur": 1.6, "bareRests": "one place in three" },- "profile": { "file": "samples/adapt-teach/aquarelle/profile.json", "summary": "high key (mean L 0.84), contrast 0.23, 8 colours over 2%, chroma 0.064, no line, no measurable grain, edges 90% soft, no lattice; measured with the terminal window excluded" },+ "profile": { "summary": "high key (mean L 0.84), contrast 0.23, 8 colours over 2%, chroma 0.064, no line, no measurable grain, edges 90% soft, no lattice; measured with the terminal window excluded" },"provenance": {"reference": "lightshot-aquarelle.png (1310x552), a pastel watercolour backdrop behind a terminal window","sha256": "397bc0daeac41e18f6c3001c03582a7a8ab617a2b97377e8b7152538e6a89ae4",@@ -22,5 +22,5 @@"embedded": false,"copied": "nothing: the reference is an abstract backdrop; the proof subject (a moon jellyfish) and its composition are new"},- "proof": ["samples/adapt-teach/aquarelle/adaptAquarelle-still.png", "samples/adapt-teach/aquarelle/compare-aquarelle.png"]+ "proof": ["node tools/still.mjs adaptAquarelle (from engine/): the plate in this hand"]}diff --git a/plugins/anidoodle/skills/anidoodle/styles/house/quiet-scrapbook.json b/plugins/anidoodle/skills/anidoodle/styles/house/quiet-scrapbook.jsonindex 3a8e085..7f08bc9 100644--- a/plugins/anidoodle/skills/anidoodle/styles/house/quiet-scrapbook.json+++ b/plugins/anidoodle/skills/anidoodle/styles/house/quiet-scrapbook.json@@ -12,7 +12,7 @@"layout rule": "mostly empty page; pieces are islands with air round them; one diagram card is the focal piece"},"params": { "deckle": 3.2, "shadow": { "dx": 4, "dy": 6, "blur": 5, "alpha": 0.55 }, "typeCell": 0.86 },- "profile": { "file": "samples/adapt-teach/scrapbook/profile.json", "summary": "high key (mean L 0.86), contrast 0.23, 5 colours over 2%, low chroma 0.03 with one vermilion accent, line presence 1.8% (mostly type), pooled rims 0.42 (card shadows), no lattice. The statistical nearest was wren: the empty page dominates the numbers, which is why the plate was picked by eye" },+ "profile": { "summary": "high key (mean L 0.86), contrast 0.23, 5 colours over 2%, low chroma 0.03 with one vermilion accent, line presence 1.8% (mostly type), pooled rims 0.42 (card shadows), no lattice. The statistical nearest was wren: the empty page dominates the numbers, which is why the plate was picked by eye" },"provenance": {"reference": "refs/ritwika-explainer/frames/f_10.png (1280x720), frame 10 of Ritwika's explainer film","sha256": "8d9f7315fb91a81b364235f77bd3653a794c97967cbf99a8a24fcfed4d26fb34",@@ -22,5 +22,5 @@"copied": "nothing: its subject (a frozen-LLM encoder), diagram (bars in a box, a vector), quote card, padlock engraving, asterisk and progress dots are not used; the proof subject (why sourdough rises) and its layout are new"},"knownGaps": ["the typewriter is capitals only (drafting.ts has no lowercase); the reference types lowercase serif", "no brush-script hand yet (lettering.ts spells one authored word)"],- "proof": ["samples/adapt-teach/scrapbook/adaptScrapbook-still.png", "samples/adapt-teach/scrapbook/compare-scrapbook.png"]+ "proof": ["node tools/still.mjs adaptScrapbook (from engine/): the plate in this hand"]}