autopattr
Expose multiple objects to the pattr system
Description
Causes multiple objects within a patcher to be automatically included in the pattr system.
Note: you should use only one instance of an autopattr object per level in a patch.
Arguments
Attributes
autoname[int]
The word autopattr object's autoname state. The default is 0 (off). When enabled, the autopattr object will automatically name any unnamed objects in the patcher supported by the pattr system and bind to them, if possible. Naming only occurs when the patcher loads, when the autopattr object is again instantiated, or when the autopattr object receives the message . New objects placed in a patcher after the autopattr has been instantiated will not be autonamed until one of these conditions is met.
, followed by a 1 or 0, enables or disables the
autorestore[int]
The word autopattr object's autorestore state. The default is 1 (on). When enabled, the autopattr object will automatically output its last-saved values when the patcher is loaded, and distribute them to bound objects. Values are saved whenever the patcher is saved.
, followed by a 1 or 0, enables or disables the
dirty[int]
The word autopattr object will dirty the patch whenever its state changes.
, followed by a 1 or 0, enables or disables the patcher-dirty flag. The default is 0 (disabled). When enabled, the
greedy[int]
The word autopattr object. The default is 0 (disabled). When enabled, any internal attributes of objects attached to the left outlet of the autopattr object will be exposed to the pattr system (as well as the normal value, if present).
, followed by a 1 or 0, enables or disables the attribute-gathering feature of the
name[symbol]
The word autopattr object's patcher name.
, followed by a symbol, sets theCommon 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]
JS Painter File
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
bang
autopattr object and output from its center right outlet.
is passed through the
int
An autopattr object and output from its center right outlet.
is passed through the- input
[int]
float
autopattr object and output from its center right outlet.
is passed through the- input
[float]
list
autopattr object and output from its center right outlet.
is passed through the- input
[list]
anything
Any autopattr, the subsequent arguments in the set that object's value. If the first element of the matches (name), where (name) matches the name of an object maintained by the autopattr, the value of that object is sent from the autopattr object's right outlet, prepended by the object's name. Otherwise, the is passed through the autopattr object and output from its center right outlet.
is analyzed. If the first element of the matches the name of an object maintained by the- input/arguments
[list]
getattributes
Causes a list of all objects names maintained by the autopattr object to be output from the right outlet, prepended by the symbol .
Output
(internal)
Out left outlet: Any user interface object (or other object that responds to the internal messaging system utilized by autopattr) connected to the left outlet of the autopattr object will be automatically named (if necessary) and bound to. If the autopattr object's attribute has been enabled, any attributes associated with the bound object will also be exposed to the pattr system. The name is automatically generated from the object's class name (e.g. a connected number box might be named number[1].) At the time of this writing, the following Max user interface objects can be bound in this fashion: dial, function, gain~, ggate, gswitch, js, jsui (see the JavaScript in Max manual for more information on using the pattr system with JavaScript), led, matrixctrl, multislider, number box (int and float), pictctrl, pictslider, radiogroup, rslider, slider, table, textedit, toggle and umenu.
Out center-left outlet: Any user interface object (or other object that responds to the internal messaging system utilized by autopattr) connected to the center left outlet of the autopattr object will be automatically named (if necessary) and excluded from the autopattr object's bound-object list.
See Also
Name | Description |
---|---|
pattr | Provide an alias with a named data wrapper |
pattrforward | Send any message to a named object |
pattrhub | Access all pattr objects in a patcher |
pattrmarker | Provide pattr communication between patchers |
pattrstorage | Save and recall pattr presets |