flush

Provide note-offs for held notes

Description

flush keeps track of all note-ons passed through it, and can provide note-off messages for any held note-ons.

Arguments

None.

Messages

bang In left inlet: Immediately sends note-offs for any pitches that have passed through as note-ons but not as note-offs by sending 0 out its right outlet followed by a pitch value out its left outlet.
int pitch [int]
In left inlet: The number is treated as the pitch value of a pitch-velocity pair and the note is sent out.
  (inlet1) velocity [int]
In right inlet: The number is stored as the velocity to be paired with numbers received in the left inlet.
clear In left inlet: Erases any numbers held by flush, without sending any note-offs.

Information for box attributes common to all objects

Output

int: Out left outlet: The output is the pitch of the note-on or note-off.

Out right outlet: The number is the velocity of the note-on or note-off.

The flush object keeps track of the notes that have passed through it. When a bang is received in the inlet, note-off messages are provided for any notes that have passed through as note-ons only.

Examples

Make sure all notes are turned off by providing note-offs for held notes

See Also

Name Description
bag Store a collection of numbers
borax Report current information about note-ons and note-offs
makenote Generate a note-off message following each note-on
midiflush Send note-offs for hanging note-ons in raw MIDI data
offer Store x,y pairs of numbers temporarily
stripnote Filter out note-off messages, pass only note-on messages
sustain Hold note-off messages, output them on command
Max MIDI Tutorial 2: MIDI Note Management Max MIDI Tutorial 2: MIDI Note Management