HI!
Can someone give me an example of a script to create a trigger, when pressing a key on a controller, in the actual position of the running cursor.
Here is my script:
I put in BOLD the line than doesn´t work.
function onConfigure() {
//title(“enter title here”);
//ask(“prompt”, “groupName”, “variableName”, defaultValue);
}
function onCreate() {
run (” add curve 1 “)
run (” setpos current 0 0 0 “)
run (” setpointsellipse current 5 5 “)
run (” add cursor 2 “)
run (” setcurve current lastCurve “)
run (” setspeed current 50 “)
run (” setPattern current 0 0 1 “)
run (” add trigger 23 “)
run (” setpos current 4 3 0 “)
run (” add trigger 25 “)
run (” setpos current -4 -3 0 “)
}
function onMessage(protocol, host, port, destination, values) {
if((protocol == “midi”) && (destination == “cc”) && (values.length > 2)) {
var channel = parseInt(values[0]);
var cc = parseInt(values[1]);
var val = parseInt(values[2]);
if (cc == 32) {
run (” add trigger auto “)
run(“setPos current ” + cursor_value_x + ” ” + cursor_value_y + ” 0″);
}
}
}
Thank´s
Andrés