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
Switching Off
Re: Switching Off
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.
I've attached an example.
- Attachments
-
- RadioSwitch_Reset.jzml
- (3.65 KiB) Downloaded 128 times
"Having no silence in music is like having no black or white in a painting" - Brian Eno
https://soundcloud.com/mrcorba
https://soundcloud.com/mrcorba
Re: Switching Off
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.
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
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.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.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
Re: Switching Off
x is an expression not an attribute!
Re: Switching Off
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.
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
Oh wow, you're right. Guess I should've tried it first..
Re: Switching Off
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;
ASwitches.x = 0;
Re: Switching Off
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.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro