gatheround
Well-known member
Hey everyone, I'm trying to simplify my code and make the following statements inside a nice/easy FOR loop. I'll be manipulating these variables lots, so being able to address them like an array would help out lots. This code is to change parameters inside a FAUST audio object, but I figure the question is more of a general programming question.
I tried making an array of strings with all of the param names and iterating through that, but it didn't seem to work. Any suggestions? would love to do something like:
Code:
test.setParamValue("enable0", 1);
test.setParamValue("enable1", 1);
test.setParamValue("enable2", 1);
test.setParamValue("enable3", 1);
test.setParamValue("enable4", 1);
test.setParamValue("enable5", 1);
test.setParamValue("enable6", 1);
test.setParamValue("enable7", 1);
test.setParamValue("enable8", 1);
test.setParamValue("enable9", 1);
test.setParamValue("enable10", 1);
test.setParamValue("enable11", 1);
I tried making an array of strings with all of the param names and iterating through that, but it didn't seem to work. Any suggestions? would love to do something like:
Code:
test.setParamValue(enable[i], 1);