Iannix osc responder wrapper and command facilities for the Iannix application

Inherits from: Object

Intended to be used with Iannix.app.

http://www.iannix.org/fr/index.php

See also: IannixTrigger, IannixCursor, IannixCurve

Creation / Class Methods

*new (iannixIP, iannixPort, sclangIP)

iannixIP - Iannix.app IP . Default value is "127.0.0.1".

iannixPort - Iannix.app port. Default value is 1234 (see Iannix app documentation).

sclangIP - Default value is "127.0.0.1", required to give Iannix.app the sclang ip, for automatic message formatting

( see the messages_ method, in IannixObject ).

Connects itself to the Iannix application, with a NetAddr instance (see the connect method)

// example

i = Iannix.new;

i.removeAll; //cleaning method

Accessing Instance Variables

synthGroup

An instance of Group, created with the createSynthGroup method (see later)

Transport actions (play, stop... from sclang or from the Iannix.app... see the play/stop methods ) have an effect ( = run(true) or run(false)) on the synths attached to it.

idOffsets

Simply a dictionary defined at Iannix instance startup:

(\triggers: 2000, \curves: 1000, \cursors: 0);

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

iannixAddress

An instance of NetAddr, created at any Iannix instantiation, or by using the connect method

responders

Simply a dictionary of responders ( OSCresponderNode instances), one for each type of Iannix objects (curves, cursors, triggers) .

Responders are created when using the listen method.

triggers

Returns the list of all instances of IannixTrigger created from sclang.

(Note: As long as there is no complete dump message from the Iannix Application, there is no guaranty those objects are still existing in there...)

curves

idem for instances of IannixCurve.

cursors

idem for instances of IannixCursor.

messagePeriods

A Dictionary: default periods for the Iannix app messages, in milliseconds

(\trigger: 1, \cursor: 20)

speed

Current speed value.

objects

Dictionary, as container (created at Iannix instantiation), for the different objects.

Object type, in plural form, as keys: \cursors, \triggers, \curves

transportActions

Dictionary of functions (\play, \stop, \fastrewind as keys) associated with the transport commands.

Defaults functions, created at Iannix instantiation, are oparating on synthGroup: run -> true for \play, or false for \stop and \fastrewind

globalActions

Dictionary, as container, for global functions related to the different object types.

Object type, in plural form, as keys: \cursors, \triggers, \curves

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 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]

//example:

i = Iannix.new;

i.globalActions[\cursors] = {|args|

var cursor_id, cursor_value_x, cursor_value_y ;

#cursor_id, cursor_value_x, cursor_value_y = args; //typical messages sent by Iannix.app cursors

doSomethingBasedOn(cursor_id );

doSomeOtherThingWith(cursor_value_x, cursor_value_y);

};

Note:

you can also define, eventually afterwards, actions for any separate trigger or cursor object:

c = i.cursors[20]; //assuming a group of cursors has already be created

c.action_({|args| ... do something ... });

appObjects

Supposed to store the respective number of objects existing in the Iannix application score.

It needs a transport action (stop, fastrewind) in order to actualise the number of existing objects.

Still buggy (see the info method, down there)

Actions on Iannix

connect (ip, port)

automatically done at Iannix instantiation, but you can use it to change the ip and port of Iannix application.

ip - ip of Iannix application you want to connect from Default value is "127.0.0.1".

port - port of the Iannix application you want to connect to. Default value is 1234.

// example

i = Iannix("127.0.0.1", 1234);

i.connect("98.76.54.32", 3838); //a way to change input ip and port

listen (type, on)

Creates specific osc responders for the different types of Iannix score objects.

Once the responders are created, can by used as 'switch': see the on argument, later.

type - type of Iannix object you want to listen to , from Iannix application; typically, it will be \triggers, \cursors, or \transport.

on - Default value is true. You can stop listening by putting on: false

// example

i = Iannix.new;

i.listen(\triggers, true);

i.listen(\triggers, false);

info

should help to get info on existing objects in Iannix application.

Note: Still buggy, information update is performed on any transport action, but sometimes newly created objects are not taken in account , specially if created from sclang

See also the variable appObjects

removeResponders

remove all the OscResponderNodes created with the listen message

removeAll(total=false)

remove all responders and empty all dictionaries of objects, responders, transport functions, synthgroups ...

sort of cleaning function.

by default, it only removes objects created from sc in the Iannix app score.

if total = true, it removes everything in the Iannix app score.

resetScore (zoom, total=false)

remove all objects created from sclang in the Iannix application score.

zoom -Default value is 100.

calls the removeAll method, so:

by default, it only removes objects created from sc in the Iannix app score.

if total = true, it removes everything in the Iannix app score.

synthGroup and outGroup, if any are also removed

createSynthGroup (server)

creates a Group instance on the choosen server.

Default transport functions send run commands (true or false) on it, so it's better to build all your synths from there.

It also create an outGroup, in order to get fadetimes on transport commands (see later).

server - if nil, the Group will be created on localhost.

// inline example

i.createSynthGroup;

g = Synth(\mySynthDefName, target: i.synthGroup);

fadeTime(in, out)

Act on an outgroup, created just after the synthgroup on the server tree.

The SynthDef(s) you'll use must have an 'out' argument for this function to work.

in - in seconds - Default value: 0.1

out - in seconds - Default value: nil - if not specified, the synth will take the in argument as in and out fade time.

play(speed)

Sends a play command to the Iannix application.

speed - a multiplicant. Default value is the last choosen value, or actual value in Iannix App.

Send a run command to the synth connected to the Iannix synthsgroup

stop

Sends a stop command to the Iannix application.

Send a pause command to the synth connected to the Iannix synthsgroup

fastrewind

Sends a fastrewind command to the Iannix application.

It actually stops Iannix and make it go to start.

It must sometimes be sended twice ( the first send just stops Iannix, without making it go to the start point of the score).

speed_ (value)

Sends a new speed value to the Iannix Application.

value . Default value is 1 - it is a multiplicant.

zoom(value)

Sends a zoom message to the Iannix Application.

value Default value is 100.

center(x, y)

Sets the center point of Iannix Application Score.

x - Default value is 0.

y - Default value is 0.

rotate(x, y, z)

Sets the angle of view in the Iannix Application Score, in degrees.

Without argument: reset to normal view.

x - Default value is 0.

y - Default value is 0.

z - Default value is 0.

// example

i = Iannix.new;

i.rotate(-45, 30, 10);

i.rotate; //back to normal

trigger(xPos, yPos, zPos, send)

Creates a IannixTrigger in sclang, and a corresponding trigger in the connected Iannix application (if send is set to true, which is so by default).

See also IannixTrigger help file.

xPos - horizontal position in Iannix application. Default value is 0.

yPos - vertical position in Iannix application. Default value is 0.

zPos - position in the z plane in Iannix application.

send - Default value is true. Put false if you only want to create a IannixTrigger in sclang, mirroring an already existing trigger in the Iannix application.

curve (pointsArray, xPos, yPos, zPos, send)

Creates a IannixCurve in sclang, and a corresponding curve in the connected Iannix application (if send is set to true).

See also IannixCurve help file.

pointsArray

- a list of Point instances, i.e. the coordinates of the defining point onto the Iannix application score.

- (lasily) accepts different types of point definitions:

a point can be:

- a Point instance (eg. 2@3) , witch will add a point in the 2D plane (x, y).

- a pair (eg. [2, 3]), witch will add a point in the 2D plane. (x, y)

- a triplet (eg. [2, 3, -1]), , witch will add a point in the 3D plane. (x, y, z).

-a couple of lists:

the first list will be a pair or a triplet, witch will respectively represent the coordinates in the 2D or 3D plane,

the second list will contain 4 or 6 elements, defining the bezier start and end tangent , in the 2D or 3D plane:

-2D beziers: [ 2, 2, 0, 2 ] will represent the start tangent (the two first values) and end tangent (the two last values) in the 2D plane => 4 values

-3D beziers: [ 0, -2, 2 , 5, 0, 0 ] will represent the start tangent (the three first values) and end tangent (the three last values) in the 3D plane => 6 values

complete representation of a point with beziers: [ [x, y, (z)], [startTangent_x, startTangent_y, (startTangent_z), endTangent_x, endTangent_y, (endTangent_z)] ]

xPos - position of the starting point on the x plane. Default value is 0.

yPos - position of the starting point on the y plane. Default value is 0.

zPos - position of the starting point on the z plane. Default value is 0.

send - Default value is true. Put false if you only want to create a IannixCurve in sclang, just mirroring an already existing curve in the Iannix application.

// example

i = Iannix.new;

c = i.curve([1@2, 2@3, 3@0, 8@10] );

cursor (curve, send)

Creates a IannixCursor in sclang, and a corresponding cursor in the connected Iannix application (if send is set to true, which is so by default).

See also IannixCursor help file.

curve - the sclang IannixCurve instance it connects to.

send - Default value is true. Put false if you only want to create a IannixCursor in sclang, mirroring an already existing cursor in the Iannix application.

// example

i = Iannix.new;

c = i.curve([1@2, 2@3, 3@0, 8@10]); //curve creation

k = i.cursor(c); //put a cursor on the newly created curve

activate (groupName, bool)

set all objects in the same Iannix application group active or inactive. ! Not related to synths group ! See Iannix application documentation for more info on object activation.

bool - Default value is true.