Specifications

214 Chapter 12 Tasks and Expressions
value is effectively clipped to the range 0 through 1 (as the image can’t be
more than fully opaque or fully transparent). Most parameters work in this
way, with the notable exception of the color hue, as it allows the color wheel to
be rotated multiple revolutions.
Using Relational Operators When using expressions to trigger tasks, it is often useful to specify a threshold
for the triggering value. If the input is used on its own, the task will be triggered
as soon as the input leaves zero. If you prefer the input to exceed a certain
value, you can use a “greater than” operator to test for this:
ModWheel > 0.5
This operator yields a value that is 1 if the value on the left hand side is greater
than the value on the right hand side, otherwise its value is 0. Likewise, if you
want to trigger the task when the value becomes zero (rather than when it
leaves zero), you can write:
ModWheel = 0
This uses the “equals” operator, yielding 1 if the value on the left is the same
as the value on the right, else it yields 0.
Using Logical Operators Occasionally you may want to create more complex triggering conditions,
combining multiple inputs, so that the task will only be triggered when all
conditions are met. That can be accomplished using the “and” operator:
ModWheel > 0.5 && MiddleC
This will trigger the task when the modulation wheel is above 50% and the
MiddleC key is pressed (assuming here that MiddleC is a MIDI Note input).