ION • Trigger scenes in Isadora

Hello,

Idea - Use an ION to trigger scenes in Isadora.

I’m working on a dance piece here at CalArts and I’m trying to trigger a jump to the next scene through the ION. I don’t have a MIDI interface for the Mac, I would like to use something over ethernet, just not sure what to use or where to begin.

Thanks!

Parents Reply Children
  • Mark Coniglio, creator of Isadora here. Good morning. ;-)

    For sure, MIDI is probably the simplest solution. But the Eos console also sends UDP... and perhaps there is a way to simulate an OSC message with an Eos console.

    For example, you could send the following 20 byte-long chunk of data -- which is a simple OSC message. (NOTE: please view the bit below with a monospaced font if possible -- It will make much more sense!)

                                   1  1  1  1  1  1  1  1  1  1

     0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5  6  7  8  9

    -----------------------------------------------------------

    2f 69 73 61 64 6f 72 61 2f 31 00 00 2c 69 00 00 00 00 00 01

    -----------------------------------------------------------

    /  i  s  a  d  o  r  a  /  1         ,  i

    • bytes 0 - 9 (inclusive) = "/isadora/1"
    • bytes 10-11 = 0 (padding - next chunk must be start on a 4 byte boundary -- note that their must be at _least_ one 0 here to terminate the string!)
    • bytes 12-13 = ",i" = integer 'type tag' - indicates a single value of type integer
    • bytes 14-15 = 0 (padding - next chunk must start on a 4 byte boundary)
    • bytes 16-19 = the number '1' as an integer.

    If you wanted a simple trigger, and you could send the exact hex string above. The message shown above would be received by a Isadora "OSC Listener" actor that is set to channel 1. The value it would receive would be the integer number 1.

    You could trigger a different OSC listener by changing the 'channel number' -- i.e., the number that comes after the second slash '/' in the address string. E.g., to send to channel 14 you'd use an address of "/isadora/14" (Note that, for this address, you would then need to reduce the number of padding bytes.)

    You can send a different integer value by changing the last four bytes. Note that this integer value is in "network order", i.e,. big endian order, with the most significant byte first. If you wanted to send the decimal number 4660, (which, in hex, is 1234) the last four bytes of the message would be 00 00 12 34. This endian order is _not_ the same as one would encounter on an Intel processor.

    You would send this message using UDP to the IP address be the target computer using port number 1234. (That is the default port number -- it can be changed in Isadora's preferences.)

    Phew! I think that's it. I hope that the Eos can send a string with all that nasty hex stuff in it. (Usually it's the 0 padding that is most problematic.) I'll let an ETC/Eos expert help out with that.

    Hope that helps.

    Best Wishes,
    Mark

  • Eos currently only sends text strings over UDP, so it is currently not possible to send OSC messages through the UDP string interface.

    We plan to add this ability in a future version by allowing the user to type a series a numbers into the text string, then Eos will send them as raw byte data instead of the text the user typed. This would be similar to what we allow now with the [MIDI Raw] strings. We may also add a specific [OSC] command to make entering and reading OSC messages easier when they are entered as text.

     

  • I know this is an old thread, but I thought I'd share my experience with this. I was able to successfully use an ION to drive an Isadora setup. I wrote a script in Node.js that listened to the UDP from the console then spat out some OSC to Isadora. It's quite a simple setup really. If you're interested just PM me or shoot me an email. Email is my ETC forum username at gmail.

  • I'll start out by saying that this is a very techy solution to making this work, but it's also very simple. This will work both on Mac and PC. I recommend reading through everything so you know what's going on. Some of the logic of the app I'm doing in javascript because it's easier than doing it in Isadora. You could actually have Isadora always handle the raw strings if you wanted.

    1205.eos family isadora.zip

     

    A few terms:

    • UDP (user datagram protocol)- a networking protocol that is connectionless (meaning no confirmation is ever made, messages are just fired into the dark hoping they reach their destination- this is simple and fast)
    • OSC (open sound control)- this is just UDP strings formatted in a certain way
    • String- well, it's a string of text

     

    If you've read the thread on the ETC forums Mark Coniglio (creator or Isadora) mentions that OSC (which Isadora happens to support) is actually just a UDP string. All Eos family consoles support sending UDP strings. This gets us close to our solution but doesn't quite all work out because Eos family consoles only allow you to send strings, not raw bytes. Now, yes, I'm sure you could figure out how to send raw bytes, but it's easier to type in english rather than using character codes.

     

    With this in mind we need a middle man that can take our UDP strings from the console and spit it out as OSC for Idadora. Node.js is a perfect solution to make this work. It's actually a server side javascript engine. (Traditionally javascript is used in web browsers, but in recent years it's been used for other things because of it's easy and fast scripting abilities.

     

    First thing you need to do: go install node.js (hint: google is your friend.)

     

    Below is some code is used just yesterday to trigger a simple fade in Isadora.

     

     

    var app = require('express').createServer();

    var dgram = require('dgram');

    var server = dgram.createSocket("udp4");

    var osc = require('./node_modules/omgosc/omgosc.js');

     

    var sender = new osc.UdpSender('127.0.0.1', 1234);

    var udpListener=dgram.createSocket('udp4');

     

    var running=false;

    var state="off";

    var channel="rfaa";

     

    udpListener.on('message', function(data){

        parseInput(data.toString().trim());

    });

     

    function parseInput(input){

        if(input=="SubDown 24" && !running){

            running=true;

            if(state=="off") imageOn();

            else if(state=="on") imageOff();

            setTimeout(function(){

                running=false;

            }, 2000);

        }

    }

     

    function imageOn(){

        sender.send('/'+channel,'s', ['on']);

        state="on";

    }

     

    function imageOff(){

        sender.send('/'+channel,'s', ['off']);

        state="off";

    }

    udpListener.bind(5001);

     

    This first few lines are simple includes our app is powered by. This are called modules in node. Installing them is supposed to be simple but I had troubles with the OSC module before. Feel free to use the files I have included.

     

     

    The line:

     

    var sender = new osc.UdpSender('127.0.0.1', 1234);

     

    is used to set up our OSC messages that go to Isadora. On this line the 1234 represents the port number. (I believe 1234 is the default Isadora port.) the 127.0.0.1 is a local loopback IP (meaning that it will always refer to the computer it's running on. If you are you going to run this middle man script on a different computer than the one you have Isadora on you need to change 127.0.0.1 to the IP of the Isadora computer.

     

    The line:

     

    var udpListener=dgram.createSocket('udp4');

     

    is used to set up the socket that will receive messages from the console. More on this later.

     

    A few variables to be used:

     

    var running=false; (used to track if the transition is currently running)

    var state="off"; (used to track if the image is on or off)

    var channel="rfaa"; (the OSC channel Isadora will listen for, this can be anything you want)

     

     

    The lines:

     

    udpListener.on('message', function(data){

        parseInput(data.toString().trim());

    });

    are used to receive messages from the console. Every time the console sends ANYTHING this will be run. The trim function takes off any extra whitespace on the end (line breaks & spaces).

     

    The lines:

     

    function parseInput(input){

        if(input=="SubDown 24" && !running){

            running=true;

            if(state=="off") imageOn();

            else if(state=="on") imageOff();

            setTimeout(function(){

                running=false;

            }, 2000);

        }

    }

    are the meat of this app. First it checks to see that the input string is and that the transition is not currently running. This particular app I used was fired whenever the submaster 24 bump button was pressed. As soon as we fire the app, it sets the running state to true so we can't fire the transition while one is still running. Then, if the image state is off we run the imageOn function. Otherwise if the image state is on, we run the imageOff function. The setTimeout function waits 2000 milliseconds then sets running to be false.

     

    The lines:

     

    function imageOn(){

        sender.send('/'+channel,'s', ['on']);

        state="on";

    }

    this is the OSC that gets sent to Isadora. The first argument ('/'+channel) will be whatever you defined it to be above. The second ('s') means our value will be a string. The third (['on']) is an array of strings. (The [ ] is what makes it an array. If you forget these each character will be send as a separate string.) Finally, we say that the image state is on.

     

    The lines:

     

    function imageOff(){

        sender.send('/'+channel,'s', ['off']);

        state="off";

    }

    are the same as the on function but for off.

     

    And finally:

     

    udpListener.bind(5001);

     

    kicks off the app and tells it to sit and listen forever on port 5001 for UDP strings.

     

    You can actually send anything you want from this to Isadora. Rather then 'on' and 'off' you could send an integer of a scene to activate. I've used a master scene that would just activate other scenes. I've also put an OSC listener in each scene and just had it activate the next scene. In my current implementation I had an envelope generator (set to 2 seconds matched by the 2000 millisecond timeout) that would just change the intensity of the projector actor.

     

    A few other notes:

    • On your console you need to go to displays>setup>show settings>show control and turn on String TX
    • Also set the String TX Port to match whatever you have in the udpListener.bind function
    • Also set the String TX Address to be the IP address of whatever computer you have node.js on
    • Be sure to turn on String MIDI TX (this enables the console to send strings like 'subDown' and 'cue' ETC reference
    • Be aware that you can also have the console send custom commands. For one show I did something where I had the console send a message like '5:2' where 5 was the scene number and 2 was the fade duration.

     

     

    If you have any other questions please just ask!



    [edited by: paco3346 at 3:14 PM (GMT -6) on Sat, Mar 16 2013]
Related