Page 1 of 1

Get\post the index value of a Switches object

Posted: 17 Aug 2013 10:47
by Glennzone
I'm trying to send an OSC message for the index value of the selected switch in Switches object (+1).

Within "Switches1" I've created an expression called index :
firstof(Switches1.x)+1

I'm also trying to post that value onscreen in a monitor object using the value Switches1.index

I don't think the index is actually populating with the selected Switches index (+1), and I certainly don't see it showing up in the monitor object.

What am I doing wrong ?

Re: Get\post the index value of a Switches object

Posted: 18 Aug 2013 22:01
by Softcore
I dont think there's anything wrong! It works here! - Keep in mind though firstof(x) when no button is pressed returns the size of the x array (32 in our case).
Also I hope you are planning to use the buttons as "radio" (only one can be "on at a time) or else firstof(x) will only give you the "first" active button index.