@open-take/compositor 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (439) hide show
  1. package/dist/cdp-CzT5BKNY.js +3 -0
  2. package/dist/cdp-QXbQfXna.js +373 -0
  3. package/dist/cdp-QXbQfXna.js.map +1 -0
  4. package/dist/index.d.ts +4327 -195
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +26282 -160
  7. package/dist/index.js.map +1 -1
  8. package/dist/server-841PMF2H.js +163 -0
  9. package/dist/server-841PMF2H.js.map +1 -0
  10. package/dist/server-C2aVv4-t.js +3 -0
  11. package/kit/audio.mjs +2366 -0
  12. package/kit/camera.js +587 -0
  13. package/kit/cursor.js +264 -0
  14. package/kit/cut.js +427 -0
  15. package/kit/draw.js +346 -0
  16. package/kit/look.js +589 -0
  17. package/kit/map.js +170 -0
  18. package/kit/media.js +3568 -0
  19. package/kit/motion.js +1115 -0
  20. package/kit/seams.js +1006 -0
  21. package/kit/stage.js +923 -0
  22. package/kit/time.js +812 -0
  23. package/kit/world.js +1072 -0
  24. package/package.json +7 -3
  25. package/src/ffmpeg.ts +63 -0
  26. package/src/film/beats.ts +1285 -0
  27. package/src/film/carry.ts +221 -0
  28. package/src/film/changes.ts +330 -0
  29. package/src/film/check.ts +996 -0
  30. package/src/film/clock.ts +2530 -0
  31. package/src/film/components-probe.ts +809 -0
  32. package/src/film/components.ts +1566 -0
  33. package/src/film/frames.ts +389 -0
  34. package/src/film/gallery.ts +3276 -0
  35. package/src/film/kit.ts +515 -0
  36. package/src/film/layout.ts +701 -0
  37. package/src/film/listen.ts +1979 -0
  38. package/src/film/look.ts +3829 -0
  39. package/src/film/materials.ts +976 -0
  40. package/src/film/moving.ts +248 -0
  41. package/src/film/part-files.ts +729 -0
  42. package/src/film/picture.ts +74 -0
  43. package/src/film/probe-text.ts +843 -0
  44. package/src/film/probe.ts +3456 -0
  45. package/src/film/provenance.ts +596 -0
  46. package/src/film/render.ts +2447 -0
  47. package/src/film/report.ts +1631 -0
  48. package/src/film/sheet.ts +156 -0
  49. package/src/film/study-declared.ts +123 -0
  50. package/src/film/study-picture.ts +791 -0
  51. package/src/film/study-sound.ts +416 -0
  52. package/src/film/study.ts +864 -0
  53. package/src/film/tuning.ts +155 -0
  54. package/src/film/viewer.ts +174 -0
  55. package/src/html/cdp.ts +575 -0
  56. package/src/html/server.ts +208 -0
  57. package/src/index.ts +202 -0
  58. package/src/launch-render.ts +3 -2
  59. package/src/math.ts +3 -3
  60. package/src/mjpeg-matroska.ts +228 -0
  61. package/src/render.ts +6 -4
  62. package/src/state-diff.ts +215 -0
  63. package/src/state-index.ts +99 -0
  64. package/src/types.ts +59 -1
  65. package/starter/PLAN.md +84 -0
  66. package/starter/START.md +460 -0
  67. package/starter/lib/anim.js +760 -0
  68. package/starter/lib/devices.js +1402 -0
  69. package/starter/lib/handoff.js +421 -0
  70. package/starter/lib/hud.js +1879 -0
  71. package/starter/lib/measure.mjs +154 -0
  72. package/starter/lib/moves.js +1095 -0
  73. package/starter/lib/palette.mjs +803 -0
  74. package/starter/lib/physics-seeds.mjs +198 -0
  75. package/starter/lib/physics.js +738 -0
  76. package/starter/lib/sampler.mjs +242 -0
  77. package/starter/lib/solid.js +727 -0
  78. package/starter/lib/space.js +1227 -0
  79. package/starter/lib/swarm.js +1398 -0
  80. package/starter/reference/motion.md +276 -0
  81. package/starter/reference/structure.md +466 -0
  82. package/starter/reference/travel/motion.md +433 -0
  83. package/starter/reference/travel/sound.md +241 -0
  84. package/starter/reference/travel/structure.md +518 -0
  85. package/starter/samples/NOTICE.txt +55 -0
  86. package/starter/samples/celli/celli_24_1.opus +0 -0
  87. package/starter/samples/celli/celli_24_3.opus +0 -0
  88. package/starter/samples/celli/celli_28_1.opus +0 -0
  89. package/starter/samples/celli/celli_28_3.opus +0 -0
  90. package/starter/samples/celli/celli_31_1.opus +0 -0
  91. package/starter/samples/celli/celli_31_3.opus +0 -0
  92. package/starter/samples/celli/celli_35_1.opus +0 -0
  93. package/starter/samples/celli/celli_35_3.opus +0 -0
  94. package/starter/samples/celli/celli_38_1.opus +0 -0
  95. package/starter/samples/celli/celli_38_3.opus +0 -0
  96. package/starter/samples/celli/celli_41_1.opus +0 -0
  97. package/starter/samples/celli/celli_41_3.opus +0 -0
  98. package/starter/samples/celli/celli_45_1.opus +0 -0
  99. package/starter/samples/celli/celli_45_3.opus +0 -0
  100. package/starter/samples/celli/celli_48_1.opus +0 -0
  101. package/starter/samples/celli/celli_48_3.opus +0 -0
  102. package/starter/samples/celli/celli_52_1.opus +0 -0
  103. package/starter/samples/celli/celli_52_3.opus +0 -0
  104. package/starter/samples/celli/celli_55_1.opus +0 -0
  105. package/starter/samples/celli/celli_55_3.opus +0 -0
  106. package/starter/samples/celli/celli_59_1.opus +0 -0
  107. package/starter/samples/celli/celli_59_3.opus +0 -0
  108. package/starter/samples/celli/celli_62_1.opus +0 -0
  109. package/starter/samples/celli/celli_62_3.opus +0 -0
  110. package/starter/samples/celli/celli_65_1.opus +0 -0
  111. package/starter/samples/celli/celli_65_3.opus +0 -0
  112. package/starter/samples/crash/crash_f_1.flac +0 -0
  113. package/starter/samples/crash/crash_fff_1.flac +0 -0
  114. package/starter/samples/ebass/ebass_0_x.flac +0 -0
  115. package/starter/samples/ebass/ebass_10_x.flac +0 -0
  116. package/starter/samples/ebass/ebass_11_x.flac +0 -0
  117. package/starter/samples/ebass/ebass_1_x.flac +0 -0
  118. package/starter/samples/ebass/ebass_2_x.flac +0 -0
  119. package/starter/samples/ebass/ebass_3_x.flac +0 -0
  120. package/starter/samples/ebass/ebass_4_x.flac +0 -0
  121. package/starter/samples/ebass/ebass_5_x.flac +0 -0
  122. package/starter/samples/ebass/ebass_6_x.flac +0 -0
  123. package/starter/samples/ebass/ebass_7_x.flac +0 -0
  124. package/starter/samples/ebass/ebass_8_x.flac +0 -0
  125. package/starter/samples/ebass/ebass_9_x.flac +0 -0
  126. package/starter/samples/ek_clap/ek_clap_1_1.flac +0 -0
  127. package/starter/samples/ek_hat/ek_hat_1_1.flac +0 -0
  128. package/starter/samples/ek_hat/ek_hat_1_2.flac +0 -0
  129. package/starter/samples/ek_kick/ek_kick_1_1.flac +0 -0
  130. package/starter/samples/ek_kick/ek_kick_1_2.flac +0 -0
  131. package/starter/samples/glock/glock_67_x.flac +0 -0
  132. package/starter/samples/glock/glock_72_x.flac +0 -0
  133. package/starter/samples/glock/glock_79_x.flac +0 -0
  134. package/starter/samples/glock/glock_84_x.flac +0 -0
  135. package/starter/samples/glock/glock_91_x.flac +0 -0
  136. package/starter/samples/glock/glock_96_x.flac +0 -0
  137. package/starter/samples/harp/harp_101_f.opus +0 -0
  138. package/starter/samples/harp/harp_28_f.opus +0 -0
  139. package/starter/samples/harp/harp_31_mp.opus +0 -0
  140. package/starter/samples/harp/harp_35_mf.opus +0 -0
  141. package/starter/samples/harp/harp_38_mf.opus +0 -0
  142. package/starter/samples/harp/harp_41_mf.opus +0 -0
  143. package/starter/samples/harp/harp_45_mf.opus +0 -0
  144. package/starter/samples/harp/harp_48_mf.opus +0 -0
  145. package/starter/samples/harp/harp_52_mf.opus +0 -0
  146. package/starter/samples/harp/harp_55_mf.opus +0 -0
  147. package/starter/samples/harp/harp_59_mf.opus +0 -0
  148. package/starter/samples/harp/harp_62_mf.opus +0 -0
  149. package/starter/samples/harp/harp_65_mf.opus +0 -0
  150. package/starter/samples/harp/harp_69_mf.opus +0 -0
  151. package/starter/samples/harp/harp_72_mf.opus +0 -0
  152. package/starter/samples/harp/harp_76_mf.opus +0 -0
  153. package/starter/samples/harp/harp_79_mf.opus +0 -0
  154. package/starter/samples/harp/harp_83_mf.opus +0 -0
  155. package/starter/samples/harp/harp_86_mf.opus +0 -0
  156. package/starter/samples/harp/harp_89_mf.opus +0 -0
  157. package/starter/samples/harp/harp_93_mf.opus +0 -0
  158. package/starter/samples/harp/harp_95_mf.opus +0 -0
  159. package/starter/samples/harp/harp_98_f.opus +0 -0
  160. package/starter/samples/manifest.json +2951 -0
  161. package/starter/samples/marimba/marimba_29_x.flac +0 -0
  162. package/starter/samples/marimba/marimba_36_x.flac +0 -0
  163. package/starter/samples/marimba/marimba_43_x.flac +0 -0
  164. package/starter/samples/marimba/marimba_47_x.flac +0 -0
  165. package/starter/samples/marimba/marimba_53_x.flac +0 -0
  166. package/starter/samples/marimba/marimba_60_x.flac +0 -0
  167. package/starter/samples/marimba/marimba_67_x.flac +0 -0
  168. package/starter/samples/marimba/marimba_71_x.flac +0 -0
  169. package/starter/samples/marimba/marimba_77_x.flac +0 -0
  170. package/starter/samples/marimba/marimba_84_x.flac +0 -0
  171. package/starter/samples/piano/piano_102_12.opus +0 -0
  172. package/starter/samples/piano/piano_102_16.opus +0 -0
  173. package/starter/samples/piano/piano_102_4.opus +0 -0
  174. package/starter/samples/piano/piano_102_8.opus +0 -0
  175. package/starter/samples/piano/piano_105_12.opus +0 -0
  176. package/starter/samples/piano/piano_105_16.opus +0 -0
  177. package/starter/samples/piano/piano_105_4.opus +0 -0
  178. package/starter/samples/piano/piano_105_8.opus +0 -0
  179. package/starter/samples/piano/piano_108_12.opus +0 -0
  180. package/starter/samples/piano/piano_108_16.opus +0 -0
  181. package/starter/samples/piano/piano_108_4.opus +0 -0
  182. package/starter/samples/piano/piano_108_8.opus +0 -0
  183. package/starter/samples/piano/piano_21_12.opus +0 -0
  184. package/starter/samples/piano/piano_21_16.opus +0 -0
  185. package/starter/samples/piano/piano_21_4.opus +0 -0
  186. package/starter/samples/piano/piano_21_8.opus +0 -0
  187. package/starter/samples/piano/piano_24_12.opus +0 -0
  188. package/starter/samples/piano/piano_24_16.opus +0 -0
  189. package/starter/samples/piano/piano_24_4.opus +0 -0
  190. package/starter/samples/piano/piano_24_8.opus +0 -0
  191. package/starter/samples/piano/piano_27_12.opus +0 -0
  192. package/starter/samples/piano/piano_27_16.opus +0 -0
  193. package/starter/samples/piano/piano_27_4.opus +0 -0
  194. package/starter/samples/piano/piano_27_8.opus +0 -0
  195. package/starter/samples/piano/piano_30_12.opus +0 -0
  196. package/starter/samples/piano/piano_30_16.opus +0 -0
  197. package/starter/samples/piano/piano_30_4.opus +0 -0
  198. package/starter/samples/piano/piano_30_8.opus +0 -0
  199. package/starter/samples/piano/piano_33_12.opus +0 -0
  200. package/starter/samples/piano/piano_33_16.opus +0 -0
  201. package/starter/samples/piano/piano_33_4.opus +0 -0
  202. package/starter/samples/piano/piano_33_8.opus +0 -0
  203. package/starter/samples/piano/piano_36_12.opus +0 -0
  204. package/starter/samples/piano/piano_36_16.opus +0 -0
  205. package/starter/samples/piano/piano_36_4.opus +0 -0
  206. package/starter/samples/piano/piano_36_8.opus +0 -0
  207. package/starter/samples/piano/piano_39_12.opus +0 -0
  208. package/starter/samples/piano/piano_39_16.opus +0 -0
  209. package/starter/samples/piano/piano_39_4.opus +0 -0
  210. package/starter/samples/piano/piano_39_8.opus +0 -0
  211. package/starter/samples/piano/piano_42_12.opus +0 -0
  212. package/starter/samples/piano/piano_42_16.opus +0 -0
  213. package/starter/samples/piano/piano_42_4.opus +0 -0
  214. package/starter/samples/piano/piano_42_8.opus +0 -0
  215. package/starter/samples/piano/piano_45_12.opus +0 -0
  216. package/starter/samples/piano/piano_45_16.opus +0 -0
  217. package/starter/samples/piano/piano_45_4.opus +0 -0
  218. package/starter/samples/piano/piano_45_8.opus +0 -0
  219. package/starter/samples/piano/piano_48_12.opus +0 -0
  220. package/starter/samples/piano/piano_48_16.opus +0 -0
  221. package/starter/samples/piano/piano_48_4.opus +0 -0
  222. package/starter/samples/piano/piano_48_8.opus +0 -0
  223. package/starter/samples/piano/piano_51_12.opus +0 -0
  224. package/starter/samples/piano/piano_51_16.opus +0 -0
  225. package/starter/samples/piano/piano_51_4.opus +0 -0
  226. package/starter/samples/piano/piano_51_8.opus +0 -0
  227. package/starter/samples/piano/piano_54_12.opus +0 -0
  228. package/starter/samples/piano/piano_54_16.opus +0 -0
  229. package/starter/samples/piano/piano_54_4.opus +0 -0
  230. package/starter/samples/piano/piano_54_8.opus +0 -0
  231. package/starter/samples/piano/piano_57_12.opus +0 -0
  232. package/starter/samples/piano/piano_57_16.opus +0 -0
  233. package/starter/samples/piano/piano_57_4.opus +0 -0
  234. package/starter/samples/piano/piano_57_8.opus +0 -0
  235. package/starter/samples/piano/piano_60_12.opus +0 -0
  236. package/starter/samples/piano/piano_60_16.opus +0 -0
  237. package/starter/samples/piano/piano_60_4.opus +0 -0
  238. package/starter/samples/piano/piano_60_8.opus +0 -0
  239. package/starter/samples/piano/piano_63_12.opus +0 -0
  240. package/starter/samples/piano/piano_63_16.opus +0 -0
  241. package/starter/samples/piano/piano_63_4.opus +0 -0
  242. package/starter/samples/piano/piano_63_8.opus +0 -0
  243. package/starter/samples/piano/piano_66_12.opus +0 -0
  244. package/starter/samples/piano/piano_66_16.opus +0 -0
  245. package/starter/samples/piano/piano_66_4.opus +0 -0
  246. package/starter/samples/piano/piano_66_8.opus +0 -0
  247. package/starter/samples/piano/piano_69_12.opus +0 -0
  248. package/starter/samples/piano/piano_69_16.opus +0 -0
  249. package/starter/samples/piano/piano_69_4.opus +0 -0
  250. package/starter/samples/piano/piano_69_8.opus +0 -0
  251. package/starter/samples/piano/piano_72_12.opus +0 -0
  252. package/starter/samples/piano/piano_72_16.opus +0 -0
  253. package/starter/samples/piano/piano_72_4.opus +0 -0
  254. package/starter/samples/piano/piano_72_8.opus +0 -0
  255. package/starter/samples/piano/piano_75_12.opus +0 -0
  256. package/starter/samples/piano/piano_75_16.opus +0 -0
  257. package/starter/samples/piano/piano_75_4.opus +0 -0
  258. package/starter/samples/piano/piano_75_8.opus +0 -0
  259. package/starter/samples/piano/piano_78_12.opus +0 -0
  260. package/starter/samples/piano/piano_78_16.opus +0 -0
  261. package/starter/samples/piano/piano_78_4.opus +0 -0
  262. package/starter/samples/piano/piano_78_8.opus +0 -0
  263. package/starter/samples/piano/piano_81_12.opus +0 -0
  264. package/starter/samples/piano/piano_81_16.opus +0 -0
  265. package/starter/samples/piano/piano_81_4.opus +0 -0
  266. package/starter/samples/piano/piano_81_8.opus +0 -0
  267. package/starter/samples/piano/piano_84_12.opus +0 -0
  268. package/starter/samples/piano/piano_84_16.opus +0 -0
  269. package/starter/samples/piano/piano_84_4.opus +0 -0
  270. package/starter/samples/piano/piano_84_8.opus +0 -0
  271. package/starter/samples/piano/piano_87_12.opus +0 -0
  272. package/starter/samples/piano/piano_87_16.opus +0 -0
  273. package/starter/samples/piano/piano_87_4.opus +0 -0
  274. package/starter/samples/piano/piano_87_8.opus +0 -0
  275. package/starter/samples/piano/piano_90_12.opus +0 -0
  276. package/starter/samples/piano/piano_90_16.opus +0 -0
  277. package/starter/samples/piano/piano_90_4.opus +0 -0
  278. package/starter/samples/piano/piano_90_8.opus +0 -0
  279. package/starter/samples/piano/piano_93_12.opus +0 -0
  280. package/starter/samples/piano/piano_93_16.opus +0 -0
  281. package/starter/samples/piano/piano_93_4.opus +0 -0
  282. package/starter/samples/piano/piano_93_8.opus +0 -0
  283. package/starter/samples/piano/piano_96_12.opus +0 -0
  284. package/starter/samples/piano/piano_96_16.opus +0 -0
  285. package/starter/samples/piano/piano_96_4.opus +0 -0
  286. package/starter/samples/piano/piano_96_8.opus +0 -0
  287. package/starter/samples/piano/piano_99_12.opus +0 -0
  288. package/starter/samples/piano/piano_99_16.opus +0 -0
  289. package/starter/samples/piano/piano_99_4.opus +0 -0
  290. package/starter/samples/piano/piano_99_8.opus +0 -0
  291. package/starter/samples/piano/piano_rel_102_x.opus +0 -0
  292. package/starter/samples/piano/piano_rel_105_x.opus +0 -0
  293. package/starter/samples/piano/piano_rel_108_x.opus +0 -0
  294. package/starter/samples/piano/piano_rel_21_x.opus +0 -0
  295. package/starter/samples/piano/piano_rel_24_x.opus +0 -0
  296. package/starter/samples/piano/piano_rel_27_x.opus +0 -0
  297. package/starter/samples/piano/piano_rel_30_x.opus +0 -0
  298. package/starter/samples/piano/piano_rel_33_x.opus +0 -0
  299. package/starter/samples/piano/piano_rel_36_x.opus +0 -0
  300. package/starter/samples/piano/piano_rel_39_x.opus +0 -0
  301. package/starter/samples/piano/piano_rel_42_x.opus +0 -0
  302. package/starter/samples/piano/piano_rel_45_x.opus +0 -0
  303. package/starter/samples/piano/piano_rel_48_x.opus +0 -0
  304. package/starter/samples/piano/piano_rel_51_x.opus +0 -0
  305. package/starter/samples/piano/piano_rel_54_x.opus +0 -0
  306. package/starter/samples/piano/piano_rel_57_x.opus +0 -0
  307. package/starter/samples/piano/piano_rel_60_x.opus +0 -0
  308. package/starter/samples/piano/piano_rel_63_x.opus +0 -0
  309. package/starter/samples/piano/piano_rel_66_x.opus +0 -0
  310. package/starter/samples/piano/piano_rel_69_x.opus +0 -0
  311. package/starter/samples/piano/piano_rel_72_x.opus +0 -0
  312. package/starter/samples/piano/piano_rel_75_x.opus +0 -0
  313. package/starter/samples/piano/piano_rel_78_x.opus +0 -0
  314. package/starter/samples/piano/piano_rel_81_x.opus +0 -0
  315. package/starter/samples/piano/piano_rel_84_x.opus +0 -0
  316. package/starter/samples/piano/piano_rel_87_x.opus +0 -0
  317. package/starter/samples/piano/piano_rel_90_x.opus +0 -0
  318. package/starter/samples/piano/piano_rel_93_x.opus +0 -0
  319. package/starter/samples/piano/piano_rel_96_x.opus +0 -0
  320. package/starter/samples/piano/piano_rel_99_x.opus +0 -0
  321. package/starter/samples/pizz/pizz_24_2.flac +0 -0
  322. package/starter/samples/pizz/pizz_28_2.flac +0 -0
  323. package/starter/samples/pizz/pizz_31_2.flac +0 -0
  324. package/starter/samples/pizz/pizz_35_2.flac +0 -0
  325. package/starter/samples/pizz/pizz_38_2.flac +0 -0
  326. package/starter/samples/pizz/pizz_41_2.flac +0 -0
  327. package/starter/samples/pizz/pizz_45_2.flac +0 -0
  328. package/starter/samples/pizz/pizz_48_2.flac +0 -0
  329. package/starter/samples/pizz/pizz_52_2.flac +0 -0
  330. package/starter/samples/pizz/pizz_57_2.flac +0 -0
  331. package/starter/samples/pizz/pizz_60_2.flac +0 -0
  332. package/starter/samples/pizz/pizz_64_2.flac +0 -0
  333. package/starter/samples/pizz/pizz_67_2.flac +0 -0
  334. package/starter/samples/pizz/pizz_71_2.flac +0 -0
  335. package/starter/samples/pizz/pizz_74_2.flac +0 -0
  336. package/starter/samples/pk_hat/pk_hat_2_1.flac +0 -0
  337. package/starter/samples/pk_hat/pk_hat_2_2.flac +0 -0
  338. package/starter/samples/pk_hat/pk_hat_6_1.flac +0 -0
  339. package/starter/samples/pk_hat/pk_hat_6_2.flac +0 -0
  340. package/starter/samples/pk_kick/pk_kick_3_1.flac +0 -0
  341. package/starter/samples/pk_kick/pk_kick_3_2.flac +0 -0
  342. package/starter/samples/pk_kick/pk_kick_7_1.flac +0 -0
  343. package/starter/samples/pk_kick/pk_kick_7_2.flac +0 -0
  344. package/starter/samples/pk_ohat/pk_ohat_3_1.flac +0 -0
  345. package/starter/samples/pk_ohat/pk_ohat_3_2.flac +0 -0
  346. package/starter/samples/pk_ohat/pk_ohat_6_1.flac +0 -0
  347. package/starter/samples/pk_ohat/pk_ohat_6_2.flac +0 -0
  348. package/starter/samples/pk_rim/pk_rim_2_1.flac +0 -0
  349. package/starter/samples/pk_rim/pk_rim_2_2.flac +0 -0
  350. package/starter/samples/pk_rim/pk_rim_5_1.flac +0 -0
  351. package/starter/samples/pk_rim/pk_rim_5_2.flac +0 -0
  352. package/starter/samples/pk_snare/pk_snare_3_1.flac +0 -0
  353. package/starter/samples/pk_snare/pk_snare_3_2.flac +0 -0
  354. package/starter/samples/pk_snare/pk_snare_7_1.flac +0 -0
  355. package/starter/samples/pk_snare/pk_snare_7_2.flac +0 -0
  356. package/starter/samples/shaker/shaker_1_1.flac +0 -0
  357. package/starter/samples/shaker/shaker_2_1.flac +0 -0
  358. package/starter/samples/snap/snap_r_1.flac +0 -0
  359. package/starter/samples/snap/snap_r_2.flac +0 -0
  360. package/starter/samples/snap/snap_r_3.flac +0 -0
  361. package/starter/samples/snap/snap_r_4.flac +0 -0
  362. package/starter/samples/snap/snap_r_5.flac +0 -0
  363. package/starter/samples/snap/snap_r_6.flac +0 -0
  364. package/starter/samples/tom/tom_3_1.flac +0 -0
  365. package/starter/samples/tom/tom_3_2.flac +0 -0
  366. package/starter/samples/tom/tom_4_1.flac +0 -0
  367. package/starter/samples/tom/tom_4_2.flac +0 -0
  368. package/starter/samples/vibes/vibes_41_1.opus +0 -0
  369. package/starter/samples/vibes/vibes_41_2.opus +0 -0
  370. package/starter/samples/vibes/vibes_45_1.opus +0 -0
  371. package/starter/samples/vibes/vibes_45_2.opus +0 -0
  372. package/starter/samples/vibes/vibes_48_1.opus +0 -0
  373. package/starter/samples/vibes/vibes_48_2.opus +0 -0
  374. package/starter/samples/vibes/vibes_52_1.opus +0 -0
  375. package/starter/samples/vibes/vibes_52_2.opus +0 -0
  376. package/starter/samples/vibes/vibes_55_1.opus +0 -0
  377. package/starter/samples/vibes/vibes_55_2.opus +0 -0
  378. package/starter/samples/vibes/vibes_59_1.opus +0 -0
  379. package/starter/samples/vibes/vibes_59_2.opus +0 -0
  380. package/starter/samples/vibes/vibes_62_1.opus +0 -0
  381. package/starter/samples/vibes/vibes_62_2.opus +0 -0
  382. package/starter/samples/vibes/vibes_65_1.opus +0 -0
  383. package/starter/samples/vibes/vibes_65_2.opus +0 -0
  384. package/starter/samples/vibes/vibes_69_1.opus +0 -0
  385. package/starter/samples/vibes/vibes_69_2.opus +0 -0
  386. package/starter/samples/vibes/vibes_72_1.opus +0 -0
  387. package/starter/samples/vibes/vibes_72_2.opus +0 -0
  388. package/starter/samples/vibes/vibes_76_1.opus +0 -0
  389. package/starter/samples/vibes/vibes_76_2.opus +0 -0
  390. package/starter/samples/violas/violas_36_1.opus +0 -0
  391. package/starter/samples/violas/violas_36_2.opus +0 -0
  392. package/starter/samples/violas/violas_38_1.opus +0 -0
  393. package/starter/samples/violas/violas_38_2.opus +0 -0
  394. package/starter/samples/violas/violas_40_1.opus +0 -0
  395. package/starter/samples/violas/violas_40_2.opus +0 -0
  396. package/starter/samples/violas/violas_43_1.opus +0 -0
  397. package/starter/samples/violas/violas_43_2.opus +0 -0
  398. package/starter/samples/violas/violas_47_1.opus +0 -0
  399. package/starter/samples/violas/violas_47_2.opus +0 -0
  400. package/starter/samples/violas/violas_50_1.opus +0 -0
  401. package/starter/samples/violas/violas_50_2.opus +0 -0
  402. package/starter/samples/violas/violas_53_1.opus +0 -0
  403. package/starter/samples/violas/violas_53_2.opus +0 -0
  404. package/starter/samples/violas/violas_57_1.opus +0 -0
  405. package/starter/samples/violas/violas_57_2.opus +0 -0
  406. package/starter/samples/violas/violas_60_1.opus +0 -0
  407. package/starter/samples/violas/violas_60_2.opus +0 -0
  408. package/starter/samples/violas/violas_64_1.opus +0 -0
  409. package/starter/samples/violas/violas_64_2.opus +0 -0
  410. package/starter/samples/violas/violas_67_1.opus +0 -0
  411. package/starter/samples/violas/violas_67_2.opus +0 -0
  412. package/starter/samples/violas/violas_71_1.opus +0 -0
  413. package/starter/samples/violas/violas_71_2.opus +0 -0
  414. package/starter/samples/violas/violas_74_1.opus +0 -0
  415. package/starter/samples/violas/violas_74_2.opus +0 -0
  416. package/starter/samples/violins/violins_43_1.opus +0 -0
  417. package/starter/samples/violins/violins_43_2.opus +0 -0
  418. package/starter/samples/violins/violins_45_1.opus +0 -0
  419. package/starter/samples/violins/violins_45_2.opus +0 -0
  420. package/starter/samples/violins/violins_47_1.opus +0 -0
  421. package/starter/samples/violins/violins_47_2.opus +0 -0
  422. package/starter/samples/violins/violins_50_1.opus +0 -0
  423. package/starter/samples/violins/violins_50_2.opus +0 -0
  424. package/starter/samples/violins/violins_54_1.opus +0 -0
  425. package/starter/samples/violins/violins_54_2.opus +0 -0
  426. package/starter/samples/violins/violins_57_1.opus +0 -0
  427. package/starter/samples/violins/violins_57_2.opus +0 -0
  428. package/starter/samples/violins/violins_60_1.opus +0 -0
  429. package/starter/samples/violins/violins_60_2.opus +0 -0
  430. package/starter/samples/violins/violins_64_1.opus +0 -0
  431. package/starter/samples/violins/violins_64_2.opus +0 -0
  432. package/starter/samples/violins/violins_67_1.opus +0 -0
  433. package/starter/samples/violins/violins_67_2.opus +0 -0
  434. package/starter/samples/violins/violins_71_1.opus +0 -0
  435. package/starter/samples/violins/violins_71_2.opus +0 -0
  436. package/starter/samples/violins/violins_74_1.opus +0 -0
  437. package/starter/samples/violins/violins_74_2.opus +0 -0
  438. package/starter/samples/woodblock/woodblock_f_1.flac +0 -0
  439. package/starter/samples/woodblock/woodblock_f_2.flac +0 -0
@@ -0,0 +1,155 @@
1
+ // How in tune a film's pitched sound is: in each register, the strongest
2
+ // partial of each frame, how far it sits from the nearest semitone of the
3
+ // piece's own tuning (fitted on the whole sound, so a piece tuned a little
4
+ // off A440 throughout is in tune with itself). A sound whose notes mostly sit
5
+ // between semitones, or bend through them, is heard as out of tune even when
6
+ // every note was written right. Information only.
7
+
8
+ import { LISTEN_RATE, makeFft } from "./beats";
9
+
10
+ export type Register = {
11
+ name: string;
12
+ lo: number;
13
+ hi: number;
14
+ /** frames where a pitched sound led this register */
15
+ frames: number;
16
+ /** the share of those within 15 cents of the piece's tuning */
17
+ inTune: number;
18
+ /** their median distance from it, cents (signed: below is flat) */
19
+ offset: number;
20
+ };
21
+
22
+ export type Tuning = {
23
+ /** the piece's tuning against A440, cents (null: nothing pitched) */
24
+ reference: number | null;
25
+ registers: Register[];
26
+ };
27
+
28
+ const N = 8192; // 0.37 s: 2.7 Hz a bin
29
+ const HOP = 1024; // 46 ms
30
+ const REGISTERS: [string, number, number][] = [
31
+ ["low", 80, 400],
32
+ ["middle", 400, 1600],
33
+ ];
34
+
35
+ /** cents from the nearest semitone of A440, −50..50 */
36
+ const dev = (hz: number) => {
37
+ const c = 1200 * Math.log2(hz / 440);
38
+ return ((((c + 50) % 100) + 100) % 100) - 50;
39
+ };
40
+ const wrap = (c: number) => ((((c + 50) % 100) + 100) % 100) - 50;
41
+
42
+ export function tuning(pcm: Float32Array, rate = LISTEN_RATE): Tuning {
43
+ const fft = makeFft(N);
44
+ const hann = new Float64Array(N);
45
+ for (let i = 0; i < N; i++) hann[i] = 0.5 - 0.5 * Math.cos((2 * Math.PI * i) / N);
46
+ const re = new Float64Array(N);
47
+ const im = new Float64Array(N);
48
+ const binHz = rate / N;
49
+ // per register, per frame: the strongest peak's frequency, or null
50
+ const tracks = REGISTERS.map(() => [] as (number | null)[]);
51
+ for (let at = 0; at + N <= pcm.length; at += HOP) {
52
+ let sq = 0;
53
+ for (let i = 0; i < N; i++) {
54
+ const v = pcm[at + i]!;
55
+ re[i] = v * hann[i]!;
56
+ im[i] = 0;
57
+ sq += v * v;
58
+ }
59
+ const quiet = 10 * Math.log10(sq / N + 1e-12) < -45;
60
+ fft(re, im);
61
+ // the two strongest peaks from 40 to 400 Hz, whether or not they stand clear: the
62
+ // notes (a frame can hold the end of one and the start of the next) a higher
63
+ // register's peak may be a harmonic of
64
+ const mag = (k: number) => Math.hypot(re[k]!, im[k]!);
65
+ const lows: number[] = [];
66
+ for (let k = Math.ceil(40 / binHz); k <= Math.floor(400 / binHz); k++)
67
+ if (mag(k) >= mag(k - 1) && mag(k) >= mag(k + 1)) lows.push(k);
68
+ lows.sort((x, y) => mag(y) - mag(x));
69
+ const lowest = quiet ? [] : lows.slice(0, 2).map((k) => k * binHz);
70
+ register: for (const [r, [, lo, hi]] of REGISTERS.entries()) {
71
+ if (quiet) {
72
+ tracks[r]!.push(null);
73
+ continue;
74
+ }
75
+ const k0 = Math.max(2, Math.ceil(lo / binHz));
76
+ const k1 = Math.min(N / 2 - 2, Math.floor(hi / binHz));
77
+ const db = (k: number) => 20 * Math.log10(Math.hypot(re[k]!, im[k]!) + 1e-12);
78
+ let best = -1;
79
+ let bestDb = -Infinity;
80
+ const all: number[] = [];
81
+ for (let k = k0; k <= k1; k++) {
82
+ const d = db(k);
83
+ all.push(d);
84
+ if (d > bestDb && d >= db(k - 1) && d >= db(k + 1)) {
85
+ bestDb = d;
86
+ best = k;
87
+ }
88
+ }
89
+ all.sort((a, b) => a - b);
90
+ // a peak standing well above the register's floor: a pitched sound, not noise
91
+ if (best < 0 || bestDb - all[all.length >> 1]! < 20) {
92
+ tracks[r]!.push(null);
93
+ continue;
94
+ }
95
+ const a = db(best - 1);
96
+ const c = db(best + 1);
97
+ const f = (best + (0.5 * (a - c)) / (a - 2 * bestDb + c || 1)) * binHz;
98
+ // a higher register's strongest peak may be a harmonic of the note below it (a saw
99
+ // bass's 7th sits −31 cents from the scale): that frame says nothing of its tuning
100
+ const below = r > 0 ? lowest : [];
101
+ // (the peak below may itself be the 2nd or 3rd harmonic of a note lower still)
102
+ for (const b of below)
103
+ for (let m = 1; m <= 3; m++) {
104
+ const ratio = (f * m) / b;
105
+ const h = Math.round(ratio);
106
+ if (h >= 2 && h <= 12 && Math.abs(ratio / h - 1) <= 0.015) {
107
+ tracks[r]!.push(null);
108
+ continue register;
109
+ }
110
+ }
111
+ tracks[r]!.push(f);
112
+ }
113
+ }
114
+ // the piece's tuning: the circular mean of every frame's distance from A440's semitones
115
+ let sx = 0;
116
+ let sy = 0;
117
+ for (const t of tracks)
118
+ for (const f of t)
119
+ if (f) {
120
+ const ang = (dev(f) / 100) * 2 * Math.PI;
121
+ sx += Math.cos(ang);
122
+ sy += Math.sin(ang);
123
+ }
124
+ if (!sx && !sy) return { reference: null, registers: [] };
125
+ const reference = Math.round((Math.atan2(sy, sx) / (2 * Math.PI)) * 100);
126
+ const registers = REGISTERS.map(([name, lo, hi], r) => {
127
+ const ds = tracks[r]!.filter((f) => f != null).map((f) => wrap(dev(f) - reference));
128
+ const sorted = [...ds].sort((a, b) => a - b);
129
+ return {
130
+ name,
131
+ lo,
132
+ hi,
133
+ frames: ds.length,
134
+ inTune: ds.length
135
+ ? Math.round((ds.filter((d) => Math.abs(d) <= 15).length / ds.length) * 100) / 100
136
+ : 0,
137
+ offset: sorted.length ? Math.round(sorted[sorted.length >> 1]!) : 0,
138
+ };
139
+ });
140
+ return { reference, registers };
141
+ }
142
+
143
+ export function formatTuning(t: Tuning): string[] {
144
+ if (t.reference == null) return ["- tuning: nothing pitched stood out (not detected)"];
145
+ const L = [
146
+ `- tuning: the piece sits ${t.reference >= 0 ? "+" : ""}${t.reference} cents from A440 (estimated)`,
147
+ ];
148
+ for (const r of t.registers)
149
+ L.push(
150
+ r.frames < 20
151
+ ? `- ${r.name} register (${r.lo}–${r.hi} Hz): too little pitched sound to read (not detected)`
152
+ : `- ${r.name} register (${r.lo}–${r.hi} Hz): ${Math.round(r.inTune * 100)}% of its pitched frames within 15 cents of the piece's tuning (median ${r.offset >= 0 ? "+" : ""}${r.offset}) (estimated)`,
153
+ );
154
+ return L;
155
+ }
@@ -0,0 +1,174 @@
1
+ // `open-take film viewer`: a round for a first-time viewer — someone who has
2
+ // seen nothing of how the film was made watches it and says where they would
3
+ // scroll on. The film's author knows what every shot means; a viewer does not,
4
+ // and such a viewer has found in minutes what the author's own checks had
5
+ // not. This only sets
6
+ // the round up: a copy of the film and a brief in <film>.viewer/<n>/. Who
7
+ // watches is the author's to start — an agent given that brief and nothing
8
+ // else. The brief names no faults to look for: what the viewer notices on its
9
+ // own is the point. Only once that is written does it read what makes films
10
+ // look machine-made (`skill film tells`) and say which of those this one has.
11
+ //
12
+ // A viewer started as a fresh process has its own PATH and its own tool
13
+ // permissions. One round ran with no ffmpeg on PATH (open-take keeps its own
14
+ // under ~/.open-take, off PATH) and with its shell and file tools refused: it
15
+ // took no frame and wrote notes all the same. So the brief names the ffmpeg
16
+ // and ffprobe open-take itself uses by their full paths, the round says what
17
+ // the viewer must be allowed to do, the frames it looks at stay in the round's
18
+ // folder, and a round whose folder holds notes and not one frame is reported
19
+ // as a viewer that saw nothing (`film viewer <film> --check`, and the line a
20
+ // render prints).
21
+
22
+ import { existsSync } from "node:fs";
23
+ import { copyFile, mkdir, readdir, stat, writeFile } from "node:fs/promises";
24
+ import { basename, dirname, isAbsolute, join, resolve } from "node:path";
25
+ import { resolveFfmpeg, resolveFfprobe } from "../ffmpeg";
26
+
27
+ export type ViewerRound = {
28
+ /** the round's folder, <film>.viewer/<n>/ (absolute) */
29
+ dir: string;
30
+ /** 1 for the first round */
31
+ round: number;
32
+ /** the brief to hand to the viewer */
33
+ brief: string;
34
+ /** where the viewer writes what they felt */
35
+ notes: string;
36
+ /** the ffmpeg and ffprobe the brief names: a full path for open-take's own,
37
+ * the bare name when the one in use is on PATH already */
38
+ ffmpeg: string;
39
+ ffprobe: string;
40
+ };
41
+
42
+ /** What a viewer has to be allowed to do, in Claude Code's tool names: run
43
+ * ffmpeg and open-take (Bash), look at the frames (Read), write its notes
44
+ * and sheets (Write, Edit), find its files (Glob, Grep). */
45
+ export const VIEWER_TOOLS = ["Bash", "Read", "Write", "Edit", "Glob", "Grep"] as const;
46
+
47
+ export type ViewerRounds = {
48
+ /** rounds with the viewer's notes written, oldest first; `frames` is how
49
+ * many pictures are in the round's folder — 0 means it watched nothing */
50
+ done: { round: number; notes: string; filmMtimeMs: number; frames: number }[];
51
+ /** rounds set up whose notes are not there yet */
52
+ open: number[];
53
+ };
54
+
55
+ /** pictures under a folder, to any depth; counting stops at `limit` */
56
+ async function countPictures(dir: string, limit = 1000): Promise<number> {
57
+ let n = 0;
58
+ for (const e of await readdir(dir, { withFileTypes: true }).catch(() => [])) {
59
+ if (n >= limit) break;
60
+ if (e.isDirectory()) n += await countPictures(join(dir, e.name), limit - n);
61
+ else if (/\.(jpe?g|png|webp|gif|bmp)$/i.test(e.name)) n++;
62
+ }
63
+ return n;
64
+ }
65
+
66
+ const viewerDir = (film: string) => `${resolve(film).replace(/\.[^./]+$/, "")}.viewer`;
67
+
68
+ /** the rounds already set up beside a film */
69
+ export async function viewerRounds(film: string): Promise<ViewerRounds> {
70
+ const root = viewerDir(film);
71
+ const out: ViewerRounds = { done: [], open: [] };
72
+ if (!existsSync(root)) return out;
73
+ const rounds = (await readdir(root))
74
+ .filter((n) => /^\d+$/.test(n))
75
+ .map(Number)
76
+ .sort((a, b) => a - b);
77
+ for (const round of rounds) {
78
+ const notes = join(root, String(round), "VIEWER.md");
79
+ if (existsSync(notes))
80
+ out.done.push({
81
+ round,
82
+ notes,
83
+ filmMtimeMs:
84
+ (await stat(join(root, String(round), "film.mp4")).catch(() => null))?.mtimeMs ?? 0,
85
+ frames: await countPictures(join(root, String(round))),
86
+ });
87
+ else out.open.push(round);
88
+ }
89
+ return out;
90
+ }
91
+
92
+ /** The latest round's state, for `film viewer --check`: `ok` only when its
93
+ * notes are written and its folder holds at least one frame. */
94
+ export async function checkViewer(
95
+ film: string,
96
+ ): Promise<{ ok: boolean; round: number | null; dir: string | null; message: string }> {
97
+ const { done, open } = await viewerRounds(film);
98
+ const round = Math.max(0, ...done.map((d) => d.round), ...open);
99
+ if (!round)
100
+ return { ok: false, round: null, dir: null, message: "no viewer round has been set up for this film" };
101
+ const dir = join(viewerDir(film), String(round));
102
+ const last = done.find((d) => d.round === round);
103
+ if (!last)
104
+ return { ok: false, round, dir, message: `round ${round} has no VIEWER.md yet: the viewer has not finished, or never started` };
105
+ if (last.frames === 0)
106
+ return {
107
+ ok: false,
108
+ round,
109
+ dir,
110
+ message:
111
+ `THE VIEWER OF ROUND ${round} SAW NOTHING: ${dir} holds VIEWER.md and not one frame of the film. ` +
112
+ "Its notes are not a viewing; do not act on them. It could not run ffmpeg (not on its PATH) or was refused " +
113
+ "its shell or file tools. Start a new round and give the viewer what the command prints: the PATH and the tools.",
114
+ };
115
+ return { ok: true, round, dir, message: `round ${round}: notes written, ${last.frames >= 1000 ? "1000 or more" : last.frames} frame(s) and sheet(s) in ${dir}` };
116
+ }
117
+
118
+ export function viewerBrief(
119
+ filmCopy: string,
120
+ notes: string,
121
+ invoke = "npx open-take",
122
+ tools: { ffmpeg?: string; ffprobe?: string } = {},
123
+ ): string {
124
+ const dir = resolve(filmCopy, "..");
125
+ // a bare name is one found on PATH: there is no path to give, and none is needed
126
+ const at = [tools.ffmpeg && isAbsolute(tools.ffmpeg) ? `ffmpeg is at \`${tools.ffmpeg}\`` : "",
127
+ tools.ffprobe && isAbsolute(tools.ffprobe) ? `ffprobe at \`${tools.ffprobe}\`` : ""].filter(Boolean);
128
+ const where = at.length
129
+ ? `\n${at.join(" and ").replace(/^ffprobe at/, "ffprobe is at")}. They may not be on your PATH: call them by these paths.\n`
130
+ : "";
131
+ return `# Watch this film as a first-time viewer
132
+
133
+ You came across this film in a social feed. You have never heard of the product.
134
+ The film: ${filmCopy}
135
+
136
+ Watch it closely. You cannot see moving pictures, so take frames with ffmpeg / ffprobe — as dense as you can, denser where the picture moves — lay them out on sheets, read the words on screen, and look at how the sound changes. \`${invoke} film listen <film>\` lays the sound out against time (its beats, sections, loudness, and how far each cut sits from a sound) and \`${invoke} film probe <film>\` the picture (every cut, how much each frame changes, the zoom and travel); both describe, neither judges. Install whatever else you need. Keep every frame and sheet you look at in ${join(dir, "frames")}.
137
+ ${where}
138
+ If you cannot take a single frame — ffmpeg will not run, or you are refused the shell or the files — stop there: write in ${notes} only what stopped you, and nothing about the film. Notes on a film you did not see are worse than none.
139
+
140
+ Then write ${notes} for the person who made the film, in the language of the film's own words. Write what you honestly felt watching it: at which second, and why, you would scroll on or keep watching; what you did not understand, what bored you, what felt uncomfortable or forced; what was good. Most important first.
141
+
142
+ When that is written — not before — run \`${invoke} skill film tells\`: choices that make films look machine-made, each with when it is fine. Add a last section to ${notes}, "Looks machine-made", naming each one this film has, at which second and what is on screen, and whether it has a reason here. Leave out the ones it does not have, and leave what you wrote above as it was.
143
+
144
+ Work only in ${dir}. Do not read anything else about how the film was made, and do not look the product up.
145
+ `;
146
+ }
147
+
148
+ /** The command that starts a viewer as a fresh Claude Code session in the
149
+ * round's folder: open-take's ffmpeg and ffprobe first on its PATH, and the
150
+ * tools it needs allowed, so it is not left waiting on a permission no one
151
+ * is there to give. */
152
+ export function viewerCommand(v: Pick<ViewerRound, "dir" | "ffmpeg" | "ffprobe">): string {
153
+ const q = (s: string) => `'${s.replace(/'/g, "'\\''")}'`;
154
+ // only a tool named by its full path has a folder to add; one found on PATH is there already
155
+ const path = [...new Set([v.ffmpeg, v.ffprobe].filter((f) => isAbsolute(f)).map((f) => dirname(f)))].join(":");
156
+ return `cd ${q(v.dir)} && ${path ? `PATH=${q(path)}:"$PATH" ` : ""}claude -p --allowedTools "${VIEWER_TOOLS.join(" ")}" < BRIEF.md`;
157
+ }
158
+
159
+ /** sets up the next round: <film>.viewer/<n>/film.mp4 and BRIEF.md */
160
+ export async function prepareViewer(film: string, invoke?: string): Promise<ViewerRound> {
161
+ const src = resolve(film);
162
+ if (!existsSync(src)) throw new Error(`film viewer: ${film} not found`);
163
+ const { done, open } = await viewerRounds(src);
164
+ const round = Math.max(0, ...done.map((d) => d.round), ...open) + 1;
165
+ const dir = join(viewerDir(src), String(round));
166
+ await mkdir(dir, { recursive: true });
167
+ const copy = join(dir, `film${basename(src).match(/\.[^.]+$/)?.[0] ?? ".mp4"}`);
168
+ await copyFile(src, copy);
169
+ const notes = join(dir, "VIEWER.md");
170
+ const brief = join(dir, "BRIEF.md");
171
+ const [ffmpeg, ffprobe] = await Promise.all([resolveFfmpeg(), resolveFfprobe()]);
172
+ await writeFile(brief, viewerBrief(copy, notes, invoke, { ffmpeg, ffprobe }));
173
+ return { dir, round, brief, notes, ffmpeg, ffprobe };
174
+ }