flush Reference

Output MIDI note-offs for held notes

flush

Description

Outputss note-off messages for any held note-ons. flush keeps track of all note-ons passed through it, and produces note-off messages for any held notes when it receives a bang message.

Examples

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

Arguments

None.

Attributes

Common Box Attributes

Messages

bang

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

Arguments

pitch [int]
The number is treated as the pitch value of a pitch-velocity pair and the note is sent out.

  (inlet1)

Arguments

velocity [int]
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.

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.

See Also

Name Description
MIDI MIDI
bag
borax
makenote
midiflush
offer
stripnote
sustain
Max MIDI Tutorial 2: MIDI Note Management Max MIDI Tutorial 2: MIDI Note Management