arthur/docs/time.md

44 lines
2.1 KiB
Markdown
Raw Normal View History

2026-10-10 15:13:21 -04:00
# Time
A document has ONE rate, `:fps`, and a symbol has none. A symbol is a bag of
frames: frame n of anything plays for one tick of the document's clock, at any
depth of nesting. This is Flash's model — a MovieClip has no frame rate of its
own — and it is what makes "one frame" mean the same thing wherever you are
drawing. New documents are 12fps.
## Footage
Footage is the one thing that really has its own rate. A tracing symbol's frames
are the footage's frames and a take's measured faces are the camera's, so they
keep them, and the PLACEMENT plays them at the speed that makes them real time:
30fps footage in a 12fps project is an instance with `:playback :speed 2.5`.
It is an ordinary, visible retime. Output frame f shows source frame
`floor(f · speed)`, the latest at or before its instant; the preserve-snap
(`domain/pose`) is what recovers a one-frame closure that speed skips.
A sound counts in its source's own rate (`:source :fps`), and the audio mix
cancels the document's rate out, so only deliberate speed changes affect pitch
and duration.
## Changing the rate
The rate is changed through a dialog, not typed over, because there are two
honest meanings and they are Animate's two (`domain/retime`):
* **keep frames** — `(assoc clip :fps rate)`. Every frame stays where it is and
plays for the new tick, so the animation runs faster or slower. Sounds still
play in seconds.
* **keep timing** — `retime/scale-spans`, Animate's "scale spans". Every frame
number in every symbol is multiplied by `new/old` and rounded: keys, spans,
`:time :at`, holds, exposure, a symbol's `:frames`. Keys that land on one frame
keep the later one. A symbol of camera frames (footage, dense measurements)
cannot be rewritten frame by frame, so its factor is 1 and its placements
absorb the change — an instance's speed becomes `speed · child/host`, the same
rule read the other way round.
Bringing symbols in from a document at another rate (a take, another project)
keeps their timing the same way.
Source video presentation timestamps are still future work; this model assumes
constant fps.