Get\post the index value of a Switches object

Discuss problems and solutions.
Post Reply
Glennzone
Newbie
Posts: 23
Joined: 18 Jan 2013 22:16

Get\post the index value of a Switches object

Post 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 ?
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

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

Post 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.
Attachments
switches-index.jzml
(2.21 KiB) Downloaded 66 times
Post Reply