patch_add_box
Adds a box such as an object, message, comment, UI control, or Live parameter to a Max for Live patch or subpatcher, inferring inlet/outlet counts and registering parameters.
Instructions
Add a box. maxclass 'newobj' (object box, give text), 'message', 'comment', or a UI class
('live.text', 'live.dial', 'bpatcher', ...). In/outlet counts are inferred (Max-saved patch corpus,
abstractions, subpatcher contents); pass them explicitly if unknown. patcher = subpatcher path to add into.
attrs are extra box attributes (dotted keys allowed: 'saved_attribute_attributes.valueof.parameter_mmax').
Live parameters: live.* UI objects (and newobj text with '@parameter_enable 1') need
parameter={'longname','shortname', optional 'type' (0 float,1 int,2 enum,3 blob),'mmin','mmax','enum',
'initial','initial_enable','unitstyle',...}; the box gets saved_attribute_attributes.valueof and is registered
in the device's parameter registry for every instance of that patcher. id defaults to the next free obj-N.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "patch_add_box"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| id | No | ||
| file | No | ||
| path | Yes | ||
| text | No | ||
| attrs | No | ||
| width | No | ||
| height | No | ||
| patcher | No | ||
| maxclass | No | newobj | |
| numinlets | No | ||
| parameter | No | ||
| numoutlets | No | ||
| outlettype | No | ||
| allow_rename | No | ||
| presentation_rect | No |