"else if" and Monitor Object
Posted: 09 Aug 2012 18:13
Hi!
I have Osculator sending me different OSC values depending on the song position of my sequencer. I can pick up those values in Lemur with a monitor object. The message received by Lemur is "/songloaded/value" and its from 0 to 1. That part works just fine. However, I need to translate the value into a textual message. So, I created a text object named "songcue" and followed the instructions in the manual example on else if statements. The script is associated to the monitor object. Like this:
I've tried "On Expression" and "On OSC" and I'm getting an error flag on the script. I tried replacing "x" with "value" in the script, too.
Anyone willing to help me figure out why I get the error? Or maybe there's a simpler way to do this?
I have Osculator sending me different OSC values depending on the song position of my sequencer. I can pick up those values in Lemur with a monitor object. The message received by Lemur is "/songloaded/value" and its from 0 to 1. That part works just fine. However, I need to translate the value into a textual message. So, I created a text object named "songcue" and followed the instructions in the manual example on else if statements. The script is associated to the monitor object. Like this:
Code: Select all
decl text, val;
val = firstof(x);
if (val==.00) text = 'No Song Cued';
else if (val==.02) text = 'Song One';
else if (val==.11) text = 'Song Two';
setattribute(songcue, 'content', text);
Anyone willing to help me figure out why I get the error? Or maybe there's a simpler way to do this?