/* * IanniX Score File */ /* * This method is called first. * It is the good section for asking user for script global variables (parameters). * * This section is never overwritten by IanniX when saving. */ function askUserForParameters() { //title("The title of the parameter box"); //ask("Group name of the parameter (only for display purposes)", "Parameter label", "myGlobalVar", "theDefaultValue"); } /* * This method stores all the operations made through IanniX scripts. * You can add some commands here to make your own scripts! * Scripts are written in Javascript but even with a limited knowledge of Javascript, many types of useful scripts can be created. * * Beyond the standard javascript commands, the run() function is used to send commands to IanniX. * Commands must be provided to run() as a single string. * For example, run("zoom 100"); sets the display zoom to 100%. * * To combine numeric parameters with text commands to produce a string, use the concatenation operator. * In the following example center_x and center_y are in numeric variables and must be concatenated to the command string. * Example: run("setPos current " + center_x + " " + center_y + " 0"); * * To learn IanniX commands, perform an manipulation in IanniX graphical user interface, and see the Helper window. * You'll see the syntax of the command-equivalent action. * * And finally, remember that most of commands must target an object. * Global syntax is always run(" "); * Targets can be an ID (number) or a Group ID (string name of group) (please see "Info" tab in Inspector panel). * Special targets are "current" (last used ID), "all" (all the objects) and "lastCurve" (last used curve). * * This section is never overwritten by IanniX when saving. */ function makeWithScript() { //Clears the score run("clear"); //Resets rotation run("rotate 0 0 0"); //Resets score viewport center run("center 0 0"); //Resets score zoom run("zoom 100"); } /* * When an incoming message is received, this method is called. * - tells information about the nature of message ("osc", "midi", "direct…) * - and gives the origin of message, specially for IP protocols (for OpenSoundControl, UDP or TCP, it is the IP and port of the application that sends the message) * - is the supposed destination of message (for OpenSoundControl it is the path, for MIDI it is Control Change or Note on/off…) * - are an array of arguments contained in the message * * This section is never overwritten by IanniX when saving. */ function onIncomingMessage(protocol, host, port, destination, values) { //Logs a message in the console (open "Config" tab from Inspector panel and see "Message log") console("Received on '" + protocol + "' (" + host + ":" + port + ") to '" + destination + "', " + values.length + " values : "); //Browses all the arguments and displays them in log window for(var valueIndex = 0 ; valueIndex < values.length ; valueIndex++) console("- arg " + valueIndex + " = " + values[valueIndex]); } /* * This method stores all the operations made through the graphical user interface. * You are not supposed to modify this section, but it can be useful to remove some stuff that you added accidentaly. * * Be very careful! This section is automaticaly overwritten when saving a score. */ function madeThroughGUI() { //GUI: NEVER EVER REMOVE THIS LINE run("zoom 1916"); run("center 32.0674 0.69712"); run("add curve 1"); run("setpos current 0 0 0"); var points1 = [ {x: -5, y: 0, z: 0, c1x: 0, c1y: 0, c1z: 0, c2x: 0, c2y: 0, c2z: 0}, {x: 400, y: 0, z: 0, c1x: 0, c1y: 0, c1z: 0, c2x: 0, c2y: 0, c2z: 0}, ]; for(var i = 0 ; i < points1.length ; i++) run("setpointat current " + i + " " + points1[i].x + " " + points1[i].y + " " + points1[i].z + " " + points1[i].c1x + " " + points1[i].c1y + " " + points1[i].c1z + " " + points1[i].c2x + " " + points1[i].c2y + " " + points1[i].c2z); run("add cursor 2"); run("setcurve current lastCurve"); run("setpos current -5 0 0"); run("setwidth current 149"); run("setboundssourcemode current 3"); run("setmessage current 20, osc://ip_out:port_out/curve collision_curve_id collision_curve_group_id collision_value_x collision_value_y 0 collision_xPos collision_yPos 0 , tcp:// curve collision_curve_id collision_curve_group_id collision_value_x collision_value_y 0 collision_xPos collision_yPos 0 ,"); run("setboundssource current -7.500 7.500 -73.000 55.000 -0.250 -0.250"); run("setdepth current 0"); run("add curve 3"); run("setpos current 0 0 0"); var points3 = [ {x: 0, y: 0, z: 0, c1x: 0, c1y: 0, c1z: 0, c2x: 0, c2y: 0, c2z: 0}, {x: 32, y: 33, z: 0, c1x: 0, c1y: 0, c1z: 0, c2x: 0, c2y: 0, c2z: 0}, {x: 32, y: 4, z: 0, c1x: 0, c1y: 0, c1z: 0, c2x: 0, c2y: 0, c2z: 0}, {x: 65, y: 4, z: 0, c1x: 0, c1y: 0, c1z: 0, c2x: 0, c2y: 0, c2z: 0}, {x: 76, y: -73, z: 0, c1x: 0, c1y: 0, c1z: 0, c2x: 0, c2y: 0, c2z: 0}, {x: 76, y: 55, z: 0, c1x: 0, c1y: 0, c1z: 0, c2x: 0, c2y: 0, c2z: 0}, {x: 137, y: 0, z: 0, c1x: 0, c1y: 0, c1z: 0, c2x: 0, c2y: 0, c2z: 0}, ]; for(var i = 0 ; i < points3.length ; i++) run("setpointat current " + i + " " + points3[i].x + " " + points3[i].y + " " + points3[i].z + " " + points3[i].c1x + " " + points3[i].c1y + " " + points3[i].c1z + " " + points3[i].c2x + " " + points3[i].c2y + " " + points3[i].c2z); run("add curve 4"); run("setpos current 0 46 0"); var points4 = [ {x: 0, y: 0, z: 0, c1x: 0, c1y: 0, c1z: 0, c2x: 0, c2y: 0, c2z: 0}, {x: 25, y: -46, z: 0, c1x: 5, c1y: -9.2, c1z: 0, c2x: -8.4, c2y: 23.8, c2z: 0}, {x: 42, y: -119, z: 0, c1x: 8.4, c1y: -23.8, c1z: 0, c2x: -15, c2y: -9.4, c2z: 0}, {x: 100, y: 1, z: 0, c1x: 15, c1y: 9.4, c1z: 0, c2x: -19.4, c2y: -8, c2z: 0}, {x: 139, y: -79, z: 0, c1x: 19.4, c1y: 8, c1z: 0, c2x: -7.8, c2y: 16, c2z: 0}, ]; for(var i = 0 ; i < points4.length ; i++) run("setpointat current " + i + " " + points4[i].x + " " + points4[i].y + " " + points4[i].z + " " + points4[i].c1x + " " + points4[i].c1y + " " + points4[i].c1z + " " + points4[i].c2x + " " + points4[i].c2y + " " + points4[i].c2z); run("setcoloractive current _cursor_active"); //GUI: NEVER EVER REMOVE THIS LINE } /* * This method stores all the operations made by other softwares through one of the IanniX interfaces. * You are not supposed to modify this section, but it can be useful to remove some stuff that you or a third party software added accidentaly. * * Be very careful! This section is automaticaly overwritten when saving a score. */ function madeThroughInterfaces() { //INTERFACES: NEVER EVER REMOVE THIS LINE //INTERFACES: NEVER EVER REMOVE THIS LINE } /* * This method is called last. * It allows you to modify your hand-drawn score (made through graphical user interface). * * This section is never overwritten by IanniX when saving. */ function alterateWithScript() { } /* * //APP VERSION: NEVER EVER REMOVE THIS LINE * Made with IanniX 0.9.17 * //APP VERSION: NEVER EVER REMOVE THIS LINE */ /* This file is part of IanniX, a graphical real-time open-source sequencer for digital art Copyright (C) 2010-2015 — IanniX Association Project Manager: Thierry Coduys (http://www.le-hub.org) Development: Guillaume Jacquemin (http://www.buzzinglight.com) This file was written by Guillaume Jacquemin. IanniX is a free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */