I’m attempting to iterate through a section of my inputs, checking if each has reached a threshold, and if so, to set the value of the corresponding parameter. It almost works, but for some reason it turns on/off not only the InputId(i), but also InputId(i+1).


I’ve tinkered with other i values–if i is decrementing, then high gates trigger InputId(i) and InputId(i-1); if i is incrementing by 2, then InputId(i) and InputId(i+2) (and InputIds with even values never get triggered at all); and so on.
I’m aware that iterating through enums in this way might not be the best practice. I’m trying to avoid coding 16 nearly identical if-else statements to cover each input.
I’m new to coding in general, and VERY new to C++ and the Rack API, so feel free to roast me or provided constructive feedback unrelated to the question.