sera-code 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/bin/sera.mjs +31 -0
- package/dist/bundle/chunks/{chunk-LOMPDCMP.js → chunk-DFRGGJWV.js} +1 -1
- package/dist/bundle/chunks/{chunk-AZC5WTED.js → chunk-EMXTNOOJ.js} +5 -5
- package/dist/bundle/chunks/{chunk-KXU77PUU.js → chunk-ET2ARYK4.js} +1 -1
- package/dist/bundle/chunks/{chunk-ZNCN2NGY.js → chunk-G5BGS7HZ.js} +2 -2
- package/dist/bundle/chunks/{chunk-HODJBMOY.js → chunk-GSGPISRE.js} +3 -4
- package/dist/bundle/chunks/{chunk-46WGNYIE.js → chunk-NMUS7OCP.js} +1 -1
- package/dist/bundle/chunks/{chunk-HQBQWHLD.js → chunk-RCQXVPCE.js} +1 -1
- package/dist/bundle/chunks/{cli-MML2DU4A.js → cli-NOCFT7AL.js} +1 -1
- package/dist/bundle/chunks/{execute-HXDNZ26B.js → execute-S2O3RL6V.js} +1 -1
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{runtime-JAH75CB5.js → runtime-BRT7AUXY.js} +1 -1
- package/dist/bundle/chunks/{virtual-modules-Z2V3PTLI.js → virtual-modules-QR2XYBMY.js} +1 -1
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/lib/postinstall.js +16 -0
- package/lib/update.js +85 -0
- package/lib/win-setup.js +96 -0
- package/package.json +4 -1
- package/sera-core/skills/ambalaj-tasarim/NOTICE +1 -0
- package/sera-core/skills/ambalaj-tasarim/SKILL.md +34 -0
- package/sera-core/skills/ambalaj-tasarim/dieline.mjs +17 -0
- package/sera-core/skills/ambalaj-tasarim/sera-pack.js +535 -0
- package/sera-core/skills/animasyonlu-site/NOTICE +1 -0
- package/sera-core/skills/animasyonlu-site/SKILL.md +26 -0
- package/sera-core/skills/animasyonlu-site/sera-motion.js +310 -0
- package/sera-core/skills/animate/LICENSE +21 -0
- package/sera-core/skills/animate/NOTICE +2 -0
- package/sera-core/skills/animate/RECIPES.md +324 -0
- package/sera-core/skills/animate/SKILL.md +209 -0
- package/sera-core/skills/astryx-ui/SKILL.md +37 -0
- package/sera-core/skills/awwwards/LICENSE +21 -0
- package/sera-core/skills/awwwards/NOTICE +5 -0
- package/sera-core/skills/awwwards/SKILL.md +357 -0
- package/sera-core/skills/awwwards/references/anatomy.md +103 -0
- package/sera-core/skills/awwwards/references/art-direction.md +114 -0
- package/sera-core/skills/awwwards/references/astro.md +235 -0
- package/sera-core/skills/awwwards/references/concepts.md +110 -0
- package/sera-core/skills/awwwards/references/content.md +88 -0
- package/sera-core/skills/awwwards/references/engine.md +751 -0
- package/sera-core/skills/awwwards/references/layout.md +81 -0
- package/sera-core/skills/awwwards/references/motion.md +463 -0
- package/sera-core/skills/awwwards/references/nextjs.md +386 -0
- package/sera-core/skills/awwwards/references/patterns.md +123 -0
- package/sera-core/skills/awwwards/references/quality-bar.md +151 -0
- package/sera-core/skills/awwwards/references/quality.md +91 -0
- package/sera-core/skills/awwwards/references/ship.md +36 -0
- package/sera-core/skills/awwwards/references/typography.md +135 -0
- package/sera-core/skills/awwwards/references/webgl.md +430 -0
- package/sera-core/skills/awwwards/scripts/audit.mjs +243 -0
- package/sera-core/skills/awwwards/scripts/browser.mjs +54 -0
- package/sera-core/skills/awwwards/scripts/font.mjs +87 -0
- package/sera-core/skills/awwwards/scripts/og.mjs +20 -0
- package/sera-core/skills/awwwards/scripts/photos.mjs +65 -0
- package/sera-core/skills/awwwards/scripts/serve.mjs +48 -0
- package/sera-core/skills/awwwards/scripts/shoot.mjs +675 -0
- package/sera-core/skills/beceri-yaz/SKILL.md +39 -0
- package/sera-core/skills/brag-slim/LICENSE +21 -0
- package/sera-core/skills/brag-slim/NOTICE +2 -0
- package/sera-core/skills/brag-slim/SKILL.md +108 -0
- package/sera-core/skills/brainstorming/LICENSE +21 -0
- package/sera-core/skills/brainstorming/NOTICE +5 -0
- package/sera-core/skills/brainstorming/SKILL.md +298 -0
- package/sera-core/skills/brainstorming/builder-check-prompt.md +23 -0
- package/sera-core/skills/copywriting/LICENSE +21 -0
- package/sera-core/skills/copywriting/NOTICE +5 -0
- package/sera-core/skills/copywriting/SKILL.md +343 -0
- package/sera-core/skills/copywriting/references/ai-tells.md +309 -0
- package/sera-core/skills/copywriting/references/copy-frameworks.md +432 -0
- package/sera-core/skills/copywriting/references/natural-transitions.md +256 -0
- package/sera-core/skills/cro/LICENSE +21 -0
- package/sera-core/skills/cro/NOTICE +5 -0
- package/sera-core/skills/cro/SKILL.md +198 -0
- package/sera-core/skills/cro/references/experiments.md +248 -0
- package/sera-core/skills/cro/references/form.md +422 -0
- package/sera-core/skills/derin-arastirma/referanslar/arastirma-yontem.md +11 -0
- package/sera-core/skills/emil-design-eng/LICENSE +21 -0
- package/sera-core/skills/emil-design-eng/NOTICE +2 -0
- package/sera-core/skills/emil-design-eng/SKILL.md +684 -0
- package/sera-core/skills/frontend-design/LICENSE.txt +177 -0
- package/sera-core/skills/frontend-design/NOTICE +2 -0
- package/sera-core/skills/frontend-design/SKILL.md +71 -0
- package/sera-core/skills/gorsel-denetim/SKILL.md +30 -0
- package/sera-core/skills/hallmark/LICENSE +21 -0
- package/sera-core/skills/hallmark/NOTICE +5 -0
- package/sera-core/skills/hallmark/SKILL.md +154 -0
- package/sera-core/skills/hallmark/references/anatomy.md +71 -0
- package/sera-core/skills/hallmark/references/brand-truth.md +40 -0
- package/sera-core/skills/hallmark/references/comp.md +104 -0
- package/sera-core/skills/hallmark/references/craft.md +116 -0
- package/sera-core/skills/hallmark/references/dark-mode.md +49 -0
- package/sera-core/skills/hallmark/references/data-viz.md +48 -0
- package/sera-core/skills/hallmark/references/design-md.md +53 -0
- package/sera-core/skills/hallmark/references/direction.md +52 -0
- package/sera-core/skills/hallmark/references/export-formats.md +80 -0
- package/sera-core/skills/hallmark/references/flow.md +131 -0
- package/sera-core/skills/hallmark/references/fonts.md +58 -0
- package/sera-core/skills/hallmark/references/gates.md +243 -0
- package/sera-core/skills/hallmark/references/genres/atmospheric.md +24 -0
- package/sera-core/skills/hallmark/references/genres/editorial.md +24 -0
- package/sera-core/skills/hallmark/references/genres/modern-minimal.md +24 -0
- package/sera-core/skills/hallmark/references/genres/playful.md +24 -0
- package/sera-core/skills/hallmark/references/imagery.md +99 -0
- package/sera-core/skills/hallmark/references/interaction-and-states.md +89 -0
- package/sera-core/skills/hallmark/references/layout.md +104 -0
- package/sera-core/skills/hallmark/references/macrostructures/01-bento-grid.md +21 -0
- package/sera-core/skills/hallmark/references/macrostructures/02-long-document.md +35 -0
- package/sera-core/skills/hallmark/references/macrostructures/03-marquee-hero.md +21 -0
- package/sera-core/skills/hallmark/references/macrostructures/04-stat-led.md +21 -0
- package/sera-core/skills/hallmark/references/macrostructures/05-workbench.md +21 -0
- package/sera-core/skills/hallmark/references/macrostructures/06-conversational-faq.md +28 -0
- package/sera-core/skills/hallmark/references/macrostructures/07-manifesto.md +28 -0
- package/sera-core/skills/hallmark/references/macrostructures/08-photographic.md +21 -0
- package/sera-core/skills/hallmark/references/macrostructures/09-quote-led.md +21 -0
- package/sera-core/skills/hallmark/references/macrostructures/10-specimen.md +21 -0
- package/sera-core/skills/hallmark/references/macrostructures/11-catalogue.md +21 -0
- package/sera-core/skills/hallmark/references/macrostructures/12-letter.md +21 -0
- package/sera-core/skills/hallmark/references/macrostructures/13-index-first.md +21 -0
- package/sera-core/skills/hallmark/references/macrostructures/14-narrative-workflow.md +21 -0
- package/sera-core/skills/hallmark/references/macrostructures/15-split-studio.md +21 -0
- package/sera-core/skills/hallmark/references/macrostructures/16-feature-stack.md +23 -0
- package/sera-core/skills/hallmark/references/macrostructures/17-type-specimen.md +19 -0
- package/sera-core/skills/hallmark/references/macrostructures/18-portfolio-grid.md +21 -0
- package/sera-core/skills/hallmark/references/macrostructures/19-map-diagram.md +21 -0
- package/sera-core/skills/hallmark/references/macrostructures/20-ecosystem-index.md +19 -0
- package/sera-core/skills/hallmark/references/macrostructures/21-component-playground.md +21 -0
- package/sera-core/skills/hallmark/references/macrostructures.md +119 -0
- package/sera-core/skills/hallmark/references/microinteractions.md +80 -0
- package/sera-core/skills/hallmark/references/patterns.md +202 -0
- package/sera-core/skills/hallmark/references/redesign.md +88 -0
- package/sera-core/skills/hallmark/references/responsive.md +46 -0
- package/sera-core/skills/hallmark/references/review-finish.md +19 -0
- package/sera-core/skills/hallmark/references/review-hero.md +20 -0
- package/sera-core/skills/hallmark/references/scroll-choreography.md +110 -0
- package/sera-core/skills/hallmark/references/texture.md +90 -0
- package/sera-core/skills/hallmark/references/themes/README.md +58 -0
- package/sera-core/skills/hallmark/references/themes/almanac.md +103 -0
- package/sera-core/skills/hallmark/references/themes/arcade.md +102 -0
- package/sera-core/skills/hallmark/references/themes/atelier.md +98 -0
- package/sera-core/skills/hallmark/references/themes/bloom.md +102 -0
- package/sera-core/skills/hallmark/references/themes/blueprint.md +103 -0
- package/sera-core/skills/hallmark/references/themes/broadside.md +108 -0
- package/sera-core/skills/hallmark/references/themes/brutal.md +95 -0
- package/sera-core/skills/hallmark/references/themes/carnival.md +104 -0
- package/sera-core/skills/hallmark/references/themes/cobalt.md +101 -0
- package/sera-core/skills/hallmark/references/themes/console.md +99 -0
- package/sera-core/skills/hallmark/references/themes/coral.md +102 -0
- package/sera-core/skills/hallmark/references/themes/darkroom.md +99 -0
- package/sera-core/skills/hallmark/references/themes/dose.md +98 -0
- package/sera-core/skills/hallmark/references/themes/dusk.md +105 -0
- package/sera-core/skills/hallmark/references/themes/editorial.md +97 -0
- package/sera-core/skills/hallmark/references/themes/formwork.md +107 -0
- package/sera-core/skills/hallmark/references/themes/furrow.md +98 -0
- package/sera-core/skills/hallmark/references/themes/garden.md +97 -0
- package/sera-core/skills/hallmark/references/themes/grid.md +101 -0
- package/sera-core/skills/hallmark/references/themes/halftone.md +106 -0
- package/sera-core/skills/hallmark/references/themes/hedgerow.md +104 -0
- package/sera-core/skills/hallmark/references/themes/hum.md +99 -0
- package/sera-core/skills/hallmark/references/themes/ink.md +106 -0
- package/sera-core/skills/hallmark/references/themes/kiln.md +108 -0
- package/sera-core/skills/hallmark/references/themes/loom.md +106 -0
- package/sera-core/skills/hallmark/references/themes/lumen.md +103 -0
- package/sera-core/skills/hallmark/references/themes/manifesto.md +101 -0
- package/sera-core/skills/hallmark/references/themes/midnight.md +97 -0
- package/sera-core/skills/hallmark/references/themes/newsprint.md +102 -0
- package/sera-core/skills/hallmark/references/themes/overprint.md +101 -0
- package/sera-core/skills/hallmark/references/themes/pasteup.md +100 -0
- package/sera-core/skills/hallmark/references/themes/piste.md +99 -0
- package/sera-core/skills/hallmark/references/themes/refract.md +101 -0
- package/sera-core/skills/hallmark/references/themes/ribbon.md +106 -0
- package/sera-core/skills/hallmark/references/themes/rim.md +96 -0
- package/sera-core/skills/hallmark/references/themes/riso.md +98 -0
- package/sera-core/skills/hallmark/references/themes/solstice.md +104 -0
- package/sera-core/skills/hallmark/references/themes/specimen.md +100 -0
- package/sera-core/skills/hallmark/references/themes/spore.md +104 -0
- package/sera-core/skills/hallmark/references/themes/sport.md +101 -0
- package/sera-core/skills/hallmark/references/themes/squeeze.md +99 -0
- package/sera-core/skills/hallmark/references/themes/sticker.md +106 -0
- package/sera-core/skills/hallmark/references/themes/studio.md +99 -0
- package/sera-core/skills/hallmark/references/themes/terminal.md +96 -0
- package/sera-core/skills/hallmark/references/themes/terrazzo.md +106 -0
- package/sera-core/skills/hallmark/references/themes/ultraviolet.md +106 -0
- package/sera-core/skills/hallmark/references/themes/vantage.md +99 -0
- package/sera-core/skills/hallmark/references/themes/vellum.md +105 -0
- package/sera-core/skills/hallmark/references/themes/wayfind.md +105 -0
- package/sera-core/skills/hallmark/references/themes/werkstatt.md +105 -0
- package/sera-core/skills/hallmark/scripts/capture.mjs +132 -0
- package/sera-core/skills/hallmark/scripts/refcheck.mjs +405 -0
- package/sera-core/skills/hallmark/scripts/sloplint-render.mjs +1283 -0
- package/sera-core/skills/hallmark/scripts/sloplint.mjs +4426 -0
- package/sera-core/skills/hallmark/scripts/theme.mjs +660 -0
- package/sera-core/skills/kurum-ici-iletisim/SKILL.md +40 -0
- package/sera-core/skills/launch/LICENSE +21 -0
- package/sera-core/skills/launch/NOTICE +5 -0
- package/sera-core/skills/launch/SKILL.md +385 -0
- package/sera-core/skills/launch/references/shipped-changes.md +84 -0
- package/sera-core/skills/launch/references/site-launch-qa.md +57 -0
- package/sera-core/skills/marka-kimligi/SKILL.md +30 -0
- package/sera-core/skills/mcp-yaz/SKILL.md +41 -0
- package/sera-core/skills/mobil-arayuz/SKILL.md +12 -0
- package/sera-core/skills/mvp-scoping/LICENSE +21 -0
- package/sera-core/skills/mvp-scoping/NOTICE +5 -0
- package/sera-core/skills/mvp-scoping/SKILL.md +95 -0
- package/sera-core/skills/ortak-yazarlik/SKILL.md +32 -0
- package/sera-core/skills/oyun-turleri/SKILL.md +176 -0
- package/sera-core/skills/paralel-sadelestirme/SKILL.md +33 -0
- package/sera-core/skills/phaser-core/LICENSE +201 -0
- package/sera-core/skills/phaser-core/NOTICE +5 -0
- package/sera-core/skills/phaser-core/NOTICE-UPSTREAM +15 -0
- package/sera-core/skills/phaser-core/SKILL.md +245 -0
- package/sera-core/skills/phaser-core/references/scene-flow.md +177 -0
- package/sera-core/skills/pitch-deck/LICENSE +21 -0
- package/sera-core/skills/pitch-deck/NOTICE +5 -0
- package/sera-core/skills/pitch-deck/SKILL.md +103 -0
- package/sera-core/skills/sera-3d-oyun/NOTICE +1 -0
- package/sera-core/skills/sera-3d-oyun/SKILL.md +12 -0
- package/sera-core/skills/sera-3d-oyun/sera-3d.js +3697 -0
- package/sera-core/skills/sera-diyagram/SKILL.md +43 -0
- package/sera-core/skills/sera-ofis-dosya/SKILL.md +3 -0
- package/sera-core/skills/sera-ofis-dosya/referanslar/ofis-ileri.md +46 -0
- package/sera-core/skills/sera-ui-site/NOTICE +1 -0
- package/sera-core/skills/sera-ui-site/SKILL.md +10 -0
- package/sera-core/skills/sera-ui-site/sera-ui.js +83 -0
- package/sera-core/skills/sera-veri-gorsel/SKILL.md +3 -0
- package/sera-core/skills/sera-veri-gorsel/referanslar/palet-dogrula.mjs +80 -0
- package/sera-core/skills/sistem-tarama/SKILL.md +49 -0
- package/sera-core/skills/sistem-tarama/referanslar/komutlar.md +78 -0
- package/sera-core/skills/tasarim-stilleri/SKILL.md +113 -0
- package/sera-core/skills/teardown/LICENSE +22 -0
- package/sera-core/skills/teardown/NOTICE +3 -0
- package/sera-core/skills/teardown/SKILL.md +144 -0
- package/sera-core/skills/teardown/package-lock.json +545 -0
- package/sera-core/skills/teardown/package.json +18 -0
- package/sera-core/skills/teardown/paths.mjs +30 -0
- package/sera-core/skills/teardown/run_sfx.py +10 -0
- package/sera-core/skills/teardown/sfx/__init__.py +10 -0
- package/sera-core/skills/teardown/sfx/__main__.py +64 -0
- package/sera-core/skills/teardown/sfx/dsp.py +453 -0
- package/sera-core/skills/teardown/sfx/loudness.py +72 -0
- package/sera-core/skills/teardown/sfx/mix.py +111 -0
- package/sera-core/skills/teardown/sfx/samples/SOURCES.md +23 -0
- package/sera-core/skills/teardown/sfx/samples/fs-258269-mouth-pop.ogg +0 -0
- package/sera-core/skills/teardown/sfx/samples/fs-323432-typing.ogg +0 -0
- package/sera-core/skills/teardown/sfx/samples/fs-329533-room-tone-in-an-apartment-livi.ogg +0 -0
- package/sera-core/skills/teardown/sfx/samples/fs-329569-roomtone-bedroom-yew.ogg +0 -0
- package/sera-core/skills/teardown/sfx/samples/fs-339521-vhs-rewind-forward-and-eject.ogg +0 -0
- package/sera-core/skills/teardown/sfx/samples/fs-349504-triangle-open-04.ogg +0 -0
- package/sera-core/skills/teardown/sfx/samples/fs-416777-digital-typing-wav.ogg +0 -0
- package/sera-core/skills/teardown/sfx/samples/fs-426767-apartment-room-tone-wav.ogg +0 -0
- package/sera-core/skills/teardown/sfx/samples/fs-447909-keyboard-typing.ogg +0 -0
- package/sera-core/skills/teardown/sfx/samples/fs-447910-plop.ogg +0 -0
- package/sera-core/skills/teardown/sfx/samples/fs-79388-keyboard-typing-wav.ogg +0 -0
- package/sera-core/skills/teardown/sfx/samples/fs-824189-pop-in-sfx.ogg +0 -0
- package/sera-core/skills/teardown/sfx/score_kit.py +206 -0
- package/sera-core/skills/teardown/sfx/synth.py +294 -0
- package/sera-core/skills/teardown/sheet.mjs +127 -0
- package/sera-core/skills/teardown/sims/beats.py +212 -0
- package/sera-core/skills/teardown/sims/build.mjs +141 -0
- package/sera-core/skills/teardown/sims/capture.mjs +211 -0
- package/sera-core/skills/teardown/sims/cessna-film/main.js +4 -0
- package/sera-core/skills/teardown/sims/cessna-film/timeline.json +1 -0
- package/sera-core/skills/teardown/sims/cessna-live/main.js +5 -0
- package/sera-core/skills/teardown/sims/cessna-shared/console.js +288 -0
- package/sera-core/skills/teardown/sims/cessna-shared/film.js +254 -0
- package/sera-core/skills/teardown/sims/cessna-shared/flight.js +53 -0
- package/sera-core/skills/teardown/sims/cessna-shared/gear.js +364 -0
- package/sera-core/skills/teardown/sims/cessna-shared/live.js +351 -0
- package/sera-core/skills/teardown/sims/cessna-shared/score.py +41 -0
- package/sera-core/skills/teardown/sims/cessna-shared/stage.js +248 -0
- package/sera-core/skills/teardown/sims/kit/director.js +300 -0
- package/sera-core/skills/teardown/sims/kit/hud.js +194 -0
- package/sera-core/skills/teardown/sims/kit/runtime.js +168 -0
- package/sera-core/skills/teardown/sims/kit/stage3d.js +114 -0
- package/sera-core/skills/teardown/sims/kit/style.css +137 -0
- package/sera-core/skills/teardown/sims/kit/util.js +79 -0
- package/sera-core/skills/teardown/sims/kit/warm.js +66 -0
- package/sera-core/skills/teardown/sims/strandbeest-film/main.js +4 -0
- package/sera-core/skills/teardown/sims/strandbeest-film/timeline.json +1 -0
- package/sera-core/skills/teardown/sims/strandbeest-live/main.js +5 -0
- package/sera-core/skills/teardown/sims/strandbeest-shared/beast.js +419 -0
- package/sera-core/skills/teardown/sims/strandbeest-shared/console.js +375 -0
- package/sera-core/skills/teardown/sims/strandbeest-shared/film.js +352 -0
- package/sera-core/skills/teardown/sims/strandbeest-shared/jansen.js +67 -0
- package/sera-core/skills/teardown/sims/strandbeest-shared/live.js +420 -0
- package/sera-core/skills/teardown/sims/strandbeest-shared/score.py +85 -0
- package/sera-core/skills/teardown/sims/strandbeest-shared/stage.js +463 -0
- package/sera-core/skills/teardown/sims/v8-film/main.js +4 -0
- package/sera-core/skills/teardown/sims/v8-film/timeline.json +1 -0
- package/sera-core/skills/teardown/sims/v8-live/main.js +5 -0
- package/sera-core/skills/teardown/sims/v8-shared/console.js +339 -0
- package/sera-core/skills/teardown/sims/v8-shared/engine.js +624 -0
- package/sera-core/skills/teardown/sims/v8-shared/film.js +239 -0
- package/sera-core/skills/teardown/sims/v8-shared/kin.js +86 -0
- package/sera-core/skills/teardown/sims/v8-shared/live.js +374 -0
- package/sera-core/skills/teardown/sims/v8-shared/score.py +60 -0
- package/sera-core/skills/teardown/sims/v8-shared/stage.js +173 -0
- package/sera-core/skills/teardown/wave.mjs +67 -0
- package/sera-core/skills/toplu-degisiklik/SKILL.md +39 -0
- package/sera-core/skills/ui-ux-pro-max/LICENSE +21 -0
- package/sera-core/skills/ui-ux-pro-max/NOTICE +5 -0
- package/sera-core/skills/ui-ux-pro-max/SKILL.md +13 -0
- package/sera-core/skills/ui-ux-pro-max/references/pro-rules.md +117 -0
- package/sera-core/skills/ui-ux-pro-max/references/quick-reference.md +266 -0
- package/sera-core/skills/unslop/LICENSE.md +410 -0
- package/sera-core/skills/unslop/SKILL.md +217 -0
- package/sera-core/skills/unslop/references/effects.md +113 -0
- package/sera-core/skills/unslop/references/refs/unslop-dashboard-after.webp +0 -0
- package/sera-core/skills/unslop/references/refs/unslop-hero-after.webp +0 -0
- package/sera-core/skills/unslop/references/refs.md +16 -0
- package/sera-core/skills/unslop/references/rtl.md +72 -0
- package/sera-core/skills/unslop/references/signs.md +125 -0
- package/sera-core/skills/unslop/references/tokens.md +137 -0
- package/sera-core/skills/unslop/references/visuals.md +84 -0
- package/sera-core/skills/unslop/scripts/snapshot.mjs +197 -0
- package/sera-core/skills/uretken-sanat/SKILL.md +42 -0
- package/sera-core/skills/verification-before-completion/LICENSE +21 -0
- package/sera-core/skills/verification-before-completion/NOTICE +5 -0
- package/sera-core/skills/verification-before-completion/SKILL.md +120 -0
- package/sera-core/skills/web-yayin-listesi/SKILL.md +3 -0
- package/sera-core/src/app-master.ts +2 -2
- package/sera-core/src/app-verify.ts +33 -0
- package/sera-core/src/auto-memory.ts +249 -0
- package/sera-core/src/extension.ts +69 -3
- package/sera-core/src/generated/build-rules.ts +81 -17
- package/sera-core/src/generated/quality-probe.ts +2 -0
- package/sera-core/src/generated/zero-knowledge.ts +36 -9
- package/sera-core/src/image-tool.ts +124 -7
- package/sera-core/src/link-data-tools.ts +411 -0
- package/sera-core/src/skills.ts +54 -18
- package/sera-core/src/video-tool.ts +51 -0
- package/sera-core/src/zk.ts +7 -3
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"""Shared pieces for the figure scores: a parameterised lo-fi bed and a handful of accents.
|
|
2
|
+
|
|
3
|
+
A figure's score.py imports this (it sits next to the sfx engine on sys.path when run through
|
|
4
|
+
run_sfx.py) and adds its own accents on the tour's seconds.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import math
|
|
8
|
+
import os
|
|
9
|
+
import random
|
|
10
|
+
|
|
11
|
+
from sfx.dsp import add, reverb, svf, zeros
|
|
12
|
+
from sfx.synth import SR, bandnoise, bass, blip, epiano, hat, kick, snare
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def env_fade(x, fin, fout):
|
|
16
|
+
n = len(x)
|
|
17
|
+
a = max(1, int(fin * SR))
|
|
18
|
+
b = max(1, int(fout * SR))
|
|
19
|
+
for i in range(min(a, n)):
|
|
20
|
+
x[i] *= i / a
|
|
21
|
+
for i in range(min(b, n)):
|
|
22
|
+
x[n - 1 - i] *= i / b
|
|
23
|
+
return x
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def bed(dur, bpm, chords, motif=(), motif_voice="epiano", bass_pattern=((0, 1.15, 0.9), (2.5, 0.85, 0.6)),
|
|
27
|
+
kicks=(0, 2.75), snares=(1, 3), hats=8, swing=0.12, drums_from=1, keys_lp=4200, crackle_level=0.0, keys_vel=0.9):
|
|
28
|
+
"""A looping bed: e-piano chords (one per bar), a bass line, soft drums and an optional motif every other bar.
|
|
29
|
+
|
|
30
|
+
chords: [([note Hz, ...], root Hz), ...]. bass_pattern: (beat, length in beats, velocity). Returns stereo keys
|
|
31
|
+
plus mono bass and drum stems, all faded in and out.
|
|
32
|
+
"""
|
|
33
|
+
if os.environ.get("FIG_VARIANT"):
|
|
34
|
+
# the second-upload variant: three semitones up, a touch faster, the other motif voice
|
|
35
|
+
up = 2 ** (3 / 12)
|
|
36
|
+
chords = [([f * up for f in notes], root * up) for notes, root in chords]
|
|
37
|
+
motif = [(bt, f * up) for bt, f in motif]
|
|
38
|
+
motif_voice = "blip" if motif_voice == "epiano" else "epiano"
|
|
39
|
+
bpm *= 1.06
|
|
40
|
+
beat = 60 / bpm
|
|
41
|
+
bar = 4 * beat
|
|
42
|
+
n = int(dur * SR)
|
|
43
|
+
keys, low, drums = zeros(n), zeros(n), zeros(n)
|
|
44
|
+
bars = int(dur / bar) + 1
|
|
45
|
+
for b in range(bars):
|
|
46
|
+
t = 0.12 + b * bar
|
|
47
|
+
notes, root = chords[b % len(chords)]
|
|
48
|
+
for i, f in enumerate(notes):
|
|
49
|
+
add(keys, epiano(f, 2.9 * 84 / bpm + 0.4, keys_vel), int((t + 0.012 * i) * SR))
|
|
50
|
+
if i >= 2:
|
|
51
|
+
add(keys, epiano(f, 1.3, keys_vel * 0.5), int((t + 1.5 * beat + 0.01 * i) * SR))
|
|
52
|
+
if b % 2 == 1:
|
|
53
|
+
for bt, f in motif:
|
|
54
|
+
v = epiano(f, 1.1, 0.34, 0.6) if motif_voice == "epiano" else blip(f, 0.32, 0.11)
|
|
55
|
+
add(keys, v, int((t + bt * beat) * SR), 1.0 if motif_voice == "epiano" else 0.5)
|
|
56
|
+
for bt, length, vel in bass_pattern:
|
|
57
|
+
add(low, bass(root, length * beat, vel), int((t + bt * beat) * SR))
|
|
58
|
+
if drums_from <= b < bars - 2:
|
|
59
|
+
for bt in kicks:
|
|
60
|
+
add(drums, kick(1.0 if bt == 0 else 0.75), int((t + bt * beat) * SR))
|
|
61
|
+
for bt in snares:
|
|
62
|
+
add(drums, snare(0.55), int((t + bt * beat) * SR))
|
|
63
|
+
for e in range(hats):
|
|
64
|
+
sw = swing * beat if (hats == 8 and e % 2) else 0.0
|
|
65
|
+
add(drums, hat(0.5 if e % 2 == 0 else 0.32), int((t + e * 4 * beat / hats + sw) * SR))
|
|
66
|
+
keys = svf(keys, keys_lp, 0.6, "lp")
|
|
67
|
+
wl, wr = reverb(keys, size=0.6, damp=0.5, scale=0.9)
|
|
68
|
+
left = [k * 0.8 + w * 0.36 for k, w in zip(keys, wl)]
|
|
69
|
+
right = [k * 0.8 + w * 0.36 for k, w in zip(keys, wr)]
|
|
70
|
+
low = svf(low, 900, 0.7, "lp")
|
|
71
|
+
drums = svf(drums, 7000, 0.6, "lp")
|
|
72
|
+
for buf in (left, right, low, drums):
|
|
73
|
+
env_fade(buf, 1.0, 2.2)
|
|
74
|
+
return left, right, low, drums
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def thud(f=95, decay=0.12, dur=0.4):
|
|
78
|
+
"""A soft body hitting something: a plush toy landing, a knock."""
|
|
79
|
+
n = int(dur * SR)
|
|
80
|
+
return [math.sin(2 * math.pi * f * k / SR) * math.exp(-k / (decay * SR)) * min(1, k / 40) for k in range(n)]
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def motor(dur, f0=220, grit_hz=1400, wobble=17):
|
|
84
|
+
"""A small electric motor: a buzzy tone plus brush noise, faded at both ends."""
|
|
85
|
+
n = int(dur * SR)
|
|
86
|
+
grit = bandnoise(n, lambda k: grit_hz, q=0.8)
|
|
87
|
+
out = []
|
|
88
|
+
for k in range(n):
|
|
89
|
+
t = k / SR
|
|
90
|
+
m = 1 + 0.15 * math.sin(2 * math.pi * wobble * t)
|
|
91
|
+
s = sum(math.sin(2 * math.pi * f0 * h * t) / h for h in (1, 2, 3, 4))
|
|
92
|
+
out.append(m * (0.35 * s + 0.5 * grit[k]))
|
|
93
|
+
return env_fade(out, 0.06, 0.1)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def airy(dur, f0, f1, level=1.0):
|
|
97
|
+
"""Moving air: band noise sweeping from f0 to f1 with a soft swell."""
|
|
98
|
+
n = int(dur * SR)
|
|
99
|
+
x = bandnoise(n, lambda k: f0 * (f1 / f0) ** (k / n), q=0.7)
|
|
100
|
+
return [x[k] * level * 1.4 * math.sin(math.pi * k / n) for k in range(n)]
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def bang(level=1.0, seed=0):
|
|
104
|
+
"""A small explosion: a low punch and a burst of dark noise."""
|
|
105
|
+
rnd = random.Random(seed)
|
|
106
|
+
n = int(0.42 * SR)
|
|
107
|
+
noise = bandnoise(n, lambda k: 700 + 1600 * math.exp(-k / (0.03 * SR)), q=0.5)
|
|
108
|
+
out = []
|
|
109
|
+
ph = 0.0
|
|
110
|
+
for k in range(n):
|
|
111
|
+
t = k / SR
|
|
112
|
+
f = 48 + 90 * math.exp(-t / 0.03)
|
|
113
|
+
ph += 2 * math.pi * f / SR
|
|
114
|
+
s = math.sin(ph) * math.exp(-t / 0.12) * 1.1 + noise[k] * 1.8 * math.exp(-t / 0.05)
|
|
115
|
+
out.append(level * math.tanh(1.5 * s) * (0.92 + 0.08 * rnd.random()))
|
|
116
|
+
return out
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def puff(level=1.0):
|
|
120
|
+
"""A breath of gas out of a pipe."""
|
|
121
|
+
n = int(0.3 * SR)
|
|
122
|
+
x = bandnoise(n, lambda k: 900, q=0.6)
|
|
123
|
+
return [level * x[k] * 1.6 * math.sin(math.pi * min(1, k / (0.06 * SR)) / 2) * math.exp(-k / (0.09 * SR)) for k in range(n)]
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def rumble(dur, f_at, level=1.0):
|
|
127
|
+
"""An engine's low hum whose pitch follows f_at(t)."""
|
|
128
|
+
n = int(dur * SR)
|
|
129
|
+
out = []
|
|
130
|
+
ph = 0.0
|
|
131
|
+
for k in range(n):
|
|
132
|
+
f = f_at(k / SR)
|
|
133
|
+
ph += 2 * math.pi * f / SR
|
|
134
|
+
out.append(level * (math.sin(ph) + 0.4 * math.sin(2 * ph) + 0.2 * math.sin(3 * ph)))
|
|
135
|
+
return env_fade(out, 0.3, 0.4)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
_SEMI = {"C": -9, "D": -7, "E": -5, "F": -4, "G": -2, "A": 0, "B": 2}
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def hz(name):
|
|
142
|
+
"""Note name to frequency: "A4" = 440, "F#3", "Bb2"."""
|
|
143
|
+
base, rest = name[0], name[1:]
|
|
144
|
+
shift = 0
|
|
145
|
+
while rest and rest[0] in "#b":
|
|
146
|
+
shift += 1 if rest[0] == "#" else -1
|
|
147
|
+
rest = rest[1:]
|
|
148
|
+
return 440.0 * 2 ** ((_SEMI[base] + shift + 12 * (int(rest) - 4)) / 12)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def chords(*specs):
|
|
152
|
+
"""chords("Fmaj7:F3 A3 C4 E4/F2", ...) -> bed() chord list; the part after / is the bass root."""
|
|
153
|
+
out = []
|
|
154
|
+
for spec in specs:
|
|
155
|
+
notes, root = spec.split(":", 1)[1].split("/")
|
|
156
|
+
out.append(([hz(n) for n in notes.split()], hz(root.strip())))
|
|
157
|
+
return out
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def beep(freq, dur=0.12, level=1.0):
|
|
161
|
+
"""A clean electronic beep: a keypad, a timer, a piezo horn."""
|
|
162
|
+
n = int(dur * SR)
|
|
163
|
+
a = max(1, int(0.004 * SR))
|
|
164
|
+
return [level * math.sin(2 * math.pi * freq * k / SR) * min(1, k / a, (n - k) / a) for k in range(n)]
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
def rattle(dur, rate=18.0, f=3200, seed=0, level=1.0):
|
|
168
|
+
"""Many small hard things settling: coins in a box, shavings, capsules."""
|
|
169
|
+
rnd = random.Random(seed)
|
|
170
|
+
n = int(dur * SR)
|
|
171
|
+
out = zeros(n)
|
|
172
|
+
t = 0.0
|
|
173
|
+
while t < dur:
|
|
174
|
+
k = int(t * SR)
|
|
175
|
+
tick = [math.sin(2 * math.pi * f * (0.7 + 0.6 * rnd.random()) * j / SR) * math.exp(-j / (0.004 * SR)) for j in range(int(0.03 * SR))]
|
|
176
|
+
add(out, tick, k, level * (0.4 + 0.6 * rnd.random()) * math.sin(math.pi * min(1.0, t / dur)))
|
|
177
|
+
t += rnd.expovariate(rate)
|
|
178
|
+
return out
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def hiss(dur, fc=5200, level=1.0):
|
|
182
|
+
"""Steam or air escaping: bright band noise with a soft swell."""
|
|
183
|
+
n = int(dur * SR)
|
|
184
|
+
x = bandnoise(n, lambda k: fc, q=0.5)
|
|
185
|
+
return [x[k] * level * 1.3 * min(1, k / (0.15 * SR), (n - k) / (0.25 * SR)) for k in range(n)]
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def spans(tl, field, pred):
|
|
189
|
+
"""Intervals (t0, t1) in seconds where pred(sampled value of field) holds, from a timeline made with --sample."""
|
|
190
|
+
i = tl["fields"].index(field)
|
|
191
|
+
rate, out, start = tl["rate"], [], None
|
|
192
|
+
for k, row in enumerate(tl["samples"]):
|
|
193
|
+
on = bool(pred(row[i]))
|
|
194
|
+
if on and start is None:
|
|
195
|
+
start = k / rate
|
|
196
|
+
elif not on and start is not None:
|
|
197
|
+
out.append((start, k / rate))
|
|
198
|
+
start = None
|
|
199
|
+
if start is not None:
|
|
200
|
+
out.append((start, len(tl["samples"]) / rate))
|
|
201
|
+
return out
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def rising(tl, field, pred):
|
|
205
|
+
"""Moments where pred(sampled value) turns true."""
|
|
206
|
+
return [a for a, _ in spans(tl, field, pred)]
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
"""Sound generators.
|
|
2
|
+
|
|
3
|
+
Every generator returns mono samples (a list of floats, roughly -1..1) at SR.
|
|
4
|
+
The first line of each docstring says what it's for; `python run_sfx.py --list`
|
|
5
|
+
prints them. To add a sound, write a function here in the same shape.
|
|
6
|
+
Use the module-level `random` for noise so renders stay reproducible.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import array
|
|
10
|
+
import bisect
|
|
11
|
+
import math
|
|
12
|
+
import os
|
|
13
|
+
import random
|
|
14
|
+
import subprocess
|
|
15
|
+
|
|
16
|
+
SR = 48000
|
|
17
|
+
FFMPEG = r"C:\Users\user_\.claude\bin\ffmpeg.exe"
|
|
18
|
+
SAMPLES = os.path.join(os.path.dirname(os.path.abspath(__file__)), "samples")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def sample(name, start=0.0, dur=None):
|
|
22
|
+
"""Recorded sound from sfx/samples (or any path): keyboards, room tone. start/dur trim it in seconds."""
|
|
23
|
+
path = name if os.path.isabs(name) else os.path.join(SAMPLES, name)
|
|
24
|
+
cmd = [FFMPEG, "-v", "error", "-ss", str(start), "-i", path]
|
|
25
|
+
if dur is not None:
|
|
26
|
+
cmd += ["-t", str(dur)]
|
|
27
|
+
cmd += ["-ac", "1", "-ar", str(SR), "-f", "s16le", "-"]
|
|
28
|
+
raw = subprocess.run(cmd, check=True, capture_output=True).stdout
|
|
29
|
+
pcm = array.array("h")
|
|
30
|
+
pcm.frombytes(raw[: len(raw) // 2 * 2])
|
|
31
|
+
return [x / 32768 for x in pcm]
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def bandnoise(n, fc_at, q=0.8):
|
|
35
|
+
"""Building block: white noise through a band-pass, fc_at(k) is the cutoff in Hz at sample k."""
|
|
36
|
+
low = band = 0.0
|
|
37
|
+
out = []
|
|
38
|
+
for k in range(n):
|
|
39
|
+
f = 2 * math.sin(math.pi * min(fc_at(k), SR / 6) / SR)
|
|
40
|
+
x = random.uniform(-1, 1)
|
|
41
|
+
low += f * band
|
|
42
|
+
high = x - low - q * band
|
|
43
|
+
band += f * high
|
|
44
|
+
out.append(band)
|
|
45
|
+
return out
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def click(freq=1800, dur=0.05):
|
|
49
|
+
"""UI click: a control snapping to a step, a toggle, a tick. Higher freq sounds smaller."""
|
|
50
|
+
n = int(dur * SR)
|
|
51
|
+
out = []
|
|
52
|
+
for k in range(n):
|
|
53
|
+
tt = k / SR
|
|
54
|
+
s = math.sin(2 * math.pi * freq * tt) * math.exp(-tt / 0.012)
|
|
55
|
+
s += random.uniform(-1, 1) * math.exp(-tt / 0.0015) * 0.6
|
|
56
|
+
out.append(s)
|
|
57
|
+
return out
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def key():
|
|
61
|
+
"""One keystroke; every call is slightly different. For typing use Mix.typing()."""
|
|
62
|
+
n = int(0.018 * SR)
|
|
63
|
+
fc = random.uniform(2400, 4200)
|
|
64
|
+
noise = bandnoise(n, lambda k: fc, q=0.5)
|
|
65
|
+
thock = random.uniform(160, 220)
|
|
66
|
+
return [
|
|
67
|
+
noise[k] * math.exp(-k / (0.0025 * SR)) * 2.2
|
|
68
|
+
+ math.sin(2 * math.pi * thock * k / SR) * math.exp(-k / (0.006 * SR)) * 0.5
|
|
69
|
+
for k in range(n)
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def blip(freq, dur=0.35, tau=0.12):
|
|
74
|
+
"""Soft tonal blip: a word or element landing, one note of a sequence. Keep freq in key."""
|
|
75
|
+
n = int(dur * SR)
|
|
76
|
+
out = []
|
|
77
|
+
ph = 0.0
|
|
78
|
+
for k in range(n):
|
|
79
|
+
tt = k / SR
|
|
80
|
+
ph += 2 * math.pi * freq / SR
|
|
81
|
+
a = min(1, tt / 0.003) * math.exp(-tt / tau)
|
|
82
|
+
out.append(a * (math.sin(ph) + 0.25 * math.sin(2 * ph) + 0.08 * math.sin(3 * ph)))
|
|
83
|
+
return out
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def pop(f0, f1, dur=0.16):
|
|
87
|
+
"""Pitched pop: a badge, chip or callout popping in. Sweeps f0 to f1; raise f0 across a sequence."""
|
|
88
|
+
n = int(dur * SR)
|
|
89
|
+
out = []
|
|
90
|
+
ph = 0.0
|
|
91
|
+
for k in range(n):
|
|
92
|
+
tt = k / SR
|
|
93
|
+
f = f0 * (f1 / f0) ** min(1, tt / 0.06)
|
|
94
|
+
ph += 2 * math.pi * f / SR
|
|
95
|
+
a = min(1, tt / 0.002) * math.exp(-tt / 0.045)
|
|
96
|
+
out.append(a * math.sin(ph))
|
|
97
|
+
return out
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def chime(freqs, dur=1.8, tau=0.7):
|
|
101
|
+
"""Bell chord: success, arrival, a payoff. Pass freqs from the video's key."""
|
|
102
|
+
n = int(dur * SR)
|
|
103
|
+
out = [0.0] * n
|
|
104
|
+
for j, f in enumerate(freqs):
|
|
105
|
+
ph1 = ph2 = 0.0
|
|
106
|
+
g = 1.0 / (1 + j * 0.35)
|
|
107
|
+
for k in range(n):
|
|
108
|
+
tt = k / SR
|
|
109
|
+
ph1 += 2 * math.pi * f / SR
|
|
110
|
+
ph2 += 2 * math.pi * f * 2.76 / SR
|
|
111
|
+
a = min(1, tt / 0.004) * math.exp(-tt / tau)
|
|
112
|
+
out[k] += g * a * (math.sin(ph1) + 0.18 * math.sin(ph2) * math.exp(-tt / 0.15))
|
|
113
|
+
return out
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def whoosh(dur, f0, f1, peak=0.6, q=0.9):
|
|
117
|
+
"""Air whoosh: movement, reveals, transitions. f0 to f1 sets direction, peak (0..1) where it's loudest."""
|
|
118
|
+
n = int(dur * SR)
|
|
119
|
+
p = math.log(0.5) / math.log(peak)
|
|
120
|
+
noise = bandnoise(n, lambda k: f0 * (f1 / f0) ** (k / n), q=q)
|
|
121
|
+
return [noise[k] * math.sin(math.pi * (k / n) ** p) ** 2 * 1.6 for k in range(n)]
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def riser(dur, f0=260, f1=5200):
|
|
125
|
+
"""Build-up into a payoff. End it exactly on the hit; one big riser per video."""
|
|
126
|
+
n = int(dur * SR)
|
|
127
|
+
noise = bandnoise(n, lambda k: f0 * (f1 / f0) ** (k / n), q=0.6)
|
|
128
|
+
out = []
|
|
129
|
+
ph = 0.0
|
|
130
|
+
for k in range(n):
|
|
131
|
+
x = k / n
|
|
132
|
+
ph += 2 * math.pi * (180 * (4.0 ** x)) / SR
|
|
133
|
+
tail = min(1, (n - k) / (0.02 * SR))
|
|
134
|
+
out.append((noise[k] * 1.3 + 0.35 * math.sin(ph)) * x ** 2.2 * tail)
|
|
135
|
+
return out
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def impact(dur=1.2):
|
|
139
|
+
"""Low impact for the hero moment. One per video."""
|
|
140
|
+
n = int(dur * SR)
|
|
141
|
+
out = []
|
|
142
|
+
ph = 0.0
|
|
143
|
+
lp = 0.0
|
|
144
|
+
for k in range(n):
|
|
145
|
+
tt = k / SR
|
|
146
|
+
f = 38 + 60 * math.exp(-tt / 0.07)
|
|
147
|
+
ph += 2 * math.pi * f / SR
|
|
148
|
+
lp += 0.08 * (random.uniform(-1, 1) - lp)
|
|
149
|
+
s = math.sin(ph) * math.exp(-tt / 0.38)
|
|
150
|
+
s += lp * math.exp(-tt / 0.05) * 3.0
|
|
151
|
+
out.append(math.tanh(1.6 * s))
|
|
152
|
+
return out
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def scratch(dur):
|
|
156
|
+
"""Pencil on paper: a sketch or line drawing itself on."""
|
|
157
|
+
n = int(dur * SR)
|
|
158
|
+
noise = bandnoise(n, lambda k: 3800 + 1400 * math.sin(k / SR * 23), q=0.35)
|
|
159
|
+
out = []
|
|
160
|
+
for k in range(n):
|
|
161
|
+
tt = k / SR
|
|
162
|
+
stroke = max(0.0, math.sin(tt * 2 * math.pi * 7.5)) ** 3
|
|
163
|
+
env = math.sin(math.pi * k / n)
|
|
164
|
+
out.append(noise[k] * stroke * env * 1.4)
|
|
165
|
+
return out
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def envelope(points):
|
|
169
|
+
"""Helper: piecewise-linear gain curve from [(t, value), ...], for pad volume and ducking."""
|
|
170
|
+
pts = sorted(points)
|
|
171
|
+
ts = [p[0] for p in pts]
|
|
172
|
+
|
|
173
|
+
def at(t):
|
|
174
|
+
i = bisect.bisect_right(ts, t)
|
|
175
|
+
if i == 0:
|
|
176
|
+
return pts[0][1]
|
|
177
|
+
if i == len(pts):
|
|
178
|
+
return pts[-1][1]
|
|
179
|
+
(t0, v0), (t1, v1) = pts[i - 1], pts[i]
|
|
180
|
+
return v0 + (v1 - v0) * (t - t0) / (t1 - t0)
|
|
181
|
+
|
|
182
|
+
return at
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def pad(duration, chords, volume=None, detune=0.6, tremolo=0.23, xfade=0.35):
|
|
186
|
+
"""Music bed under everything; returns (left, right) for Mix.put_stereo. chords = [(start_s, [freqs]), ...]."""
|
|
187
|
+
n = int(duration * SR)
|
|
188
|
+
left = [0.0] * n
|
|
189
|
+
right = [0.0] * n
|
|
190
|
+
for ci, (t0, freqs) in enumerate(chords):
|
|
191
|
+
t_next = chords[ci + 1][0] if ci + 1 < len(chords) else None
|
|
192
|
+
i0 = int(t0 * SR)
|
|
193
|
+
i1 = n if t_next is None else min(n, int((t_next + xfade) * SR))
|
|
194
|
+
phl = [0.0] * len(freqs)
|
|
195
|
+
phr = [0.0] * len(freqs)
|
|
196
|
+
for i in range(i0, i1):
|
|
197
|
+
t = i / SR
|
|
198
|
+
w = 1.0 if ci == 0 else min(1.0, (t - t0) / xfade)
|
|
199
|
+
if t_next is not None and t > t_next:
|
|
200
|
+
w *= max(0.0, 1 - (t - t_next) / xfade)
|
|
201
|
+
v = w * (volume(t) if volume else 1.0) * (0.85 + 0.15 * math.sin(2 * math.pi * tremolo * t))
|
|
202
|
+
sl = sr = 0.0
|
|
203
|
+
for j, f in enumerate(freqs):
|
|
204
|
+
phl[j] += 2 * math.pi * (f - detune) / SR
|
|
205
|
+
phr[j] += 2 * math.pi * (f + detune) / SR
|
|
206
|
+
g = 1 / (1 + j * 0.5)
|
|
207
|
+
sl += g * math.sin(phl[j])
|
|
208
|
+
sr += g * math.sin(phr[j])
|
|
209
|
+
left[i] += sl * v
|
|
210
|
+
right[i] += sr * v
|
|
211
|
+
return left, right
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
# ---------------------------------------------------------------- a small band, for music beds
|
|
215
|
+
# Added 2026-10-18 for the coffee-machine film. Soft, warm, low in the mix: the bed sits under the picture,
|
|
216
|
+
# the accents (clicks, hiss) sit on top of it.
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def epiano(freq, dur=2.6, vel=1.0, decay=1.1):
|
|
220
|
+
"""Electric-piano note (tine and warm body), for lo-fi chords. Keep freq in key; vel 0..1."""
|
|
221
|
+
n = int(dur * SR)
|
|
222
|
+
out = [0.0] * n
|
|
223
|
+
w1 = 2 * math.pi * freq / SR
|
|
224
|
+
w2 = 2 * w1
|
|
225
|
+
wt = 2 * math.pi * freq * 6.98 / SR
|
|
226
|
+
wtrem = 2 * math.pi * 4.6 / SR
|
|
227
|
+
sin = math.sin
|
|
228
|
+
exp = math.exp
|
|
229
|
+
for k in range(n):
|
|
230
|
+
t = k / SR
|
|
231
|
+
a = (t / 0.006 if t < 0.006 else 1.0) * exp(-t / decay)
|
|
232
|
+
body = sin(w1 * k) + 0.28 * sin(w2 * k) * exp(-t / 0.5)
|
|
233
|
+
tine = 0.16 * sin(wt * k) * exp(-t / 0.09)
|
|
234
|
+
out[k] = vel * a * (body + tine) * (1 + 0.1 * sin(wtrem * k))
|
|
235
|
+
tail = min(n, int(0.08 * SR))
|
|
236
|
+
for i in range(tail):
|
|
237
|
+
out[n - 1 - i] *= i / tail
|
|
238
|
+
return out
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def bass(freq, dur=0.9, vel=1.0):
|
|
242
|
+
"""Round bass note: sine plus a little second harmonic, gently saturated. Roots under the chords."""
|
|
243
|
+
n = int(dur * SR)
|
|
244
|
+
out = [0.0] * n
|
|
245
|
+
w = 2 * math.pi * freq / SR
|
|
246
|
+
sin = math.sin
|
|
247
|
+
exp = math.exp
|
|
248
|
+
for k in range(n):
|
|
249
|
+
t = k / SR
|
|
250
|
+
a = (t / 0.012 if t < 0.012 else 1.0) * exp(-t / 0.45)
|
|
251
|
+
out[k] = math.tanh(1.4 * vel * a * (sin(w * k) + 0.22 * sin(2 * w * k)))
|
|
252
|
+
tail = min(n, int(0.05 * SR))
|
|
253
|
+
for i in range(tail):
|
|
254
|
+
out[n - 1 - i] *= i / tail
|
|
255
|
+
return out
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
def kick(vel=1.0):
|
|
259
|
+
"""Soft kick: a sine dropping from 110 to 46 Hz. Lo-fi, not club."""
|
|
260
|
+
n = int(0.32 * SR)
|
|
261
|
+
out = [0.0] * n
|
|
262
|
+
ph = 0.0
|
|
263
|
+
for k in range(n):
|
|
264
|
+
t = k / SR
|
|
265
|
+
f = 46 + 64 * math.exp(-t / 0.035)
|
|
266
|
+
ph += 2 * math.pi * f / SR
|
|
267
|
+
out[k] = vel * math.sin(ph) * math.exp(-t / 0.11) * min(1.0, t / 0.002)
|
|
268
|
+
return out
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
def snare(vel=1.0):
|
|
272
|
+
"""Brushed snare: band-passed noise with a short body tone, for beats 2 and 4."""
|
|
273
|
+
n = int(0.22 * SR)
|
|
274
|
+
noise = bandnoise(n, lambda k: 2100, q=0.55)
|
|
275
|
+
return [vel * (noise[k] * 1.6 * math.exp(-k / (0.06 * SR)) + 0.25 * math.sin(2 * math.pi * 190 * k / SR) * math.exp(-k / (0.025 * SR))) for k in range(n)]
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
def hat(vel=1.0):
|
|
279
|
+
"""Closed hat tick: high band noise, very short. Swing the off-beats."""
|
|
280
|
+
n = int(0.05 * SR)
|
|
281
|
+
noise = bandnoise(n, lambda k: 7600, q=0.4)
|
|
282
|
+
return [vel * noise[k] * 1.8 * math.exp(-k / (0.011 * SR)) for k in range(n)]
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
def crackle(dur, density=7.0, hiss=0.012):
|
|
286
|
+
"""Vinyl crackle bed: sparse clicks over a faint hiss. density is clicks per second."""
|
|
287
|
+
n = int(dur * SR)
|
|
288
|
+
out = [random.uniform(-1, 1) * hiss for _ in range(n)]
|
|
289
|
+
for _ in range(int(dur * density)):
|
|
290
|
+
at = random.randrange(n)
|
|
291
|
+
g = random.uniform(0.05, 0.35) * random.choice((-1, 1))
|
|
292
|
+
for i in range(min(40, n - at)):
|
|
293
|
+
out[at + i] += g * math.exp(-i / 6.0)
|
|
294
|
+
return out
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Contact sheets from any rendered video: the review loop's eyes, and the way to
|
|
3
|
+
// read a clip before writing timecodes about it.
|
|
4
|
+
//
|
|
5
|
+
// node sheet.mjs --video f.mp4 --timeline timeline.json every beat, settled (+0.3s)
|
|
6
|
+
// node sheet.mjs --video f.mp4 2.3 4.5 6.9 exact timestamps
|
|
7
|
+
// node sheet.mjs --video f.mp4 --every 1 one frame per second
|
|
8
|
+
// node sheet.mjs --video f.mp4 --from 3 --to 5 --every 0.2 scrub a transition
|
|
9
|
+
//
|
|
10
|
+
// Options: --offset 0.3 --cols 4 --rows 2 --size 540 --name beats
|
|
11
|
+
// Sheets land next to the video in <video>_sheets/. Every tile is labelled t=.
|
|
12
|
+
import {execFileSync} from 'node:child_process';
|
|
13
|
+
import fs from 'node:fs';
|
|
14
|
+
import path from 'node:path';
|
|
15
|
+
import {FFMPEG, FFPROBE} from './paths.mjs';
|
|
16
|
+
|
|
17
|
+
const argv = process.argv.slice(2);
|
|
18
|
+
const opt = (name, fallback) => {
|
|
19
|
+
const i = argv.indexOf(`--${name}`);
|
|
20
|
+
if (i === -1) return fallback;
|
|
21
|
+
const v = argv[i + 1];
|
|
22
|
+
argv.splice(i, 2);
|
|
23
|
+
return v;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const video = path.resolve(opt('video', ''));
|
|
27
|
+
const timelinePath = opt('timeline', null);
|
|
28
|
+
const offset = Number(opt('offset', '0.3'));
|
|
29
|
+
const every = opt('every', null);
|
|
30
|
+
const from = Number(opt('from', '0'));
|
|
31
|
+
const to = opt('to', null);
|
|
32
|
+
const cols = Number(opt('cols', '4'));
|
|
33
|
+
const rows = Number(opt('rows', '2'));
|
|
34
|
+
const size = Number(opt('size', '540'));
|
|
35
|
+
let name = opt('name', null);
|
|
36
|
+
|
|
37
|
+
if (!video || !fs.existsSync(video)) {
|
|
38
|
+
console.error('pass --video <file.mp4>');
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const probe = (args) =>
|
|
43
|
+
execFileSync(FFPROBE, ['-v', 'error', ...args, '-of', 'csv=p=0', video]).toString().trim();
|
|
44
|
+
const duration = Number(probe(['-show_entries', 'format=duration']));
|
|
45
|
+
|
|
46
|
+
const beats = () => {
|
|
47
|
+
if (!timelinePath) {
|
|
48
|
+
console.error('pass timestamps, --every, or --timeline <file.json>');
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
const tl = JSON.parse(fs.readFileSync(timelinePath, 'utf8'));
|
|
52
|
+
const out = [];
|
|
53
|
+
const walk = (v, key) => {
|
|
54
|
+
if (key === 'fps' || key === 'duration') return;
|
|
55
|
+
if (typeof v === 'number') out.push(v);
|
|
56
|
+
else if (Array.isArray(v)) v.forEach((x) => walk(x));
|
|
57
|
+
else if (v && typeof v === 'object') Object.entries(v).forEach(([k, x]) => walk(x, k));
|
|
58
|
+
};
|
|
59
|
+
walk(tl);
|
|
60
|
+
return out.map((t) => t + offset);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
let times;
|
|
64
|
+
if (argv.length) {
|
|
65
|
+
times = argv.map(Number);
|
|
66
|
+
name ??= 'picked';
|
|
67
|
+
} else if (every) {
|
|
68
|
+
const end = to === null ? duration : Number(to);
|
|
69
|
+
times = [];
|
|
70
|
+
for (let t = from; t <= end + 1e-6; t += Number(every)) times.push(Number(t.toFixed(3)));
|
|
71
|
+
name ??= `every${every}`;
|
|
72
|
+
} else {
|
|
73
|
+
times = beats();
|
|
74
|
+
name ??= 'beats';
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// ffmpeg returns no frame for a seek this close to the end of the file, so keep 50 ms off it
|
|
78
|
+
const eps = 0.05;
|
|
79
|
+
times = [...new Set(times.map((t) => Math.min(Math.max(t, 0), duration - eps).toFixed(2)))]
|
|
80
|
+
.map(Number)
|
|
81
|
+
.sort((a, b) => a - b);
|
|
82
|
+
|
|
83
|
+
const base = video.replace(/\.[^.]+$/, '') + '_sheets';
|
|
84
|
+
const dir = path.join(base, name);
|
|
85
|
+
fs.rmSync(dir, {recursive: true, force: true});
|
|
86
|
+
fs.mkdirSync(dir, {recursive: true});
|
|
87
|
+
|
|
88
|
+
const ffmpeg = (args) => execFileSync(FFMPEG, ['-loglevel', 'error', '-y', ...args], {stdio: 'pipe'});
|
|
89
|
+
|
|
90
|
+
let labels = true;
|
|
91
|
+
times.forEach((t, i) => {
|
|
92
|
+
const file = path.join(dir, `${String(i).padStart(3, '0')}.png`);
|
|
93
|
+
const scale = `scale=${size}:-2`;
|
|
94
|
+
// Consolas ships with Windows; the colon in the drive letter is escaped for the filter parser.
|
|
95
|
+
const label = `drawtext=fontfile='C\\:/Windows/Fonts/consola.ttf':text='t=${t.toFixed(2)}':x=10:y=10:fontsize=${Math.round(
|
|
96
|
+
size / 24,
|
|
97
|
+
)}:fontcolor=white:box=1:boxcolor=black@0.6:boxborderw=6`;
|
|
98
|
+
const grab = (vf) => ffmpeg(['-ss', String(t), '-i', video, '-frames:v', '1', '-vf', vf, file]);
|
|
99
|
+
if (labels) {
|
|
100
|
+
try {
|
|
101
|
+
grab(`${scale},${label}`);
|
|
102
|
+
return;
|
|
103
|
+
} catch {
|
|
104
|
+
labels = false;
|
|
105
|
+
console.warn('drawtext unavailable in this ffmpeg build; sheets will have no timestamps.');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
grab(scale);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
const perSheet = cols * rows;
|
|
112
|
+
const sheets = [];
|
|
113
|
+
for (let s = 0; s * perSheet < times.length; s++) {
|
|
114
|
+
const out = path.join(base, `${name}-${s + 1}.png`);
|
|
115
|
+
ffmpeg([
|
|
116
|
+
'-framerate', '1',
|
|
117
|
+
'-start_number', String(s * perSheet),
|
|
118
|
+
'-i', path.join(dir, '%03d.png'),
|
|
119
|
+
'-vf', `tile=${cols}x${rows}:padding=6:color=0x333333`,
|
|
120
|
+
'-frames:v', '1',
|
|
121
|
+
out,
|
|
122
|
+
]);
|
|
123
|
+
sheets.push(out);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
console.log(`${times.length} frames from ${video} → ${sheets.length} sheet(s):`);
|
|
127
|
+
sheets.forEach((s) => console.log(` ${s}`));
|