HELP (stupid and mysterious?) format error - For structure within a MIDI responsive sketch

I assume you want if (this.pitch == 30) {

(please note the if AND a double == here)

  • for is repeating some lines of code a few times. A for-loop is not an if-clause.

  • An if-clause is executing the code inside { .... } ONLY when the condition is true.

Remark

The correct term for a for-loop would be for(int i=0; i<10; i++) { ... } which would increment i 10 times and repeat everything inside { … }

2 Likes