More options for Alias controls

Send us your feedback or ask for features.
acidan
Newbie
Posts:28
Joined:06 Feb 2012 13:19
Re: More options for Alias controls

Post by acidan » 15 Apr 2013 10:45

Softcore wrote:Also, as mentioned earlier, by linking the two objects you dont have to midi map both of them - only the one, perhaps thats why they are being "locked" for you?
I think the loop is happening internally as I have only mapped midi to one of the Ring Area objects. The if statement has fixed the problem. Thanks
Last edited by acidan on 15 Apr 2013 16:29, edited 1 time in total.

acidan
Newbie
Posts:28
Joined:06 Feb 2012 13:19

Re: More options for Alias controls

Post by acidan » 15 Apr 2013 16:06

I am trying to target switch 1 of a Switches object (an 8 switch array set to radio mode) from a Pad object on another page (just 1 pad).

the script I have used is: Switches.x=1;

all of the switches are pressed so I know that I am targeting the right object. I'm just struggling with the array part.

Any help would be great.

Cheers

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: More options for Alias controls

Post by Softcore » 15 Apr 2013 21:16

Objects' arrays (vectors in Lemur) are simply accesed by referencing their "index" number in []

The first switch of an 8 switches-object for example would be

Switch.x[0]

;)

So you need

Code: Select all

Switches.x[0]=1;
These things are all covered in the manual though - it would be best if you just gave it a read! ;)

acidan
Newbie
Posts:28
Joined:06 Feb 2012 13:19

Re: More options for Alias controls

Post by acidan » 16 Apr 2013 00:11

Really appreciate your help Softcore, I tried many combinations like this but had the [0] in the wrong place!

I do have the manual and I am slowly starting to understand some basic functions. Ive not had any previous programming experience at all so sorry for asking silly questions.

Switches.x[0]=1; worked a treat! but has given me another problem!

when switching the target radio Switches, the previously selected Switch remains the same colour as if its still selected, as well as the current selected switch

Do I need another script to fix this?

Thanks

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: More options for Alias controls

Post by Softcore » 16 Apr 2013 08:34

No such thing as a silly question! ;)

I see what you mean - not "selected" but "on"...it stays "on"...this is because the "radio" functionality only works when you "touch" the object....

So in essense, what you want is as soon as you tap on that other pad, the first switch is activated (on) and any other switch that was previously on should go "off" (like it would if you use it in "radio" mode)....

So.....

you need this script in your Pad

Code: Select all

decl i;
for (i=1; i<8; i++)
{
Switches.x[i]=0;
}
Switches.x[0]=1;
What this does essentially is giving the "i" variable values from 1 to 7 and then applies the script in the { } ....
So its a "fast way" of saying:
Switches.x[1]=0;
Switches.x[2]=0;
.....
Switches.x[7]=0;

acidan
Newbie
Posts:28
Joined:06 Feb 2012 13:19

Re: More options for Alias controls

Post by acidan » 17 Apr 2013 01:13

I ended up using the latter script u suggested (and obvious now its in front of me!) It works and is easy for me to apply to other objects in my template. I need to read a bit more to understand whats actually happening in the first script.

thanks again :)

Post Reply