Page 1 of 1
Switching Off
Posted: 08 Apr 2015 19:03
by joebataz
I have 5 sets of switches (16 in each set). They are all configured as radio buttons so within each set I can only have one switch on. BUT under certain circumstances I'd like to be able to turn off ALL the switches in a group.I've tried doing:
setattribute(ASwitches,'x',{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0});
setattribute(ASwitches,'x',{0});
ASwitches.x = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
ASwitches.x = 0;
ASwitches.x = {0};
ASwitches.x ={};
I've also done loops setting each switch off.
I always have one switch on in each group. There's got to be a way to do this, shouldn't there? With the latency I've been seeing lately with Lemur (and WHAT'S up with that????) I need to keep my code tight and small. Any ideas?
Thanks all,
Joe B
Re: Switching Off
Posted: 08 Apr 2015 20:08
by MrCorba
The only way I can think of achieving this is create a pad object with a script which turns off Radio mode, sets buttons to 0 and ten turns Radio mode back on. It may not be the most beautiful way, but Hey it works:D
I've attached an example.
Re: Switching Off
Posted: 08 Apr 2015 23:37
by ndivuyo
Mr. Cobra's method works great for your setup.
Also you could use Pads instead of switches and create a custom expression and use multicolor/light to get the same 'radio' effect and have more control.
Re: Switching Off
Posted: 09 Apr 2015 01:02
by Phil999
ndivuyo wrote:
Also you could use Pads instead of switches and create a custom expression and use multicolor/light to get the same 'radio' effect and have more control.
I think that's the way I've done this as well. Needs only few lines of code and works like radio buttons. I've been away from Lemur for some months, I don't remember exactly.
Re: Switching Off
Posted: 09 Apr 2015 22:03
by Softcore
x is an expression not an attribute!
Re: Switching Off
Posted: 09 Apr 2015 22:06
by Softcore
I dont get what the problem is......
I created a switches object....8 rows, 8 columns...
I set the switches to radio mode.
I then created a single Pad - inside the pad....
script execute on expression x, up arrow
Switches.x=0;
The pad switches OFF succesfully ALL the switches. I know for a fact that "radio" mode has never been "respected" by scripts.
Re: Switching Off
Posted: 10 Apr 2015 00:50
by ndivuyo
Oh wow, you're right. Guess I should've tried it first..
Re: Switching Off
Posted: 10 Apr 2015 11:56
by Softcore
No worries bro! I cant understand why it didnt work for the OP in the first place, as one of his codes "should" work.
ASwitches.x = 0;
Re: Switching Off
Posted: 10 Apr 2015 19:03
by Phil999
I also think one or several options posted by Joe should work. Using 'custom' radio button behavior has the advantage that you get feedback from the software/plugin.