clip

Limit numbers within a certain range

Description

clip will constrain any numerical input within a specified range.

Arguments

Name Type Opt Description
minimum/maximum int or float opt The first number specifies a minimum limit and the second number specifies a maximum limit, within which all numbers will be constrained before being sent out the outlet. If only one argument is present, it is used as both the minimum and maximum limit. If no argument is present, the minimum and maximum limit is 0.

Messages

int input [int]
In left inlet: The number is sent out the outlet, constrained within the minimum and maximum limits specified by the arguments, inlets, or by a set message. If the number received is a float, it will be sent out as a float.
float input [float]
In left inlet: The number is sent out the outlet, constrained within the minimum and maximum limits specified by the arguments, inlets, or by a set message. If the number received is a float, it will be sent out as a float.
list input [list]
Each number in the list is constrained within the minimum and maximum limits, and the constrained numbers are sent out as a list.
set minimum/maximum [list]
The word set, followed by two numbers, resets the minimum and maximum limits within which all numbers will be constrained before being sent out the outlet.

Information for box attributes common to all objects

Output

float: If the received number is a float, it is constrained within the specified minimum and maximum limits, then sent out the outlet as a float.
int: When an int is received in the inlet, it is constrained within the specified minimum and maximum limits, then sent out the outlet. If the received number is less than the minimum limit, the minimum value is sent out; if the received number is greater than the maximum limit, the maximum value is sent out.
list: When a list is received in the inlet, each number is constrained within the specified minimum and maximum limits, and the numbers are sent out as a list.

Examples

Numbers are always kept within the specified range

See Also

Name Description
maximum Output the greatest in a list of numbers
minimum Output the smallest in a list of numbers
split Look for a range of numbers
< Is less than, comparison of two numbers
<= Is less than or equal to, comparison of two numbers
> Is greater than, comparison of two numbers
>= Is greater than or equal to, comparison of two numbers