A newbie question, how to write a loop?
-
How should I write a loop for this situation? I wrote
for (i = 0; i < 12; i++){ ADSR[i].setAttribute(ADSR[i].Attack, value);
does not work.
-
@CatABC that really not enough to tell us where you are going wrong... include the definition and populating of your ADSR named array..
so to set up your array, if you havent already:
const myADSR = []; for (i = 0; i < 12; i++) { myADSR[i] = Synth.getModulator("ADSR" + (i+1)); };
..and in your slider callback...
for (i = 0; i < 12; i++) { myADSR[i].setAttribute(myADSR[i].Attack, value); };
-
@Lindon
Awesome, that's exactly what I wanted, thank you very much!