pixi-effects 0.45.0 → 0.47.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/CHANGELOG.md +17 -0
- package/README.md +5 -5
- package/ai/chat-template.html +3 -3
- package/ai/tools/check.mjs +2 -2
- package/ai/tools/lookup.mjs +6 -1
- package/ai/tools/pixi-effects.mjs +1 -0
- package/ai/tools/render.mjs +17 -1
- package/dist/Composition-NSY7A32Y.js +7 -0
- package/dist/{Composition-YGBQX3HZ.js.map → Composition-NSY7A32Y.js.map} +1 -1
- package/dist/Composition-PME3P5LP.cjs +16 -0
- package/dist/{Composition-N6BOROJ2.cjs.map → Composition-PME3P5LP.cjs.map} +1 -1
- package/dist/Controller.d.cts +2 -2
- package/dist/Controller.d.ts +2 -2
- package/dist/{Movie-C-d4zN-N.d.cts → Movie-BqrAWN0g.d.cts} +6 -1
- package/dist/{Movie-lMSS9JwX.d.ts → Movie-sV8nJr_f.d.ts} +6 -1
- package/dist/{Spans-XTIWYSNO.cjs → Spans-2TZCNREQ.cjs} +9 -9
- package/dist/{Spans-XTIWYSNO.cjs.map → Spans-2TZCNREQ.cjs.map} +1 -1
- package/dist/{Spans-6L2ZVECX.js → Spans-TESJPQKX.js} +4 -4
- package/dist/{Spans-6L2ZVECX.js.map → Spans-TESJPQKX.js.map} +1 -1
- package/dist/{chunk-O66JGPVV.cjs → chunk-23SXKSUI.cjs} +18 -4
- package/dist/chunk-23SXKSUI.cjs.map +1 -0
- package/dist/{chunk-K24FF4BT.js → chunk-4SEL6W7H.js} +18 -4
- package/dist/chunk-4SEL6W7H.js.map +1 -0
- package/dist/{chunk-3HZV3UHU.cjs → chunk-DKCMJILW.cjs} +67 -65
- package/dist/chunk-DKCMJILW.cjs.map +1 -0
- package/dist/{chunk-4QVQ5UJJ.js → chunk-DM2OLQOJ.js} +5 -6
- package/dist/chunk-DM2OLQOJ.js.map +1 -0
- package/dist/{chunk-ICI6ACHY.js → chunk-FPV3NPYC.js} +8 -6
- package/dist/chunk-FPV3NPYC.js.map +1 -0
- package/dist/{chunk-3IO5RWE4.cjs → chunk-I6VUQ2CR.cjs} +188 -74
- package/dist/chunk-I6VUQ2CR.cjs.map +1 -0
- package/dist/{chunk-X62H3RBG.cjs → chunk-LALEBV63.cjs} +5 -6
- package/dist/chunk-LALEBV63.cjs.map +1 -0
- package/dist/{chunk-Z6JQO7GX.js → chunk-W46VWAZC.js} +146 -32
- package/dist/chunk-W46VWAZC.js.map +1 -0
- package/dist/index.cjs +35 -35
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +4 -4
- package/dist/loader.css +1 -1
- package/dist/present.cjs +4 -4
- package/dist/present.d.cts +2 -2
- package/dist/present.d.ts +2 -2
- package/dist/present.js +4 -4
- package/dist/sound.cjs +2 -2
- package/dist/sound.js +1 -1
- package/dist/three.cjs +194 -15
- package/dist/three.cjs.map +1 -1
- package/dist/three.d.cts +75 -4
- package/dist/three.d.ts +75 -4
- package/dist/three.js +191 -13
- package/dist/three.js.map +1 -1
- package/dist/{types-C5xo0fzb.d.cts → types-CTSrPvY3.d.cts} +64 -58
- package/dist/{types-C5xo0fzb.d.ts → types-CTSrPvY3.d.ts} +64 -58
- package/docs/api.md +2 -1
- package/docs/dsl.md +25 -1
- package/llms-full.txt +65 -6
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +1 -1
- package/skills/pixi-effects/reference/cheatsheet.md +3 -3
- package/skills/pixi-effects/reference/recipes.md +34 -0
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-N6BOROJ2.cjs +0 -16
- package/dist/Composition-YGBQX3HZ.js +0 -7
- package/dist/chunk-3HZV3UHU.cjs.map +0 -1
- package/dist/chunk-3IO5RWE4.cjs.map +0 -1
- package/dist/chunk-4QVQ5UJJ.js.map +0 -1
- package/dist/chunk-ICI6ACHY.js.map +0 -1
- package/dist/chunk-K24FF4BT.js.map +0 -1
- package/dist/chunk-O66JGPVV.cjs.map +0 -1
- package/dist/chunk-X62H3RBG.cjs.map +0 -1
- package/dist/chunk-Z6JQO7GX.js.map +0 -1
|
@@ -355,6 +355,12 @@ function analyzeAudio(mix, sources, stats, movieDuration, opts = {}) {
|
|
|
355
355
|
const over = s.music.seconds - plays;
|
|
356
356
|
if (over > 2 && over / s.music.seconds > 0.15) scoreNotes.push(`${layer} (${source}): the score is ${Math.round(s.music.seconds * 10) / 10}s long but only ${Math.round(plays * 100) / 100}s of it play, so it is cut off mid-phrase. Write fewer bars (or a faster tempo) so it ends with the movie`);
|
|
357
357
|
}
|
|
358
|
+
if (s.music && s.music.tracks.length > 1) {
|
|
359
|
+
const short = s.music.tracks.filter((t) => t.beats <= s.music.beats - s.music.meter);
|
|
360
|
+
if (short.length > 0) {
|
|
361
|
+
scoreNotes.push(`${layer} (${source}): ${short.slice(0, 3).map((t) => `the ${t.inst} track is ${Math.round(t.beats * 100) / 100} beats long against ${s.music.beats} for the longest and falls silent from beat ${Math.round(t.beats * 100) / 100} (bar ${Math.floor(t.beats / s.music.meter) + 1})`).join("; ")}. If that is a miscount, add its missing beats (a rest is \`_:4\`); if it is on purpose, ignore this`);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
358
364
|
let belowMixDb;
|
|
359
365
|
if (!clock && !s.sourceMap && s.start < movieDuration && ownDb > INAUDIBLE_DB) {
|
|
360
366
|
const at = s.start + sound.loudestAt;
|
|
@@ -369,7 +375,7 @@ function analyzeAudio(mix, sources, stats, movieDuration, opts = {}) {
|
|
|
369
375
|
if (buried.length > 0) {
|
|
370
376
|
const worst = buried.reduce((a, b) => b.belowMixDb > a.belowMixDb ? b : a);
|
|
371
377
|
const distinct = new Set(buried.map((x) => (x.layer === "an audio layer" ? `#${buried.indexOf(x)}` : x.layer) + x.source)).size;
|
|
372
|
-
scoreNotes.push(`${distinct === 1 ? "1 sound effect is" : `${distinct} sound effects are`} buried (${BURIED_DB} dB or more under the loudest sample of the mix around its loudest moment${buried.length > distinct ? `, ${buried.length} times in all` : ""}): the worst is ${worst.layer} (${worst.source}), its own peak ${worst.ownDb} dBFS at volume ${Math.round(worst.topVolume * 100) / 100} against ${worst.around} dBFS at ${worst.at} s, ${worst.belowMixDb} dB louder. If it is meant to be heard, raise its volume (an accent over music needs 2 to 3) or lower what plays there; every source's belowMixDb has its own number`);
|
|
378
|
+
scoreNotes.push(`${distinct === 1 ? "1 sound effect is" : `${distinct} sound effects are`} buried (${BURIED_DB} dB or more under the loudest sample of the mix around its loudest moment${buried.length > distinct ? `, ${buried.length} times in all` : ""}): the worst is ${worst.layer} (${worst.source}), its own peak ${worst.ownDb} dBFS at volume ${Math.round(worst.topVolume * 100) / 100} against ${worst.around} dBFS at ${worst.at} s, ${worst.belowMixDb} dB louder. If it is meant to be heard, raise its volume (this one to about ${Math.round(Math.min(4, worst.topVolume * 10 ** ((worst.belowMixDb - 3) / 20)) * 10) / 10}, which puts it about 3 dB under the mix; an accent over music needs 2 to 3) or lower what plays there; every source's belowMixDb has its own number`);
|
|
373
379
|
}
|
|
374
380
|
const whole = measureLoudness(chans, sr);
|
|
375
381
|
const silences = findSilences(chans, sr, { minLength: 1 });
|
|
@@ -383,8 +389,16 @@ function analyzeAudio(mix, sources, stats, movieDuration, opts = {}) {
|
|
|
383
389
|
if (whole.truePeakDb > LOUDNESS_NOTES.headroomDb && whole.truePeakDb <= 0) notes.push(`the true peak is ${whole.truePeakDb} dBTP: little headroom left for encoding (keep it below ${LOUDNESS_NOTES.headroomDb} dBTP)`);
|
|
384
390
|
const asked = stats?.loudness;
|
|
385
391
|
if (asked) {
|
|
392
|
+
const playingAt = (t) => {
|
|
393
|
+
const at = sources.filter((x) => x.start <= t && t < Math.min(x.end, movieDuration)).map((x) => x.layer && x.layer !== "an audio layer" ? `${x.layer}${x.source ? ` (${x.source})` : ""}` : x.source ?? "audio");
|
|
394
|
+
return [...new Set(at)].slice(0, 6).join(", ") || "nothing that is listed";
|
|
395
|
+
};
|
|
386
396
|
if (asked.gainDb !== 0) notes.push(`the whole mix was ${asked.gainDb > 0 ? "raised" : "lowered"} by ${Math.abs(asked.gainDb)} dB to reach ${asked.target} LUFS (init({ loudness: ${asked.target} }))`);
|
|
387
|
-
if (asked.limited)
|
|
397
|
+
if (asked.limited) {
|
|
398
|
+
notes.push(`the mix could not reach ${asked.target} LUFS: it stopped at ${asked.reachedLufs} LUFS because its loudest moment${asked.limiterAt !== void 0 ? ` (at ${asked.limiterAt} s, where ${playingAt(asked.limiterAt)} play)` : ""} would need more than ${asked.limiterDb ?? 10} dB of limiting to stay under -1 dBTP; lower the sound that peaks there (a click or hit on top of a quiet bed), or ask for less`);
|
|
399
|
+
} else if (asked.limiterDb !== void 0 && asked.limiterDb >= 3) {
|
|
400
|
+
notes.push(`a limiter took up to ${asked.limiterDb} dB off the loudest peak (at ${asked.limiterAt} s, where ${playingAt(asked.limiterAt ?? 0)} play) so that the mix reaches ${asked.target} LUFS without passing -1 dBTP: if that sound should hit harder, lower what plays under it`);
|
|
401
|
+
}
|
|
388
402
|
}
|
|
389
403
|
for (const q of silences.slice(0, 3)) notes.push(`the mix is silent from ${q.from} s to ${q.to} s (${Math.round((q.to - q.from) * 10) / 10} s)`);
|
|
390
404
|
if (silences.length > 3) notes.push(`and ${silences.length - 3} more silent stretch(es) (loudness.silences lists them all)`);
|
|
@@ -426,5 +440,5 @@ function inspectSound(pcm, opts = {}) {
|
|
|
426
440
|
}
|
|
427
441
|
|
|
428
442
|
export { analyzeAudio, fft, inspectSound, measureLoudness, playSpan, resampleThrough };
|
|
429
|
-
//# sourceMappingURL=chunk-
|
|
430
|
-
//# sourceMappingURL=chunk-
|
|
443
|
+
//# sourceMappingURL=chunk-4SEL6W7H.js.map
|
|
444
|
+
//# sourceMappingURL=chunk-4SEL6W7H.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/audioRemap.ts","../src/core/spectrum.ts","../src/audio/loudness.ts","../src/core/inspectAudio.ts"],"names":[],"mappings":";AAKA,S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W,GAAA,CAAI,MAAA,GAAS,GAAA,CAAI,UAAA;AAClC,EAAA,MAAM,CAAA,GAAI,YAAA,CAAa,GAAA,EAAK,IAAI,IAAA,EAAM,QAAA,EAAU,IAAA,CAAK,MAAA,GAAS,EAAE,MAAA,EAAQ,IAAA,CAAK,MAAA,EAAO,GAAI,EAAE,CAAA;AAE1F,EAAA,MAAM,KAAA,GAAQ,KAAK,MAAA,IAAU,GAAA;AAC7B,EAAA,IAAI,UAAU,CAAA,CAAE,OAAA;AAChB,EAAA,IAAI,QAAQ,MAAA,GAAS,CAAA,IAAK,QAAA,GAAW,OAAA,CAAQ,QAAQ,MAAA,GAAS,CAAC,CAAA,CAAG,CAAA,GAAI,QAAQ,CAAA,EAAG,OAAA,GAAU,OAAA,CAAQ,KAAA,CAAM,GAAG,EAAE,CAAA;AAC9G,EAAA,OAAO;AAAA,IACL,QAAA,EAAU,IAAA,CAAK,KAAA,CAAM,QAAA,GAAW,GAAI,CAAA,GAAI,GAAA;AAAA,IAAM,YAAY,GAAA,CAAI,UAAA;AAAA,IAAY,UAAU,GAAA,CAAI,gBAAA;AAAA,IAAkB,QAAQ,CAAA,CAAE,MAAA;AAAA,IACpH,UAAU,CAAA,CAAE,QAAA;AAAA,IAAU,OAAA,EAAS,OAAA,CAAQ,GAAA,CAAI,CAAA,CAAA,MAAM,EAAE,CAAA,EAAG,CAAA,CAAE,CAAA,EAAG,KAAA,EAAO,CAAA,CAAE,KAAA,EAAM,CAAE,CAAA;AAAA,IAAG,OAAO,CAAC,GAAG,EAAE,KAAA,EAAO,GAAG,EAAE,MAAM;AAAA,GAChH;AACF","file":"chunk-4SEL6W7H.js","sourcesContent":["import type { AudioDescriptor } from '../types';\n\ntype RemapFields = Pick<AudioDescriptor, 'start' | 'end' | 'loop' | 'initialVolume' | 'volumeKeyframes' | 'warp' | 'sourceMap'>;\n\n/** The gain of a sound at its own time `u`: `initialVolume` from `start`, then straight lines to each point (what the Web Audio ramps did). */\nfunction gainAt(a: RemapFields, u: number): number {\n let prevT = a.start, prevV = a.initialVolume ?? 1;\n if (u <= prevT) return prevV;\n for (const kf of a.volumeKeyframes ?? []) {\n if (u <= kf.time) return kf.time === prevT ? kf.value : prevV + (kf.value - prevV) * ((u - prevT) / (kf.time - prevT));\n prevT = kf.time; prevV = kf.value;\n }\n return prevV;\n}\n\nconst CELL = 1 / 1000;\n\n/**\n * Render a sound through its time maps. For every output sample T: u = warp(T) (sampled every millisecond, interpolated), the position\n * in the sound is sourceMap(u) (or u - start), and the sample is read with linear interpolation. Where the position hardly moves (a\n * freeze) it fades to silence rather than hold one sample as a DC offset. Returns null when it is never audible. `at` is where in the\n * mix the returned samples begin. Pitch follows speed (a resample, like a tape).\n */\nexport function resampleThrough(\n a: RemapFields, left: Float32Array, right: Float32Array, srcRate: number, outRate: number, total: number,\n): { L: Float32Array; R: Float32Array; at: number } | null {\n const nCell = Math.ceil(total / CELL) + 2;\n const U = new Float64Array(nCell);\n let first = -1, last = -1;\n for (let k = 0; k < nCell; k++) {\n const u = a.warp ? a.warp(k * CELL) : k * CELL;\n U[k] = u;\n if (Number.isFinite(u) && u >= a.start && u < a.end) { if (first < 0) first = k; last = k; }\n }\n if (first < 0) return null;\n const lo = Math.max(0, (first - 1) * CELL), hi = Math.min(total, (last + 2) * CELL);\n const n = Math.max(1, Math.ceil((hi - lo) * outRate));\n const L = new Float32Array(n), R = new Float32Array(n);\n const dur = left.length / srcRate;\n let prevPos = NaN;\n for (let i = 0; i < n; i++) {\n const T = lo + i / outRate;\n const x = T / CELL, k = Math.min(Math.floor(x), nCell - 2), f = x - k;\n const u0 = U[k]!, u1 = U[k + 1]!;\n if (!(Number.isFinite(u0) && Number.isFinite(u1))) { prevPos = NaN; continue; }\n const u = u0 * (1 - f) + u1 * f;\n if (u < a.start || u >= a.end) { prevPos = NaN; continue; }\n const raw = a.sourceMap ? a.sourceMap(u) : u - a.start;\n let pos = raw;\n if (a.loop) pos = ((pos % dur) + dur) % dur;\n const rate = Number.isNaN(prevPos) ? 1 : Math.abs(raw - prevPos) * outRate;\n prevPos = raw;\n if (pos < 0 || pos >= dur) continue;\n const g = gainAt(a, u) * Math.min(1, rate / 0.02);\n const sp = pos * srcRate, j = Math.floor(sp), fr = sp - j, j1 = Math.min(j + 1, left.length - 1);\n L[i] = (left[j]! * (1 - fr) + left[j1]! * fr) * g;\n R[i] = (right[j]! * (1 - fr) + right[j1]! * fr) * g;\n }\n return { L, R, at: lo };\n}\n\n/**\n * When a sound plays, in the MOVIE's time. Without a `warp` that is `start`..`end`; with one (the sound sits in a remapped composition)\n * `start` / `end` are the composition's local times, so the span is where the warp lands inside them. `total` is the movie's length.\n */\nexport function playSpan(a: Pick<AudioDescriptor, 'start' | 'end' | 'warp'>, total: number): { start: number; end: number } {\n if (!a.warp) return { start: a.start, end: a.end };\n let first = -1, last = -1;\n const n = Math.ceil(total / CELL) + 1;\n for (let k = 0; k <= n; k++) {\n const u = a.warp(k * CELL);\n if (Number.isFinite(u) && u >= a.start && u < a.end) { if (first < 0) first = k; last = k; }\n }\n return first < 0 ? { start: total, end: total } : { start: first * CELL, end: (last + 1) * CELL };\n}\n\n/**\n * The farthest local time the warp (the clock of the composition the sound sits in) reaches during the movie. A sound whose local `end` is\n * beyond it is cut short by that clock (it stops or stands still) — a different cause than the end of the movie.\n */\nexport function clockReach(a: Pick<AudioDescriptor, 'warp'>, total: number): number {\n let reach = -Infinity;\n const n = Math.ceil(total / CELL) + 1;\n for (let k = 0; k <= n; k++) {\n const u = a.warp ? a.warp(k * CELL) : k * CELL;\n if (Number.isFinite(u) && u > reach) reach = u;\n }\n return reach;\n}\n","/** In-place radix-2 FFT (re/im arrays of the same power-of-two length). */\nexport function fft(re: Float64Array, im: Float64Array): void {\n const n = re.length;\n for (let i = 1, j = 0; i < n; i++) {\n let bit = n >> 1;\n for (; j & bit; bit >>= 1) j ^= bit;\n j ^= bit;\n if (i < j) { [re[i], re[j]] = [re[j]!, re[i]!]; [im[i], im[j]] = [im[j]!, im[i]!]; }\n }\n for (let len = 2; len <= n; len <<= 1) {\n const ang = (-2 * Math.PI) / len;\n for (let i = 0; i < n; i += len) {\n for (let k = 0; k < len / 2; k++) {\n const wr = Math.cos(ang * k), wi = Math.sin(ang * k);\n const a = i + k, b = a + len / 2;\n const xr = re[b]! * wr - im[b]! * wi, xi = re[b]! * wi + im[b]! * wr;\n re[b] = re[a]! - xr; im[b] = im[a]! - xi;\n re[a] = re[a]! + xr; im[a] = im[a]! + xi;\n }\n }\n }\n}\n\nconst FRAME = 2048;\n\n/**\n * Spectral centroid (\"brightness\") in Hz of `samples[from, to)`: the power-weighted mean frequency\n * over Hann-windowed 2048-sample frames (louder frames count more). 0 for silence.\n * Rough guide: < 500 Hz dark / boomy, 1–3 kHz mid, > 4 kHz bright / airy.\n */\nexport function spectralCentroid(samples: Float32Array, sampleRate: number, from = 0, to = samples.length): number {\n let num = 0;\n let den = 0;\n const re = new Float64Array(FRAME);\n const im = new Float64Array(FRAME);\n const end = Math.min(to, samples.length);\n for (let start = Math.max(0, from); start < end; start += FRAME / 2) {\n for (let i = 0; i < FRAME; i++) {\n const k = start + i;\n const w = 0.5 - 0.5 * Math.cos((2 * Math.PI * i) / (FRAME - 1));\n re[i] = k < end ? samples[k]! * w : 0;\n im[i] = 0;\n }\n fft(re, im);\n for (let b = 1; b < FRAME / 2; b++) {\n const power = re[b]! * re[b]! + im[b]! * im[b]!;\n num += power * ((b * sampleRate) / FRAME);\n den += power;\n }\n }\n return den > 1e-9 ? Math.round(num / den / 10) * 10 : 0;\n}\n","/** Loudness of a mix, ITU-R BS.1770-4 / EBU R128, without a dependency. Pure: takes channels, returns numbers. */\nexport interface LoudnessReport { integratedLufs: number | null; truePeakDb: number | null; samplePeakDb: number; clippedSamples: number }\n\n/** Where the advice in `inspectAudio().notes` starts: one place, so the docs can point at it. */\nexport const LOUDNESS_NOTES = { quietBelow: -20, loudAbove: -9, headroomDb: -1 } as const;\n\ninterface Biquad { b: [number, number, number]; a: [number, number, number] }\n\n/** The K-weighting of BS.1770-4: a high shelf, then a 38 Hz high-pass, as biquads for any sample rate (bilinear transform). */\nfunction kWeighting(fs: number): [Biquad, Biquad] {\n const f0 = 1681.974450955533, G = 3.999843853973347, Q = 0.7071752369554196;\n const K = Math.tan(Math.PI * f0 / fs), Vh = 10 ** (G / 20), Vb = Vh ** 0.4996667741545416;\n const a0 = 1 + K / Q + K * K;\n const shelf: Biquad = {\n b: [(Vh + Vb * K / Q + K * K) / a0, 2 * (K * K - Vh) / a0, (Vh - Vb * K / Q + K * K) / a0],\n a: [1, 2 * (K * K - 1) / a0, (1 - K / Q + K * K) / a0],\n };\n const f1 = 38.13547087602444, Q1 = 0.5003270373238773, K1 = Math.tan(Math.PI * f1 / fs), a1 = 1 + K1 / Q1 + K1 * K1;\n const high: Biquad = { b: [1, -2, 1], a: [1, 2 * (K1 * K1 - 1) / a1, (1 - K1 / Q1 + K1 * K1) / a1] };\n return [shelf, high];\n}\n\nfunction filter(x: Float32Array, stages: Biquad[]): Float32Array {\n let cur = x;\n for (const { b, a } of stages) {\n const out = new Float32Array(cur.length); // Float32 between stages: half the memory, far below the measurement's resolution\n let x1 = 0, x2 = 0, y1 = 0, y2 = 0;\n for (let i = 0; i < cur.length; i++) {\n const xi = cur[i]!, y = b[0] * xi + b[1] * x1 + b[2] * x2 - a[1] * y1 - a[2] * y2;\n x2 = x1; x1 = xi; y2 = y1; y1 = y; out[i] = y;\n }\n cur = out;\n }\n return cur;\n}\n\nconst toDb = (x: number): number => Math.round(200 * Math.log10(Math.max(x, 1e-6))) / 10; // 0.1 dB, floor -120\n\nconst TP_HALF = 12, TP_BLOCK = 32;\nconst TP_KERNELS = [0.25, 0.5, 0.75].map(p => Float64Array.from({ length: 2 * TP_HALF }, (_, j) => {\n const k = j - TP_HALF + 1, x = k - p, s = x === 0 ? 1 : Math.sin(Math.PI * x) / (Math.PI * x);\n return s * (0.5 + 0.5 * Math.cos(Math.PI * x / (TP_HALF + 1)));\n}));\n/** No interpolated value can exceed (the loudest sample around it) x this: where that cannot beat the peak so far, skip the sums. */\nconst TP_GAIN = Math.max(...TP_KERNELS.map(k => k.reduce((a, v) => a + Math.abs(v), 0)));\n\n/** 4x oversampled peak (windowed-sinc interpolation, 12 samples either side): catches peaks between samples. Equal to checking every phase of every sample, only faster. */\nfunction truePeak(chans: Float32Array[]): number {\n let peak = 0;\n for (const c of chans) {\n const n = c.length;\n const blocks = Math.ceil(n / TP_BLOCK), blockMax = new Float32Array(blocks + 2); // [b + 1] is block b; the ends stay 0\n for (let i = 0; i < n; i++) { const a = Math.abs(c[i]!), b = (i / TP_BLOCK | 0) + 1; if (a > blockMax[b]!) blockMax[b] = a; if (a > peak) peak = a; }\n const padded = new Float32Array(n + 2 * TP_HALF); // zeros around, so the sums need no bounds check\n padded.set(c, TP_HALF);\n for (let i = 0; i < n; i++) {\n const b = (i / TP_BLOCK | 0) + 1;\n const local = Math.max(blockMax[b - 1]!, blockMax[b]!, blockMax[b + 1]!); // the 24 samples around i lie in these three blocks\n if (local * TP_GAIN <= peak) continue;\n for (let pi = 0; pi < 3; pi++) {\n const k = TP_KERNELS[pi]!;\n let v = 0;\n for (let j = 0; j < 2 * TP_HALF; j++) v += padded[i + 1 + j]! * k[j]!;\n const a = Math.abs(v);\n if (a > peak) peak = a;\n }\n }\n }\n return peak;\n}\n\nexport function measureLoudness(channels: Float32Array[], sampleRate: number, opts: { truePeak?: boolean } = {}): LoudnessReport {\n let samplePeak = 0, clipped = 0;\n for (const c of channels) for (let i = 0; i < c.length; i++) { const a = Math.abs(c[i]!); if (a > samplePeak) samplePeak = a; if (a >= 1) clipped++; }\n const stages = kWeighting(sampleRate);\n const weighted = channels.map(c => filter(c, stages));\n const block = Math.round(0.4 * sampleRate), hop = Math.round(0.1 * sampleRate);\n const energies: number[] = [];\n for (let s = 0; s + block <= (weighted[0]?.length ?? 0); s += hop) {\n let sum = 0;\n for (const w of weighted) { let z = 0; for (let i = s; i < s + block; i++) z += w[i]! * w[i]!; sum += z / block; } // the weight is 1 for L, R and mono\n energies.push(sum);\n }\n const lufs = (e: number): number => -0.691 + 10 * Math.log10(e);\n const absolute = energies.filter(e => e > 0 && lufs(e) > -70);\n let integrated: number | null = null;\n if (absolute.length) {\n const relative = lufs(absolute.reduce((a, b) => a + b, 0) / absolute.length) - 10;\n const gated = absolute.filter(e => lufs(e) > relative);\n if (gated.length) integrated = Math.round(10 * lufs(gated.reduce((a, b) => a + b, 0) / gated.length)) / 10;\n }\n return { integratedLufs: integrated, truePeakDb: opts.truePeak === false ? null : toDb(truePeak(channels)), samplePeakDb: toDb(samplePeak), clippedSamples: clipped };\n}\n\n/** Runs of at least `minLength` seconds where every channel stays below `thresholdDb` (default -60 dBFS). */\nexport function findSilences(channels: Float32Array[], sampleRate: number, opts: { minLength?: number; thresholdDb?: number } = {}): Array<{ from: number; to: number }> {\n const min = Math.round((opts.minLength ?? 1) * sampleRate), limit = 10 ** ((opts.thresholdDb ?? -60) / 20);\n const n = channels[0]?.length ?? 0, out: Array<{ from: number; to: number }> = [];\n let start = -1;\n const quiet = (i: number): boolean => channels.every(c => Math.abs(c[i]!) < limit);\n for (let i = 0; i <= n; i++) {\n const q = i < n && quiet(i);\n if (q && start < 0) start = i;\n if (!q && start >= 0) { if (i - start >= min) out.push({ from: Math.round(start / sampleRate * 1000) / 1000, to: Math.round(i / sampleRate * 1000) / 1000 }); start = -1; }\n }\n return out;\n}\n","import type { AudioDescriptor } from '../types';\nimport type { MusicSummary } from '../audio/music/events';\nimport { playSpan, clockReach } from './audioRemap';\nimport type { MixStats } from './AudioMixer';\nimport { spectralCentroid } from './spectrum';\nimport { findSilences, LOUDNESS_NOTES, measureLoudness } from '../audio/loudness';\n\nexport interface AudioInspectOptions {\n /** Width of each loudness window in seconds. Default 0.1. */\n window?: number;\n /** The scenes to measure one by one (`movie.inspectAudio()` fills this from the movie's named top-level compositions). Default: the whole movie as one. */\n scenes?: Array<{ name: string; start: number; end: number }>;\n}\n\n/** One sound measured ON ITS OWN (not mixed), so overlapping layers do not blur it. */\nexport interface SoundMeasure {\n /** Seconds of audio the source has (an sfx: its length; a file: the file's length). */\n length: number;\n /** Its own loudest sample, dBFS (before the layer's volume). */\n peakDb: number;\n /** Seconds from its start to its loudest sample — the moment to line up with the picture. */\n loudestAt: number;\n /** Spectral centroid in Hz: < 500 dark / boomy, 1–4 k mid, > 8 k airy / hissy. */\n brightnessHz: number;\n}\n\nexport interface AudioSourceReport {\n /** `layer \"pop-1\"` (or `unnamed audio layer`). */\n layer: string;\n /** `sfx \"pop\"`, `asset \"bgm\"`, `video \"green\"`. */\n source: string;\n /** Movie time, seconds. */\n start: number;\n end: number;\n /** Loudest sample of the MIX while this source plays, dBFS (−120 = silence). */\n peakDb: number;\n sound: SoundMeasure;\n /**\n * How far below the loudest sample of the MIX around its own loudest moment this source is, dB (0 = it is the loudest thing there; 20 = the mix is 20 dB louder, so\n * the source is hardly heard). Absent for a sound inside a remapped composition (its time is not the movie's).\n */\n belowMixDb?: number;\n /** For a `music` layer: its score read back (bars per track, what starts in each bar, the drum spans). */\n music?: MusicSummary;\n}\n\nexport interface AudioReport {\n duration: number;\n sampleRate: number;\n /** Loudest sample of the mix before limiting, dBFS. Above 0 the mix was limited. */\n peakDb: number;\n peakAt: number;\n /** Every audio layer / video soundtrack in the mix, in start order. */\n sources: AudioSourceReport[];\n /** The mix over time: one row per window, `t` = window start. */\n windows: Array<{ t: number; rmsDb: number; peakDb: number; brightnessHz: number }>;\n /** Problems worth fixing: limiting, clipping, a true peak above 0 dBTP, inaudible layers, sounds cut off by the end of the movie. Read this first. */\n issues: string[];\n /** The mix as a whole (ITU-R BS.1770 loudness; `integratedLufs` is null for a mix shorter than 0.4 s or with nothing above −70 LUFS). */\n loudness: { integratedLufs: number | null; truePeakDb: number; clippedSamples: number; silences: Array<{ from: number; to: number }> };\n /** The same measure for each scene (`silent`: nothing above −60 dBFS). */\n scenes: Array<{ name: string; from: number; to: number; lufs: number | null; peakDb: number; silent: boolean }>;\n /** When each sound starts: what a waveform marks. */\n cues: Array<{ t: number; name: string }>;\n /** Advice, not faults: a mix that is quiet or loud for web video, little headroom, silent stretches. */\n notes: string[];\n}\n\ninterface PcmLike {\n numberOfChannels: number;\n sampleRate: number;\n length: number;\n getChannelData(ch: number): Float32Array;\n}\n\n/** A short sound effect this many dB under the loudest sample of the mix around its loudest moment is hardly heard. */\nconst BURIED_DB = 12;\n/** Below this a source counts as inaudible. */\nconst INAUDIBLE_DB = -50;\n\nconst db = (x: number): number => Math.round(10 * Math.max(-120, 20 * Math.log10(x))) / 10;\nconst mono = (chans: Float32Array[]): Float32Array => {\n if (chans.length === 1) return chans[0]!;\n const out = new Float32Array(chans[0]!.length);\n for (const d of chans) for (let i = 0; i < out.length; i++) out[i] = out[i]! + d[i]! / chans.length;\n return out;\n};\n\nfunction measure(chans: Float32Array[], sampleRate: number): SoundMeasure {\n let peak = 0;\n let at = 0;\n for (const d of chans) for (let i = 0; i < d.length; i++) if (Math.abs(d[i]!) > peak) { peak = Math.abs(d[i]!); at = i; }\n return {\n length: Math.round((chans[0]!.length / sampleRate) * 1000) / 1000,\n peakDb: db(peak),\n loudestAt: Math.round((at / sampleRate) * 1000) / 1000,\n brightnessHz: spectralCentroid(mono(chans), sampleRate),\n };\n}\n\n/**\n * Measure the soundtrack so an author who cannot listen can still check it: every sound on its own\n * (length, level, loudest moment, brightness), when it plays and how loud the mix is there, the mix over\n * time, and issues. Pure: takes the mix and the list of sources that went into it.\n */\nexport function analyzeAudio(\n mix: PcmLike | null, sources: AudioDescriptor[], stats: MixStats | null, movieDuration: number, opts: AudioInspectOptions = {},\n): AudioReport {\n // A sound inside a remapped composition has `start` / `end` in that composition's local time: report when it plays in the MOVIE's time.\n const warped = new Map<AudioDescriptor, { localEnd: number; reach: number }>();\n sources = sources.map(s => {\n if (!s.warp) return s;\n const moved = { ...s, ...playSpan(s, movieDuration) };\n warped.set(moved, { localEnd: s.end, reach: clockReach(s, movieDuration) });\n return moved;\n });\n if (!mix) {\n return { duration: movieDuration, sampleRate: 0, peakDb: -120, peakAt: 0, sources: [], windows: [],\n loudness: { integratedLufs: null, truePeakDb: -120, clippedSamples: 0, silences: [] }, scenes: [], cues: [], notes: [], issues: ['no audio: the movie has no audio layers (sound effects need no files: { type: \"audio\", sfx: \"pop\", at: 1 })'] };\n }\n const sr = mix.sampleRate;\n const chans = Array.from({ length: mix.numberOfChannels }, (_, c) => mix.getChannelData(c));\n const mixMono = mono(chans);\n const peakIn = (t0: number, t1: number): number => {\n let p = 0;\n const i1 = Math.min(mix.length, Math.ceil(t1 * sr));\n for (const d of chans) for (let i = Math.max(0, Math.floor(t0 * sr)); i < i1; i++) p = Math.max(p, Math.abs(d[i]!));\n return p;\n };\n\n // at least 10 ms: a smaller window would ask for a spectrum per sample\n const win = opts.window && opts.window > 0 ? Math.max(0.01, opts.window) : 0.1;\n const windows: AudioReport['windows'] = [];\n for (let t = 0; t < movieDuration - 1e-9; t += win) {\n const i0 = Math.floor(t * sr);\n const i1 = Math.min(mix.length, Math.floor((t + win) * sr));\n let sum = 0;\n let peak = 0;\n for (const d of chans) {\n for (let i = i0; i < i1; i++) {\n sum += d[i]! * d[i]!;\n peak = Math.max(peak, Math.abs(d[i]!));\n }\n }\n const n = Math.max(1, (i1 - i0) * chans.length);\n windows.push({ t: Math.round(t * 1000) / 1000, rmsDb: db(Math.sqrt(sum / n)), peakDb: db(peak), brightnessHz: spectralCentroid(mixMono, sr, i0, i1) });\n }\n\n const issues: string[] = [];\n if (stats && stats.peak > 1) {\n issues.push(`the mix peaks at ${db(stats.peak)} dBFS at ${stats.peakAt.toFixed(2)}s and was limited — lower the volume of the layers playing there`);\n }\n const rendered = new Map<string, SoundMeasure>();\n const soundOf = (s: AudioDescriptor): SoundMeasure => {\n if (s.synth) {\n let m = rendered.get(s.synth.key);\n if (!m) rendered.set(s.synth.key, (m = measure(s.synth.render(sr), sr)));\n return m;\n }\n const b = s.buffer!;\n return measure(Array.from({ length: b.numberOfChannels }, (_, c) => b.getChannelData(c)), b.sampleRate);\n };\n const scoreNotes: string[] = [];\n const buried: Array<{ layer: string; source: string; ownDb: number; topVolume: number; around: number; belowMixDb: number; at: number }> = [];\n const list = [...sources].sort((a, b) => a.start - b.start).map(s => {\n const layer = s.layer ?? 'an audio layer';\n const source = s.source ?? 'audio';\n const peakDb = db(peakIn(s.start, Math.min(s.end, movieDuration)));\n const sound = soundOf(s);\n // The layer's OWN level: the sound's peak at the loudest volume it ever has. Judging the mix instead would\n // hide a nearly silent layer under a loud one.\n const topVolume = Math.max(s.initialVolume ?? 1, ...(s.volumeKeyframes ?? []).map(k => k.value));\n const ownDb = db(Math.pow(10, sound.peakDb / 20) * Math.max(0, topVolume));\n if (s.start >= movieDuration) {\n issues.push(`${layer} (${source}) starts at ${s.start.toFixed(2)}s, after the movie ends (${movieDuration}s)`);\n } else if (ownDb < INAUDIBLE_DB || peakDb < INAUDIBLE_DB) {\n issues.push(`${layer} (${source}) is inaudible from ${s.start.toFixed(2)}s to ${s.end.toFixed(2)}s (its own peak ${ownDb} dBFS at volume ${topVolume}; mix peak there ${peakDb} dBFS) — check its volume`);\n }\n const clock = warped.get(s);\n if (s.synth && s.start < movieDuration) {\n if (clock) {\n // inside a remapped composition: it is cut short when the composition's clock never gets to the end of the sound\n if (clock.reach < clock.localEnd - 1e-3) {\n issues.push(`${layer} (${source}) is cut off: its composition's clock only reaches ${clock.reach.toFixed(2)}s (the sound is ${clock.localEnd.toFixed(2)}s long), because the clock stops or the movie ends first — give the layer a shorter duration, or let the clock run on`);\n }\n } else if (s.end > movieDuration + 1e-6) {\n issues.push(`${layer} (${source}) is cut off by the end of the movie at ${movieDuration}s (it runs to ${s.end.toFixed(2)}s)`);\n }\n }\n // A written score (`music`) much longer than what plays: said as a NOTE (a trial: 19.2 s of music under a 10 s film; the read-back showed it but nothing said it).\n // Not a fault: music that outlasts the movie ends with it (see Audio.ts). A tail under 2 s or 15 % over is only the reverb tail; a looping layer is meant to be cut.\n if (s.music && !s.loop && s.start < movieDuration && !clock) {\n const plays = Math.min(s.end, movieDuration) - s.start;\n const over = s.music.seconds - plays;\n if (over > 2 && over / s.music.seconds > 0.15) scoreNotes.push(`${layer} (${source}): the score is ${Math.round(s.music.seconds * 10) / 10}s long but only ${Math.round(plays * 100) / 100}s of it play, so it is cut off mid-phrase. Write fewer bars (or a faster tempo) so it ends with the movie`);\n }\n // A track a bar or more shorter than the longest one is silent from its end on: usually a miscount of the beats (a trial: three agents; only the read-back showed it). A note, not a fault: a bell may come and go on purpose.\n if (s.music && s.music.tracks.length > 1) {\n const short = s.music.tracks.filter(t => t.beats <= s.music!.beats - s.music!.meter);\n if (short.length > 0) {\n scoreNotes.push(`${layer} (${source}): ${short.slice(0, 3).map(t => `the ${t.inst} track is ${Math.round(t.beats * 100) / 100} beats long against ${s.music!.beats} for the longest and falls silent from beat ${Math.round(t.beats * 100) / 100} (bar ${Math.floor(t.beats / s.music!.meter) + 1})`).join('; ')}. If that is a miscount, add its missing beats (a rest is \\`_:4\\`); if it is on purpose, ignore this`);\n }\n }\n // Buried: the sound's own peak against the mix around its loudest moment. A short sound effect 12 dB or more under what plays with it is a hit nobody hears.\n // (A layer with its own speed or `time` plays the sound at another pace: its loudest moment is not at start + loudestAt, so it is left out.)\n let belowMixDb: number | undefined;\n if (!clock && !s.sourceMap && s.start < movieDuration && ownDb > INAUDIBLE_DB) {\n const at = s.start + sound.loudestAt;\n const around = db(peakIn(Math.max(0, at - 0.05), Math.min(movieDuration, at + 0.05)));\n belowMixDb = Math.max(0, Math.round((around - ownDb) * 10) / 10);\n if (!s.music && source.startsWith('sfx') && sound.length <= 4 && belowMixDb >= BURIED_DB) {\n buried.push({ layer, source, ownDb, topVolume, around, belowMixDb, at: Math.round(at * 100) / 100 });\n }\n }\n return { layer, source, start: s.start, end: s.end, peakDb, sound, ...(belowMixDb !== undefined ? { belowMixDb } : {}), ...(s.music ? { music: s.music } : {}) };\n });\n\n // ONE note for the movie (an accent that is meant to be subtle is common: the numbers are in every source's `belowMixDb`): how many, and the worst\n if (buried.length > 0) {\n const worst = buried.reduce((a, b) => (b.belowMixDb > a.belowMixDb ? b : a));\n // layers with no name all carry the same label, so they are counted one by one; a named layer that plays many times counts once\n const distinct = new Set(buried.map(x => (x.layer === 'an audio layer' ? `#${buried.indexOf(x)}` : x.layer) + x.source)).size;\n scoreNotes.push(`${distinct === 1 ? '1 sound effect is' : `${distinct} sound effects are`} buried (${BURIED_DB} dB or more under the loudest sample of the mix around its loudest moment${buried.length > distinct ? `, ${buried.length} times in all` : ''}): the worst is ${worst.layer} (${worst.source}), its own peak ${worst.ownDb} dBFS at volume ${Math.round(worst.topVolume * 100) / 100} against ${worst.around} dBFS at ${worst.at} s, ${worst.belowMixDb} dB louder. If it is meant to be heard, raise its volume (this one to about ${Math.round(Math.min(4, worst.topVolume * 10 ** ((worst.belowMixDb - 3) / 20)) * 10) / 10}, which puts it about 3 dB under the mix; an accent over music needs 2 to 3) or lower what plays there; every source's belowMixDb has its own number`);\n }\n // the mix as a whole, scene by scene, and the advice\n const whole = measureLoudness(chans, sr);\n const silences = findSilences(chans, sr, { minLength: 1 });\n if (whole.clippedSamples > 0) issues.push(`${whole.clippedSamples} sample(s) of the mix are at full scale (clipped) — lower the volume of the layers that play loudest`);\n if (whole.truePeakDb! > 0) issues.push(`the mix's true peak is ${whole.truePeakDb} dBTP: it will distort when the video is encoded — lower the volume`);\n const notes: string[] = [...scoreNotes];\n if (whole.integratedLufs !== null) {\n if (whole.integratedLufs < LOUDNESS_NOTES.quietBelow) notes.push(`the mix is quiet for web video: ${whole.integratedLufs} LUFS (typical −14 to −16); raise the volume, or ask for a loudness: movie.init({ loudness: -16 }), if that is not on purpose`);\n else if (whole.integratedLufs > LOUDNESS_NOTES.loudAbove) notes.push(`the mix is loud: ${whole.integratedLufs} LUFS (typical web video −14 to −16)`);\n }\n if (whole.truePeakDb! > LOUDNESS_NOTES.headroomDb && whole.truePeakDb! <= 0) notes.push(`the true peak is ${whole.truePeakDb} dBTP: little headroom left for encoding (keep it below ${LOUDNESS_NOTES.headroomDb} dBTP)`);\n const asked = stats?.loudness;\n if (asked) {\n // which layers play at a moment (the ones a peak there is made of); an unnamed layer is told by what it plays\n const playingAt = (t: number): string => {\n const at = sources.filter(x => x.start <= t && t < Math.min(x.end, movieDuration)).map(x => (x.layer && x.layer !== 'an audio layer' ? `${x.layer}${x.source ? ` (${x.source})` : ''}` : x.source ?? 'audio'));\n return [...new Set(at)].slice(0, 6).join(', ') || 'nothing that is listed';\n };\n if (asked.gainDb !== 0) notes.push(`the whole mix was ${asked.gainDb > 0 ? 'raised' : 'lowered'} by ${Math.abs(asked.gainDb)} dB to reach ${asked.target} LUFS (init({ loudness: ${asked.target} }))`);\n if (asked.limited) {\n notes.push(`the mix could not reach ${asked.target} LUFS: it stopped at ${asked.reachedLufs} LUFS because its loudest moment${asked.limiterAt !== undefined ? ` (at ${asked.limiterAt} s, where ${playingAt(asked.limiterAt)} play)` : ''} would need more than ${asked.limiterDb ?? 10} dB of limiting to stay under -1 dBTP; lower the sound that peaks there (a click or hit on top of a quiet bed), or ask for less`);\n } else if (asked.limiterDb !== undefined && asked.limiterDb >= 3) {\n notes.push(`a limiter took up to ${asked.limiterDb} dB off the loudest peak (at ${asked.limiterAt} s, where ${playingAt(asked.limiterAt ?? 0)} play) so that the mix reaches ${asked.target} LUFS without passing -1 dBTP: if that sound should hit harder, lower what plays under it`);\n }\n }\n for (const q of silences.slice(0, 3)) notes.push(`the mix is silent from ${q.from} s to ${q.to} s (${Math.round((q.to - q.from) * 10) / 10} s)`);\n if (silences.length > 3) notes.push(`and ${silences.length - 3} more silent stretch(es) (loudness.silences lists them all)`);\n const sceneList = (opts.scenes && opts.scenes.length ? opts.scenes : [{ name: 'movie', start: 0, end: movieDuration }]).map(sc => {\n const a = Math.max(0, Math.round(sc.start * sr)), b = Math.min(mix.length, Math.round(sc.end * sr));\n const part = chans.map(c => c.subarray(a, Math.max(a, b)));\n const m = measureLoudness(part, sr, { truePeak: false }); // the true peak is the slow part and is only wanted for the whole mix\n return { name: sc.name, from: sc.start, to: sc.end, lufs: m.integratedLufs, peakDb: m.samplePeakDb, silent: m.samplePeakDb < -60 };\n });\n\n return {\n duration: movieDuration,\n sampleRate: sr,\n peakDb: db(stats?.peak ?? peakIn(0, movieDuration)),\n peakAt: stats?.peakAt ?? 0,\n sources: list,\n windows,\n issues,\n loudness: { integratedLufs: whole.integratedLufs, truePeakDb: whole.truePeakDb ?? -120, clippedSamples: whole.clippedSamples, silences },\n scenes: sceneList,\n cues: list.map(s => ({ t: s.start, name: `${s.layer} (${s.source})` })),\n notes,\n };\n}\n\n/** What `inspectSound` says about a sound. */\nexport interface SoundReport {\n /** Seconds, the sample rate and the number of channels of what was measured. */\n duration: number;\n sampleRate: number;\n channels: number;\n /** The loudest sample, dBFS. */\n peakDb: number;\n /** ITU-R BS.1770 loudness, true peak, samples at full scale and silences, as `check` reports them for a movie's mix. */\n loudness: AudioReport['loudness'];\n /** The level over time: the RMS of each window (`window` seconds, 0.1 by default), dBFS. */\n windows: Array<{ t: number; rmsDb: number }>;\n /** Advice (quiet or loud for web video, little headroom, silent stretches) and what would distort when encoded. */\n notes: string[];\n}\n\n/**\n * Measure the sound of any file, not only a movie's mix: its loudness, peak, clipping, silences and level over time, with the same code `movie.inspectAudio()` uses, so\n * `check` and the `pixi-effects sound` command give the same numbers for the same samples. Takes decoded PCM (an AudioBuffer works).\n */\nexport function inspectSound(pcm: PcmLike, opts: { window?: number } = {}): SoundReport {\n const duration = pcm.length / pcm.sampleRate;\n const r = analyzeAudio(pcm, [], null, duration, opts.window ? { window: opts.window } : {});\n // a file that ends a few ms into a window would show that sliver as a row (a 36 ms tail of encoder padding reads as −90 dBFS): a last window under half the width is dropped\n const width = opts.window ?? 0.1;\n let windows = r.windows;\n if (windows.length > 1 && duration - windows[windows.length - 1]!.t < width / 2) windows = windows.slice(0, -1);\n return {\n duration: Math.round(duration * 1000) / 1000, sampleRate: pcm.sampleRate, channels: pcm.numberOfChannels, peakDb: r.peakDb,\n loudness: r.loudness, windows: windows.map(w => ({ t: w.t, rmsDb: w.rmsDb })), notes: [...r.notes, ...r.issues],\n };\n}\n\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkLALEBV63_cjs = require('./chunk-LALEBV63.cjs');
|
|
4
4
|
var chunkJN7JHNZR_cjs = require('./chunk-JN7JHNZR.cjs');
|
|
5
5
|
var chunk3SAS3ZE5_cjs = require('./chunk-3SAS3ZE5.cjs');
|
|
6
6
|
var chunkTWZNOUM7_cjs = require('./chunk-TWZNOUM7.cjs');
|
|
@@ -33,10 +33,10 @@ var KIND_ALIASES = {
|
|
|
33
33
|
fill: "ambient"
|
|
34
34
|
};
|
|
35
35
|
function lightKindProblem(kind) {
|
|
36
|
-
if (kind === void 0 || typeof kind === "string" &&
|
|
37
|
-
const guess = typeof kind === "string" ? KIND_ALIASES[kind.toLowerCase()] ?? chunkTWZNOUM7_cjs.suggestName(kind,
|
|
36
|
+
if (kind === void 0 || typeof kind === "string" && chunkLALEBV63_cjs.LIGHT_KINDS.includes(kind)) return null;
|
|
37
|
+
const guess = typeof kind === "string" ? KIND_ALIASES[kind.toLowerCase()] ?? chunkTWZNOUM7_cjs.suggestName(kind, chunkLALEBV63_cjs.LIGHT_KINDS) : null;
|
|
38
38
|
const shown = typeof kind === "string" ? `"${kind}"` : String(kind);
|
|
39
|
-
return `kind ${shown} is not a light kind${guess ? `; did you mean "${guess}"?` : ""} (use ${
|
|
39
|
+
return `kind ${shown} is not a light kind${guess ? `; did you mean "${guess}"?` : ""} (use ${chunkLALEBV63_cjs.LIGHT_KINDS.join(", ")}); point is used`;
|
|
40
40
|
}
|
|
41
41
|
var LIGHT_ALIASES = {
|
|
42
42
|
pointOfInterest: 'did you mean "lookAtX / lookAtY / lookAtZ"?',
|
|
@@ -61,24 +61,24 @@ function lightLayerProblems(spec) {
|
|
|
61
61
|
const raw = spec;
|
|
62
62
|
const kind = lightKindProblem(raw.kind);
|
|
63
63
|
if (kind) out.push(kind);
|
|
64
|
-
if (raw.falloff !== void 0 && !
|
|
65
|
-
const guess = typeof raw.falloff === "string" ? chunkTWZNOUM7_cjs.suggestName(raw.falloff,
|
|
66
|
-
out.push(`falloff ${JSON.stringify(raw.falloff)} is not supported${guess ? `; did you mean "${guess}"?` : ""} (use ${
|
|
64
|
+
if (raw.falloff !== void 0 && !chunkLALEBV63_cjs.FALLOFFS.includes(raw.falloff)) {
|
|
65
|
+
const guess = typeof raw.falloff === "string" ? chunkTWZNOUM7_cjs.suggestName(raw.falloff, chunkLALEBV63_cjs.FALLOFFS) : null;
|
|
66
|
+
out.push(`falloff ${JSON.stringify(raw.falloff)} is not supported${guess ? `; did you mean "${guess}"?` : ""} (use ${chunkLALEBV63_cjs.FALLOFFS.join(", ")}); none is used`);
|
|
67
67
|
}
|
|
68
68
|
for (const k of Object.keys(raw)) {
|
|
69
|
-
if (
|
|
69
|
+
if (chunkLALEBV63_cjs.LIGHT_PROPS.includes(k) || k === "intensity" || k === "shadowDarkness" || k === "shadowDiffusion") {
|
|
70
70
|
out.push(`"${k}" must go inside initial / keyframes, not on the light itself`);
|
|
71
71
|
} else if (LIGHT_ALIASES[k]) out.push(`"${k}" is not a property \u2014 ${LIGHT_ALIASES[k]}`);
|
|
72
72
|
}
|
|
73
73
|
const explained = new Set(Object.keys(LIGHT_ALIASES));
|
|
74
74
|
for (const k of chunk3SAS3ZE5_cjs.collectPropKeys(spec)) {
|
|
75
75
|
if (LIGHT_ALIASES[k]) out.push(`"${k}" is not a property \u2014 ${LIGHT_ALIASES[k]}`);
|
|
76
|
-
else if (!explained.has(k) && !
|
|
76
|
+
else if (!explained.has(k) && !chunkLALEBV63_cjs.LIGHT_PROPS.includes(k)) out.push(`"${k}" has no effect on a light (use ${chunkLALEBV63_cjs.LIGHT_PROPS.join(", ")})`);
|
|
77
77
|
}
|
|
78
78
|
if (numbersOf(spec, "coneFeather").some((v) => v > 1 || v < 0)) out.push("coneFeather is 0..1 (the soft part of the cone edge, as a fraction of the half angle); it is clamped");
|
|
79
79
|
const big = numbersOf(spec, "intensity").find((v) => v > 10);
|
|
80
80
|
if (big !== void 0) out.push(`intensity ${big} looks like a percentage: it is a multiplier (1 = full, 0.25 = a quarter); did you mean ${big / 100}?`);
|
|
81
|
-
const kindNow = typeof raw.kind === "string" &&
|
|
81
|
+
const kindNow = typeof raw.kind === "string" && chunkLALEBV63_cjs.LIGHT_KINDS.includes(raw.kind) ? raw.kind : "point";
|
|
82
82
|
const has = (...keys) => keys.filter((k) => bagsOf(spec).some((b) => b[k] !== void 0));
|
|
83
83
|
const falloffOn = raw.falloff === "smooth" || raw.falloff === "inverseSquare";
|
|
84
84
|
if (kindNow === "ambient" && raw.castsShadows) out.push("an ambient light has no direction, so it makes no shadow: castsShadows is ignored (put it on a point, spot or parallel light)");
|
|
@@ -106,18 +106,18 @@ function lightSetProblems(layers) {
|
|
|
106
106
|
out.push("there is no ambient light, so what no light reaches is black; add { type: 'light', kind: 'ambient', initial: { intensity: 0.25 } }");
|
|
107
107
|
}
|
|
108
108
|
const direct = lights.filter((l) => kindOf(l) !== "ambient");
|
|
109
|
-
if (direct.length >
|
|
110
|
-
const dropped = direct.slice(
|
|
111
|
-
out.push(`${direct.length} lights, but at most ${
|
|
109
|
+
if (direct.length > chunkLALEBV63_cjs.MAX_LIGHTS) {
|
|
110
|
+
const dropped = direct.slice(chunkLALEBV63_cjs.MAX_LIGHTS).map((l) => nameOf(l, layers.indexOf(l)));
|
|
111
|
+
out.push(`${direct.length} lights, but at most ${chunkLALEBV63_cjs.MAX_LIGHTS} are used (the first ${chunkLALEBV63_cjs.MAX_LIGHTS}, in layer order); ${dropped.join(", ")} and later are dropped. Use fewer lights`);
|
|
112
112
|
}
|
|
113
113
|
const lightsCast = lights.some((l) => kindOf(l) !== "ambient" && l.castsShadows);
|
|
114
114
|
const casters = layers.filter((l) => l.type !== "light" && l.castsShadows && l.threeD);
|
|
115
115
|
if (casters.length > 0 && !lightsCast) out.push(`${casters.length} layer${casters.length > 1 ? "s have" : " has"} castsShadows but no light has castsShadows: add castsShadows: true to the light that should make the shadows`);
|
|
116
116
|
const hostsThree = layers.some((l) => l.type === "three" && l.followLights);
|
|
117
117
|
if (lightsCast && casters.length === 0 && !hostsThree) out.push("a light has castsShadows but no layer has castsShadows: add castsShadows: true to the threeD layers that should cast a shadow");
|
|
118
|
-
if (lightsCast && casters.length >
|
|
119
|
-
const dropped = casters.slice(
|
|
120
|
-
out.push(`${casters.length} layers cast shadows, but a layer receives shadows from at most ${
|
|
118
|
+
if (lightsCast && casters.length > chunkLALEBV63_cjs.MAX_CASTERS) {
|
|
119
|
+
const dropped = casters.slice(chunkLALEBV63_cjs.MAX_CASTERS).map((c) => nameOf(c, layers.indexOf(c)));
|
|
120
|
+
out.push(`${casters.length} layers cast shadows, but a layer receives shadows from at most ${chunkLALEBV63_cjs.MAX_CASTERS} (the first ${chunkLALEBV63_cjs.MAX_CASTERS}, in layer order); ${dropped.join(", ")} and later cast none`);
|
|
121
121
|
}
|
|
122
122
|
const softLights = lights.filter((l) => l.castsShadows && numbersOf(l, "shadowDiffusion").some((v) => v > 0));
|
|
123
123
|
if (softLights.length >= SOFT_LIGHTS) {
|
|
@@ -302,9 +302,9 @@ var roundPixelsBit = {
|
|
|
302
302
|
name: "round-pixels-bit",
|
|
303
303
|
vertex: { header: `fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32> { return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; }` }
|
|
304
304
|
};
|
|
305
|
-
var ML =
|
|
306
|
-
var MC =
|
|
307
|
-
var TAPS =
|
|
305
|
+
var ML = chunkLALEBV63_cjs.MAX_LIGHTS;
|
|
306
|
+
var MC = chunkLALEBV63_cjs.MAX_CASTERS;
|
|
307
|
+
var TAPS = chunkLALEBV63_cjs.SHADOW_TAPS;
|
|
308
308
|
var SHADOW_KEYS = Array.from({ length: MC }, (_, j) => `uShadow${j}`);
|
|
309
309
|
var WGSL_SHADOW_DECLS = SHADOW_KEYS.map((k, j) => ` @group(2) @binding(${4 + j}) var ${k}: texture_2d<f32>;`).join("\n");
|
|
310
310
|
var WGSL_SHADOW_PICK = SHADOW_KEYS.map((k, j) => (j === 0 ? "" : "else ") + `if (j == ${j}) { a = textureSampleLevel(${k}, uSampler, uv, 0.0).a; }`).join(" ");
|
|
@@ -664,8 +664,8 @@ function readLayerTransform(target) {
|
|
|
664
664
|
x: c.x,
|
|
665
665
|
y: c.y,
|
|
666
666
|
z: c.z ?? 0,
|
|
667
|
-
rotationX: (c.rotationX ?? 0) *
|
|
668
|
-
rotationY: (c.rotationY ?? 0) *
|
|
667
|
+
rotationX: (c.rotationX ?? 0) * chunkLALEBV63_cjs.DEG,
|
|
668
|
+
rotationY: (c.rotationY ?? 0) * chunkLALEBV63_cjs.DEG,
|
|
669
669
|
rotationZ: c.rotation,
|
|
670
670
|
scaleX: c.scale.x,
|
|
671
671
|
scaleY: c.scale.y,
|
|
@@ -730,20 +730,20 @@ var Layer3D = class {
|
|
|
730
730
|
if (!(needW >= 1 && needH >= 1) || !Number.isFinite(bounds.x) || !Number.isFinite(bounds.y)) return this.hide();
|
|
731
731
|
const size = this.sizeFor(needW, needH);
|
|
732
732
|
const frame = { x: bounds.x - pad, y: bounds.y - pad, width: size.w, height: size.h };
|
|
733
|
-
const projected =
|
|
733
|
+
const projected = chunkLALEBV63_cjs.projectLayer(readLayerTransform(target), frame, basis);
|
|
734
734
|
this.depth = projected.depth;
|
|
735
735
|
{
|
|
736
736
|
const lt = readLayerTransform(target);
|
|
737
|
-
const o =
|
|
738
|
-
const pu =
|
|
739
|
-
const pv =
|
|
737
|
+
const o = chunkLALEBV63_cjs.layerToWorld(lt, frame.x, frame.y);
|
|
738
|
+
const pu = chunkLALEBV63_cjs.layerToWorld(lt, frame.x + frame.width, frame.y);
|
|
739
|
+
const pv = chunkLALEBV63_cjs.layerToWorld(lt, frame.x, frame.y + frame.height);
|
|
740
740
|
this.world = { o, u: { x: pu.x - o.x, y: pu.y - o.y, z: pu.z - o.z }, v: { x: pv.x - o.x, y: pv.y - o.y, z: pv.z - o.z } };
|
|
741
741
|
}
|
|
742
742
|
if (!projected.visible) {
|
|
743
743
|
if (!this.warnedBehind) {
|
|
744
744
|
this.warnedBehind = true;
|
|
745
745
|
if (this.seq.spec.hideBehindCamera) return this.hide();
|
|
746
|
-
if (projected.depth >
|
|
746
|
+
if (projected.depth > chunkLALEBV63_cjs.NEAR) {
|
|
747
747
|
console.warn(
|
|
748
748
|
`pixi-effects: ${chunk3SAS3ZE5_cjs.describeLayer(this.seq.spec)}: part of it (a corner) reaches the camera plane (z = ${(target.z ?? 0).toFixed(0)}, rotationX ${(target.rotationX ?? 0).toFixed(0)}\xB0, rotationY ${(target.rotationY ?? 0).toFixed(0)}\xB0), and a layer is hidden whole when any corner is at or behind it. Tilt it less (rotationX / rotationY), make it smaller, or keep the camera further away from it (the default camera sits at z = (height/2)/tan(fov/2), about 989 for 720p at fov 40).`
|
|
749
749
|
);
|
|
@@ -775,7 +775,7 @@ var Layer3D = class {
|
|
|
775
775
|
*/
|
|
776
776
|
setBlur(radius) {
|
|
777
777
|
const d = this.display;
|
|
778
|
-
const r = radius >
|
|
778
|
+
const r = radius > chunkLALEBV63_cjs.MIN_BLUR ? Math.min(radius, chunkLALEBV63_cjs.MAX_BLUR) : 0;
|
|
779
779
|
this.blur = r;
|
|
780
780
|
if (r === 0) {
|
|
781
781
|
if (this.blurFilter) {
|
|
@@ -962,7 +962,7 @@ function lintSequence(spec, warn = defaultWarn) {
|
|
|
962
962
|
function lintFocus(camera, siblings, warn = defaultWarn) {
|
|
963
963
|
if (camera.type !== "camera") return;
|
|
964
964
|
const who = chunk3SAS3ZE5_cjs.describeLayer(camera);
|
|
965
|
-
for (const p of
|
|
965
|
+
for (const p of chunkLALEBV63_cjs.focusProblems(camera, siblings)) {
|
|
966
966
|
if (p.kind === "missing") {
|
|
967
967
|
warn(`pixi-effects: ${who}: focus: no layer named "${p.name}"${p.hint ? `; did you mean "${p.hint}"?` : ""} (the z = 0 plane is used). Write a threeD layer's name or a z number`);
|
|
968
968
|
} else if (p.kind === "not-threeD") {
|
|
@@ -1252,7 +1252,7 @@ var MatteSet = class {
|
|
|
1252
1252
|
};
|
|
1253
1253
|
|
|
1254
1254
|
// src/sequences/Composition.ts
|
|
1255
|
-
var CompositionSequence = class extends
|
|
1255
|
+
var CompositionSequence = class extends chunkLALEBV63_cjs.Sequence {
|
|
1256
1256
|
_innerContainer = null;
|
|
1257
1257
|
_compositionShape = null;
|
|
1258
1258
|
_children = [];
|
|
@@ -1319,11 +1319,11 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1319
1319
|
this.intrinsicWidth = width;
|
|
1320
1320
|
this.intrinsicHeight = height;
|
|
1321
1321
|
this._innerContainer = inner;
|
|
1322
|
-
const base =
|
|
1323
|
-
const span = base ?
|
|
1324
|
-
this._remap = base ?
|
|
1322
|
+
const base = chunkLALEBV63_cjs.timeRemapOf(this.spec);
|
|
1323
|
+
const span = base ? chunkLALEBV63_cjs.contentLength(base, this.duration) : this.duration;
|
|
1324
|
+
this._remap = base ? chunkLALEBV63_cjs.remapOf(this.spec, "time", span) : null;
|
|
1325
1325
|
this._contentSpan = span;
|
|
1326
|
-
this._compositionShape = { width, height, duration: span, spaceAt: (t) => this._spaceAt(t) };
|
|
1326
|
+
this._compositionShape = { width, height, duration: span, spaceAt: (t) => this._spaceAt(t), findLayer: (name) => this._children.find((c) => c.spec.name === name) ?? null, layerNames: () => this._children.map((c) => c.spec.name).filter((n) => !!n) };
|
|
1327
1327
|
const lateKeyframes = [];
|
|
1328
1328
|
for (const s of this.spec.sequences ?? []) {
|
|
1329
1329
|
lintSequence(s);
|
|
@@ -1338,10 +1338,12 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1338
1338
|
if (crowd >= chunkJN7JHNZR_cjs.MANY_ADVANCED) {
|
|
1339
1339
|
console.warn(`pixi-effects: ${chunk3SAS3ZE5_cjs.describeLayer(this.spec)}: ${crowd} layers with an advanced blendMode are on screen at once (a composition with one counts each layer inside it, since its children blend one by one); each is a full-frame pass (about 2 ms on WebGL). Put fewer layers in the blend (or draw the glow as one layer), or use add / screen / multiply`);
|
|
1340
1340
|
}
|
|
1341
|
-
this._children =
|
|
1341
|
+
this._children = [];
|
|
1342
|
+
await chunkLALEBV63_cjs.buildSequenceTree(
|
|
1342
1343
|
this.spec.sequences ?? [],
|
|
1343
1344
|
this._compositionShape,
|
|
1344
|
-
this.root
|
|
1345
|
+
this.root,
|
|
1346
|
+
this._children
|
|
1345
1347
|
);
|
|
1346
1348
|
this._resolveParents();
|
|
1347
1349
|
const matteNames = /* @__PURE__ */ new Set();
|
|
@@ -1349,22 +1351,22 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1349
1351
|
if (matteNames.size > 0) {
|
|
1350
1352
|
this._mattes = new MatteSet(inner, width, height);
|
|
1351
1353
|
for (const name of matteNames) {
|
|
1352
|
-
const source = this._children.find((c) => c.spec.name === name && !(c instanceof
|
|
1354
|
+
const source = this._children.find((c) => c.spec.name === name && !(c instanceof chunkLALEBV63_cjs.CameraSequence));
|
|
1353
1355
|
if (!source || !source.target || !canBeMatte(source.spec)) continue;
|
|
1354
1356
|
const chain = [];
|
|
1355
1357
|
for (let p = this._parentOf.get(source); p; p = this._parentOf.get(p)) chain.push(p);
|
|
1356
1358
|
this._mattes.add(name, source, chain);
|
|
1357
1359
|
}
|
|
1358
1360
|
}
|
|
1359
|
-
if (this._children.some((c) => c instanceof
|
|
1361
|
+
if (this._children.some((c) => c instanceof chunkLALEBV63_cjs.LightSequence)) {
|
|
1360
1362
|
for (const message of lightSetProblems(this.spec.sequences ?? [])) console.warn(`pixi-effects: ${chunk3SAS3ZE5_cjs.describeLayer(this.spec)}: ${message}`);
|
|
1361
1363
|
}
|
|
1362
1364
|
const layerNames = new Set(this._children.map((c) => c.spec.name).filter((n) => !!n));
|
|
1363
1365
|
for (const cam of this._children) {
|
|
1364
|
-
if (!(cam instanceof
|
|
1366
|
+
if (!(cam instanceof chunkLALEBV63_cjs.CameraSequence)) continue;
|
|
1365
1367
|
cam.resolveFocusNames((name) => {
|
|
1366
1368
|
const hit = this._children.find((c) => c.spec.name === name && c.spec.threeD);
|
|
1367
|
-
return hit ?
|
|
1369
|
+
return hit ? chunkLALEBV63_cjs.layerInitialZ(hit.spec, hit.scope()) : void 0;
|
|
1368
1370
|
}, layerNames);
|
|
1369
1371
|
}
|
|
1370
1372
|
const blendSaid = /* @__PURE__ */ new Map();
|
|
@@ -1374,11 +1376,11 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1374
1376
|
else blendSaid.set(message, { spec, n: 1 });
|
|
1375
1377
|
};
|
|
1376
1378
|
for (const child of this._children) {
|
|
1377
|
-
if (child instanceof
|
|
1379
|
+
if (child instanceof chunkLALEBV63_cjs.CameraSequence) {
|
|
1378
1380
|
this._cameras.push(child);
|
|
1379
1381
|
continue;
|
|
1380
1382
|
}
|
|
1381
|
-
if (child instanceof
|
|
1383
|
+
if (child instanceof chunkLALEBV63_cjs.LightSequence) {
|
|
1382
1384
|
this._lights.push(child);
|
|
1383
1385
|
continue;
|
|
1384
1386
|
}
|
|
@@ -1412,7 +1414,7 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1412
1414
|
if (maskSrc.kind === "inline") {
|
|
1413
1415
|
const maskSpec = maskSrc.spec;
|
|
1414
1416
|
const lifetime = maskSpec.at === void 0 ? { at: child.at, duration: maskSpec.duration ?? child.duration } : {};
|
|
1415
|
-
const built = await
|
|
1417
|
+
const built = await chunkLALEBV63_cjs.buildSequenceTree([{ ...maskSpec, ...lifetime }], this._compositionShape, this.root);
|
|
1416
1418
|
const maskSeq = built[0];
|
|
1417
1419
|
if (maskSeq?.target) {
|
|
1418
1420
|
child.maskSequence = maskSeq;
|
|
@@ -1468,9 +1470,9 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1468
1470
|
const remap = this._remap;
|
|
1469
1471
|
const childOffset = remap ? 0 : offset + this.at;
|
|
1470
1472
|
this._childBase = childOffset;
|
|
1471
|
-
const target = remap ?
|
|
1473
|
+
const target = remap ? chunkLALEBV63_cjs.createTimeline({ paused: true, defaults: { ease: "none" } }) : timeline;
|
|
1472
1474
|
for (const child of this._children) {
|
|
1473
|
-
const own =
|
|
1475
|
+
const own = chunkLALEBV63_cjs.createTimeline({ defaults: { ease: "none" } });
|
|
1474
1476
|
child.bindTimeline(own, childOffset);
|
|
1475
1477
|
child.maskSequence?.bindTimeline(own, childOffset);
|
|
1476
1478
|
target.add(own, 0);
|
|
@@ -1500,8 +1502,8 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1500
1502
|
this._clock = clock;
|
|
1501
1503
|
const scope = this.scope();
|
|
1502
1504
|
if (remap.start !== void 0 && remap.timeKfs.length === 0) clock.time = remap.start;
|
|
1503
|
-
|
|
1504
|
-
this._warnUnreachable(
|
|
1505
|
+
chunkLALEBV63_cjs.bindClock(timeline, clock, "time", remap, this.duration, offset + this.at, scope);
|
|
1506
|
+
this._warnUnreachable(chunkLALEBV63_cjs.clockTable(remap, "time", this.duration, offset + this.at, scope, offset + this.at + this.duration), offset + this.at, offset + this.at + this.duration);
|
|
1505
1507
|
}
|
|
1506
1508
|
/**
|
|
1507
1509
|
* A child the clock never dwells in is never visible: say so. Its `at` is in THIS composition's local time, so the usual mistake is
|
|
@@ -1539,7 +1541,7 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1539
1541
|
for (let p = this._parentOf.get(seq); p; p = this._parentOf.get(p)) out.push(p);
|
|
1540
1542
|
return out;
|
|
1541
1543
|
};
|
|
1542
|
-
return [...this._visual.map((v) => v.seq), ...this._nested].filter((seq) => !(seq instanceof
|
|
1544
|
+
return [...this._visual.map((v) => v.seq), ...this._nested].filter((seq) => !(seq instanceof chunkLALEBV63_cjs.NullSequence)).map((seq) => {
|
|
1543
1545
|
const layer = this._visual.find((v) => v.seq === seq)?.layer ?? null;
|
|
1544
1546
|
return {
|
|
1545
1547
|
seq,
|
|
@@ -1549,24 +1551,24 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1549
1551
|
depthBlur: layer?.blur ?? 0,
|
|
1550
1552
|
quad: layer && layer.display.visible ? layer.corners : null,
|
|
1551
1553
|
// how lit it is (threeD layers that receive the lights of the last frame only); computed here, not per frame
|
|
1552
|
-
light: layer && this._lighting && layer.world && layer.spec.lit !== false ?
|
|
1554
|
+
light: layer && this._lighting && layer.world && layer.spec.lit !== false ? chunkLALEBV63_cjs.lightLevel(layer.world, this._lighting.cam, this._lighting.states) : void 0
|
|
1553
1555
|
};
|
|
1554
1556
|
});
|
|
1555
1557
|
}
|
|
1556
1558
|
/** Match every `parent: 'name'` to a null layer; anything that cannot work is said out loud and drawn unparented. */
|
|
1557
1559
|
_resolveParents() {
|
|
1558
|
-
const nulls = this._children.filter((c) => c instanceof
|
|
1560
|
+
const nulls = this._children.filter((c) => c instanceof chunkLALEBV63_cjs.NullSequence);
|
|
1559
1561
|
const nullNames = nulls.map((n) => n.spec.name).filter((n) => !!n);
|
|
1560
1562
|
const warned = /* @__PURE__ */ new Set();
|
|
1561
1563
|
for (const child of this._children) {
|
|
1562
1564
|
const want = child.spec.parent;
|
|
1563
1565
|
if (want === void 0) continue;
|
|
1564
1566
|
const who = chunk3SAS3ZE5_cjs.describeLayer(child.spec);
|
|
1565
|
-
if (child instanceof
|
|
1567
|
+
if (child instanceof chunkLALEBV63_cjs.CameraSequence) {
|
|
1566
1568
|
console.warn(`pixi-effects: ${who}: a camera cannot have a parent; ignored`);
|
|
1567
1569
|
continue;
|
|
1568
1570
|
}
|
|
1569
|
-
if (child instanceof
|
|
1571
|
+
if (child instanceof chunkLALEBV63_cjs.LightSequence) {
|
|
1570
1572
|
console.warn(`pixi-effects: ${who}: a light cannot have a parent (parent "${want}" ignored: move the light with its own x / y / z keyframes)`);
|
|
1571
1573
|
continue;
|
|
1572
1574
|
}
|
|
@@ -1580,7 +1582,7 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1580
1582
|
console.warn(`pixi-effects: ${who}: parent "${want}": no layer with that name${hint ? `; did you mean "${hint}"?` : ""} (the layer is drawn without a parent)`);
|
|
1581
1583
|
continue;
|
|
1582
1584
|
}
|
|
1583
|
-
const holder = same.find((c) => c instanceof
|
|
1585
|
+
const holder = same.find((c) => c instanceof chunkLALEBV63_cjs.NullSequence);
|
|
1584
1586
|
if (!holder) {
|
|
1585
1587
|
console.warn(`pixi-effects: ${who}: parent "${want}" is a ${same[0].spec.type} layer; only { type: 'null' } layers can be parents (the layer is drawn without a parent)`);
|
|
1586
1588
|
continue;
|
|
@@ -1625,8 +1627,8 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1625
1627
|
childT,
|
|
1626
1628
|
compEnd
|
|
1627
1629
|
);
|
|
1628
|
-
const cam = active ? active.cam.state() :
|
|
1629
|
-
const basis =
|
|
1630
|
+
const cam = active ? active.cam.state() : chunkLALEBV63_cjs.homeCamera(width, height);
|
|
1631
|
+
const basis = chunkLALEBV63_cjs.cameraBasis(cam, width, height);
|
|
1630
1632
|
for (const layer of this._layers3d) layer.update(host, basis);
|
|
1631
1633
|
this._applyLighting(childT, compEnd, basis, active?.cam ?? null);
|
|
1632
1634
|
this._applyDepthOfField(cam, basis);
|
|
@@ -1649,7 +1651,7 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1649
1651
|
const { width, height } = this._compositionShape;
|
|
1650
1652
|
const compEnd = this._childBase + (this.duration ?? 0);
|
|
1651
1653
|
const active = pickActiveCamera(this._cameras.map((cam) => ({ cam, ...cam.window() })), t, compEnd);
|
|
1652
|
-
return { camera: active ? active.cam.state() :
|
|
1654
|
+
return { camera: active ? active.cam.state() : chunkLALEBV63_cjs.homeCamera(width, height), lights: this._liveLights(t, compEnd).map((l) => l.state()), fog: active?.cam.fogState() ?? null };
|
|
1653
1655
|
}
|
|
1654
1656
|
/**
|
|
1655
1657
|
* Lights and fog: when the composition has a light layer or the camera writes fog, every threeD layer draws with the lit shader, fed with
|
|
@@ -1661,7 +1663,7 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1661
1663
|
const fog = cam?.fogState() ?? null;
|
|
1662
1664
|
if (this._lights.length === 0 && !this._cameras.some((c) => c.fog)) return;
|
|
1663
1665
|
const states = this._liveLights(t, compEnd).map((l) => l.state());
|
|
1664
|
-
const packed = states.length > 0 ?
|
|
1666
|
+
const packed = states.length > 0 ? chunkLALEBV63_cjs.packLights(states) : null;
|
|
1665
1667
|
this._lighting = states.length > 0 ? { states, cam: { x: basis.cx, y: basis.cy, z: basis.cz } } : null;
|
|
1666
1668
|
const shadowing = states.some((s) => s.castsShadows);
|
|
1667
1669
|
const casters = shadowing ? this._layers3d.filter((l) => l.spec.castsShadows && l.display.visible && l.world && l.source) : [];
|
|
@@ -1670,7 +1672,7 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1670
1672
|
const mat = l.setLit(true);
|
|
1671
1673
|
if (!mat || !l.world) continue;
|
|
1672
1674
|
const lit = l.spec.lit !== false;
|
|
1673
|
-
const mine = lit ? casters.filter((c) => c !== l).slice(0,
|
|
1675
|
+
const mine = lit ? casters.filter((c) => c !== l).slice(0, chunkLALEBV63_cjs.MAX_CASTERS).map((c) => ({ frame: c.world, source: c.source })) : [];
|
|
1674
1676
|
mat.update(l.world, camInfo, lit ? packed : null, fog, mine);
|
|
1675
1677
|
}
|
|
1676
1678
|
}
|
|
@@ -1681,8 +1683,8 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1681
1683
|
for (const l of this._layers3d) l.setBlur(0);
|
|
1682
1684
|
return;
|
|
1683
1685
|
}
|
|
1684
|
-
const focusDepth =
|
|
1685
|
-
if (!(focusDepth >
|
|
1686
|
+
const focusDepth = chunkLALEBV63_cjs.projectPoint(basis, { x: cam.lookAtX, y: cam.lookAtY, z: cam.focus ?? 0 }).depth;
|
|
1687
|
+
if (!(focusDepth > chunkLALEBV63_cjs.NEAR)) {
|
|
1686
1688
|
if (!this._dofSaid.behind) {
|
|
1687
1689
|
this._dofSaid.behind = true;
|
|
1688
1690
|
console.warn(`pixi-effects: ${chunk3SAS3ZE5_cjs.describeLayer(this.spec)}: the camera's focus (z = ${(cam.focus ?? 0).toFixed(0)}) is at or behind the camera, so nothing is blurred. Put focus in front of the camera (a z below the camera's z)`);
|
|
@@ -1692,12 +1694,12 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1692
1694
|
}
|
|
1693
1695
|
let blurred = 0;
|
|
1694
1696
|
for (const l of this._layers3d) {
|
|
1695
|
-
l.setBlur(l.display.visible ?
|
|
1697
|
+
l.setBlur(l.display.visible ? chunkLALEBV63_cjs.blurRadius(aperture, basis.focal, l.depth, focusDepth) : 0);
|
|
1696
1698
|
if (l.blur > 0) blurred++;
|
|
1697
1699
|
}
|
|
1698
|
-
if (blurred >=
|
|
1700
|
+
if (blurred >= chunkLALEBV63_cjs.MANY_BLURRED && !this._dofSaid.many) {
|
|
1699
1701
|
this._dofSaid.many = true;
|
|
1700
|
-
console.warn(`pixi-effects: ${chunk3SAS3ZE5_cjs.describeLayer(this.spec)}: ${blurred} layers are blurred by depth of field at once (it warns from ${
|
|
1702
|
+
console.warn(`pixi-effects: ${chunk3SAS3ZE5_cjs.describeLayer(this.spec)}: ${blurred} layers are blurred by depth of field at once (it warns from ${chunkLALEBV63_cjs.MANY_BLURRED}); each costs a filter pass per frame (WebGPU more). Merge the far layers or lower aperture`);
|
|
1701
1703
|
}
|
|
1702
1704
|
}
|
|
1703
1705
|
collectAudio(out, baseTime) {
|
|
@@ -1711,7 +1713,7 @@ var CompositionSequence = class extends chunkX62H3RBG_cjs.Sequence {
|
|
|
1711
1713
|
const inner = [];
|
|
1712
1714
|
for (const child of this._children) child.collectAudio(inner, 0);
|
|
1713
1715
|
const lo = baseTime + this.at, hi = lo + this.duration;
|
|
1714
|
-
const table =
|
|
1716
|
+
const table = chunkLALEBV63_cjs.clockTable(remap, "time", this.duration, lo, this.scope(), hi);
|
|
1715
1717
|
for (const d of inner) {
|
|
1716
1718
|
const prev = d.warp;
|
|
1717
1719
|
out.push({ ...d, warp: (t) => t < lo || t > hi ? NaN : prev ? prev(table.at(t)) : table.at(t) });
|
|
@@ -1741,5 +1743,5 @@ function frameOf(child) {
|
|
|
1741
1743
|
|
|
1742
1744
|
exports.CompositionSequence = CompositionSequence;
|
|
1743
1745
|
exports.maskSourceOf = maskSourceOf;
|
|
1744
|
-
//# sourceMappingURL=chunk-
|
|
1745
|
-
//# sourceMappingURL=chunk-
|
|
1746
|
+
//# sourceMappingURL=chunk-DKCMJILW.cjs.map
|
|
1747
|
+
//# sourceMappingURL=chunk-DKCMJILW.cjs.map
|