Skip to content

armgit / kokon

Public Imported from GitHub
0

Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.

Video: Kokon 0.12 (Update012, Update012UHD), voice round 3

Gabriele Lozupone69fc57efd635
diff --git a/marketing/audio/gen_voice.py b/marketing/audio/gen_voice.py
index abaf389..b70e585 100644
--- a/marketing/audio/gen_voice.py
+++ b/marketing/audio/gen_voice.py
@@ -65,6 +65,8 @@ TAKES = {
"playful": ("turbo", 0.0, 0.0, 0.8),
"tender": ("base", 0.3, 0.45, 0.65),
"intimate": ("base", 0.25, 0.5, 0.55),
+ # The 0.12 end line, slower (Gabriele: the first takes too fast): low exaggeration and cfg read slowest.
+ "slow": ("base", 0.3, 0.2, 0.7),
}
# A clean line of the launch take (12.8 s), the voice Turbo copies.
TURBO_REF = HERE.parent / "video" / "public" / "voice" / "03.wav"
@@ -289,7 +291,14 @@ USECASES_TONES = {n: r[3] for n, r in enumerate(script_rows(USECASES["script"]),
# (seeds k of the second tone are offset by 5, so every take keeps its own file name).
V011 = {"script": "voiceover-0.11.md", "dir": OUT / "update-0.11", "public": "voice-0.11", "json": "voice-0.11.json"}
V011_TONES = {n: ["calmer", "expressive"] for n in range(1, len(script_rows(V011["script"])) + 1)}
-PROJECTS = {"update": (UPDATE, UPDATE_TAKES), "usecases": (USECASES, USECASES_TONES), "011": (V011, V011_TONES)}
+# The "Kokon 0.12" video (voiceover-0.12.md): the same voice and tones as 0.11. Round 2 (line 20
+# added) and round 3 (Gabriele's picks) go to their own folders; earlier files in public/ stay as they were.
+V012 = {"script": "voiceover-0.12.md", "dir": OUT / "update-0.12", "public": "voice-0.12-v3", "json": "voice-0.12-v3.json"}
+V012_TONES = {n: ["calmer", "expressive"] for n in range(1, len(script_rows(V012["script"])) + 1)}
+V012_TONES[20] = ["slow", "calmer", "calm"]
+# build-012: seconds between the end line's sentences (the default 0.4 made it sound rushed).
+V012_PAUSES = {20: 0.8}
+PROJECTS = {"update": (UPDATE, UPDATE_TAKES), "usecases": (USECASES, USECASES_TONES), "011": (V011, V011_TONES), "012": (V012, V012_TONES)}
# build-011: sentences cut into parts that the video places one by one ("LINE.SENTENCE": about
# where, in seconds into the take; each cut moves to the quietest 10 ms within 0.15 s). "Scan the
# code, / sign in once, / and add Kokon to your home screen." goes with three shots; "Pick a photo, /
@@ -335,7 +344,7 @@ def build(src: Path, pick: dict[str, int], project: str = "update") -> None:
between sentences (UPDATE_PAUSES, UPDATE_SPLITS), mastered like the launch take (-16 LUFS over all lines). Each build goes to
a new folder; the video gets the files and their sentence spans."""
proj = PROJECTS[project][0]
- pauses = UPDATE_PAUSES if project == "update" else {}
+ pauses = UPDATE_PAUSES if project == "update" else V012_PAUSES if project == "012" else {}
splits = UPDATE_SPLITS if project == "update" else {}
lines = script_lines(proj["script"])
missing = [f"{n}.{i}" for n, l in enumerate(lines, 1) for i in range(len(sentences(l))) if f"{n}.{i}" not in pick]
diff --git a/marketing/audio/voiceover-0.12.md b/marketing/audio/voiceover-0.12.md
new file mode 100644
index 0000000..0ec38ec
--- /dev/null
+++ b/marketing/audio/voiceover-0.12.md
@@ -0,0 +1,43 @@
+# Voiceover script: "Kokon 0.12" video (2026-11-03)
+
+About 3 min, for Reddit (it autoplays muted, so the on-screen text carries every message on its
+own), then YouTube. Built on Gabriele's two screen recordings, shown whole and in order (Layers
+lab on the Halloween poster, then Colours on the kitchen); the voice comments what is on screen
+as it happens. Same voice as the 0.10 and 0.11 videos (Chatterbox base, built-in voice, one
+sentence at a time, calmer and expressive). "0.12" is spelled out for the voice. Honest claims
+only: Blend into scene is experimental; the inpaint result is pasted on the original outside the
+painted area; Mac times measured on an M2 Pro 16 GB, 1024², Qwen-Image 2.1 Turbo, 8 steps
+(sd.cpp 276 s, Kokon's Mac engine ~65 s).
+
+| # | Shot | Window | Line |
+|---|---|---|---|
+| 1 | Opening: the poster | 0:00–0:04 | Kokon zero point twelve. |
+| 2 | Layers (lab) opens | 0:04–0:07 | This is the new Layers lab. |
+| 3 | First click, on the text | 0:07–0:12 | Click each thing you want on its own layer. |
+| 4 | The clicks, one name each | 0:12–0:42 | The text. The bats. The ghosts. The spider. And the girl. |
+| 5 | Fast or Quality | 0:43–0:47 | Quality: the AI redraws each edge as a clean cut-out. |
+| 6 | Stickers and fill, 8x | 0:47–1:00 | Each object becomes its own layer, and the background behind them is painted in. |
+| 7 | The layers appear | 1:00–1:04 | Same picture, but every piece moves on its own. |
+| 8 | Hide, move, resize | 1:04–1:18 | Hide the bats. Move the spider: the street behind it is already there. Make the girl bigger. |
+| 9 | Expand on the spider | 1:26–1:42 | The spider was cut off by the frame. Edit just its layer: extend it, and ask to complete it. |
+| 10 | Spider completed | 1:45–1:48 | Only the spider changes. |
+| 11 | Blend dialog | 1:48–1:54 | Blend into scene is experimental. The AI reads where each object stands: dry ground, soft shadows, under it. |
+| 12 | Blending, 6x | 1:54–1:58 | Then it draws the shadows, or reflections on wet or shiny ground. |
+| 13 | Result, strength | 1:58–2:07 | Too strong? Turn it down. Then export to PSD, and keep going in Photoshop or similar. |
+| 14 | Paint area opens | 2:07–2:11 | Next: painting with colours. |
+| 15 | Red area, box on the image | 2:11–2:25 | Paint where something should go. Then say what goes there, right on the picture. |
+| 16 | Blue area | 2:25–2:33 | Blue: a pizza on a plate. |
+| 17 | Prompt+ review | 2:38–2:47 | Prompt+ turns it into one detailed request. |
+| 18 | Result | 2:52–3:01 | The bottle and the pizza, where you painted them. Only what you painted changes. |
+| 19 | Mac engine card | 3:01–3:13 | On a Mac, Kokon now runs its own engine: about a minute for a one-megapixel image on an M2 Pro, four times faster than before. |
+| 20 | End card | last 8 s | Kokon zero point twelve is out now. Haven't tried it yet? Get it today. It's free, and it runs on your own computer. |
+
+Round 2 (Gabriele, 11-03): not placed in the video any more: line 8 sentences 1 and 3 ("Hide the bats.", "Make the girl
+bigger.": the girl is only moved), line 16 ("Blue: a pizza on a plate."), line 18 sentence 1 ("The bottle and the
+pizza…"). Line 20 added for the end card.
+
+Takes: `gen_voice.py audition-012` (every sentence in two tones, calmer and expressive, three
+seeds each, in voice/update-0.12/audition-<stamp>), then
+`gen_voice.py build-012 --from <that folder> --pick LINE.SENTENCE:SEED,...`, which writes
+voice/update-0.12/final-<stamp>/ and copies the lines to video/public/voice-0.12 with their
+sentence spans in video/src/app/voice-0.12.json.
diff --git a/marketing/video/.gitignore b/marketing/video/.gitignore
index ed1bf77..2bdd01a 100644
--- a/marketing/video/.gitignore
+++ b/marketing/video/.gitignore
@@ -1,2 +1,11 @@
out/
node_modules/
+
+# Kokon 0.12 video: the screen recordings converted from Gabriele's HDR captures (hundreds of MB,
+# made again from the originals with the commands in private/wiki/marketing.md "0.12 video"), and
+# the two voice rounds the video no longer uses (it plays voice-0.12-v3).
+public/rec-0.12/
+public/voice-0.12/
+public/voice-0.12-v2/
+src/app/voice-0.12.json
+src/app/voice-0.12-v2.json
diff --git a/marketing/video/public/voice-0.12-v3/01.wav b/marketing/video/public/voice-0.12-v3/01.wav
new file mode 100644
index 0000000..1d73ad8
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/01.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/02.wav b/marketing/video/public/voice-0.12-v3/02.wav
new file mode 100644
index 0000000..9b29988
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/02.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/03.wav b/marketing/video/public/voice-0.12-v3/03.wav
new file mode 100644
index 0000000..bf5a992
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/03.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/04.wav b/marketing/video/public/voice-0.12-v3/04.wav
new file mode 100644
index 0000000..b799dd9
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/04.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/05.wav b/marketing/video/public/voice-0.12-v3/05.wav
new file mode 100644
index 0000000..ff1460a
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/05.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/06.wav b/marketing/video/public/voice-0.12-v3/06.wav
new file mode 100644
index 0000000..1ed36bf
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/06.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/07.wav b/marketing/video/public/voice-0.12-v3/07.wav
new file mode 100644
index 0000000..40dfbea
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/07.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/08.wav b/marketing/video/public/voice-0.12-v3/08.wav
new file mode 100644
index 0000000..26d55e9
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/08.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/09.wav b/marketing/video/public/voice-0.12-v3/09.wav
new file mode 100644
index 0000000..134b8c6
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/09.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/10.wav b/marketing/video/public/voice-0.12-v3/10.wav
new file mode 100644
index 0000000..d93264d
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/10.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/11.wav b/marketing/video/public/voice-0.12-v3/11.wav
new file mode 100644
index 0000000..0489426
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/11.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/12.wav b/marketing/video/public/voice-0.12-v3/12.wav
new file mode 100644
index 0000000..824bc11
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/12.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/13.wav b/marketing/video/public/voice-0.12-v3/13.wav
new file mode 100644
index 0000000..f754a6a
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/13.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/14.wav b/marketing/video/public/voice-0.12-v3/14.wav
new file mode 100644
index 0000000..971dab0
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/14.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/15.wav b/marketing/video/public/voice-0.12-v3/15.wav
new file mode 100644
index 0000000..307d9f7
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/15.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/16.wav b/marketing/video/public/voice-0.12-v3/16.wav
new file mode 100644
index 0000000..96ea4da
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/16.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/17.wav b/marketing/video/public/voice-0.12-v3/17.wav
new file mode 100644
index 0000000..84853e8
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/17.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/18.wav b/marketing/video/public/voice-0.12-v3/18.wav
new file mode 100644
index 0000000..d95a647
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/18.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/19.wav b/marketing/video/public/voice-0.12-v3/19.wav
new file mode 100644
index 0000000..4947e94
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/19.wav differ
diff --git a/marketing/video/public/voice-0.12-v3/20.wav b/marketing/video/public/voice-0.12-v3/20.wav
new file mode 100644
index 0000000..176b41f
Binary files /dev/null and b/marketing/video/public/voice-0.12-v3/20.wav differ
diff --git a/marketing/video/src/Root.tsx b/marketing/video/src/Root.tsx
index 891dd8b..14b6627 100644
--- a/marketing/video/src/Root.tsx
+++ b/marketing/video/src/Root.tsx
@@ -15,6 +15,7 @@ import { REELS, ReelScene, reelFrames } from "./scenes/Reels";
import { AppShot, PH_SLIDES } from "./scenes/ProductHunt";
import { Probe011 } from "./scenes/Probe011";
import { Update011, UPDATE011_FRAMES } from "./scenes/Update011";
+import { Update012, UPDATE012_FRAMES } from "./scenes/Update012";
import { VREELS, VReelScene, vreelFrames } from "./scenes/VReels";
import { UseCases, USECASES_FRAMES, USECASES_IMAGES, UseCasesThumb } from "./scenes/UseCases";
@@ -31,6 +32,8 @@ export function Root() {
<>
<Composition id="KokonLaunch" component={withPreload(Main)} durationInFrames={MAIN_FRAMES} {...S} />
<Composition id="Update011" component={withPreload(Update011)} durationInFrames={UPDATE011_FRAMES} {...S} />
+ <Composition id="Update012" component={withPreload(Update012)} durationInFrames={UPDATE012_FRAMES} {...S} />
+ <Composition id="Update012UHD" component={withPreload(() => <Update012 uhd />)} durationInFrames={UPDATE012_FRAMES} {...S} />
<Composition id="Probe011" component={withPreload(Probe011)} durationInFrames={1} {...S} />
<Composition id="UseCases" component={() => (<><Preload extra={USECASES_IMAGES} /><UseCases /></>)} durationInFrames={USECASES_FRAMES} {...S} />
<Composition id="UseCasesHouse4" component={() => (<><Preload extra={USECASES_IMAGES} /><UseCases music="music-usecases-house4.m4a" /></>)} durationInFrames={USECASES_FRAMES} {...S} />
diff --git a/marketing/video/src/app/timeline012.ts b/marketing/video/src/app/timeline012.ts
new file mode 100644
index 0000000..9815829
--- /dev/null
+++ b/marketing/video/src/app/timeline012.ts
@@ -0,0 +1,220 @@
+// The clock of the "Kokon 0.12" video (composition Update012): Gabriele's two screen recordings,
+// shown whole and in order (only OBS cut at the ends), the waits sped up, two short freezes to read
+// a dialog, slow zooms on details. Recording times are seconds into the 1440p proxies in
+// public/rec-0.12 (HDR10 sources tone-mapped there: PQ white at ~270 nits = SDR white). Frames at
+// 30 fps from the start of the video.
+import voice from "./voice-0.12-v3.json";
+import { FPS, type Cue, type Lines, sentenceAt, type VoiceSet } from "./timeline";
+
+export type Rec = 1 | 2;
+/** The recordings at 1440p (the 1080p video), or at 2160p from the same crop (the 4K video, Update012UHD). */
+export const recSrc = (rec: Rec, uhd: boolean) => `rec-0.12/${rec === 1 ? "layer-lab" : "color-edit"}-${uhd ? 2160 : 1440}.mp4`;
+
+/** A stretch of a recording at `rate` (1 = as recorded), or `hold` seconds on one of its frames
+ * (a still in public/rec-0.12/stills, `r<rec>-<t>.png`). */
+type Piece = { rec: Rec; from: number; to: number; rate: number } | { rec: Rec; still: number; hold: number };
+export type Placed = Piece & { start: number; frames: number };
+
+export const OPEN = 120;
+/** Recording 1, Layers lab on the Halloween poster: OBS until 0.97, again from 290.6. */
+const REC1: Piece[] = [
+ { rec: 1, from: 29 / 30, to: 4, rate: 1 },
+ // Picking the objects (round 2, Gabriele: much faster): 2x to the first click, then 5x.
+ { rec: 1, from: 4, to: 11, rate: 2 },
+ { rec: 1, from: 11, to: 69.5, rate: 5 },
+ // "How should the objects be cut out?": held to be read, Quality chosen.
+ { rec: 1, from: 69.5, to: 71, rate: 1 },
+ { rec: 1, still: 71, hold: 1.5 },
+ { rec: 1, from: 71, to: 72.5, rate: 1 },
+ // Stickers, then the background filled: 8x.
+ { rec: 1, from: 72.5, to: 178, rate: 8 },
+ // The layers; bats hidden, the spider moved (the street behind it), girl and ghosts moved:
+ // only the spider's move near normal speed.
+ { rec: 1, from: 178, to: 183.6, rate: 1 },
+ { rec: 1, from: 183.6, to: 187.4, rate: 3 },
+ { rec: 1, from: 187.4, to: 191.4, rate: 1.5 },
+ { rec: 1, from: 191.4, to: 207, rate: 4 },
+ // Expand on the spider's layer, "Complete the spider to the right side" typed.
+ { rec: 1, from: 207, to: 231.5, rate: 4 },
+ { rec: 1, from: 231.5, to: 251.5, rate: 8 },
+ { rec: 1, from: 251.5, to: 257.8, rate: 1 },
+ // Blend into scene: what the AI read, held.
+ { rec: 1, still: 257.8, hold: 2 },
+ { rec: 1, from: 257.8, to: 258.4, rate: 1 },
+ { rec: 1, from: 258.4, to: 281.3, rate: 6 },
+ { rec: 1, from: 281.3, to: 290.6, rate: 1 },
+];
+/** Recording 2, Colours on the kitchen: OBS until 1.75, again from 101.2. */
+const REC2: Piece[] = [
+ { rec: 2, from: 1.8, to: 6, rate: 1 },
+ // Painting (round 2, Gabriele: faster): red 3x, its box typed 2x, blue and its box 4x.
+ { rec: 2, from: 6, to: 11, rate: 3 },
+ { rec: 2, from: 11, to: 19.6, rate: 2 },
+ { rec: 2, from: 19.6, to: 36.5, rate: 4 },
+ // Done, the Prompt+ menu, Prompt+ writing: 2.5x, then its request held.
+ { rec: 2, from: 36.5, to: 43.4, rate: 2.5 },
+ { rec: 2, from: 43.4, to: 44.2, rate: 1 },
+ { rec: 2, still: 44.2, hold: 1 },
+ { rec: 2, from: 44.2, to: 45.5, rate: 1 },
+ { rec: 2, from: 45.5, to: 96.5, rate: 10 },
+ { rec: 2, from: 96.5, to: 101, rate: 1 },
+ // Before / after on the result.
+ { rec: 2, still: 101, hold: 4.5 },
+];
+
+function place(pieces: Piece[], start: number): Placed[] {
+ let at = start;
+ return pieces.map((p) => {
+ const frames = Math.round("still" in p ? p.hold * FPS : ((p.to - p.from) * FPS) / p.rate);
+ const placed = { ...p, start: at, frames };
+ at += frames;
+ return placed;
+ });
+}
+export const PIECES = [...place(REC1, OPEN), ...place(REC2, 0)];
+// REC2 follows REC1 directly.
+{
+ const end1 = PIECES.filter((p) => p.rec === 1).reduce((e, p) => Math.max(e, p.start + p.frames), 0);
+ let at = end1;
+ for (const p of PIECES.filter((q) => q.rec === 2)) {
+ p.start = at;
+ at += p.frames;
+ }
+}
+const endOf = (rec: Rec) => Math.max(...PIECES.filter((p) => p.rec === rec).map((p) => p.start + p.frames));
+export const SHOT = {
+ open: 0,
+ rec1: OPEN,
+ rec2: endOf(1),
+ /** The before/after on the last still. */
+ compare: PIECES[PIECES.length - 1].start,
+ mac: endOf(2),
+ close: endOf(2) + 12 * FPS,
+};
+/** The end card: 9 s, or longer when the closing line (20) needs it (0.5 s in, 1 s after it). */
+const END_LINE = (voice as unknown as Lines)["20"].dur;
+export const UPDATE012_FRAMES = SHOT.close + Math.max(9 * FPS, Math.ceil((END_LINE + 1.5) * FPS));
+
+/** Video frame where recording `rec` shows second `t` (the first piece holding it). */
+export function at(rec: Rec, t: number): number {
+ for (const p of PIECES) {
+ if (p.rec !== rec) continue;
+ if ("still" in p) {
+ if (Math.abs(p.still - t) < 1e-6) return p.start;
+ } else if (t >= p.from - 1e-6 && t <= p.to + 1e-6) return p.start + Math.round(((t - p.from) * FPS) / p.rate);
+ }
+ throw new Error(`recording ${rec} at ${t}s is not in the video`);
+}
+
+/** Slow zooms on a detail (video pixels, 1920×1080): in over `ease` frames from recording time
+ * `a`, held, out over `ease` frames ending at `b`. Scaled about the detail, so it stays put. */
+export interface Zoom { rec: Rec; a: number; b: number; x: number; y: number; s: number }
+export const ZOOM_EASE = 24;
+export const ZOOMS: Zoom[] = [
+ { rec: 1, a: 69.8, b: 72.4, x: 960, y: 560, s: 1.55 }, // Fast / Quality
+ { rec: 1, a: 179.2, b: 183.6, x: 1600, y: 250, s: 1.8 }, // the layers panel
+ { rec: 1, a: 187.4, b: 191.4, x: 1060, y: 760, s: 1.7 }, // the street behind the spider
+ { rec: 1, a: 251.6, b: 254.4, x: 620, y: 745, s: 1.8 }, // the spider completed
+ { rec: 1, a: 255.6, b: 258.2, x: 960, y: 560, s: 1.6 }, // read by the AI
+ { rec: 1, a: 281.6, b: 286.4, x: 800, y: 780, s: 1.7 }, // the shadows, strength
+ { rec: 2, a: 11, b: 19.6, x: 850, y: 420, s: 1.7 }, // what goes here, typed on the image
+ { rec: 2, a: 43.4, b: 45.4, x: 956, y: 940, s: 1.6 }, // Prompt+'s request
+ { rec: 2, a: 97.4, b: 100.8, x: 1000, y: 400, s: 1.7 }, // bottle and pizza
+];
+
+/** Speed badges: every piece faster than 3x. */
+export const BADGES = PIECES.filter((p): p is Placed & { rate: number } => "rate" in p && p.rate > 3).map((p) => ({ start: p.start, end: p.start + p.frames, rate: p.rate }));
+
+/** The result's image on screen (video pixels), for the before/after. */
+export const RESULT_RECT = { x: 628, y: 66, w: 666, h: 668 };
+
+/** On-screen words: section titles (large, a moment) and captions (bottom left), recording times. */
+export const TITLES: { rec: Rec; t: number; text: string; tag?: string }[] = [
+ { rec: 1, t: 4.4, text: "Any image → its layers" },
+ { rec: 1, t: 178.4, text: "Move anything" },
+ { rec: 1, t: 254.6, text: "Blend into scene", tag: "Experimental" },
+ { rec: 2, t: 2.2, text: "Paint where things go" },
+];
+export const CAPTIONS: { rec: Rec; a: number; b: number; title: string; sub?: string }[] = [
+ { rec: 1, a: 7, b: 69.4, title: "Click each thing you want on its own layer" },
+ { rec: 1, a: 69.6, b: 72.4, title: "Quality: the AI redraws each edge" },
+ { rec: 1, a: 72.8, b: 177.6, title: "Each object on its own layer", sub: "The background rebuilt behind them" },
+ { rec: 1, a: 180.6, b: 206.8, title: "Move it, hide it", sub: "The scene behind is already there" },
+ { rec: 1, a: 207.2, b: 254.2, title: "Edit one layer only", sub: "Extend the spider, ask to complete it" },
+ { rec: 1, a: 257, b: 281.2, title: "The AI reads where each object stands", sub: "Then adds shadows, or reflections on wet or shiny ground" },
+ { rec: 1, a: 281.6, b: 290.5, title: "Strength to taste. Export to PSD", sub: "Keep going in Photoshop or similar" },
+ { rec: 2, a: 5, b: 36.4, title: "One colour per thing", sub: "Say what goes there, on the picture" },
+ // Off while the zoom reads Prompt+'s request (it would cover the start of the text).
+ { rec: 2, a: 36.8, b: 43.2, title: "Prompt+ writes the full request" },
+ { rec: 2, a: 45.6, b: 96.4, title: "Prompt+ writes the full request" },
+];
+
+// Voice: voiceover-0.12.md, one cue per sentence (or per line), placed on the action it names.
+const json = voice as unknown as Lines;
+export const VOICE_012: VoiceSet = { dir: "voice-0.12-v3", lines: json };
+const n = (line: number) => VOICE_012.lines[String(line)].sentences.length;
+const cue = (line: number, f: number, from = 0, to = from): Cue => ({ line, from, to, at: f, set: VOICE_012 });
+const all = (line: number, f: number): Cue => cue(line, f, 0, n(line) - 1);
+export const CUES_012: Cue[] = [
+ all(1, 18),
+ all(2, at(1, 1.2)),
+ all(3, at(1, 4.2)),
+ cue(4, at(1, 11), 0),
+ cue(4, at(1, 27), 1),
+ cue(4, at(1, 34), 2),
+ cue(4, at(1, 42.5), 3),
+ cue(4, at(1, 55), 4),
+ all(5, at(1, 69.8)),
+ all(6, at(1, 76)),
+ all(7, at(1, 178.6)),
+ // Round 2: only "Move the spider: …" (no "Hide the bats.", no "Make the girl bigger.").
+ cue(8, at(1, 187.5), 1),
+ all(9, at(1, 207.6)),
+ all(10, at(1, 251.8)),
+ all(11, at(1, 254.8)),
+ all(12, at(1, 266)),
+ // "Too strong? Turn it down." as the strength goes to 50 %, then the PSD sentence.
+ cue(13, at(1, 283), 0, 1),
+ cue(13, at(1, 285.6), 2),
+ all(14, at(2, 2.4)),
+ cue(15, at(2, 5.4), 0),
+ cue(15, at(2, 11.2), 1),
+ // Round 2: no line 16 ("Blue: a pizza on a plate.") and no line 18's first sentence.
+ all(17, at(2, 37)),
+ cue(18, SHOT.compare + 30, 1),
+ all(19, SHOT.mac + 24),
+ all(20, SHOT.close + 15),
+];
+const cueOf = (line: number, i: number) => CUES_012.find((c) => c.line === line && c.from <= i && i <= c.to)!;
+/** Frame where sentence `i` of line `line` starts. */
+export const said = (line: number, i = 0) => sentenceAt(cueOf(line, i), i);
+
+// Music: the 0.11 video's house-4 (92 s, 118 BPM, first bar line at 0.288 s): intro bars 0-3,
+// groove 4-23, softer 24-30, groove 32-39, outro 40-42. The video is longer, so whole 8-bar
+// phrases follow each other on the beat grid (a short crossfade on the bar line), and the outro
+// starts on the end card (bar 39 -> 40, as the track itself plays it).
+export const MUSIC_SRC = "music-0.11-house4.m4a";
+const BAR = (4 * 60) / 118;
+const BAR0 = 0.288;
+/** [first bar, bar after the last] of the track, in the order played. */
+const PHRASES: [number, number][] = [
+ [0, 40],
+ [8, 24],
+ [32, 40],
+];
+const OUTRO: [number, number] = [40, 44];
+export interface MusicPiece { at: number; from: number; frames: number }
+export const MUSIC_PIECES: MusicPiece[] = (() => {
+ const bars = [...PHRASES, OUTRO];
+ const lens = bars.map(([a, b]) => (b - a) * BAR);
+ // The outro on the end card: everything before it ends at SHOT.close.
+ const before = lens.slice(0, -1).reduce((s, l) => s + l, 0);
+ let t = SHOT.close / FPS - before;
+ return bars.map(([a], i) => {
+ const p = { at: Math.round(t * FPS), from: BAR0 + a * BAR, frames: Math.round(lens[i] * FPS) };
+ t += lens[i];
+ return p;
+ });
+})();
+/** Crossfade between pieces, frames on each side of the bar line. */
+export const MUSIC_XFADE = 4;
diff --git a/marketing/video/src/app/voice-0.12-v3.json b/marketing/video/src/app/voice-0.12-v3.json
new file mode 100644
index 0000000..d3827c4
--- /dev/null
+++ b/marketing/video/src/app/voice-0.12-v3.json
@@ -0,0 +1,242 @@
+{
+ "1": {
+ "dur": 1.88,
+ "sentences": [
+ [
+ 0.0,
+ 1.88
+ ]
+ ]
+ },
+ "2": {
+ "dur": 1.8,
+ "sentences": [
+ [
+ 0.0,
+ 1.8
+ ]
+ ]
+ },
+ "3": {
+ "dur": 2.2,
+ "sentences": [
+ [
+ 0.0,
+ 2.2
+ ]
+ ]
+ },
+ "4": {
+ "dur": 6.04,
+ "sentences": [
+ [
+ 0.0,
+ 0.8
+ ],
+ [
+ 1.2,
+ 1.96
+ ],
+ [
+ 2.36,
+ 3.44
+ ],
+ [
+ 3.84,
+ 4.8
+ ],
+ [
+ 5.2,
+ 6.04
+ ]
+ ]
+ },
+ "5": {
+ "dur": 3.36,
+ "sentences": [
+ [
+ 0.0,
+ 3.36
+ ]
+ ]
+ },
+ "6": {
+ "dur": 4.2,
+ "sentences": [
+ [
+ 0.0,
+ 4.2
+ ]
+ ]
+ },
+ "7": {
+ "dur": 2.64,
+ "sentences": [
+ [
+ 0.0,
+ 2.64
+ ]
+ ]
+ },
+ "8": {
+ "dur": 6.08,
+ "sentences": [
+ [
+ 0.0,
+ 1.04
+ ],
+ [
+ 1.44,
+ 4.4
+ ],
+ [
+ 4.8,
+ 6.08
+ ]
+ ]
+ },
+ "9": {
+ "dur": 5.64,
+ "sentences": [
+ [
+ 0.0,
+ 1.84
+ ],
+ [
+ 2.24,
+ 5.64
+ ]
+ ]
+ },
+ "10": {
+ "dur": 1.8,
+ "sentences": [
+ [
+ 0.0,
+ 1.8
+ ]
+ ]
+ },
+ "11": {
+ "dur": 6.8,
+ "sentences": [
+ [
+ 0.0,
+ 2.0
+ ],
+ [
+ 2.4,
+ 6.8
+ ]
+ ]
+ },
+ "12": {
+ "dur": 3.76,
+ "sentences": [
+ [
+ 0.0,
+ 3.76
+ ]
+ ]
+ },
+ "13": {
+ "dur": 6.08,
+ "sentences": [
+ [
+ 0.0,
+ 0.88
+ ],
+ [
+ 1.28,
+ 2.2
+ ],
+ [
+ 2.6,
+ 6.08
+ ]
+ ]
+ },
+ "14": {
+ "dur": 1.84,
+ "sentences": [
+ [
+ 0.0,
+ 1.84
+ ]
+ ]
+ },
+ "15": {
+ "dur": 4.4,
+ "sentences": [
+ [
+ 0.0,
+ 1.44
+ ],
+ [
+ 1.84,
+ 4.4
+ ]
+ ]
+ },
+ "16": {
+ "dur": 1.92,
+ "sentences": [
+ [
+ 0.0,
+ 1.92
+ ]
+ ]
+ },
+ "17": {
+ "dur": 2.96,
+ "sentences": [
+ [
+ 0.0,
+ 2.96
+ ]
+ ]
+ },
+ "18": {
+ "dur": 4.24,
+ "sentences": [
+ [
+ 0.0,
+ 2.08
+ ],
+ [
+ 2.48,
+ 4.24
+ ]
+ ]
+ },
+ "19": {
+ "dur": 7.6,
+ "sentences": [
+ [
+ 0.0,
+ 7.6
+ ]
+ ]
+ },
+ "20": {
+ "dur": 9.12,
+ "sentences": [
+ [
+ 0.0,
+ 2.24
+ ],
+ [
+ 3.04,
+ 4.08
+ ],
+ [
+ 4.88,
+ 5.88
+ ],
+ [
+ 6.68,
+ 9.12
+ ]
+ ]
+ }
+}
diff --git a/marketing/video/src/scenes/Update012.tsx b/marketing/video/src/scenes/Update012.tsx
new file mode 100644
index 0000000..b86142d
--- /dev/null
+++ b/marketing/video/src/scenes/Update012.tsx
@@ -0,0 +1,325 @@
+// "Kokon 0.12": the update video for the Layers lab and painting with colours (Reddit, then
+// YouTube), built on Gabriele's two screen recordings, shown whole and in order
+// (app/timeline012.ts): only OBS is cut at the ends, the waits are sped up with a badge, two
+// dialogs are held a moment to be read. The only camera move is a slow zoom on a detail, held,
+// then back (scaled about the detail, so nothing pans). The on-screen words carry every message,
+// since Reddit plays muted. Then Kokon's Mac engine (measured times) and the end card.
+import { FastForward } from "lucide-react";
+import { createContext, useContext, type CSSProperties, type ReactNode } from "react";
+import { AbsoluteFill, Html5Audio, Img, OffthreadVideo, Sequence, staticFile, useCurrentFrame } from "remotion";
+import { Mark } from "../app/Mark";
+import { inOut, prog } from "../app/motion";
+import { Sfx, Voice } from "../app/sound";
+import { FPS } from "../app/timeline";
+import {
+ at,
+ BADGES,
+ CAPTIONS,
+ CUES_012,
+ MUSIC_PIECES,
+ MUSIC_SRC,
+ MUSIC_XFADE,
+ OPEN,
+ PIECES,
+ recSrc,
+ RESULT_RECT,
+ SHOT,
+ TITLES,
+ UPDATE012_FRAMES,
+ ZOOM_EASE,
+ ZOOMS,
+ type Placed,
+} from "../app/timeline012";
+
+export { UPDATE012_FRAMES };
+const font = '"Inter Variable", Inter, sans-serif';
+const PAPER = "#F7F6F2";
+const AMBER = "#f3c969";
+/** True in the 4K composition: the 2160p recordings and stills. */
+const Uhd = createContext(false);
+const still = (rec: number, t: number, uhd = false) => staticFile(`rec-0.12/stills${uhd ? "-2160" : ""}/r${rec}-${Number.isInteger(t) ? t.toFixed(1) : String(Math.round(t * 100) / 100)}.png`);
+const rise = (p: number): CSSProperties => ({ opacity: p, transform: `translateY(${(1 - p) * 18}px)` });
+const FULL: CSSProperties = { position: "absolute", left: 0, top: 0, width: 1920, height: 1080 };
+
+// ---------------------------------------------------------------------------------------------
+// The recordings, piece by piece, under the zooms.
+// ---------------------------------------------------------------------------------------------
+function Piece({ p }: { p: Placed }) {
+ const uhd = useContext(Uhd);
+ return (
+ <Sequence from={p.start} durationInFrames={p.frames} layout="none" name={"still" in p ? `rec${p.rec} hold ${p.still}` : `rec${p.rec} ${p.from}-${p.to} x${p.rate}`}>
+ {"still" in p ? (
+ <Img src={still(p.rec, p.still, uhd)} style={FULL} />
+ ) : (
+ <OffthreadVideo src={staticFile(recSrc(p.rec, uhd))} trimBefore={Math.round(p.from * FPS)} playbackRate={p.rate} muted style={FULL} />
+ )}
+ </Sequence>
+ );
+}
+
+const ZOOM_FRAMES = ZOOMS.map((z) => ({ ...z, A: at(z.rec, z.a), B: at(z.rec, z.b) }));
+function zoomAt(f: number) {
+ for (const z of ZOOM_FRAMES) {
+ if (f < z.A || f > z.B) continue;
+ const p = Math.min(prog(f, z.A, ZOOM_EASE, inOut), 1 - prog(f, z.B - ZOOM_EASE, ZOOM_EASE, inOut));
+ return { s: 1 + (z.s - 1) * p, x: z.x, y: z.y };
+ }
+ return { s: 1, x: 960, y: 540 };
+}
+
+function Recordings() {
+ const f = useCurrentFrame();
+ const z = zoomAt(f);
+ return (
+ <AbsoluteFill style={{ transform: `scale(${z.s})`, transformOrigin: `${z.x}px ${z.y}px` }}>
+ {PIECES.map((p, i) => (
+ <Piece key={i} p={p} />
+ ))}
+ </AbsoluteFill>
+ );
+}
+
+/** Before / after on the colour result: a divider comes in from the right and stops in the middle. */
+function Compare() {
+ const f = useCurrentFrame();
+ const uhd = useContext(Uhd);
+ const from = SHOT.compare + 8;
+ if (f < SHOT.compare || f >= SHOT.mac) return null;
+ const p = prog(f, from, 34, inOut);
+ const R = RESULT_RECT;
+ const x = R.x + R.w * (1 - 0.5 * p);
+ const label = (text: string, left: number, o: number) => (
+ <div style={{ position: "absolute", left, top: R.y + R.h - 58, padding: "6px 14px", borderRadius: 999, background: "rgba(10,10,10,0.72)", color: PAPER, fontFamily: font, fontSize: 22, fontWeight: 600, opacity: o }}>{text}</div>
+ );
+ return (
+ <AbsoluteFill>
+ <Img src={still(2, 3, uhd)} style={{ ...FULL, clipPath: `polygon(${R.x}px ${R.y}px, ${x}px ${R.y}px, ${x}px ${R.y + R.h}px, ${R.x}px ${R.y + R.h}px)` }} />
+ <div style={{ position: "absolute", left: x - 1.5, top: R.y, width: 3, height: R.h, background: PAPER, opacity: p > 0 ? 1 : 0, boxShadow: "0 0 12px rgba(0,0,0,0.5)" }} />
+ {label("Before", R.x + 16, prog(f, from + 26, 12))}
+ {label("After", R.x + R.w - 92, prog(f, from + 26, 12))}
+ </AbsoluteFill>
+ );
+}
+
+// ---------------------------------------------------------------------------------------------
+// Words on screen.
+// ---------------------------------------------------------------------------------------------
+function Badge() {
+ const f = useCurrentFrame();
+ const b = BADGES.find((x) => f >= x.start && f < x.end);
+ if (!b) return null;
+ const o = Math.min(prog(f, b.start, 8), 1 - prog(f, b.end - 8, 8));
+ return (
+ <div style={{ position: "absolute", right: 196, bottom: 40, display: "flex", alignItems: "center", gap: 8, padding: "10px 18px", borderRadius: 999, background: "rgba(10,10,10,0.8)", border: "1px solid rgba(255,255,255,0.12)", color: PAPER, fontFamily: font, fontSize: 30, fontWeight: 650, opacity: o }}>
+ <FastForward size={26} fill={PAPER} strokeWidth={0} />
+ {b.rate}×
+ </div>
+ );
+}
+
+const TITLE_FRAMES = 72;
+function Titles() {
+ const f = useCurrentFrame();
+ const t = TITLES.map((x) => ({ ...x, f0: at(x.rec, x.t) })).find((x) => f >= x.f0 && f < x.f0 + TITLE_FRAMES);
+ if (!t) return null;
+ const o = Math.min(prog(f, t.f0, 12, inOut), 1 - prog(f, t.f0 + TITLE_FRAMES - 12, 12, inOut));
+ return (
+ <AbsoluteFill style={{ background: `rgba(5,5,5,${0.55 * o})`, alignItems: "center", justifyContent: "center", fontFamily: font, color: PAPER }}>
+ <div style={{ display: "flex", alignItems: "center", gap: 26, ...rise(o) }}>
+ <span style={{ fontSize: 96, fontWeight: 650, letterSpacing: "-0.04em", textShadow: "0 6px 40px rgba(0,0,0,0.6)" }}>{t.text}</span>
+ {t.tag && <span style={{ padding: "8px 20px", borderRadius: 999, background: "rgba(243,201,105,0.16)", color: AMBER, fontSize: 36, fontWeight: 600 }}>{t.tag}</span>}
+ </div>
+ </AbsoluteFill>
+ );
+}
+
+function Captions() {
+ const f = useCurrentFrame();
+ const c = CAPTIONS.map((x) => ({ ...x, A: at(x.rec, x.a), B: at(x.rec, x.b) })).find((x) => f >= x.A && f < x.B);
+ if (!c) return null;
+ const o = Math.min(prog(f, c.A, 12), 1 - prog(f, c.B - 10, 10, inOut));
+ return (
+ <div style={{ position: "absolute", left: 196, bottom: 44, maxWidth: 400, padding: "18px 22px", borderRadius: 18, background: "rgba(12,12,12,0.82)", border: "1px solid rgba(255,255,255,0.08)", fontFamily: font, color: PAPER, ...rise(o) }}>
+ <div style={{ fontSize: 34, fontWeight: 650, letterSpacing: "-0.025em", lineHeight: 1.12 }}>{c.title}</div>
+ {c.sub && <div style={{ marginTop: 8, fontSize: 22, lineHeight: 1.3, color: "rgba(247,246,242,0.72)" }}>{c.sub}</div>}
+ </div>
+ );
+}
+
+// ---------------------------------------------------------------------------------------------
+// Opening, the Mac engine, the end card.
+// ---------------------------------------------------------------------------------------------
+function KokonTitle({ version, size = 1 }: { version: string; size?: number }) {
+ return (
+ <div style={{ display: "flex", alignItems: "center", gap: 30 * size }}>
+ <Mark size={104 * size} color={PAPER} />
+ <span style={{ fontSize: 116 * size, fontWeight: 620, letterSpacing: "-0.045em", lineHeight: 1 }}>Kokon</span>
+ <span style={{ padding: `${8 * size}px ${20 * size}px ${11 * size}px`, borderRadius: 999, border: `${3 * size}px solid ${PAPER}`, fontSize: 56 * size, fontWeight: 600, letterSpacing: "-0.03em", lineHeight: 1 }}>{version}</span>
+ </div>
+ );
+}
+
+/** The poster as the recording starts, close, with the title; then back to the whole window. */
+function Opening() {
+ const f = useCurrentFrame();
+ const uhd = useContext(Uhd);
+ if (f >= OPEN) return null;
+ const back = prog(f, OPEN - 36, 36, inOut);
+ const title = Math.min(prog(f, 4, 22), 1 - prog(f, OPEN - 40, 14, inOut));
+ return (
+ <AbsoluteFill style={{ background: "#050505" }}>
+ <Img src={still(1, 29 / 30, uhd)} style={{ ...FULL, transform: `scale(${2.1 - 1.1 * back})`, transformOrigin: "960px 400px" }} />
+ <AbsoluteFill style={{ background: `radial-gradient(ellipse at 50% 55%, rgba(5,5,5,${0.72 * title}) 0%, rgba(5,5,5,${0.4 * title}) 60%, transparent 100%)` }} />
+ <AbsoluteFill style={{ alignItems: "center", justifyContent: "center", fontFamily: font, color: PAPER }}>
+ <div style={rise(title)}>
+ <KokonTitle version="0.12" />
+ </div>
+ </AbsoluteFill>
+ </AbsoluteFill>
+ );
+}
+
+/** Measured on the same Mac (wiki/engineering.md "Bench 10-25" and the 10-26/10-27 reports). */
+const MAC_ROWS = [
+ { name: "Kokon 0.11", sub: "stable-diffusion.cpp", s: 276, label: "276 s" },
+ { name: "Kokon 0.12", sub: "Kokon's Mac engine", s: 65, label: "~65 s", ours: true },
+ { name: "Draw Things", sub: "4-bit", s: 150, label: "~150 s" },
+ { name: "mflux", sub: "4-bit", s: 158, label: "158 s" },
+];
+function MacEngine() {
+ const f = useCurrentFrame() - SHOT.mac;
+ if (f < 0 || f >= SHOT.close - SHOT.mac) return null;
+ const head = prog(f, 0, 22);
+ const out = prog(f, SHOT.close - SHOT.mac - 12, 12, inOut);
+ const MAXW = 860;
+ return (
+ <AbsoluteFill style={{ background: "#050505", fontFamily: font, color: PAPER, opacity: 1 - out }}>
+ <div style={{ position: "absolute", inset: 0, background: "radial-gradient(circle at 30% 30%, rgba(247,246,242,0.05) 0%, transparent 50%)" }} />
+ <div style={{ position: "absolute", left: 180, top: 150, ...rise(head) }}>
+ <div style={{ fontSize: 60, fontWeight: 650, letterSpacing: "-0.035em" }}>Kokon's own Mac engine, now the default on Macs</div>
+ <div style={{ marginTop: 18, fontSize: 32, color: "rgba(247,246,242,0.75)" }}>M2 Pro 16 GB · 1024² · Qwen-Image 2.1 Turbo, 8 steps</div>
+ </div>
+ <div style={{ position: "absolute", left: 180, top: 400, display: "flex", flexDirection: "column", gap: 34 }}>
+ {MAC_ROWS.map((r, i) => {
+ const p = prog(f, 20 + i * 8, 40, inOut);
+ const n = prog(f, 44 + i * 8, 14);
+ return (
+ <div key={r.name} style={{ display: "flex", alignItems: "center", gap: 36, ...rise(prog(f, 10 + i * 8, 18)) }}>
+ <div style={{ width: 420 }}>
+ <div style={{ fontSize: 38, fontWeight: r.ours ? 700 : 560, letterSpacing: "-0.02em" }}>{r.name}</div>
+ <div style={{ fontSize: 24, color: "rgba(247,246,242,0.6)" }}>{r.sub}</div>
+ </div>
+ <div style={{ width: (MAXW * r.s * p) / 276, height: 46, borderRadius: 12, background: r.ours ? PAPER : "rgba(247,246,242,0.22)" }} />
+ <div style={{ fontSize: 38, fontWeight: r.ours ? 700 : 560, opacity: n, fontVariantNumeric: "tabular-nums" }}>{r.label}</div>
+ </div>
+ );
+ })}
+ </div>
+ <div style={{ position: "absolute", left: 180, top: 910, fontSize: 26, color: "rgba(247,246,242,0.55)", opacity: prog(f, 80, 20) }}>Time for one image, measured on the same Mac. Lower is better.</div>
+ </AbsoluteFill>
+ );
+}
+
+function Close() {
+ const f = useCurrentFrame() - SHOT.close;
+ if (f < 0) return null;
+ const a = prog(f, 0, 24);
+ const b = prog(f, 10, 22);
+ const c = prog(f, 22, 22);
+ const fade = prog(f, UPDATE012_FRAMES - SHOT.close - 20, 20, inOut);
+ return (
+ <AbsoluteFill style={{ background: "#050505", fontFamily: font, color: PAPER, opacity: 1 - fade }}>
+ <div style={{ position: "absolute", inset: 0, background: "radial-gradient(circle at 50% 40%, rgba(247,246,242,0.06) 0%, transparent 45%)" }} />
+ <AbsoluteFill style={{ alignItems: "center", justifyContent: "center", flexDirection: "column" }}>
+ <div style={rise(a)}>
+ <KokonTitle version="0.12" />
+ </div>
+ <div style={{ marginTop: 44, fontSize: 46, fontWeight: 600, letterSpacing: "-0.02em", ...rise(b) }}>kokon.app</div>
+ <div style={{ marginTop: 16, fontSize: 30, color: "rgba(247,246,242,0.8)", ...rise(b) }}>Windows · macOS · Linux</div>
+ <div style={{ marginTop: 10, fontSize: 26, color: "rgba(247,246,242,0.6)", ...rise(b) }}>12 GB GPU (8 GB in beta), NVIDIA or AMD, or Apple Silicon</div>
+ <div style={{ marginTop: 40, padding: "16px 34px", borderRadius: 999, background: PAPER, color: "#0d0d0d", fontSize: 34, fontWeight: 650, letterSpacing: "-0.02em", ...rise(c) }}>Free, local, open source</div>
+ </AbsoluteFill>
+ </AbsoluteFill>
+ );
+}
+
+/** A short dip through black between the two recordings. */
+function Dip({ at: f0, half = 8 }: { at: number; half?: number }) {
+ const f = useCurrentFrame();
+ const d = Math.abs(f - f0);
+ if (d >= half) return null;
+ return <AbsoluteFill style={{ background: "#050505", opacity: 1 - d / half }} />;
+}
+
+// ---------------------------------------------------------------------------------------------
+// Sound: the music in whole phrases (timeline012 MUSIC_PIECES), the voice, two soft hits.
+// ---------------------------------------------------------------------------------------------
+/** The music's level under the voice: one steady background, as in 0.11 (a little lower: the voice
+ * talks over most of this video). */
+const MUSIC_GAIN = 0.4;
+const LEVEL_MUSIC = 0.62; // sound.tsx LEVEL.music
+function Music() {
+ const X = MUSIC_XFADE;
+ const last = MUSIC_PIECES.length - 1;
+ return (
+ <>
+ {MUSIC_PIECES.map((p, i) => {
+ let start = p.at - (i > 0 ? X : 0);
+ let from = p.from - (i > 0 ? X / FPS : 0);
+ let frames = p.frames + (i > 0 ? X : 0) + (i < last ? X : 0);
+ if (start < 0) {
+ from -= start / FPS;
+ frames += start;
+ start = 0;
+ }
+ frames = Math.min(frames, UPDATE012_FRAMES - start);
+ if (frames <= 0) return null;
+ const head = i > 0 && p.at - X >= 0;
+ return (
+ <Sequence key={i} from={start} durationInFrames={frames} layout="none" name={`music ${p.from.toFixed(2)}s`}>
+ <Html5Audio
+ src={staticFile(MUSIC_SRC)}
+ trimBefore={Math.round(from * FPS)}
+ volume={(f) => {
+ const fin = head ? Math.min(1, f / (2 * X)) : 1;
+ const fout = i < last ? Math.min(1, (frames - f) / (2 * X)) : 1;
+ const end = Math.min(1, Math.max(0, (UPDATE012_FRAMES - (start + f)) / 45));
+ return LEVEL_MUSIC * MUSIC_GAIN * Math.sqrt(Math.max(0, fin)) * Math.sqrt(Math.max(0, fout)) * end;
+ }}
+ />
+ </Sequence>
+ );
+ })}
+ </>
+ );
+}
+
+const Shot = ({ from, to, children }: { from: number; to: number; children: ReactNode }) => {
+ const f = useCurrentFrame();
+ return f >= from && f < to ? <>{children}</> : null;
+};
+
+/** `uhd`: the 4K render (Update012UHD, `--scale=2`) reads the 2160p recordings. */
+export function Update012({ uhd = false }: { uhd?: boolean }) {
+ return (
+ <Uhd.Provider value={uhd}>
+ <AbsoluteFill style={{ background: "#050505" }}>
+ <Shot from={SHOT.rec1} to={SHOT.mac}>
+ <Recordings />
+ <Compare />
+ <Captions />
+ <Badge />
+ <Titles />
+ <Dip at={SHOT.rec2} />
+ </Shot>
+ <Opening />
+ <MacEngine />
+ <Close />
+ <Sfx name="hit" at={6} gain={0.4} />
+ <Sfx name="hit" at={SHOT.close} gain={0.35} />
+ <Voice cues={CUES_012} />
+ <Music />
+ </AbsoluteFill>
+ </Uhd.Provider>
+ );
+}