A newer version of Max is available. Click here to access the latest version of the Max documentation

change Reference

Filter out repetitions

change

Examples

Arguments

input [number]

Optional

The value to check for repetition.

Inlets

input [number]

The value to check for repetition.

Outlets

out [number]

Outputs the incoming value if the incoming value is different from the last received value.

nonzero [number]

Outputs a value of 1 any time the incoming value transitions from zero to non-zero.

zero [number]

Outputs a value of 1 any time the incoming value transitions from non-zero to zero.

Fixed Attributes

These attributes must be set in the object box and determine the behavior of the object at runtime.

mode [enum] (default: default)

Sets the detection mode. By default (0) the left outlet outputs a value if it is different than the previous value. When set to inc, outputs a value of 1 only when the incoming value is greater than the previous value. When set to dec, outputs a value of -1 if incoming value is less than previous value.

Possible values:

0 = 'default'
1 = 'inc'
2 = 'dec'

Dynamic Attributes

These attributes can be modified in the code during execution using the set object

input [number]

The value to check for repetition.

reset [bang]

reset

See Also

Name Description
change Filter out repetitions of a number
change~ Report signal direction
edge~ detect logical signal transitions
thresh Detect input above a certain level
list.change Filter out repetitions (similar to zl.change)