IannixObject abstract parent class for the different Iannix objects

Inherits from: Object

See also: IannixTrigger, IannixCursor, IannixCurve for more specific variables and methods.

Accessing Instance and Class Variables

group

Returns the Iannix group name for this object, if any.

Default value is nil.

color

Returns the object color, if defined in sclang.

action

Returns the defined action for this object if any.

Default value is nil.

parent

returns the actual Iannix instance this object is related to.

size

Returns the object size, if defined.

Default value is nil.

id

Returns the id associated to this object;

Note:

Objects, in Iannix.app are supposed to have different offsets for their ID: cursors start at 0, curves at 1000, triggers at 2000.

At object creation, from sc, any newly created object will have its id based on these offset, defined in Iannix.idOffsets; those default offsets can be changed.

Actions

send (autoID)

Sends the object, i.e., creates a related object in Iannix application.

autoID - if true, the object ID will be automatically choosen in Iannix application. Default value is false, i.e. the ID is defined from within sclang

position_ (x, y, z)

setting the object position in the Iannix Application Score.

x - Position in the x plane. Default value is 0.

y - Position in the y plane. Default value is 0.

z - Position in the x plane. Default value is 0.

group_ (groupName)

Setting the group name for this object.

Related to the group scheme in Iannix app., and not to any grouping in the sc synth domain.

groupName Default value is nil.

active (bool)

Set this object activation.

bool - Default value is true; if false, this object won't send any message from Iannix app.

autosize (bool)

Objects can be resized when score is zoomed.

bool - Default value is true.

size_ (size)

Setting the size of this object.

thickness_ (thickness)

Setting the thickness of this object

action_ (function)

The Iannix class has a method , globalActions, that affects a global action to all objects of a given type, e.g. to all cursors, or all triggers, etc.

the action_ method defined her is a way to define, or redefine an action, just for this object.

function - The function must have one argument , which will be used as "input" for the Iannix.app osc messages.

This input will be an array of the values sent by the corresponding object in Iannix app: e.g. if the arguments in the sent message are cursor_value_x and cursor_value_y ,

the args input will receive the values output from them, in the form: [ cursor_value_x value, cursor_value_y value]

~inx.cursors[20].action_({|args| ... do something ... });

label_ (text)

Setting a label associated to this object in the Iannix app score.

color_ (colorObject, state)

Setting the color of this object

colorObject - a Color instance

state - an object can have two colors , one in its active state, one in its inactive state

lineStyle_ (pattern, factor)

Sets a dotted style with dash pattern, which must be a sequence of 0 and 1; it defines the space between each dot.

pattern - as openGl patterns (16bit hex, or binary, like 2r1111110011110000)

( see http://fly.cc.fer.hr/~unreal/theredbook/chapter02.html, look at "Stippled Lines" )

factor - each point will be "repeated " x times, depending on this factor

See Iannix_send examples in this folder.

remove

Removes this object, in sclang and in Iannix application.

messages_ (arguments, protocol, messageAddr, port, cmdName)

Messages sent by this object from Iannix application can be set from here.

(In fact, any object created from sclang will automatically have a default message set , with its id as only argument, e.g. "cursor_id" ).

arguments - They must be enclosed in an array.

protocol - can be "osc", "udp", or "midi" (see Iannix app documentation, other protocols (http and direct) are not tested yet - default value: osc

messageAddr - the net address the messages will be sent to - default value: 127.0.0.1 (only relevant for osc and udp)

port - the port messages will use by default will use NetAddr.langPort, in general 57120 (only relevant for osc and udp)

messageAddr and port are respectively 127.0.0.1 and NetAddr.langPort by default, i.e. the messages will be sent back to sclang

Actually, at each object creation in sclang, a default message is set for it, in a way to get back its id from Iannix Application;

cmdName - the "discriminator" for the messages; by default its the object name in Iannix.app

i = Iannix.new;

l = i.curve([0@0, 5@4]);

c = i.cursor(l);

c.messages_(["cursor_value_x", "cursor_value_y"]);

Here, Iannix app will send cursor_value_x and cursor_value_y for this cursor (thru the osc protocol, back to sclang )

the entire message sent by the object from Iannix app will be :

osc://127.0.0.1:57120/cursor cursor_value_x cursor_value_y

in the form: <protocol>://<messageAddr:port>/<cmdName> <arguments>

One can set up a message forwarding to other protocols (and so other applications), eg:

i = Iannix.new;

l = i.curve([0@0, 5@4]);

c = i.cursor(l);

t = i.trigger( x: 1, y: 0);

t.messages_([10 , 36, "trigger_value"], protocol: "midi", cmdName: "note") // an associated message is created for the trigger, to send by midi a note on canal 10, with the value 127 (trigger_value by default)

this trigger will send the following message:

midi://Iannix_Out/note 10 36 127

see Iannix app documentation for message formatting