Page 1 of 1

Bunch Identical functions with pairs of objects... HELP!!!

Posted: 01 Apr 2017 14:14
by johnman51
Hello!

I really need help with my script...
I made a 149 Pads called "TR1, TR2, TR3, ......" and 149 faders called "F1", "F2", "F3", ......


I made a giant scripts that look like this: (My Execution depends on a specific expression)
if (TR1.x) F1.x = (F1.x-(1/254));
if (TR2.x) F2.x = (F2.x-(1/254));
if (TR3.x) F3.x = (F3.x-(1/254));
if (TR4.x) F4.x = (F4.x-(1/254));
if (TR5.x) F5.x = (F5.x-(1/254));
if (TR6.x) F6.x = (F6.x-(1/254));
if (TR7.x) F7.x = (F7.x-(1/254));
if (TR8.x) F8.x = (F8.x-(1/254));
if (TR9.x) F9.x = (F9.x-(1/254));
if (TR10.x) F10.x = (F10.x-(1/254));
if (TR10.x) F10.x = (F10.x-(1/254));
if (TR11.x) F11.x = ...............!!! until F149 !!!................ HELP!!!!

I'm sure there is a way to write it in shorter way but I'm really not good at this...
Is there someone to help me?

Best regards!
John.

Re: Bunch Identical functions with pairs of objects... HELP!

Posted: 03 Apr 2017 16:32
by phase_change
Use a for loop incrementing from 1 to 149