foley.weave.timeline#
The sound-design timeline as an editable document — hydrate, edit, caption.
The timeline is the SSOT and the reproducible seed; foley.weave.render() is a
pure projection of it. This module owns the document operations, all pure and
stdlib-only (no numpy, no I/O):
hydrate()— resolve each item’s symbolic anchor into a concretePlacementand fill processing/id defaults, idempotently(
hydrate ∘ hydrate == hydrate) and without clobbering a hand-set placement.Pure edit transforms (
swap_clip(),nudge(),set_gain(),toggle(),set_master()) — each returns a NEW timeline, so an edit +re-render reproduces exactly that change (the “editable, re-renderable” DoD).
Accessibility SDH captions (
to_webvtt()/to_srt()) — bracketed SFX labels ([door creak]) derived from the items, never from the narration transcript, so no speech text leaks into a shipped caption file.
Module Attributes
How long a one-shot's caption stays on screen (seconds) when the item has no resolved duration of its own. |
Functions
|
Resolve every item's anchor + fill processing/id, returning a NEW timeline. |
|
Shift an item's resolved onset by |
|
Set an item's processing gain (dB, voice-relative) — a NEW timeline. |
|
Set the timeline's master profile (name or |
|
Swap an item's clip (keeping its placement/processing) — a NEW timeline. |
|
Render the timeline's SFX cues as an SRT SDH caption file (report 06 / issue #8). |
|
Render the timeline's SFX cues as a WebVTT SDH caption file (report 06 / issue #8). |
|
Non-destructively mute/unmute an item — a NEW timeline. |
- foley.weave.timeline.DISPLAY_WINDOW_S: float = 2.0#
How long a one-shot’s caption stays on screen (seconds) when the item has no resolved duration of its own.
- foley.weave.timeline.hydrate(timeline, word_timeline=None)[source]#
Resolve every item’s anchor + fill processing/id, returning a NEW timeline.
Idempotent: an item that already carries a
Placementkeeps its symbolic anchor (a hand edit is never clobbered) but is re-resolved againstword_timelineso a re-recorded/re-aligned narration re-flows the SFX (report 06 §6.1).processingfalls back to the sparsegainandidto a stable content hash. The resolvedword_timelineis cached on the returned timeline (the reproducible seed).- Parameters:
timeline (
SoundDesignTimeline) – The (sparse or partially-resolved) timeline.word_timeline (
Optional[list]) – The forced alignment; defaults totimeline.word_timeline.
- Return type:
- Returns:
A hydrated copy with resolved placements, filled processing, stable ids.
- foley.weave.timeline.nudge(timeline, item_id, delta_s)[source]#
Shift an item’s resolved onset by
delta_sseconds — a NEW timeline.Resolves the item’s anchor against the timeline’s
word_timelinefirst, then shifts the resolved onset and pins the anchor toabsoluteso the manual offset survives a re-hydrate. This means nudging a still-symbolic (not-yet-hydrated) item on a timeline that carries alignment shifts from the item’s true resolved onset, not from 0. On a pre-alignment timeline with noword_timelinea word/sentence anchor is genuinely unresolvable, so there the shift is relative to 0 — hydrate/weave first for such items.- Return type:
- foley.weave.timeline.set_gain(timeline, item_id, gain_db)[source]#
Set an item’s processing gain (dB, voice-relative) — a NEW timeline.
- Return type:
- foley.weave.timeline.set_master(timeline, master)[source]#
Set the timeline’s master profile (name or
MasterProfile) — a NEW timeline.- Return type:
- foley.weave.timeline.swap_clip(timeline, item_id, new_clip_ref)[source]#
Swap an item’s clip (keeping its placement/processing) — a NEW timeline.
- Return type:
- foley.weave.timeline.to_srt(timeline, *, window_s=2.0)[source]#
Render the timeline’s SFX cues as an SRT SDH caption file (report 06 / issue #8).
- Return type:
- foley.weave.timeline.to_webvtt(timeline, *, window_s=2.0)[source]#
Render the timeline’s SFX cues as a WebVTT SDH caption file (report 06 / issue #8).
Each enabled, placed item becomes one
[bracketed]cue at its resolved onset.- Return type: