Appearance
anim-format (runtime format) / ClipClock
Class: ClipClock
a timeline a chain can drive
Implements
Constructors
Constructor
ts
new ClipClock(
host,
round,
fps,
opts?
): ClipClock;Parameters
| Parameter | Type |
|---|---|
host | ClipClockHost |
round | ClockRound |
fps | number |
opts? | ClipClockOptions |
Returns
ClipClock
Properties
| Property | Modifier | Type | Default value | Description |
|---|---|---|---|---|
acc | public | number | 0 | ms toward the next beat |
afterGoto | public | | { then?: "play" | "stop"; to: number; token: number; } | null | null | a gotoAfter waiting for the playhead to leave its frame; token = moves when it was set (any other move voids it) |
backward | public | boolean | false | - |
controlled | public | boolean | false | a synced clip an action took over: its own clock from then on |
direction | public | -1 | 1 | 1 | - |
driven | public | boolean | false | follows its parent's frames (synced) |
fps | public | number | undefined | authored frames per second |
frac | public | number | 0 | fractional playhead: position − frame shown (a speed that is not whole) |
frame | public | number | 0 | the frame shown |
globalFps | public | ClockRamp | null | null | - |
host | readonly | ClipClockHost | undefined | - |
linear | readonly | boolean | undefined | - |
loop | public | boolean | true | back to the first frame at the end |
moves | public | number | 0 | playback chains: bumped by every move an action makes |
ownFps | public | ClockRamp | null | null | - |
playing | public | boolean | true | - |
repeats | readonly | Map<number, number> | ... | repeat counters per frame of the list |
round | readonly | ClockRound | undefined | - |
speed | public | number | 1 | beats move the playhead this far |
stopAt | public | number | null | null | a playTo's frame |
waitMs | public | number | 0 | - |
Accessors
currentFps
Get Signature
ts
get currentFps(): number;frames per second now: own speed, else the root's global one, else fps
Returns
number
position
Get Signature
ts
get position(): number;the playhead position (the frame shown ± a fraction)
Returns
number
Methods
awaitMove()
ts
awaitMove(token, cont): void;cont once the playTo / wait that left moves at token is done and nothing moved the playhead since (else never)
Parameters
| Parameter | Type |
|---|---|
token | number |
cont | () => void |
Returns
void
Implementation of
chainStep()
ts
chainStep(a, scene): ChainStep;one action of a script chain on this clip, as a round of its own
Parameters
| Parameter | Type |
|---|---|
a | PlaybackAction |
scene | string | undefined |
Returns
dropChain()
ts
dropChain(): void;the clip is gone: a waiting chain never goes on
Returns
void
enter()
ts
enter(
f,
actions?,
beat?
): void;the playhead moves to f (actions = its frame actions run; beat = the clock moved it)
Parameters
| Parameter | Type | Default value |
|---|---|---|
f | number | undefined |
actions? | boolean | true |
beat? | boolean | false |
Returns
void
jumpTo()
ts
jumpTo(
f,
then?,
repeat?
): ChainStep;a gotoNow: to f (its actions run), playing or stopped per then; a frame already visited in this round = a loop: the jump is void
Parameters
| Parameter | Type | Default value |
|---|---|---|
f | number | undefined |
then? | "play" | "stop" | undefined |
repeat? | boolean | false |
Returns
play()
ts
play(): void;Returns
void
resetFps()
ts
resetFps(seconds?): void;back to the global speed, over seconds
Parameters
| Parameter | Type | Default value |
|---|---|---|
seconds? | number | 0 |
Returns
void
resetGlobalFps()
ts
resetGlobalFps(seconds?): void;the global speed back to the authored fps, over seconds
Parameters
| Parameter | Type | Default value |
|---|---|---|
seconds? | number | 0 |
Returns
void
runActions()
ts
runActions(
actions,
f?,
external?
): void;Runs playback actions as a CHAIN (runChain, owner 2026-11-05): in order, a playTo / wait holding the rest until it is done, the rest dropped when something else moves that playhead first. f = the frame the list sits on. external = not this clip's own frame actions (a click, a sound's onEnd, the host): then, like actions aimed at another clip, a synced clip they move takes its own clock.
Parameters
| Parameter | Type | Default value |
|---|---|---|
actions | readonly PlaybackAction[] | undefined |
f? | number | ... |
external? | boolean | true |
Returns
void
sceneIndex()
ts
sceneIndex(): number;Returns
number
setFps()
ts
setFps(fps, seconds?): void;this clip's own speed, reached over seconds (0 = at once)
Parameters
| Parameter | Type | Default value |
|---|---|---|
fps | number | undefined |
seconds? | number | 0 |
Returns
void
setGlobalFps()
ts
setGlobalFps(fps, seconds?): void;every clip's speed (those without their own), over seconds
Parameters
| Parameter | Type | Default value |
|---|---|---|
fps | number | undefined |
seconds? | number | 0 |
Returns
void
showAt()
ts
showAt(f): void;stops on frame f (a script's fractional goto / showSection: the host puts the fraction back); its actions run only when the frame changes
Parameters
| Parameter | Type |
|---|---|
f | number |
Returns
void
startPlayTo()
ts
startPlayTo(f): ChainStep;plays forward or backward to f and stops there (no wrap; frames passed run no actions); blocks a chain until it arrives
Parameters
| Parameter | Type |
|---|---|
f | number |
Returns
stop()
ts
stop(): void;Returns
void
stopAll()
ts
stopAll(): void;this clip and every own-clock clip nested in it stop (synced ones follow)
Returns
void
takeControl()
ts
takeControl(): void;a synced clip an action moves keeps its own clock from now on
Returns
void
update()
ts
update(ms): object;Advances time by ms: ramps, waits, a waiting chain, then the beats (each moves the playhead by speed; the frame shown is the position rounded half up and is entered when it changes — owner 2026-11-06). Returns the beats that moved the playhead and the frame time used.
Parameters
| Parameter | Type |
|---|---|
ms | number |
Returns
object
| Name | Type |
|---|---|
beats | number |
frameMs | number |