Introduction | Main elements | Messages sent and received | Graphical interface | Scripts | Reference | Functions index

Version française

## Documentation

IanniX commands must specify a target at each execution:

- `id` refers to a specific object.
  Example: `remove 2`
- `group_id` refers to the entire group that can be a word.
  Example: `remove toto`
- `all` refers to all objects.
  Example: `remove all`
- `current` refers to the last created object.
  Example: `remove current`

## Managing objects

### Adding an object

Adds an object on the score, but does not specify its position (by default, the object is set on (0,0,0)). The key word `auto` automatically assigns an ID to your object.
add <objet> <id>
Example: `add trigger 1`

| Copy / paste this example in IanniX to understand how the code works! `add trigger 1`

### Defining a group

Groups are identified by a number or word you are free to choose. Objects are not required to be part of a group.
setGroup <target> <group name>
Example: `setGroup current triggers`

| Copy / paste this example in IanniX to understand how the code works! `add trigger 1 setGroup current triggers`

### Space position

Sets an object on the score via the coordinates (x, y, z).
setPos <target> <x> <y> <z>
Example: `setPos 1 1 2 0`

| Copy / paste this example in IanniX to understand how the code works! `add trigger 1 setGroup current triggers setPos 1 1 2 0`

### Enable / disable an object

An object is enable by default, but you can disable it.
setActive <target> <0|1>
Example: `setActive 1 0`

| Copy / paste this example in IanniX to understand how the code works! `add trigger 1 setGroup current triggers setPos 1 1 2 0 setActive 1 0`

### Assigning a message

This command sets the message that an object must send.
setMessage <target> <period>, <message1> <variables>, <message2>,message2, message3, …
Example: `setMessage current 1, osc://127.0.0.1:57120/trigger trigger_id trigger_xPos trigger_yPos cursor_id`

Copy / paste this example in IanniX to understand how the code works! `setMessage current 1, osc://127.0.0.1:57120/trigger trigger_id trigger_xPos trigger_yPos cursor_id` | The previously added trigger will respectively send: its ID, abscissa, ordinate and the ID of cursor that triggered. The protocol used is OSC, 127.0.0.1 is the IP address of the computer itself (localhost) and 57120 is the port used for sending

### Deleting an object

Deletes an object in the score thanks to its ID
remove <target>
Example: `remove 1`

| Copy / paste this example in IanniX to understand how the code works! `add trigger 1 setGroup current triggers setPos 1 1 2 0 setActive 1 0 remove 1`

## Trigger

### Time before release (NoteOff)

When a note is played thanks to a trigger, you can configure it to turn the note off automatically after a configurable delay. Note-off time can be set either by this method, which sets the time that is always used for this trigger, or note-off time can be controlled with the duration parameter in the trigger's message. Controlling the off-time in the message allows the time to be controlled some score variables, changing as the score plays. The time before releaseshould normally be set to zero when note-off time is not being sent in the messages of this trigger.
setTriggerOff <target> <delay>
Example: `setTriggerOff current 0.5`

| Copy / paste this example in IanniX to understand how the code works! `add trigger 1 setTriggerOff current 0.5` | The previously created trigger will send a message "note off" after half a second

### Messages & variables related to a trigger

You can use the following variables in the messages sent by the triggers:

- `trigger_id` ID of the enabled trigger
- `trigger_group_id` ID of the enabled group
- `trigger_document_id` name of the project
- `trigger_xPos` abscissa
- `trigger_yPos` ordinate
- `trigger_distance` straight line distance from the trigger to the cursor at the time of collision
- `trigger_value` 127 when the trigger is enabled and 0 when it is disabled
- `trigger_side` 0 when the trigger is on the left of the direction of cursor motion and 1 if on the right

You can also use any of the cursor_ variables of the colliding cursor, or the curve_ variables of the cursor's curve.

## Curve

### Circular curves & ellipses

Ellipses are defined by a major axis and a minor axis. To construct circles, the two axes must have the same value.
setPointsEllipse <target> <width> <height>
Example: `setPointsEllipse current 2 1`

| Copy / paste this example in IanniX to understand how the code works! `add curve 1 setPointsEllipse current 2 1 setPos current 1 1 0`

### Straight trajectory

A curve must be defined a sequence of points. The points index starts at 0.
Note that point coordinates are defined to be relative to the position of the curve object.
For more detail, see the section on drawing curves in the scripting section.
setPointAt <target> <point index> <x> <y>
Example: `setPointAt current 1 3 3`

| Copy / paste this example in IanniX to understand how the code works! `add curve 1 setPos current -1 -1 0 setPointAt current 0 0 0 setPointAt current 1 3 3`

### Bézier curve

To add points to a Bezier curve, use:
setPointAt <target> <path>

Bézier curves are formed from curved line segments defined giving the endpoint of each subsequent segment. The curvature is defined by providing two additonal "control points" to the `setPointAt` function, one to define the direction of the tangent to curve at its start point and the other to control the direction of the tangent to the curve at its end point.

For more detail on drawing with Bezier curves, see the section on drawing curves in the scripting section.

### Text

A character can also be played like a curve.
setPointsTxt <target> <scaling> <font> <text>
Example: `setPointsTxt current 0.1 Arial a`

| Copy / paste this example in IanniX to understand how the code works! `add curve 1 setPos current 0 0 0 setPointsTxt current 0.1 Arial a`

### SVG curve — cubic path

A SVG curve is defined by a path that you can directly import from another software by copy / paste.
setPointsSVG <target> <width> <height> <svg path>
Example: `setPointsSVG current 5 5 M637.599,1569.972c0,0,89.127,0,222.818, 0c8.913,0,18.023,0,27.381,0.113C901, 1570,913,1573,926,1576c67,15,128,43, 198,28c9-2,17.833-4.277,26.554-6.685c8. 72-2.407,17.255-5.074,25.247-8.562C1224, 1567,1239,1514,1256,1469c18-48,69-29, 101-9c81.375,48.125,161.219,103.141, 254.032,110.08c13.259,0.991,26.782, 1.001,40.616-0.129C1716,1574,1788, 1562,1842,1606c39,32,62,97,119, 90c44-6,70-47,101.551-72.846`

| `add curve auto setPointsSVG current 5 5 M637.599,1569.972c0,0,89.127,0,222.818, 0c8.913,0,18.023,0,27.381,0.113C901, 1570,913,1573,926,1576c67,15,128,43, 198,28c9-2,17.833-4.277,26.554-6.685c8. 72-2.407,17.255-5.074,25.247-8.562C1224, 1567,1239,1514,1256,1469c18-48,69-29, 101-9c81.375,48.125,161.219,103.141, 254.032,110.08c13.259,0.991,26.782, 1.001,40.616-0.129C1716,1574,1788, 1562,1842,1606c39,32,62,97,119, 90c44-6,70-47,101.551-72.846 setPos current -3 0 0`

### SVG curve — polygons

The SVG path of these curves is simply a set of points (absolutely positioned).
setPointsSVG2 <target> <scaling> <svg path>
Example: `setPointsSVG2 current 1 1,1 1,2 -1,2 -1,-2 -2,0`

| Copy / paste this example in IanniX to understand how the code works! `add curve 1 setPos current 0 0 0 setPointsSVG2 current 1 1,1 1,2 -1,2 -1,-2 -2,0`

### Automatic vectorization

A curve can be directly constructed from an image by an automatic vectorization.
setPointsImg <target> <scaling> <filename>
Example: `setPointsImg current 0.1 ./Examples/trigger_speaker.png`

| Copy / paste this example in IanniX to understand how the code works! `add curve 1 setPos current 1 2 0 setPointsImg current 0.1 ./Examples/trigger_speaker.png`

### Size

The size of objects can be changed directly.
setResize <target> <width> <height>
Example: `setResize current 2 1`

| Copy / paste this example in IanniX to understand how the code works! `add curve 1 setPointsEllipse current 2 1 setPos current 1 1 0 setResize current 2 1`

## Cursor

### Assign a curve

After creating your cursor, make sur you have assigned the curve you want it to follow. You can use the keyword `lastCurve` to designate the last curve added.
setCurve <cursor target> <curve target>
Example: `setCurve 2 lastCurve`

| Copy / paste this example in IanniX to understand how the code works! `add curve 1 setPointsEllipse current 2 2 setPos current 0 0 0 add cursor 2 setCurve 2 lastCurve`

### Width of the play head

You can edit in real time the width of a cursor in order to enable or disable triggers nearby.
setWidth <target> <width>
Example: `setWidth current 3.5`

| Copy / paste this example in IanniX to understand how the code works! `add cursor 1 setWidth current 3.5`

### Instantaneous position

The position of a cursor can be modified in real time. This instruction does not work if you include it directly in your script, because at each execution, IanniX does a fastrewind.
setTime <target> <time>
Example: `setTime 11 0`

| Copy / paste this example in IanniX to understand how the code works! `add curve 1 setPointsEllipse current 2 2 setPos current 0 0 0 add cursor 11 setCurve 11 1 add trigger 21 setPos current -2 0 0 setMessage current 10, direct:// setTime 11 0`

### Offset

You can choose to start your cursor at a certain point of the curve (marked in seconds) and limit it between certain values (also in seconds).
For example, the 2 4 6 offset means that your cursor will start your curve at the position t=2s then will travel to point t=6s to start again at the point t=4s.
setOffset <target> <initial> <start> <end>
Example: `setOffset current 3 1 7`

| Copy / paste this example in IanniX to understand how the code works! `add curve 1 setPointAt current 1 6 6 setPos current -3 -3 0 add cursor 10 setCurve 10 1 setOffset current 3 1 7`

### Mapping values

You can set your cursor to send values within a chosen interval. For example, if it is operating in a 3x3 square, it can still send coordinates as values between 0 and 1.
Use setBoundsSource to indicate to IanniX the interval in which your cursor is located and setBoundsTarget to set the range of your sent values. Generally BoundsSource is correctly set by default.
You must use the variables `cursor_value_x`, `cursor_value_y`, `collison_value_x` ou `collison_value_y` that values sent are those of BoundsTarget.
setBoundsSource <target> <x-top-left-corner> <y-top-left-corner> <x-bottom-right-corner> <y-bottom-right-corner>
setBoundsTarget <target> <x-top-left-value> <y-top-left-value> <x-bottom-right-value> <y-bottom-right-value>
Example: `setBoundsSource 2 0 3 3 0` et `setBoundsTarget 2 0 1 1 0`

| Copy / paste this example in IanniX to understand how the code works! `add curve 1 setPos 1 0 0 0 setPointAt 1 1 3 3 add cursor 2 setCurve 2 1` setBoundsSource 2 0 3 3 0 setBoundsTarget 2 0 1 1 0 setMessage 2 250, direct:// cursor_value_x cursor_value_y |

### Messages & variables related to the cursor

You can use the following variables in the messages sent by cursors:

- `cursor_id` cursor ID
- `cursor_group_id` group ID of the cursor
- `cursor_document_id` name of the project
- `cursor_xPos` cursor abscissa
- `cursor_yPos` cursor ordinate
- `cursor_time` cursor position on the curve in seconds
- `cursor_time_percent` cursor position on the curve in percent (between 0 and 1)
- `cursor_value_x` abscissa in agreement with the BoundsTarget specified
- `cursor_value_y` ordinate in agreement with the BoundsTarget specified
- `cursor_angle` angle of the cursor relative to the curve
- `cursor_nb_loop` number of cycles on the curve

Cursors can also send information about the curve on which they are located and the curves they intersect.

- `curve_id` ID of the curve affected by the cursor
- `curve_group_id` group ID of the curve
- `curve_document_id` name of the project
- `curve_xPos` abscissa of the first point of the curve
- `curve_yPos` ordinate of the first point of the curve
- `collision_curve_id` ID of the crossed curve
- `collision_xPos` abscissa of the intersection point
- `collision_yPos` ordinate of the intersection point
- `collison_value_x` abscissa of the intersection point in agreement with the BoundsTarget specified
- `collision_value_y` ordinate of the intersection point in agreement with the BoundsTarget specified
- `collision_distance` straight line distance between the collision point and the cursor

## Speed in IanniX

The speed of the cursors is composed of several parameters: `speed`, `speedfactor`, `speedf` and `pattern`.
`speed` is the global speed of the score, `speedfactor` is the speed of the cursor itself, `speedf` is the instantaneous speed of the cursor and `pattern` defines the number and direction of the cycles.
We can thus write the speed of a cursor: (`speed`)x(`speedfactor`)x(`speedf`)x(`pattern`) with `pattern`.

### Speed of the score

You can set the global speed of the score. A negative speed will evolve over time in the negative direction. The speed is a sort of velocity factor that is combined with the speed factor or duration parameter of each cursor to determine the speed, or more intuitively the transit time of the cursor on its curve.

For more details of the determination of cursor speed, see the following section on the "Speed of a Cursor."
speed <speed>
Example: `speed 20`

| `setPointsEllipse current 1 1 setPos current 1 0 0 add cursor 10 setCurve 10 1 add curve 2 setPointsEllipse current 1 1 setPos current -1 0 0 add cursor 11 setCurve 11 2 speed 20`

### Speed of a cursor

Cursors have a speed factor independent of each other. The travel time of a curve is also configurable. The cursor will evolve in the negative direction if the speed is negative, but time will continue to flow naturally.

Cursor speed is best understood by thinking in terms of the time duration required for a given cursor to traverse its path one time. If the master speed of the transport is set to 1.0 (with the "speed" command or the transport slider), and a cursor's time is set to say 10.0 seconds, the cursor will take 10 seconds to traverse the curve once. Doubling the master speed to 2 would cut the transit time of this cursor to 5.0 seconds.Thus each cursor can have it's own transit time (or inversely, speed), proportional to the master speed of the score.

To set the cursor speed in terms of the duration of the transit time, use the following form of the setSpeed command:
setSpeed <target> auto <duration>

To set the speed of a cursor in terms of speed factor (i.e. speed in the same units as used by the master slider) use the following form of the command:
setSpeed <target> <speed factor>
Example: `setSpeed 11 4`

| Copy / paste this example in IanniX to understand how the code works! `add curve 1 setPointsEllipse current 1 1 setPos current -1 0 0 add cursor 10 setCurve 10 1 add curve 2 setPointsEllipse current 1 1 setPos current 1 0 0 add cursor 11 setCurve 11 2 setSpeed 11 4`

### Instantaneous speed of a cursor

Cursors have an instantaneous speed factor independent, very useful for real-time performances. As setSpeed, a negative speed is possible without affecting the global speed of the score.
setSpeedF <target> <speed factor>
Example: `setSpeedF 11 cursor_yPos`

| `add curve 2 setPointsEllipse current 1 1 setPos current 1 0 0 add cursor 11 setCurve 11 2 add curve 1 setPointAt current 1 0 4 setPos current -1 -2 0 add cursor 10 setCurve 10 1 setMessage current 20, direct:// setSpeedF 11 cursor_yPos`

### Pattern

This parameter refers to the direction and the number of cycles. For example, with `1 1 0`, the cursor will perform two cycles in the positive direction before stopping. The equivalent write is `2 0`.
setPattern <target> 0 0 <pattern>
Example: `setPattern current 0 0 1 -1`

| Copy / paste this example in IanniX to understand how the code works! `add curve 1 setPointsEllipse current 2 2 setPos current 0 0 0 add cursor 10 setCurve 10 1 setPattern current 0 0 1 -1`

## Navigating into the scores

### Erasing a score

Erasing all objects into the score
clear

Copy / paste this example in IanniX to understand how the code works! `clear`

### Zoom

Adjust the zoom using the script. The factor is in percent. e.g. A factor of 200 doubles the size of the display area.
zoom <zoomfactor>

| Copy / paste this example in IanniX to understand how the code works! `clear" zoom 2000`

### Resizing objects regardless of zoom

Enabled by default, can automatically increase or decrease the size of the triggers and cursors when you zoom in / out the score in order to facilitate reading. Only the visual aspect is affected, the actual size of the objects is not changed.
autosize <0|1>

| Copy / paste this example in IanniX to understand how the code works! `add trigger 1 zoom 200 autosize 0`

### Placing a point in the center of the screen

Placing the point (x,y) in the center of the workspace
center <x> <y>

| Copy / paste this example in IanniX to understand how the code works! `clear zoom 200 center 2 2`

### Changing the viewing direction

Rotate the view about the x, y and z axes
rotate <RotationAboutX-Axis> <RotationAboutY-Axis> <RotationAboutZ-Axis>

Copy / paste this example in IanniX to understand how the code works! `rotate 45 0 0`

### Playing the score

Enabling the playback
play

| Copy / paste this example in IanniX to understand how the code works! `play`

### Fast Rewind

Back to 000:00.000
fastrewind

| Copy / paste this example in IanniX to understand how the code works! `fastrewind`

## General display of the scores

### Adding text

You can add a text description of your items on the score.Show / hide these descriptions with the button 7 of the toolbar (see Graphic interface).

All types of characters are accepted, there is no limit in number.
setLabel <target> <label>
Example: `setLabel current Hello World !`

| Copy / paste this example in IanniX to understand how the code works! `add trigger auto setPos current 0 0 0 setLabel current Hello World !`

### Size of objects

Unlike setResize, this function modifies the thickness of a curve or a cursor and the size of a trigger.
setSize <target> <size>
Example: `setSize 1 10`

| Copy / paste this example in IanniX to understand how the code works! `add curve 1 add trigger 2 add cursor 3 setCurve 3 1 setPos 2 1.5 1.5 0 setPointsEllipse 1 2 2 setSize 1 10 setSize 2 5 setSize 3 7`

### Paths format

Sets a style dotted with `dash pattern` which must be a sequence of 0 and 1, `dash style` defines the space between each dot.
setLine <target> <dash style> <dash pattern>
Example: `setLine 1 2000 1`

| Copy / paste this example in IanniX to understand how the code works! `add curve 1 setPointsEllipse 1 2.5 2.5 setLine 1 2000 1`

## Colors

You can directly specify the color of an object using HSB or RGB codes with management of the opacity A.
The RGB values range from 0 to 255 and HSB ones range from 0 to 360. The opacity A is between 0 (fully transparent) and 255 (no transparency).

### Color of an active object that does not send any messages

Modify the color of active objects.
setColorActive <target> <variable>
setColorActive <target> <r> <g> <b> <a>
setColorActive2 <target> <h> <s> <b> <a>
Example: `setColorActive 1 0 255 0 255`

| Copy / paste this example in IanniX to understand how the code works! `add trigger 1 setPos 1 1 1 0 setColorActive 1 0 255 0 255`

### Color of an inactive object that does not send any messages

Modify the color of inactive objects.
setColorInactive <target> <variable>
setColorInactive <target> <r> <g> <b> <a>
setColorInactive2 <target> <h> <s> <b> <a>
Example: `setColorInactive 1 0 0 255 255`

| Copy / paste this example in IanniX to understand how the code works! `add trigger 1 setPos 1 1 1 0 setActive 1 0 setColorInactive 1 0 0 255 255`

### Color of an active object that send messages

Modify the color of an active object for which a message has already been set.
setColorActiveMessage <target> <variable>
setColorActiveMessage <target> <r> <g> <b> <a>
setColorActiveMessage2 <target> <h> <s> <b> <a>
Example: `setColorActiveMessage2 1 360 255 255 255`

| Copy / paste this example in IanniX to understand how the code works! `add trigger 1 setPos 1 1 1 0 setMessage 1 250, direct:// message setColorActiveMessage2 1 360 255 255 255`

### Color of an inactive object that send messages

Modify the color of an inactive object for which a message has already been set.
setColorInactiveMessage <target> <variable>
setColorInactiveMessage <target> <r> <g> <b> <a>
setColorInactiveMessage2 <target> <h> <s> <b> <a>
Example: `setColorInactiveMessage 1 0 127 127 200`

| Copy / paste this example in IanniX to understand how the code works! `add trigger 1 setPos 1 1 1 0 setMessage 1 250, direct:// message setActive 1 0 setColorInactiveMessage 1 0 127 127 200`

### Creating a variable color

IanniX can also save a color as a variable for reusing it more easily.
registerColor <variable> <r> <g> <b> <a>
registerColor2 <variable> <h> <s> <b> <a>
Example: `registerColor rougeRGB 255 0 0 255` et `registerColor2 rougeHSB 360 255 255 255`

| Copy / paste this example in IanniX to understand how the code works! `registerColor rougeRGB 255 0 0 255 registerColor2 rougeHSB 360 255 255 255 add trigger 1 add trigger 2 setPos 1 1 2 0 setPos 2 1 1 0 setColorActive 1 rougeRGB setColorActive 2 rougeHSB setLabel 1 1 setLabel 2 2`

## Textures

Customize your score with your own images.
You can directly edit the background of the score or the appearance of the triggers thanks to the following variables:

- `background` background
- `trigger_active` active triggers
- `trigger_inactive` inactive triggers
- `trigger_active_message` active triggers with message
- `trigger_inactive_message` inactive triggers with message

### Creating a variable texture

Save your texture as a variable. If you are using the following variables, the display is directly modified because native textures are saved under those variables. Use the tool "restore triggers original shapes" from the inspector "scripts & styles" to find the original textures.
registerTexture <variable> <x-top-left-corner> <y-top-left-corner> <x-bottom-right-corner> <y-bottom-right-corner> <file name>
Example: `registerTexture trigger_active -1 1 1 -1 ./Examples/trigger_triangle.png`

| Copy / paste this example in IanniX to understand how the code works! `registerTexture trigger_active -1 1 1 -1 ./Examples/trigger_triangle.png add trigger 1 add trigger 2 add trigger 3 setPos 1 1 1 0 setPos 3 -1 -1 0 setActive 3 0 setLabel 1 1 setLabel 2 2 setLabel 3 3`

### Texture of an active object that does not send any messages

Modify the aspect of one active object. You can also use a group name or one of the following variables:
setTextureActive <target> <variable>
Example: `setTextureActive 1 triangle`

| Copy / paste this example in IanniX to understand how the code works! `registerTexture triangle -1 1 1 -1 ./Examples/trigger_triangle.png add trigger 1 add trigger 2 setTextureActive 1 triangle setPos 1 1 1 0 setLabel 1 1 setLabel 2 2`

### Texture of an inactive object that does not send any messages

Modify the texture of an object or a group of inactive objects.
setTextureInactive <target> <variable>
Example: `setTextureInactive 2 triangle`

| Copy / paste this example in IanniX to understand how the code works! `registerTexture triangle -1 1 1 -1 ./Examples/trigger_triangle.png add trigger 1 add trigger 2 setActive 2 0 setTextureInactive 2 triangle setPos 1 1 1 0 setLabel 1 1 setLabel 2 2`

### Texture of an active object that send messages

Modify the texture of an object or a group of active objects with message.
setTextureActiveMessage <target> <variable>
Example: `setTextureActiveMessage triggers triangle`

| Copy / paste this example in IanniX to understand how the code works! `registerTexture triangle -1 1 1 -1 ./Examples/trigger_triangle.png add trigger 1 add trigger 2 setGroup 1 triggers setGroup 2 triggers setMessage 2 1, direct:// message setTextureActiveMessage triggers triangle setPos 1 1 1 0 setLabel 1 1 setLabel 2 2`

### Texture of an inactive object that send messages

Modify the texture of an object or a group of inactive objects with message.
setTextureInactiveMessage <target> <variable>
Example: `setTextureInactiveMessage triggers triangle`

| `registerTexture triangle -1 1 1 -1 ./Examples/trigger_triangle.png add trigger 1 add trigger 2 setGroup 1 triggers setGroup 2 triggers setMessage triggers 1, direct:// message setTextureInactiveMessage triggers triangle setActive 1 0 setPos 1 1 1 0 setLabel 1 1 setLabel 2 2`