Scene messages

A scene may be viewed as a window on the score elements. Its address is /ITL/sceneIdentifier where sceneIdentifier is a user defined scene name. A scene named scene is created on startup.

Scene control

The following messages are available at scene level, to control the scene appearance and behaviour:

sceneMsg
  • new: creates a new scene and opens it in a new window.
  • del: deletes a scene and closes the corresponding window.
  • reset: clears the scene (i.e. delete all components) and resets the scene to its default state (position, size and color).
  • foreground: display scene window in foreground of all other windows in the system windows manager.
  • rootPath: rootPath of a scene is the default path where the scene reads or writes a file when a relative path is used for this file. When no value has been specified, the application rootPath is used. Calling rootPath without argument clears the scene rootPath.
  • preprocess: evaluates the input file script and print the result to the log window.
  • load: loads an INScore file to the scene. Note that the OSC addresses are translated to the scene OSC address.

  • fullscreen: requests the scene to switch to full screen or normal screen. The parameter is interpreted as a boolean value. Default value is 0.

  • frameless: requests the scene to switch to frameless or normal window. The parameter is interpreted as a boolean value. Default value is 0.
  • absolutexy: requests the scene to absolute or relative coordinates. Absolute coordinates are in pixels relative to the top left corner of the screen. Relative coordinates are in the range [-1, 1] where [0,0] is the center of the screen. The message parameter is interpreted as a boolean value. Default value is 0.
  • windowOpacity: switch the scene window to opaque or transparent mode. When in transparent mode, the scene alpha channel controls the window opacity (from completely opaque to completely transparent). In opaque mode, the scene alpha channel controls the background brush only. Default value is 0 (transparent).
  • commonMsg: a scene support the common graphic attributes. See section common.
  • forwardingMsg: a scene support message forwading and filtering. See section \fullref{forwarding}.

Example Setting a scene current path:

/ITL/scene rootPath "/path/to/my/folder";

Loading an INScore file:

/ITL/scene load "myscript.inscore";

will load /path/to/my/folder/myscript.inscore into the scene.

Setting a scene to fullscreen:

/ITL/scene fullscreen 1;

Creating a new score named myScore:

/ITL/myScore new;

OpenGl rendering

A scene supports optional OpenGl rendering.

openglMsg
  • opengl: requests the scene to switch to OpenGl or normal rendering. The parameter is interpreted as a boolean value. Default value is 0.

Note: OpenGl rendering improves significantly the performance of graphic operations but at the cost of dirty rendering for text and scores.

Scene queries

A scene may respond to queries regarding its elements:

sceneQuery
  • count: count the number of elements in the scene.
  • rcount: recursively count the number of elements in the scene.
  • swidth: gives the scene width from objects viewpoint (see the note about scene dimensions below).
  • sheight: gives the scene height from objects viewpoint (see the note about scene dimensions below).

Example Counting the elements in a scene:

/ITL/scene get count;
  will give a message like the following as output: 
/ITL/scene count 200;

Note: About the scene dimensions Similarly to any object, the scene width and height (set using the width and height messages) are expressed regarding its parent (i.e. the screen). The swidth and sheight messages give the scene dimensions as seen by embedded objects. They are provided for convenience since the returned values can be computed from the current width and height.

Example Fill a scene with a rectangle:

/ITL/scene/r set rect $(/ITL/scene get swidth) $(/ITL/scene get sheight);