Category Archives: isadora

javascript – variable out of the loop

if you want to build a js counter in izzy you have to store the actual number outside of the loop

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* in our main function we establish the variable
*/

function main()
{
var e;
e=0;

//now we are calling the loop part of our main function
main = function()
{
    print(e + " \r");
    e ++;
    return arguments[0] + 1;
}
}

überdruck

We have been happy to support kombinat’s new piece überdruck with our work on the media framework. We used isadora as the playout engine, installed on a mac mini.

Isadora is triggered  by a user pushing the big red buzzer.

Then a combination of randomness, air pressure systems, latex specialty and kombinat’s wisdom in setting the right values will give you an unique experience with this machine.

 

downgrading a mac os system on a new mac

preparing a macmini as an izzy installation machine:

since the macos x installer would not work on a newer system, a work around is to reshape your drive partition with disk utility and add a 8 GB sized partition for the installer. Using the createinstallmedia command from Apple (https://support.apple.com/en-us/HT201372) an installer can be created on your HD / SSD. Problems during installation with slow, faulty USB Sticks are gone and afterwards the partition could be used as a 2nd boot option for the terminal / diskutility or be erased.

isadora – first steps in javascript

Ryan wrote some really good introductions to javascript, which you could find in the knowledge base and on his blog.

In this post I note my experiences and thoughts. So what is a javascript actor ? For me it is similar to a macro or user actor in the sense that we can combine a lot of functionality in one actor.

It has to be coded and there is no way to paste an other actor into the javascript one, but we can look what the other actor is doing and mimic this function.
This sounds strange as we do have all the calculation, trigger value, comparator,scale actors already in isadora but knowing how to do it in javascript opens you the door to much more powerful calculations.

Lets start with a boring example.

Imagine we would have a couple of apple trees and we want to count the apples we harvest a day. In old school izzy we would define how many trees we have (lets say 8) and connect them with calculator actors. To have a cleaner comparison against the js actor we put them in a macro.

The javascript actor will be defined with our 8 inputs and we will write this code into the actor.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function main(){
var tree1 = arguments[0];
var tree2 = arguments[1];
var tree3 = arguments[2];
var tree4 = arguments[3];
var tree5 = arguments[4];
var tree6 = arguments[5];
var tree7 = arguments[6];
var tree8 = arguments[7];

var summe = tree1 + tree2 + tree3 + tree4 + tree5 + tree6 + tree7 + tree8;

return summe;
}

The result is the same, so what is the difference ?

In our macro we needed 7 Calculator actors to combine 8 numbers. In the JS actor we wrote some code. Let’s have a look what the code is actually doing:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// the function Main is the program which is triggered when we change the value of an input
function main(){

//our inputs are arguments for the function and we can work with the values,
//in the way that we define a variable and write the value into it, the arguments[number] points to our input starting with a 0
var tree1 = arguments[0];
var tree2 = arguments[1];
var tree3 = arguments[2];
var tree4 = arguments[3];
var tree5 = arguments[4];
var tree6 = arguments[5];
var tree7 = arguments[6];
var tree8 = arguments[7];

// now we can calculate (add) all the values together
var summe = tree1 + tree2 + tree3 + tree4 + tree5 + tree6 + tree7 + tree8;

// and return (send the variable summe with ) the sum of our calculation to the output
return summe;
}

In our small case we even don’t need to define all the tree variables, we could instead say that all inputs shall be added together:

1
2
3
function main(){
return arguments[0] + arguments[1] + arguments[2] + arguments[3] + arguments[4] + arguments[5] + arguments[6] + arguments[7];
}

In our traditional node based thinking, we had this 8 inputs and our sum at the output. We did the same with the javascript code, actually it looks similar to math equation from school.

We use the “arguments[number]” like an UserInput actor, but what it is to the javascript it is the function input, referenced by a number. The data is in the form of an array.

 “An array is a systematic arrangement of similar objects, usually in rows and columns.”   wikipedia.

That makes a big difference between our macro and the javascript actor. The  moment we define on the js actor how many inputs we have, the array arguments[] will be defined and we can work with this information from inside the js actor.
Jumping back into our apple tree example, this code is using the information how many inputs our arguments array has.

1
2
3
4
5
6
7
8
function main()
{
sum=0;
for(i=0;i<arguments.length;i++){
sum = sum + arguments[i];
}
return sum;
}

and now with comments

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function main() // same like in the code above our program that runs ones an input value is changed
{
var sum=0; // we define a variable and initialize it with a value of 0 (no apples collected yet)

/*we individually add the referenced input value to the sum
here in detail
with arguments.length we extract the number of defined inputs by looking how big the array is
in the for() loop we set an index to 0 --- i=0
and while this index is smaller then the number of our inputs (arguments.length) --- i<arguments.length
the sum is the result of the sum + the referenced input --- sum = sum + arguments[i]
the trick is that we use our index to go step by step through the array extracting the relevant value
ones the sum calculations is done the index is counted up by 1 --- i++ (inside the for() definition)
*/


for(i=0;i<arguments.length;i++){
sum = sum + arguments[i];
}

// ones we looped through all inputs, the value has to be returned
return sum;
}

When our farm grows or we want to sell the program to our neighbor, we don’t have to know how many trees we want to calculate. We have the option to define 1-99 inputs and the script will always work.

In the node based way we would cascade more and more calculators in the macro. Drawing a lot of lines but if there are not used, we couldn’t shrink the user inputs without losing the connection to the calculators resulting in visually big marco being in your patch.

isadora -> chamsys magicq

using isadora as the media engine for grand jeté we wanted to trigger the lighting desk, unfortunately chamsys only opens the midi functions with their proprietary midi / timecode interface

after analyzing the remote ethernet protocol we build an isadora actor

the protocol is a bit nifty, and a proxy is needed to transform the tcp stream into a udp one

the proxy server is established by using net cat with following attributes // you need to change the 2.0.0.20 with the ip of your chamsys console / pc

type in your terminal:

nc -l -k 5555 | nc -u 2.0.0.20 6553

to exit the proxy session press “ctrl + c”

—-

isadora is calculating the bit length of the array and using an increm counter to indicate  how many messages got send previously, you find more informations inside the actor  …

chamsys_actor_b04.izz

chamsys_actor_screensh

bitfields – text parser

an example how to use the text parser and a couple of other actors to retrieve bit values out of a decimal value

used to decode a response showing the installed modules of an analog way seamless switcher

the logical calculators are deconstructing (filtering with a & function and bit shifting) the 16bit value into two bytes  the text formatter is forming the equivalent ascii codes which are finally processed by the text parser

giving the value directly (through a number to text actor) into the text parser ends in errors as  each digit of the value is transformed into the proper ascii character and the relation is lost.

for example

a value of 443 is represented by the hex 01 BB, transformed through the number to text actor gives  a  hex 34 34 33

bitwise textparser

and the izzy patch bitfields_decoding

more on isadora manual  / page 189

testing tcp connections

if you need to check your output and parsing of the tcp actors, an easy way to accomplish this with osx is a small terminal session using nc just type

nc -l 12000

and you can connect to your terminal session at port 12000

message_return terminal message received

isadora – text formatter <-> text parser

pars-format formatparse

Using a text parser / formatter combination to let multiple values flow through one wire. Extreme useful if you need to connect actors in multiple macro patches.

As the Actors having an intelligent way to save cpu cycles they don’t send or parse the same text string ones done. So if you need to send the same values again through the wire , you should add a port and use a changing value as a refresh signal like done heretoggle_2format