Troubleshooting

Vector Issue

Started by MrCorba on .

Sign in or create an account to join the conversation.

3 posts

Topic starter
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
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);
}
Hi
With string functions you can now do something like this
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