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: voice and music for the 0.10 update video

Gabriele Lozupone74272b10059a
diff --git a/marketing/audio/make_update_music.py b/marketing/audio/make_update_music.py
new file mode 100644
index 0000000..60fcab8
--- /dev/null
+++ b/marketing/audio/make_update_music.py
@@ -0,0 +1,51 @@
+"""The music of the "Kokon 0.10" update video, cut from ACE-Step take update-20261020-175836-1.
+
+ D:/AI/tts/.venv/Scripts/python make_update_music.py -> ../video/public/music-0.10.m4a
+
+The take (118 BPM, measured with librosa: beats every 0.50849 s, drop on the bar line at 16.252 s)
+builds quietly, drops, plays 8 bars and stops dead. The video needs the drop on its beat 26 (the
+image hatching) and about 12 bars after it, so: start 26 beats before the drop, play bars 1-7,
+repeat bars 4-7, then bar 8 with the stop and the take's quiet tail. Every join is on a bar line,
+with a 10 ms crossfade. The stop lands 37.63 s into the video (STOP in timeline010.ts).
+"""
+import subprocess
+from pathlib import Path
+
+import numpy as np
+import soundfile as sf
+
+HERE = Path(__file__).parent
+TAKE = HERE / "takes" / "update-20261020-175836-1.wav"
+OUT = HERE.parent / "video" / "public" / "music-0.10.m4a"
+BEAT = 60 / 118
+DROP = 16.252
+BAR = 4 * BEAT
+FADE = 0.010
+
+
+def main() -> None:
+ y, sr = sf.read(TAKE, dtype="float32", always_2d=True)
+ at = lambda t: int(round(t * sr))
+ bar = lambda i: DROP + i * BAR # start of groove bar i (0-based)
+ start = DROP - 26 * BEAT
+ parts = [
+ y[at(start):at(bar(7))], # the build and bars 1-7
+ y[at(bar(3)):at(bar(7))], # bars 4-7 again
+ y[at(bar(7)):at(bar(8) + 3.5)], # bar 8, the stop, the tail
+ ]
+ n = at(FADE)
+ ramp = np.linspace(0, 1, n, dtype=np.float32)[:, None]
+ out = parts[0]
+ for p in parts[1:]:
+ # The tail of what came before overlaps the head of the next part.
+ mixed = out[-n:] * (1 - ramp) + p[:n] * ramp
+ out = np.concatenate([out[:-n], mixed, p[n:]])
+ wav = HERE / "takes" / "music-0.10.wav"
+ sf.write(wav, out, sr)
+ subprocess.run(["ffmpeg", "-v", "error", "-y", "-i", str(wav), "-c:a", "aac", "-b:a", "192k", str(OUT)], check=True)
+ stop = (bar(8) - start) - 2 * FADE + 4 * BAR
+ print(f"{OUT}: {len(out) / sr:.2f} s, drop at {DROP - start:.3f} s, stop at {stop:.3f} s")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/marketing/video/public/music-0.10.m4a b/marketing/video/public/music-0.10.m4a
new file mode 100644
index 0000000..4f56ffd
Binary files /dev/null and b/marketing/video/public/music-0.10.m4a differ
diff --git a/marketing/video/public/voice-0.10/01.wav b/marketing/video/public/voice-0.10/01.wav
new file mode 100644
index 0000000..1fac1f0
Binary files /dev/null and b/marketing/video/public/voice-0.10/01.wav differ
diff --git a/marketing/video/public/voice-0.10/02.wav b/marketing/video/public/voice-0.10/02.wav
new file mode 100644
index 0000000..a7ab447
Binary files /dev/null and b/marketing/video/public/voice-0.10/02.wav differ
diff --git a/marketing/video/public/voice-0.10/03.wav b/marketing/video/public/voice-0.10/03.wav
new file mode 100644
index 0000000..28ff7b4
Binary files /dev/null and b/marketing/video/public/voice-0.10/03.wav differ
diff --git a/marketing/video/public/voice-0.10/04.wav b/marketing/video/public/voice-0.10/04.wav
new file mode 100644
index 0000000..283bf43
Binary files /dev/null and b/marketing/video/public/voice-0.10/04.wav differ
diff --git a/marketing/video/public/voice-0.10/05.wav b/marketing/video/public/voice-0.10/05.wav
new file mode 100644
index 0000000..24fa90d
Binary files /dev/null and b/marketing/video/public/voice-0.10/05.wav differ
diff --git a/marketing/video/public/voice-0.10/06.wav b/marketing/video/public/voice-0.10/06.wav
new file mode 100644
index 0000000..2231ea4
Binary files /dev/null and b/marketing/video/public/voice-0.10/06.wav differ
diff --git a/marketing/video/src/app/timeline010.ts b/marketing/video/src/app/timeline010.ts
index 7410b3c..6c7273c 100644
--- a/marketing/video/src/app/timeline010.ts
+++ b/marketing/video/src/app/timeline010.ts
@@ -5,20 +5,23 @@ import voice from "./voice-0.10.json";
import { FPS, type Cue, type Lines, sentenceAt, type VoiceSet } from "./timeline";
// Music: `src` from `from` seconds; its beats fall every BEAT seconds from BEAT0 (seconds into
-// the video). Placeholder until the new take: the launch track's tail (beat 76 of its grid at
-// 47.09 s), so its drop (60.3 s) lands on beat 26, the hatch.
-export const MUSIC = { src: "music.m4a", from: 8.45 + 76 * (60 / 118) };
+// the video). public/music-0.10.m4a (audio/make_update_music.py, from ACE-Step take
+// update-20261020-175836-1): the drop on beat 26 (the hatch), a dead stop at 37.607 s.
+export const MUSIC = { src: "music-0.10.m4a", from: 0 };
const BEAT = 60 / 118;
const BEAT0 = 0;
/** Frame of beat `k` of the video. */
export const beat = (k: number) => Math.round((BEAT0 + k * BEAT) * FPS);
+/** Where the music stops dead, before the last words. */
+export const STOP = Math.round(37.607 * FPS);
/** Shot starts (frames), each on a beat. */
export const SHOT = {
title: 0,
composer: beat(6),
card: beat(10),
- making: beat(18),
+ /** On the beat before "Then Kokon makes the image." (set below, from the voice). */
+ making: 0,
logo: beat(24),
hatch: beat(26), // the drop
model: beat(30),
@@ -40,6 +43,8 @@ export const VOICE_READY = !json._provisional;
export const UPDATE_VOICE: VoiceSet = { dir: "voice-0.10", lines: json };
const cue = (line: number, at: number, from = 0, to = from): Cue => ({ line, from, to, at, set: UPDATE_VOICE });
+/** Seconds into a sentence where a word starts (Whisper word times of the picked takes). */
+export const WORD = { two: 1.25, reads: 0.72, writes: 1.58, load: 0.21, click: 1.07, spun: 1.67 };
const all = (line: number, at: number): Cue => cue(line, at, 0, UPDATE_VOICE.lines[String(line)].sentences.length - 1);
const span = (line: number, i: number) => UPDATE_VOICE.lines[String(line)].sentences[i];
@@ -51,20 +56,26 @@ export const CUES_010: Cue[] = [
all(2, WRITE - Math.round(span(2, 1)[0] * FPS)),
all(3, SHOT.hatch + 10),
all(4, SHOT.settings + 6),
- all(5, SHOT.look + 6),
- all(6, SHOT.end + 12),
+ // "...spun from silk." as the silk shot comes in.
+ all(5, SHOT.silk - Math.round(WORD.spun * FPS)),
+ cue(6, SHOT.end + 12, 0),
+ // "Get it at kokon dot app." right after the music stops.
+ cue(6, STOP + 8, 1),
];
-export const LINE = (n: number) => CUES_010[n - 1];
-export const said = (n: number, i: number) => sentenceAt(LINE(n), i);
+const cueOf = (n: number, i: number) => CUES_010.find((c) => c.line === n && c.from <= i && i <= c.to)!;
+/** Frame where sentence `i` of line `n` starts, and where a word of it starts. */
+export const said = (n: number, i: number) => sentenceAt(cueOf(n, i), i);
+export const word = (n: number, i: number, w: keyof typeof WORD) => said(n, i) + Math.round(WORD[w] * FPS);
/** Frame where sentence `i` of line `n` ends. */
-export const saidEnd = (n: number, i: number) => LINE(n).at + Math.round((span(n, i)[1] - span(n, 0)[0]) * FPS);
+export const saidEnd = (n: number, i: number) => said(n, i) + Math.round((span(n, i)[1] - span(n, i)[0]) * FPS);
/** The last beat at or before frame `f`. */
const beatBefore = (f: number) => beat(Math.floor((f / FPS - BEAT0) / BEAT));
SHOT.pill = Math.min(beatBefore(said(4, 2) + 2), SHOT.look - 45);
+SHOT.making = beatBefore(said(2, 2) + 4);
/** LoRA: "Load a LoRA…" clicked as the voice says "Load one in Settings.", the pill on "one
* click" (but before the cut to the new look). */
-export const LORA_CLICK = { load: said(4, 1) + 6, pill: Math.min(saidEnd(4, 2) - 8, SHOT.look - 14) };
+export const LORA_CLICK = { load: word(4, 1, "load") + 4, pill: Math.min(word(4, 2, "click"), SHOT.look - 14) };
/** The Prompt+ shots (frames of the video), in the shape Create uses (scenes/AppScenes.tsx). */
export const PROMPT = {
@@ -74,8 +85,8 @@ export const PROMPT = {
send: SHOT.card - 1,
job: SHOT.card,
write: WRITE,
- written: SHOT.making - 14,
- leave: SHOT.making - 6,
+ written: SHOT.making - 24,
+ leave: SHOT.making - 21,
form: SHOT.logo - 1,
done: SHOT.hatch - 6,
hatch: SHOT.hatch,
diff --git a/marketing/video/src/app/voice-0.10.json b/marketing/video/src/app/voice-0.10.json
index 1ac0378..0ecd127 100644
--- a/marketing/video/src/app/voice-0.10.json
+++ b/marketing/video/src/app/voice-0.10.json
@@ -1,85 +1,84 @@
{
- "_provisional": true,
"1": {
- "dur": 2.298,
+ "dur": 2.0,
"sentences": [
[
- 0,
- 2.298
+ 0.0,
+ 2.0
]
]
},
"2": {
- "dur": 6.669,
+ "dur": 5.36,
"sentences": [
[
- 0,
- 1.615
+ 0.0,
+ 1.08
],
[
- 2.015,
- 4.313
+ 1.48,
+ 3.32
],
[
- 4.713,
- 6.669
+ 3.72,
+ 5.36
]
]
},
"3": {
- "dur": 8.034,
+ "dur": 6.76,
"sentences": [
[
- 0,
- 1.615
+ 0.0,
+ 1.84
],
[
- 2.015,
- 5.678
+ 2.24,
+ 4.56
],
[
- 6.078,
- 8.034
+ 4.96,
+ 6.76
]
]
},
"4": {
- "dur": 6.669,
+ "dur": 5.76,
"sentences": [
[
- 0,
- 1.956
+ 0.0,
+ 1.84
],
[
- 2.356,
- 3.971
+ 2.24,
+ 3.84
],
[
- 4.371,
- 6.669
+ 4.24,
+ 5.76
]
]
},
"5": {
- "dur": 2.98,
+ "dur": 2.68,
"sentences": [
[
- 0,
- 2.98
+ 0.0,
+ 2.68
]
]
},
"6": {
- "dur": 4.996,
+ "dur": 4.28,
"sentences": [
[
- 0,
- 2.298
+ 0.0,
+ 2.2
],
[
- 2.698,
- 4.996
+ 2.6,
+ 4.28
]
]
}
-}
\ No newline at end of file
+}
diff --git a/marketing/video/src/scenes/Update010.tsx b/marketing/video/src/scenes/Update010.tsx
index 7535168..1c85759 100644
--- a/marketing/video/src/scenes/Update010.tsx
+++ b/marketing/video/src/scenes/Update010.tsx
@@ -13,7 +13,7 @@ import { Mark, MARK_PATHS } from "../app/Mark";
import { Backdrop, type Cam, Camera, Caption, DepthOfField, Dissolve, inOut, prog, Pointer, typingDone, Vignette } from "../app/motion";
import { Music, Send, Sfx, Voice } from "../app/sound";
import { FPS } from "../app/timeline";
-import { beat, CUES_010, LORA_CLICK, MUSIC, PROMPT, said, SHOT, UPDATE_FRAMES, VOICE_READY } from "../app/timeline010";
+import { beat, CUES_010, LORA_CLICK, MUSIC, PROMPT, said, SHOT, STOP, UPDATE_FRAMES, VOICE_READY, word } from "../app/timeline010";
import { CardMotionContext, type CardMotion } from "../mocks/card";
import { Hatch } from "../mocks/Cocoon";
import type { State } from "../mocks/store";
@@ -151,7 +151,7 @@ function Hatched() {
<Words
items={[
{ text: "One model.", at: said(3, 0) },
- { text: "Two jobs.", at: said(3, 0) + 22 },
+ { text: "Two jobs.", at: word(3, 0, "two") },
]}
end={SHOT.model + 6}
/>
@@ -192,8 +192,8 @@ function OneModel() {
const t0 = SHOT.model;
const show = (at: number, dur = 18) => prog(f, at, dur);
const rise = (p: number): CSSProperties => ({ opacity: p, transform: `translateY(${(1 - p) * 24}px)`, filter: `blur(${(1 - p) * 8}px)` });
- const reads = said(3, 1);
- const writes = reads + 30;
+ const reads = word(3, 1, "reads");
+ const writes = word(3, 1, "writes");
const none = said(3, 2);
const a = show(t0 + 2);
const b = show(t0 + 8);
@@ -392,7 +392,8 @@ function Sounds() {
<Sfx name="reveal" at={loaded + 2} variant={1} gain={0.6} />
<Sfx name="click" at={clickPill} />
<Sfx name="whoosh" at={SHOT.look} gain={0.5} />
- <Sfx name="hit" at={SHOT.end} gain={0.8} />
+ <Sfx name="hit" at={SHOT.end} gain={0.5} />
+ <Sfx name="hit" at={STOP} gain={0.7} />
</>
);
}