how to set a dynamic variable that can keep changing? like javascript "var x=1" Thanks!
Asked
Active
Viewed 164 times
1 Answers
0
Hoping I understand your question correctly.
Probably, you wanted to create a variable for a loop:
for(x = 0; x < 11; x++) { ... }
There is two ways to solve this task.
I used "Circle" patch for a dynamic test ("Clear" patch is for filling BG with black color). You need to place an "Iterator Variables" patch inside "Iterator" (by double-clicking "Iterator"). For "Iterator Variables" patch assign Publish Outputs ("Current Index") with right mouse button (slot turns green). You'll see that "Current Index" output on Iterator's patch body. Also you need a "Math" patch with expression a/10 (a = "Current Index").
Connect and setup Low Frequency Oscillator (LFO), Iterator, Math and Circle as shown on the picture.
Or simply use "JavaScript" patch with the following code:

Andy Jazz
- 49,178
- 17
- 136
- 220