reframe-video 0.6.32 → 0.6.34

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/dist/labels.js CHANGED
@@ -728,12 +728,12 @@ function validateScene(ir) {
728
728
  if (problems.length > 0) throw new SceneValidationError(problems);
729
729
  }
730
730
 
731
- // ../core/src/presets.ts
732
- var SET = 1 / 120;
733
-
734
731
  // ../core/src/evaluate.ts
735
732
  var DEG = Math.PI / 180;
736
733
 
734
+ // ../core/src/presets.ts
735
+ var SET = 1 / 120;
736
+
737
737
  // ../render-cli/src/loadScene.ts
738
738
  import { build } from "esbuild";
739
739
  import { readFile } from "node:fs/promises";
package/dist/trace-cli.js CHANGED
@@ -93,12 +93,12 @@ function wait(duration, label) {
93
93
  return { kind: "wait", duration, ...label !== void 0 && { label } };
94
94
  }
95
95
 
96
- // ../core/src/presets.ts
97
- var SET = 1 / 120;
98
-
99
96
  // ../core/src/evaluate.ts
100
97
  var DEG = Math.PI / 180;
101
98
 
99
+ // ../core/src/presets.ts
100
+ var SET = 1 / 120;
101
+
102
102
  // ../core/src/motion.ts
103
103
  var EASE_BY_CLASS = {
104
104
  accelerating: "easeInCubic",
@@ -0,0 +1,18 @@
1
+ /**
2
+ * autoFoley — the animation scores its own sound effects, deterministically.
3
+ *
4
+ * A pure analysis pass over the compiled motion: it samples each node's own
5
+ * (camera-independent) x/y/scale/opacity over the timeline and emits sound cues
6
+ * for the gestures it sees — a fast move → whoosh, a moving-then-stopping settle
7
+ * → impact, a scale-in → pop — panned by screen position. Because it re-derives
8
+ * cues from `sampleProp` (the same deterministic sampler `evaluate` uses), the
9
+ * sound follows retiming and AI regeneration for free, and any manual `audio.cues`
10
+ * still layer on top. The audio analogue of evaluate(scene, t); the motion
11
+ * generalization of `textTypeCues`.
12
+ *
13
+ * MVP scope: translation / settle / scale-in + pan. Deferred: sustained scale
14
+ * riser→impact, rotation→swish.
15
+ */
16
+ import type { CompiledScene } from "./compile.js";
17
+ import type { AudioCueIR, AutoFoleyOptions } from "./ir.js";
18
+ export declare function autoFoley(compiled: CompiledScene, opts?: AutoFoleyOptions): AudioCueIR[];
@@ -6,6 +6,7 @@ export { composeScene, formatComposeReport, type OverlayDoc, type ComposeReport,
6
6
  export { compileScene, type CompiledScene, type PropertySegment, type LabelSpan, type MotionDriver } from "./compile.js";
7
7
  export { pathPoint, pathTangentAngle, type Pt } from "./path.js";
8
8
  export { cameraTo, cameraFit, cameraMatrix, CAMERA_ID, CAMERA_PROPS } from "./camera.js";
9
+ export { autoFoley } from "./autoFoley.js";
9
10
  export { linearGradient, radialGradient, conicGradient, isGradient } from "./gradient.js";
10
11
  export { glow, dropShadow } from "./effects.js";
11
12
  export { row, column, grid, type RowOpts, type GridOpts } from "./layout.js";
@@ -467,6 +467,31 @@ export interface AudioIR {
467
467
  } | false;
468
468
  };
469
469
  cues?: AudioCueIR[];
470
+ /**
471
+ * Auto-generate sound cues from node motion (move→whoosh, settle→impact,
472
+ * scale-in→pop, panned by position). Deterministic + retime-safe (re-derived
473
+ * from the motion each render); manual `cues` still layer on top.
474
+ */
475
+ autoFoley?: boolean | AutoFoleyOptions;
476
+ }
477
+ /** Knobs for {@link AudioIR.autoFoley}. */
478
+ export interface AutoFoleyOptions {
479
+ /** Master gain applied to every auto cue (default 0.5). */
480
+ gain?: number;
481
+ /** Emit a whoosh/swish at a fast move's velocity peak (default true). */
482
+ whoosh?: boolean;
483
+ /** Emit a thud/knock when a moving node settles to a stop (default true). */
484
+ impact?: boolean;
485
+ /** Emit a pop when a node scales in (default true). */
486
+ pop?: boolean;
487
+ /** Stereo-pan each cue by the node's x position (default true). */
488
+ pan?: boolean;
489
+ /** Only foley these node ids (default: every node). */
490
+ nodes?: string[];
491
+ /** Cap the number of cues, keeping the loudest (default 32). */
492
+ maxCues?: number;
493
+ /** Scale the detection thresholds: >1 = more sensitive / more cues (default 1). */
494
+ sensitivity?: number;
470
495
  }
471
496
  /**
472
497
  * The scene camera: a viewport over the whole scene. `(x,y)` is the scene point
@@ -578,6 +578,16 @@ explicitly with `params`: `{ sfx: "blip", params: { seed: 4 } }` (pick the varia
578
578
  `{ sfx: "tick", params: { pitch: 1.5 } }` (an explicit frequency multiplier; `2` = octave
579
579
  up). `params.gainDb` trims a single hit.
580
580
 
581
+ **Auto-foley — the motion scores itself.** `audio: { autoFoley: true }` derives sound
582
+ cues from node motion, no manual cues needed: a fast move → `whoosh`/`swish` at the
583
+ velocity peak, a moving node that settles → `thud`/`knock`, a scale-in → `pop`, each
584
+ panned by its on-screen x. It's a pure pass over the compiled motion, so it's
585
+ deterministic AND **retime/regeneration-safe** — retime a step and the sound follows.
586
+ Manual `cues` still layer on top (and win). Best for discrete-element scenes; on dense
587
+ scenes use the options to stay tasteful: `autoFoley: { gain?, whoosh?, impact?, pop?,
588
+ pan?, sensitivity?, maxCues?, nodes?: [ids] }` (`maxCues` keeps the loudest, `nodes`
589
+ allowlists). See `examples/scenes/auto-foley-demo.ts` (zero manual cues).
590
+
581
591
  **bgm beds**: synthesized via `bgm.synth` (`ambient-pad` `lofi` `pulse` `tension`
582
592
  `uplift`), or a file via `bgm.file` — bundled CC0 music: `bgm-song21.mp3` (ambient),
583
593
  `bgm-synthwave.mp3` (chill), `bgm-piano.mp3` (elegant), `bgm-battle.mp3` (energetic),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reframe-video",
3
- "version": "0.6.32",
3
+ "version": "0.6.34",
4
4
  "description": "Declarative motion graphics that AI can write and humans can tweak — human edits survive AI regeneration. Deterministic mp4 renders from a plain-data scene format.",
5
5
  "keywords": [
6
6
  "motion-graphics",