makenote

Generate a note-off message following each note-on

Description

makenote outputs a MIDI note-on message paired with a velocity value followed by a note-off message after a specified amount of time. This object uses the Max time format syntax. The interval that the makenote object uses to specify the time between not-on and note-off can be either fixed or tempo-relative (it must be a single-valued).

Arguments

Name Type Opt Description
initial-velocity and initial-duration int float symbol opt The first argument sets an initial velocity value (int) to be paired with incoming pitch numbers. If there is no argument, the initial velocity is 0.

The second optional argument sets an initial note duration (time before a note-off is sent out), in any of Max's time units. A simple int or float will set the duration in milliseconds. If the second argument is not present, the note-off follows the note-on immediately.

Messages

int pitch-value velocity and duration [int] In left inlet: The number is treated as a pitch value for a MIDI note-on message. It is paired with a velocity value and the numbers are sent out the outlets. After a certain time, a note-off message (a note-on with a velocity of 0) is sent out for that pitch.

In middle inlet: The number is stored as a velocity to be paired with pitch numbers received in the left inlet.

In right inlet: The number is stored as the duration (in milliseconds) that makenote waits before a note-off message is sent out.
float pitch-value velocity and duration [float] Converted to int.
list pitch-value and velocity [list] In left inlet: The second number is treated as the velocity and is sent out the right outlet. The first number is treated as the pitch and is sent out the left outlet. A corresponding note-off message is sent out later.
In right inlet: A list may be used to specify time in one of the Max time formats.
anything pitch-value and velocity [list] Performs the same function as list.
clear Erases all notes currently held by makenote, without sending note-offs.
clock setclock object name [symbol] The word clock, followed by the name of an existing setclock object, sets the makenote object to be controlled by that setclock object rather than by Max’s internal millisecond clock. The word clock by itself sets the makenote object back to using Max’s regular millisecond clock.
stop Causes makenote to send out immediate note-offs for all pitches it currently holds.

Attributes

Name Type g/s Description
duration atom The duration (in milliseconds) that makenote waits before a note-off message is sent out.

Information for box attributes common to all objects

Output

int: Out left outlet: The number received in the left inlet is sent out immediately, paired with a velocity value out the other outlet. After a certain duration, the same number is sent out paired with a velocity of 0.

Out right outlet: The number in the middle inlet is sent out as a velocity value in conjunction with a pitch value out the left outlet. After a certain duration, 0 is sent out paired with the same pitch.

Examples

Supply note-offs for note-ons generated within Max

See Also

Name Description
flush Provide note-offs for held notes
midiout Transmit raw MIDI data
noteout Transmit MIDI note messages
nslider Output numbers from a notation display onscreen
stripnote Filter out note-off messages, pass only note-on messages
transport control a master clock and report time values.
xnoteout Format MIDI note messages with release velocity
MIDI Tutorial 2: MIDI Note Management MIDI Tutorial 2: MIDI Note Management