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

next Reference

Detect separation of messages

next

Description

Sends a bang out its left outlet when an incoming message is not part of the same Max "event" as a previous message. (An "event" is a mouse click, key press, MIDI event, or tick of the scheduler.) Otherwise, next sends a bang out its right outlet.

Examples

next detects when separate Max messages occur within the same logical event

Discussion

next is useful for doing something once per dump of an object such as coll.

Arguments

None.

Attributes

Common Box Attributes

Messages

bang

Performs the same as anything.

int

Arguments

input [int]
Performs the same as anything.

float

Arguments

input [float]
Performs the same as anything.

anything

Arguments

input [list]
Messages are tested to determine whether they are part of the same logical event. A logical event is one of the following: a mouse click, the ongoing polling of a mouse drag, an event generated by the scheduler (such as the bang from a metro), a MIDI event, or a keyboard event. next determines whether the current message is part of the same event as the previously received message. For example, if you click on a bang twice, the two bangs are not part of the same logical event. But if you put bang, bang in a message box, or use the uzi object to send out two bangs in a row, these bangs are part of the same logical event.

Output

bang

Out left outlet: A bang is sent out if the current message is not part of the same logical event as the previously received message.

Out right outlet: A bang is sent out if the current message is part of the same logical event as the previously received message.

See Also

Name Description
uzi
defer
delay