@biunow/agent-biutalk 1.1.7 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_shared/.tmp-panel-smoke/art/smoke.mp4 +0 -0
- package/_shared/.tmp-panel-smoke/art-pipe/out/biuart-01_cave-mwq5kfpm.mp4 +0 -0
- package/_shared/.tmp-panel-smoke/art-pipe/panel-delivery.json +7 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/film/index.html +7 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/film/main.js +68 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/film/panel-beats.json +20 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/CREDITS +20 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/build.sh +17 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/ease.js +43 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/events.json +1 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/film.js +533 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/fonts/OFL-Archivo.txt +93 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/fonts/OFL-DMSerifDisplay.txt +93 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/fonts/OFL-UnifrakturMaguntia.txt +94 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/fonts/fonts.css +3 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/index.html +6 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/lines.json +10 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/main.js +15 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/mix.py +116 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/music/score.py +168 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/music/score_meta.json +59 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/score.json +235 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/stills/styleframe.jpg +0 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/tools/fonts.sh +17 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/tools/subs.py +11 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/tools/words.py +20 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/voices/dur.json +10 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/voices/words.json +213 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-demo/voices/words_rel.json +56 -0
- package/_shared/.tmp-panel-smoke/reel-pipe/style-ref.json +5 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/film/index.html +7 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/film/main.js +68 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/film/panel-beats.json +20 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/out/video.mp4 +0 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/panel-delivery.json +8 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/CREDITS +20 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/build.sh +17 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/ease.js +43 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/events.json +1 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/film.js +533 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/fonts/OFL-Archivo.txt +93 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/fonts/OFL-DMSerifDisplay.txt +93 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/fonts/OFL-UnifrakturMaguntia.txt +94 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/fonts/fonts.css +3 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/index.html +6 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/lines.json +10 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/main.js +15 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/mix.py +116 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/music/score.py +168 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/music/score_meta.json +59 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/score.json +235 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/stills/styleframe.jpg +0 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/tools/fonts.sh +17 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/tools/subs.py +11 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/tools/words.py +20 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/voices/dur.json +10 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/voices/words.json +213 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-demo/voices/words_rel.json +56 -0
- package/_shared/.tmp-panel-smoke/reel-pipe2/style-ref.json +5 -0
- package/_shared/.tmp-panel-smoke/remo-pipe/brief.md +2 -0
- package/_shared/.tmp-panel-smoke/remo-pipe/remo-job.json +4 -0
- package/_shared/.tmp-panel-smoke/remo-pipe2/brief.md +1 -0
- package/_shared/.tmp-panel-smoke/remo-pipe2/out/final.mp4 +0 -0
- package/_shared/.tmp-panel-smoke/remo-pipe2/panel-delivery.json +8 -0
- package/_shared/.tmp-panel-smoke/remo-pipe2/remo-job.json +4 -0
- package/_shared/.tmp-panel-smoke/vibe-pipe-ok/ep00-demo.mp4 +0 -0
- package/_shared/.tmp-panel-smoke/vibe-pipe-ok/out/ep00-demo.mp4 +0 -0
- package/_shared/.tmp-panel-smoke/vibe-pipe-ok/panel-delivery.json +7 -0
- package/_shared/.tmp-panel-smoke/vibe-pipe-ok/publish.json +10 -0
- package/_shared/.tmp-panel-smoke/vibe-still.jpg +0 -0
- package/_shared/.tmp-panel-smoke/vibe-still.log +6 -0
- package/_shared/.tmp-panel-smoke/vibe-still.log.err +0 -0
- package/_shared/.tmp-panel-smoke/vibe-still2.log +26 -0
- package/_shared/.tmp-panel-smoke/vibe-still2.log.err +0 -0
- package/_shared/lib/film-locate.mjs +203 -0
- package/_shared/lib/voice-catalog.mjs +127 -0
- package/_shared/scripts/apply-upload-limits.mjs +62 -0
- package/_shared/scripts/patch-film-hosts.mjs +233 -0
- package/_shared/scripts/patch-voice-options.mjs +41 -0
- package/_shared/scripts/sync-local-agents.mjs +67 -0
- package/_shared/scripts/wire-film-bridge.mjs +24 -0
- package/_shared/scripts/wire-voice-plus.mjs +68 -0
- package/_shared/studio/assert-panel-permit.mjs +67 -0
- package/_shared/studio/composer.css +559 -0
- package/_shared/studio/composer.js +728 -0
- package/_shared/studio/optimize-prompt.mjs +84 -0
- package/_shared/studio/optimize-prompt.test.mjs +47 -0
- package/_shared/studio/recipes.mjs +87 -0
- package/_shared/studio/select-menu.js +450 -0
- package/_shared/studio/to-english-prompt.mjs +165 -0
- package/_shared/studio/to-english-prompt.test.mjs +72 -0
- package/bin/server.js +22 -22
- package/data/looks.json +8 -0
- package/lib/film-bridge.mjs +1 -0
- package/lib/host.mjs +131 -264
- package/lib/voice-bridge.mjs +2 -0
- package/manifest.json +4 -3
- package/package.json +1 -1
- package/skills/biutalk/EXEC.md +69 -0
- package/skills/biutalk/SKILL.md +12 -10
- package/skills/biutalk/scripts/doctor.mjs +124 -0
- package/skills/biutalk/scripts/qc.mjs +129 -0
- package/skills/biutalk/scripts/scaffold.mjs +205 -0
- package/studio/app.js +16 -1
- package/studio/composer.css +94 -0
- package/studio/composer.js +257 -9
- package/studio/index.html +5 -1
- package/studio/to-english-prompt.mjs +16 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Rebuild 《Five Rules for a Poster》 from scratch: sh styles/swiss-motion/demo/build.sh (runs from any folder)
|
|
3
|
+
set -e
|
|
4
|
+
sh "$(dirname "$0")/tools/fonts.sh" # fonts: not in git (CREDITS names them) → fonts/
|
|
5
|
+
cd "$(dirname "$0")/../../.."
|
|
6
|
+
PY=.venv/bin/python; D=styles/swiss-motion/demo; S=styles/swiss-motion
|
|
7
|
+
$PY core/tts/tts.py $D/lines.json $D/voices # 1. Kokoro voice-over (af_sarah, speed 1.0)
|
|
8
|
+
$PY core/tts/asr_check.py $D/lines.json $D/voices # 2. whisper line-by-line check (should give mismatches: 0)
|
|
9
|
+
$PY $D/tools/words.py # 3. word timings → subtitles snap in word by word
|
|
10
|
+
$PY $D/music/score.py # 4. original motorik score (reads score.json, ~4 s)
|
|
11
|
+
node core/render/events.mjs $D # 5. timeline → events.json (foley events)
|
|
12
|
+
$PY $D/mix.py # 6. foley + voice-over ducking + score → mix.wav
|
|
13
|
+
$PY $D/tools/subs.py && $PY core/render/srt.py $D/out/subs.json $S/swiss-motion.srt # 7. subtitles (asserts on-screen durations)
|
|
14
|
+
node core/render/video.mjs $D --fps 24 --workers 3 --out $D/out/video24.mp4 # 8. frame-by-frame render (~12 s)
|
|
15
|
+
sh core/render/mux.sh $D/out/video24.mp4 $D/mix.wav $S/swiss-motion.mp4 24 0 # 9. mux: −14 LUFS, grain 0
|
|
16
|
+
node core/render/still.mjs $D 33.4 --q nosub=1 --out $D/out/still --prefix sf_ && cp $D/out/still/sf_33.4.jpg $D/stills/styleframe.jpg
|
|
17
|
+
node core/render/still.mjs $D 43.5 --q 'nosub=1&poster=1' --out $D/out/still --prefix po_ && cp $D/out/still/po_43.5.jpg $S/poster.jpg
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Precise easing and snap tools. Swiss motion graphics allows only two curves: the precise ease cubic-bezier(.7,0,.2,1) and linear.
|
|
2
|
+
export const clamp = (x, a = 0, b = 1) => Math.max(a, Math.min(b, x));
|
|
3
|
+
export const lerp = (a, b, t) => a + (b - a) * t;
|
|
4
|
+
export const seg = (t, a, b) => clamp((t - a) / (b - a));
|
|
5
|
+
|
|
6
|
+
export function cubicBezier(x1, y1, x2, y2) {
|
|
7
|
+
const bx = u => 3 * (1 - u) * (1 - u) * u * x1 + 3 * (1 - u) * u * u * x2 + u * u * u;
|
|
8
|
+
const by = u => 3 * (1 - u) * (1 - u) * u * y1 + 3 * (1 - u) * u * u * y2 + u * u * u;
|
|
9
|
+
return t => {
|
|
10
|
+
if (t <= 0) return 0; if (t >= 1) return 1;
|
|
11
|
+
let lo = 0, hi = 1, u = t;
|
|
12
|
+
for (let i = 0; i < 30; i++) { const x = bx(u); if (Math.abs(x - t) < 1e-6) break; if (x < t) lo = u; else hi = u; u = (lo + hi) / 2; }
|
|
13
|
+
return by(u);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export const E = cubicBezier(.7, 0, .2, 1); // the only ease in the whole film
|
|
17
|
+
|
|
18
|
+
export const BPM = 120, BEAT = 60 / BPM, E8 = BEAT / 2, E16 = BEAT / 4, BAR = BEAT * 4;
|
|
19
|
+
|
|
20
|
+
// snap: lands in place at time t1, starting d seconds earlier (default one eighth note)
|
|
21
|
+
export const snap = (t, t1, d = E8) => E(seg(t, t1 - d, t1));
|
|
22
|
+
// linear segment
|
|
23
|
+
export const lin = (t, a, b) => seg(t, a, b);
|
|
24
|
+
// stepped rise: n steps, one precise ease per step ("one cell at a time")
|
|
25
|
+
export function steps(t, a, b, n) {
|
|
26
|
+
const p = seg(t, a, b) * n, i = Math.floor(p);
|
|
27
|
+
if (i >= n) return 1;
|
|
28
|
+
return (i + E(p - i)) / n;
|
|
29
|
+
}
|
|
30
|
+
// multi-segment snap track: keys = [[t_arrive, value, dur?], ...]; value can be a number or an array
|
|
31
|
+
export function track(keys) {
|
|
32
|
+
return t => {
|
|
33
|
+
let v = keys[0][1];
|
|
34
|
+
for (let i = 1; i < keys.length; i++) {
|
|
35
|
+
const [t1, v1, d = E8] = keys[i];
|
|
36
|
+
if (t < t1 - d) break;
|
|
37
|
+
const p = snap(t, t1, d);
|
|
38
|
+
v = Array.isArray(v1) ? v1.map((x, j) => lerp(v[j], x, p)) : lerp(v, v1, p);
|
|
39
|
+
if (p < 1) break;
|
|
40
|
+
}
|
|
41
|
+
return v;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"dur":44,"ev":[{"t":0,"type":"knife","g":1},{"t":0.5625,"type":"rule","g":0.5},{"t":0.6875,"type":"rule","g":0.5},{"t":0.8125,"type":"rule","g":0.5},{"t":0.9375,"type":"rule","g":0.5},{"t":1.0625,"type":"rule","g":0.5},{"t":1.1875,"type":"rule","g":0.5},{"t":1.3125,"type":"rule","g":0.5},{"t":1.4375,"type":"rule","g":0.5},{"t":1.5625,"type":"rule","g":0.5},{"t":1.6875,"type":"rule","g":0.5},{"t":1.8125,"type":"rule","g":0.5},{"t":1.9375,"type":"rule","g":0.5},{"t":2,"type":"clack","g":0.9},{"t":2.25,"type":"clack","g":0.9},{"t":2.5,"type":"clack","g":0.9},{"t":2.75,"type":"clack","g":0.9},{"t":3,"type":"clack","g":0.9},{"t":3.5,"type":"paper","g":1},{"t":4.125,"type":"thunk","g":0.45},{"t":4.25,"type":"thunk","g":0.45},{"t":4.25,"type":"rule","g":0.7},{"t":4.375,"type":"thunk","g":0.45},{"t":4.4,"type":"voice","id":"l1"},{"t":4.5,"type":"thunk","g":0.6},{"t":4.5,"type":"rule","g":0.7},{"t":4.75,"type":"rule","g":0.7},{"t":5,"type":"rule","g":0.7},{"t":5.25,"type":"rule","g":0.7},{"t":5.5,"type":"rule","g":0.7},{"t":5.75,"type":"rule","g":0.7},{"t":5.875,"type":"rule","g":0.45},{"t":6,"type":"rule","g":0.7},{"t":6,"type":"rule","g":0.45},{"t":6.125,"type":"rule","g":0.45},{"t":6.25,"type":"rule","g":0.45},{"t":6.375,"type":"rule","g":0.45},{"t":6.5,"type":"rule","g":0.45},{"t":6.625,"type":"rule","g":0.45},{"t":6.75,"type":"rule","g":0.45},{"t":6.875,"type":"rule","g":0.45},{"t":7,"type":"rule","g":0.45},{"t":7.125,"type":"rule","g":0.45},{"t":7.25,"type":"rule","g":0.45},{"t":7.375,"type":"rule","g":0.45},{"t":7.5,"type":"rule","g":0.45},{"t":7.625,"type":"rule","g":0.45},{"t":7.75,"type":"rule","g":0.45},{"t":7.875,"type":"rule","g":0.45},{"t":8.125,"type":"thunk","g":0.45},{"t":8.125,"type":"clack","g":0.7},{"t":8.25,"type":"thunk","g":0.45},{"t":8.25,"type":"clack","g":0.7},{"t":8.375,"type":"thunk","g":0.45},{"t":8.375,"type":"clack","g":0.7},{"t":8.4,"type":"voice","id":"l2"},{"t":8.5,"type":"thunk","g":0.6},{"t":8.5,"type":"clack","g":0.7},{"t":8.625,"type":"clack","g":0.7},{"t":8.75,"type":"clack","g":0.7},{"t":8.875,"type":"clack","g":0.7},{"t":9,"type":"clack","g":0.7},{"t":9.125,"type":"clack","g":0.7},{"t":9.25,"type":"clack","g":0.7},{"t":10,"type":"clackBig","g":1},{"t":12.125,"type":"thunk","g":0.45},{"t":12.25,"type":"thunk","g":0.45},{"t":12.375,"type":"thunk","g":0.45},{"t":12.4,"type":"voice","id":"l3"},{"t":12.5,"type":"thunk","g":0.6},{"t":12.5,"type":"knife","g":0.8},{"t":13,"type":"knife","g":0.8},{"t":13.5,"type":"knife","g":0.8},{"t":14,"type":"knife","g":0.8},{"t":15,"type":"slide","g":0.5},{"t":15.0625,"type":"slide","g":0.5},{"t":15.125,"type":"slide","g":0.5},{"t":15.1875,"type":"slide","g":0.5},{"t":15.25,"type":"slide","g":0.5},{"t":15.3125,"type":"slide","g":0.5},{"t":16,"type":"clackBig","g":0.9},{"t":16,"type":"slide","g":0.7},{"t":16.125,"type":"thunk","g":0.45},{"t":16.25,"type":"thunk","g":0.45},{"t":16.375,"type":"thunk","g":0.45},{"t":16.4,"type":"voice","id":"l4"},{"t":16.5,"type":"thunk","g":0.6},{"t":18.125,"type":"snap","g":0.5},{"t":18.25,"type":"snap","g":0.5},{"t":18.375,"type":"snap","g":0.5},{"t":18.5,"type":"snap","g":0.5},{"t":18.625,"type":"snap","g":0.5},{"t":18.75,"type":"snap","g":0.5},{"t":18.875,"type":"snap","g":0.5},{"t":19,"type":"snap","g":0.5},{"t":19.125,"type":"snap","g":0.5},{"t":19.25,"type":"snap","g":0.5},{"t":19.375,"type":"snap","g":0.5},{"t":19.5,"type":"snap","g":0.5},{"t":19.625,"type":"snap","g":0.5},{"t":19.75,"type":"snap","g":0.5},{"t":19.875,"type":"snap","g":0.5},{"t":20,"type":"snap","g":0.5},{"t":20,"type":"thump","g":1},{"t":20.1,"type":"voice","id":"l4b"},{"t":22.125,"type":"thunk","g":0.45},{"t":22.15,"type":"voice","id":"l5"},{"t":22.25,"type":"thunk","g":0.45},{"t":22.375,"type":"thunk","g":0.45},{"t":22.5,"type":"thunk","g":0.6},{"t":23.625,"type":"tick","g":0.7},{"t":24,"type":"tick","g":0.6},{"t":24,"type":"slide","g":1},{"t":24.6,"type":"voice","id":"l5b"},{"t":26,"type":"thump","g":1.1},{"t":26.125,"type":"snap","g":0.6},{"t":26.25,"type":"snap","g":0.6},{"t":26.375,"type":"snap","g":0.6},{"t":26.5,"type":"snap","g":0.6},{"t":26.625,"type":"snap","g":0.6},{"t":26.75,"type":"snap","g":0.6},{"t":26.875,"type":"snap","g":0.6},{"t":27,"type":"snap","g":0.6},{"t":27.125,"type":"clack","g":0.6},{"t":27.25,"type":"clack","g":0.6},{"t":27.375,"type":"clack","g":0.6},{"t":27.5,"type":"clack","g":0.6},{"t":27.625,"type":"clack","g":0.6},{"t":27.75,"type":"clack","g":0.6},{"t":29.25,"type":"swish","g":1,"d":0.75},{"t":30.625,"type":"tick","g":0.35},{"t":30.6875,"type":"tick","g":0.35},{"t":30.75,"type":"tick","g":0.35},{"t":30.8125,"type":"tick","g":0.35},{"t":30.875,"type":"tick","g":0.35},{"t":30.9375,"type":"tick","g":0.35},{"t":31,"type":"tick","g":0.35},{"t":31.75,"type":"rule","g":0.8},{"t":36,"type":"swish","g":0.8,"d":1},{"t":36.5,"type":"voice","id":"l6"},{"t":39,"type":"knife","g":1.1},{"t":39.5,"type":"swish","g":0.6,"d":0.5},{"t":40.25,"type":"clack","g":0.7},{"t":40.5,"type":"clack","g":0.7},{"t":40.75,"type":"clack","g":0.7},{"t":41,"type":"clack","g":0.7}]}
|
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
// Five Rules for a Poster —— timeline and drawing. Every coordinate is on the grid; every motion is snap (precise ease) or lin (linear).
|
|
2
|
+
// The only exception: the red circle's escape (linear, no snap, leaves the grid).
|
|
3
|
+
import { clamp, lerp, seg, E, snap, lin, steps, track, E8, E16, BEAT, BAR } from './ease.js';
|
|
4
|
+
|
|
5
|
+
export const W = 1920, H = 1080, DUR = 44;
|
|
6
|
+
export const C = {
|
|
7
|
+
page: '#EAE9E5', paper: '#FFFFFF', ink: '#111111', red: '#E30613',
|
|
8
|
+
grid: '#CFCEC9', pgrid: '#E2E1DC', bass: '#CFCEC9', mute: '#77766F', col: '#E2E1DC', wall: '#DFDED9',
|
|
9
|
+
};
|
|
10
|
+
// ---------- frame grid: 12 columns, margin 96, gutter 24 ----------
|
|
11
|
+
const FM = 96, FG = 24, FC = 122;
|
|
12
|
+
export const fx = i => FM + i * (FC + FG);
|
|
13
|
+
// ---------- poster (local coordinates): 706×1008; 7 columns × 91 = the 7 notes of A Dorian; 16 rows × 40 = 16 eighth notes ----------
|
|
14
|
+
export const PW = 706, PH = 1008, PM = 35, PMX = 34.5, CW = 91, RH = 40, NC = 7;
|
|
15
|
+
export const px = c => PMX + c * CW, py = r => PM + r * RH;
|
|
16
|
+
const SCORE_B = py(16);
|
|
17
|
+
|
|
18
|
+
// ---------- key moments ----------
|
|
19
|
+
export const T = {
|
|
20
|
+
run: 18.0, circleIn: 20.0, hes: 23.5, pageOut: 24.5, fly0: 24.5, pause: [25.0, 25.25], land: 26.0,
|
|
21
|
+
reflow: 26.125, txtFinal: 27.125, gridOff: 27.5, rot: 30.0, rotD: 1.5 * BEAT, labels: 30.5,
|
|
22
|
+
sweep: 32.0, wall: 37.0, wallD: 1.0, cut: 39.0, home: 40.0,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
let S = null, WORDS = {}, LINES = [];
|
|
26
|
+
export function setScore(s) { S = s; buildUnits(); }
|
|
27
|
+
export function setWords(w) { WORDS = w || {}; }
|
|
28
|
+
// subtitles = a line of typesetting within the layout. The first line is set small (lead-in), the rest large (statements)
|
|
29
|
+
const LAYOUT = { l1: [7.8, 'page'], l2: [11.8, 'page'], l3: [15.8, 'page'], l4: [19.85, 'page'], l4b: [22.15, 'page', 1], l5: [99, 'page'], l5b: [27.4, 'center'], l6: [39.95, 'wall'] };
|
|
30
|
+
export function setLines(lines, dur) {
|
|
31
|
+
LINES = lines.map(L => {
|
|
32
|
+
const i = L.text.indexOf('. '), [end, pos, soft] = LAYOUT[L.id];
|
|
33
|
+
const small = L.id === 'l5b' ? '' : L.text.slice(0, i + 1), big = L.id === 'l5b' ? L.text : L.text.slice(i + 2);
|
|
34
|
+
return { id: L.id, t: L.t, dur: dur[L.id], end, pos, soft, small, big, text: L.text };
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export const subs = () => LINES.map(L => ({ t0: L.t, t1: Math.min(L.end, L.id === 'l5' ? 24.5 : L.end), text: L.text }));
|
|
38
|
+
|
|
39
|
+
// ======================================================================
|
|
40
|
+
function font(g, weight, size, fam = 'Archivo') {
|
|
41
|
+
g.font = `${weight} ${size}px ${fam}`;
|
|
42
|
+
g.letterSpacing = size >= 90 && fam === 'Archivo' ? `${(-size * 0.022).toFixed(1)}px` : '0px';
|
|
43
|
+
}
|
|
44
|
+
const textW = (g, s) => g.measureText(s).width;
|
|
45
|
+
// a run of text that snaps in from below the baseline (p: 0→1 enters; q: 0→1 flips away upward)
|
|
46
|
+
function revealText(g, s, x, y, size, p, q = 0) {
|
|
47
|
+
if (p <= 0 || q >= 1) return;
|
|
48
|
+
const w = textW(g, s) + size * .1;
|
|
49
|
+
g.save(); g.beginPath(); g.rect(x - 2, y - size * 1.02, w + 4, size * 1.30); g.clip();
|
|
50
|
+
g.fillText(s, x, y + (1 - p) * size * 1.05 - q * size * 1.3);
|
|
51
|
+
g.restore();
|
|
52
|
+
}
|
|
53
|
+
function wordTimes(L) {
|
|
54
|
+
const n = (L.small ? L.small.split(' ').length : 0) + L.big.split(' ').length, w = WORDS[L.id];
|
|
55
|
+
if (w && w.length === n) return w.map(x => L.t + x);
|
|
56
|
+
return Array.from({ length: n }, (_, i) => L.t + i * .26);
|
|
57
|
+
}
|
|
58
|
+
function drawLine(g, L, t, x, ySmall, yBig, bigSize = 76) {
|
|
59
|
+
if (t < L.t - .1 || t > L.end + .2) return;
|
|
60
|
+
const ts = wordTimes(L), sm = L.small ? L.small.split(' ') : [], bg = L.big.split(' ');
|
|
61
|
+
const q = snap(t, L.end, E8);
|
|
62
|
+
let i = 0, cx = x;
|
|
63
|
+
font(g, 500, 30); g.fillStyle = C.mute;
|
|
64
|
+
for (const wd of sm) { revealText(g, wd, cx, ySmall, 30, snap(t, ts[i] + E16, E16), q); cx += textW(g, wd + ' '); i++; }
|
|
65
|
+
cx = x; font(g, L.soft ? 400 : 700, bigSize); g.fillStyle = C.ink;
|
|
66
|
+
for (const wd of bg) { revealText(g, wd, cx, yBig, bigSize, snap(t, ts[i] + E16, E16), q); cx += textW(g, wd + ' '); i++; }
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// ======================================================================
|
|
70
|
+
// poster text blocks: A messy (three typefaces) → B unified Archivo → C white space tightened → D flush left → E final
|
|
71
|
+
const TX = [
|
|
72
|
+
{ A: ['Neue Musik', 'Fraktur', 400, 118, 200], B: ['neue musik', 800, 112], C: [104, 800, 790], E: [PMX, 861, 150, 800], split: [PMX, 973] },
|
|
73
|
+
{ A: ['Grosses Konzert', 'DMSerif', 400, 62, 300], B: ['grosses konzert', 300, 62], cut: 14.0 },
|
|
74
|
+
{ A: ['!! nicht verpassen !!', 'Archivo', 800, 40, 370], B: ['!! nicht verpassen !!', 900, 40], cut: 12.5 },
|
|
75
|
+
{ A: ['Konzert 1961', 'DMSerif', 400, 58, 452], B: ['konzert 1961', 600, 58], C: [32, 600, 842], E: [px(3), 64, 32, 700] },
|
|
76
|
+
{ A: ['Freitag 17. März 1961 · 20.15 Uhr', 'Archivo', 400, 28, 520], B: ['freitag 17. märz 1961 · 20.15 uhr', 400, 28], C: [20, 400, 888], E: [px(3), 104, 20, 500] },
|
|
77
|
+
{ A: ['im Kleinen Saal', 'Fraktur', 400, 54, 600], B: ['kleiner saal', 700, 54], C: [20, 400, 914], E: [px(3), 130, 20, 500] },
|
|
78
|
+
{ A: ['mit Pauken und Trompeten', 'DMSerif', 400, 42, 680], B: ['mit pauken und trompeten', 500, 42], cut: 13.0 },
|
|
79
|
+
{ A: ['Werke von Marti, Brunner, Weiss', 'Archivo', 400, 24, 748], B: ['werke von marti, brunner, weiss', 400, 24], C: [20, 400, 940], E: [px(3), 156, 20, 400] },
|
|
80
|
+
{ A: ['Eintritt Fr. 3.–', 'DMSerif', 400, 36, 820], B: ['eintritt fr. 3.–', 600, 36], C: [20, 400, 966], E: [px(3), 182, 20, 400] },
|
|
81
|
+
{ A: ['— Nur ein Abend —', 'Fraktur', 400, 44, 900], B: ['nur ein abend', 800, 44], cut: 13.5 },
|
|
82
|
+
];
|
|
83
|
+
const T_TXT_IN = 8.0, T_FONT = 10.0, T_COMPACT = 15.0, T_ALIGN = 16.0;
|
|
84
|
+
const TXC = TX.filter(z => z.C);
|
|
85
|
+
function drawPosterText(g, t) {
|
|
86
|
+
if (t < T_TXT_IN) return;
|
|
87
|
+
TX.forEach((d, i) => {
|
|
88
|
+
const pin = snap(t, T_TXT_IN + i * E16 + E16, E16);
|
|
89
|
+
if (pin <= 0) return;
|
|
90
|
+
const useB = t >= T_FONT;
|
|
91
|
+
let text = useB ? d.B[0] : d.A[0], fam = useB ? 'Archivo' : d.A[1], wt = useB ? d.B[1] : d.A[2];
|
|
92
|
+
let size = useB ? d.B[2] : d.A[3], y = d.A[4], collapse = 1, xl = null;
|
|
93
|
+
if (d.cut) { if (t > d.cut + E8) return; collapse = 1 - snap(t, d.cut + E8, E8); }
|
|
94
|
+
if (d.C) {
|
|
95
|
+
const kc = TXC.indexOf(d), pc = snap(t, T_COMPACT + kc * E16 * .5, E8 * 2);
|
|
96
|
+
size = lerp(size, d.C[0], pc); y = lerp(y, d.C[2], pc); if (pc > .5) wt = d.C[1];
|
|
97
|
+
font(g, wt, size, fam);
|
|
98
|
+
xl = lerp(PW / 2 - textW(g, text) / 2, PMX, snap(t, T_ALIGN, E8 * 2));
|
|
99
|
+
const pf = snap(t, T.txtFinal + kc * E16, E8);
|
|
100
|
+
if (pf > 0) { xl = lerp(xl, d.E[0], pf); y = lerp(y, d.E[1], pf); size = lerp(size, d.E[2], pf); if (pf > .5) wt = d.E[3]; }
|
|
101
|
+
}
|
|
102
|
+
font(g, wt, size, fam); g.fillStyle = C.ink;
|
|
103
|
+
if (d.split && t >= T.txtFinal - E8) { // title split into two lines: musik drops to the second line
|
|
104
|
+
const pf = snap(t, T.txtFinal, E8), w1 = text.split(' ')[0];
|
|
105
|
+
const x2 = lerp(xl + textW(g, w1 + ' '), d.split[0], pf), y2 = lerp(y, d.split[1], snap(t, T.txtFinal + E16, E8));
|
|
106
|
+
g.fillText(w1, xl, y); g.fillText(text.slice(w1.length + 1), x2, y2);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const w = textW(g, text), x0 = xl ?? (PW / 2 - w / 2);
|
|
110
|
+
g.save();
|
|
111
|
+
if (collapse < 1) { const m = y - size * .35; g.translate(0, m); g.scale(1, Math.max(.001, collapse)); g.translate(0, -m); }
|
|
112
|
+
g.beginPath(); g.rect(x0 - 10, y - size * 1.1, w + 20, size * 1.45 * pin); g.clip();
|
|
113
|
+
g.fillText(text, x0, y);
|
|
114
|
+
g.restore();
|
|
115
|
+
if (d.cut && t > d.cut - E16 && t < d.cut + E8) { // knife line
|
|
116
|
+
g.fillStyle = C.ink; g.fillRect(PMX - 10, y - size * .35 - 1, (PW - 2 * PMX + 20) * lin(t, d.cut - E16, d.cut), 2);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// ======================================================================
|
|
122
|
+
// score units: 16 one-cell black blocks, from a rigid staircase → the final phrase (adjacent cells merge into long bars; the first bleeds off the top, the last bleeds off the right)
|
|
123
|
+
let UNITS = [];
|
|
124
|
+
function buildUnits() {
|
|
125
|
+
const slots = [];
|
|
126
|
+
S.final.lead.forEach(([c, r, l], bi) => { for (let j = 0; j < l; j++) slots.push({ c, r: r + j, first: j === 0, last: j === l - 1, bar: bi }); });
|
|
127
|
+
slots.sort((a, b) => a.r - b.r || a.c - b.c);
|
|
128
|
+
const [fcx, fcy] = circleFinalCenter();
|
|
129
|
+
UNITS = S.stiff.lead.map(([c, r], k) => ({ s: { c, r }, f: slots[k] }));
|
|
130
|
+
UNITS.map((u, k) => [k, Math.hypot(px(u.s.c) + CW / 2 - fcx, py(u.s.r) + RH / 2 - fcy)]).sort((a, b) => a[1] - b[1]).forEach(([k], rank) => UNITS[k].rank = rank);
|
|
131
|
+
}
|
|
132
|
+
function rectOf(c, r, first = true, last = true, bar = -1) {
|
|
133
|
+
let x0 = px(c) + 4, x1 = px(c) + CW - 4, y0 = first ? py(r) + 3 : py(r) - 1, y1 = last ? py(r + 1) - 3 : py(r + 1) + 1;
|
|
134
|
+
const bl = S.final.bleed && S.final.bleed[bar];
|
|
135
|
+
if (bl === 'top' && first) y0 = -2;
|
|
136
|
+
if (bl === 'right') x1 = PW + 2;
|
|
137
|
+
return [x0, y0, x1 - x0, y1 - y0];
|
|
138
|
+
}
|
|
139
|
+
const barOn = (bar, row) => { const b = S.final.lead[bar]; return row >= b[1] && row < b[1] + b[2]; };
|
|
140
|
+
function drawUnits(g, t, playRow) {
|
|
141
|
+
for (let k = 0; k < UNITS.length; k++) {
|
|
142
|
+
const u = UNITS[k], pin = snap(t, T.run + k * E16 + E16, E16);
|
|
143
|
+
if (pin <= 0) continue;
|
|
144
|
+
let R = rectOf(u.s.c, u.s.r);
|
|
145
|
+
const pf = snap(t, T.reflow + Math.floor(u.rank / 2) * E16, E8);
|
|
146
|
+
if (pf > 0) { const F = rectOf(u.f.c, u.f.r, u.f.first, u.f.last, u.f.bar); R = R.map((v, j) => lerp(v, F[j], pf)); }
|
|
147
|
+
g.fillStyle = playRow != null && barOn(u.f.bar, playRow) ? C.red : C.ink;
|
|
148
|
+
g.fillRect(R[0], R[1], R[2], R[3] * pin);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function drawBass(g, t) {
|
|
152
|
+
const p0 = lin(t, 16.0, 17.0);
|
|
153
|
+
if (p0 <= 0) return;
|
|
154
|
+
[[0, 0, 8], [0, 8, 4], [0, 12, 4]].forEach(([c, r, l], i) => {
|
|
155
|
+
const [fc, fr, fl] = S.final.bass[i], q = snap(t, T.reflow + E8 + i * E8, E8);
|
|
156
|
+
const cc = lerp(c, fc, q), rr = lerp(r, fr, q), ll = lerp(l, fl, q);
|
|
157
|
+
const y0 = py(rr), y1 = Math.min(py(rr + ll), PM + (SCORE_B - PM) * p0);
|
|
158
|
+
if (y1 > y0) { g.fillStyle = C.bass; g.fillRect(px(cc), y0, CW, y1 - y0); }
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// ======================================================================
|
|
163
|
+
// red circle: rigid position = top-right cell (2-column diameter); final = bottom left, 4-column diameter, bleeding off the left, overlapped by the title
|
|
164
|
+
const D0 = () => CW * S.circleDiameterCols.stiff, D1 = () => CW * S.circleDiameterCols.final;
|
|
165
|
+
function circleFinalCenter() { const [c, r] = S.final.circle, d = CW * S.circleDiameterCols.final; return [px(c) + d / 2, py(r) + d / 2]; }
|
|
166
|
+
export function flight(t) { return lin(t, T.fly0, T.pause[0]) * .4 + lin(t, T.pause[1], T.land) * .6; }
|
|
167
|
+
export function circleState(t) { // → [left, top, d] (poster-local pixels)
|
|
168
|
+
const [c0, r0] = S.stiff.circle, [c1, r1] = S.final.circle, d0 = D0(), d1 = D1();
|
|
169
|
+
let x0 = px(c0) + .25 * CW * (snap(t, T.hes, E16) - snap(t, T.hes + .375, E16)), y0 = py(r0);
|
|
170
|
+
y0 = lerp(-d0 - 4, y0, snap(t, T.circleIn, BEAT)); // entrance: drops from the poster's top edge down its own column
|
|
171
|
+
const a = flight(t), d = lerp(d0, d1, a);
|
|
172
|
+
const cx = lerp(x0 + d0 / 2, px(c1) + d1 / 2, a), cy = lerp(y0 + d0 / 2, py(r1) + d1 / 2, a);
|
|
173
|
+
return [cx - d / 2, cy - d / 2, d];
|
|
174
|
+
}
|
|
175
|
+
function drawCircle(g, t, pulse) {
|
|
176
|
+
if (t < T.circleIn - BEAT) return;
|
|
177
|
+
const [l, tp, d] = circleState(t), cx = l + d / 2, cy = tp + d / 2;
|
|
178
|
+
if (t > T.fly0 && t < T.gridOff + E8) { // the empty cell and track left behind after it leaves (1.5 px red line)
|
|
179
|
+
const [c0, r0] = S.stiff.circle, d0 = D0(), gx = px(c0) + d0 / 2, gy = py(r0) + d0 / 2;
|
|
180
|
+
const k = 1 - snap(t, T.gridOff + E8, E8);
|
|
181
|
+
g.strokeStyle = C.red; g.lineWidth = 1.5;
|
|
182
|
+
g.beginPath(); g.arc(gx, gy, d0 / 2 * k, 0, Math.PI * 2); g.stroke();
|
|
183
|
+
g.beginPath(); g.moveTo(lerp(gx, cx, 1 - k), lerp(gy, cy, 1 - k)); g.lineTo(cx, cy); g.stroke();
|
|
184
|
+
}
|
|
185
|
+
g.fillStyle = C.red; g.beginPath(); g.arc(cx, cy, d / 2, 0, Math.PI * 2); g.fill();
|
|
186
|
+
if (pulse > 0 && pulse < 1) { // hit by the playhead: a ring of red line spreads outward
|
|
187
|
+
g.strokeStyle = C.red; g.lineWidth = 6 * (1 - pulse);
|
|
188
|
+
g.beginPath(); g.arc(cx, cy, d / 2 + 70 * E(pulse), 0, Math.PI * 2); g.stroke();
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// ======================================================================
|
|
193
|
+
// poster grid lines
|
|
194
|
+
function gridState(t) {
|
|
195
|
+
const v = [], h = [];
|
|
196
|
+
const off1 = seg(t, 20.0, 20.5), on2 = seg(t, 24.0, 24.5), off2 = seg(t, T.gridOff, T.gridOff + .5), off3 = seg(t, 36.0, 36.4);
|
|
197
|
+
for (let c = 0; c <= NC; c++) {
|
|
198
|
+
const p1 = lin(t, 4.0 + c * E8, 4.0 + c * E8 + E8), p3 = lin(t, T.rot + c * E16 * .5, T.rot + c * E16 * .5 + E8);
|
|
199
|
+
v.push(t < 22 ? p1 * (1 - off1) : t < 29 ? on2 * (1 - off2) : p3 * (1 - off3));
|
|
200
|
+
}
|
|
201
|
+
for (let r = 0; r <= 16; r++) {
|
|
202
|
+
const p1 = lin(t, 5.625 + r * E16, 5.625 + r * E16 + E8), p3 = lin(t, T.rot + .125 + r * E16 * .25, T.rot + .125 + r * E16 * .25 + E8);
|
|
203
|
+
h.push(t < 22 ? p1 * (1 - off1) : t < 29 ? on2 * (1 - off2) : p3 * (1 - off3));
|
|
204
|
+
}
|
|
205
|
+
const ext = t < 29 ? E(on2) * (1 - E(off2)) : E(seg(t, T.rot, T.rot + .5)) * (1 - E(off3));
|
|
206
|
+
return { v, h, ext };
|
|
207
|
+
}
|
|
208
|
+
function drawPosterGrid(g, t, G, stroke) {
|
|
209
|
+
g.strokeStyle = stroke; g.lineWidth = 1; g.beginPath();
|
|
210
|
+
const bOff = seg(t, 20.0, 20.5);
|
|
211
|
+
if (t < 22) for (let k = 0; k <= 10; k++) {
|
|
212
|
+
const p = lin(t, 7.0 + k * E16 * .5, 7.0 + k * E16 * .5 + E8) * (1 - bOff), y = 713 + k * 26 + .5;
|
|
213
|
+
if (p > 0) { g.moveTo(PMX, y); g.lineTo(PMX + (PW - 2 * PMX) * p, y); }
|
|
214
|
+
}
|
|
215
|
+
G.v.forEach((p, c) => { if (p > 0) { g.moveTo(px(c) + .5, PM); g.lineTo(px(c) + .5, PM + (SCORE_B - PM) * p); } });
|
|
216
|
+
G.h.forEach((p, r) => { if (p > 0) { g.moveTo(PMX, py(r) + .5); g.lineTo(PMX + (PW - 2 * PMX) * p, py(r) + .5); } });
|
|
217
|
+
g.stroke();
|
|
218
|
+
}
|
|
219
|
+
function drawGridExt(g, G) { // grid extends beyond the poster to fill the frame
|
|
220
|
+
if (G.ext <= 0) return;
|
|
221
|
+
const L = 2600 * G.ext;
|
|
222
|
+
g.strokeStyle = C.grid; g.lineWidth = 1; g.beginPath();
|
|
223
|
+
for (let c = 0; c <= NC; c++) { g.moveTo(px(c) + .5, 0); g.lineTo(px(c) + .5, -L); g.moveTo(px(c) + .5, PH); g.lineTo(px(c) + .5, PH + L); }
|
|
224
|
+
for (let r = 0; r <= 16; r++) { g.moveTo(0, py(r) + .5); g.lineTo(-L, py(r) + .5); g.moveTo(PW, py(r) + .5); g.lineTo(PW + L, py(r) + .5); }
|
|
225
|
+
g.stroke();
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// ======================================================================
|
|
229
|
+
// camera: poster centre, zoom, rotation
|
|
230
|
+
const SPREAD = [1471, 540, 1, 0];
|
|
231
|
+
const CAM = track([
|
|
232
|
+
[0, SPREAD],
|
|
233
|
+
[T.pageOut, [860, 540, 1, 0], BEAT],
|
|
234
|
+
[T.rot, [960, 540, 1.34, -Math.PI / 2], T.rotD],
|
|
235
|
+
[T.wall, [960, 452, 0.42, 0], T.wallD],
|
|
236
|
+
[T.home, SPREAD, BEAT],
|
|
237
|
+
]);
|
|
238
|
+
export function posterMatrix(t) {
|
|
239
|
+
const [cx, cy, s, r] = CAM(t);
|
|
240
|
+
return new DOMMatrix().translate(cx, cy).rotate(r * 180 / Math.PI).scale(s).translate(-PW / 2, -PH / 2);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// ======================================================================
|
|
244
|
+
// left page: giant numeral, rule annotation, annotation lines, bar counter
|
|
245
|
+
const RULES = [[4.0, '1', 'Grid'], [8.0, '2', 'Typeface'], [12.0, '3', 'Space'], [16.0, '4', 'Alignment'], [22.0, '5', 'Exception']];
|
|
246
|
+
let NUM_SIZE = 980, NUM_ASC = 0.72;
|
|
247
|
+
export function measureNumeral(g) { font(g, 700, 100); NUM_ASC = g.measureText('4').actualBoundingBoxAscent / 100; NUM_SIZE = Math.round(700 / NUM_ASC); }
|
|
248
|
+
function drawNumeral(g, t) {
|
|
249
|
+
const base = 1044, h = NUM_SIZE * NUM_ASC;
|
|
250
|
+
for (let i = 0; i < RULES.length; i++) {
|
|
251
|
+
const [tr, n] = RULES[i], tn = RULES[i + 1] ? RULES[i + 1][0] : 99;
|
|
252
|
+
if (t < tr || t > tn + .01) continue;
|
|
253
|
+
const up = steps(t, tr, tr + BEAT, 4), down = snap(t, tn, E8 * 2);
|
|
254
|
+
g.save(); g.beginPath(); g.rect(0, base - h - 40, 1100, h + 40); g.clip();
|
|
255
|
+
font(g, 700, NUM_SIZE); g.fillStyle = C.ink;
|
|
256
|
+
const lsb = -g.measureText(n).actualBoundingBoxLeft; // optical left alignment
|
|
257
|
+
g.fillText(n, fx(0) - lsb, base + (1 - up) * (h + 40) + down * (h + 40));
|
|
258
|
+
g.restore();
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
const NOTES = [
|
|
262
|
+
['Columns 7', 'Rows 16', 'Module 91 × 40'],
|
|
263
|
+
['Family Archivo', 'Weights 400–800', 'Voices 1'],
|
|
264
|
+
['Lines removed 4', 'White space 62 %', ''],
|
|
265
|
+
['Axis flush left', 'Every edge on a line', ''],
|
|
266
|
+
['Exceptions 1', '', ''],
|
|
267
|
+
];
|
|
268
|
+
function drawRuleNotes(g, t) {
|
|
269
|
+
const ri = RULES.findLastIndex(r => t >= r[0]); if (ri < 0) return;
|
|
270
|
+
const tr = RULES[ri][0], tn = RULES[ri + 1] ? RULES[ri + 1][0] : 99, q = snap(t, tn, E8);
|
|
271
|
+
font(g, 500, 19); g.fillStyle = C.ink;
|
|
272
|
+
NOTES[ri].forEach((s, i) => { if (s) revealText(g, s, fx(4), 992 + i * 26, 19, snap(t, tr + BEAT + i * E16, E16), q); });
|
|
273
|
+
g.fillRect(fx(4), 962, FC * 2 + FG, 1);
|
|
274
|
+
}
|
|
275
|
+
function captionRow(g, x, p, q, a, b, c) {
|
|
276
|
+
g.fillStyle = C.ink; g.fillRect(fx(0) + x, 36, (fx(5) + FC - fx(0)) * p * (1 - q), 1);
|
|
277
|
+
font(g, 500, 19);
|
|
278
|
+
revealText(g, a, fx(0) + x, 66, 19, p, q); revealText(g, b, fx(2) + x, 66, 19, p, q); revealText(g, c, fx(4) + x, 66, 19, p, q);
|
|
279
|
+
}
|
|
280
|
+
function drawCaptions(g, t) {
|
|
281
|
+
if (t < 2.0 || t > T.rot + .1) return;
|
|
282
|
+
const p = snap(t, 2.0 + E8, E8), q = snap(t, T.rot - T.rotD + E8, E8);
|
|
283
|
+
const ri = RULES.findLastIndex(r => t >= r[0]);
|
|
284
|
+
if (ri < 0) captionRow(g, 0, p, q, 'A programme in five steps', '1961', '♩ = 120');
|
|
285
|
+
else captionRow(g, 0, p, q, 'Five Rules for a Poster', `Rule 0${RULES[ri][1]} / 05`, RULES[ri][2]);
|
|
286
|
+
}
|
|
287
|
+
function drawBarCounter(g, t, pageX) {
|
|
288
|
+
if (t < 4) return;
|
|
289
|
+
const bar = Math.floor(t / BAR) + 1, beat = Math.floor((t % BAR) / BEAT) + 1;
|
|
290
|
+
font(g, 500, 18); g.fillStyle = C.mute; g.fillText('♩ = 120', fx(6) + pageX, 1016);
|
|
291
|
+
g.fillStyle = C.ink; font(g, 600, 18); g.fillText(`bar ${String(bar).padStart(2, '0')}.${beat}`, fx(6) + pageX, 1044);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// ======================================================================
|
|
295
|
+
// opening: red line + grid columns + title
|
|
296
|
+
function drawOpening(g, t) {
|
|
297
|
+
if (t > 8.3) return;
|
|
298
|
+
const Y = 300;
|
|
299
|
+
for (let c = 0; c < 12; c++) { // grid columns: grow up and down at once from the red line (one column per sixteenth note); retract when rule one ends
|
|
300
|
+
const p = snap(t, .5 + c * E16 + E16, E16) * (1 - snap(t, 8.0 + (11 - c) * E16 * .25, E8));
|
|
301
|
+
if (p > 0) { g.fillStyle = C.col; g.fillRect(fx(c), Y - Y * p, FC, Y * p + (H - Y) * p); }
|
|
302
|
+
}
|
|
303
|
+
if (t > 4.2) return;
|
|
304
|
+
const pr = lin(t, 0, .5), pout = snap(t, 4.0, E8 * 2);
|
|
305
|
+
if (pr > 0 && pout < 1) { g.fillStyle = C.red; g.fillRect(W * pout, Y, W * (pr - pout), 3); }
|
|
306
|
+
const q = snap(t, 3.875 + E8, E8);
|
|
307
|
+
font(g, 700, 120); g.fillStyle = C.ink;
|
|
308
|
+
let x = fx(0); ['Five', 'Rules'].forEach((w, i) => { revealText(g, w, x, 168, 120, snap(t, 2.0 + i * E8 + E16, E16), q); x += textW(g, w + ' '); });
|
|
309
|
+
x = fx(0); ['for', 'a', 'Poster'].forEach((w, i) => { revealText(g, w, x, 276, 120, snap(t, 2.5 + i * E8 + E16, E16), q); x += textW(g, w + ' '); });
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// ======================================================================
|
|
313
|
+
// poster wall: the same system, each poster breaks a different rule (the rebel elements are all red)
|
|
314
|
+
const GAP = 80, SLOT = PW + GAP;
|
|
315
|
+
const VAR = [
|
|
316
|
+
{ k: -2, head: ['klang'], sub: 'konzert 1962', lead: [[0, 2, 2], [1, 4, 1], [2, 5, 3], [4, 8, 2], [5, 10, 1], [6, 11, 3]], bass: [[0, 0, 8], [4, 8, 8]], circ: [4, 1], rebel: 'typeface', label: 'breaks rule 2 · typeface' },
|
|
317
|
+
{ k: -1, head: ['takt'], sub: 'konzert 1963', lead: [[0, 0, 1], [1, 1, 1], [2, 2, 4], [3, 6, 1], [4, 7, 1], [5, 8, 4], [6, 12, 2]], bass: [[0, 0, 16]], circ: null, rebel: 'space', label: 'breaks rule 3 · space' },
|
|
318
|
+
{ k: 0, label: 'breaks rule 1 · grid', ours: true },
|
|
319
|
+
{ k: 1, head: ['stille'], sub: 'konzert 1964', lead: [[0, 0, 6], [3, 8, 1], [6, 12, 4]], bass: [[0, 6, 6]], circ: [4, 2], rebel: 'align', label: 'breaks rule 4 · alignment' },
|
|
320
|
+
{ k: 2, head: ['puls'], sub: 'konzert 1965', lead: [[0, 1, 2], [2, 3, 2], [1, 6, 3], [4, 7, 2], [3, 10, 3], [6, 12, 2]], bass: [[2, 0, 8], [5, 8, 8]], circ: [0, 11], rebel: 'all', label: 'breaks all five' },
|
|
321
|
+
];
|
|
322
|
+
function drawVariant(g, v) {
|
|
323
|
+
g.save(); g.translate(v.k * SLOT, 0);
|
|
324
|
+
g.fillStyle = C.paper; g.fillRect(0, 0, PW, PH);
|
|
325
|
+
g.beginPath(); g.rect(0, 0, PW, PH); g.clip();
|
|
326
|
+
const chaos = v.rebel === 'all';
|
|
327
|
+
v.bass.forEach(([c, r, l]) => { g.fillStyle = C.bass; g.fillRect(px(c), py(r), CW, l * RH); });
|
|
328
|
+
if (v.rebel === 'space') { g.fillStyle = C.red; g.fillRect(px(3), py(0), PW - px(3) + 2, py(8) - py(0)); } // the white space is filled
|
|
329
|
+
v.lead.forEach(([c, r, l], i) => {
|
|
330
|
+
g.save();
|
|
331
|
+
if (chaos) { g.translate(px(c) + CW / 2, py(r)); g.rotate((i % 2 ? .35 : -.25)); g.translate(-(px(c) + CW / 2), -py(r)); }
|
|
332
|
+
g.fillStyle = C.ink; g.fillRect(px(c) + 4, py(r) + 3, CW - 8, l * RH - 6);
|
|
333
|
+
g.restore();
|
|
334
|
+
});
|
|
335
|
+
if (v.circ) {
|
|
336
|
+
const d = 2 * CW, [c, r] = v.circ;
|
|
337
|
+
g.fillStyle = chaos ? C.red : C.ink;
|
|
338
|
+
const ox = chaos ? 57 : 0, oy = chaos ? 23 : 0;
|
|
339
|
+
g.beginPath(); g.arc(px(c) + d / 2 + ox, py(r) + d / 2 + oy, d / 2, 0, Math.PI * 2); g.fill();
|
|
340
|
+
}
|
|
341
|
+
// title
|
|
342
|
+
const head = v.head[0];
|
|
343
|
+
if (v.rebel === 'typeface') { font(g, 400, 190, 'Fraktur'); g.fillStyle = C.red; g.fillText('Klang', PMX, 960); }
|
|
344
|
+
else if (chaos) {
|
|
345
|
+
font(g, 400, 150, 'DMSerif'); g.fillStyle = C.ink; g.save(); g.translate(PW / 2, 900); g.rotate(-.12); g.textAlign = 'center'; g.fillText('Puls!', 0, 0); g.restore();
|
|
346
|
+
font(g, 400, 60, 'Fraktur'); g.textAlign = 'center'; g.fillText('Konzert 1965', PW / 2, 990); g.textAlign = 'left';
|
|
347
|
+
} else if (v.rebel === 'align') { font(g, 800, 170); g.fillStyle = C.red; g.fillText(head, PW - PMX - textW(g, head) + 6, 973); } // title not flush left
|
|
348
|
+
else { font(g, 800, 170); g.fillStyle = C.ink; g.fillText(head, PMX, 973); }
|
|
349
|
+
// info block
|
|
350
|
+
const info = [v.sub, 'freitag · 20.15 uhr', 'kleiner saal', 'eintritt fr. 3.–'];
|
|
351
|
+
if (!chaos) info.forEach((s, i) => {
|
|
352
|
+
font(g, i ? 500 : 700, i ? 20 : 32);
|
|
353
|
+
let x = px(3), y = i ? 78 + i * 26 : 64;
|
|
354
|
+
g.fillStyle = C.ink;
|
|
355
|
+
g.fillText(s, x, y);
|
|
356
|
+
});
|
|
357
|
+
else { font(g, 700, 34, 'DMSerif'); g.fillStyle = C.ink; g.textAlign = 'center'; g.fillText('freitag 20.15 uhr', PW / 2 + 60, 120); g.textAlign = 'left'; }
|
|
358
|
+
g.restore();
|
|
359
|
+
}
|
|
360
|
+
// the wall labels
|
|
361
|
+
function drawWallLabels(g, t, M) {
|
|
362
|
+
if (t < T.wall || t > T.cut + .01) return;
|
|
363
|
+
VAR.forEach((v, i) => {
|
|
364
|
+
const q = M.transformPoint(new DOMPoint(v.k * SLOT, PH + 60));
|
|
365
|
+
font(g, v.ours ? 700 : 500, 22); g.fillStyle = v.ours ? C.red : C.ink;
|
|
366
|
+
revealText(g, v.label, q.x, q.y + 20, 22, snap(t, T.wall + E8 + i * E16, E16), snap(t, T.cut, E8));
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// ======================================================================
|
|
371
|
+
// end card
|
|
372
|
+
function drawEndCard(g, t, opt = {}) {
|
|
373
|
+
if (t < T.cut) return;
|
|
374
|
+
if (t < T.home - E8) return;
|
|
375
|
+
const p = snap(t, T.home + E8, E8);
|
|
376
|
+
if (opt.poster) { // poster: the film title as main headline
|
|
377
|
+
captionRow(g, 0, 1, 0, 'Swiss Motion Graphics', 'A Lemo-Opuscar film', 'LemoLab \u00d7 Claude Opus 5.5');
|
|
378
|
+
font(g, 700, 120); g.fillStyle = C.ink; g.fillText('Five Rules', fx(0), 168); g.fillText('for a Poster', fx(0), 276);
|
|
379
|
+
font(g, 500, 19); ['Typeface Archivo', 'Score A dorian \u00b7 120 bpm', 'Grid 7 \u00d7 16'].forEach((s, i) => g.fillText(s, fx(4), 992 + i * 26));
|
|
380
|
+
g.fillRect(fx(4), 962, FC * 2 + FG, 1);
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
captionRow(g, 0, p, 0, 'Five Rules for a Poster', 'A Lemo-Opuscar film', '2026');
|
|
384
|
+
font(g, 700, 120); g.fillStyle = C.ink;
|
|
385
|
+
let x = fx(0); ['Swiss', 'Motion'].forEach((w, i) => { revealText(g, w, x, 168, 120, snap(t, T.home + E8 + i * E8, E16)); x += textW(g, w + ' '); });
|
|
386
|
+
x = fx(0); revealText(g, 'Graphics', x, 276, 120, snap(t, T.home + E8 + 2 * E8, E16));
|
|
387
|
+
font(g, 600, 36); revealText(g, 'LemoLab × Claude Opus 5.5', fx(0), 372, 36, snap(t, T.home + BEAT * 2, E16));
|
|
388
|
+
font(g, 500, 19); g.fillStyle = C.ink;
|
|
389
|
+
// the last two lines are the licence credit for the drum samples (fine print); the list comes in early enough to hold ≥ 2.5 s
|
|
390
|
+
['Typeface Archivo', 'Score A dorian · 120 bpm', 'Voice Kokoro af_sarah', 'Drums MuldjordKit', 'Lars Muldjord · CC BY 4.0'].forEach((s, i) => revealText(g, s, fx(4), 940 + i * 26, 19, snap(t, T.home + BEAT * 1.5 + i * E16, E16)));
|
|
391
|
+
g.fillRect(fx(4), 910, (FC * 2 + FG) * snap(t, T.home + BEAT * 1.5, E8), 1);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// ======================================================================
|
|
395
|
+
// main render
|
|
396
|
+
export function renderFilm(g, t, opt = {}) {
|
|
397
|
+
g.setTransform(1, 0, 0, 1, 0, 0);
|
|
398
|
+
g.fillStyle = C.page; g.fillRect(0, 0, W, H);
|
|
399
|
+
g.textBaseline = 'alphabetic';
|
|
400
|
+
drawOpening(g, t);
|
|
401
|
+
|
|
402
|
+
const pageX = -1200 * snap(t, T.pageOut, BEAT);
|
|
403
|
+
if (pageX > -1190) {
|
|
404
|
+
g.save(); g.translate(pageX, 0);
|
|
405
|
+
drawNumeral(g, t); drawRuleNotes(g, t);
|
|
406
|
+
for (const L of LINES) if (L.pos === 'page') drawLine(g, L, t, fx(0), 168, 252);
|
|
407
|
+
g.restore();
|
|
408
|
+
drawBarCounter(g, t, pageX);
|
|
409
|
+
}
|
|
410
|
+
drawCaptions(g, t);
|
|
411
|
+
if (t >= T.home - BEAT) { g.fillStyle = C.red; g.fillRect(0, lerp(452, 300, snap(t, T.home, BEAT)), W, 3); } // the red line drops to the title line (behind the poster)
|
|
412
|
+
|
|
413
|
+
if (t >= 3.5 - E8) {
|
|
414
|
+
const M = posterMatrix(t);
|
|
415
|
+
g.setTransform(M);
|
|
416
|
+
// poster wall (appears only on the pull-out; cut away by the red line at 39.0)
|
|
417
|
+
if (t > 36.0 && t < T.home) {
|
|
418
|
+
const cutX = lin(t, T.cut, T.cut + .5) * W;
|
|
419
|
+
{ // wall panels: cut away where the red line passes (left to right in screen space)
|
|
420
|
+
const a = M.transformPoint(new DOMPoint(-2 * SLOT - 120, -110)), b = M.transformPoint(new DOMPoint(2 * SLOT + PW + 120, PH + 110));
|
|
421
|
+
const x0 = Math.max(Math.min(a.x, b.x), t > T.cut ? cutX : -1e9), x1 = Math.max(a.x, b.x);
|
|
422
|
+
g.setTransform(1, 0, 0, 1, 0, 0);
|
|
423
|
+
if (Math.abs(M.b) < 1e-6 && x1 > x0) { g.fillStyle = C.wall; g.fillRect(x0, Math.min(a.y, b.y), x1 - x0, Math.abs(b.y - a.y)); }
|
|
424
|
+
else if (Math.abs(M.b) >= 1e-6) { g.setTransform(M); g.fillStyle = C.wall; g.fillRect(-2 * SLOT - 120, -110, 4 * SLOT + PW + 240, PH + 220); }
|
|
425
|
+
g.setTransform(M);
|
|
426
|
+
}
|
|
427
|
+
for (const v of VAR) {
|
|
428
|
+
if (v.ours) continue;
|
|
429
|
+
const sx = M.transformPoint(new DOMPoint(v.k * SLOT + PW / 2, PH / 2)).x;
|
|
430
|
+
const tc = T.cut + .5 * clamp(sx / W), k = 1 - snap(t, tc + E8, E8);
|
|
431
|
+
if (k <= 0) continue;
|
|
432
|
+
g.save(); g.translate(0, PH / 2); g.scale(1, k); g.translate(0, -PH / 2); drawVariant(g, v); g.restore();
|
|
433
|
+
}
|
|
434
|
+
g.setTransform(1, 0, 0, 1, 0, 0);
|
|
435
|
+
g.fillStyle = C.red; if (t > T.cut && t < T.home - BEAT) g.fillRect(0, 452, cutX, 3);
|
|
436
|
+
g.setTransform(M);
|
|
437
|
+
}
|
|
438
|
+
const G = gridState(t);
|
|
439
|
+
drawGridExt(g, G);
|
|
440
|
+
const pin = snap(t, 3.5, E8);
|
|
441
|
+
g.fillStyle = C.paper; g.fillRect(0, 0, PW, PH * pin);
|
|
442
|
+
g.save(); g.beginPath(); g.rect(0, 0, PW, PH * pin); g.clip();
|
|
443
|
+
drawPosterGrid(g, t, G, t < 21 ? '#C9C8C2' : C.pgrid);
|
|
444
|
+
drawBass(g, t);
|
|
445
|
+
const playRow = (t >= T.sweep && t < T.sweep + 4) ? (t - T.sweep) / E8 : null;
|
|
446
|
+
drawUnits(g, t, playRow);
|
|
447
|
+
const cr = S.final.circle[1];
|
|
448
|
+
drawCircle(g, t, playRow != null ? seg(playRow, cr, cr + 4) : 0);
|
|
449
|
+
drawPosterText(g, t);
|
|
450
|
+
g.restore();
|
|
451
|
+
// playhead: drawn vertically at 31.75, sweeps linearly 32–36, retracts at 36
|
|
452
|
+
const ph = seg(t, T.sweep - BEAT / 2, T.sweep) * (1 - seg(t, T.sweep + 4, T.sweep + 4 + E8));
|
|
453
|
+
if (ph > 0) {
|
|
454
|
+
const row = clamp((t - T.sweep) / E8, 0, 16);
|
|
455
|
+
g.fillStyle = C.red; g.fillRect(-24, py(row) - 2, (PW + 48) * ph, 4);
|
|
456
|
+
}
|
|
457
|
+
g.setTransform(1, 0, 0, 1, 0, 0);
|
|
458
|
+
drawScoreLabels(g, t, M);
|
|
459
|
+
drawWallLabels(g, t, M);
|
|
460
|
+
}
|
|
461
|
+
drawHUD(g, t);
|
|
462
|
+
drawEndCard(g, t, opt);
|
|
463
|
+
if (!opt.nosub) for (const L of LINES) {
|
|
464
|
+
if (L.pos === 'center') drawLine(g, L, t, fx(0), 780, 848);
|
|
465
|
+
if (L.pos === 'wall') drawLine(g, L, t, fx(0), 928, 1004);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// note names and bar numbers after the rotation reveal (upright text, drawn in screen coordinates)
|
|
470
|
+
function drawScoreLabels(g, t, M) {
|
|
471
|
+
const q = snap(t, 36.0 + E8, E8);
|
|
472
|
+
if (t < T.labels || q >= 1) return;
|
|
473
|
+
const used = new Set(S.final.lead.map(n => n[0]));
|
|
474
|
+
font(g, 700, 26);
|
|
475
|
+
for (let c = 0; c < NC; c++) {
|
|
476
|
+
const pt = M.transformPoint(new DOMPoint(px(c) + CW / 2, -22));
|
|
477
|
+
g.fillStyle = used.has(c) ? C.ink : C.mute;
|
|
478
|
+
revealText(g, S.cols[c], pt.x - textW(g, S.cols[c]) - 6, pt.y + 9, 26, snap(t, T.labels + E16 + c * E16 * .5, E16), q);
|
|
479
|
+
}
|
|
480
|
+
font(g, 600, 22);
|
|
481
|
+
[0, 8].forEach((r, i) => {
|
|
482
|
+
const pt = M.transformPoint(new DOMPoint(PW + 16, py(r)));
|
|
483
|
+
g.fillStyle = C.ink; revealText(g, `bar ${i + 1}`, pt.x, pt.y - 10, 22, snap(t, T.labels + BEAT + i * E8, E16), q);
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
// coordinate readout during the escape (close to the poster's right edge)
|
|
487
|
+
function drawHUD(g, t) {
|
|
488
|
+
const p = snap(t, T.fly0, E8) * (1 - snap(t, T.gridOff + E8, E8));
|
|
489
|
+
if (p <= 0) return;
|
|
490
|
+
const [l, tp] = circleState(t), c = (l - PMX) / CW, r = (tp - PM) / RH;
|
|
491
|
+
const on = t < T.fly0 + .01, x = 1290;
|
|
492
|
+
font(g, 500, 26); g.fillStyle = C.mute;
|
|
493
|
+
revealText(g, 'col', x, 500, 26, p); revealText(g, 'row', x, 540, 26, p);
|
|
494
|
+
font(g, 700, 26); g.fillStyle = C.ink;
|
|
495
|
+
revealText(g, (c < 0 ? '−' : '') + Math.abs(c).toFixed(2), x + 80, 500, 26, p); revealText(g, r.toFixed(2), x + 80, 540, 26, p);
|
|
496
|
+
g.fillStyle = on ? C.ink : C.red; font(g, 700, 26);
|
|
497
|
+
revealText(g, on ? 'on grid' : 'off grid', x, 596, 26, p);
|
|
498
|
+
g.fillStyle = C.ink; g.fillRect(x, 460, 240 * p, 1);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
// ======================================================================
|
|
502
|
+
// sound events (foley), exported by events.mjs for mix.py
|
|
503
|
+
export function buildEvents() {
|
|
504
|
+
const ev = [], add = (t, type, o = {}) => ev.push({ t: +t.toFixed(4), type, ...o });
|
|
505
|
+
add(0, 'knife', { g: 1 });
|
|
506
|
+
for (let c = 0; c < 12; c++) add(.5 + c * E16 + E16 * .5, 'rule', { g: .5 });
|
|
507
|
+
[2.0, 2.25, 2.5, 2.75, 3.0].forEach(t => add(t, 'clack', { g: .9 }));
|
|
508
|
+
add(3.5, 'paper', { g: 1 });
|
|
509
|
+
RULES.forEach(([tr]) => { for (let i = 1; i <= 4; i++) add(tr + i * BEAT / 4, 'thunk', { g: .45 + .15 * (i === 4) }); });
|
|
510
|
+
for (let c = 0; c <= NC; c++) add(4.0 + c * E8 + E8, 'rule', { g: .7 });
|
|
511
|
+
for (let r = 0; r <= 16; r++) add(5.625 + r * E16 + E8, 'rule', { g: .45 });
|
|
512
|
+
for (let i = 0; i < TX.length; i++) add(T_TXT_IN + i * E16 + E16, 'clack', { g: .7 });
|
|
513
|
+
add(T_FONT, 'clackBig', { g: 1 });
|
|
514
|
+
TX.forEach(d => { if (d.cut) add(d.cut, 'knife', { g: .8 }); });
|
|
515
|
+
TXC.forEach((d, k) => add(T_COMPACT + k * E16 * .5, 'slide', { g: .5 }));
|
|
516
|
+
add(T_ALIGN, 'clackBig', { g: .9 }); add(16.0, 'slide', { g: .7 });
|
|
517
|
+
for (let k = 0; k < 16; k++) add(T.run + k * E16 + E16, 'snap', { g: .5 });
|
|
518
|
+
add(T.circleIn, 'thump', { g: 1 });
|
|
519
|
+
add(T.hes + E16, 'tick', { g: .7 }); add(T.hes + .375 + E16, 'tick', { g: .6 });
|
|
520
|
+
add(24.0, 'slide', { g: 1 });
|
|
521
|
+
add(T.land, 'thump', { g: 1.1 });
|
|
522
|
+
for (let i = 0; i < 8; i++) add(T.reflow + i * E16, 'snap', { g: .6 });
|
|
523
|
+
TXC.forEach((d, k) => add(T.txtFinal + k * E16, 'clack', { g: .6 }));
|
|
524
|
+
add(T.rot - T.rotD, 'swish', { g: 1, d: T.rotD });
|
|
525
|
+
for (let c = 0; c < NC; c++) add(T.labels + E16 + c * E16 * .5, 'tick', { g: .35 });
|
|
526
|
+
add(T.sweep - BEAT / 2, 'rule', { g: .8 });
|
|
527
|
+
add(36.0, 'swish', { g: .8, d: 1.0 });
|
|
528
|
+
add(T.cut, 'knife', { g: 1.1 });
|
|
529
|
+
add(T.home - BEAT, 'swish', { g: .6, d: BEAT });
|
|
530
|
+
for (let i = 0; i < 4; i++) add(T.home + E8 + i * E8, 'clack', { g: .7 });
|
|
531
|
+
LINES.forEach(L => add(L.t, 'voice', { id: L.id }));
|
|
532
|
+
return ev.sort((a, b) => a.t - b.t);
|
|
533
|
+
}
|