pixi-effects 0.26.1 → 0.26.3
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/CHANGELOG.md +22 -0
- package/README.md +6 -6
- package/ai/chat-template.html +3 -3
- package/ai/tools/render.mjs +16 -11
- package/dist/Composition-3O7L2VL5.js +7 -0
- package/dist/{Composition-Z2VY3KWZ.js.map → Composition-3O7L2VL5.js.map} +1 -1
- package/dist/Composition-EE3KEE2L.cjs +16 -0
- package/dist/{Composition-THQPG4E5.cjs.map → Composition-EE3KEE2L.cjs.map} +1 -1
- package/dist/Controller.d.cts +1 -1
- package/dist/Controller.d.ts +1 -1
- package/dist/{Movie-i05Oh9mJ.d.cts → Movie-BWLLWRRe.d.cts} +10 -3
- package/dist/{Movie-DVeDTdnc.d.ts → Movie-BkP82KXS.d.ts} +10 -3
- package/dist/Presenter.d.cts +1 -1
- package/dist/Presenter.d.ts +1 -1
- package/dist/{chunk-EABL3UKJ.cjs → chunk-A225HYSY.cjs} +351 -20
- package/dist/chunk-A225HYSY.cjs.map +1 -0
- package/dist/{chunk-JHJNEIDI.js → chunk-FXAHNPBP.js} +351 -20
- package/dist/chunk-FXAHNPBP.js.map +1 -0
- package/dist/{chunk-H3RHEH5W.cjs → chunk-IIDBEYQH.cjs} +59 -59
- package/dist/{chunk-H3RHEH5W.cjs.map → chunk-IIDBEYQH.cjs.map} +1 -1
- package/dist/{chunk-YEVAUQ6Y.js → chunk-WMMZDPWK.js} +3 -3
- package/dist/{chunk-YEVAUQ6Y.js.map → chunk-WMMZDPWK.js.map} +1 -1
- package/dist/index.cjs +144 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +121 -27
- package/dist/index.js.map +1 -1
- package/dist/loader.css +1 -1
- package/dist/{music-AF4VTFAF.js → music-3O5MDQXY.js} +52 -6
- package/dist/music-3O5MDQXY.js.map +1 -0
- package/dist/{music-KB7YZLHP.cjs → music-4O367SPR.cjs} +52 -6
- package/dist/music-4O367SPR.cjs.map +1 -0
- package/dist/three.cjs +5 -5
- package/dist/three.js +1 -1
- package/docs/api.md +11 -5
- package/docs/dsl.md +4 -2
- package/llms-full.txt +21 -12
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +1 -1
- package/skills/pixi-effects/reference/cheatsheet.md +4 -4
- package/skills/pixi-effects/reference/pitfalls.md +1 -0
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-THQPG4E5.cjs +0 -16
- package/dist/Composition-Z2VY3KWZ.js +0 -7
- package/dist/chunk-EABL3UKJ.cjs.map +0 -1
- package/dist/chunk-JHJNEIDI.js.map +0 -1
- package/dist/music-AF4VTFAF.js.map +0 -1
- package/dist/music-KB7YZLHP.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/audio/music/instruments.ts","../src/audio/music/notation.ts","../src/audio/music/resolve.ts","../src/audio/music/render.ts"],"names":["warnUnknownOptions","suggestName"],"mappings":";;;;;AAqBA,IAAM,GAAA,GAAM,KAAK,EAAA,GAAK,CAAA;AACtB,IAAI,EAAA,GAAK,KAAA;AAEF,SAAS,cAAc,EAAA,EAAkB;AAAE,EAAA,EAAA,GAAK,EAAA;AAAI;AAE3D,IAAM,OAAO,CAAC,CAAA,KAAsB,GAAA,GAAM,CAAA,KAAA,CAAO,IAAI,EAAA,IAAM,EAAA,CAAA;AAE3D,IAAM,SAAN,MAAa;AAAA,EACH,EAAA,GAAK,CAAA;AAAA,EAAW,EAAA,GAAK,CAAA;AAAA,EAAW,EAAA,GAAK,CAAA;AAAA,EAAW,EAAA,GAAK,CAAA;AAAA,EAAW,EAAA,GAAK,CAAA;AAAA,EACrE,EAAA,GAAK,CAAA;AAAA,EAAW,EAAA,GAAK,CAAA;AAAA,EAAW,EAAA,GAAK,CAAA;AAAA,EAAW,EAAA,GAAK,CAAA;AAAA,EAC7D,WAAA,CAAY,IAAA,EA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AI,KAAA,EAAO,CAAA,EAAA,EAAK;AAC9B,IAAA,MAAM,IAAI,CAAA,IAAK,KAAA,GAAQ,QAAQ,KAAA,GAAQ,CAAA,GAAI,KAAK,IAAA,GAAO,CAAA;AACvD,IAAA,GAAA,CAAI,CAAA,CAAE,CAAC,CAAA,IAAM,IAAA,GAAO,CAAA;AAAG,IAAA,GAAA,CAAI,CAAA,CAAE,CAAC,CAAA,IAAM,IAAA,GAAO,CAAA;AAAA,EAC7C;AACA,EAAA,OAAO,CAAC,GAAA,CAAI,CAAA,EAAG,GAAA,CAAI,CAAC,CAAA;AACtB","file":"music-4O367SPR.cjs","sourcesContent":["/**\n * The voices of `music`: a handful of small synthesisers and drums, each rendering ONE note into a stereo buffer.\n * Pure DSP over Float32Array, seeded noise only, so the same score always gives the same samples. Ported from the\n * spike the owner approved by ear; the sample rate is set once per render (renders are synchronous).\n */\n\nexport interface Bus { L: Float32Array; R: Float32Array }\nexport type Rand = () => number;\n\n/** Per-track knobs an instrument may use. */\nexport interface VoiceOptions {\n /** Seconds the sound fades in (pad, lead). */\n attack?: number;\n /** Seconds the sound fades out after the written length. */\n release?: number;\n /** Seconds a bell / music box keeps ringing. */\n ring?: number;\n}\n\ntype Voice = (midi: number, dur: number, vel: number, out: Bus, start: number, rnd: Rand, o: VoiceOptions) => void;\n\nconst TAU = Math.PI * 2;\nlet SR = 44100;\n/** Set the sample rate for the render that follows. */\nexport function setSampleRate(sr: number): void { SR = sr; }\n\nconst mtof = (m: number): number => 440 * 2 ** ((m - 69) / 12);\n\nclass Biquad {\n private b0 = 1; private b1 = 0; private b2 = 0; private a1 = 0; private a2 = 0;\n private x1 = 0; private x2 = 0; private y1 = 0; private y2 = 0;\n constructor(type: 'lp' | 'hp' | 'bp', fc: number, q = 0.707) { this.set(type, fc, q); }\n /** Change the cutoff without clearing the state (so it can move while a sound plays). */\n set(type: 'lp' | 'hp' | 'bp', fc: number, q = 0.707): void {\n const w = (TAU * Math.min(fc, SR * 0.45)) / SR, c = Math.cos(w), s = Math.sin(w), al = s / (2 * q);\n const a0 = 1 + al;\n let b0: number, b1: number, b2: number;\n if (type === 'lp') { b0 = (1 - c) / 2; b1 = 1 - c; b2 = b0; }\n else if (type === 'hp') { b0 = (1 + c) / 2; b1 = -(1 + c); b2 = b0; }\n else { b0 = al; b1 = 0; b2 = -al; }\n this.b0 = b0 / a0; this.b1 = b1 / a0; this.b2 = b2 / a0; this.a1 = (-2 * c) / a0; this.a2 = (1 - al) / a0;\n }\n run(x: number): number {\n const y = this.b0 * x + this.b1 * this.x1 + this.b2 * this.x2 - this.a1 * this.y1 - this.a2 * this.y2;\n this.x2 = this.x1; this.x1 = x; this.y2 = this.y1; this.y1 = y;\n return y;\n }\n}\nexport { Biquad };\n\nconst polyblep = (t: number, dt: number): number => (t < dt ? ((t /= dt), t + t - t * t - 1) : t > 1 - dt ? ((t = (t - 1) / dt), t * t + t + t + 1) : 0);\nconst saw = (ph: number, dt: number): number => 2 * ph - 1 - polyblep(ph, dt);\nconst adsr = (t: number, dur: number, a: number, d: number, s: number, r: number): number => {\n if (t < dur) return t < a ? t / a : t < a + d ? 1 - (1 - s) * ((t - a) / d) : s;\n const base = dur < a ? dur / a : dur < a + d ? 1 - (1 - s) * ((dur - a) / d) : s;\n return Math.max(0, base * (1 - (t - dur) / r));\n};\n\nfunction addTo(out: Bus, start: number, i: number, l: number, r: number): void {\n const k = start + i;\n if (k >= 0 && k < out.L.length) { out.L[k]! += l; out.R[k]! += r; }\n}\n\nexport const INSTRUMENTS = ['keys', 'pluck', 'pad', 'bass', 'sub', 'lead', 'bell', 'musicbox'] as const;\nexport type InstrumentName = (typeof INSTRUMENTS)[number];\n\nexport const VOICES: Record<InstrumentName, Voice> = {\n // electric piano: two FM operators (tine + bell), a little stereo chorus\n keys(m, dur, vel, out, start, rnd, o) {\n const f = mtof(m), rel = o.release ?? 0.5, total = dur + rel + 1.2;\n const n = Math.floor(Math.min(total, 6) * SR), idx = 1.1 + 2.2 * vel, det = 1 + (rnd() - 0.5) * 0.002;\n for (let i = 0; i < n; i++) {\n const t = i / SR;\n const decay = Math.exp(-t * (1.1 + f / 1500));\n const mod = Math.sin(TAU * f * 14 * t) * idx * 0.12 * Math.exp(-t * 18) + Math.sin(TAU * f * t) * idx * Math.exp(-t * 3.2);\n const body = Math.sin(TAU * f * t + mod) * decay;\n const body2 = Math.sin(TAU * f * det * t + mod * 0.9) * decay;\n const env = t < dur ? 1 : Math.max(0, 1 - (t - dur) / rel);\n const a = Math.min(1, t / 0.004) * env * 0.5 * vel;\n addTo(out, start, i, a * (body * 0.7 + body2 * 0.3), a * (body * 0.3 + body2 * 0.7));\n }\n },\n // plucked string (Karplus–Strong with a darker loss filter): guitar / harp / koto\n pluck(m, dur, vel, out, start, rnd, o) {\n const f = mtof(m), len = Math.max(2, Math.round(SR / f)), buf = new Float32Array(len);\n const lp = new Biquad('lp', 2500 + 3500 * vel, 0.6);\n for (let i = 0; i < len; i++) buf[i] = lp.run(rnd() * 2 - 1);\n const rel = o.release ?? 0.25, total = Math.min(dur + rel + 0.4, 5), n = Math.floor(total * SR), loss = 0.9965 - 0.5 / (f + 100);\n let p = 0, prev = 0;\n const pan = (rnd() - 0.5) * 0.3;\n for (let i = 0; i < n; i++) {\n const cur = buf[p]!, nxt = buf[(p + 1) % len]!;\n buf[p] = loss * 0.5 * (cur + nxt);\n p = (p + 1) % len;\n const t = i / SR, env = t < dur ? 1 : Math.max(0, 1 - (t - dur) / rel);\n const y = (cur - prev * 0.2) * env * 0.55 * vel;\n prev = cur;\n addTo(out, start, i, y * (1 - pan), y * (1 + pan));\n }\n },\n // warm pad: five detuned band-limited saws through a slow low-pass\n pad(m, dur, vel, out, start, rnd, o) {\n const f = mtof(m), A = o.attack ?? 0.7, R = o.release ?? 1.4, n = Math.floor((dur + R) * SR);\n const voices = [-0.14, -0.07, 0, 0.07, 0.14].map((c, k) => ({ ph: rnd(), f: f * 2 ** ((c / 12) * 0.6), pan: (k - 2) / 2.5 }));\n const cut = Math.min(1800, 500 + f * 1.5);\n const lp = new Biquad('lp', cut, 0.6), lp2 = new Biquad('lp', cut, 0.6);\n for (let i = 0; i < n; i++) {\n const t = i / SR;\n let l = 0, r = 0;\n for (const v of voices) {\n const dt = v.f / SR;\n v.ph += dt; if (v.ph >= 1) v.ph -= 1;\n const s = saw(v.ph, dt);\n l += s * (1 - v.pan) * 0.5; r += s * (1 + v.pan) * 0.5;\n }\n const env = t < dur ? Math.min(1, t / A) : Math.max(0, Math.min(1, dur / A) * (1 - (t - dur) / R));\n const g = env * 0.11 * vel;\n addTo(out, start, i, lp.run(l) * g, lp2.run(r) * g);\n }\n },\n // synth bass: saw + sine sub, filter envelope\n bass(m, dur, vel, out, start, _rnd, o) {\n const f = mtof(m), rel = o.release ?? 0.12, n = Math.floor((dur + rel) * SR);\n let ph = 0, ph2 = 0;\n const lp = new Biquad('lp', 400, 1.1);\n for (let i = 0; i < n; i++) {\n const t = i / SR, dt = f / SR;\n ph = (ph + dt) % 1; ph2 = (ph2 + dt) % 1;\n if (i % 64 === 0) lp.set('lp', Math.min(160 + 900 * Math.exp(-t * 7) * vel, 4000), 1.1);\n const s = lp.run(saw(ph, dt)) * 0.55 + Math.sin(TAU * ph2) * 0.55;\n const env = t < dur ? Math.min(1, t / 0.006) * (0.75 + 0.25 * Math.exp(-t * 4)) : Math.max(0, 1 - (t - dur) / rel) * 0.75;\n const y = s * env * 0.5 * vel;\n addTo(out, start, i, y, y);\n }\n },\n // a pure sine bass: a soft heartbeat or sub (no filter sweep, hardly any upper harmonics)\n sub(m, dur, vel, out, start, _rnd, o) {\n const f = mtof(m), rel = o.release ?? 0.2, n = Math.floor((dur + rel) * SR);\n let ph = 0;\n for (let i = 0; i < n; i++) {\n const t = i / SR;\n ph += (TAU * f) / SR;\n const env = t < dur ? Math.min(1, t / (o.attack ?? 0.012)) * (0.8 + 0.2 * Math.exp(-t * 5)) : Math.max(0, 1 - (t - dur) / rel) * 0.8;\n const y = (Math.sin(ph) + 0.12 * Math.sin(2 * ph)) * env * 0.6 * vel;\n addTo(out, start, i, y, y);\n }\n },\n // lead: soft saw / triangle with a delayed vibrato\n lead(m, dur, vel, out, start, rnd, o) {\n const f = mtof(m), rel = o.release ?? 0.18, A = o.attack ?? 0.02, n = Math.floor((dur + rel) * SR);\n let ph = rnd(), ph2 = rnd();\n const lp = new Biquad('lp', 2600 + 1800 * vel, 0.8);\n for (let i = 0; i < n; i++) {\n const t = i / SR, vib = 1 + 0.0035 * Math.sin(TAU * 5.3 * t) * Math.min(1, Math.max(0, (t - 0.18) / 0.3));\n const dt = (f * vib) / SR;\n ph = (ph + dt) % 1; ph2 = (ph2 + dt * 1.003) % 1;\n const tri = 4 * Math.abs(ph - 0.5) - 1;\n const s = lp.run(saw(ph2, dt) * 0.35 + tri * 0.65);\n const y = s * adsr(t, dur, A, 0.15, 0.7, rel) * 0.28 * vel;\n addTo(out, start, i, y * 0.9, y * 1.1);\n }\n },\n // bell / glockenspiel: inharmonic FM; `ring` is how many seconds it keeps sounding\n bell(m, dur, vel, out, start, rnd, o) {\n const f = mtof(m), ring = o.ring ?? 2.5, n = Math.floor(Math.min(dur + ring, 6) * SR), pan = (rnd() - 0.5) * 0.6;\n const k = 1.5 * (2.5 / ring);\n for (let i = 0; i < n; i++) {\n const t = i / SR;\n const mod = Math.sin(TAU * f * 3.5 * t) * 1.6 * Math.exp(-t * 5);\n const s = Math.sin(TAU * f * t + mod) * Math.exp(-t * k) + Math.sin(TAU * f * 2.76 * t) * 0.25 * Math.exp(-t * 4);\n const y = s * Math.min(1, t / 0.002) * 0.3 * vel;\n addTo(out, start, i, y * (1 - pan), y * (1 + pan));\n }\n },\n // music box: a bright tine with a strong upper partial and a short, dry ring\n musicbox(m, dur, vel, out, start, rnd, o) {\n const f = mtof(m), ring = o.ring ?? 1.3, n = Math.floor(Math.min(dur + ring, 4) * SR), pan = (rnd() - 0.5) * 0.4;\n for (let i = 0; i < n; i++) {\n const t = i / SR;\n const s = Math.sin(TAU * f * t) * Math.exp(-t * (3.2 / ring * 1.3)) + Math.sin(TAU * f * 4.0 * t) * 0.22 * Math.exp(-t * (9 / ring)) + Math.sin(TAU * f * 6.8 * t) * 0.08 * Math.exp(-t * 18);\n const y = s * Math.min(1, t / 0.0015) * 0.34 * vel;\n addTo(out, start, i, y * (1 - pan), y * (1 + pan));\n }\n },\n};\n\nexport const DRUMS = ['kick', 'snare', 'hat', 'openhat', 'clap', 'rim', 'tom', 'crash', 'shaker', 'sleigh'] as const;\nexport type DrumName = (typeof DRUMS)[number];\n\nexport function hitDrum(kind: DrumName, vel: number, out: Bus, start: number, rnd: Rand): void {\n const mono = (n: number, f: (t: number) => [number, number]): void => {\n for (let i = 0; i < n; i++) { const [l, r] = f(i / SR); addTo(out, start, i, l, r); }\n };\n const len = (s: number) => Math.floor(s * SR);\n if (kind === 'kick') {\n let ph = 0;\n mono(len(0.5), t => { ph += (TAU * (45 + 110 * Math.exp(-t * 28))) / SR; const o = (Math.sin(ph) * Math.exp(-t * 7.5) + (t < 0.004 ? (rnd() - 0.5) * 0.5 : 0)) * 0.95 * vel; return [o, o]; });\n } else if (kind === 'snare') {\n const bp = new Biquad('bp', 1900, 0.9), hp = new Biquad('hp', 700, 0.7);\n let ph = 0;\n mono(len(0.4), t => { ph += (TAU * (185 - 40 * t)) / SR; const nz = hp.run(bp.run(rnd() * 2 - 1)) * 2.2; const o = (nz * Math.exp(-t * 17) + Math.sin(ph) * Math.exp(-t * 26) * 0.6) * 0.6 * vel; return [o * 0.95, o * 1.05]; });\n } else if (kind === 'clap') {\n const bp = new Biquad('bp', 1500, 1.2);\n mono(len(0.35), t => { const burst = t < 0.033 ? Math.exp(-((t * 1000) % 11) * 0.5) : Math.exp(-(t - 0.033) * 22); const o = bp.run(rnd() * 2 - 1) * 2.4 * burst * 0.5 * vel; return [o, o * 0.9]; });\n } else if (kind === 'hat' || kind === 'openhat') {\n const hp = new Biquad('hp', 7500, 0.8), dec = kind === 'hat' ? 55 : 9;\n mono(len(kind === 'hat' ? 0.12 : 0.6), t => { const o = hp.run(rnd() * 2 - 1) * Math.exp(-t * dec) * 0.35 * vel; return [o * 0.8, o * 1.2]; });\n } else if (kind === 'rim') {\n let ph = 0;\n const bp = new Biquad('bp', 3200, 4);\n mono(len(0.1), t => { ph += (TAU * 1750) / SR; const o = (Math.sin(ph) * 0.5 + bp.run(rnd() * 2 - 1)) * Math.exp(-t * 70) * 0.5 * vel; return [o, o]; });\n } else if (kind === 'tom') {\n let ph = 0;\n mono(len(0.5), t => { ph += (TAU * (95 + 70 * Math.exp(-t * 15))) / SR; const o = Math.sin(ph) * Math.exp(-t * 7) * 0.7 * vel; return [o, o]; });\n } else if (kind === 'crash') {\n const hp = new Biquad('hp', 5200, 0.7), bp = new Biquad('bp', 9000, 0.6);\n mono(len(1.8), t => { const nz = rnd() * 2 - 1; const o = (hp.run(nz) * 0.7 + bp.run(nz) * 0.5) * (0.55 * Math.exp(-t * 2.6) + 0.45 * Math.exp(-t * 11)) * 0.5 * vel; return [o * 0.9, o * 1.1]; });\n } else if (kind === 'shaker') {\n const bp = new Biquad('bp', 6500, 1.4);\n mono(len(0.16), t => { const env = (t < 0.018 ? t / 0.018 : 1) * Math.exp(-t * 28); const o = bp.run(rnd() * 2 - 1) * env * 1.4 * 0.3 * vel; return [o * 0.85, o * 1.15]; });\n } else { // sleigh: a jingle of small bells (bright noise + a cluster of high partials with a fast flutter)\n const bp = new Biquad('bp', 7800, 1.0);\n const partials = [4200, 5630, 6900, 8350];\n mono(len(0.5), t => {\n let s = 0;\n for (let k = 0; k < partials.length; k++) s += Math.sin(TAU * partials[k]! * t * (1 + k * 0.0007)) * (0.5 + 0.5 * Math.sin(TAU * (19 + k * 3.1) * t + k)) * Math.exp(-t * (7 + k * 2));\n const o = (s * 0.11 + bp.run(rnd() * 2 - 1) * Math.exp(-t * 16) * 0.5) * Math.min(1, t / 0.003) * vel * 0.8;\n return [o * 0.85, o * 1.15];\n });\n }\n}\n\n/** Freeverb-style reverb: sums the `send` bus to mono and adds its tail to `out` (the same bus works too). `wet` 0–1. */\nexport function reverb(send: Bus, out: Bus, wet: number, size = 0.8): void {\n const L = out.L, R = out.R, sL = send.L, sR = send.R;\n const scale = SR / 44100;\n type Comb = { b: Float32Array; i: number; fb: number; d: number; damp: number };\n const comb = (len: number): Comb => ({ b: new Float32Array(Math.max(8, Math.round(len * scale))), i: 0, fb: size, d: 0, damp: 0.35 });\n const mk = (off: number) => ({\n c: [1116, 1188, 1277, 1356, 1422, 1491].map(l => comb(l + off)),\n a: [556, 441, 341].map(l => ({ b: new Float32Array(Math.max(8, Math.round((l + off) * scale))), i: 0 })),\n });\n const run = (x: number, ch: ReturnType<typeof mk>): number => {\n let y = 0;\n for (const c of ch.c) {\n const o = c.b[c.i]!;\n c.d = o * (1 - c.damp) + c.d * c.damp;\n c.b[c.i] = x * 0.03 + c.d * c.fb;\n c.i = (c.i + 1) % c.b.length;\n y += o;\n }\n for (const a of ch.a) {\n const o = a.b[a.i]!, inp = y;\n a.b[a.i] = inp + o * 0.5;\n a.i = (a.i + 1) % a.b.length;\n y = o - inp;\n }\n return y;\n };\n const chL = mk(0), chR = mk(23);\n for (let i = 0; i < L.length; i++) {\n const m = (sL[i]! + sR[i]!) * 0.5;\n L[i]! += run(m, chL) * wet; R[i]! += run(m, chR) * wet;\n }\n}\n","/**\n * The text notation of `music`: notes, chords, rests and drum grids, and the tempo map. Pure functions, no audio.\n * Ported from the spike the owner approved by ear (a score of 8 lines of text → a lo-fi tune that sounds like one).\n */\n\nconst SEMI: Record<string, number> = { c: 0, d: 2, e: 4, f: 5, g: 7, a: 9, b: 11 };\nconst accidental = (s: string): number => (s === '#' ? 1 : s === 'b' ? -1 : 0);\n\n/** Chord kinds as semitones above the root (a ninth is 14, an eleventh 17, a thirteenth 21). Voiced close, around octave 3. */\nexport const CHORD_KINDS: Record<string, number[]> = {\n '': [0, 4, 7], m: [0, 3, 7], 5: [0, 7], aug: [0, 4, 8], dim: [0, 3, 6], sus2: [0, 2, 7], sus4: [0, 5, 7],\n 6: [0, 4, 7, 9], m6: [0, 3, 7, 9], add9: [0, 4, 7, 14], madd9: [0, 3, 7, 14], add11: [0, 4, 7, 17],\n 7: [0, 4, 7, 10], maj7: [0, 4, 7, 11], m7: [0, 3, 7, 10], mMaj7: [0, 3, 7, 11], dim7: [0, 3, 6, 9], m7b5: [0, 3, 6, 10],\n '7sus4': [0, 5, 7, 10], '7b9': [0, 4, 7, 10, 13], '7#9': [0, 4, 7, 10, 15],\n 9: [0, 4, 7, 10, 14], maj9: [0, 4, 7, 11, 14], m9: [0, 3, 7, 10, 14],\n 11: [0, 4, 7, 10, 14, 17], m11: [0, 3, 7, 10, 14, 17], 13: [0, 4, 7, 10, 14, 21], maj13: [0, 4, 7, 11, 14, 21], m13: [0, 3, 7, 10, 14, 21],\n 'maj7#11': [0, 4, 7, 11, 18],\n};\n\nexport const NOTE_FORMS = 'a note in lowercase like c4, f#3, bb2; a chord starting with a capital like Am7, G7, C@4, Am7/e; [c4 e4 g4]; _ for a rest; ~ to hold';\n\n/** Spellings people reach for that are not chord kinds here, and the kind they mean (`Cmin7` → `Cm7`). */\nconst KIND_SPELLINGS: Record<string, string> = {\n maj: '', M: '', major: '', min: 'm', minor: 'm', mi: 'm', '-': 'm', min7: 'm7', mi7: 'm7', '-7': 'm7', minor7: 'm7', min9: 'm9', min6: 'm6', min11: 'm11',\n M7: 'maj7', Maj7: 'maj7', ma7: 'maj7', major7: 'maj7', M9: 'maj9', Maj9: 'maj9', sus: 'sus4', dom7: '7', dom: '7', '+': 'aug', o: 'dim', o7: 'dim7',\n 'ø': 'm7b5', 'm7-5': 'm7b5', add: 'add9', '7sus': '7sus4', 'sus7': '7sus4', '9sus4': '7sus4', '6/9': '6', '69': '6',\n};\n\n/** Why a bare token that starts with a capital letter is not a chord, as one sentence with the fix (or null when it is something else). */\nfunction capitalHint(tok: string): string | null {\n if (/^[A-G][#b]?-?\\d$/.test(tok)) return `it starts with a capital letter, so it is read as a chord; write the note in lowercase: ${tok.toLowerCase()}`;\n const m = /^([A-G][#b]?)([^@/\\s]*)((?:@\\d)?(?:\\/[a-gA-G][#b]?)?)$/.exec(tok);\n if (!m) return null;\n const fix = KIND_SPELLINGS[m[2]!];\n return fix === undefined ? null : `the chord kind \"${m[2]}\" is not known; did you mean \"${m[1]}${fix}${m[3]}\"?`;\n}\n\n/** `c4` / `f#3` / `Bb2` → MIDI number (c4 = 60), or null. */\nexport function noteToMidi(name: string): number | null {\n const m = /^([a-gA-G])([#b]?)(-?\\d)$/.exec(name);\n if (!m) return null;\n return 12 * (Number(m[3]) + 1) + SEMI[m[1]!.toLowerCase()]! + accidental(m[2]!);\n}\n\n/** `Am7` → MIDI notes (root in octave 3); `C@4` puts the root in octave 4, `Am7/e` puts e in the bass. Null when it is not a chord. */\nexport function chordToMidi(sym: string): number[] | null {\n const m = /^([A-G])([#b]?)([^@/\\s]*)(?:@(\\d))?(?:\\/([a-gA-G][#b]?))?$/.exec(sym);\n if (!m) return null;\n const kind = CHORD_KINDS[m[3]!];\n if (!kind) return null;\n const root = SEMI[m[1]!.toLowerCase()]! + accidental(m[2]!);\n const oct = m[4] !== undefined ? Number(m[4]) : 3;\n const notes = kind.map(i => 12 * (oct + 1) + root + i);\n if (m[5]) notes.unshift(12 * oct + SEMI[m[5][0]!.toLowerCase()]! + accidental(m[5][1] ?? ''));\n return notes;\n}\n\n/** One note or chord of a track: where (beats from the start), how long (beats), which MIDI notes, how hard (0–1). */\nexport interface MusicEvent { t: number; dur: number; midi: number[]; vel: number }\n\n/**\n * A track's `notes` string → events. Tokens are separated by spaces (`|` is ignored: use it for bars).\n * `c4`, `c4:2`, `c4:0.5` a note (`:` = length in beats, default `step`) · `Am7:4`, `C@4:2`, `Am7/e:4` a chord · `[c4 e4 g4]:2` a chord note by note ·\n * `_`, `_:2` a rest · `~`, `~:1` hold (lengthens the note before) · `!` accent, `,` soft, before or after the length: `c4!:1`, `c4:1!`.\n * Throws an Error that names the token.\n */\nexport function parseNotes(str: string, step = 1): { events: MusicEvent[]; length: number } {\n const events: MusicEvent[] = [];\n let t = 0;\n for (const raw of String(str).replace(/\\|/g, ' ').match(/\\[[^\\]]*\\](?::[\\d.]+)?[!,]?|\\S+/g) ?? []) {\n let tok = raw, vel = 0.8;\n const mark = (c: string) => { vel = c === '!' ? 1 : 0.55; };\n if (/[!,]$/.test(tok)) { mark(tok.slice(-1)); tok = tok.slice(0, -1); }\n let dur = step;\n const dm = /:([\\d.]+)$/.exec(tok);\n if (dm) { dur = Number(dm[1]); tok = tok.slice(0, dm.index); }\n if (/[!,]$/.test(tok)) { mark(tok.slice(-1)); tok = tok.slice(0, -1); }\n if (!(dur > 0) || !Number.isFinite(dur)) throw new Error(`\"${raw}\" has a length of ${dm?.[1]} beats; a length must be a positive number of beats (c4:2)`);\n if (tok === '_') { t += dur; continue; }\n if (tok === '~') { if (events.length) events[events.length - 1]!.dur += dur; t += dur; continue; }\n let midi: Array<number | null> | null;\n if (tok.startsWith('[')) midi = tok.slice(1, -1).trim().split(/\\s+/).map(noteToMidi);\n else if (/^[A-G]/.test(tok)) midi = chordToMidi(tok); // a capital letter starts a chord (G7, C5, C6), a lowercase one a note (g7, c5, c6): never both\n else midi = [noteToMidi(tok)];\n if (!midi || midi.length === 0 || midi.some(x => x === null)) {\n const hint = /^[A-G]/.test(tok) && !tok.startsWith('[') ? capitalHint(tok) : null;\n throw new Error(`cannot read \"${raw}\"${hint ? `: ${hint}` : ''} (${NOTE_FORMS})`);\n }\n events.push({ t, dur, midi: midi as number[], vel });\n t += dur;\n }\n return { events, length: t };\n}\n\n/** A drum pattern: `x` a hit, `o` a soft hit, `.` nothing (spaces and `|` are ignored). Step = 1/`grid` of a beat. */\nexport function parseDrumGrid(grid: string): { hits: Array<{ i: number; vel: number }>; steps: number } {\n const hits: Array<{ i: number; vel: number }> = [];\n let i = 0;\n for (const ch of String(grid).replace(/[\\s|]/g, '')) {\n if (ch === 'x' || ch === 'X') hits.push({ i, vel: 1 });\n else if (ch === 'o' || ch === 'O') hits.push({ i, vel: 0.5 });\n else if (ch !== '.' && ch !== '-' && ch !== '_') throw new Error(`\"${ch}\" in the drum pattern \"${grid}\": use x (hit), o (soft hit), . (nothing)`);\n i++;\n }\n return { hits, steps: i };\n}\n\n/** Tempo as `[beat, bpm]` points; between two points the tempo changes linearly (a ritardando), before / after it holds. */\nexport type TempoPoints = Array<[number, number]>;\n\n/** Beats → seconds for a tempo map (exact integral of 60 / bpm). */\nexport class TempoMap {\n private readonly points: TempoPoints;\n private readonly secAt: number[] = [0];\n\n constructor(bpm: number | TempoPoints) {\n this.points = typeof bpm === 'number' ? [[0, bpm]] : [...bpm].sort((a, b) => a[0] - b[0]);\n if (this.points[0]![0] > 0) this.points.unshift([0, this.points[0]![1]]);\n for (let i = 1; i < this.points.length; i++) {\n const [b0, t0] = this.points[i - 1]!, [b1, t1] = this.points[i]!;\n this.secAt.push(this.secAt[i - 1]! + TempoMap.span(b1 - b0, t0, t1));\n }\n }\n\n /** Seconds taken by `db` beats while the tempo goes from `t0` to `t1` bpm. */\n private static span(db: number, t0: number, t1: number): number {\n return Math.abs(t1 - t0) < 1e-9 ? (60 * db) / t0 : (60 * db * Math.log(t1 / t0)) / (t1 - t0);\n }\n\n seconds(beat: number): number {\n if (beat <= 0) return (60 * beat) / this.points[0]![1];\n let i = this.points.length - 1;\n while (i > 0 && this.points[i]![0] > beat) i--;\n const [b0, t0] = this.points[i]!;\n const next = this.points[i + 1];\n if (!next) return this.secAt[i]! + (60 * (beat - b0)) / t0;\n const t = t0 + ((next[1] - t0) * (beat - b0)) / (next[0] - b0);\n return this.secAt[i]! + TempoMap.span(beat - b0, t0, t);\n }\n\n /** The tempo at a beat. */\n bpmAt(beat: number): number {\n if (beat <= this.points[0]![0]) return this.points[0]![1];\n for (let i = 1; i < this.points.length; i++) {\n const [b0, t0] = this.points[i - 1]!, [b1, t1] = this.points[i]!;\n if (beat < b1) return t0 + ((t1 - t0) * (beat - b0)) / (b1 - b0);\n }\n return this.points[this.points.length - 1]![1];\n }\n}\n","import { suggestName, warnUnknownOptions } from '../../core/options';\nimport type { MusicOptions } from '../../types';\nimport { DRUMS, INSTRUMENTS, type DrumName, type InstrumentName, type VoiceOptions } from './instruments';\nimport { parseDrumGrid, parseNotes, TempoMap, type MusicEvent, type TempoPoints } from './notation';\n\nexport const MAX_TRACKS = 16;\nexport const MAX_SECONDS = 180;\nexport const MAX_NOTES = 20000;\nexport const DEFAULT_TAIL = 2.5;\n\nconst OPTION_KEYS = ['bpm', 'tracks', 'drums', 'grid', 'swing', 'reverb', 'humanize', 'drumVol', 'transpose', 'tail', 'seed'] as const;\nconst TRACK_KEYS = ['inst', 'notes', 'vol', 'pan', 'step', 'strum', 'legato', 'tone', 'reverb', 'attack', 'release', 'ring', 'transpose'] as const;\n/** Layer fields an author may put inside `music` by mistake. */\nconst LAYER_KEYS = ['duration', 'length', 'volume', 'at', 'loop'];\n\n/** Words authors reach for, mapped to the instrument that makes that sound. */\nconst INSTRUMENT_ALIASES: Record<string, InstrumentName> = {\n piano: 'keys', ep: 'keys', rhodes: 'keys', epiano: 'keys', electricpiano: 'keys', keyboard: 'keys', organ: 'pad',\n guitar: 'pluck', harp: 'pluck', koto: 'pluck', strings: 'pad', synth: 'lead', melody: 'lead', flute: 'lead',\n glockenspiel: 'bell', glock: 'bell', chime: 'bell', vibes: 'bell', 'music-box': 'musicbox', music_box: 'musicbox', musicbox: 'musicbox',\n sinebass: 'sub', '808': 'sub', bassline: 'bass',\n};\nconst DRUM_ALIASES: Record<string, DrumName> = {\n bd: 'kick', bassdrum: 'kick', sd: 'snare', hihat: 'hat', hh: 'hat', closedhat: 'hat', oh: 'openhat', cymbal: 'crash', tambourine: 'shaker',\n sleighbells: 'sleigh', jingle: 'sleigh', bells: 'sleigh',\n};\n\nexport interface ResolvedTrack {\n inst: InstrumentName;\n events: MusicEvent[];\n length: number;\n vol: number | Array<[number, number]>;\n pan: number;\n strum: number;\n legato: number;\n tone: number;\n reverb: number;\n transpose: number;\n voice: VoiceOptions;\n}\nexport interface ResolvedDrums {\n from: number;\n to: number;\n /** Beats one repeat of the pattern lasts. */\n repeat: number;\n drums: Array<{ kind: DrumName; hits: Array<{ i: number; vel: number }> }>;\n}\nexport interface ResolvedMusic {\n tempo: TempoPoints;\n swing: number;\n reverb: number;\n humanize: number;\n drumVol: number;\n grid: number;\n tail: number;\n seed: number;\n tracks: ResolvedTrack[];\n drums: ResolvedDrums[];\n /** Length of the music in beats (the longest track; drums fill up to it). */\n beats: number;\n /** Length of the music in seconds, without the tail. */\n seconds: number;\n}\n\ntype Warn = (message: string) => void;\nconst defaultWarn: Warn = m => console.warn(m);\nconst clamp = (x: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, x));\nconst finite = (x: unknown): x is number => typeof x === 'number' && Number.isFinite(x);\n\n/** Check an author's `music` value, warn about everything that will not do what they meant, and return what to render (null: silent). */\nexport function resolveMusic(music: unknown, who: string, warn: Warn = defaultWarn): ResolvedMusic | null {\n if (!music || typeof music !== 'object' || Array.isArray(music)) {\n warn(`pixi-effects: ${who}: music must be an object like { bpm: 96, tracks: [{ inst: 'keys', notes: 'Cmaj7:4 Am7:4' }], drums: { kick: 'x...x...' } } (got ${JSON.stringify(music)}). The layer is silent.`);\n return null;\n }\n const o = music as Record<string, unknown>;\n const rest: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(o)) {\n if (LAYER_KEYS.includes(k)) warn(`pixi-effects: ${who}: \"${k}\" goes on the audio layer, not inside music${k === 'duration' || k === 'length' ? ' (the music lasts as long as its notes; a shorter layer duration cuts it)' : ''}`);\n else rest[k] = v;\n }\n warnUnknownOptions(`${who} music`, rest, OPTION_KEYS);\n\n const num = (key: string, lo: number, hi: number, fallback: number): number => {\n const v = o[key];\n if (v === undefined) return fallback;\n if (!finite(v)) { warn(`pixi-effects: ${who}: music.${key} must be a number (got ${JSON.stringify(v)}); using ${fallback}`); return fallback; }\n if (v < lo || v > hi) { warn(`pixi-effects: ${who}: music.${key} ${v} is outside ${lo}–${hi}; using ${clamp(v, lo, hi)}`); return clamp(v, lo, hi); }\n return v;\n };\n\n // tempo\n let tempo: TempoPoints | null = null;\n if (finite(o.bpm)) tempo = [[0, clamp(o.bpm, 20, 400)]];\n else if (Array.isArray(o.bpm) && o.bpm.length > 0 && o.bpm.every(p => Array.isArray(p) && finite(p[0]) && finite(p[1]) && p[1] > 0)) {\n tempo = (o.bpm as Array<[number, number]>).map(([b, t]) => [Math.max(0, b), clamp(t, 20, 400)] as [number, number]).sort((a, b) => a[0] - b[0]);\n }\n if (!tempo) {\n warn(`pixi-effects: ${who}: music.bpm is required: beats per minute (96), or [beat, bpm] points for a tempo change ([[0, 96], [28, 96], [32, 60]]) (got ${JSON.stringify(o.bpm)}). The layer is silent.`);\n return null;\n }\n if (finite(o.bpm) && (o.bpm < 20 || o.bpm > 400)) warn(`pixi-effects: ${who}: music.bpm ${o.bpm} is outside 20–400; using ${tempo[0]![1]}`);\n\n const swing = num('swing', 0, 0.4, 0);\n const reverbAmount = num('reverb', 0, 0.6, 0.22);\n const humanize = num('humanize', 0, 0.06, 0.012);\n const drumVol = num('drumVol', 0, 1, 0.8);\n const grid = Math.round(num('grid', 1, 12, 4));\n const tail = num('tail', 0, 10, DEFAULT_TAIL);\n const transpose = num('transpose', -36, 36, 0);\n const seed = Math.trunc(num('seed', -1e9, 1e9, 1));\n\n // tracks\n const rawTracks: unknown[] = o.tracks === undefined ? [] : Array.isArray(o.tracks) ? o.tracks : [];\n if (o.tracks !== undefined && !Array.isArray(o.tracks)) warn(`pixi-effects: ${who}: music.tracks must be a list of { inst, notes } objects (got ${typeof o.tracks})`);\n if (rawTracks.length > MAX_TRACKS) warn(`pixi-effects: ${who}: music has ${rawTracks.length} tracks; only the first ${MAX_TRACKS} play`);\n const tracks: ResolvedTrack[] = [];\n let notes = 0;\n rawTracks.slice(0, MAX_TRACKS).forEach((raw, i) => {\n const where = `${who} music.tracks[${i}]`;\n if (!raw || typeof raw !== 'object' || Array.isArray(raw)) { warn(`pixi-effects: ${where} must be an object like { inst: 'keys', notes: 'c4 e4 g4' }. The track is skipped.`); return; }\n const t = raw as Record<string, unknown>;\n warnUnknownOptions(where, t, TRACK_KEYS);\n const name = String(t.inst);\n let inst = (INSTRUMENTS as readonly string[]).includes(name) ? (name as InstrumentName) : null;\n if (!inst) {\n const guess = INSTRUMENT_ALIASES[name.toLowerCase().replace(/\\s+/g, '')] ?? (suggestName(name, INSTRUMENTS) as InstrumentName | null);\n warn(`pixi-effects: ${where}: unknown instrument \"${name}\"${guess ? ` — did you mean \"${guess}\"?` : ''} (instruments: ${INSTRUMENTS.join(', ')}). The track is skipped.`);\n return;\n }\n if (typeof t.notes !== 'string') { warn(`pixi-effects: ${where} (${inst}): notes must be a string like 'c4 e4 g4:2 _ Am7:4' (got ${JSON.stringify(t.notes)}). The track is skipped.`); return; }\n const knob = (key: string, lo: number, hi: number, fallback: number): number => {\n const v = t[key];\n if (v === undefined) return fallback;\n if (!finite(v)) { warn(`pixi-effects: ${where}: ${key} must be a number (got ${JSON.stringify(v)}); using ${fallback}`); return fallback; }\n if (v < lo || v > hi) { warn(`pixi-effects: ${where}: ${key} ${v} is outside ${lo}–${hi}; using ${clamp(v, lo, hi)}`); return clamp(v, lo, hi); }\n return v;\n };\n let parsed;\n try { parsed = parseNotes(t.notes, knob('step', 0.0625, 16, 1)); } catch (e) { warn(`pixi-effects: ${where} (${inst}): ${(e as Error).message}. The track is skipped.`); return; }\n notes += parsed.events.length;\n let vol: ResolvedTrack['vol'] = 0.8;\n if (t.vol !== undefined) {\n if (finite(t.vol)) vol = clamp(t.vol, 0, 1.5);\n else if (Array.isArray(t.vol) && t.vol.length > 0 && t.vol.every(p => Array.isArray(p) && finite(p[0]) && finite(p[1]))) {\n vol = (t.vol as Array<[number, number]>).map(([b, v]) => [b, clamp(v, 0, 1.5)] as [number, number]).sort((a, b) => a[0] - b[0]);\n } else warn(`pixi-effects: ${where}: vol must be a number (0.8) or [beat, level] points ([[0, 0], [8, 0.8]]) (got ${JSON.stringify(t.vol)}); using 0.8`);\n }\n const voice: VoiceOptions = {};\n for (const k of ['attack', 'release', 'ring'] as const) if (t[k] !== undefined) voice[k] = knob(k, k === 'ring' ? 0.1 : 0.001, k === 'ring' ? 6 : 8, 0.5);\n tracks.push({\n inst, events: parsed.events, length: parsed.length, vol, pan: knob('pan', -1, 1, 0), strum: knob('strum', 0, 0.2, 0), legato: knob('legato', 0.1, 1, 0.96),\n tone: knob('tone', 0, 1, 1), reverb: knob('reverb', 0, 1, 1), transpose: transpose + knob('transpose', -36, 36, 0), voice,\n });\n });\n if (notes > MAX_NOTES) { warn(`pixi-effects: ${who}: music has ${notes} notes; the limit is ${MAX_NOTES}. The layer is silent.`); return null; }\n\n // drums\n const sections: ResolvedDrums[] = [];\n const rawDrums: unknown[] = o.drums === undefined ? [] : Array.isArray(o.drums) ? o.drums : [o.drums];\n rawDrums.forEach((raw, i) => {\n const where = `${who} music.drums${Array.isArray(o.drums) ? `[${i}]` : ''}`;\n if (!raw || typeof raw !== 'object') { warn(`pixi-effects: ${where} must be an object like { kick: 'x...x...', snare: '....x...' } (steps: x hit, o soft hit, . nothing). It is skipped.`); return; }\n const d = raw as Record<string, unknown>;\n const drums: ResolvedDrums['drums'] = [];\n let steps = 0;\n for (const [key, pattern] of Object.entries(d)) {\n if (key === 'from' || key === 'to') continue;\n const kind = (DRUMS as readonly string[]).includes(key) ? (key as DrumName) : null;\n if (!kind) {\n const guess = DRUM_ALIASES[key.toLowerCase()] ?? (suggestName(key, DRUMS) as DrumName | null);\n warn(`pixi-effects: ${where}: unknown drum \"${key}\"${guess ? ` — did you mean \"${guess}\"?` : ''} (drums: ${DRUMS.join(', ')}, and from / to). It is skipped.`);\n continue;\n }\n if (typeof pattern !== 'string') { warn(`pixi-effects: ${where}.${key} must be a string of steps like 'x...x...' (got ${JSON.stringify(pattern)}). It is skipped.`); continue; }\n try {\n const g = parseDrumGrid(pattern);\n drums.push({ kind, hits: g.hits });\n steps = Math.max(steps, g.steps);\n } catch (e) { warn(`pixi-effects: ${where}.${key}: ${(e as Error).message}. It is skipped.`); }\n }\n if (drums.length === 0 || steps === 0) return;\n const from = finite(d.from) ? Math.max(0, d.from) : 0, to = finite(d.to) ? d.to : Infinity;\n if (d.from !== undefined && !finite(d.from)) warn(`pixi-effects: ${where}.from must be a beat number (got ${JSON.stringify(d.from)}); using 0`);\n sections.push({ from, to, repeat: steps / grid, drums });\n });\n\n const beats = Math.max(0, ...tracks.map(t => t.length), ...sections.map(s => (Number.isFinite(s.to) ? s.to : 0)));\n const map = new TempoMap(tempo);\n const seconds = map.seconds(beats);\n if (beats === 0) {\n warn(`pixi-effects: ${who}: music has no notes${sections.length ? ' (drums alone do not set the length: add a track, or a rest such as notes: \\'_:16\\')' : ''}. The layer is silent.`);\n return null;\n }\n if (seconds > MAX_SECONDS) { warn(`pixi-effects: ${who}: the music lasts ${Math.round(seconds)} s; the limit is ${MAX_SECONDS} s. The layer is silent.`); return null; }\n return { tempo, swing, reverb: reverbAmount, humanize, drumVol, grid, tail, seed, tracks, drums: sections, beats, seconds };\n}\n\n/** Cache key: equal keys render equal samples (the score is plain data, so its JSON is the key). */\nexport function musicKey(m: ResolvedMusic, length: number, loop: boolean): string {\n return `music|${JSON.stringify([m.tempo, m.swing, m.reverb, m.humanize, m.drumVol, m.grid, m.tail, m.seed, m.tracks, m.drums, length, loop])}`;\n}\n","import { Biquad, hitDrum, reverb, setSampleRate, VOICES, type Bus } from './instruments';\nimport { TempoMap } from './notation';\nimport type { ResolvedMusic, ResolvedTrack } from './resolve';\n\n/** The loudest sample of music at `volume: 1` (−6 dBFS), so it sits under speech and sound effects (sfx peak at −12 dBFS). */\nexport const MUSIC_PEAK = 0.5;\nconst RMS_CAP = 0.12;\n\n/** Seeded random numbers (mulberry32): the same seed always gives the same music. */\nfunction rng(seed: number): () => number {\n let a = seed >>> 0;\n return () => {\n a = (a + 0x6d2b79f5) >>> 0;\n let t = a;\n t = Math.imul(t ^ (t >>> 15), t | 1);\n t ^= t + Math.imul(t ^ (t >>> 7), t | 61);\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n\n/** How long the music plays, in seconds: its notes plus the tail of the reverb. */\nexport function musicLength(m: ResolvedMusic): number {\n return m.seconds + m.tail;\n}\n\n/** The beats of a score as times in seconds (the kick hits when there are drums with a kick, otherwise every beat): what `react()` pulses on. */\nexport function musicBeatTimes(m: ResolvedMusic, until = m.seconds): number[] {\n const map = new TempoMap(m.tempo);\n const times: number[] = [];\n if (m.drums.some(s => s.drums.some(d => d.kind === 'kick'))) {\n for (const s of m.drums) {\n const kick = s.drums.find(d => d.kind === 'kick');\n if (!kick) continue;\n const end = Math.min(s.to, m.beats);\n for (let rep = 0; s.from + rep * s.repeat < end; rep++) for (const h of kick.hits) {\n const b = s.from + rep * s.repeat + h.i / m.grid;\n if (b < end) times.push(map.seconds(b));\n }\n }\n times.sort((a, b) => a - b);\n } else {\n for (let b = 0; b < m.beats; b++) times.push(map.seconds(b));\n }\n return times.filter(t => t < until);\n}\n\n/**\n * Stereo samples `[left, right]` of the music at `sampleRate`, `length` seconds long: cut (with a short fade) if shorter than the music,\n * silent after it if longer, or repeated from the start with `loop`. Same music, same samples.\n */\nexport function renderMusic(m: ResolvedMusic, sampleRate: number, length: number, loop = false): [Float32Array, Float32Array] {\n setSampleRate(sampleRate);\n const total = Math.max(2, Math.round(length * sampleRate));\n const rnd = rng(m.seed);\n const map = new TempoMap(m.tempo);\n const loopSec = map.seconds(m.beats);\n const repeats = loop ? Math.max(1, Math.ceil(length / Math.max(0.1, loopSec))) : 1;\n const bus = (): Bus => ({ L: new Float32Array(total), R: new Float32Array(total) });\n const out = bus(), send = bus(), scratch = bus();\n const swingShift = (beat: number): number => {\n const frac = beat - Math.floor(beat);\n return beat + (Math.abs(frac - 0.5) < 1e-6 ? m.swing * 0.5 : Math.abs(frac - 0.75) < 1e-6 ? m.swing * 0.25 : 0);\n };\n\n const levelAt = (vol: ResolvedTrack['vol']): ((sec: number) => number) => {\n if (typeof vol === 'number') return () => vol;\n const pts = vol.map(([b, v]) => [map.seconds(b), v] as const);\n return sec => {\n const t = loop && loopSec > 0 ? sec % loopSec : sec;\n if (t <= pts[0]![0]) return pts[0]![1];\n for (let i = 1; i < pts.length; i++) {\n if (t < pts[i]![0]) return pts[i - 1]![1] + ((pts[i]![1] - pts[i - 1]![1]) * (t - pts[i - 1]![0])) / (pts[i]![0] - pts[i - 1]![0]);\n }\n return pts[pts.length - 1]![1];\n };\n };\n\n for (const tr of m.tracks) {\n const inst = VOICES[tr.inst];\n scratch.L.fill(0); scratch.R.fill(0);\n for (let r = 0; r < repeats; r++) {\n const offset = r * loopSec;\n for (const e of tr.events) {\n const strum = e.midi.length > 1 ? tr.strum : 0;\n const startBeat = swingShift(e.t);\n const lenSec = Math.max(0.05, (map.seconds(e.t + e.dur) - map.seconds(e.t)) * tr.legato);\n e.midi.forEach((midi, k) => {\n const t0 = offset + map.seconds(startBeat) + (rnd() - 0.5) * m.humanize + k * strum;\n const vel = Math.min(1, e.vel * (0.93 + rnd() * 0.14));\n if (t0 * sampleRate >= total) return;\n inst(midi + tr.transpose, lenSec, vel, scratch, Math.max(0, Math.round(t0 * sampleRate)), rnd, tr.voice);\n });\n }\n }\n if (tr.tone < 1) {\n const fc = 400 * 50 ** tr.tone;\n const a = [new Biquad('lp', fc, 0.7), new Biquad('lp', fc, 0.7)], b = [new Biquad('lp', fc, 0.7), new Biquad('lp', fc, 0.7)];\n for (let i = 0; i < total; i++) {\n scratch.L[i] = a[1]!.run(a[0]!.run(scratch.L[i]!));\n scratch.R[i] = b[1]!.run(b[0]!.run(scratch.R[i]!));\n }\n }\n const level = levelAt(tr.vol), pan = Math.max(-1, Math.min(1, tr.pan));\n const gl = Math.cos(((pan + 1) * Math.PI) / 4) * 1.3, gr = Math.sin(((pan + 1) * Math.PI) / 4) * 1.3;\n const constant = typeof tr.vol === 'number';\n let g = constant ? level(0) : 0;\n for (let i = 0; i < total; i++) {\n if (!constant) g = level(i / sampleRate);\n const l = scratch.L[i]! * g * gl, r = scratch.R[i]! * g * gr;\n out.L[i]! += l; out.R[i]! += r;\n send.L[i]! += l * tr.reverb; send.R[i]! += r * tr.reverb;\n }\n }\n\n if (m.drums.length) {\n scratch.L.fill(0); scratch.R.fill(0);\n for (let r = 0; r < repeats; r++) {\n const offset = r * loopSec;\n for (const s of m.drums) {\n const end = Math.min(s.to, m.beats);\n for (let rep = 0; s.from + rep * s.repeat < end - 1e-6; rep++) for (const d of s.drums) for (const h of d.hits) {\n const beat = s.from + rep * s.repeat + h.i / m.grid;\n if (beat >= end) continue;\n const vel = h.vel * (0.9 + rnd() * 0.2);\n const t0 = offset + map.seconds(swingShift(beat)) + (rnd() - 0.5) * m.humanize * 0.5;\n if (t0 * sampleRate >= total) continue;\n hitDrum(d.kind, vel, scratch, Math.max(0, Math.round(t0 * sampleRate)), rnd);\n }\n }\n }\n for (let i = 0; i < total; i++) {\n const l = scratch.L[i]! * m.drumVol, r = scratch.R[i]! * m.drumVol;\n out.L[i]! += l; out.R[i]! += r; send.L[i]! += l; send.R[i]! += r;\n }\n }\n\n reverb(send, out, m.reverb, 0.8);\n let peak = 0, sum = 0;\n for (let i = 0; i < total; i++) {\n const l = (out.L[i] = Math.tanh(out.L[i]! * 0.9)), r = (out.R[i] = Math.tanh(out.R[i]! * 0.9));\n peak = Math.max(peak, Math.abs(l), Math.abs(r));\n sum += l * l + r * r;\n }\n const rms = Math.sqrt(sum / (2 * total));\n const gain = peak > 0 ? Math.min(MUSIC_PEAK / peak, RMS_CAP / Math.max(rms, 1e-9)) : 0;\n const fade = Math.min(Math.floor(0.4 * sampleRate), total >> 2);\n for (let i = 0; i < total; i++) {\n const f = i >= total - fade ? (total - 1 - i) / fade : 1;\n out.L[i]! *= gain * f; out.R[i]! *= gain * f;\n }\n return [out.L, out.R];\n}\n"]}
|
package/dist/three.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkA225HYSY_cjs = require('./chunk-A225HYSY.cjs');
|
|
4
4
|
require('./chunk-ECA2WNRX.cjs');
|
|
5
5
|
require('./chunk-TWZNOUM7.cjs');
|
|
6
6
|
var pixi_js = require('pixi.js');
|
|
7
7
|
var three$1 = require('three');
|
|
8
8
|
|
|
9
|
-
var ThreeSequence = class extends
|
|
9
|
+
var ThreeSequence = class extends chunkA225HYSY_cjs.Sequence {
|
|
10
10
|
_renderer = null;
|
|
11
11
|
_scene = null;
|
|
12
12
|
_camera = null;
|
|
@@ -25,7 +25,7 @@ var ThreeSequence = class extends chunkEABL3UKJ_cjs.Sequence {
|
|
|
25
25
|
if (this.duration === void 0) {
|
|
26
26
|
this.duration = this.parent?.duration ?? this.root.duration;
|
|
27
27
|
}
|
|
28
|
-
const scope =
|
|
28
|
+
const scope = chunkA225HYSY_cjs.buildScope(this, this.parent, this.root);
|
|
29
29
|
const width = resolveDim(spec.width, scope) ?? this.parent?.width ?? this.root.width;
|
|
30
30
|
const height = resolveDim(spec.height, scope) ?? this.parent?.height ?? this.root.height;
|
|
31
31
|
const resolution = spec.resolution ?? 1;
|
|
@@ -145,12 +145,12 @@ var ThreeSequence = class extends chunkEABL3UKJ_cjs.Sequence {
|
|
|
145
145
|
function resolveDim(v, scope) {
|
|
146
146
|
if (v === void 0) return void 0;
|
|
147
147
|
if (typeof v === "number") return v;
|
|
148
|
-
return
|
|
148
|
+
return chunkA225HYSY_cjs.evaluateExpr(v, scope);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
// src/three/index.ts
|
|
152
152
|
function registerThree() {
|
|
153
|
-
|
|
153
|
+
chunkA225HYSY_cjs.registerSequenceType("three", ThreeSequence);
|
|
154
154
|
}
|
|
155
155
|
function three(spec) {
|
|
156
156
|
return spec;
|
package/dist/three.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Sequence, buildScope, evaluateExpr, registerSequenceType } from './chunk-
|
|
1
|
+
import { Sequence, buildScope, evaluateExpr, registerSequenceType } from './chunk-FXAHNPBP.js';
|
|
2
2
|
import './chunk-TLYTYBWX.js';
|
|
3
3
|
import './chunk-BXOCEZ4U.js';
|
|
4
4
|
import { Texture, Sprite } from 'pixi.js';
|
package/docs/api.md
CHANGED
|
@@ -155,14 +155,16 @@ Renders the entire timeline to a single video file. Pauses playback first.
|
|
|
155
155
|
|
|
156
156
|
```ts
|
|
157
157
|
interface RenderOptions {
|
|
158
|
-
format?: 'mp4' | 'mov' | 'webm' | 'mkv'; // default 'mp4'
|
|
158
|
+
format?: 'mp4' | 'mov' | 'webm' | 'mkv' | 'wav' | 'ogg'; // default 'mp4'; wav / ogg: ONLY the movie's sound (an error when it has none)
|
|
159
159
|
video?: {
|
|
160
|
-
codec?: string; // default per format (mp4/mov→avc, webm
|
|
161
|
-
bitrate?: 'very-low' | 'low' | 'medium' | 'high' | 'very-high'; // default 'high'
|
|
160
|
+
codec?: string; // 'avc' (H.264) | 'hevc' | 'vp9' | 'av1' | 'vp8'; default per format (mp4/mov→avc, webm→vp9, mkv→vp9)
|
|
161
|
+
bitrate?: 'very-low' | 'low' | 'medium' | 'high' | 'very-high' | number | string; // default 'high'; or bits a second: 8_000_000, '8M', '800k'
|
|
162
|
+
hardware?: 'no-preference' | 'prefer-hardware' | 'prefer-software'; // where to encode (default 'no-preference')
|
|
163
|
+
keyFrameInterval?: number; // seconds between keyframes (default 2): shorter seeks faster, a bigger file
|
|
162
164
|
};
|
|
163
165
|
audio?: {
|
|
164
|
-
codec?: string; // default per format (mp4/mov→aac, webm/mkv→opus)
|
|
165
|
-
bitrate?: 'very-low' | 'low' | 'medium' | 'high' | 'very-high'; // default 'high'
|
|
166
|
+
codec?: string; // default per format (mp4/mov→aac, webm/mkv/ogg→opus, wav→pcm-s16)
|
|
167
|
+
bitrate?: 'very-low' | 'low' | 'medium' | 'high' | 'very-high' | number | string; // default 'high' (not for wav: it is not compressed)
|
|
166
168
|
};
|
|
167
169
|
motionBlur?: boolean | number | { samples?: number; shutter?: number }; // overrides movie.init's; false turns it off
|
|
168
170
|
}
|
|
@@ -177,6 +179,10 @@ interface RenderOptions {
|
|
|
177
179
|
- After a blurred snapshot, contact sheet or render the playhead and the stage are on an exact frame again, not a sample.
|
|
178
180
|
- `pixi-effects-render --motion-blur 8 [--shutter 0.5]` sets it for one file.
|
|
179
181
|
|
|
182
|
+
**Video codec:** unless you name `video.codec`, the usual one for the format is used (mp4 / mov: `avc`; webm: `vp9`); if this browser cannot encode it, the next that works is used and a warning says so. A codec you name is never swapped: it is used, or the error names the one that would work (`"av1" ... "avc" would work: render({ format: 'mp4', video: { codec: 'avc' } })`). `hevc` and `av1` make smaller files at the same quality but play in fewer places than `avc`; `hardware: 'prefer-hardware'` asks the GPU's encoder.
|
|
183
|
+
|
|
184
|
+
**Sound only:** `render({ format: 'wav' })` (16-bit PCM, no loss) or `render({ format: 'ogg' })` (Opus) writes the movie's mixed sound without drawing a frame: a tune written as `music` becomes an audio file. `range` cuts it like a video. `pixi-effects render page.html -o mix.wav` does the same from a script. `mp3` and `flac` are not offered: browsers cannot encode them.
|
|
185
|
+
|
|
180
186
|
**Audio codec fallback:** unless you name `audio.codec`, the first codec this browser can actually encode is used (mp4: `aac`, then `opus`, `mp3`, `flac`; webm: `opus`, `vorbis`). Chrome on Linux has no AAC encoder, so there an mp4 with sound carries Opus and a warning says so (before, the export failed with a message about encoder configurations). A codec you name is never swapped: if it cannot be encoded the error says which one would work.
|
|
181
187
|
|
|
182
188
|
Returns a `Blob` whose `type` is the container's MIME (e.g. `video/mp4`). Emits `'progress'` repeatedly during the render.
|
package/docs/dsl.md
CHANGED
|
@@ -264,8 +264,8 @@ A tune with no audio file: notes, chords and drum patterns written as strings, p
|
|
|
264
264
|
|
|
265
265
|
| Token | Meaning |
|
|
266
266
|
|---|---|
|
|
267
|
-
| `c4` `f#3` `
|
|
268
|
-
| `Am7` `F#m` `Bbmaj7` `C@4` `Am7/e` | a chord, voiced close around octave 3 (`@4` puts the root in octave 4; `/e` puts e in the bass). Kinds: none, `m`, `5`, `aug`, `dim`, `sus2`, `sus4`, `6`, `m6`, `add9`, `madd9`, `add11`, `7`, `maj7`, `m7`, `mMaj7`, `dim7`, `m7b5`, `7sus4`, `7b9`, `7#9`, `9`, `maj9`, `m9`, `11`, `m11`, `13`, `maj13`, `m13`, `maj7#11` |
|
|
267
|
+
| `c4` `f#3` `bb2` | a note, **always lowercase** (c4 = middle C; `bb2` is B flat); `:2` after it is its length in beats (`c4:0.5` an eighth), default `step` |
|
|
268
|
+
| `Am7` `F#m` `Bbmaj7` `G7` `C5` `C@4` `Am7/e` | a chord, **always starting with a capital letter** (`G7` is G dominant seventh, `g7` a very high note); voiced close around octave 3 (`@4` puts the root in octave 4; `/e` puts e in the bass). Kinds: none, `m`, `5`, `aug`, `dim`, `sus2`, `sus4`, `6`, `m6`, `add9`, `madd9`, `add11`, `7`, `maj7`, `m7`, `mMaj7`, `dim7`, `m7b5`, `7sus4`, `7b9`, `7#9`, `9`, `maj9`, `m9`, `11`, `m11`, `13`, `maj13`, `m13`, `maj7#11` |
|
|
269
269
|
| `[c4 e4 g4]:2` | a chord written out note by note (exact voicings) |
|
|
270
270
|
| `_` `_:2` | a rest |
|
|
271
271
|
| `~` `~:1` | hold: lengthens the note before |
|
|
@@ -932,6 +932,8 @@ interface Keyframe {
|
|
|
932
932
|
}
|
|
933
933
|
```
|
|
934
934
|
|
|
935
|
+
**Relative values.** A number in `to`, `from` or `set` may be written `'+=36'` or `'-=36'`: it is measured from where the property stands when the keyframe starts (GSAP's own relative values), and the right side is an expression (`'-=GW*0.1'`). `from: { x: '-=36' }` starts 36 px to the left of where the layer is and arrives there (the usual slide-in); `to: { y: '+=40' }` moves 40 px further. Several keyframes one after another stack, whatever order you seek in; with `repeat` the same move plays again from the same start (it does not stack). A relative value in `initial`, a style, or the start side of a `from` + `to` keyframe has nothing to be measured from: it warns and is read as the number.
|
|
936
|
+
|
|
935
937
|
The four kinds are mutually exclusive per keyframe:
|
|
936
938
|
|
|
937
939
|
- **`set`** — instantaneous property assignment at `at`.
|
package/llms-full.txt
CHANGED
|
@@ -6,7 +6,7 @@ Concatenation of the skill, cheatsheet, pitfalls, recipes and the DSL / API refe
|
|
|
6
6
|
|
|
7
7
|
<!-- ===== skills/pixi-effects/SKILL.md ===== -->
|
|
8
8
|
|
|
9
|
-
> Written for pixi-effects 0.26.
|
|
9
|
+
> Written for pixi-effects 0.26.3. Update this skill with `npx skills update`; the newest docs are at https://yjmtmtk.github.io/pixi-effects/
|
|
10
10
|
|
|
11
11
|
# pixi-effects — write a video as data
|
|
12
12
|
|
|
@@ -75,7 +75,7 @@ A video is **data**: a tree of plain objects. Everything below is a JS object yo
|
|
|
75
75
|
| Canvas | pixels, origin top-left, `+x` right, `+y` down. Typical: 1280×720 @ 30 fps |
|
|
76
76
|
| Angles | **degrees**: `rotation`, `skew*`, `rotationX`, `rotationY` |
|
|
77
77
|
| Depth (`z`) | `+z` toward the viewer (bigger, nearer) |
|
|
78
|
-
| Numbers | any number may be an **expression string**: `'GW/2 - w/2'`, `'min(W,H)*0.4'` (build-time only; no per-frame time variable). Functions: `min max abs floor ceil round sqrt pow sin cos tan lerp clamp smoothstep mod step`, `PI`, and **seeded** `rand(seed)` (0…1) / `noise(x, seed)` (−1…1): give each layer its own seed, never `Math.random()`. **
|
|
78
|
+
| Numbers | any number may be an **expression string**: `'GW/2 - w/2'`, `'min(W,H)*0.4'` (build-time only; no per-frame time variable). Functions: `min max abs floor ceil round sqrt pow sin cos tan lerp clamp smoothstep mod step`, `PI`, and **seeded** `rand(seed)` (0…1) / `noise(x, seed)` (−1…1): give each layer its own seed, never `Math.random()`. **Relative values** work in a keyframe's `to` / `from` / `set` (not in `initial`, a style, or the start of a `from`+`to`): `'+=36'` / `'-=36'` are measured from where the layer stands, and the right side is an expression (`'-=GW*0.1'`). A slide-in is `from: { x: '-=36' }`, a nudge `to: { y: '+=40' }`; keyframes one after another stack; with `repeat` the same move replays from the same start (it does not stack). Expressions work in layer `x y` and the other numeric props, **not** in `line.from / to`, `polygon.points` or `path.d`: compute those in JS (`const W = 1920`) |
|
|
79
79
|
| Colours | `'#rrggbb'` strings or numbers; text colour is `style.fill`, shape colour is `fillColor`/`strokeColor`, image colour is `tint` |
|
|
80
80
|
| Z-order | **array order**, later = on top. A layer is hidden (not removed) outside `[at, at+duration)` and keeps its last values |
|
|
81
81
|
| Time of a sequence's `at` | seconds from the start of its **parent composition** (default 0) |
|
|
@@ -111,7 +111,7 @@ blendMode: 'normal' | 'add' | 'screen' | 'multiply' | 'overlay' | 'soft-light' |
|
|
|
111
111
|
|
|
112
112
|
Animatable props (`initial` / keyframes): `x y alpha rotation scale scaleX scaleY pivotX pivotY anchorX anchorY skewX skewY tint width height visible autoAlpha`, plus for shapes their style/geometry, for text `fill`, for audio `volume`, for 3D `z rotationX rotationY`, filter params as `'filters.<name>.<param>'`, three objects as `'three.<obj>.<path>'`. **These go in `initial` / keyframes, never at the top level of a shape or text layer** (top-level `x`, `rotation`, `strokeColor`, `fillAlpha` each warn "is not a … key"): the top level of a shape holds its geometry (`width height radius d startAngle endAngle cornerRadius anchorX anchorY`), `trimStart` / `trimEnd`, `strokeCap` / `strokeJoin`, `fillGradient`.
|
|
113
113
|
|
|
114
|
-
Keyframe kinds: `set` (jump at `at`; undone when you seek back), `to` (animate to), `from` (animate from), `from`+`to
|
|
114
|
+
Keyframe kinds: `set` (jump at `at`; undone when you seek back), `to` (animate to), `from` (animate from), `from`+`to`; a value may be relative to where the layer stands (`from: { x: '-=36' }` slides in from 36 px to the left of its place). `from` / `from+to` show their start value from the layer's start, so a delayed fade-in needs no `initial.alpha`. `repeat` (finite extra plays), `yoyo`, `repeatDelay` loop any of them (endless repeats are not allowed). `ease` = any GSAP ease (`'none'`, `'power2.out'`, `'expo.out'`, `'back.out(1.7)'`, `'elastic.out(1,0.5)'`, `'sine.inOut'`, `'bounce.out'`, **`'cubic-bezier(.4, 0, .2, 1)'`** (CSS syntax, x1 and x2 in 0…1; `.4, 0, .2, 1` is a gentle in-out; `.2, .8, .2, 1` is FRONT-LOADED, not slow motion: half of the change in the first 13 % of the time, 90 % by 39 %, 99 % by 74 %, then a long settle, so what sits at the END of the content gets the glide; `.2, .8, .5, 1` has a shorter tail). GSAP's `power1…4` are the powers 2…5: `power2` is a cubic, `power2.in` has done only 12.5 % at half time (42 % at three quarters)… and springs: `'spring(mass, stiffness, damping)'` or `'spring.gentle' | 'snappy' | 'bouncy' | 'wobbly' | 'slow'`; **`duration: 'auto'` = the time the spring takes to settle** (presets, settle time / highest value reached as a multiple of the target: `snappy` 0.42 s / 1.01, `gentle` 0.72 s / 1.02, `bouncy` 1.08 s / 1.28, `slow` 1.29 s / 1.00, `wobbly` 1.61 s / 1.40: time the next beat from these) (real physics; with a number `duration` is the settle time and only the damping ratio shapes it; a damping ratio of 1 or more never overshoots, so `spring(1,170,26)` does not bounce: use damping below 20 at stiffness 170; `'auto'` works on keyframes only, not in `animateText` / `orbit` tweens; a `stagger` ease may be a spring, its delays are held inside the spread). Default ease is linear.
|
|
115
115
|
|
|
116
116
|
## Layer types
|
|
117
117
|
|
|
@@ -123,7 +123,7 @@ Keyframe kinds: `set` (jump at `at`; undone when you seek back), `to` (animate t
|
|
|
123
123
|
|
|
124
124
|
**audio** — a file: `asset`, `loop`, `volume`, `speed` (the pitch follows; `time` keyframes work as for video; not for `sfx` / `music`: change an sfx's `pitch` instead, or put it in a composition and remap that); `volume` (top level, or in `initial` like every other layer's starting values); fade with volume keyframes (`{ at: -2, to: { volume: 0 }, duration: 2 }` fades the last 2 s). Omit `duration` for a one-shot clip: it lasts exactly as long as the clip. With `loop: true` and no `duration` it lasts until the composition ends. An explicit `duration` longer than the clip goes silent after the clip unless `loop: true`.
|
|
125
125
|
**Or a sound effect with no file — `sfx`:** `{ type: 'audio', sfx: 'swoosh', at: 2 }` is the whole thing. Presets, default length in s: `click` 0.04 · `pop` 0.12 · `swoosh` 0.5 (loudest 0.16 s in, moves left → right) · `swipe` 0.22 · `hit` 0.7 · `riser` 1 (loudest at its END: `at = hit − duration`) · `chime` 1.4 · `beep` 0.16 · `coin` 0.4 · `glitch` 0.35 · `typewriter` 0.06. Knobs: `sfx: { preset, pitch /* semitones ±24 */, brightness /* −1 dark … 1 bright */, seed /* another take */ }`. **The layer's `duration` IS the sound's length** (omit it; set it to stretch, e.g. a riser; at most 10 s); `volume` is its level (1 = the preset's standard level, peaking at −12 … −18 dBFS by preset; above 1 is allowed: a sparse track of clicks measured −32 LUFS at 0.5 and needed about 2 to reach −24 LUFS). No `loop`: one layer per hit (a JS loop). Custom sound: `sfx: { voices: [{ wave: 'noise' | 'sine' | 'square' | 'saw' | 'triangle', freq: 440 | [from, to], filter: { type: 'lowpass' | 'highpass' | 'bandpass', freq: [from, to] }, envelope: 'fall' | 'bell' | 'swell' | 'hold', pan: [-1, 1] }] }`. The export (mp4 / webm / mov) encodes this same mix (lossy AAC / Opus), on time within a few ms.
|
|
126
|
-
**Or music with no file — `music`:** `{ type: 'audio', music: { bpm: 96, tracks: [{ inst: 'keys', notes: 'Cmaj7:4 Am7:4 Dm7:4 G7:4' }, { inst: 'bass', notes: 'c2:2 g1:2 …' }], drums: { kick: 'x...x...', snare: '....x...', hat: 'x.x.x.x.' } } }` — a tune written as text (notes `c4:2` in beats, chords `Am7` `C@4` `Am7/e
|
|
126
|
+
**Or music with no file — `music`:** `{ type: 'audio', music: { bpm: 96, tracks: [{ inst: 'keys', notes: 'Cmaj7:4 Am7:4 Dm7:4 G7:4' }, { inst: 'bass', notes: 'c2:2 g1:2 …' }], drums: { kick: 'x...x...', snare: '....x...', hat: 'x.x.x.x.' } } }` — a tune written as text (notes in LOWERCASE `c4:2` in beats, chords start with a CAPITAL `Am7` `G7` `C@4` `Am7/e` (`g7` is a very high note, not G7), `[c4 e4 g4]`, rest `_`, hold `~`, `!` accent; `|` ignored). Instruments `keys pluck pad bass sub lead bell musicbox`; drums `kick snare hat openhat clap rim tom crash shaker sleigh` as 16th-note step strings (`x` hit, `o` soft, `.` none; a list of `{ from, to, … }` for sections). Score options `bpm` (or `[[beat, bpm], …]` for a ritardando) `swing reverb (0–0.6) humanize drumVol grid transpose tail seed`; track options `vol` (or `[[beat, level], …]` for a fade) `pan step strum legato tone reverb attack release ring transpose`. Lasts its notes + tail, ends with the movie, `loop: true` repeats; peaks −6 dBFS at `volume: 1`. `await musicEnvelope(music, { frameRate })` → an envelope for `react()`; `await musicBuffer(music)` → a Web Audio `AudioBuffer` to play yourself.
|
|
127
127
|
|
|
128
128
|
**shape** — `shape: 'rect' | 'circle' | 'ellipse' | 'arc' | 'line' | 'polygon' | 'path'`:
|
|
129
129
|
|
|
@@ -233,7 +233,7 @@ const movie = new Movie();
|
|
|
233
233
|
await movie.init({ canvas, width, height, duration, frameRate, background, assets, composition });
|
|
234
234
|
movie.play(); movie.pause();
|
|
235
235
|
await movie.gotoFrame(n, true); // seek (frames; 30 fps => t = n/30)
|
|
236
|
-
const blob = await movie.render({ format: 'mp4' }); // 'mp4' | 'webm' | 'mov' | 'mkv'; ~real-time. Part of it: `range: [2, 5]` (seconds) or `range: 'title'` (a top-level layer's span; picture and sound); `scale: 0.5` / `draft: true` (half size, low quality, no motion blur: a smaller file, not a faster drawing). Fast motion: `movie.init({ motionBlur: true })` (8 samples, 180° shutter; or a number / { samples: 2–64, shutter: 0–1 }) blurs render / snapshot / contactSheet, not live playback; a render takes `samples`× as long
|
|
236
|
+
const blob = await movie.render({ format: 'mp4' }); // 'mp4' | 'webm' | 'mov' | 'mkv'; ~real-time. `format: 'wav'` / `'ogg'` writes only the movie's SOUND (a `music` score as an audio file). `video: { codec: 'hevc' | 'av1' | 'vp9' | 'avc', bitrate: '8M', hardware, keyFrameInterval }` (a codec this browser cannot encode names the one that works). Part of it: `range: [2, 5]` (seconds) or `range: 'title'` (a top-level layer's span; picture and sound); `scale: 0.5` / `draft: true` (half size, low quality, no motion blur: a smaller file, not a faster drawing). Fast motion: `movie.init({ motionBlur: true })` (8 samples, 180° shutter; or a number / { samples: 2–64, shutter: 0–1 }) blurs render / snapshot / contactSheet, not live playback; a render takes `samples`× as long
|
|
237
237
|
movie.on('progress', e => e.progress /* 0–100 */);
|
|
238
238
|
movie.audioBuffer // mixed audio (after init), if any audio layers
|
|
239
239
|
await movie.contactSheet({ count: 6, as: 'dataURL' }) // ONE image of several labelled frames — look at it. Options: frames | times | count, columns, cellWidth, as
|
|
@@ -378,6 +378,7 @@ A good habit that catches most of these: after `init`, read `window.__logs` (see
|
|
|
378
378
|
96. **A filter option that is a point (`rgbSplit.red`, `glitch` offsets) cannot be tweened as a whole**, but a scalar can: `set: { 'filters.tear.seed': n }` steps `glitch.seed` (a `set` keyframe works on filter options; no warning, visible tearing). To switch between looks on one subject, put the subject in time-windowed `composition` copies, each carrying the filters of its look.
|
|
379
379
|
97. **A deck inside your own composition loses its `transitions` and `stops`** unless you take them across: `const d = deck({ width: 1920, height: 1080, pages })`, then `{ type: 'composition', sequences: d.composition.sequences, transitions: d.composition.transitions }`. Pass `width` / `height` yourself for a page that is not the movie's own size.
|
|
380
380
|
98. **A matte layer needs a fill.** A named matte (`mask: 'glass'`) that is a shape with no `fillColor` / `fillGradient` (or a text with no fill) cuts everything away and nothing warns: the layers it should show simply vanish. Give the matte a fill (white for `alpha`, a gradient for `luma`).
|
|
381
|
+
99. **In a `music` score a capital letter is a chord and a lowercase one a note.** `G7` is G dominant seventh, `C5` a power chord, `C6` a sixth chord; `g7`, `c5`, `c6` are notes (octave 7 is a very high note: it used to be what `G7` meant, silently). A bare note in capitals (`Bb2`) is refused with the lowercase spelling (`bb2`); inside brackets (`[C4 E4 G4]`) any case is a note. An unknown chord kind suggests the nearest (`Cmin7` → `Cm7`, `Csus` → `Csus4`, `CM7` → `Cmaj7`).
|
|
381
382
|
|
|
382
383
|
|
|
383
384
|
<!-- ===== skills/pixi-effects/reference/recipes.md ===== -->
|
|
@@ -1784,8 +1785,8 @@ A tune with no audio file: notes, chords and drum patterns written as strings, p
|
|
|
1784
1785
|
|
|
1785
1786
|
| Token | Meaning |
|
|
1786
1787
|
|---|---|
|
|
1787
|
-
| `c4` `f#3` `
|
|
1788
|
-
| `Am7` `F#m` `Bbmaj7` `C@4` `Am7/e` | a chord, voiced close around octave 3 (`@4` puts the root in octave 4; `/e` puts e in the bass). Kinds: none, `m`, `5`, `aug`, `dim`, `sus2`, `sus4`, `6`, `m6`, `add9`, `madd9`, `add11`, `7`, `maj7`, `m7`, `mMaj7`, `dim7`, `m7b5`, `7sus4`, `7b9`, `7#9`, `9`, `maj9`, `m9`, `11`, `m11`, `13`, `maj13`, `m13`, `maj7#11` |
|
|
1788
|
+
| `c4` `f#3` `bb2` | a note, **always lowercase** (c4 = middle C; `bb2` is B flat); `:2` after it is its length in beats (`c4:0.5` an eighth), default `step` |
|
|
1789
|
+
| `Am7` `F#m` `Bbmaj7` `G7` `C5` `C@4` `Am7/e` | a chord, **always starting with a capital letter** (`G7` is G dominant seventh, `g7` a very high note); voiced close around octave 3 (`@4` puts the root in octave 4; `/e` puts e in the bass). Kinds: none, `m`, `5`, `aug`, `dim`, `sus2`, `sus4`, `6`, `m6`, `add9`, `madd9`, `add11`, `7`, `maj7`, `m7`, `mMaj7`, `dim7`, `m7b5`, `7sus4`, `7b9`, `7#9`, `9`, `maj9`, `m9`, `11`, `m11`, `13`, `maj13`, `m13`, `maj7#11` |
|
|
1789
1790
|
| `[c4 e4 g4]:2` | a chord written out note by note (exact voicings) |
|
|
1790
1791
|
| `_` `_:2` | a rest |
|
|
1791
1792
|
| `~` `~:1` | hold: lengthens the note before |
|
|
@@ -2452,6 +2453,8 @@ interface Keyframe {
|
|
|
2452
2453
|
}
|
|
2453
2454
|
```
|
|
2454
2455
|
|
|
2456
|
+
**Relative values.** A number in `to`, `from` or `set` may be written `'+=36'` or `'-=36'`: it is measured from where the property stands when the keyframe starts (GSAP's own relative values), and the right side is an expression (`'-=GW*0.1'`). `from: { x: '-=36' }` starts 36 px to the left of where the layer is and arrives there (the usual slide-in); `to: { y: '+=40' }` moves 40 px further. Several keyframes one after another stack, whatever order you seek in; with `repeat` the same move plays again from the same start (it does not stack). A relative value in `initial`, a style, or the start side of a `from` + `to` keyframe has nothing to be measured from: it warns and is read as the number.
|
|
2457
|
+
|
|
2455
2458
|
The four kinds are mutually exclusive per keyframe:
|
|
2456
2459
|
|
|
2457
2460
|
- **`set`** — instantaneous property assignment at `at`.
|
|
@@ -3346,14 +3349,16 @@ Renders the entire timeline to a single video file. Pauses playback first.
|
|
|
3346
3349
|
|
|
3347
3350
|
```ts
|
|
3348
3351
|
interface RenderOptions {
|
|
3349
|
-
format?: 'mp4' | 'mov' | 'webm' | 'mkv'; // default 'mp4'
|
|
3352
|
+
format?: 'mp4' | 'mov' | 'webm' | 'mkv' | 'wav' | 'ogg'; // default 'mp4'; wav / ogg: ONLY the movie's sound (an error when it has none)
|
|
3350
3353
|
video?: {
|
|
3351
|
-
codec?: string; // default per format (mp4/mov→avc, webm
|
|
3352
|
-
bitrate?: 'very-low' | 'low' | 'medium' | 'high' | 'very-high'; // default 'high'
|
|
3354
|
+
codec?: string; // 'avc' (H.264) | 'hevc' | 'vp9' | 'av1' | 'vp8'; default per format (mp4/mov→avc, webm→vp9, mkv→vp9)
|
|
3355
|
+
bitrate?: 'very-low' | 'low' | 'medium' | 'high' | 'very-high' | number | string; // default 'high'; or bits a second: 8_000_000, '8M', '800k'
|
|
3356
|
+
hardware?: 'no-preference' | 'prefer-hardware' | 'prefer-software'; // where to encode (default 'no-preference')
|
|
3357
|
+
keyFrameInterval?: number; // seconds between keyframes (default 2): shorter seeks faster, a bigger file
|
|
3353
3358
|
};
|
|
3354
3359
|
audio?: {
|
|
3355
|
-
codec?: string; // default per format (mp4/mov→aac, webm/mkv→opus)
|
|
3356
|
-
bitrate?: 'very-low' | 'low' | 'medium' | 'high' | 'very-high'; // default 'high'
|
|
3360
|
+
codec?: string; // default per format (mp4/mov→aac, webm/mkv/ogg→opus, wav→pcm-s16)
|
|
3361
|
+
bitrate?: 'very-low' | 'low' | 'medium' | 'high' | 'very-high' | number | string; // default 'high' (not for wav: it is not compressed)
|
|
3357
3362
|
};
|
|
3358
3363
|
motionBlur?: boolean | number | { samples?: number; shutter?: number }; // overrides movie.init's; false turns it off
|
|
3359
3364
|
}
|
|
@@ -3368,6 +3373,10 @@ interface RenderOptions {
|
|
|
3368
3373
|
- After a blurred snapshot, contact sheet or render the playhead and the stage are on an exact frame again, not a sample.
|
|
3369
3374
|
- `pixi-effects-render --motion-blur 8 [--shutter 0.5]` sets it for one file.
|
|
3370
3375
|
|
|
3376
|
+
**Video codec:** unless you name `video.codec`, the usual one for the format is used (mp4 / mov: `avc`; webm: `vp9`); if this browser cannot encode it, the next that works is used and a warning says so. A codec you name is never swapped: it is used, or the error names the one that would work (`"av1" ... "avc" would work: render({ format: 'mp4', video: { codec: 'avc' } })`). `hevc` and `av1` make smaller files at the same quality but play in fewer places than `avc`; `hardware: 'prefer-hardware'` asks the GPU's encoder.
|
|
3377
|
+
|
|
3378
|
+
**Sound only:** `render({ format: 'wav' })` (16-bit PCM, no loss) or `render({ format: 'ogg' })` (Opus) writes the movie's mixed sound without drawing a frame: a tune written as `music` becomes an audio file. `range` cuts it like a video. `pixi-effects render page.html -o mix.wav` does the same from a script. `mp3` and `flac` are not offered: browsers cannot encode them.
|
|
3379
|
+
|
|
3371
3380
|
**Audio codec fallback:** unless you name `audio.codec`, the first codec this browser can actually encode is used (mp4: `aac`, then `opus`, `mp3`, `flac`; webm: `opus`, `vorbis`). Chrome on Linux has no AAC encoder, so there an mp4 with sound carries Opus and a warning says so (before, the export failed with a message about encoder configurations). A codec you name is never swapped: if it cannot be encoded the error says which one would work.
|
|
3372
3381
|
|
|
3373
3382
|
Returns a `Blob` whose `type` is the container's MIME (e.g. `video/mp4`). Emits `'progress'` repeatedly during the render.
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ name: pixi-effects
|
|
|
3
3
|
description: Use when asked to make, animate, preview or export a video, motion graphics, an animated title, a lower third, kinetic type, a promo, a slideshow with transitions, an animated chart or data story, a social clip, a 2.5D / depth scene, or music and sound for a video, written as code in JavaScript or HTML. pixi-effects is a JS library where a video is a plain-object composition (text, shape, image, video, audio and file-free sfx / music, camera, light and shader layers with keyframes) that plays in the browser, is checked by a tool the agent can run, and exports MP4 / WebM / MOV with no server. Not for a project that already uses another video tool (Remotion, Motion Canvas, ffmpeg); follow that tool instead.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> Written for pixi-effects 0.26.
|
|
6
|
+
> Written for pixi-effects 0.26.3. Update this skill with `npx skills update`; the newest docs are at https://yjmtmtk.github.io/pixi-effects/
|
|
7
7
|
|
|
8
8
|
# pixi-effects — write a video as data
|
|
9
9
|
|
|
@@ -9,7 +9,7 @@ A video is **data**: a tree of plain objects. Everything below is a JS object yo
|
|
|
9
9
|
| Canvas | pixels, origin top-left, `+x` right, `+y` down. Typical: 1280×720 @ 30 fps |
|
|
10
10
|
| Angles | **degrees**: `rotation`, `skew*`, `rotationX`, `rotationY` |
|
|
11
11
|
| Depth (`z`) | `+z` toward the viewer (bigger, nearer) |
|
|
12
|
-
| Numbers | any number may be an **expression string**: `'GW/2 - w/2'`, `'min(W,H)*0.4'` (build-time only; no per-frame time variable). Functions: `min max abs floor ceil round sqrt pow sin cos tan lerp clamp smoothstep mod step`, `PI`, and **seeded** `rand(seed)` (0…1) / `noise(x, seed)` (−1…1): give each layer its own seed, never `Math.random()`. **
|
|
12
|
+
| Numbers | any number may be an **expression string**: `'GW/2 - w/2'`, `'min(W,H)*0.4'` (build-time only; no per-frame time variable). Functions: `min max abs floor ceil round sqrt pow sin cos tan lerp clamp smoothstep mod step`, `PI`, and **seeded** `rand(seed)` (0…1) / `noise(x, seed)` (−1…1): give each layer its own seed, never `Math.random()`. **Relative values** work in a keyframe's `to` / `from` / `set` (not in `initial`, a style, or the start of a `from`+`to`): `'+=36'` / `'-=36'` are measured from where the layer stands, and the right side is an expression (`'-=GW*0.1'`). A slide-in is `from: { x: '-=36' }`, a nudge `to: { y: '+=40' }`; keyframes one after another stack; with `repeat` the same move replays from the same start (it does not stack). Expressions work in layer `x y` and the other numeric props, **not** in `line.from / to`, `polygon.points` or `path.d`: compute those in JS (`const W = 1920`) |
|
|
13
13
|
| Colours | `'#rrggbb'` strings or numbers; text colour is `style.fill`, shape colour is `fillColor`/`strokeColor`, image colour is `tint` |
|
|
14
14
|
| Z-order | **array order**, later = on top. A layer is hidden (not removed) outside `[at, at+duration)` and keeps its last values |
|
|
15
15
|
| Time of a sequence's `at` | seconds from the start of its **parent composition** (default 0) |
|
|
@@ -45,7 +45,7 @@ blendMode: 'normal' | 'add' | 'screen' | 'multiply' | 'overlay' | 'soft-light' |
|
|
|
45
45
|
|
|
46
46
|
Animatable props (`initial` / keyframes): `x y alpha rotation scale scaleX scaleY pivotX pivotY anchorX anchorY skewX skewY tint width height visible autoAlpha`, plus for shapes their style/geometry, for text `fill`, for audio `volume`, for 3D `z rotationX rotationY`, filter params as `'filters.<name>.<param>'`, three objects as `'three.<obj>.<path>'`. **These go in `initial` / keyframes, never at the top level of a shape or text layer** (top-level `x`, `rotation`, `strokeColor`, `fillAlpha` each warn "is not a … key"): the top level of a shape holds its geometry (`width height radius d startAngle endAngle cornerRadius anchorX anchorY`), `trimStart` / `trimEnd`, `strokeCap` / `strokeJoin`, `fillGradient`.
|
|
47
47
|
|
|
48
|
-
Keyframe kinds: `set` (jump at `at`; undone when you seek back), `to` (animate to), `from` (animate from), `from`+`to
|
|
48
|
+
Keyframe kinds: `set` (jump at `at`; undone when you seek back), `to` (animate to), `from` (animate from), `from`+`to`; a value may be relative to where the layer stands (`from: { x: '-=36' }` slides in from 36 px to the left of its place). `from` / `from+to` show their start value from the layer's start, so a delayed fade-in needs no `initial.alpha`. `repeat` (finite extra plays), `yoyo`, `repeatDelay` loop any of them (endless repeats are not allowed). `ease` = any GSAP ease (`'none'`, `'power2.out'`, `'expo.out'`, `'back.out(1.7)'`, `'elastic.out(1,0.5)'`, `'sine.inOut'`, `'bounce.out'`, **`'cubic-bezier(.4, 0, .2, 1)'`** (CSS syntax, x1 and x2 in 0…1; `.4, 0, .2, 1` is a gentle in-out; `.2, .8, .2, 1` is FRONT-LOADED, not slow motion: half of the change in the first 13 % of the time, 90 % by 39 %, 99 % by 74 %, then a long settle, so what sits at the END of the content gets the glide; `.2, .8, .5, 1` has a shorter tail). GSAP's `power1…4` are the powers 2…5: `power2` is a cubic, `power2.in` has done only 12.5 % at half time (42 % at three quarters)… and springs: `'spring(mass, stiffness, damping)'` or `'spring.gentle' | 'snappy' | 'bouncy' | 'wobbly' | 'slow'`; **`duration: 'auto'` = the time the spring takes to settle** (presets, settle time / highest value reached as a multiple of the target: `snappy` 0.42 s / 1.01, `gentle` 0.72 s / 1.02, `bouncy` 1.08 s / 1.28, `slow` 1.29 s / 1.00, `wobbly` 1.61 s / 1.40: time the next beat from these) (real physics; with a number `duration` is the settle time and only the damping ratio shapes it; a damping ratio of 1 or more never overshoots, so `spring(1,170,26)` does not bounce: use damping below 20 at stiffness 170; `'auto'` works on keyframes only, not in `animateText` / `orbit` tweens; a `stagger` ease may be a spring, its delays are held inside the spread). Default ease is linear.
|
|
49
49
|
|
|
50
50
|
## Layer types
|
|
51
51
|
|
|
@@ -57,7 +57,7 @@ Keyframe kinds: `set` (jump at `at`; undone when you seek back), `to` (animate t
|
|
|
57
57
|
|
|
58
58
|
**audio** — a file: `asset`, `loop`, `volume`, `speed` (the pitch follows; `time` keyframes work as for video; not for `sfx` / `music`: change an sfx's `pitch` instead, or put it in a composition and remap that); `volume` (top level, or in `initial` like every other layer's starting values); fade with volume keyframes (`{ at: -2, to: { volume: 0 }, duration: 2 }` fades the last 2 s). Omit `duration` for a one-shot clip: it lasts exactly as long as the clip. With `loop: true` and no `duration` it lasts until the composition ends. An explicit `duration` longer than the clip goes silent after the clip unless `loop: true`.
|
|
59
59
|
**Or a sound effect with no file — `sfx`:** `{ type: 'audio', sfx: 'swoosh', at: 2 }` is the whole thing. Presets, default length in s: `click` 0.04 · `pop` 0.12 · `swoosh` 0.5 (loudest 0.16 s in, moves left → right) · `swipe` 0.22 · `hit` 0.7 · `riser` 1 (loudest at its END: `at = hit − duration`) · `chime` 1.4 · `beep` 0.16 · `coin` 0.4 · `glitch` 0.35 · `typewriter` 0.06. Knobs: `sfx: { preset, pitch /* semitones ±24 */, brightness /* −1 dark … 1 bright */, seed /* another take */ }`. **The layer's `duration` IS the sound's length** (omit it; set it to stretch, e.g. a riser; at most 10 s); `volume` is its level (1 = the preset's standard level, peaking at −12 … −18 dBFS by preset; above 1 is allowed: a sparse track of clicks measured −32 LUFS at 0.5 and needed about 2 to reach −24 LUFS). No `loop`: one layer per hit (a JS loop). Custom sound: `sfx: { voices: [{ wave: 'noise' | 'sine' | 'square' | 'saw' | 'triangle', freq: 440 | [from, to], filter: { type: 'lowpass' | 'highpass' | 'bandpass', freq: [from, to] }, envelope: 'fall' | 'bell' | 'swell' | 'hold', pan: [-1, 1] }] }`. The export (mp4 / webm / mov) encodes this same mix (lossy AAC / Opus), on time within a few ms.
|
|
60
|
-
**Or music with no file — `music`:** `{ type: 'audio', music: { bpm: 96, tracks: [{ inst: 'keys', notes: 'Cmaj7:4 Am7:4 Dm7:4 G7:4' }, { inst: 'bass', notes: 'c2:2 g1:2 …' }], drums: { kick: 'x...x...', snare: '....x...', hat: 'x.x.x.x.' } } }` — a tune written as text (notes `c4:2` in beats, chords `Am7` `C@4` `Am7/e
|
|
60
|
+
**Or music with no file — `music`:** `{ type: 'audio', music: { bpm: 96, tracks: [{ inst: 'keys', notes: 'Cmaj7:4 Am7:4 Dm7:4 G7:4' }, { inst: 'bass', notes: 'c2:2 g1:2 …' }], drums: { kick: 'x...x...', snare: '....x...', hat: 'x.x.x.x.' } } }` — a tune written as text (notes in LOWERCASE `c4:2` in beats, chords start with a CAPITAL `Am7` `G7` `C@4` `Am7/e` (`g7` is a very high note, not G7), `[c4 e4 g4]`, rest `_`, hold `~`, `!` accent; `|` ignored). Instruments `keys pluck pad bass sub lead bell musicbox`; drums `kick snare hat openhat clap rim tom crash shaker sleigh` as 16th-note step strings (`x` hit, `o` soft, `.` none; a list of `{ from, to, … }` for sections). Score options `bpm` (or `[[beat, bpm], …]` for a ritardando) `swing reverb (0–0.6) humanize drumVol grid transpose tail seed`; track options `vol` (or `[[beat, level], …]` for a fade) `pan step strum legato tone reverb attack release ring transpose`. Lasts its notes + tail, ends with the movie, `loop: true` repeats; peaks −6 dBFS at `volume: 1`. `await musicEnvelope(music, { frameRate })` → an envelope for `react()`; `await musicBuffer(music)` → a Web Audio `AudioBuffer` to play yourself.
|
|
61
61
|
|
|
62
62
|
**shape** — `shape: 'rect' | 'circle' | 'ellipse' | 'arc' | 'line' | 'polygon' | 'path'`:
|
|
63
63
|
|
|
@@ -167,7 +167,7 @@ const movie = new Movie();
|
|
|
167
167
|
await movie.init({ canvas, width, height, duration, frameRate, background, assets, composition });
|
|
168
168
|
movie.play(); movie.pause();
|
|
169
169
|
await movie.gotoFrame(n, true); // seek (frames; 30 fps => t = n/30)
|
|
170
|
-
const blob = await movie.render({ format: 'mp4' }); // 'mp4' | 'webm' | 'mov' | 'mkv'; ~real-time. Part of it: `range: [2, 5]` (seconds) or `range: 'title'` (a top-level layer's span; picture and sound); `scale: 0.5` / `draft: true` (half size, low quality, no motion blur: a smaller file, not a faster drawing). Fast motion: `movie.init({ motionBlur: true })` (8 samples, 180° shutter; or a number / { samples: 2–64, shutter: 0–1 }) blurs render / snapshot / contactSheet, not live playback; a render takes `samples`× as long
|
|
170
|
+
const blob = await movie.render({ format: 'mp4' }); // 'mp4' | 'webm' | 'mov' | 'mkv'; ~real-time. `format: 'wav'` / `'ogg'` writes only the movie's SOUND (a `music` score as an audio file). `video: { codec: 'hevc' | 'av1' | 'vp9' | 'avc', bitrate: '8M', hardware, keyFrameInterval }` (a codec this browser cannot encode names the one that works). Part of it: `range: [2, 5]` (seconds) or `range: 'title'` (a top-level layer's span; picture and sound); `scale: 0.5` / `draft: true` (half size, low quality, no motion blur: a smaller file, not a faster drawing). Fast motion: `movie.init({ motionBlur: true })` (8 samples, 180° shutter; or a number / { samples: 2–64, shutter: 0–1 }) blurs render / snapshot / contactSheet, not live playback; a render takes `samples`× as long
|
|
171
171
|
movie.on('progress', e => e.progress /* 0–100 */);
|
|
172
172
|
movie.audioBuffer // mixed audio (after init), if any audio layers
|
|
173
173
|
await movie.contactSheet({ count: 6, as: 'dataURL' }) // ONE image of several labelled frames — look at it. Options: frames | times | count, columns, cellWidth, as
|
|
@@ -126,3 +126,4 @@ A good habit that catches most of these: after `init`, read `window.__logs` (see
|
|
|
126
126
|
96. **A filter option that is a point (`rgbSplit.red`, `glitch` offsets) cannot be tweened as a whole**, but a scalar can: `set: { 'filters.tear.seed': n }` steps `glitch.seed` (a `set` keyframe works on filter options; no warning, visible tearing). To switch between looks on one subject, put the subject in time-windowed `composition` copies, each carrying the filters of its look.
|
|
127
127
|
97. **A deck inside your own composition loses its `transitions` and `stops`** unless you take them across: `const d = deck({ width: 1920, height: 1080, pages })`, then `{ type: 'composition', sequences: d.composition.sequences, transitions: d.composition.transitions }`. Pass `width` / `height` yourself for a page that is not the movie's own size.
|
|
128
128
|
98. **A matte layer needs a fill.** A named matte (`mask: 'glass'`) that is a shape with no `fillColor` / `fillGradient` (or a text with no fill) cuts everything away and nothing warns: the layers it should show simply vanish. Give the matte a fill (white for `alpha`, a gradient for `luma`).
|
|
129
|
+
99. **In a `music` score a capital letter is a chord and a lowercase one a note.** `G7` is G dominant seventh, `C5` a power chord, `C6` a sixth chord; `g7`, `c5`, `c6` are notes (octave 7 is a very high note: it used to be what `G7` meant, silently). A bare note in capitals (`Bb2`) is refused with the lowercase spelling (`bb2`); inside brackets (`[C4 E4 G4]`) any case is a note. An unknown chord kind suggests the nearest (`Cmin7` → `Cm7`, `Csus` → `Csus4`, `CM7` → `Cmaj7`).
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>pixi-effects video</title>
|
|
7
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pixi-effects@0.26.
|
|
7
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pixi-effects@0.26.3/dist/loader.css" /> <!-- the loader: HTML + CSS only, so it is on screen at once and keeps moving while the page builds the video -->
|
|
8
8
|
<style>
|
|
9
9
|
body { background: #0d1220; margin: 0; padding: 16px; }
|
|
10
10
|
.stage { position: relative; width: min(960px, 100%); } /* the player and the loader both sit inside this box */
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
"gsap": "https://esm.sh/gsap@3.12.5",
|
|
40
40
|
"gsap/PixiPlugin": "https://esm.sh/gsap@3.12.5/PixiPlugin",
|
|
41
41
|
"mediabunny": "https://esm.sh/mediabunny",
|
|
42
|
-
"pixi-effects": "https://cdn.jsdelivr.net/npm/pixi-effects@0.26.
|
|
43
|
-
"pixi-effects/controller": "https://cdn.jsdelivr.net/npm/pixi-effects@0.26.
|
|
44
|
-
"pixi-effects/presenter": "https://cdn.jsdelivr.net/npm/pixi-effects@0.26.
|
|
45
|
-
"pixi-effects/three": "https://cdn.jsdelivr.net/npm/pixi-effects@0.26.
|
|
42
|
+
"pixi-effects": "https://cdn.jsdelivr.net/npm/pixi-effects@0.26.3/dist/index.js",
|
|
43
|
+
"pixi-effects/controller": "https://cdn.jsdelivr.net/npm/pixi-effects@0.26.3/dist/Controller.js",
|
|
44
|
+
"pixi-effects/presenter": "https://cdn.jsdelivr.net/npm/pixi-effects@0.26.3/dist/Presenter.js",
|
|
45
|
+
"pixi-effects/three": "https://cdn.jsdelivr.net/npm/pixi-effects@0.26.3/dist/three.js",
|
|
46
46
|
"pixi-filters": "https://esm.sh/pixi-filters@6.1.5?external=pixi.js",
|
|
47
47
|
"three": "https://esm.sh/three@0.178.0"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
</script>
|
|
51
|
-
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/pixi-effects@0.26.
|
|
51
|
+
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/pixi-effects@0.26.3/dist/index.js" /> <!-- after the import map: the library downloads while the page is parsed -->
|
|
52
52
|
|
|
53
53
|
<script type="module">
|
|
54
54
|
import { Movie, kenBurns, withFade } from 'pixi-effects';
|