pixi-effects 0.47.0 → 0.47.2
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 +5 -5
- package/ai/chat-template.html +3 -3
- package/ai/tools/render.mjs +8 -1
- package/dist/Composition-X6MCEFRH.cjs +16 -0
- package/dist/{Composition-PME3P5LP.cjs.map → Composition-X6MCEFRH.cjs.map} +1 -1
- package/dist/Composition-ZYMQ7ZRC.js +7 -0
- package/dist/{Composition-NSY7A32Y.js.map → Composition-ZYMQ7ZRC.js.map} +1 -1
- package/dist/{Spans-2TZCNREQ.cjs → Spans-6HSLKR5Q.cjs} +11 -11
- package/dist/{Spans-2TZCNREQ.cjs.map → Spans-6HSLKR5Q.cjs.map} +1 -1
- package/dist/{Spans-TESJPQKX.js → Spans-LCCZ4PW7.js} +6 -6
- package/dist/{Spans-TESJPQKX.js.map → Spans-LCCZ4PW7.js.map} +1 -1
- package/dist/{blendModes-FMYO6SQN.js → blendModes-EMANEHZS.js} +4 -4
- package/dist/{blendModes-FMYO6SQN.js.map → blendModes-EMANEHZS.js.map} +1 -1
- package/dist/{blendModes-FD3THLNC.cjs → blendModes-JUISKPCA.cjs} +5 -5
- package/dist/{blendModes-FD3THLNC.cjs.map → blendModes-JUISKPCA.cjs.map} +1 -1
- package/dist/{chunk-3SAS3ZE5.cjs → chunk-2YV7ISX6.cjs} +11 -2
- package/dist/chunk-2YV7ISX6.cjs.map +1 -0
- package/dist/{chunk-DKCMJILW.cjs → chunk-4RC4GXEM.cjs} +92 -92
- package/dist/{chunk-DKCMJILW.cjs.map → chunk-4RC4GXEM.cjs.map} +1 -1
- package/dist/{chunk-FPV3NPYC.js → chunk-AOQRB6AU.js} +5 -5
- package/dist/{chunk-FPV3NPYC.js.map → chunk-AOQRB6AU.js.map} +1 -1
- package/dist/{chunk-JN7JHNZR.cjs → chunk-DQVUKP5G.cjs} +5 -5
- package/dist/{chunk-JN7JHNZR.cjs.map → chunk-DQVUKP5G.cjs.map} +1 -1
- package/dist/{chunk-4SEL6W7H.js → chunk-G4PXCV2B.js} +13 -9
- package/dist/chunk-G4PXCV2B.js.map +1 -0
- package/dist/{chunk-W46VWAZC.js → chunk-M5P7TXZ2.js} +135 -63
- package/dist/chunk-M5P7TXZ2.js.map +1 -0
- package/dist/{chunk-32MMNDDN.js → chunk-P2P7C2KZ.js} +11 -2
- package/dist/chunk-P2P7C2KZ.js.map +1 -0
- package/dist/{chunk-VNP7QCJE.js → chunk-R43646JP.js} +4 -4
- package/dist/{chunk-VNP7QCJE.js.map → chunk-R43646JP.js.map} +1 -1
- package/dist/{chunk-LALEBV63.cjs → chunk-TVVC4GVK.cjs} +29 -29
- package/dist/{chunk-LALEBV63.cjs.map → chunk-TVVC4GVK.cjs.map} +1 -1
- package/dist/{chunk-I6VUQ2CR.cjs → chunk-UXPTDNNA.cjs} +181 -109
- package/dist/chunk-UXPTDNNA.cjs.map +1 -0
- package/dist/{chunk-DM2OLQOJ.js → chunk-YF4JC2AL.js} +5 -5
- package/dist/{chunk-DM2OLQOJ.js.map → chunk-YF4JC2AL.js.map} +1 -1
- package/dist/{chunk-23SXKSUI.cjs → chunk-ZAHCGFGC.cjs} +13 -9
- package/dist/chunk-ZAHCGFGC.cjs.map +1 -0
- package/dist/index.cjs +37 -37
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -6
- package/dist/loader.css +1 -1
- package/dist/present.cjs +6 -6
- package/dist/present.js +6 -6
- package/dist/sound.cjs +2 -2
- package/dist/sound.js +1 -1
- package/dist/three.cjs +93 -26
- package/dist/three.cjs.map +1 -1
- package/dist/three.d.cts +19 -4
- package/dist/three.d.ts +19 -4
- package/dist/three.js +89 -22
- package/dist/three.js.map +1 -1
- package/docs/dsl.md +7 -2
- package/llms-full.txt +10 -4
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +2 -1
- package/skills/pixi-effects/reference/recipes.md +1 -1
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-NSY7A32Y.js +0 -7
- package/dist/Composition-PME3P5LP.cjs +0 -16
- package/dist/chunk-23SXKSUI.cjs.map +0 -1
- package/dist/chunk-32MMNDDN.js.map +0 -1
- package/dist/chunk-3SAS3ZE5.cjs.map +0 -1
- package/dist/chunk-4SEL6W7H.js.map +0 -1
- package/dist/chunk-I6VUQ2CR.cjs.map +0 -1
- package/dist/chunk-W46VWAZC.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/audioRemap.ts","../src/core/spectrum.ts","../src/audio/loudness.ts","../src/core/inspectAudio.ts"],"names":[],"mappings":";AAKA,SAAS,MAAA,CAAO,GAAgB,CAAA,EAAmB;AACjD,EAAA,IAAI,KAAA,GAAQ,CAAA,CAAE,KAAA,EAAO,KAAA,GAAQ,EAAE,aAAA,IAAiB,CAAA;AAChD,EAAA,IAAI,CAAA,IAAK,OAAO,OAAO,KAAA;AACvB,EAAA,KAAA,MAAW,EAAA,IAAM,CAAA,CAAE,eAAA,IAAmB,EAAC,EAAG;AACxC,IAAA,IAAI,KAAK,EAAA,CAAG,IAAA,EAAM,OAAO,EAAA,CAAG,SAAS,KAAA,GAAQ,EAAA,CAAG,KAAA,GAAQ,KAAA,GAAA,CAAS,GAAG,KAAA,GAAQ,KAAA,KAAA,CAAW,CAAA,GAAI,KAAA,KAAU,GAAG,IAAA,GAAO,KAAA,CAAA,CAAA;AAC/G,IAAA,KAAA,GAAQ,EAAA,CAAG,IAAA;AAAM,IAAA,KAAA,GAAQ,EAAA,CAAG,KAAA;AAAA,EAC9B;AACA,EAAA,OAAO,KAAA;AACT;AAEA,IAAM,OAAO,CAAA,GAAI,GAAA;AAQV,SAAS,gBACd,CAAA,EAAgB,IAAA,EAAoB,KAAA,EAAqB,OAAA,EAAiB,SAAiB,KAAA,EAClC;AACzD,EAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,IAAA,CAAK,KAAA,GA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,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"]}
|