Switching Off

Discuss problems and solutions.
Post Reply
joebataz
Regular
Posts: 154
Joined: 28 Feb 2012 16:50
Location: Anthem, AZ USA
Contact:

Switching Off

Post 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
MrCorba
Regular
Posts: 142
Joined: 02 Sep 2013 20:17
Location: Netherlands

Re: Switching Off

Post 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.
Attachments
RadioSwitch_Reset.jzml
(3.65 KiB) Downloaded 127 times
"Having no silence in music is like having no black or white in a painting" - Brian Eno
https://soundcloud.com/mrcorba
ndivuyo
Regular
Posts: 278
Joined: 23 May 2014 00:24

Re: Switching Off

Post 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.
Phil999
Regular
Posts: 919
Joined: 11 Jan 2012 01:53

Re: Switching Off

Post 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.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Switching Off

Post by Softcore »

x is an expression not an attribute! ;)
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Switching Off

Post 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.
ndivuyo
Regular
Posts: 278
Joined: 23 May 2014 00:24

Re: Switching Off

Post by ndivuyo »

Oh wow, you're right. Guess I should've tried it first..
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Switching Off

Post 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;
Phil999
Regular
Posts: 919
Joined: 11 Jan 2012 01:53

Re: Switching Off

Post 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.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
Post Reply