Page 1 of 1

Vector Issue

Posted: 21 Apr 2014 12:32
by MrCorba
Hello Wise Masters of the Liine Forum,

I've got a small problem and I can't discover why this isn't working. I've got 16 faders called Vel1, Vel2 etc. I want one button that sets all these faders to zero. I tried to use the code below but for some reason it won't work.
I've tried the set expression on just 1 fader, as in setexpression(Vel1,'x',0), then it seems to work. Does anyone see the error in my code? Cheers

Code: Select all

decl vel={Vel1,Vel2,Vel3,Vel4,Vel5,Vel6,Vel7,Vel8,Vel9,Vel10,Vel11,Vel12,Vel13,Vel14,Vel15,Vel16};
decl i;
for(i=0; i<16; i++);
{
setexpression(vel[i],'x',0);
}

Re: Vector Issue

Posted: 21 Apr 2014 13:52
by Macciza
Hi
With string functions you can now do something like this

Code: Select all

decl i;
for (i=1; i <= 16; i++) {
decl obj = findobject('Vel' + i); 
setexpression(obj, 'x', 0);
}
No vectors needed, just use 'objName'+ i ...
MM

Re: Vector Issue

Posted: 21 Apr 2014 17:56
by MrCorba
Nice! Thanks man!