The timingsrc library implements the timing object programming model. This document briefly introduces the following concepts and provides links for further documentation.
Note that the timingsrc library implements Immediate Events semantics for many of its event types.
// regular script import - 'TIMINGSRC' property on global object var timingsrc = TIMINGSRC; // require js module import var timingsrc = require("./timingsrc"); // use the module var timingObject = new timingsrc.TimingObject();
The timingsrc library is available from GitHub.
The timing objects is the basic concept of this programming model. You may think of it as an advanced stop-watch. If you start it, its value progresses as a clock, until you pause or resume it later. The timing object additionally supports behavior like time-shifting, different velocities (including backwards), and acceleration.
- TimingObject Background
- TimingObject API
- TimingObject Example (page-local)
- TimingObject Example (multi-device)
Timing converters are a special kind of timing objects that depend on an other timing object. Timing converters are useful when you need an alternative representations for a single timing object. For instance, timing converters may be used to shift or scale the timeline.
- TimingConverter Background
- TimingConverter API
- TimingConverter Example (page-local)
- TimingConverter Example (multi-device)
Timing objects may become multi-device by connecting with an online timing provider. Shared Motion by Motion Corporation implements the Timing Provider API and can therefore be used directly with the timing object.
Given a timing object, a common challenge is to correctly align timed data. This challenge is known under many names; timed events, triggers, upcalls etc. Such timed data are also commonly collected into scripts, tracks, logs or time-series. Here the term sequencing broadly refers to the translation of timed data into timed execution. We are not making any distinction concerning the specific type of data, and instead aim to provide generic mechanisms useful for a wide variety of applications.
setPointCallback and setIntervalCallback are simple tools inspired by setTimeout and setInterval. setPointCallback triggers a callback when the timing object passes by a specific point on the timeline. setIntervalCallback is associated with periodic points along the timeline.
The Sequencer is a more sophisticated tool designed to work on larger sets of points and intervals. Both emit enter and exit events as intervals becomes active or inactive, but differ in how they define this condition.
- Sequencer Background
- Sequencer API
- Sequencer Usage
- Default Sequencer Example (page-local)
- Default Sequencer Example (multi-device)
- Window sequencing Example (page-local)
- Window sequencing Example (multi-device)
Media Synchronization Tools