togedge Reference

Report zero/non-zero transitions

togedge

Description

Output bangs for 0-to-1 transitions out the left outlet, and bangs the right outlet for 1-to-0 transitions. Outlets alternate output when bangs are received.

Examples

Used as a detector of on/off status, or to switch back and forth between two triggers

Arguments

None.

Attributes

Common Box Attributes

Messages

bang

Switches the value stored in togedge from 0 to non-zero, or vice versa, and reports the change by sending a bang out one of the outlets.

int

Arguments

input [int]
The number is stored in togedge. If it is not 0, and the previously stored number was 0, togedge sends a bang out the left outlet. If the number is 0, and the previously stored number was not 0, togedge sends a bang out the right outlet. Otherwise, togedge sends no output.

Output

bang

Out left outlet: If the stored value is changed from 0 to not 0.

Out right outlet: If the stored value is changed from not 0 to 0.

See Also

Name Description
change
led
toggle