Testing for a range of numbers

If you want to detect when a number has occurred that fits within a particular range, you'll want to use logical operators to test conditions such as is less than, is less than or equal to or is greater than this and less than that. Most logical operators send out the number 1 (meaning true) if the condition is met, and 0 otherwise.

Interpolation with the function object

The function object can be used to create line segment functions that control a line~ object, and it can also be used as a lookup table. A number coming in its inlet will be treated as a point on the x-axis, and whatever y-axis value is shown on the line segment function at that point will be sent out the leftmost outlet. This example patch demonstrates that use of function.

Timed counting in Max

The upper example shows how to count from 1 to 10 at a specific rate (e.g., one count every 500 ms) and stop when you reach 10. The metro object sends out a bang message when it is turned on (when it receives a nonzero number in its left inlet), and continues to send out bang every x milliseconds (specified by the typed-in argument or by a number received in its right inlet). You can type in minimum and maximum values as arguments in the counter object.