Need logical calculation/control actor suggestion
-
Hi all,
I am trying to find the right actor to interpret more than one value of "if then": I have 8 sensors each outputting 1 when on, 0 when off. I'm trying to find an actor that can do "if all 8 values are 0, then output 1 or trigger".
I've tried the Lookup actor, but it doesn't seem to do what I want.I'm sure this is quite easy, but I can't seem to find the right actor for it.
Thanks very much
-
Comparator actor?
-
Hi @Skulpture,
I need to compare 8 values though. If all 8 values = 0 then output 1.
If there any actor that can compare more than 1 values?
Thanks!
-
this is quite easy: use four calculator actors for the input values, then another two to get the summary of two pairs and another one to get the summary from them. Then take a comparator actor that is looking for zero, if zero then the output is one otherwise zero. See attached image.
Best
Michel
-
Seems like an ideal place for the javascript actor.
Also very minor bug report - it says compatator in the help for the comparator actor (see Skulptures post above) -
Michel was faster...
-
@[Michel](http://troikatronix.com/troikatronixforum/profile/9/Michel)YES!!! This is it! So simple, but need intelligent brains to show me the way. Thanks so much! -
Or paste the following into a javascript actor with 8 inputs
function main(){ total=0; for (i=0;i<8;i++) { total+=arguments[i] } return total>0; }
-
Well spotted @gavspav ;)
-
The javascript method is great.
But another very simple one can be setup using the 'Lookup' actor.It will output 0 if the 'compare' input is not found in the X (eight for this case) inputs.Otherwise it will say which input matches the 'compare'If your binary values run into eight value inputs, and you compare '1', you will receive a '0' if all of your eight values are not 1, and a value between 1 and 8 if there is a match. -
Thats great too!
Another way - how about the Maximum actor with 8 inputs.The advantage of this is that the 8 value inputs are 'active' - with the lookup actor you have to keep sending '1' to the compare input every time you want the actor to do its thing.Sorry if I'm getting a bit anal. On the same note here's a rewrite of the javascript:function main() { for (i=0;i<8;i++) { if (arguments[i]==1) { return 1; break; } } return 0; }
-
yep the maximum actor is even simpler to setup.
-
yes,Maximum is an easier choice than lookup.Its probably the easiest native Isadora solution. -
-
and thank you @gavspav
I just realized you've already suggested it as well. i'll try the javascript actor too, just for fun. cheers. -
the tutorial on Javascript for Isadora might be worth a read.
http://troikatronix.com/support/kb/getting-started-with-javascript/