filmClock
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
filmClock
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2The film's single clock. FURROW is a pure function of one number: `filmClock.now()`, the seconds elapsed since the film began. `Director.component` is the ONLY thing that advances it, once per frame, by a FIXED step. Everything else in the demo — the animal, the sand, the light, the score — reads it and poses itself for that instant. The rule, and it is not negotiable: **NO SLICE KEEPS ITS OWN CLOCK.** Never accumulate `dt` yourself, never call `os.clock()` or `getTime()` to decide what your slice should be doing. Read `filmClock.now()` and derive your state from it. That is what makes the film reproducible: run it twice and you get the same 181 seconds, frame for frame, because every subsystem is a function of the same number and that number advances in fixed increments rather than in whatever the frame took. It is also what lets the Film phase record in one pass, and the Direct phase re-run a single shot by seeking.
now( ) → number
The current film time, in seconds.
running( ) → boolean
Whether the film is running.
advance( ) → number
Director only. Advances the clock one fixed step and returns the new time.
advanceBy(step: number) → number
Director only. Advances the clock by a stated amount and returns the new time. The film's picture is recorded a frame at a time on the fixed STEP above; its SOUND is recorded in a second pass where the clock has to follow the wall clock instead, because the mixer plays in real seconds and a bed whose gain is ramped on a fixed step drifts away from the audio it is shaping as soon as the frame rate is not the film's rate.
| arg | type | description |
|---|---|---|
| step | number |
set(v: number) → void
Director only. Jumps the clock (used to start, to reset, and to seek).
| arg | type | description |
|---|---|---|
| v | number |
setRunning(v: boolean) → void
Director only.
| arg | type | description |
|---|---|---|
| v | boolean |
ramp(a: number, b: number) → number
0 at `a`, 1 at `b`, clamped outside. The workhorse for "ramp this thing across this window of the film" — a light that warms, a fog that thickens, an emitter that spins up.
| arg | type | description |
|---|---|---|
| a | number | |
| b | number |
smoothRamp(a: number, b: number) → number
`ramp`, eased with a smoothstep. Use this for anything a viewer watches change — a linear ramp reads as mechanical.
| arg | type | description |
|---|---|---|
| a | number | |
| b | number |
past(mark: number) → boolean
True once the film has passed `mark`.
| arg | type | description |
|---|---|---|
| mark | number |
within(a: number, b: number) → boolean
True while the film is inside [a, b).
| arg | type | description |
|---|---|---|
| a | number | |
| b | number |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.