Critical MaxMSP MCP rules for object placement, gotchas, and tool usage. Invoke before creating/modifying Max patches.
0. Consider whether the task at hand is best served by using a subpatcher.
1. Call get_avoid_rect_position() FIRST
2. Use returned [left, top, right, bottom] to calculate position
3. Place at y = bottom + 50 (minimum)
NEVER skip this step. NEVER guess positions.
Math objects (+, -, *, /, %, pow, scale) and pack/pak/unpack:
.0 from numbers! Use STRING args: ["0", "127", "0", "25."]..["f", "f", "f"] (type specifier)int_mode=True if integer truncation is intentionalscale with output range ≤ 2 auto-detects float intentdial - use instead of live.dial, requires @size:
['@size', 1, '@floatoutput', 1]['@min', -1, '@size', 2, '@floatoutput', 1, '@mode', 6]['@size', 127]flonum/number instead (bypass with extend=True)live.dial rejected (bypass with use_live_dial=True)trigger/t - fires RIGHT-TO-LEFT:
trigger_rtl=True to acknowledge[t b f] sends f FIRST, then bcoll - data doesn't persist unless embedded:
@embed 1 in args: ['mycoll', '@embed', 1]Auto-summing: MSP inlets automatically sum all incoming signals. Never use +~ just to combine signals - connect them both to the same inlet instead.
Delay feedback: Connect feedback directly to tapin~, never through a mixer first.
After calling get_avoid_rect_position() → [left, top, right, bottom]:
[left, bottom + 50]Use subpatchers for: effects, voices, drums, sequencers, mixers, modulation.
create_subpatcher([x, y], "varname", "display_name")
enter_subpatcher("varname")
add inlet/outlet objects
build internal logic
exit_subpatcher()
connect from parent
| Tool | Purpose |
|---|---|
get_avoid_rect_position() | REQUIRED before placing |
add_max_object(pos, type, var, args) | Create object |
move_object(var, x, y) | Reposition |
recreate_with_args(var, args) | Change creation-time args |
get_object_connections(var) | Get all connections |
create_subpatcher(pos, var, name) | Create p object |
enter_subpatcher(var) / exit_subpatcher() | Navigate subpatchers |
line~ messages - must have EVEN number of values (pairs):
[0, 0, 1, 500, 0, 500] for instant→0, ramp→1 in 500ms, →0 in 500msnot_line_msg=True to bypass)[200, 0, 50]["200", "0", "50"] (creates literal quotes)