Chapter 2
Common messages

Common messages are intended to control the graphic and the time space of the components of a scene. They could be sent to any address with the form /ITL/scene or /ITL/scene/identifier where identifier is the unique identifier of a scene component.

commonMsg PICT

Export of a scene to a given file as jpeg at the current root path:

/ITL/scene export ’myexport.jpg’;

Saving a scene to myScore.inscore at the current root path, the second form saves only the x, y and z attributes, the third form uses the append mode:

/ITL/scene save ’myScore.inscore’;
/ITL/scene save x y z ’thePositions.inscore’;
/ITL/scene save ’myScore.inscore’ ’+’;

Hiding an object:

/ITL/scene/myObject show 0;

2.1 Positioning

PositionMsg PICT

Graphic position messages are absolute position or relative position messages. They can also control an object origin and transformations like rotation around an axis.

2.1.1 Absolute positioning

absPosMsg PICT

Moving and scaling an object:

/ITL/scene/myObject x -0.9;
/ITL/scene/myObject y 0.9;
/ITL/scene/myObject scale 2.0;

2.1.2 Relative positioning

relPosMsg PICT

Relative displacement of an object:

/ITL/scene/myObject dx 0.1;

2.1.3 Components origin

The origin of a component is the point (xo, yo) such that the (x, y) coordinates and the (xo, yo) point coincide graphically. For example, when the origin is the top left corner, the component top left corner is drawn at the (x, y) coordinates.

originMsg PICT

Setting an object graphic origin to the top left corner.

/ITL/scene/myObject xorigin -1. ;
/ITL/scene/myObject yorigin -1. ;

2.2 Components transformations

A component tranformation specifies 2D transformations of its coordinate system. It includes shear and object rotation.

transformMsg PICT

Rotating an object graphic on the z axis.

/ITL/scene/myObject rotatez 90. ;

NOTE angle and rotatez are equivalent. angle has been introduced before the transformation messages and is maintained for compatibility reasons.

2.3 Color messages

ColorMsg PICT

Color messages are absolute or relative color control messages. Color may be expressed in RGBA or HSBA.

2.3.1 Absolute color messages

absColorMsg PICT

red, green, blue, hue, saturation, brightness, alpha messages address a specific part of a color using the RGB or HSB scheme.

colorvalue PICT

The value may be specified as integer or float. The data range is given in table 2.1. When the alpha component is not specified, the color is assumed to be opaque.

Componentinteger range float range

red [R] [0,255] [-1,1]
green [G] [0,255] [-1,1]
blue [B] [0,255] [-1,1]
alpha [A] [0,255] [-1,1]
hue [H] [0,360] [-1,1] mapped to [-180,180]
saturation [S] [0,100] [-1,1]
brightness [B] [0,100] [-1,1]

Table 2.1: Color components data ranges when expressed as integer or float.

The same alpha channel specified as integer value or as floating point value:

/ITL/scene/myObject alpha 51 ;
/ITL/scene/myObject alpha 0.2 ;

2.3.2 The color messages

color PICT

color sets an object color in the RGBA space. When A is not specified, the color is assumed to be opaque. Default color value is [0,0,0,255].

2.3.3 The hsb messages

hsb PICT

hsb sets an object color in the HSBA space. When A is not specified, the color is assumed to be opaque.

2.3.4 Relative color messages

relColorMsg PICT

Moving a color in the RGBA space:

TL/scene/myObject dcolor 10 5 0 -10 ,

  will increase the red component by 10, the blue component by 5, and decrease the transparency by 10.

NOTE Objects that are carrying color information (images, SVG) don’t respond to color change but are sensitive to transparency changes.

2.4 Pen control

Pen messages accepted by all the components and result in 2 different behaviors:

penMsg PICT

penstyle PICT

The pen style default value is solid.

Setting a rectangle border width and color:

/ITL/scene/rect set rect 0.5 0.5 ;
/ITL/scene/rect penWidth 2. ;
/ITL/scene/rect penColor 255 0 0 ;

2.5 The ’effect’ messages

The effect message sets a graphic effect on the target object.

effectMsg PICT

NOTE An effect affects the target object but also all the target slaves.

2.5.1 The blur effect

blurParams PICT

Blur parameters are the blur radius and a rendering hint. The radius is an int32 value. By default, it is 5 pixels. The radius is given in device coordinates, meaning it is unaffected by scale.

blurHint PICT

Use the performance hint to say that you want a faster blur, the quality hint to say that you prefer a higher quality blur, or the animation when you want to animate the blur radius. The default hint value is performance.

Setting a 8 pixels effect on myObject

/ITL/scene/myObject effect blur 8;

2.5.2 The colorize effect

colorizeParams PICT

Colorize parameters are a strength and a tint color. The strength is a float value. By default, it is 1.0. A strength 0.0 equals to no effect, while 1.0 means full colorization.
The color is given as a RGB triplet (see section 2.3 p.16) by default, the color value is light blue (0, 0, 192).

Setting a red colorize effect on myObject with a 0.5 strength.

/ITL/scene/myObject effect colorize 0.5 200 0 0;

2.5.3 The shadow effect

shadowParams PICT

xoffset and yoffset are the shadow offset and should be given as int32 values. The default value is 8 pixels. The offset is given in device coordinates, which means it is unaffected by scale.
The color is given as a RGBA color (see section 2.3 p.16) by default, the color value is a semi-transparent dark gray (63, 63, 63, 180)
The blur radius should be given as an int32 value. By default, the blur radius is 1 pixel.

Setting a shadow effect on myObject.
The shadow offset is (10,10) pixels, the color is a transparent grey (100,100,100, 50) and the blur is 8 pixels.

/ITL/scene/myObject effect shadow 10 10 100 100 100 50 8;

2.6 The ’edit’ message

The edit message opens a small editor that allows to edit the target object attributes.

effectMsg PICT

Each object maintains the current content of the editor, that is initialized at first edit message or when this content is cleared. Successive call to edit will preserve the editor content unless it is cleared.

NOTE Since the editor preserves its content, it doesn’t take account of changes that may result from received messages and thus may not reflect the target object changes. To synchronize the editor content with the current attributes values, you can clear the editor content, which will refresh the attributes to their current values.

NOTE Although initialized with the target object attributes, the editor supports arbitrary INScore messages, i.e. addressed to any other object or even making use of extended OSC addresses.

Editing an object on double click:

/ITL/scene/myObject watch doubleClick (/ITL/scene/myObject edit);

Editing some specific attributes:

/ITL/scene/myObject watch doubleClick (/ITL/scene/myObject edit x y);