pattr
Description
Stores its own data, or binds to another object to share its contents with other pattr-based objects (such as pattrstorage). Can be used for data routing or preset creation.
Examples

Discussion
The pattr object can be thought of as an alias for data. It functions in two modes. By default, the pattr object maintains its own data. This data can be of any normal Max type (int, float, list, symbol). The pattr object can also bind to another object, as long as that object has a patcher name that the pattr object can resolve. In this instance, the pattr object merely refers to the data inside of another object, and is restricted to the type of data expected by the object. When bound, data sent to the pattr object is forwarded to the referred object (target), and changes made to the target are reflected in the pattr object.
Arguments
Attributes
autorestore [int]
Enables (1) or disables (0) the autorestore state of the pattr object. The default is 1 (enabled). When enabled, the pattr object will automatically output its last-saved value when the patcher is loaded (and, if bound to another object, send the value to that object. See the attribute, below for more information on bound objects).
bindto [symbol]
The word pattr object's binding state. The default state is unbound (no arguments). By default, the pattr object maintains its own data. When "bound" using the feature, a pattr object maintains the data for the other object and automatically gets and sets values for that object. takes an optional argument, which specifies the name of the object to which pattr will bind. Binding targets need not be at the same patcher-level as the pattr object. In this case, a double-colon syntax ('::') is used to separate levels of patcher hierarchy for the purposes of describing a path for name resolution (e.g. somepatcher::someobject). If the named object is at a higher patcher-level than the pattr object, the word parent can be used to refer to a patcher at a higher level (e.g. parent::objectaboveme, parent::parent::objectaboveobjectaboveme or parent::patchernexttome::someobject ).
If the named object contains attributes, and the user wishes to bind to a specific attribute, the same double-colon syntax is used to specify the name of that attribute (e.g. someobject::someattribute). A message sent without an argument unbinds the pattr object from any bound object, and causes it to resume the maintenance its own internal state. See the pattr helpfile for more information about this feature.
default_active [int]
Enables (1) or disables (0) the pattr object's default active state, when it is discovered by a pattrstorage object. The default is 1 (active). See the Reference for the pattrstorage object for more information.
default_interp [2 atoms]
The word pattr object's default interpolation setting, when it is discovered by a pattrstorage object. The default is . See the Reference for the pattrstorage object for more information.
, followed by a symbol and an optional 2nd argument, defines thedefault_priority [int]
The word pattr object's default priority, when it is discovered by a pattrstorage object. The default is . See the Reference for the pattrstorage object for more information.
, followed by an , defines thedirty [int]
Enables (1) or disables (0) the patcher-dirty flag. The default is 0 (disabled). When enabled, the pattr object will dirty the patch whenever its state changes.
initial [256 atoms] (default: )
The pattr object's initial value. If autorestore is set to , this value will be restored upon patch load, rather than the value of the pattr object at the time the patch was last saved. The initial attribute can be used in combination with the message to reset the pattr object to the specified value.
invisible [int]
The word pattr object is invisible to pattrstorage objects. The default is 0 (visible).
, followed by a 1 or 0, determines whether or not theparameter_enable [int]
Enables use of this object with Max for Live Parameters.
parameter_mappable [int] (default: 1)
When parameter_mappable is enabled, the object will be available for mapping to keyboard or MIDI input using the Mappings feature.
thru [int]
Enables (1) or disables (0) the pattr object's thru behavior. The default is 1 (enabled). When enabled, the object will output its value whenever it changes. When disabled, the object will only output its value when it receives a message.
type [symbol] (default: atom)
The word pattr object, when the object is not bound. The default is . Available types include , , , , , and .
Possible values:
'atom'
'char'
'long'
'float32'
'float64'
'symbol'
Common Box Attributes
Parameter Attributes
Messages
bang
int
Arguments
float
Arguments
list
Arguments
anything
Arguments
assign
Arguments
(mouse)
dictionary
Arguments
Output
(internal)
A user interface object (or other object that responds to the internal messaging system utilized by pattr) connected to the middle outlet of the pattr object will be automatically named (if necessary) and bound to. The name is automatically generated from the object's class name (e.g. a connected number box might be named number[1].) Currently, the following Max user interface objects can be bound in this fashion: dial, function, gain~, ggate, gswitch, js (requires user support), jsui (see the JavaScript in Max manual for more information on using the pattr system with JavaScript), led, matrixctrl, multislider, nslider, number box (int and float), pattr, pattrstorage, pictctrl, pictslider, radiogroup, rslider, slider, swatch, table, textedit, toggle, and umenu.
See Also
Name | Description |
---|---|
Max For Live | Max For Live |
autopattr | |
pattrforward | |
pattrhub | |
pattrmarker | |
pattrstorage | |
Max pattr Tutorial 1: Patcher Storage | Max pattr Tutorial 1: Patcher Storage |