change~

Report signal direction

Description

The change object will watch an incoming signal and report a value of 1. when its value increases, a value of -1. when the signal decreases, or a value of 0. when there is no change.

Arguments

None.

Messages

float input [float]
You can set the value stored with a float.
signal Any signal to be watched for changed and unchanged values.

Information for box attributes common to all objects

Output

signal: When the current sample is greater in value than the previous sample, change~ outputs a sample of 1. When the current sample is the same as the previous sample, change~ outputs a sample of 0. When the current sample is less than the previous sample, change~ outputs a sample of -1.

Examples

Detect whether a signal is increasing decreasing or remaining constant

See Also

Name Description
edge~ Detect logical signal transitions
thresh~ Detect signal above a set level
zerox~ Detect zero crossings