IannixCursor representation of Iannix app cursor, in sclang
Inherits from: Object : IannixObject
! See first: IannixObject for common variables and methods for all Iannix objects.
Creation / Class Methods
*new (parent, id)
parent - mandatory. must be an instance of Iannix class.
id - if nil: automatically incremented, based on already created object of this type, and default offset for this type.
i = Iannix.new;
c = IannixCursor.new(i); //creation in sclang
c.send; // actually send an osc message to Iannix app for object creation;
c.position_(1, 2, 0) //x, y, z positions
// ... not very useful without a curve ...
Note: Its better to create a cursor this way (automatic indexation, sending and positionning):
i = Iannix.new;
l = i.curve([0@1, 10@1]); //curve creation ( see IannixCurve help file )
c = i.cursor(l); //put the cursor on the curve
Accessing Instance and Class Variables
Doing Some Task
putOnCurve (curve)
curve - a IannixCurve instance.
// example
i = Iannix.new;
l = i.curve([0@1, 10@1]); //curve creation ( see IannixCurve help file )
c = IannixCursor.new(i).send; /// actually send an osc message to Iannix app for object creation;
c.putOnCurve(l);
c.width_(10)
Again, the easiest way is
c = i.cursor(l)
width_ (width)
setting of the width of the cursor, and so its possibility to catch triggers nearby (in this scope)
width - Default value is 0.1
duration_ (duration)
the time for this cursor to reach the end of the curve.
duration - in seconds. Default value is 1.
speed_ (factor)
speed of the cursor.
factor - related to the cursor duration. Default value is 1. Negative value will drive the cursor in the opposite way.
masterSpeed (factor)
Another speed factor, see Iannix app documentation ... :¬ }
factor - Default value is 1.
loopPattern_ (list)
a cycle of speeds.
list - each element in the list represent a speed, negative value will generate a backward movement at this speed.
Note: a zero will stop the cursor, and so end the pattern.
i = Iannix.new;
l = i.curve.asEllipse;
c = i.cursor(l);
c.loopPattern_([1, -1, 0.2, 3, 1, 0])
i.play;
offset_ (initialPoint, startPoint, endPoint)
add bondaries for the cursor path on its curve, and a starting point.
initialPoint - starting point - Default value is 0.
startPoint - lower bondary - Default value is 0.
endPoint - end bondary - Default value is "end".
i = Iannix.new;
l = i.curve([0@1, 5@1]);
c = i.cursor(l);
c.offset_(3, 1, 4);
i.play;
timePos_ (pos)
Instant change of the cursor position, related to the cursor duration.
pos - in seconds. Default value is 0.
mapping_ (outputBondaries, inputBondaries)
A way to change ouput values range for the cursor, using the setBoundsTarget and setBoundsSource functions of Iannix app.
outputBondaries
One must give a the rectangle representing the field for the x/y output values, given four bondaries.
4 values: [ x-top-left-corner, y-top-left-corner, x-bottom-right-corner, y-bottom-right-corner]: bondaries of the output values .
inputBondaries
A way to change the field for actual x/y values of the cursor, with the same method.
the interval in which your cursor is located
Note: the mapping is only in 2D for now.
i = Iannix.new;
l = i.curve([0@0, 5@4]);
c = i.cursor(l);
c.mapping_([0, 10, 2, 0]);
c.messages_(["cursor_value_x", "cursor_value_y"]); // in a way to see the output values in the Iannix app monitor
Examples
...