Repository navigation
feat(sfx): time a sound effect by a word of the narration, with the film's snap to a hit - #105
Merged
Merged
Conversation
…ilm's snap to a hit
…y-word # Conflicts: # tests/work.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #92. Part of #87.
Summary
A sound effect's
atcan now name a word of its scene's narration, andbuildturns it into seconds. The calculation is the one the film uses forfilm.word(lead + the word's time in the scene's WAV / speed). An optionaloffsetshifts it. With"snap": "hit", it moves to the nearest kick, snare or rim hit within an eighth of a bar, asbeat.snapmoves the film's motion.{ "at": { "word": "四割" }, "prompt": "paper tearing", "duration": 1 } { "at": { "word": "人に", "offset": 0.1, "snap": "hit" }, "prompt": "airy whoosh", "duration": 0.8 }A number still works as before.
Why
Times copied by hand did not match the film:
words.jsonplusleadwould have been off by 0.03–0.40 s, because the film's word times also divide by the speaking rate.Change
scripts/work.tsparseSfxacceptsat: { word, offset?, snap? }and keeps it on the effect, withat: 0until it is resolved. A missing word, or asnapthat is not"hit", is refused.scripts/words.tsresolveSfxTimes(work, script, timing)scripts/cli.tsbuildresolves the times before placing the effects.sfxshows the resolved times once the narration exists, and the times as written before that.skills/rich/SKILL.md,references/html-film.mdTest
tests/work.test.ts: parsing, and the two refusals.tests/words.test.ts:pageWords(...), the film'sfilm.word, plus the offset.make checkpasses.