@motionscript/core 0.1.0-alpha.0 → 0.1.0-alpha.5

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.
Files changed (767) hide show
  1. package/CHANGELOG.md +282 -0
  2. package/LICENSE +201 -201
  3. package/NOTICE +48 -0
  4. package/README.md +93 -72
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.d.ts +9 -0
  7. package/dist/assets/catalog.d.ts.map +1 -1
  8. package/dist/assets/catalog.js +11 -0
  9. package/dist/assets/catalog.js.map +1 -1
  10. package/dist/assets/errors.d.ts.map +1 -1
  11. package/dist/assets/errors.js +8 -3
  12. package/dist/assets/errors.js.map +1 -1
  13. package/dist/assets/index.js.map +1 -1
  14. package/dist/assets/manager.d.ts +26 -1
  15. package/dist/assets/manager.d.ts.map +1 -1
  16. package/dist/assets/manager.js +93 -11
  17. package/dist/assets/manager.js.map +1 -1
  18. package/dist/assets/manifest.js.map +1 -1
  19. package/dist/assets/record.js.map +1 -1
  20. package/dist/assets/scope.d.ts +3 -3
  21. package/dist/assets/scope.d.ts.map +1 -1
  22. package/dist/assets/scope.js.map +1 -1
  23. package/dist/attributes/audio/filters/chain.d.ts +1 -1
  24. package/dist/attributes/audio/filters/chain.js.map +1 -1
  25. package/dist/attributes/audio/filters/curve.d.ts +8 -8
  26. package/dist/attributes/audio/filters/curve.d.ts.map +1 -1
  27. package/dist/attributes/audio/filters/curve.js +20 -19
  28. package/dist/attributes/audio/filters/curve.js.map +1 -1
  29. package/dist/attributes/audio/filters/implementations/echo.js.map +1 -1
  30. package/dist/attributes/audio/filters/implementations/gain.js.map +1 -1
  31. package/dist/attributes/audio/filters/implementations/highpass.js.map +1 -1
  32. package/dist/attributes/audio/filters/implementations/lowpass.js.map +1 -1
  33. package/dist/attributes/audio/filters/implementations/speed.d.ts +2 -2
  34. package/dist/attributes/audio/filters/implementations/speed.js.map +1 -1
  35. package/dist/attributes/audio/filters/implementations/tremolo.js.map +1 -1
  36. package/dist/attributes/audio/filters/index.d.ts +1 -1
  37. package/dist/attributes/audio/filters/index.d.ts.map +1 -1
  38. package/dist/attributes/audio/filters/index.js +1 -1
  39. package/dist/attributes/audio/filters/index.js.map +1 -1
  40. package/dist/attributes/audio/filters/registry.js.map +1 -1
  41. package/dist/attributes/audio/filters/union.js.map +1 -1
  42. package/dist/attributes/audio/request.d.ts +32 -4
  43. package/dist/attributes/audio/request.d.ts.map +1 -1
  44. package/dist/attributes/audio/request.js +9 -1
  45. package/dist/attributes/audio/request.js.map +1 -1
  46. package/dist/attributes/audio/schedule.d.ts +11 -2
  47. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  48. package/dist/attributes/audio/schedule.js +15 -8
  49. package/dist/attributes/audio/schedule.js.map +1 -1
  50. package/dist/attributes/audio/sound.d.ts +4 -2
  51. package/dist/attributes/audio/sound.d.ts.map +1 -1
  52. package/dist/attributes/audio/sound.js +8 -4
  53. package/dist/attributes/audio/sound.js.map +1 -1
  54. package/dist/attributes/index.d.ts +1 -0
  55. package/dist/attributes/index.d.ts.map +1 -1
  56. package/dist/attributes/index.js +1 -0
  57. package/dist/attributes/index.js.map +1 -1
  58. package/dist/attributes/layout/alignment.js +1 -1
  59. package/dist/attributes/layout/alignment.js.map +1 -1
  60. package/dist/attributes/layout/index.js.map +1 -1
  61. package/dist/attributes/layout/insets.js.map +1 -1
  62. package/dist/attributes/layout/matrix2d.js.map +1 -1
  63. package/dist/attributes/layout/size.js.map +1 -1
  64. package/dist/attributes/layout/transform3d.js.map +1 -1
  65. package/dist/attributes/layout/vector2.js.map +1 -1
  66. package/dist/attributes/layout/world-transform.js.map +1 -1
  67. package/dist/attributes/mask/boolean.js.map +1 -1
  68. package/dist/attributes/mask/mask.js.map +1 -1
  69. package/dist/attributes/properties/decorator.d.ts +17 -6
  70. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  71. package/dist/attributes/properties/decorator.js +26 -14
  72. package/dist/attributes/properties/decorator.js.map +1 -1
  73. package/dist/attributes/properties/inputs.js.map +1 -1
  74. package/dist/attributes/properties/typed.d.ts +9 -2
  75. package/dist/attributes/properties/typed.d.ts.map +1 -1
  76. package/dist/attributes/properties/typed.js +15 -1
  77. package/dist/attributes/properties/typed.js.map +1 -1
  78. package/dist/attributes/render3d/orbit.d.ts +8 -8
  79. package/dist/attributes/render3d/orbit.js +7 -7
  80. package/dist/attributes/render3d/orbit.js.map +1 -1
  81. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  82. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  83. package/dist/attributes/shape/corners/corners.js.map +1 -1
  84. package/dist/attributes/shape/corners/index.js.map +1 -1
  85. package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
  86. package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
  87. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  88. package/dist/attributes/shape/effects/chain.d.ts +28 -120
  89. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  90. package/dist/attributes/shape/effects/chain.js +16 -88
  91. package/dist/attributes/shape/effects/chain.js.map +1 -1
  92. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  93. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  94. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  95. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  96. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  97. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  98. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  99. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  100. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +2 -2
  101. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  102. package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -1
  103. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  104. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  105. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  106. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  107. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  108. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/glass.d.ts +15 -24
  110. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  112. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  114. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  116. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  118. package/dist/attributes/shape/effects/implementations/lut.d.ts +1 -1
  119. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  120. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  122. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  124. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  126. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  128. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  130. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  132. package/dist/attributes/shape/effects/implementations/shader.js +15 -8
  133. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  134. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  136. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  137. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  138. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  139. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  140. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  141. package/dist/attributes/shape/effects/index.d.ts +2 -6
  142. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  143. package/dist/attributes/shape/effects/index.js.map +1 -1
  144. package/dist/attributes/shape/effects/registry.d.ts +23 -6
  145. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  146. package/dist/attributes/shape/effects/registry.js +44 -10
  147. package/dist/attributes/shape/effects/registry.js.map +1 -1
  148. package/dist/attributes/shape/effects/union.d.ts +2 -6
  149. package/dist/attributes/shape/effects/union.d.ts.map +1 -1
  150. package/dist/attributes/shape/effects/union.js.map +1 -1
  151. package/dist/attributes/shape/fill/blend.js.map +1 -1
  152. package/dist/attributes/shape/fill/chain.js.map +1 -1
  153. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  154. package/dist/attributes/shape/fill/color/constants.js.map +1 -1
  155. package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
  156. package/dist/attributes/shape/fill/color/parser.js +81 -44
  157. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  158. package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
  159. package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
  160. package/dist/attributes/shape/fill/gradient-stops.js +65 -0
  161. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
  162. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  163. package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
  164. package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
  165. package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
  166. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
  167. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  168. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
  169. package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
  170. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  171. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  172. package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
  173. package/dist/attributes/shape/fill/implementations/image.js +5 -4
  174. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  175. package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
  176. package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
  177. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
  178. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  179. package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
  180. package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
  181. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
  182. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  183. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
  184. package/dist/attributes/shape/fill/implementations/video.js +1 -1
  185. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  186. package/dist/attributes/shape/fill/index.js.map +1 -1
  187. package/dist/attributes/shape/fill/lerp.d.ts +9 -1
  188. package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
  189. package/dist/attributes/shape/fill/lerp.js +12 -1
  190. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  191. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  192. package/dist/attributes/shape/fill/registry.js.map +1 -1
  193. package/dist/attributes/shape/fill/union.js.map +1 -1
  194. package/dist/attributes/shape/filters/chain.d.ts +4 -10
  195. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  196. package/dist/attributes/shape/filters/chain.js +1 -13
  197. package/dist/attributes/shape/filters/chain.js.map +1 -1
  198. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
  199. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
  200. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
  201. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  202. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  203. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  204. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
  205. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
  206. package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
  207. package/dist/attributes/shape/filters/index.d.ts +1 -1
  208. package/dist/attributes/shape/filters/index.js.map +1 -1
  209. package/dist/attributes/shape/filters/registry.d.ts +2 -2
  210. package/dist/attributes/shape/filters/registry.js +3 -3
  211. package/dist/attributes/shape/filters/registry.js.map +1 -1
  212. package/dist/attributes/shape/filters/union.d.ts +6 -7
  213. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  214. package/dist/attributes/shape/filters/union.js.map +1 -1
  215. package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
  216. package/dist/attributes/shape/path/anchors.js +12 -5
  217. package/dist/attributes/shape/path/anchors.js.map +1 -1
  218. package/dist/attributes/shape/path/bezier.js.map +1 -1
  219. package/dist/attributes/shape/path/index.js.map +1 -1
  220. package/dist/attributes/shape/path/measure.js.map +1 -1
  221. package/dist/attributes/shape/path/morph.d.ts.map +1 -1
  222. package/dist/attributes/shape/path/morph.js +16 -4
  223. package/dist/attributes/shape/path/morph.js.map +1 -1
  224. package/dist/attributes/shape/path/ops.js.map +1 -1
  225. package/dist/attributes/shape/path/types.js.map +1 -1
  226. package/dist/attributes/shape/path/walk.js.map +1 -1
  227. package/dist/attributes/shape/shaders/index.js.map +1 -1
  228. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  229. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  230. package/dist/attributes/shape/shadow/index.js.map +1 -1
  231. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  232. package/dist/attributes/shape/stroke/index.d.ts +2 -2
  233. package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
  234. package/dist/attributes/shape/stroke/index.js +1 -1
  235. package/dist/attributes/shape/stroke/index.js.map +1 -1
  236. package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
  237. package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
  238. package/dist/attributes/shape/stroke/stroke.js +22 -2
  239. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  240. package/dist/attributes/shared/operators.js.map +1 -1
  241. package/dist/attributes/text/index.js.map +1 -1
  242. package/dist/attributes/text/ops.d.ts +6 -0
  243. package/dist/attributes/text/ops.d.ts.map +1 -1
  244. package/dist/attributes/text/ops.js +1 -0
  245. package/dist/attributes/text/ops.js.map +1 -1
  246. package/dist/attributes/text/types.js.map +1 -1
  247. package/dist/browser/chunks/chunk-FUZVFT3W.js +18 -0
  248. package/dist/browser/chunks/chunk-FUZVFT3W.js.map +7 -0
  249. package/dist/browser/chunks/chunk-QG6C23IJ.js +3 -0
  250. package/dist/browser/chunks/chunk-QG6C23IJ.js.map +7 -0
  251. package/dist/browser/chunks/chunk-SFNJRPBV.js +2 -0
  252. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +7 -0
  253. package/dist/browser/component.js +1 -1
  254. package/dist/browser/component.js.map +3 -3
  255. package/dist/browser/index.js +1 -1
  256. package/dist/browser/index.js.map +4 -4
  257. package/dist/browser/jsx-jsx-dev-runtime.js +1 -1
  258. package/dist/browser/jsx-jsx-runtime.js +1 -1
  259. package/dist/browser/manifest.json +3 -2
  260. package/dist/browser/sdk.js +1 -1
  261. package/dist/component.js.map +1 -1
  262. package/dist/document/audio.d.ts +1 -1
  263. package/dist/document/audio.js +4 -4
  264. package/dist/document/audio.js.map +1 -1
  265. package/dist/document/builtins.d.ts.map +1 -1
  266. package/dist/document/builtins.js +8 -14
  267. package/dist/document/builtins.js.map +1 -1
  268. package/dist/document/command-traits.d.ts +1 -1
  269. package/dist/document/command-traits.d.ts.map +1 -1
  270. package/dist/document/command-traits.js +17 -3
  271. package/dist/document/command-traits.js.map +1 -1
  272. package/dist/document/deny-globals.js.map +1 -1
  273. package/dist/document/diff.js.map +1 -1
  274. package/dist/document/doc-index.d.ts +2 -2
  275. package/dist/document/doc-index.d.ts.map +1 -1
  276. package/dist/document/doc-index.js.map +1 -1
  277. package/dist/document/expression/compile.d.ts.map +1 -1
  278. package/dist/document/expression/compile.js +8 -5
  279. package/dist/document/expression/compile.js.map +1 -1
  280. package/dist/document/expression/index.js.map +1 -1
  281. package/dist/document/expression/ops.js +1 -1
  282. package/dist/document/expression/ops.js.map +1 -1
  283. package/dist/document/expression/parse.d.ts.map +1 -1
  284. package/dist/document/expression/parse.js +15 -6
  285. package/dist/document/expression/parse.js.map +1 -1
  286. package/dist/document/expression/refs.d.ts +1 -1
  287. package/dist/document/expression/refs.js +1 -1
  288. package/dist/document/expression/refs.js.map +1 -1
  289. package/dist/document/expression/types.js.map +1 -1
  290. package/dist/document/expression/walk.d.ts.map +1 -1
  291. package/dist/document/expression/walk.js +2 -1
  292. package/dist/document/expression/walk.js.map +1 -1
  293. package/dist/document/index.d.ts +2 -0
  294. package/dist/document/index.d.ts.map +1 -1
  295. package/dist/document/index.js +2 -0
  296. package/dist/document/index.js.map +1 -1
  297. package/dist/document/node-decorator.js.map +1 -1
  298. package/dist/document/node-descriptor.d.ts +19 -0
  299. package/dist/document/node-descriptor.d.ts.map +1 -1
  300. package/dist/document/node-descriptor.js.map +1 -1
  301. package/dist/document/placement.d.ts +70 -0
  302. package/dist/document/placement.d.ts.map +1 -0
  303. package/dist/document/placement.js +83 -0
  304. package/dist/document/placement.js.map +1 -0
  305. package/dist/document/project.d.ts +2 -2
  306. package/dist/document/project.d.ts.map +1 -1
  307. package/dist/document/project.js.map +1 -1
  308. package/dist/document/registry.d.ts +34 -16
  309. package/dist/document/registry.d.ts.map +1 -1
  310. package/dist/document/registry.js +51 -12
  311. package/dist/document/registry.js.map +1 -1
  312. package/dist/document/timeline-patch.js.map +1 -1
  313. package/dist/document/timeline.d.ts +73 -18
  314. package/dist/document/timeline.d.ts.map +1 -1
  315. package/dist/document/timeline.js +192 -40
  316. package/dist/document/timeline.js.map +1 -1
  317. package/dist/document/types.d.ts +12 -12
  318. package/dist/document/types.d.ts.map +1 -1
  319. package/dist/document/types.js +2 -2
  320. package/dist/document/types.js.map +1 -1
  321. package/dist/document/validate.d.ts +2 -2
  322. package/dist/document/validate.d.ts.map +1 -1
  323. package/dist/document/validate.js +37 -31
  324. package/dist/document/validate.js.map +1 -1
  325. package/dist/document/withdraw.d.ts +28 -0
  326. package/dist/document/withdraw.d.ts.map +1 -0
  327. package/dist/document/withdraw.js +61 -0
  328. package/dist/document/withdraw.js.map +1 -0
  329. package/dist/index.d.ts +1 -0
  330. package/dist/index.d.ts.map +1 -1
  331. package/dist/index.js +1 -0
  332. package/dist/index.js.map +1 -1
  333. package/dist/jsx/jsx-dev-runtime.js.map +1 -1
  334. package/dist/jsx/jsx-runtime.d.ts +9 -1
  335. package/dist/jsx/jsx-runtime.d.ts.map +1 -1
  336. package/dist/jsx/jsx-runtime.js +13 -3
  337. package/dist/jsx/jsx-runtime.js.map +1 -1
  338. package/dist/layout/bounds.d.ts +0 -1
  339. package/dist/layout/bounds.d.ts.map +1 -1
  340. package/dist/layout/bounds.js.map +1 -1
  341. package/dist/layout/constraints.js.map +1 -1
  342. package/dist/layout/flex.d.ts +4 -2
  343. package/dist/layout/flex.d.ts.map +1 -1
  344. package/dist/layout/flex.js +27 -11
  345. package/dist/layout/flex.js.map +1 -1
  346. package/dist/layout/freeform.js.map +1 -1
  347. package/dist/layout/grid.js.map +1 -1
  348. package/dist/layout/index.js.map +1 -1
  349. package/dist/layout/item.js.map +1 -1
  350. package/dist/layout/ops.d.ts +6 -0
  351. package/dist/layout/ops.d.ts.map +1 -1
  352. package/dist/layout/ops.js +6 -0
  353. package/dist/layout/ops.js.map +1 -1
  354. package/dist/layout/types.js.map +1 -1
  355. package/dist/nodes/2d/node-lifecycle.js.map +1 -1
  356. package/dist/nodes/2d/node-motion.js.map +1 -1
  357. package/dist/nodes/2d/node-render.d.ts +3 -3
  358. package/dist/nodes/2d/node-render.d.ts.map +1 -1
  359. package/dist/nodes/2d/node-render.js.map +1 -1
  360. package/dist/nodes/2d/node-transform.js.map +1 -1
  361. package/dist/nodes/2d/node2d.d.ts +115 -3
  362. package/dist/nodes/2d/node2d.d.ts.map +1 -1
  363. package/dist/nodes/2d/node2d.js +188 -32
  364. package/dist/nodes/2d/node2d.js.map +1 -1
  365. package/dist/nodes/2d/paint-node.d.ts +27 -0
  366. package/dist/nodes/2d/paint-node.d.ts.map +1 -1
  367. package/dist/nodes/2d/paint-node.js +42 -0
  368. package/dist/nodes/2d/paint-node.js.map +1 -1
  369. package/dist/nodes/audio/audio-bus.js.map +1 -1
  370. package/dist/nodes/audio/index.js.map +1 -1
  371. package/dist/nodes/audio/node-audio.d.ts +3 -2
  372. package/dist/nodes/audio/node-audio.d.ts.map +1 -1
  373. package/dist/nodes/audio/node-audio.js +8 -5
  374. package/dist/nodes/audio/node-audio.js.map +1 -1
  375. package/dist/nodes/audio/sound-node.d.ts +2 -2
  376. package/dist/nodes/audio/sound-node.d.ts.map +1 -1
  377. package/dist/nodes/audio/sound-node.js +2 -2
  378. package/dist/nodes/audio/sound-node.js.map +1 -1
  379. package/dist/nodes/geometry/bounds-shape-node.d.ts +4 -4
  380. package/dist/nodes/geometry/bounds-shape-node.js +2 -2
  381. package/dist/nodes/geometry/bounds-shape-node.js.map +1 -1
  382. package/dist/nodes/geometry/box-path-node.d.ts +3 -3
  383. package/dist/nodes/geometry/box-path-node.js +2 -2
  384. package/dist/nodes/geometry/box-path-node.js.map +1 -1
  385. package/dist/nodes/geometry/ellipse-node.js.map +1 -1
  386. package/dist/nodes/geometry/group-bounds.d.ts +2 -2
  387. package/dist/nodes/geometry/group-bounds.d.ts.map +1 -1
  388. package/dist/nodes/geometry/group-bounds.js +1 -2
  389. package/dist/nodes/geometry/group-bounds.js.map +1 -1
  390. package/dist/nodes/geometry/path-node.d.ts.map +1 -1
  391. package/dist/nodes/geometry/path-node.js +6 -0
  392. package/dist/nodes/geometry/path-node.js.map +1 -1
  393. package/dist/nodes/geometry/polygon-node.js.map +1 -1
  394. package/dist/nodes/geometry/polygram-node.js.map +1 -1
  395. package/dist/nodes/geometry/rect-node.js.map +1 -1
  396. package/dist/nodes/geometry/shape-node.js.map +1 -1
  397. package/dist/nodes/geometry/shape-outline.d.ts +2 -2
  398. package/dist/nodes/geometry/shape-outline.d.ts.map +1 -1
  399. package/dist/nodes/geometry/shape-outline.js +2 -13
  400. package/dist/nodes/geometry/shape-outline.js.map +1 -1
  401. package/dist/nodes/index.d.ts +3 -8
  402. package/dist/nodes/index.d.ts.map +1 -1
  403. package/dist/nodes/index.js +3 -8
  404. package/dist/nodes/index.js.map +1 -1
  405. package/dist/nodes/layout/camera-node.d.ts +9 -0
  406. package/dist/nodes/layout/camera-node.d.ts.map +1 -1
  407. package/dist/nodes/layout/camera-node.js +38 -3
  408. package/dist/nodes/layout/camera-node.js.map +1 -1
  409. package/dist/nodes/layout/orbit-camera-node.d.ts +1 -1
  410. package/dist/nodes/layout/orbit-camera-node.js +1 -1
  411. package/dist/nodes/layout/orbit-camera-node.js.map +1 -1
  412. package/dist/nodes/layout/rotated-box.js.map +1 -1
  413. package/dist/nodes/media/video-node.d.ts.map +1 -1
  414. package/dist/nodes/media/video-node.js +5 -3
  415. package/dist/nodes/media/video-node.js.map +1 -1
  416. package/dist/nodes/node/declare-paints.js.map +1 -1
  417. package/dist/nodes/node/node-editor-state.js.map +1 -1
  418. package/dist/nodes/node/node-reactive.js.map +1 -1
  419. package/dist/nodes/node/node-time.d.ts +3 -3
  420. package/dist/nodes/node/node-time.d.ts.map +1 -1
  421. package/dist/nodes/node/node-time.js +1 -1
  422. package/dist/nodes/node/node-time.js.map +1 -1
  423. package/dist/nodes/node/node-walk.js.map +1 -1
  424. package/dist/nodes/node/node.d.ts +5 -3
  425. package/dist/nodes/node/node.d.ts.map +1 -1
  426. package/dist/nodes/node/node.js +44 -19
  427. package/dist/nodes/node/node.js.map +1 -1
  428. package/dist/nodes/node/text-defaults.d.ts +10 -12
  429. package/dist/nodes/node/text-defaults.d.ts.map +1 -1
  430. package/dist/nodes/node/text-defaults.js +10 -12
  431. package/dist/nodes/node/text-defaults.js.map +1 -1
  432. package/dist/nodes/{scene → root}/canvas2d-node.d.ts +2 -2
  433. package/dist/nodes/root/canvas2d-node.d.ts.map +1 -0
  434. package/dist/nodes/{scene → root}/canvas2d-node.js +2 -2
  435. package/dist/nodes/root/canvas2d-node.js.map +1 -0
  436. package/dist/nodes/root/provider-node.d.ts.map +1 -0
  437. package/dist/nodes/root/provider-node.js.map +1 -0
  438. package/dist/nodes/root/theme-provider-node.d.ts.map +1 -0
  439. package/dist/nodes/root/theme-provider-node.js.map +1 -0
  440. package/dist/nodes/text/default-text-style-node.d.ts +5 -2
  441. package/dist/nodes/text/default-text-style-node.d.ts.map +1 -1
  442. package/dist/nodes/text/default-text-style-node.js +10 -4
  443. package/dist/nodes/text/default-text-style-node.js.map +1 -1
  444. package/dist/nodes/text/number-format.d.ts +1 -1
  445. package/dist/nodes/text/number-format.js +1 -1
  446. package/dist/nodes/text/number-format.js.map +1 -1
  447. package/dist/nodes/text/number-node.js.map +1 -1
  448. package/dist/nodes/text/number-pattern.js.map +1 -1
  449. package/dist/nodes/text/richtext-node.js +1 -1
  450. package/dist/nodes/text/richtext-node.js.map +1 -1
  451. package/dist/nodes/text/text-base.d.ts.map +1 -1
  452. package/dist/nodes/text/text-base.js +1 -1
  453. package/dist/nodes/text/text-base.js.map +1 -1
  454. package/dist/nodes/text/text-node.js.map +1 -1
  455. package/dist/nodes/text/text-selection.js.map +1 -1
  456. package/dist/nodes/three/camera-nodes.d.ts +21 -3
  457. package/dist/nodes/three/camera-nodes.d.ts.map +1 -1
  458. package/dist/nodes/three/camera-nodes.js +42 -1
  459. package/dist/nodes/three/camera-nodes.js.map +1 -1
  460. package/dist/nodes/three/canvas3d-node.d.ts +29 -6
  461. package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
  462. package/dist/nodes/three/canvas3d-node.js +44 -2
  463. package/dist/nodes/three/canvas3d-node.js.map +1 -1
  464. package/dist/nodes/three/drawable-nodes.d.ts +25 -11
  465. package/dist/nodes/three/drawable-nodes.d.ts.map +1 -1
  466. package/dist/nodes/three/drawable-nodes.js +43 -13
  467. package/dist/nodes/three/drawable-nodes.js.map +1 -1
  468. package/dist/nodes/three/environment-nodes.d.ts +9 -3
  469. package/dist/nodes/three/environment-nodes.d.ts.map +1 -1
  470. package/dist/nodes/three/environment-nodes.js.map +1 -1
  471. package/dist/nodes/three/geometry-nodes.d.ts +2 -2
  472. package/dist/nodes/three/geometry-nodes.js +2 -2
  473. package/dist/nodes/three/geometry-nodes.js.map +1 -1
  474. package/dist/nodes/three/grid-geometry3d.js.map +1 -1
  475. package/dist/nodes/three/group3d.js.map +1 -1
  476. package/dist/nodes/three/light-nodes.d.ts.map +1 -1
  477. package/dist/nodes/three/light-nodes.js +3 -3
  478. package/dist/nodes/three/light-nodes.js.map +1 -1
  479. package/dist/nodes/three/mesh3d.js.map +1 -1
  480. package/dist/nodes/three/node3d.d.ts +48 -0
  481. package/dist/nodes/three/node3d.d.ts.map +1 -1
  482. package/dist/nodes/three/node3d.js +53 -3
  483. package/dist/nodes/three/node3d.js.map +1 -1
  484. package/dist/platform/audio-sink.d.ts +2 -2
  485. package/dist/platform/audio-sink.d.ts.map +1 -1
  486. package/dist/platform/audio-sink.js.map +1 -1
  487. package/dist/platform/exporter.d.ts +13 -8
  488. package/dist/platform/exporter.d.ts.map +1 -1
  489. package/dist/platform/exporter.js.map +1 -1
  490. package/dist/platform/index.d.ts +1 -1
  491. package/dist/platform/index.d.ts.map +1 -1
  492. package/dist/platform/index.js.map +1 -1
  493. package/dist/platform/stepped-clock.js.map +1 -1
  494. package/dist/platform/storage-adapter.d.ts +12 -6
  495. package/dist/platform/storage-adapter.d.ts.map +1 -1
  496. package/dist/platform/storage-adapter.js +4 -0
  497. package/dist/platform/storage-adapter.js.map +1 -1
  498. package/dist/platform/ticker.d.ts +6 -0
  499. package/dist/platform/ticker.d.ts.map +1 -1
  500. package/dist/platform/ticker.js +6 -0
  501. package/dist/platform/ticker.js.map +1 -1
  502. package/dist/project/config.js.map +1 -1
  503. package/dist/project/index.js.map +1 -1
  504. package/dist/project/tree.d.ts +3 -3
  505. package/dist/project/tree.d.ts.map +1 -1
  506. package/dist/project/tree.js.map +1 -1
  507. package/dist/props/host.js.map +1 -1
  508. package/dist/props/index.js.map +1 -1
  509. package/dist/props/observer.js.map +1 -1
  510. package/dist/props/slot.js.map +1 -1
  511. package/dist/renamed-scene-names.d.ts +17 -0
  512. package/dist/renamed-scene-names.d.ts.map +1 -0
  513. package/dist/renamed-scene-names.js +9 -0
  514. package/dist/renamed-scene-names.js.map +1 -0
  515. package/dist/render/canvas-render-context2d.d.ts +10 -3
  516. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  517. package/dist/render/canvas-render-context2d.js +10 -0
  518. package/dist/render/canvas-render-context2d.js.map +1 -1
  519. package/dist/render/clip-contains.js.map +1 -1
  520. package/dist/render/clip.js.map +1 -1
  521. package/dist/render/descriptors/ellipse.js.map +1 -1
  522. package/dist/render/descriptors/latex.js.map +1 -1
  523. package/dist/render/descriptors/line.js.map +1 -1
  524. package/dist/render/descriptors/path-builder.js.map +1 -1
  525. package/dist/render/descriptors/path.js.map +1 -1
  526. package/dist/render/descriptors/polygon.js.map +1 -1
  527. package/dist/render/descriptors/polygram.js.map +1 -1
  528. package/dist/render/descriptors/rect.js.map +1 -1
  529. package/dist/render/descriptors/richtext.js.map +1 -1
  530. package/dist/render/descriptors/shape.d.ts +12 -0
  531. package/dist/render/descriptors/shape.d.ts.map +1 -1
  532. package/dist/render/descriptors/shape.js.map +1 -1
  533. package/dist/render/descriptors/text.d.ts +2 -2
  534. package/dist/render/descriptors/text.js +2 -2
  535. package/dist/render/descriptors/text.js.map +1 -1
  536. package/dist/render/descriptors/transform.d.ts +2 -2
  537. package/dist/render/descriptors/transform.d.ts.map +1 -1
  538. package/dist/render/descriptors/transform.js.map +1 -1
  539. package/dist/render/graphics2d.d.ts +3 -3
  540. package/dist/render/graphics2d.d.ts.map +1 -1
  541. package/dist/render/graphics2d.js +1 -1
  542. package/dist/render/graphics2d.js.map +1 -1
  543. package/dist/render/index.js.map +1 -1
  544. package/dist/render/measure-context.js.map +1 -1
  545. package/dist/render/null-render-context.js.map +1 -1
  546. package/dist/render/render-context2d.d.ts +5 -5
  547. package/dist/render/render-context2d.d.ts.map +1 -1
  548. package/dist/render/render-context2d.js.map +1 -1
  549. package/dist/render/surface.js.map +1 -1
  550. package/dist/render/text-defaults.js.map +1 -1
  551. package/dist/render/text-layout.js.map +1 -1
  552. package/dist/render3d/bounds3d.d.ts.map +1 -1
  553. package/dist/render3d/bounds3d.js +4 -2
  554. package/dist/render3d/bounds3d.js.map +1 -1
  555. package/dist/render3d/builders.js.map +1 -1
  556. package/dist/render3d/camera.d.ts +6 -0
  557. package/dist/render3d/camera.d.ts.map +1 -1
  558. package/dist/render3d/camera.js +5 -3
  559. package/dist/render3d/camera.js.map +1 -1
  560. package/dist/render3d/fill3d.d.ts +2 -9
  561. package/dist/render3d/fill3d.d.ts.map +1 -1
  562. package/dist/render3d/fill3d.js +2 -13
  563. package/dist/render3d/fill3d.js.map +1 -1
  564. package/dist/render3d/geometry.d.ts +8 -1
  565. package/dist/render3d/geometry.d.ts.map +1 -1
  566. package/dist/render3d/geometry.js.map +1 -1
  567. package/dist/render3d/graphics3d.d.ts +8 -4
  568. package/dist/render3d/graphics3d.d.ts.map +1 -1
  569. package/dist/render3d/graphics3d.js +18 -10
  570. package/dist/render3d/graphics3d.js.map +1 -1
  571. package/dist/render3d/index.d.ts +1 -1
  572. package/dist/render3d/index.js +1 -1
  573. package/dist/render3d/index.js.map +1 -1
  574. package/dist/render3d/inert.d.ts +14 -0
  575. package/dist/render3d/inert.d.ts.map +1 -0
  576. package/dist/render3d/inert.js +62 -0
  577. package/dist/render3d/inert.js.map +1 -0
  578. package/dist/render3d/light.js.map +1 -1
  579. package/dist/render3d/material.d.ts +10 -5
  580. package/dist/render3d/material.d.ts.map +1 -1
  581. package/dist/render3d/material.js.map +1 -1
  582. package/dist/render3d/matrix4.js.map +1 -1
  583. package/dist/render3d/render-context3d.js.map +1 -1
  584. package/dist/render3d/resources.d.ts +2 -2
  585. package/dist/render3d/resources.js +2 -2
  586. package/dist/render3d/resources.js.map +1 -1
  587. package/dist/render3d/rounded-box.js.map +1 -1
  588. package/dist/render3d/scene-settings.d.ts +23 -4
  589. package/dist/render3d/scene-settings.d.ts.map +1 -1
  590. package/dist/render3d/scene-settings.js.map +1 -1
  591. package/dist/render3d/scene3d.d.ts +11 -0
  592. package/dist/render3d/scene3d.d.ts.map +1 -1
  593. package/dist/render3d/scene3d.js +39 -6
  594. package/dist/render3d/scene3d.js.map +1 -1
  595. package/dist/render3d/segments.js.map +1 -1
  596. package/dist/render3d/texture.d.ts +9 -0
  597. package/dist/render3d/texture.d.ts.map +1 -1
  598. package/dist/render3d/texture.js +13 -0
  599. package/dist/render3d/texture.js.map +1 -1
  600. package/dist/render3d/tracking.js.map +1 -1
  601. package/dist/render3d/transform.d.ts +1 -1
  602. package/dist/render3d/transform.js.map +1 -1
  603. package/dist/render3d/vector3.d.ts +18 -1
  604. package/dist/render3d/vector3.d.ts.map +1 -1
  605. package/dist/render3d/vector3.js +27 -0
  606. package/dist/render3d/vector3.js.map +1 -1
  607. package/dist/render3d/walk.d.ts +1 -1
  608. package/dist/render3d/walk.d.ts.map +1 -1
  609. package/dist/render3d/walk.js +5 -1
  610. package/dist/render3d/walk.js.map +1 -1
  611. package/dist/runtime/asset-refine.js.map +1 -1
  612. package/dist/runtime/asset-timeline.js.map +1 -1
  613. package/dist/runtime/asset-update.js.map +1 -1
  614. package/dist/runtime/audio-index.d.ts +2 -2
  615. package/dist/runtime/audio-index.d.ts.map +1 -1
  616. package/dist/runtime/audio-index.js +8 -2
  617. package/dist/runtime/audio-index.js.map +1 -1
  618. package/dist/runtime/builtin-context.js.map +1 -1
  619. package/dist/runtime/clip-instance.d.ts +5 -3
  620. package/dist/runtime/clip-instance.d.ts.map +1 -1
  621. package/dist/runtime/clip-instance.js +10 -6
  622. package/dist/runtime/clip-instance.js.map +1 -1
  623. package/dist/runtime/clip-store.d.ts +9 -0
  624. package/dist/runtime/clip-store.d.ts.map +1 -1
  625. package/dist/runtime/clip-store.js +33 -3
  626. package/dist/runtime/clip-store.js.map +1 -1
  627. package/dist/runtime/engine.d.ts +5 -0
  628. package/dist/runtime/engine.d.ts.map +1 -1
  629. package/dist/runtime/engine.js +2 -0
  630. package/dist/runtime/engine.js.map +1 -1
  631. package/dist/runtime/frame-time.d.ts +31 -0
  632. package/dist/runtime/frame-time.d.ts.map +1 -0
  633. package/dist/runtime/frame-time.js +29 -0
  634. package/dist/runtime/frame-time.js.map +1 -0
  635. package/dist/runtime/index.d.ts +1 -0
  636. package/dist/runtime/index.d.ts.map +1 -1
  637. package/dist/runtime/index.js +1 -0
  638. package/dist/runtime/index.js.map +1 -1
  639. package/dist/runtime/node-picking.d.ts +44 -3
  640. package/dist/runtime/node-picking.d.ts.map +1 -1
  641. package/dist/runtime/node-picking.js +118 -3
  642. package/dist/runtime/node-picking.js.map +1 -1
  643. package/dist/runtime/node-picking3d.d.ts +2 -1
  644. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  645. package/dist/runtime/node-picking3d.js +5 -2
  646. package/dist/runtime/node-picking3d.js.map +1 -1
  647. package/dist/runtime/placement.d.ts.map +1 -1
  648. package/dist/runtime/placement.js +4 -5
  649. package/dist/runtime/placement.js.map +1 -1
  650. package/dist/runtime/playback-controller.d.ts +31 -2
  651. package/dist/runtime/playback-controller.d.ts.map +1 -1
  652. package/dist/runtime/playback-controller.js +63 -6
  653. package/dist/runtime/playback-controller.js.map +1 -1
  654. package/dist/runtime/playback.js.map +1 -1
  655. package/dist/runtime/precompisition.js.map +1 -1
  656. package/dist/runtime/project-assets.js.map +1 -1
  657. package/dist/runtime/session.d.ts +9 -7
  658. package/dist/runtime/session.d.ts.map +1 -1
  659. package/dist/runtime/session.js +12 -4
  660. package/dist/runtime/session.js.map +1 -1
  661. package/dist/runtime/settle.js.map +1 -1
  662. package/dist/runtime/state-evaluator.d.ts +1 -1
  663. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  664. package/dist/runtime/state-evaluator.js +4 -3
  665. package/dist/runtime/state-evaluator.js.map +1 -1
  666. package/dist/runtime/text-geometry.js.map +1 -1
  667. package/dist/sdk/index.d.ts +27 -22
  668. package/dist/sdk/index.d.ts.map +1 -1
  669. package/dist/sdk/index.js +23 -9
  670. package/dist/sdk/index.js.map +1 -1
  671. package/dist/tween/command-decorator.d.ts +12 -4
  672. package/dist/tween/command-decorator.d.ts.map +1 -1
  673. package/dist/tween/command-decorator.js +10 -22
  674. package/dist/tween/command-decorator.js.map +1 -1
  675. package/dist/tween/command.js.map +1 -1
  676. package/dist/tween/ease/constants.d.ts.map +1 -1
  677. package/dist/tween/ease/constants.js +8 -5
  678. package/dist/tween/ease/constants.js.map +1 -1
  679. package/dist/tween/ease/curve.d.ts.map +1 -1
  680. package/dist/tween/ease/curve.js +4 -3
  681. package/dist/tween/ease/curve.js.map +1 -1
  682. package/dist/tween/ease/describe.d.ts +15 -0
  683. package/dist/tween/ease/describe.d.ts.map +1 -0
  684. package/dist/tween/ease/describe.js +37 -0
  685. package/dist/tween/ease/describe.js.map +1 -0
  686. package/dist/tween/ease/type.js.map +1 -1
  687. package/dist/tween/index.js.map +1 -1
  688. package/dist/tween/inert.js.map +1 -1
  689. package/dist/tween/lerp.js.map +1 -1
  690. package/dist/tween/loop.js.map +1 -1
  691. package/dist/tween/prepare.d.ts +3 -3
  692. package/dist/tween/prepare.js +3 -3
  693. package/dist/tween/prepare.js.map +1 -1
  694. package/dist/tween/seekable.d.ts +12 -1
  695. package/dist/tween/seekable.d.ts.map +1 -1
  696. package/dist/tween/seekable.js +15 -0
  697. package/dist/tween/seekable.js.map +1 -1
  698. package/dist/tween/stepper.js.map +1 -1
  699. package/dist/tween/to-command.js.map +1 -1
  700. package/dist/util/clamp.js.map +1 -1
  701. package/dist/util/context.js.map +1 -1
  702. package/dist/util/csv.js.map +1 -1
  703. package/dist/util/generateList.js.map +1 -1
  704. package/dist/util/index.js.map +1 -1
  705. package/dist/util/metrics.d.ts +1 -1
  706. package/dist/util/metrics.js +1 -1
  707. package/dist/util/metrics.js.map +1 -1
  708. package/dist/util/random.js.map +1 -1
  709. package/dist/util/reference.js.map +1 -1
  710. package/dist/util/scheduler.js.map +1 -1
  711. package/package.json +2 -1
  712. package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
  713. package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
  714. package/dist/attributes/shape/effects/implementations/displace.js +0 -30
  715. package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
  716. package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
  717. package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
  718. package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
  719. package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
  720. package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
  721. package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
  722. package/dist/attributes/shape/effects/implementations/texture.js +0 -25
  723. package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
  724. package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
  725. package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
  726. package/dist/attributes/shape/effects/implementations/trails.js +0 -22
  727. package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
  728. package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
  729. package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
  730. package/dist/browser/chunks/chunk-P3XQCHDW.js +0 -16
  731. package/dist/browser/chunks/chunk-P3XQCHDW.js.map +0 -7
  732. package/dist/browser/chunks/chunk-VJQMKHGQ.js +0 -3
  733. package/dist/browser/chunks/chunk-VJQMKHGQ.js.map +0 -7
  734. package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
  735. package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
  736. package/dist/nodes/geometry/dot-grid-node.js +0 -142
  737. package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
  738. package/dist/nodes/geometry/grid-lines.d.ts +0 -101
  739. package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
  740. package/dist/nodes/geometry/grid-lines.js +0 -128
  741. package/dist/nodes/geometry/grid-lines.js.map +0 -1
  742. package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
  743. package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
  744. package/dist/nodes/geometry/grid-pattern-node.js +0 -172
  745. package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
  746. package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
  747. package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
  748. package/dist/nodes/geometry/line-grid-node.js +0 -127
  749. package/dist/nodes/geometry/line-grid-node.js.map +0 -1
  750. package/dist/nodes/geometry/line-node.d.ts +0 -58
  751. package/dist/nodes/geometry/line-node.d.ts.map +0 -1
  752. package/dist/nodes/geometry/line-node.js +0 -123
  753. package/dist/nodes/geometry/line-node.js.map +0 -1
  754. package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
  755. package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
  756. package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
  757. package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
  758. package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
  759. package/dist/nodes/scene/canvas2d-node.js.map +0 -1
  760. package/dist/nodes/scene/provider-node.d.ts.map +0 -1
  761. package/dist/nodes/scene/provider-node.js.map +0 -1
  762. package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
  763. package/dist/nodes/scene/theme-provider-node.js.map +0 -1
  764. /package/dist/nodes/{scene → root}/provider-node.d.ts +0 -0
  765. /package/dist/nodes/{scene → root}/provider-node.js +0 -0
  766. /package/dist/nodes/{scene → root}/theme-provider-node.d.ts +0 -0
  767. /package/dist/nodes/{scene → root}/theme-provider-node.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/assets/manifest.ts"],"names":[],"mappings":"","sourcesContent":["/** Static metadata for an image asset, captured at build time. */\nexport interface ImageMeta {\n width: number;\n height: number;\n sizeBytes: number;\n src: string;\n}\n\n/** Static metadata for a video asset, captured at build time. */\nexport interface VideoMeta {\n width: number;\n height: number;\n duration: number; // in seconds\n sizeBytes: number;\n src: string;\n}\n\n/** Static metadata for an audio asset, captured at build time. */\nexport interface AudioMeta {\n duration: number; // in seconds\n sizeBytes: number;\n src: string;\n}\n\n/** Static metadata for a font face, captured at build time. */\nexport interface FontMeta {\n fontFamily: string;\n fontWeight: number;\n src: string;\n sizeBytes: number;\n}\n\n/** Discriminated union of all asset metadata shapes. */\nexport type AssetMeta = ImageMeta | VideoMeta | AudioMeta | FontMeta;\n\n/** Build-time asset manifest keyed by source path (images/videos/audio) or family@weight (fonts). */\nexport interface AssetManifest {\n image: Record<string, ImageMeta>;\n video: Record<string, VideoMeta>;\n audio: Record<string, AudioMeta>;\n font: Record<string, FontMeta>;\n}"]}
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/assets/manifest.ts"],"names":[],"mappings":"","sourcesContent":["/** Static metadata for an image asset, captured at build time. */\r\nexport interface ImageMeta {\r\n width: number;\r\n height: number;\r\n sizeBytes: number;\r\n src: string;\r\n}\r\n\r\n/** Static metadata for a video asset, captured at build time. */\r\nexport interface VideoMeta {\r\n width: number;\r\n height: number;\r\n duration: number; // in seconds\r\n sizeBytes: number;\r\n src: string;\r\n}\r\n\r\n/** Static metadata for an audio asset, captured at build time. */\r\nexport interface AudioMeta {\r\n duration: number; // in seconds\r\n sizeBytes: number;\r\n src: string;\r\n}\r\n\r\n/** Static metadata for a font face, captured at build time. */\r\nexport interface FontMeta {\r\n fontFamily: string;\r\n fontWeight: number;\r\n src: string;\r\n sizeBytes: number;\r\n}\r\n\r\n/** Discriminated union of all asset metadata shapes. */\r\nexport type AssetMeta = ImageMeta | VideoMeta | AudioMeta | FontMeta;\r\n\r\n/** Build-time asset manifest keyed by source path (images/videos/audio) or family@weight (fonts). */\r\nexport interface AssetManifest {\r\n image: Record<string, ImageMeta>;\r\n video: Record<string, VideoMeta>;\r\n audio: Record<string, AudioMeta>;\r\n font: Record<string, FontMeta>;\r\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/assets/record.ts"],"names":[],"mappings":"","sourcesContent":["export type AssetType = 'image' | 'font' | 'video' | 'audio' | 'loader';\n\n/** Frees whatever a {@link LoaderFn} loaded. Called when its window is evicted. */\nexport type Disposer = () => void;\n\n/**\n * An opaque async load owned by the declaring package. Runs the load and\n * optionally resolves a {@link Disposer} that frees it. The core never inspects\n * what was loaded — this is how a component package (e.g. the code component's\n * Shiki highlighter) loads its own resources without core depending on it.\n *\n * Resolving nothing means \"keep it resident\": a syntax grammar or a 3D runtime is\n * cheap to hold and expensive to re-fetch, so most loaders have nothing to free.\n * Resolving a `Disposer` opts into eviction when the frame window closes.\n */\nexport type LoaderFn = () => Promise<void | Disposer>;\n\n// ─── Cached entry types ───────────────────────────────────────────────────────\n\n/** The frame window one asset is needed over. */\ninterface BaseAssetRecord {\n type: AssetType;\n /** First frame at which this asset is needed. */\n startFrame: number;\n /** Last frame at which this asset is needed. */\n endFrame: number;\n src: string;\n}\n\nexport interface ImageRecord extends BaseAssetRecord {\n type: 'image';\n}\n\nexport interface FontRecord extends BaseAssetRecord {\n type: 'font';\n fontWeight: number;\n fontFamily: string;\n}\n\nexport interface VideoRecord extends BaseAssetRecord {\n type: 'video';\n trimStart: number; // seconds; default 0\n trimEnd: number; // seconds; default is end of video (manifest duration)\n}\n\nexport interface AudioRecord extends BaseAssetRecord {\n type: 'audio';\n trimStart: number; // seconds; default 0\n trimEnd: number; // seconds; default is end of audio (manifest duration)\n}\n\n/**\n * A generic, opaque async load tracked on the timeline like any other asset.\n * Unlike images/fonts/etc. it isn't dispatched by {@link StorageAdapter}; the\n * {@link AssetManager} runs {@link load} directly when the frame window opens\n * and calls the returned {@link Disposer} when it evicts. `src` is the dedupe\n * key (e.g. `lang:java|github-dark`).\n */\nexport interface LoaderRecord extends BaseAssetRecord {\n type: 'loader';\n load: LoaderFn;\n}\n\n/** Union of all per-type cached entry shapes. */\nexport type AssetRecord = ImageRecord | FontRecord | VideoRecord | AudioRecord | LoaderRecord;"]}
1
+ {"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/assets/record.ts"],"names":[],"mappings":"","sourcesContent":["export type AssetType = 'image' | 'font' | 'video' | 'audio' | 'loader';\r\n\r\n/** Frees whatever a {@link LoaderFn} loaded. Called when its window is evicted. */\r\nexport type Disposer = () => void;\r\n\r\n/**\r\n * An opaque async load owned by the declaring package. Runs the load and\r\n * optionally resolves a {@link Disposer} that frees it. The core never inspects\r\n * what was loaded — this is how a component package (e.g. the code component's\r\n * Shiki highlighter) loads its own resources without core depending on it.\r\n *\r\n * Resolving nothing means \"keep it resident\": a syntax grammar or a 3D runtime is\r\n * cheap to hold and expensive to re-fetch, so most loaders have nothing to free.\r\n * Resolving a `Disposer` opts into eviction when the frame window closes.\r\n */\r\nexport type LoaderFn = () => Promise<void | Disposer>;\r\n\r\n// ─── Cached entry types ───────────────────────────────────────────────────────\r\n\r\n/** The frame window one asset is needed over. */\r\ninterface BaseAssetRecord {\r\n type: AssetType;\r\n /** First frame at which this asset is needed. */\r\n startFrame: number;\r\n /** Last frame at which this asset is needed. */\r\n endFrame: number;\r\n src: string;\r\n}\r\n\r\nexport interface ImageRecord extends BaseAssetRecord {\r\n type: 'image';\r\n}\r\n\r\nexport interface FontRecord extends BaseAssetRecord {\r\n type: 'font';\r\n fontWeight: number;\r\n fontFamily: string;\r\n}\r\n\r\nexport interface VideoRecord extends BaseAssetRecord {\r\n type: 'video';\r\n trimStart: number; // seconds; default 0\r\n trimEnd: number; // seconds; default is end of video (manifest duration)\r\n}\r\n\r\nexport interface AudioRecord extends BaseAssetRecord {\r\n type: 'audio';\r\n trimStart: number; // seconds; default 0\r\n trimEnd: number; // seconds; default is end of audio (manifest duration)\r\n}\r\n\r\n/**\r\n * A generic, opaque async load tracked on the timeline like any other asset.\r\n * Unlike images/fonts/etc. it isn't dispatched by {@link StorageAdapter}; the\r\n * {@link AssetManager} runs {@link load} directly when the frame window opens\r\n * and calls the returned {@link Disposer} when it evicts. `src` is the dedupe\r\n * key (e.g. `lang:java|github-dark`).\r\n */\r\nexport interface LoaderRecord extends BaseAssetRecord {\r\n type: 'loader';\r\n load: LoaderFn;\r\n}\r\n\r\n/** Union of all per-type cached entry shapes. */\r\nexport type AssetRecord = ImageRecord | FontRecord | VideoRecord | AudioRecord | LoaderRecord;"]}
@@ -1,7 +1,7 @@
1
1
  import type { AssetCatalog } from "./catalog.js";
2
2
  import type { LoaderFn } from "./record.js";
3
3
  import type { FillResolved } from "../attributes/shape/fill/union.js";
4
- import type { SceneEffect } from "../attributes/shape/effects/union.js";
4
+ import type { NodeEffect } from "../attributes/shape/effects/union.js";
5
5
  import type { Node } from "../nodes/node/node.js";
6
6
  /** Whether an asset has to be resident before layout measures, or only before a frame draws. */
7
7
  export type AssetGate = "layout" | "render";
@@ -44,7 +44,7 @@ export interface AssetScope {
44
44
  gate?: AssetGate;
45
45
  }): void;
46
46
  fill(fills: FillResolved | readonly FillResolved[]): void;
47
- effects(effects: readonly SceneEffect[]): void;
47
+ effects(effects: readonly NodeEffect[]): void;
48
48
  /** A detached subtree this node draws (a `Tex.surface` node source), declared as part of this node. */
49
49
  subtree(node: Node): void;
50
50
  }
@@ -82,7 +82,7 @@ export declare class AssetDeclaration implements AssetScope {
82
82
  gate?: AssetGate;
83
83
  }): void;
84
84
  fill(fills: FillResolved | readonly FillResolved[]): void;
85
- effects(effects: readonly SceneEffect[]): void;
85
+ effects(effects: readonly NodeEffect[]): void;
86
86
  subtree(node: Node): void;
87
87
  private readonly _options;
88
88
  private readonly _decls;
@@ -1 +1 @@
1
- {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/assets/scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAK9C,gGAAgG;AAChG,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE5C,MAAM,MAAM,SAAS,GACf;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAClE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAChD;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AAgC;YAAE,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,CAAC,OAA+B;QACnC,IAAI,CAAC,OAAO;YAAE,OAAO;QACrB,KAAK,MAAM,MAAM,IAAI,OAAO;YAAE,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,CAAC,IAAU;QACd,IAAI,CAAC,SAAS,KAAK,IAAI,GAAG,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO;QACrC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS;YAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;;YAC5D,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IAEgB,QAAQ,CAA0B;IAClC,MAAM,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC/C,SAAS,CAAwB;CAC5C","sourcesContent":["import type { AssetCatalog } from \"./catalog\";\nimport type { LoaderFn } from \"./record\";\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\nimport type { SceneEffect } from \"@/attributes/shape/effects/union\";\nimport type { Node } from \"@/nodes/node/node\";\nimport { declareFill } from \"@/attributes/shape/fill/registry\";\nimport { declareEffect } from \"@/attributes/shape/effects/registry\";\nimport { declareTree } from \"@/nodes/node/node-walk\";\n\n/** Whether an asset has to be resident before layout measures, or only before a frame draws. */\nexport type AssetGate = \"layout\" | \"render\";\n\nexport type AssetDecl =\n | { type: \"image\"; src: string }\n | { type: \"video\"; src: string; trimStart: number; trimEnd: number }\n | { type: \"font\"; family: string; weight: number }\n | { type: \"loader\"; key: string; load: LoaderFn; gate: AssetGate };\n\n/**\n * What a node's `declareAssets` states its needs into.\n *\n * A declaration must be a pure function of the props and context it reads — never\n * `layoutBounds`, never `time`, no writes — because the runtime re-runs it only\n * when something it read changes. Declarations dedupe by {@link assetKey}.\n */\nexport interface AssetScope {\n readonly catalog: AssetCatalog;\n image(src: string): void;\n video(src: string, trim?: { start?: number; end?: number }): void;\n /** Gates layout: text is measured against the face. */\n font(family: string, weight?: number | string): void;\n /** `gate` defaults to `\"render\"`; pass `\"layout\"` for a load measurement depends on. */\n loader(key: string, load: LoaderFn, options?: { gate?: AssetGate }): void;\n fill(fills: FillResolved | readonly FillResolved[]): void;\n effects(effects: readonly SceneEffect[]): void;\n /** A detached subtree this node draws (a `Tex.surface` node source), declared as part of this node. */\n subtree(node: Node): void;\n}\n\n/**\n * Fonts key by family alone: `loadFont` registers every weight of a family at once\n * and a variable weight renders through `fontVariations`, so a weight in the key\n * would mint an entry per frame of a weight tween.\n */\nexport function assetKey(decl: AssetDecl): string {\n switch (decl.type) {\n case \"image\":\n case \"video\":\n return decl.src;\n case \"font\":\n return decl.family;\n case \"loader\":\n return decl.key;\n }\n}\n\n/** Anything unparseable lands on 400, which is what an unspecified weight means anyway. */\nexport function normalizeWeight(weight: number | string | undefined): number {\n if (typeof weight === \"number\") return Number.isFinite(weight) ? weight : 400;\n if (typeof weight === \"string\") return parseInt(weight, 10) || 400;\n return 400;\n}\n\nexport interface AssetDeclarationOptions {\n /** Binds a detached subtree (catalog, context, clock) before it declares. */\n bindSubtree?: (node: Node) => void;\n /** Replaces the default {@link declareTree} walk over a subtree. */\n onSubtree?: (node: Node, scope: AssetScope) => void;\n}\n\n/**\n * The {@link AssetScope} that collects: one declaration pass, keyed and validated.\n *\n * Unknown images and videos throw here, so a typo surfaces against the node that\n * declared it rather than as a picture that never paints.\n */\nexport class AssetDeclaration implements AssetScope {\n readonly catalog: AssetCatalog;\n\n constructor(catalog: AssetCatalog, options: AssetDeclarationOptions = {}) {\n this.catalog = catalog;\n this._options = options;\n }\n\n get declarations(): ReadonlyMap<string, AssetDecl> {\n return this._decls;\n }\n\n // An empty `src` is an unset media slot — it paints the checkerboard, not a\n // missing asset — so it declares nothing.\n image(src: string): void {\n if (!src || this._decls.has(src)) return;\n this.catalog.getImageMeta(src);\n this._decls.set(src, { type: \"image\", src });\n }\n\n video(src: string, trim?: { start?: number; end?: number }): void {\n if (!src || this._decls.has(src)) return;\n this.catalog.getVideoMeta(src);\n this._decls.set(src, {\n type: \"video\",\n src,\n trimStart: trim?.start ?? 0,\n trimEnd: trim?.end ?? this.catalog.getVideoDuration(src),\n });\n }\n\n font(family: string, weight?: number | string): void {\n if (!family || this._decls.has(family)) return;\n this._decls.set(family, { type: \"font\", family, weight: normalizeWeight(weight) });\n }\n\n loader(key: string, load: LoaderFn, options?: { gate?: AssetGate }): void {\n const gate = options?.gate ?? \"render\";\n const existing = this._decls.get(key);\n if (existing === undefined) {\n this._decls.set(key, { type: \"loader\", key, load, gate });\n return;\n }\n if (existing.type !== \"loader\") return;\n if (existing.load !== load && process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[assets] Loader \"${key}\" was declared with a different load function; the first is kept. ` +\n `Hoist the function so every declaration of the key hands over the same one.`,\n );\n }\n // Layout is the stricter gate, so it wins whichever declaration asked first.\n if (gate === \"layout\" && existing.gate !== \"layout\") {\n this._decls.set(key, { ...existing, gate });\n }\n }\n\n fill(fills: FillResolved | readonly FillResolved[]): void {\n if (!fills) return;\n if (!Array.isArray(fills)) {\n declareFill(fills as FillResolved, this);\n return;\n }\n for (const fill of fills as readonly FillResolved[]) declareFill(fill, this);\n }\n\n effects(effects: readonly SceneEffect[]): void {\n if (!effects) return;\n for (const effect of effects) declareEffect(effect, this);\n }\n\n subtree(node: Node): void {\n this._subtrees ??= new Set();\n if (this._subtrees.has(node)) return;\n this._subtrees.add(node);\n this._options.bindSubtree?.(node);\n if (this._options.onSubtree) this._options.onSubtree(node, this);\n else declareTree(node, this);\n }\n\n private readonly _options: AssetDeclarationOptions;\n private readonly _decls = new Map<string, AssetDecl>();\n private _subtrees: Set<Node> | undefined;\n}\n"]}
1
+ {"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/assets/scope.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAgCrD;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAe;IACpC,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO;YACR,OAAO,IAAI,CAAC,GAAG,CAAC;QACpB,KAAK,MAAM;YACP,OAAO,IAAI,CAAC,MAAM,CAAC;QACvB,KAAK,QAAQ;YACT,OAAO,IAAI,CAAC,GAAG,CAAC;IACxB,CAAC;AACL,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,eAAe,CAAC,MAAmC;IAC/D,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;IAC9E,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC;IACnE,OAAO,GAAG,CAAC;AACf,CAAC;AASD;;;;;GAKG;AACH,MAAM,OAAO,gBAAgB;IAChB,OAAO,CAAe;IAE/B,YAAY,OAAqB,EAAE,UAAmC,EAAE;QACpE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC5B,CAAC;IAED,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,4EAA4E;IAC5E,0CAA0C;IAC1C,KAAK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,IAAI,CAAC;YAAE,OAAO;QACrC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS;YAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;;YAC5D,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IAEgB,QAAQ,CAA0B;IAClC,MAAM,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC/C,SAAS,CAAwB;CAC5C","sourcesContent":["import type { AssetCatalog } from \"./catalog\";\r\nimport type { LoaderFn } from \"./record\";\r\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\r\nimport type { NodeEffect } from \"@/attributes/shape/effects/union\";\r\nimport type { Node } from \"@/nodes/node/node\";\r\nimport { declareFill } from \"@/attributes/shape/fill/registry\";\r\nimport { declareEffect } from \"@/attributes/shape/effects/registry\";\r\nimport { declareTree } from \"@/nodes/node/node-walk\";\r\n\r\n/** Whether an asset has to be resident before layout measures, or only before a frame draws. */\r\nexport type AssetGate = \"layout\" | \"render\";\r\n\r\nexport type AssetDecl =\r\n | { type: \"image\"; src: string }\r\n | { type: \"video\"; src: string; trimStart: number; trimEnd: number }\r\n | { type: \"font\"; family: string; weight: number }\r\n | { type: \"loader\"; key: string; load: LoaderFn; gate: AssetGate };\r\n\r\n/**\r\n * What a node's `declareAssets` states its needs into.\r\n *\r\n * A declaration must be a pure function of the props and context it reads — never\r\n * `layoutBounds`, never `time`, no writes — because the runtime re-runs it only\r\n * when something it read changes. Declarations dedupe by {@link assetKey}.\r\n */\r\nexport interface AssetScope {\r\n readonly catalog: AssetCatalog;\r\n image(src: string): void;\r\n video(src: string, trim?: { start?: number; end?: number }): void;\r\n /** Gates layout: text is measured against the face. */\r\n font(family: string, weight?: number | string): void;\r\n /** `gate` defaults to `\"render\"`; pass `\"layout\"` for a load measurement depends on. */\r\n loader(key: string, load: LoaderFn, options?: { gate?: AssetGate }): void;\r\n fill(fills: FillResolved | readonly FillResolved[]): void;\r\n effects(effects: readonly NodeEffect[]): void;\r\n /** A detached subtree this node draws (a `Tex.surface` node source), declared as part of this node. */\r\n subtree(node: Node): void;\r\n}\r\n\r\n/**\r\n * Fonts key by family alone: `loadFont` registers every weight of a family at once\r\n * and a variable weight renders through `fontVariations`, so a weight in the key\r\n * would mint an entry per frame of a weight tween.\r\n */\r\nexport function assetKey(decl: AssetDecl): string {\r\n switch (decl.type) {\r\n case \"image\":\r\n case \"video\":\r\n return decl.src;\r\n case \"font\":\r\n return decl.family;\r\n case \"loader\":\r\n return decl.key;\r\n }\r\n}\r\n\r\n/** Anything unparseable lands on 400, which is what an unspecified weight means anyway. */\r\nexport function normalizeWeight(weight: number | string | undefined): number {\r\n if (typeof weight === \"number\") return Number.isFinite(weight) ? weight : 400;\r\n if (typeof weight === \"string\") return parseInt(weight, 10) || 400;\r\n return 400;\r\n}\r\n\r\nexport interface AssetDeclarationOptions {\r\n /** Binds a detached subtree (catalog, context, clock) before it declares. */\r\n bindSubtree?: (node: Node) => void;\r\n /** Replaces the default {@link declareTree} walk over a subtree. */\r\n onSubtree?: (node: Node, scope: AssetScope) => void;\r\n}\r\n\r\n/**\r\n * The {@link AssetScope} that collects: one declaration pass, keyed and validated.\r\n *\r\n * Unknown images and videos throw here, so a typo surfaces against the node that\r\n * declared it rather than as a picture that never paints.\r\n */\r\nexport class AssetDeclaration implements AssetScope {\r\n readonly catalog: AssetCatalog;\r\n\r\n constructor(catalog: AssetCatalog, options: AssetDeclarationOptions = {}) {\r\n this.catalog = catalog;\r\n this._options = options;\r\n }\r\n\r\n get declarations(): ReadonlyMap<string, AssetDecl> {\r\n return this._decls;\r\n }\r\n\r\n // An empty `src` is an unset media slot — it paints the checkerboard, not a\r\n // missing asset — so it declares nothing.\r\n image(src: string): void {\r\n if (!src || this._decls.has(src)) return;\r\n this.catalog.getImageMeta(src);\r\n this._decls.set(src, { type: \"image\", src });\r\n }\r\n\r\n video(src: string, trim?: { start?: number; end?: number }): void {\r\n if (!src || this._decls.has(src)) return;\r\n this.catalog.getVideoMeta(src);\r\n this._decls.set(src, {\r\n type: \"video\",\r\n src,\r\n trimStart: trim?.start ?? 0,\r\n trimEnd: trim?.end ?? this.catalog.getVideoDuration(src),\r\n });\r\n }\r\n\r\n font(family: string, weight?: number | string): void {\r\n if (!family || this._decls.has(family)) return;\r\n this._decls.set(family, { type: \"font\", family, weight: normalizeWeight(weight) });\r\n }\r\n\r\n loader(key: string, load: LoaderFn, options?: { gate?: AssetGate }): void {\r\n const gate = options?.gate ?? \"render\";\r\n const existing = this._decls.get(key);\r\n if (existing === undefined) {\r\n this._decls.set(key, { type: \"loader\", key, load, gate });\r\n return;\r\n }\r\n if (existing.type !== \"loader\") return;\r\n if (existing.load !== load && process.env.NODE_ENV !== \"production\") {\r\n console.warn(\r\n `[assets] Loader \"${key}\" was declared with a different load function; the first is kept. ` +\r\n `Hoist the function so every declaration of the key hands over the same one.`,\r\n );\r\n }\r\n // Layout is the stricter gate, so it wins whichever declaration asked first.\r\n if (gate === \"layout\" && existing.gate !== \"layout\") {\r\n this._decls.set(key, { ...existing, gate });\r\n }\r\n }\r\n\r\n fill(fills: FillResolved | readonly FillResolved[]): void {\r\n if (!fills) return;\r\n if (!Array.isArray(fills)) {\r\n declareFill(fills as FillResolved, this);\r\n return;\r\n }\r\n for (const fill of fills as readonly FillResolved[]) declareFill(fill, this);\r\n }\r\n\r\n effects(effects: readonly NodeEffect[]): void {\r\n if (!effects) return;\r\n for (const effect of effects) declareEffect(effect, this);\r\n }\r\n\r\n subtree(node: Node): void {\r\n this._subtrees ??= new Set();\r\n if (this._subtrees.has(node)) return;\r\n this._subtrees.add(node);\r\n this._options.bindSubtree?.(node);\r\n if (this._options.onSubtree) this._options.onSubtree(node, this);\r\n else declareTree(node, this);\r\n }\r\n\r\n private readonly _options: AssetDeclarationOptions;\r\n private readonly _decls = new Map<string, AssetDecl>();\r\n private _subtrees: Set<Node> | undefined;\r\n}\r\n"]}
@@ -1,7 +1,7 @@
1
1
  import { AudioFilterItem } from "./union.js";
2
2
  import { Param } from "./curve.js";
3
3
  /**
4
- * Audio filters follow the same one-argument rule as scene effects and media
4
+ * Audio filters follow the same one-argument rule as node effects and media
5
5
  * filters: every builder takes a single options object, and those with one
6
6
  * dominant param also accept that param directly.
7
7
  *
@@ -1 +1 @@
1
- {"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/chain.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,OAAO,EAAE,MAAM,SAAS,CAAC;AAyDzC;;;;;;GAMG;AACH,SAAS,WAAW,CAAmB,GAAc,EAAE,GAAY;IAC/D,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAC,GAAY,CAAC,CAAC,CAAC,CAAE,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAQ,CAAC,CAAC,CAAE,GAAS,CAAC;AACjG,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,gBAAgB;IACR;IAAnB,YAAmB,OAA0B,EAAE;QAA5B,SAAI,GAAJ,IAAI,CAAwB;IAAI,CAAC;IAE5C,MAAM,CAAC,MAAuB;QACpC,OAAO,IAAI,gBAAgB,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,qCAAqC;IACrC,IAAI,CAAC,OAAkC;QACrC,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED,6FAA6F;IAC7F,MAAM,CAAC,OAAkC;QACvC,OAAO,IAAI,CAAC,IA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,KAAK,EAAE,QAAQ,EAAE,QAAQ,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,6EAA6E;IAC7E,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,6FAA6F;IAC7F,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF;AASD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,gBAAgB,EAAE,CAAC;AAEnD;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAgC;IAClE,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACrC,IAAI,OAAO,YAAY,gBAAgB;QAAE,OAAO,OAAO,CAAC,IAAI,CAAC;IAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IAC3C,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC","sourcesContent":["import { AudioFilterItem } from \"./union\";\nimport { Param, isCurve } from \"./curve\";\n\n/**\n * Audio filters follow the same one-argument rule as scene effects and media\n * filters: every builder takes a single options object, and those with one\n * dominant param also accept that param directly.\n *\n * The shorthand admits a whole {@link Param} — a constant `number` *or* a\n * {@link Curve} — so `AudioFilters.volume(fadeIn(0.5))` still works.\n */\n\n/** Gain / volume. Param shorthand sets `value`. */\nexport interface GainFilterOptions {\n /** 1 = unchanged, 0 = silent, >1 = louder. */\n value: Param;\n}\n\n/** High-pass filter. Param shorthand sets `frequency`. */\nexport interface HighPassFilterOptions {\n /** Rolls off content below this frequency, in Hz. */\n frequency: Param;\n /** Resonance at the cutoff (default 1). */\n q?: Param;\n}\n\n/** Low-pass filter. Param shorthand sets `frequency`. */\nexport interface LowPassFilterOptions {\n /** Rolls off content above this frequency, in Hz. */\n frequency: Param;\n /** Resonance at the cutoff (default 1). */\n q?: Param;\n}\n\n/** Amplitude wobble. Param shorthand sets `rate`. */\nexport interface TremoloFilterOptions {\n /** Wobble rate in Hz. */\n rate: Param;\n /** Modulation depth, 0–1 (default 0.5). */\n depth?: Param;\n}\n\n/** Playback-rate change (alters pitch). Param shorthand sets `value`. */\nexport interface SpeedFilterOptions {\n /** Playback-rate multiplier. */\n value: Param;\n}\n\n/** Delay line with feedback. Param shorthand sets `delay`. */\nexport interface EchoFilterOptions {\n /** Delay time in seconds. */\n delay: Param;\n /** Feedback amount, 0–<1 (default 0.4). */\n feedback?: Param;\n /** Wet mix, 0–1 (default 0.5). */\n mix?: Param;\n}\n\n/**\n * Normalise a `Param | Options` argument onto its dominant field.\n *\n * A {@link Curve} is an object, so the discriminator can't be a bare\n * `typeof === 'number'` — it must ask {@link isCurve} too, or an animated\n * shorthand would be mistaken for an options bag.\n */\nfunction scalarParam<O extends object>(arg: Param | O, key: keyof O): O {\n return typeof arg === \"number\" || isCurve(arg as Param) ? ({ [key]: arg } as O) : (arg as O);\n}\n\n/**\n * Immutable, chainable list of audio filters.\n *\n * Each builder method returns a new `AudioFilterChain` with the filter appended,\n * so chains are safe to share and branch. Filters apply in array order\n * (index 0 is closest to the source).\n *\n * Every numeric param accepts either a constant `number` or a time-varying\n * {@link Param} curve (see `ramp`/`fadeIn`/`fadeOut`), so any filter can animate:\n *\n * @example\n * const chain = AudioFilters.gain(1.5).lowpass(800).echo(0.3);\n * this.playSound('song.mp3', { filters: chain }); // assign directly\n * this.playSound('song.mp3', { filters: AudioFilters.volume(fadeIn(0.5).fadeOut(1)) }); // animated\n */\nexport class AudioFilterChain {\n constructor(public list: AudioFilterItem[] = []) { }\n\n private append(filter: AudioFilterItem): AudioFilterChain {\n return new AudioFilterChain([...this.list, filter]);\n }\n\n /** Append a gain (volume) filter. */\n gain(options: Param | GainFilterOptions) {\n const { value } = scalarParam(options, \"value\");\n return this.append({ type: 'gain', value });\n }\n\n /** Alias for {@link gain}; reads naturally for volume automation (`volume(fadeIn(0.5))`). */\n volume(options: Param | GainFilterOptions) {\n return this.gain(options);\n }\n\n /** Append a high-pass filter; rolls off content below `frequency` Hz. */\n highpass(options: Param | HighPassFilterOptions) {\n const { frequency, q } = scalarParam(options, \"frequency\");\n return this.append({ type: 'highpass', frequency, q });\n }\n\n /** Append a low-pass filter; rolls off content above `frequency` Hz. */\n lowpass(options: Param | LowPassFilterOptions) {\n const { frequency, q } = scalarParam(options, \"frequency\");\n return this.append({ type: 'lowpass', frequency, q });\n }\n\n /** Append a tremolo; `rate` Hz wobble at `depth` (0–1) modulation depth. */\n tremolo(options: Param | TremoloFilterOptions) {\n const { rate, depth } = scalarParam(options, \"rate\");\n return this.append({ type: 'tremolo', rate, depth: depth ?? 0.5 });\n }\n\n /** Append a speed change; the playback-rate multiplier (alters pitch). */\n speed(options: Param | SpeedFilterOptions) {\n const { value } = scalarParam(options, \"value\");\n return this.append({ type: 'speed', value });\n }\n\n /** Append an echo; `delay` seconds, `feedback` 0–<1, optional wet `mix` 0–1. */\n echo(options: Param | EchoFilterOptions) {\n const { delay, feedback, mix } = scalarParam(options, \"delay\");\n return this.append({ type: 'echo', delay, feedback: feedback ?? 0.4, mix });\n }\n\n /** Allows spreading the chain into an array: `[...AudioFilters.gain(2)]`. */\n *[Symbol.iterator]() {\n yield* this.list;\n }\n\n /** Serializes to the raw filter array so frameworks that call `toJSON` get a plain value. */\n toJSON() {\n return this.list;\n }\n}\n\n/**\n * Accepted shapes for a sound's `filters` prop — the loose, author-facing type.\n * Can be a single filter, a plain array, or an `AudioFilterChain` builder result.\n * Mirrors how `ImageFilter` is the author-facing union in the shape filter system.\n */\nexport type AudioFilter = AudioFilterItem[] | AudioFilterChain | AudioFilterItem;\n\n/**\n * Entry point for building audio-filter chains fluently.\n *\n * An empty {@link AudioFilterChain}, so `AudioFilters.gain(1.5)` *is*\n * `new AudioFilterChain().gain(1.5)` — every builder's signature and\n * documentation has one definition, on the class, which is what an editor shows\n * when you hover `AudioFilters.gain`. The chain is immutable, so sharing one\n * empty instance as the entry point is safe.\n *\n * @example\n * this.playSound('song.mp3', { filters: AudioFilters.gain(1.5).lowpass(800) });\n */\nexport const AudioFilters = new AudioFilterChain();\n\n/**\n * Normalises any `AudioFilter` value to a plain `AudioFilterItem[]`.\n * Used internally when reading props before scheduling or interpolation.\n */\nexport function resolveAudioFilters(filters: AudioFilter | undefined): AudioFilterItem[] {\n if (filters === undefined) return [];\n if (filters instanceof AudioFilterChain) return filters.list;\n if (Array.isArray(filters)) return filters;\n return [filters];\n}\n"]}
1
+ {"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/chain.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,OAAO,EAAE,MAAM,SAAS,CAAC;AAyDzC;;;;;;GAMG;AACH,SAAS,WAAW,CAAmB,GAAc,EAAE,GAAY;IAC/D,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAC,GAAY,CAAC,CAAC,CAAC,CAAE,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAQ,CAAC,CAAC,CAAE,GAAS,CAAC;AACjG,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,gBAAgB;IACR;IAAnB,YAAmB,OAA0B,EAAE;QAA5B,SAAI,GAAJ,IAAI,CAAwB;IAAI,CAAC;IAE5C,MAAM,CAAC,MAAuB;QACpC,OAAO,IAAI,gBAAgB,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,qCAAqC;IACrC,IAAI,CAAC,OAAkC;QACrC,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED,6FAA6F;IAC7F,MAAM,CAAC,OAAkC;QACvC,OAA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EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,6EAA6E;IAC7E,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,6FAA6F;IAC7F,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF;AASD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,gBAAgB,EAAE,CAAC;AAEnD;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAgC;IAClE,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACrC,IAAI,OAAO,YAAY,gBAAgB;QAAE,OAAO,OAAO,CAAC,IAAI,CAAC;IAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IAC3C,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC","sourcesContent":["import { AudioFilterItem } from \"./union\";\r\nimport { Param, isCurve } from \"./curve\";\r\n\r\n/**\r\n * Audio filters follow the same one-argument rule as node effects and media\r\n * filters: every builder takes a single options object, and those with one\r\n * dominant param also accept that param directly.\r\n *\r\n * The shorthand admits a whole {@link Param} — a constant `number` *or* a\r\n * {@link Curve} — so `AudioFilters.volume(fadeIn(0.5))` still works.\r\n */\r\n\r\n/** Gain / volume. Param shorthand sets `value`. */\r\nexport interface GainFilterOptions {\r\n /** 1 = unchanged, 0 = silent, >1 = louder. */\r\n value: Param;\r\n}\r\n\r\n/** High-pass filter. Param shorthand sets `frequency`. */\r\nexport interface HighPassFilterOptions {\r\n /** Rolls off content below this frequency, in Hz. */\r\n frequency: Param;\r\n /** Resonance at the cutoff (default 1). */\r\n q?: Param;\r\n}\r\n\r\n/** Low-pass filter. Param shorthand sets `frequency`. */\r\nexport interface LowPassFilterOptions {\r\n /** Rolls off content above this frequency, in Hz. */\r\n frequency: Param;\r\n /** Resonance at the cutoff (default 1). */\r\n q?: Param;\r\n}\r\n\r\n/** Amplitude wobble. Param shorthand sets `rate`. */\r\nexport interface TremoloFilterOptions {\r\n /** Wobble rate in Hz. */\r\n rate: Param;\r\n /** Modulation depth, 0–1 (default 0.5). */\r\n depth?: Param;\r\n}\r\n\r\n/** Playback-rate change (alters pitch). Param shorthand sets `value`. */\r\nexport interface SpeedFilterOptions {\r\n /** Playback-rate multiplier. */\r\n value: Param;\r\n}\r\n\r\n/** Delay line with feedback. Param shorthand sets `delay`. */\r\nexport interface EchoFilterOptions {\r\n /** Delay time in seconds. */\r\n delay: Param;\r\n /** Feedback amount, 0–<1 (default 0.4). */\r\n feedback?: Param;\r\n /** Wet mix, 0–1 (default 0.5). */\r\n mix?: Param;\r\n}\r\n\r\n/**\r\n * Normalise a `Param | Options` argument onto its dominant field.\r\n *\r\n * A {@link Curve} is an object, so the discriminator can't be a bare\r\n * `typeof === 'number'` — it must ask {@link isCurve} too, or an animated\r\n * shorthand would be mistaken for an options bag.\r\n */\r\nfunction scalarParam<O extends object>(arg: Param | O, key: keyof O): O {\r\n return typeof arg === \"number\" || isCurve(arg as Param) ? ({ [key]: arg } as O) : (arg as O);\r\n}\r\n\r\n/**\r\n * Immutable, chainable list of audio filters.\r\n *\r\n * Each builder method returns a new `AudioFilterChain` with the filter appended,\r\n * so chains are safe to share and branch. Filters apply in array order\r\n * (index 0 is closest to the source).\r\n *\r\n * Every numeric param accepts either a constant `number` or a time-varying\r\n * {@link Param} curve (see `ramp`/`fadeIn`/`fadeOut`), so any filter can animate:\r\n *\r\n * @example\r\n * const chain = AudioFilters.gain(1.5).lowpass(800).echo(0.3);\r\n * this.playSound('song.mp3', { filters: chain }); // assign directly\r\n * this.playSound('song.mp3', { filters: AudioFilters.volume(fadeIn(0.5).fadeOut(1)) }); // animated\r\n */\r\nexport class AudioFilterChain {\r\n constructor(public list: AudioFilterItem[] = []) { }\r\n\r\n private append(filter: AudioFilterItem): AudioFilterChain {\r\n return new AudioFilterChain([...this.list, filter]);\r\n }\r\n\r\n /** Append a gain (volume) filter. */\r\n gain(options: Param | GainFilterOptions) {\r\n const { value } = scalarParam(options, \"value\");\r\n return this.append({ type: 'gain', value });\r\n }\r\n\r\n /** Alias for {@link gain}; reads naturally for volume automation (`volume(fadeIn(0.5))`). */\r\n volume(options: Param | GainFilterOptions) {\r\n return this.gain(options);\r\n }\r\n\r\n /** Append a high-pass filter; rolls off content below `frequency` Hz. */\r\n highpass(options: Param | HighPassFilterOptions) {\r\n const { frequency, q } = scalarParam(options, \"frequency\");\r\n return this.append({ type: 'highpass', frequency, q });\r\n }\r\n\r\n /** Append a low-pass filter; rolls off content above `frequency` Hz. */\r\n lowpass(options: Param | LowPassFilterOptions) {\r\n const { frequency, q } = scalarParam(options, \"frequency\");\r\n return this.append({ type: 'lowpass', frequency, q });\r\n }\r\n\r\n /** Append a tremolo; `rate` Hz wobble at `depth` (0–1) modulation depth. */\r\n tremolo(options: Param | TremoloFilterOptions) {\r\n const { rate, depth } = scalarParam(options, \"rate\");\r\n return this.append({ type: 'tremolo', rate, depth: depth ?? 0.5 });\r\n }\r\n\r\n /** Append a speed change; the playback-rate multiplier (alters pitch). */\r\n speed(options: Param | SpeedFilterOptions) {\r\n const { value } = scalarParam(options, \"value\");\r\n return this.append({ type: 'speed', value });\r\n }\r\n\r\n /** Append an echo; `delay` seconds, `feedback` 0–<1, optional wet `mix` 0–1. */\r\n echo(options: Param | EchoFilterOptions) {\r\n const { delay, feedback, mix } = scalarParam(options, \"delay\");\r\n return this.append({ type: 'echo', delay, feedback: feedback ?? 0.4, mix });\r\n }\r\n\r\n /** Allows spreading the chain into an array: `[...AudioFilters.gain(2)]`. */\r\n *[Symbol.iterator]() {\r\n yield* this.list;\r\n }\r\n\r\n /** Serializes to the raw filter array so frameworks that call `toJSON` get a plain value. */\r\n toJSON() {\r\n return this.list;\r\n }\r\n}\r\n\r\n/**\r\n * Accepted shapes for a sound's `filters` prop — the loose, author-facing type.\r\n * Can be a single filter, a plain array, or an `AudioFilterChain` builder result.\r\n * Mirrors how `ImageFilter` is the author-facing union in the shape filter system.\r\n */\r\nexport type AudioFilter = AudioFilterItem[] | AudioFilterChain | AudioFilterItem;\r\n\r\n/**\r\n * Entry point for building audio-filter chains fluently.\r\n *\r\n * An empty {@link AudioFilterChain}, so `AudioFilters.gain(1.5)` *is*\r\n * `new AudioFilterChain().gain(1.5)` — every builder's signature and\r\n * documentation has one definition, on the class, which is what an editor shows\r\n * when you hover `AudioFilters.gain`. The chain is immutable, so sharing one\r\n * empty instance as the entry point is safe.\r\n *\r\n * @example\r\n * this.playSound('song.mp3', { filters: AudioFilters.gain(1.5).lowpass(800) });\r\n */\r\nexport const AudioFilters = new AudioFilterChain();\r\n\r\n/**\r\n * Normalises any `AudioFilter` value to a plain `AudioFilterItem[]`.\r\n * Used internally when reading props before scheduling or interpolation.\r\n */\r\nexport function resolveAudioFilters(filters: AudioFilter | undefined): AudioFilterItem[] {\r\n if (filters === undefined) return [];\r\n if (filters instanceof AudioFilterChain) return filters.list;\r\n if (Array.isArray(filters)) return filters;\r\n return [filters];\r\n}\r\n"]}
@@ -5,7 +5,7 @@ import type { AttributeOps } from "../../../attributes/shared/operators.js";
5
5
  *
6
6
  * A {@link Curve} is a portable, immutable list of {@link CurveSegment}s described
7
7
  * in **relative** time (seconds from the clip's start, with the final segment
8
- * anchored to the clip's end). It references no absolute scene time and no
8
+ * anchored to the clip's end). It references no absolute clip time and no
9
9
  * external signal, so the same curve can be applied to any clip of any length:
10
10
  *
11
11
  * @example
@@ -128,25 +128,25 @@ export declare const audioParamOps: AttributeOps<Param, Param>;
128
128
  /** Param equality: numeric compare, or reference identity for curves. */
129
129
  export declare function equalsParam(a: Param | undefined, b: Param | undefined): boolean;
130
130
  /**
131
- * Scene-time duration consumed by playing the source under a (possibly time-varying)
131
+ * Clip-time duration consumed by playing the source under a (possibly time-varying)
132
132
  * speed curve: `∫₀^upper 1/speed(τ) dτ`.
133
133
  *
134
134
  * The speed curve is authored over the **full** `sourceLength` (its segment times
135
135
  * are seconds from the clip's source start), so it is always resolved against
136
136
  * `sourceLength`; `upper` is just the integration bound (defaults to the whole
137
- * source). A slower instant (speed < 1) consumes *more* scene time. Sampled at
137
+ * source). A slower instant (speed < 1) consumes *more* clip time. Sampled at
138
138
  * {@link INTEGRATION_STEP}; speed is clamped to a tiny positive floor so a
139
139
  * zero/negative speed can't blow up the integral.
140
140
  *
141
- * Use this in BOTH the core scene-duration math and the cross-scene end resolution
141
+ * Use this in BOTH the core clip-duration math and the cross-scene end resolution
142
142
  * so the timeline reserves exactly the span the renderer plays.
143
143
  */
144
- export declare function integrateSpeedToSceneTime(speed: Curve, sourceLength: number, upper?: number, step?: number): number;
144
+ export declare function integrateSpeedToClipTime(speed: Curve, sourceLength: number, upper?: number, step?: number): number;
145
145
  /**
146
- * Inverse of {@link integrateSpeedToSceneTime}: the source-time offset reached
147
- * after `sceneElapsed` seconds of scene time under the speed curve. This is what a
146
+ * Inverse of {@link integrateSpeedToClipTime}: the source-time offset reached
147
+ * after `clipElapsed` seconds of clip time under the speed curve. This is what a
148
148
  * mid-clip seek needs to compute the correct buffer offset for a speed-curved clip.
149
149
  * The curve is always resolved against the full `sourceLength`.
150
150
  */
151
- export declare function sourceTimeAtSceneElapsed(speed: Curve, sourceLength: number, sceneElapsed: number, step?: number): number;
151
+ export declare function sourceTimeAtClipElapsed(speed: Curve, sourceLength: number, clipElapsed: number, step?: number): number;
152
152
  //# sourceMappingURL=curve.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/curve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAIlE;;;;;;;;;;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E,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,IAAI,SAAmB,GACxB,MAAM,CAiBR"}
@@ -1,4 +1,5 @@
1
1
  import { linear } from "../../../tween/ease/constants.js";
2
+ import { easeKey } from "../../../tween/ease/describe.js";
2
3
  import { lerpNumber } from "../../../tween/lerp.js";
3
4
  const DEFAULT_EASE = linear();
4
5
  /** Portable, immutable, fluent automation curve for one numeric param. */
@@ -57,10 +58,10 @@ export class Curve {
57
58
  explicit += Math.max(0, s.duration);
58
59
  }
59
60
  if (autoFillCount > 1 && process.env.NODE_ENV !== "production") {
60
- console.warn(`[motion-script] Curve has ${autoFillCount} auto-fill hold()s; only the first absorbs leftover time, the rest are zero-length.`);
61
+ console.warn(`[motionscript] Curve has ${autoFillCount} auto-fill hold()s; only the first absorbs leftover time, the rest are zero-length.`);
61
62
  }
62
63
  if (explicit > clip && process.env.NODE_ENV !== "production") {
63
- console.warn(`[motion-script] Curve segments total ${explicit.toFixed(3)}s but the clip is only ${clip.toFixed(3)}s; clamping to the clip.`);
64
+ console.warn(`[motionscript] Curve segments total ${explicit.toFixed(3)}s but the clip is only ${clip.toFixed(3)}s; clamping to the clip.`);
64
65
  }
65
66
  const slack = Math.max(0, clip - explicit);
66
67
  // Where does the slack go so the LAST segment always lands on the clip end?
@@ -164,7 +165,7 @@ export function paramKey(p) {
164
165
  return "_";
165
166
  if (!isCurve(p))
166
167
  return String(p);
167
- return "c[" + p.segments.map((s) => `${s.from ?? "_"},${s.to ?? "_"},${s.duration ?? "_"},${s.ease?.name ?? "lin"}`).join(";") + "]";
168
+ return "c[" + p.segments.map((s) => `${s.from ?? "_"},${s.to ?? "_"},${s.duration ?? "_"},${s.ease ? easeKey(s.ease) : "lin"}`).join(";") + "]";
168
169
  }
169
170
  /**
170
171
  * Interpolate between two params at progress `t`. Two numbers lerp; if either is
@@ -196,52 +197,52 @@ export function equalsParam(a, b) {
196
197
  /** Default sampling step (seconds) for numeric speed integration. */
197
198
  const INTEGRATION_STEP = 0.001;
198
199
  /**
199
- * Scene-time duration consumed by playing the source under a (possibly time-varying)
200
+ * Clip-time duration consumed by playing the source under a (possibly time-varying)
200
201
  * speed curve: `∫₀^upper 1/speed(τ) dτ`.
201
202
  *
202
203
  * The speed curve is authored over the **full** `sourceLength` (its segment times
203
204
  * are seconds from the clip's source start), so it is always resolved against
204
205
  * `sourceLength`; `upper` is just the integration bound (defaults to the whole
205
- * source). A slower instant (speed < 1) consumes *more* scene time. Sampled at
206
+ * source). A slower instant (speed < 1) consumes *more* clip time. Sampled at
206
207
  * {@link INTEGRATION_STEP}; speed is clamped to a tiny positive floor so a
207
208
  * zero/negative speed can't blow up the integral.
208
209
  *
209
- * Use this in BOTH the core scene-duration math and the cross-scene end resolution
210
+ * Use this in BOTH the core clip-duration math and the cross-scene end resolution
210
211
  * so the timeline reserves exactly the span the renderer plays.
211
212
  */
212
- export function integrateSpeedToSceneTime(speed, sourceLength, upper = sourceLength, step = INTEGRATION_STEP) {
213
+ export function integrateSpeedToClipTime(speed, sourceLength, upper = sourceLength, step = INTEGRATION_STEP) {
213
214
  const end = Math.min(upper, sourceLength);
214
215
  if (end <= 0)
215
216
  return 0;
216
- let sceneTime = 0;
217
+ let clipTime = 0;
217
218
  for (let tau = 0; tau < end; tau += step) {
218
219
  const dt = Math.min(step, end - tau);
219
220
  const v = Math.max(1e-6, speed.sampleAt(tau + dt / 2, sourceLength, 1));
220
- sceneTime += dt / v;
221
+ clipTime += dt / v;
221
222
  }
222
- return sceneTime;
223
+ return clipTime;
223
224
  }
224
225
  /**
225
- * Inverse of {@link integrateSpeedToSceneTime}: the source-time offset reached
226
- * after `sceneElapsed` seconds of scene time under the speed curve. This is what a
226
+ * Inverse of {@link integrateSpeedToClipTime}: the source-time offset reached
227
+ * after `clipElapsed` seconds of clip time under the speed curve. This is what a
227
228
  * mid-clip seek needs to compute the correct buffer offset for a speed-curved clip.
228
229
  * The curve is always resolved against the full `sourceLength`.
229
230
  */
230
- export function sourceTimeAtSceneElapsed(speed, sourceLength, sceneElapsed, step = INTEGRATION_STEP) {
231
- if (sceneElapsed <= 0)
231
+ export function sourceTimeAtClipElapsed(speed, sourceLength, clipElapsed, step = INTEGRATION_STEP) {
232
+ if (clipElapsed <= 0)
232
233
  return 0;
233
- let scene = 0;
234
+ let played = 0;
234
235
  let tau = 0;
235
236
  while (tau < sourceLength) {
236
237
  const dt = Math.min(step, sourceLength - tau);
237
238
  const v = Math.max(1e-6, speed.sampleAt(tau + dt / 2, sourceLength, 1));
238
- const sceneStep = dt / v;
239
- if (scene + sceneStep >= sceneElapsed) {
239
+ const clipStep = dt / v;
240
+ if (played + clipStep >= clipElapsed) {
240
241
  // Linear interpolation within this step for sub-step accuracy.
241
- const frac = sceneStep > 0 ? (sceneElapsed - scene) / sceneStep : 0;
242
+ const frac = clipStep > 0 ? (clipElapsed - played) / clipStep : 0;
242
243
  return tau + dt * frac;
243
244
  }
244
- scene += sceneStep;
245
+ played += clipStep;
245
246
  tau += dt;
246
247
  }
247
248
  return sourceLength;
@@ -1 +1 @@
1
- {"version":3,"file":"curve.js","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/curve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC;AAkD9B,0EAA0E;AAC1E,MAAM,OAAO,KAAK;IACc;IAA5B,YAA4B,WAAoC,EAAE;QAAtC,aAAQ,GAAR,QAAQ,CAA8B;IAAI,CAAC;IAEvE,iEAAiE;IACjE,IAAI,CAAC,IAAY,EAAE,EAAU,EAAE,QAAgB,EAAE,IAAgC;QAC7E,OAAO,IAAI,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;I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,CAAC;YACpC,+DAA+D;YAC/D,MAAM,IAAI,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YACpE,OAAO,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC;QAC3B,CAAC;QACD,KAAK,IAAI,SAAS,CAAC;QACnB,GAAG,IAAI,EAAE,CAAC;IACd,CAAC;IACD,OAAO,YAAY,CAAC;AACxB,CAAC","sourcesContent":["import { EasingFunction } from \"@/tween/ease/type\";\nimport { linear } from \"@/tween/ease/constants\";\nimport { lerpNumber } from \"@/tween/lerp\";\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\n\nconst DEFAULT_EASE = linear();\n\n/**\n * Time-varying automation for a single numeric filter param.\n *\n * A {@link Curve} is a portable, immutable list of {@link CurveSegment}s described\n * in **relative** time (seconds from the clip's start, with the final segment\n * anchored to the clip's end). It references no absolute scene time and no\n * external signal, so the same curve can be applied to any clip of any length:\n *\n * @example\n * const swell = ramp(0, 1, 0.5).hold().ramp(1, 0, 1); // up | auto-hold | down\n * AudioFilters.volume(swell).speed(swell); // reusable across params and clips\n *\n * Segments chain fluently (`ramp().hold().ramp()`) — that *is* sequencing; there\n * is intentionally no `seq`/`par`. Parallelism is just multiple filters in a chain.\n */\n\n/** A single automation segment in relative time. */\nexport interface CurveSegment {\n /**\n * Start value. `undefined` means \"continue from the previous segment's end\"\n * (or, for the first segment, the param's natural/current value — see\n * {@link fadeIn}, which leaves `from` resolved to 0 explicitly).\n */\n from?: number;\n /** End value. `undefined` for a hold (stays at the resolved `from`). */\n to?: number;\n /**\n * Length in **seconds**. `undefined` only for a bare {@link hold} that\n * auto-fills the remaining middle of the clip.\n */\n duration?: number;\n /** Segment easing; defaults to {@link linear}. */\n ease?: EasingFunction;\n}\n\n/** A segment resolved against a concrete clip duration: absolute relative-time keyframe pair. */\nexport interface ResolvedSegment {\n /** Segment start, seconds from clip start. */\n startTime: number;\n /** Segment end, seconds from clip start. */\n endTime: number;\n from: number;\n to: number;\n ease: EasingFunction;\n /** True when `ease` is the identity {@link linear} — lets the renderer use a cheap `linearRamp`. */\n isLinear: boolean;\n}\n\n/** Portable, immutable, fluent automation curve for one numeric param. */\nexport class Curve {\n constructor(public readonly segments: readonly CurveSegment[] = []) { }\n\n /** Append a ramp from `from` to `to` over `duration` seconds. */\n ramp(from: number, to: number, duration: number, opts?: { ease?: EasingFunction }): Curve {\n return new Curve([...this.segments, { from, to, duration, ease: opts?.ease }]);\n }\n\n /**\n * Append a hold. With `duration` it sustains for that many seconds; bare\n * `hold()` stretches to fill whatever time is left in the middle of the clip\n * (only one auto-fill hold is allowed per curve).\n */\n hold(duration?: number): Curve {\n return new Curve([...this.segments, { duration }]);\n }\n\n /** Append a fade from 0 up over `duration` seconds, anchored at the clip start. */\n fadeIn(duration: number, opts?: { ease?: EasingFunction }): Curve {\n return new Curve([...this.segments, { from: 0, to: 1, duration, ease: opts?.ease }]);\n }\n\n /** Append a fade down to 0 over `duration` seconds, anchored to the clip end. */\n fadeOut(duration: number, opts?: { ease?: EasingFunction }): Curve {\n return new Curve([...this.segments, { to: 0, duration, ease: opts?.ease }]);\n }\n\n /**\n * Resolve relative segments into absolute (clip-relative) keyframes once the\n * clip's duration is known.\n *\n * - Explicit segment durations are summed; a single bare `hold()` absorbs the\n * leftover `clipDuration - sumOfExplicit` so fade-in/hold/fade-out auto-sizes.\n * - The final segment's end lands exactly at `clipDuration` (end-anchor), which\n * is what makes `fadeOut` \"the last N seconds\" without naming an anchor.\n * - If explicit durations exceed `clipDuration`, the schedule is clamped to the\n * clip (later segments may be squeezed to zero) and a dev warning is logged.\n *\n * @param defaultValue value used for an unresolved first `from` (the param's natural value).\n */\n resolve(clipDuration: number, defaultValue: number): ResolvedSegment[] {\n const segs = this.segments;\n if (segs.length === 0) return [];\n\n // Guard a non-finite/negative clip length so a degenerate duration can never\n // propagate NaN/Infinity into resolved keyframes (and then into AudioParams).\n const clip = Number.isFinite(clipDuration) && clipDuration > 0 ? clipDuration : 0;\n\n // Sum explicit durations; find a single auto-fill hold (duration undefined).\n let explicit = 0;\n let autoFillCount = 0;\n for (const s of segs) {\n if (s.duration === undefined) autoFillCount++;\n else explicit += Math.max(0, s.duration);\n }\n if (autoFillCount > 1 && process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[motion-script] Curve has ${autoFillCount} auto-fill hold()s; only the first absorbs leftover time, the rest are zero-length.`,\n );\n }\n if (explicit > clip && process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[motion-script] Curve segments total ${explicit.toFixed(3)}s but the clip is only ${clip.toFixed(3)}s; clamping to the clip.`,\n );\n }\n\n const slack = Math.max(0, clip - explicit);\n\n // Where does the slack go so the LAST segment always lands on the clip end?\n // - An explicit auto-fill hold() owns it (its index absorbs `slack`).\n // - Otherwise insert it implicitly just before the final segment, so a\n // trailing fadeOut/ramp is end-anchored (\"the last N seconds\") without the\n // author having to type hold(). With no slack, nothing is inserted.\n const autoFillIndex = autoFillCount > 0\n ? segs.findIndex((s) => s.duration === undefined)\n : (slack > 0 ? segs.length - 1 : -1);\n\n const out: ResolvedSegment[] = [];\n let cursor = 0;\n let prevValue = defaultValue;\n\n for (let i = 0; i < segs.length; i++) {\n const s = segs[i];\n\n // Insert the implicit end-anchoring gap before the final segment.\n if (autoFillCount === 0 && i === autoFillIndex && slack > 0) {\n const gapStart = Math.min(cursor, clip);\n const gapEnd = Math.min(cursor + slack, clip);\n out.push({ startTime: gapStart, endTime: gapEnd, from: prevValue, to: prevValue, ease: DEFAULT_EASE, isLinear: true });\n cursor += slack;\n }\n\n let dur: number;\n if (s.duration === undefined) {\n // Only the first auto-fill hold absorbs slack; any extras are zero.\n dur = i === autoFillIndex ? slack : 0;\n } else {\n dur = Math.max(0, s.duration);\n }\n\n const from = s.from ?? prevValue;\n // `to === undefined` is a hold: stay at `from`.\n const to = s.to ?? from;\n\n const startTime = Math.min(cursor, clip);\n const endTime = Math.min(cursor + dur, clip);\n const ease = s.ease ?? DEFAULT_EASE;\n out.push({ startTime, endTime, from, to, ease, isLinear: ease === DEFAULT_EASE });\n\n cursor += dur;\n prevValue = to;\n }\n\n return out;\n }\n\n /** Sample the curve's value at relative time `t` seconds (for a known clip duration). */\n sampleAt(t: number, clipDuration: number, defaultValue: number): number {\n const resolved = this.resolve(clipDuration, defaultValue);\n if (resolved.length === 0) return defaultValue;\n if (t <= resolved[0].startTime) return resolved[0].from;\n for (const seg of resolved) {\n if (t >= seg.startTime && t <= seg.endTime) {\n const span = seg.endTime - seg.startTime;\n const local = span > 0 ? (t - seg.startTime) / span : 1;\n return lerpNumber(seg.from, seg.to, seg.ease(local));\n }\n }\n return resolved[resolved.length - 1].to;\n }\n\n /** The curve's value at t=0 — its constant fallback for static contexts. */\n staticValue(defaultValue: number): number {\n const first = this.segments[0];\n return first?.from ?? defaultValue;\n }\n}\n\n// ─── Free-function constructors (each returns a one-segment Curve, so they chain) ─\n\n/** A ramp from `from` to `to` over `duration` seconds. */\nexport function ramp(from: number, to: number, duration: number, opts?: { ease?: EasingFunction }): Curve {\n return new Curve().ramp(from, to, duration, opts);\n}\n\n/** A hold; bare `hold()` auto-fills the middle of the clip. */\nexport function hold(duration?: number): Curve {\n return new Curve().hold(duration);\n}\n\n/** A fade from 0 up over `duration` seconds, anchored at the clip start. */\nexport function fadeIn(duration: number, opts?: { ease?: EasingFunction }): Curve {\n return new Curve().fadeIn(duration, opts);\n}\n\n/** A fade down to 0 over `duration` seconds, anchored to the clip end. */\nexport function fadeOut(duration: number, opts?: { ease?: EasingFunction }): Curve {\n return new Curve().fadeOut(duration, opts);\n}\n\n// ─── Param type & helpers ──────────────────────────────────────────────────────\n\n/** A filter param: a constant number, or a time-varying {@link Curve}. */\nexport type Param = number | Curve;\n\n/** Type guard: is this param a time-varying curve? */\nexport function isCurve(p: Param | undefined): p is Curve {\n return p instanceof Curve;\n}\n\n/**\n * The constant value of a param for static contexts (the number itself, or a\n * curve's t=0 value). Used wherever a single representative number is needed\n * (e.g. timeline math, equality fast paths).\n */\nexport function staticValue(p: Param, fallback = 0): number {\n return isCurve(p) ? p.staticValue(fallback) : p;\n}\n\n/**\n * Deterministic string key for a param, including a curve's full segment shape.\n * Used to detect when a filter param actually changed (so playback re-schedules\n * the source) — two curves with identical segments produce the same key.\n */\nexport function paramKey(p: Param | undefined): string {\n if (p === undefined) return \"_\";\n if (!isCurve(p)) return String(p);\n return \"c[\" + p.segments.map((s) =>\n `${s.from ?? \"_\"},${s.to ?? \"_\"},${s.duration ?? \"_\"},${s.ease?.name ?? \"lin\"}`,\n ).join(\";\") + \"]\";\n}\n\n/**\n * Interpolate between two params at progress `t`. Two numbers lerp; if either is\n * a curve, hard-cut at t=0.5 (curve↔curve interpolation is out of scope — this\n * only affects crossfades between two *different* filter chains, which is rare).\n */\nexport function lerpParam(from: Param, to: Param, t: number): Param {\n if (typeof from === \"number\" && typeof to === \"number\") return lerpNumber(from, to, t);\n return t < 0.5 ? from : to;\n}\n\n/** The audio-param attribute's op set: resolve is the identity, lerp hard-cuts\n * between curves (numbers lerp) — see {@link lerpParam}. */\nexport const audioParamOps: AttributeOps<Param, Param> = {\n resolve: (value) => value,\n lerp: lerpParam,\n};\n\n/** Param equality: numeric compare, or reference identity for curves. */\nexport function equalsParam(a: Param | undefined, b: Param | undefined): boolean {\n if (a === b) return true;\n if (typeof a === \"number\" && typeof b === \"number\") return a === b;\n // Curves: reference identity (portable curves are shared values, not rebuilt\n // per-frame). Structural equality is unnecessary for the equals() fast path.\n return false;\n}\n\n// ─── Speed integration (shared by core timeline math and the renderer) ──────────\n\n/** Default sampling step (seconds) for numeric speed integration. */\nconst INTEGRATION_STEP = 0.001;\n\n/**\n * Scene-time duration consumed by playing the source under a (possibly time-varying)\n * speed curve: `∫₀^upper 1/speed(τ) dτ`.\n *\n * The speed curve is authored over the **full** `sourceLength` (its segment times\n * are seconds from the clip's source start), so it is always resolved against\n * `sourceLength`; `upper` is just the integration bound (defaults to the whole\n * source). A slower instant (speed < 1) consumes *more* scene time. Sampled at\n * {@link INTEGRATION_STEP}; speed is clamped to a tiny positive floor so a\n * zero/negative speed can't blow up the integral.\n *\n * Use this in BOTH the core scene-duration math and the cross-scene end resolution\n * so the timeline reserves exactly the span the renderer plays.\n */\nexport function integrateSpeedToSceneTime(\n speed: Curve,\n sourceLength: number,\n upper: number = sourceLength,\n step = INTEGRATION_STEP,\n): number {\n const end = Math.min(upper, sourceLength);\n if (end <= 0) return 0;\n let sceneTime = 0;\n for (let tau = 0; tau < end; tau += step) {\n const dt = Math.min(step, end - tau);\n const v = Math.max(1e-6, speed.sampleAt(tau + dt / 2, sourceLength, 1));\n sceneTime += dt / v;\n }\n return sceneTime;\n}\n\n/**\n * Inverse of {@link integrateSpeedToSceneTime}: the source-time offset reached\n * after `sceneElapsed` seconds of scene time under the speed curve. This is what a\n * mid-clip seek needs to compute the correct buffer offset for a speed-curved clip.\n * The curve is always resolved against the full `sourceLength`.\n */\nexport function sourceTimeAtSceneElapsed(\n speed: Curve,\n sourceLength: number,\n sceneElapsed: number,\n step = INTEGRATION_STEP,\n): number {\n if (sceneElapsed <= 0) return 0;\n let scene = 0;\n let tau = 0;\n while (tau < sourceLength) {\n const dt = Math.min(step, sourceLength - tau);\n const v = Math.max(1e-6, speed.sampleAt(tau + dt / 2, sourceLength, 1));\n const sceneStep = dt / v;\n if (scene + sceneStep >= sceneElapsed) {\n // Linear interpolation within this step for sub-step accuracy.\n const frac = sceneStep > 0 ? (sceneElapsed - scene) / sceneStep : 0;\n return tau + dt * frac;\n }\n scene += sceneStep;\n tau += dt;\n }\n return sourceLength;\n}\n"]}
1
+ {"version":3,"file":"curve.js","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/curve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,UAAU,EA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AI,CAAC;QAAE,OAAO,CAAC,CAAC;IAC/B,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,OAAO,GAAG,GAAG,YAAY,EAAE,CAAC;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,GAAG,GAAG,CAAC,CAAC;QAC9C,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,EAAE,GAAG,CAAC,CAAC;QACxB,IAAI,MAAM,GAAG,QAAQ,IAAI,WAAW,EAAE,CAAC;YACnC,+DAA+D;YAC/D,MAAM,IAAI,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YAClE,OAAO,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC;QAC3B,CAAC;QACD,MAAM,IAAI,QAAQ,CAAC;QACnB,GAAG,IAAI,EAAE,CAAC;IACd,CAAC;IACD,OAAO,YAAY,CAAC;AACxB,CAAC","sourcesContent":["import { EasingFunction } from \"@/tween/ease/type\";\r\nimport { linear } from \"@/tween/ease/constants\";\r\nimport { easeKey } from \"@/tween/ease/describe\";\r\nimport { lerpNumber } from \"@/tween/lerp\";\r\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\r\n\r\nconst DEFAULT_EASE = linear();\r\n\r\n/**\r\n * Time-varying automation for a single numeric filter param.\r\n *\r\n * A {@link Curve} is a portable, immutable list of {@link CurveSegment}s described\r\n * in **relative** time (seconds from the clip's start, with the final segment\r\n * anchored to the clip's end). It references no absolute clip time and no\r\n * external signal, so the same curve can be applied to any clip of any length:\r\n *\r\n * @example\r\n * const swell = ramp(0, 1, 0.5).hold().ramp(1, 0, 1); // up | auto-hold | down\r\n * AudioFilters.volume(swell).speed(swell); // reusable across params and clips\r\n *\r\n * Segments chain fluently (`ramp().hold().ramp()`) — that *is* sequencing; there\r\n * is intentionally no `seq`/`par`. Parallelism is just multiple filters in a chain.\r\n */\r\n\r\n/** A single automation segment in relative time. */\r\nexport interface CurveSegment {\r\n /**\r\n * Start value. `undefined` means \"continue from the previous segment's end\"\r\n * (or, for the first segment, the param's natural/current value — see\r\n * {@link fadeIn}, which leaves `from` resolved to 0 explicitly).\r\n */\r\n from?: number;\r\n /** End value. `undefined` for a hold (stays at the resolved `from`). */\r\n to?: number;\r\n /**\r\n * Length in **seconds**. `undefined` only for a bare {@link hold} that\r\n * auto-fills the remaining middle of the clip.\r\n */\r\n duration?: number;\r\n /** Segment easing; defaults to {@link linear}. */\r\n ease?: EasingFunction;\r\n}\r\n\r\n/** A segment resolved against a concrete clip duration: absolute relative-time keyframe pair. */\r\nexport interface ResolvedSegment {\r\n /** Segment start, seconds from clip start. */\r\n startTime: number;\r\n /** Segment end, seconds from clip start. */\r\n endTime: number;\r\n from: number;\r\n to: number;\r\n ease: EasingFunction;\r\n /** True when `ease` is the identity {@link linear} — lets the renderer use a cheap `linearRamp`. */\r\n isLinear: boolean;\r\n}\r\n\r\n/** Portable, immutable, fluent automation curve for one numeric param. */\r\nexport class Curve {\r\n constructor(public readonly segments: readonly CurveSegment[] = []) { }\r\n\r\n /** Append a ramp from `from` to `to` over `duration` seconds. */\r\n ramp(from: number, to: number, duration: number, opts?: { ease?: EasingFunction }): Curve {\r\n return new Curve([...this.segments, { from, to, duration, ease: opts?.ease }]);\r\n }\r\n\r\n /**\r\n * Append a hold. With `duration` it sustains for that many seconds; bare\r\n * `hold()` stretches to fill whatever time is left in the middle of the clip\r\n * (only one auto-fill hold is allowed per curve).\r\n */\r\n hold(duration?: number): Curve {\r\n return new Curve([...this.segments, { duration }]);\r\n }\r\n\r\n /** Append a fade from 0 up over `duration` seconds, anchored at the clip start. */\r\n fadeIn(duration: number, opts?: { ease?: EasingFunction }): Curve {\r\n return new Curve([...this.segments, { from: 0, to: 1, duration, ease: opts?.ease }]);\r\n }\r\n\r\n /** Append a fade down to 0 over `duration` seconds, anchored to the clip end. */\r\n fadeOut(duration: number, opts?: { ease?: EasingFunction }): Curve {\r\n return new Curve([...this.segments, { to: 0, duration, ease: opts?.ease }]);\r\n }\r\n\r\n /**\r\n * Resolve relative segments into absolute (clip-relative) keyframes once the\r\n * clip's duration is known.\r\n *\r\n * - Explicit segment durations are summed; a single bare `hold()` absorbs the\r\n * leftover `clipDuration - sumOfExplicit` so fade-in/hold/fade-out auto-sizes.\r\n * - The final segment's end lands exactly at `clipDuration` (end-anchor), which\r\n * is what makes `fadeOut` \"the last N seconds\" without naming an anchor.\r\n * - If explicit durations exceed `clipDuration`, the schedule is clamped to the\r\n * clip (later segments may be squeezed to zero) and a dev warning is logged.\r\n *\r\n * @param defaultValue value used for an unresolved first `from` (the param's natural value).\r\n */\r\n resolve(clipDuration: number, defaultValue: number): ResolvedSegment[] {\r\n const segs = this.segments;\r\n if (segs.length === 0) return [];\r\n\r\n // Guard a non-finite/negative clip length so a degenerate duration can never\r\n // propagate NaN/Infinity into resolved keyframes (and then into AudioParams).\r\n const clip = Number.isFinite(clipDuration) && clipDuration > 0 ? clipDuration : 0;\r\n\r\n // Sum explicit durations; find a single auto-fill hold (duration undefined).\r\n let explicit = 0;\r\n let autoFillCount = 0;\r\n for (const s of segs) {\r\n if (s.duration === undefined) autoFillCount++;\r\n else explicit += Math.max(0, s.duration);\r\n }\r\n if (autoFillCount > 1 && process.env.NODE_ENV !== \"production\") {\r\n console.warn(\r\n `[motionscript] Curve has ${autoFillCount} auto-fill hold()s; only the first absorbs leftover time, the rest are zero-length.`,\r\n );\r\n }\r\n if (explicit > clip && process.env.NODE_ENV !== \"production\") {\r\n console.warn(\r\n `[motionscript] Curve segments total ${explicit.toFixed(3)}s but the clip is only ${clip.toFixed(3)}s; clamping to the clip.`,\r\n );\r\n }\r\n\r\n const slack = Math.max(0, clip - explicit);\r\n\r\n // Where does the slack go so the LAST segment always lands on the clip end?\r\n // - An explicit auto-fill hold() owns it (its index absorbs `slack`).\r\n // - Otherwise insert it implicitly just before the final segment, so a\r\n // trailing fadeOut/ramp is end-anchored (\"the last N seconds\") without the\r\n // author having to type hold(). With no slack, nothing is inserted.\r\n const autoFillIndex = autoFillCount > 0\r\n ? segs.findIndex((s) => s.duration === undefined)\r\n : (slack > 0 ? segs.length - 1 : -1);\r\n\r\n const out: ResolvedSegment[] = [];\r\n let cursor = 0;\r\n let prevValue = defaultValue;\r\n\r\n for (let i = 0; i < segs.length; i++) {\r\n const s = segs[i];\r\n\r\n // Insert the implicit end-anchoring gap before the final segment.\r\n if (autoFillCount === 0 && i === autoFillIndex && slack > 0) {\r\n const gapStart = Math.min(cursor, clip);\r\n const gapEnd = Math.min(cursor + slack, clip);\r\n out.push({ startTime: gapStart, endTime: gapEnd, from: prevValue, to: prevValue, ease: DEFAULT_EASE, isLinear: true });\r\n cursor += slack;\r\n }\r\n\r\n let dur: number;\r\n if (s.duration === undefined) {\r\n // Only the first auto-fill hold absorbs slack; any extras are zero.\r\n dur = i === autoFillIndex ? slack : 0;\r\n } else {\r\n dur = Math.max(0, s.duration);\r\n }\r\n\r\n const from = s.from ?? prevValue;\r\n // `to === undefined` is a hold: stay at `from`.\r\n const to = s.to ?? from;\r\n\r\n const startTime = Math.min(cursor, clip);\r\n const endTime = Math.min(cursor + dur, clip);\r\n const ease = s.ease ?? DEFAULT_EASE;\r\n out.push({ startTime, endTime, from, to, ease, isLinear: ease === DEFAULT_EASE });\r\n\r\n cursor += dur;\r\n prevValue = to;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /** Sample the curve's value at relative time `t` seconds (for a known clip duration). */\r\n sampleAt(t: number, clipDuration: number, defaultValue: number): number {\r\n const resolved = this.resolve(clipDuration, defaultValue);\r\n if (resolved.length === 0) return defaultValue;\r\n if (t <= resolved[0].startTime) return resolved[0].from;\r\n for (const seg of resolved) {\r\n if (t >= seg.startTime && t <= seg.endTime) {\r\n const span = seg.endTime - seg.startTime;\r\n const local = span > 0 ? (t - seg.startTime) / span : 1;\r\n return lerpNumber(seg.from, seg.to, seg.ease(local));\r\n }\r\n }\r\n return resolved[resolved.length - 1].to;\r\n }\r\n\r\n /** The curve's value at t=0 — its constant fallback for static contexts. */\r\n staticValue(defaultValue: number): number {\r\n const first = this.segments[0];\r\n return first?.from ?? defaultValue;\r\n }\r\n}\r\n\r\n// ─── Free-function constructors (each returns a one-segment Curve, so they chain) ─\r\n\r\n/** A ramp from `from` to `to` over `duration` seconds. */\r\nexport function ramp(from: number, to: number, duration: number, opts?: { ease?: EasingFunction }): Curve {\r\n return new Curve().ramp(from, to, duration, opts);\r\n}\r\n\r\n/** A hold; bare `hold()` auto-fills the middle of the clip. */\r\nexport function hold(duration?: number): Curve {\r\n return new Curve().hold(duration);\r\n}\r\n\r\n/** A fade from 0 up over `duration` seconds, anchored at the clip start. */\r\nexport function fadeIn(duration: number, opts?: { ease?: EasingFunction }): Curve {\r\n return new Curve().fadeIn(duration, opts);\r\n}\r\n\r\n/** A fade down to 0 over `duration` seconds, anchored to the clip end. */\r\nexport function fadeOut(duration: number, opts?: { ease?: EasingFunction }): Curve {\r\n return new Curve().fadeOut(duration, opts);\r\n}\r\n\r\n// ─── Param type & helpers ──────────────────────────────────────────────────────\r\n\r\n/** A filter param: a constant number, or a time-varying {@link Curve}. */\r\nexport type Param = number | Curve;\r\n\r\n/** Type guard: is this param a time-varying curve? */\r\nexport function isCurve(p: Param | undefined): p is Curve {\r\n return p instanceof Curve;\r\n}\r\n\r\n/**\r\n * The constant value of a param for static contexts (the number itself, or a\r\n * curve's t=0 value). Used wherever a single representative number is needed\r\n * (e.g. timeline math, equality fast paths).\r\n */\r\nexport function staticValue(p: Param, fallback = 0): number {\r\n return isCurve(p) ? p.staticValue(fallback) : p;\r\n}\r\n\r\n/**\r\n * Deterministic string key for a param, including a curve's full segment shape.\r\n * Used to detect when a filter param actually changed (so playback re-schedules\r\n * the source) — two curves with identical segments produce the same key.\r\n */\r\nexport function paramKey(p: Param | undefined): string {\r\n if (p === undefined) return \"_\";\r\n if (!isCurve(p)) return String(p);\r\n return \"c[\" + p.segments.map((s) =>\r\n `${s.from ?? \"_\"},${s.to ?? \"_\"},${s.duration ?? \"_\"},${s.ease ? easeKey(s.ease) : \"lin\"}`,\r\n ).join(\";\") + \"]\";\r\n}\r\n\r\n/**\r\n * Interpolate between two params at progress `t`. Two numbers lerp; if either is\r\n * a curve, hard-cut at t=0.5 (curve↔curve interpolation is out of scope — this\r\n * only affects crossfades between two *different* filter chains, which is rare).\r\n */\r\nexport function lerpParam(from: Param, to: Param, t: number): Param {\r\n if (typeof from === \"number\" && typeof to === \"number\") return lerpNumber(from, to, t);\r\n return t < 0.5 ? from : to;\r\n}\r\n\r\n/** The audio-param attribute's op set: resolve is the identity, lerp hard-cuts\r\n * between curves (numbers lerp) — see {@link lerpParam}. */\r\nexport const audioParamOps: AttributeOps<Param, Param> = {\r\n resolve: (value) => value,\r\n lerp: lerpParam,\r\n};\r\n\r\n/** Param equality: numeric compare, or reference identity for curves. */\r\nexport function equalsParam(a: Param | undefined, b: Param | undefined): boolean {\r\n if (a === b) return true;\r\n if (typeof a === \"number\" && typeof b === \"number\") return a === b;\r\n // Curves: reference identity (portable curves are shared values, not rebuilt\r\n // per-frame). Structural equality is unnecessary for the equals() fast path.\r\n return false;\r\n}\r\n\r\n// ─── Speed integration (shared by core timeline math and the renderer) ──────────\r\n\r\n/** Default sampling step (seconds) for numeric speed integration. */\r\nconst INTEGRATION_STEP = 0.001;\r\n\r\n/**\r\n * Clip-time duration consumed by playing the source under a (possibly time-varying)\r\n * speed curve: `∫₀^upper 1/speed(τ) dτ`.\r\n *\r\n * The speed curve is authored over the **full** `sourceLength` (its segment times\r\n * are seconds from the clip's source start), so it is always resolved against\r\n * `sourceLength`; `upper` is just the integration bound (defaults to the whole\r\n * source). A slower instant (speed < 1) consumes *more* clip time. Sampled at\r\n * {@link INTEGRATION_STEP}; speed is clamped to a tiny positive floor so a\r\n * zero/negative speed can't blow up the integral.\r\n *\r\n * Use this in BOTH the core clip-duration math and the cross-scene end resolution\r\n * so the timeline reserves exactly the span the renderer plays.\r\n */\r\nexport function integrateSpeedToClipTime(\r\n speed: Curve,\r\n sourceLength: number,\r\n upper: number = sourceLength,\r\n step = INTEGRATION_STEP,\r\n): number {\r\n const end = Math.min(upper, sourceLength);\r\n if (end <= 0) return 0;\r\n let clipTime = 0;\r\n for (let tau = 0; tau < end; tau += step) {\r\n const dt = Math.min(step, end - tau);\r\n const v = Math.max(1e-6, speed.sampleAt(tau + dt / 2, sourceLength, 1));\r\n clipTime += dt / v;\r\n }\r\n return clipTime;\r\n}\r\n\r\n/**\r\n * Inverse of {@link integrateSpeedToClipTime}: the source-time offset reached\r\n * after `clipElapsed` seconds of clip time under the speed curve. This is what a\r\n * mid-clip seek needs to compute the correct buffer offset for a speed-curved clip.\r\n * The curve is always resolved against the full `sourceLength`.\r\n */\r\nexport function sourceTimeAtClipElapsed(\r\n speed: Curve,\r\n sourceLength: number,\r\n clipElapsed: number,\r\n step = INTEGRATION_STEP,\r\n): number {\r\n if (clipElapsed <= 0) return 0;\r\n let played = 0;\r\n let tau = 0;\r\n while (tau < sourceLength) {\r\n const dt = Math.min(step, sourceLength - tau);\r\n const v = Math.max(1e-6, speed.sampleAt(tau + dt / 2, sourceLength, 1));\r\n const clipStep = dt / v;\r\n if (played + clipStep >= clipElapsed) {\r\n // Linear interpolation within this step for sub-step accuracy.\r\n const frac = clipStep > 0 ? (clipElapsed - played) / clipStep : 0;\r\n return tau + dt * frac;\r\n }\r\n played += clipStep;\r\n tau += dt;\r\n }\r\n return sourceLength;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"echo.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/echo.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAazD,MAAM,CAAC,MAAM,UAAU,GAAgC;IACnD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;QACzC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAClD,GAAG,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC;KACpD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC;CACtH,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\nimport { Param, lerpParam, equalsParam } from \"../curve\";\n\n/** Adds a delayed, fading repeat of the signal (a feedback echo / simple delay). */\nexport interface EchoFilter {\n type: 'echo';\n /** Delay before the first repeat, in seconds. May be a time-varying curve. */\n delay: Param;\n /** Feedback amount, 0–<1. Each repeat is scaled by this; higher = more repeats. May be a time-varying curve. */\n feedback: Param;\n /** Wet/dry mix, 0–1. 0 = dry only, 1 = full wet. Default 0.5. May be a time-varying curve. */\n mix?: Param;\n}\n\nexport const echoFilter: AudioFilterData<EchoFilter> = {\n lerp: (from, to, t) => ({\n type: \"echo\",\n delay: lerpParam(from.delay, to.delay, t),\n feedback: lerpParam(from.feedback, to.feedback, t),\n mix: lerpParam(from.mix ?? 0.5, to.mix ?? 0.5, t),\n }),\n equals: (a, b) =>\n equalsParam(a.delay, b.delay) && equalsParam(a.feedback, b.feedback) && equalsParam(a.mix ?? 0.5, b.mix ?? 0.5),\n};\n"]}
1
+ {"version":3,"file":"echo.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/echo.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAazD,MAAM,CAAC,MAAM,UAAU,GAAgC;IACnD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;QACzC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAClD,GAAG,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC;KACpD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC;CACtH,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\r\nimport { Param, lerpParam, equalsParam } from \"../curve\";\r\n\r\n/** Adds a delayed, fading repeat of the signal (a feedback echo / simple delay). */\r\nexport interface EchoFilter {\r\n type: 'echo';\r\n /** Delay before the first repeat, in seconds. May be a time-varying curve. */\r\n delay: Param;\r\n /** Feedback amount, 0–<1. Each repeat is scaled by this; higher = more repeats. May be a time-varying curve. */\r\n feedback: Param;\r\n /** Wet/dry mix, 0–1. 0 = dry only, 1 = full wet. Default 0.5. May be a time-varying curve. */\r\n mix?: Param;\r\n}\r\n\r\nexport const echoFilter: AudioFilterData<EchoFilter> = {\r\n lerp: (from, to, t) => ({\r\n type: \"echo\",\r\n delay: lerpParam(from.delay, to.delay, t),\r\n feedback: lerpParam(from.feedback, to.feedback, t),\r\n mix: lerpParam(from.mix ?? 0.5, to.mix ?? 0.5, t),\r\n }),\r\n equals: (a, b) =>\r\n equalsParam(a.delay, b.delay) && equalsParam(a.feedback, b.feedback) && equalsParam(a.mix ?? 0.5, b.mix ?? 0.5),\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"gain.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/gain.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AASzD,MAAM,CAAC,MAAM,UAAU,GAAgC;IACnD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;IACpF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;CAClD,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\nimport { Param, lerpParam, equalsParam } from \"../curve\";\n\n/** Scales the clip's amplitude by a linear factor. */\nexport interface GainFilter {\n type: 'gain';\n /** Linear gain multiplier. 1 = unchanged, 0 = silent, >1 = louder. May be a time-varying curve. */\n value: Param;\n}\n\nexport const gainFilter: AudioFilterData<GainFilter> = {\n lerp: (from, to, t) => ({ type: \"gain\", value: lerpParam(from.value, to.value, t) }),\n equals: (a, b) => equalsParam(a.value, b.value),\n};\n"]}
1
+ {"version":3,"file":"gain.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/gain.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AASzD,MAAM,CAAC,MAAM,UAAU,GAAgC;IACnD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;IACpF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;CAClD,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\r\nimport { Param, lerpParam, equalsParam } from \"../curve\";\r\n\r\n/** Scales the clip's amplitude by a linear factor. */\r\nexport interface GainFilter {\r\n type: 'gain';\r\n /** Linear gain multiplier. 1 = unchanged, 0 = silent, >1 = louder. May be a time-varying curve. */\r\n value: Param;\r\n}\r\n\r\nexport const gainFilter: AudioFilterData<GainFilter> = {\r\n lerp: (from, to, t) => ({ type: \"gain\", value: lerpParam(from.value, to.value, t) }),\r\n equals: (a, b) => equalsParam(a.value, b.value),\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"highpass.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/highpass.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAWzD,MAAM,CAAC,MAAM,cAAc,GAAoC;IAC3D,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;QACrD,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KAC1C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;CAC7F,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\nimport { Param, lerpParam, equalsParam } from \"../curve\";\n\n/** Attenuates frequencies below `frequency`, passing the highs through. */\nexport interface HighPassFilter {\n type: 'highpass';\n /** Cutoff frequency in Hz. Content below this is rolled off. May be a time-varying curve. */\n frequency: Param;\n /** Resonance (Q) at the cutoff. Default 1. May be a time-varying curve. */\n q?: Param;\n}\n\nexport const highPassFilter: AudioFilterData<HighPassFilter> = {\n lerp: (from, to, t) => ({\n type: \"highpass\",\n frequency: lerpParam(from.frequency, to.frequency, t),\n q: lerpParam(from.q ?? 1, to.q ?? 1, t),\n }),\n equals: (a, b) => equalsParam(a.frequency, b.frequency) && equalsParam(a.q ?? 1, b.q ?? 1),\n};\n"]}
1
+ {"version":3,"file":"highpass.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/highpass.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAWzD,MAAM,CAAC,MAAM,cAAc,GAAoC;IAC3D,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;QACrD,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KAC1C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;CAC7F,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\r\nimport { Param, lerpParam, equalsParam } from \"../curve\";\r\n\r\n/** Attenuates frequencies below `frequency`, passing the highs through. */\r\nexport interface HighPassFilter {\r\n type: 'highpass';\r\n /** Cutoff frequency in Hz. Content below this is rolled off. May be a time-varying curve. */\r\n frequency: Param;\r\n /** Resonance (Q) at the cutoff. Default 1. May be a time-varying curve. */\r\n q?: Param;\r\n}\r\n\r\nexport const highPassFilter: AudioFilterData<HighPassFilter> = {\r\n lerp: (from, to, t) => ({\r\n type: \"highpass\",\r\n frequency: lerpParam(from.frequency, to.frequency, t),\r\n q: lerpParam(from.q ?? 1, to.q ?? 1, t),\r\n }),\r\n equals: (a, b) => equalsParam(a.frequency, b.frequency) && equalsParam(a.q ?? 1, b.q ?? 1),\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"lowpass.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/lowpass.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAWzD,MAAM,CAAC,MAAM,aAAa,GAAmC;IACzD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;QACrD,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KAC1C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;CAC7F,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\nimport { Param, lerpParam, equalsParam } from \"../curve\";\n\n/** Attenuates frequencies above `frequency`, passing the lows through. */\nexport interface LowPassFilter {\n type: 'lowpass';\n /** Cutoff frequency in Hz. Content above this is rolled off. May be a time-varying curve. */\n frequency: Param;\n /** Resonance (Q) at the cutoff. Default 1. May be a time-varying curve. */\n q?: Param;\n}\n\nexport const lowPassFilter: AudioFilterData<LowPassFilter> = {\n lerp: (from, to, t) => ({\n type: \"lowpass\",\n frequency: lerpParam(from.frequency, to.frequency, t),\n q: lerpParam(from.q ?? 1, to.q ?? 1, t),\n }),\n equals: (a, b) => equalsParam(a.frequency, b.frequency) && equalsParam(a.q ?? 1, b.q ?? 1),\n};\n"]}
1
+ {"version":3,"file":"lowpass.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/lowpass.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAWzD,MAAM,CAAC,MAAM,aAAa,GAAmC;IACzD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;QACrD,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KAC1C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;CAC7F,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\r\nimport { Param, lerpParam, equalsParam } from \"../curve\";\r\n\r\n/** Attenuates frequencies above `frequency`, passing the lows through. */\r\nexport interface LowPassFilter {\r\n type: 'lowpass';\r\n /** Cutoff frequency in Hz. Content above this is rolled off. May be a time-varying curve. */\r\n frequency: Param;\r\n /** Resonance (Q) at the cutoff. Default 1. May be a time-varying curve. */\r\n q?: Param;\r\n}\r\n\r\nexport const lowPassFilter: AudioFilterData<LowPassFilter> = {\r\n lerp: (from, to, t) => ({\r\n type: \"lowpass\",\r\n frequency: lerpParam(from.frequency, to.frequency, t),\r\n q: lerpParam(from.q ?? 1, to.q ?? 1, t),\r\n }),\r\n equals: (a, b) => equalsParam(a.frequency, b.frequency) && equalsParam(a.q ?? 1, b.q ?? 1),\r\n};\r\n"]}
@@ -5,9 +5,9 @@ import { Param } from "../curve.js";
5
5
  * this alters both speed *and* pitch (the classic chipmunk / slow-mo effect) and
6
6
  * the clip occupies less/more time on the timeline accordingly.
7
7
  *
8
- * `value` may be a time-varying curve; when it is, the clip's scene-time length is
8
+ * `value` may be a time-varying curve; when it is, the clip's clip-time length is
9
9
  * the integral `∫ 1/speed(τ) dτ` rather than a simple division (see
10
- * `integrateSpeedToSceneTime` in `../curve`).
10
+ * `integrateSpeedToClipTime` in `../curve`).
11
11
  */
12
12
  export interface SpeedFilter {
13
13
  type: 'speed';
@@ -1 +1 @@
1
- {"version":3,"file":"speed.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/speed.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAiBzD,MAAM,CAAC,MAAM,WAAW,GAAiC;IACrD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;IACrF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;CAClD,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\nimport { Param, lerpParam, equalsParam } from \"../curve\";\n\n/**\n * Changes the clip's playback rate. Because Web Audio resamples on rate change,\n * this alters both speed *and* pitch (the classic chipmunk / slow-mo effect) and\n * the clip occupies less/more time on the timeline accordingly.\n *\n * `value` may be a time-varying curve; when it is, the clip's scene-time length is\n * the integral `∫ 1/speed(τ) dτ` rather than a simple division (see\n * `integrateSpeedToSceneTime` in `../curve`).\n */\nexport interface SpeedFilter {\n type: 'speed';\n /** Playback-rate multiplier. 1 = unchanged, 2 = twice as fast, 0.5 = half speed. May be a time-varying curve. */\n value: Param;\n}\n\nexport const speedFilter: AudioFilterData<SpeedFilter> = {\n lerp: (from, to, t) => ({ type: \"speed\", value: lerpParam(from.value, to.value, t) }),\n equals: (a, b) => equalsParam(a.value, b.value),\n};\n"]}
1
+ {"version":3,"file":"speed.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/speed.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAiBzD,MAAM,CAAC,MAAM,WAAW,GAAiC;IACrD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;IACrF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;CAClD,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\r\nimport { Param, lerpParam, equalsParam } from \"../curve\";\r\n\r\n/**\r\n * Changes the clip's playback rate. Because Web Audio resamples on rate change,\r\n * this alters both speed *and* pitch (the classic chipmunk / slow-mo effect) and\r\n * the clip occupies less/more time on the timeline accordingly.\r\n *\r\n * `value` may be a time-varying curve; when it is, the clip's clip-time length is\r\n * the integral `∫ 1/speed(τ) dτ` rather than a simple division (see\r\n * `integrateSpeedToClipTime` in `../curve`).\r\n */\r\nexport interface SpeedFilter {\r\n type: 'speed';\r\n /** Playback-rate multiplier. 1 = unchanged, 2 = twice as fast, 0.5 = half speed. May be a time-varying curve. */\r\n value: Param;\r\n}\r\n\r\nexport const speedFilter: AudioFilterData<SpeedFilter> = {\r\n lerp: (from, to, t) => ({ type: \"speed\", value: lerpParam(from.value, to.value, t) }),\r\n equals: (a, b) => equalsParam(a.value, b.value),\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"tremolo.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/tremolo.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAWzD,MAAM,CAAC,MAAM,aAAa,GAAmC;IACzD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QACtC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;KAC5C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;CACjF,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\nimport { Param, lerpParam, equalsParam } from \"../curve\";\n\n/** Modulates the clip's amplitude with a low-frequency oscillator for a wobble effect. */\nexport interface TremoloFilter {\n type: 'tremolo';\n /** Modulation rate in Hz (how fast the volume pulses). May be a time-varying curve. */\n rate: Param;\n /** Modulation depth, 0–1. 0 = no effect, 1 = full dips to silence. May be a time-varying curve. */\n depth: Param;\n}\n\nexport const tremoloFilter: AudioFilterData<TremoloFilter> = {\n lerp: (from, to, t) => ({\n type: \"tremolo\",\n rate: lerpParam(from.rate, to.rate, t),\n depth: lerpParam(from.depth, to.depth, t),\n }),\n equals: (a, b) => equalsParam(a.rate, b.rate) && equalsParam(a.depth, b.depth),\n};\n"]}
1
+ {"version":3,"file":"tremolo.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/tremolo.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAWzD,MAAM,CAAC,MAAM,aAAa,GAAmC;IACzD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QACtC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;KAC5C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;CACjF,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\r\nimport { Param, lerpParam, equalsParam } from \"../curve\";\r\n\r\n/** Modulates the clip's amplitude with a low-frequency oscillator for a wobble effect. */\r\nexport interface TremoloFilter {\r\n type: 'tremolo';\r\n /** Modulation rate in Hz (how fast the volume pulses). May be a time-varying curve. */\r\n rate: Param;\r\n /** Modulation depth, 0–1. 0 = no effect, 1 = full dips to silence. May be a time-varying curve. */\r\n depth: Param;\r\n}\r\n\r\nexport const tremoloFilter: AudioFilterData<TremoloFilter> = {\r\n lerp: (from, to, t) => ({\r\n type: \"tremolo\",\r\n rate: lerpParam(from.rate, to.rate, t),\r\n depth: lerpParam(from.depth, to.depth, t),\r\n }),\r\n equals: (a, b) => equalsParam(a.rate, b.rate) && equalsParam(a.depth, b.depth),\r\n};\r\n"]}
@@ -11,7 +11,7 @@ export type { AudioFilter } from './chain.js';
11
11
  /** Per-builder options. Each builder takes one of these, or its dominant `Param`. */
12
12
  export type { GainFilterOptions, HighPassFilterOptions, LowPassFilterOptions, TremoloFilterOptions, SpeedFilterOptions, EchoFilterOptions, } from './chain.js';
13
13
  /** Time-varying param curves: builders, the Curve type, and param helpers. */
14
- export { Curve, ramp, hold, fadeIn, fadeOut, isCurve, staticValue, lerpParam, equalsParam, integrateSpeedToSceneTime, sourceTimeAtSceneElapsed, audioParamOps, } from './curve.js';
14
+ export { Curve, ramp, hold, fadeIn, fadeOut, isCurve, staticValue, lerpParam, equalsParam, integrateSpeedToClipTime, sourceTimeAtClipElapsed, audioParamOps, } from './curve.js';
15
15
  export type { Param, CurveSegment, ResolvedSegment } from './curve.js';
16
16
  /** Union of all concrete audio-filter types accepted by sounds. */
17
17
  export type { AudioFilterItem } from './union.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,qFAAqF;AACrF,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9E,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,qFAAqF;AACrF,YAAY,EACR,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,GACpB,MAAM,SAAS,CAAC;AAEjB,8EAA8E;AAC9E,OAAO,EACH,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,OAAO,EACP,OAAO,EACP,WAAW,EACX,SAAS,EACT,WAAW,EACX,yBAAyB,EACzB,wBAAwB,EACxB,aAAa,GAChB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpE,mEAAmE;AACnE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC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AAErC,oDAAoD;AACpD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /** Chainable filter builder API, chain class, and loose author-facing union type. */
2
2
  export { AudioFilters, AudioFilterChain, resolveAudioFilters } from './chain.js';
3
3
  /** Time-varying param curves: builders, the Curve type, and param helpers. */
4
- export { Curve, ramp, hold, fadeIn, fadeOut, isCurve, staticValue, lerpParam, equalsParam, integrateSpeedToSceneTime, sourceTimeAtSceneElapsed, audioParamOps, } from './curve.js';
4
+ export { Curve, ramp, hold, fadeIn, fadeOut, isCurve, staticValue, lerpParam, equalsParam, integrateSpeedToClipTime, sourceTimeAtClipElapsed, audioParamOps, } from './curve.js';
5
5
  export { filtersKey } from './union.js';
6
6
  /** Interpolation/equality registry and contract. */
7
7
  export { AudioFilterRegistry, audioFiltersOps } from './registry.js';