Chapter 13
Synchronization

Synchronization between components is in charge of the static sync node, automatically embedded in each object. Its address is /ITL/.../object/sync and it supports messages to add or remove a master / slave relation between components or to query the synchronizations state.

NOTE
A master can naturally have several slaves, but a slave can have several masters as well. In this case, it will be drawn several times, corresponding to each master’s space.

sync PICT

syncIdentifier PICT

Synchronization identifiers indicates 1) the name of an object or 2) the name of an object associated to a mapping name. Using the first form (i.e. without explicit mapping name), the system uses the default unnamed mapping (see section 12.1 p.96 mappings and named mappings).

Synchronization between components has no effect if any of the required mapping is missing (see table 12.1).

EXAMPLE
Synchronizing an object on several masters:

/ITL/scene/myParent/sync mySlave myMaster1;
/ITL/scene/myParent/sync mySlave myMaster2;

Synchronizing two objects using a specific mapping (the second object is assumed to be a symbolic score (gmn, gmnstream or gmnf) which system mapping has been previously requested):

/ITL/scene/myParent/sync mySlave myMaster:system;

13.1 Synchronization modes

Synchronizing a slave component A to a master component B has the following effect:

syncmode PICT

13.1.1 Using the master date

syncHow PICT

The synchronization mode makes use of the master time to graphic mapping to compute the slave position. It may also use the master current date, depending on the following options:

NOTE
Use of the absolute mode may take sense with nested synchronizations: let’s consider an object A, slave of B, which is slave of C. In relative mode and if A and B receive the same clock messages, A will remain at a fixed position on B although it is moving in time.

EXAMPLE
Describing nested synchronizations, the first one using the absolute mode:

/ITL/scene/sync slave masterSlave absolute ;
/ITL/scene/sync masterSlave master ;

13.1.2 Synchronizing an object duration

syncStretch PICT

The synchronization stretch mode has the following effect on the slave dimensions:

By default, no stretching is applied.

EXAMPLE
Synchronizing two objects, aligning the slave duration to the corresponding master space and stretching the slave to the master map vertical dimension:

/ITL/scene/sync mySlave myMaster hv ;

13.1.3 Controlling the slave position

syncPos PICT

The synchronization position mode has the following effects on the slave y position:

The default position mode is syncOver. The y attribute of the slave remains available to displacement (dy).

NOTE
The y position of a synchronized object remains a free attribute. To control this position, you should send dy messages.

EXAMPLE
Synchronizing two objects, aligning the slave duration to the corresponding master space, the slave being below the master map:

/ITL/scene/sync mySlave myMaster h syncBottom;

13.1.4 The syncFrame mode

When the syncFrame mode is used, the slave is placed on the frame of the master. Typically, this frame corresponds to the object bounding box that is also the object default mapping. For ellipses, arcs, lines, polygons, the frame corresponds to the border of the object. The frame duration is the object duration.

Mappings and stretch options are ignored in syncFrame mode.