filter to choose between 2 values

    Dec 06 2013 | 4:03 pm
    i'm stuck at a point where i'm not sure what combination of if / route / gate / select objects i should use.
    i have 2 variables: theta1, theta2 and 4 other variables: a, b, c, d
    i want some kind of 'filter' that says:
    if either 'a' or 'b' are equal to zero, then pass on "theta1"
    if neither 'a' or 'b' are equal to zero, then compare 'c' and 'd'. if c>d then pass on "theta1". if c
    ideas? thanks.

    • Dec 06 2013 | 5:17 pm
      let me see...
      a, b, c, d, theta1, theta2
      [expr ((($f1==0)||($f2==0))*$f5)+(($f1!=0)&&($f2!=0))*((($f3>$f4)*$f5)+(($f3
      you might need to add some [t b f] triggers before the theta inputs.
    • Dec 06 2013 | 5:34 pm
      oh, and you have to add a [prepend set] before the first inlet, to make it _not trigger an output when you _dont want it.
    • Dec 06 2013 | 7:01 pm
      thanks for the reply roman.
      for some reason whenever i trigger an output i get the answer $f5 (theta1) no matter what the case is.
    • Dec 06 2013 | 7:54 pm
      i just got this suggestion from a friend and it works
    • Dec 06 2013 | 8:26 pm
      You're able to state your conditions logically, which is 50% of the job, so all you have to do is implement them in the given language. Here's one way. (The pak object is just for easy input, to let you try different values for the variables; the evaluative code is in the if object.)
    • Dec 08 2013 | 1:41 am
      thanks a lot for the input christopher