Gen~ [expr] syntax


    Sep 30 2015 | 8:02 pm
    Hey All,
    I'd really appreciate a helping hand, I'm at a standstill. I am working in a larger gen~ patch, involving triggering a loop if the playback pointer if outside of a certain window. I typed up a nice little expr object that works when I test it in a regular patch, but when I try the gen~ version inside of my patch, I am constantly getting two error messages saying "expr missing ')'", and I can't figure out where I'm missing a parenthesis. More importantly, I'm not really clear on the order of operations in expr, and when parenthesis are necessary (they certainly make things look clearer).
    logic: Output 1 if... ($i2$i3) is true; ~OR~ if BOTH of the following are true ($i1$i3).
    typed up as so: [expr (in2in3) || (in1in3)]
    As the above does not work in Gen~ expr, and even after trying a half dozen variations I'm still constantly getting error messages, I come to you for help!

    • Oct 01 2015 | 6:55 am
      [added additional info to original post]
    • Oct 01 2015 | 3:59 pm
      It's a typo (a missing &), which is confusing the GenExpr parser. Try:
      [expr (in2in3) || (in1in3)]
    • Oct 01 2015 | 8:00 pm
      Ah, so simple! Thank you sincerely Graham. I am still learning the operators. You have helped me write my first proper logical expr expression, I'm thankful!
    • Oct 01 2015 | 8:06 pm
      BTW if you prefer English, you can also write:
      [expr (in2 < in3) and ((in1 < in2 or in1 > in3) or (in1 < in2 and in1 > in3))]