makenote
Generate a note-on/note-off pair
Description
Outputs a MIDI note-on message paired with a velocity value followed by a note-off message after a specified amount of time. This allows for generative MIDI output without having to manage note-off generation.
Discussion
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). An additional third argument can be used to specify a MIDI output channel (the makenote object will then have four inputs and three outputs).
Arguments
velocity[number]
optional
Sets an initial velocity value (int or float) to be paired with incoming pitch numbers. If there is no argument, the initial velocity is
.
duration[number]
optional
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.
channel[number]
optional
Sets an initial MIDI channel number. If a third argument is used, the makenote object will have an additional fourth inlet (which specifies MIDI channel number) and an additional third outlet (which specifies MIDI output channel).
Attributes
duration[Time Value]
The duration that makenote waits before a note-off message is sent out.
repeatmode[int]
Sets behavior when a note is retriggered. The modes are:
repeatmode 0 (default): There is no pre-specified behavior when when you repeat a pitch before the note-off for that pitch has been sent.
repeatmode 1: If a note is still playing when you retrigger it, the makenote object will send a note-off (velocity 0) message to stop the first note and then send a new note-on message.
repeatmode 2: If a note is still playing when you retrigger it, the makenote object will cancel the scheduled output of the first note - only the last played note will send note-off (velocity 0) message.
repeatmode 3: If a note is still playing when you retrigger it, the makenote object will reschedule the note-off output of the first note without triggering a new note-on message.
repeatmode 4: If a note is still playing when you retrigger it, the makenote object will ignore the retriggered note and leave the note-off time unaffected.
Possible values:
0 = 'Poly'
1 = 'Re-trigger'
2 = 'Stop Last'
3 = 'Update Duration'
4 = 'Ignore'
Common Box Attributes
annotation[symbol]
Sets the text that will be displayed in the Clue window when the user moves the mouse over the object.
background[int]: 0
Adds or removes the object from the patcher's background layer.
adds the object to the background layer, removes it. Objects in the background layer are shown behind all objects in the default foreground layer.
color[4 floats]
Sets the color for the object box outline.
fontface[int]
Sets the type style used by the object. The options are:
plain
bold
italic
bold italic
Possible values:
0 = 'regular'
1 = 'bold'
2 = 'italic'
3 = 'bold italic'
fontname[symbol]
Sets the object's font.
fontsize[float]
Sets the object's font size (in points).
Possible values:
'8'
'9'
'10'
'11'
'12'
'13'
'14'
'16'
'18'
'20'
'24'
'30'
'36'
'48'
'64'
'72'
hint[symbol]
Sets the text that will be displayed in as a pop-up hint when the user moves the mouse over the object in a locked patcher.
ignoreclick[int]: 0
Toggles whether an object ignores mouse clicks in a locked patcher.
jspainterfile[symbol]
You can override the default appearance of a user interface object by assigning a JavaScript file with code for painting the object. The file must be in the search path.
patching_rect[4 floats]: 0. 0. 100. 0.
Sets the position and size of the object in the patcher window.
position[2 floats]
write-only
Sets the object's x and y position in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its size unchanged.
presentation[int]: 0
Sets whether an object belongs to the patcher's presentation.
presentation_rect[4 floats]: 0. 0. 0. 0.
Sets the x and y position and width and height of the object in the patcher's presentation, leaving its patching position unchanged.
rect[4 floats]
write-only
Sets the x and y position and width and height of the object in both patching and presentation modes (if the object belongs to its patcher's presentation).
size[2 floats]
write-only
Sets the object's width and height in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its position unchanged.
textcolor[4 floats]
Sets the color for the object's text in RGBA format.
textjustification[int]
Sets the justification for the object's text.
Possible values:
0 = 'left'
1 = 'center'
2 = 'right'
varname[symbol]
Sets the patcher's scripting name, which can be used to address the object by name in pattr, scripting messages to thispatcher, and the js object.
Messages
int
In first 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 second inlet: The number is stored as a velocity to be paired with pitch numbers received in the left inlet.
In third inlet: The number is stored as the duration that makenote waits before a note-off message is sent out.
In fourth inlet: The number specifies a MIDI output channel. The fourth inlet will only be present if the makenote object is initialized with three arguments.
- input
[int]
float
In first 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 second inlet: The number is stored as a velocity to be paired with pitch numbers received in the left inlet.
In third inlet: The number is stored as the duration that makenote waits before a note-off message is sent out.
In fourth inlet: The number specifies a MIDI output channel. The fourth inlet will only be present if the makenote object is initialized with three arguments.
- input
[float]
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.
If the makenote object is instantiated with three arguments, a four-item list can be used which contains an additional fourth element specifying the MIDI channel number, which is sent out the rightmost outlet of the object.
- input
[list]
anything
Performs the same function as
.- input
[list]
clear
Erases all notes currently held by makenote, without sending note-offs.
clock
stop
Causes makenote to send out immediate note-offs for all pitches it currently holds.
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
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, is sent out paired with the same pitch.
See Also
Name | Description |
---|---|
flush | Output MIDI note-offs for held notes |
midiout | Transmit raw MIDI data |
noteout | Transmit MIDI note messages |
nslider | Output numbers from a notation display |
stripnote | Filter out note-off messages |
transport | Control a clock |
xnoteout | Format MIDI note messages with release velocity |