MANDATORY CHECKLIST - Follow Before EVERY Action
BEFORE placing ANY object:
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.
Required acknowledgment flags:
Math objects (+, -, *, /, %, pow, scale) and pack/pak/unpack:
- JSON strips
.0 from numbers! Use STRING args: ["0", "127", "0", "25."]
- Strings with
. are converted to floats, without . to ints
- For unpack, use
["f", "f", "f"] (type specifier)
- Set
int_mode=True if integer truncation is intentional
- Exception:
scale with output range ≤ 2 auto-detects float intent
dial - use instead of live.dial, requires @size:
- Float 0-1:
['@size', 1, '@floatoutput', 1]
- Bipolar -1 to 1:
['@min', -1, '@size', 2, '@floatoutput', 1, '@mode', 6]
- Int 0-127:
['@size', 127]
- Max @size 255 - larger creates unusable UI; use
flonum/number instead (bypass with extend=True)
live.dial rejected (bypass with use_live_dial=True)
trigger/t - fires RIGHT-TO-LEFT:
- Set
trigger_rtl=True to acknowledge
[t b f] sends f FIRST, then b
random - needs BANG to trigger (numbers only set range):
- Set
random_bang=True to acknowledge
- Use
[t b] to convert numbers to bangs before random
coll - data doesn't persist unless embedded:
- Always include
@embed 1 in args: ['mycoll', '@embed', 1]
Signal Flow Rules
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.
Placement Rules
After calling get_avoid_rect_position() → [left, top, right, bottom]:
- First object:
[left, bottom + 50]
- Same row: x += previous_width + 25
- New row: x = left, y += 50
Subpatchers
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
MCP Tools
| 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 500ms
- Odd count rejected (set
not_line_msg=True to bypass)
Message Boxes
- Use numbers:
[200, 0, 50]
- NOT strings:
["200", "0", "50"] (creates literal quotes)
- Fixed 70px width (user adjusts)
Source: ersatzben/maxmsp-mcp — distributed by TomeVault.
1---2name: maxmsp3description: Critical MaxMSP MCP rules for object placement, gotchas, and tool usage. Invoke before creating/modifying Max patches. Use when this capability is needed.4---56# MANDATORY CHECKLIST - Follow Before EVERY Action78## BEFORE placing ANY object:9```100. Consider whether the task at hand is best served by using a subpatcher.111. Call get_avoid_rect_position() FIRST122. Use returned [left, top, right, bottom] to calculate position133. Place at y = bottom + 50 (minimum)14```15**NEVER skip this step. NEVER guess positions.**1617## Required acknowledgment flags:1819**Math objects** (`+`, `-`, `*`, `/`, `%`, `pow`, `scale`) and **pack/pak/unpack**:20- JSON strips `.0` from numbers! Use STRING args: `["0", "127", "0", "25."]`21- Strings with `.` are converted to floats, without `.` to ints22- For unpack, use `["f", "f", "f"]` (type specifier)23- Set `int_mode=True` if integer truncation is intentional24- Exception: `scale` with output range ≤ 2 auto-detects float intent2526**dial** - use instead of live.dial, requires `@size`:27- Float 0-1: `['@size', 1, '@floatoutput', 1]`28- Bipolar -1 to 1: `['@min', -1, '@size', 2, '@floatoutput', 1, '@mode', 6]`29- Int 0-127: `['@size', 127]`30- **Max @size 255** - larger creates unusable UI; use `flonum`/`number` instead (bypass with `extend=True`)31- `live.dial` rejected (bypass with `use_live_dial=True`)3233**trigger/t** - fires RIGHT-TO-LEFT:34- Set `trigger_rtl=True` to acknowledge35- `[t b f]` sends `f` FIRST, then `b`3637**random** - needs BANG to trigger (numbers only set range):38- Set `random_bang=True` to acknowledge39- Use `[t b]` to convert numbers to bangs before `random`4041**coll** - data doesn't persist unless embedded:42- Always include `@embed 1` in args: `['mycoll', '@embed', 1]`4344---4546# Signal Flow Rules4748**Auto-summing**: MSP inlets automatically sum all incoming signals. Never use `+~` just to combine signals - connect them both to the same inlet instead.4950**Delay feedback**: Connect feedback directly to `tapin~`, never through a mixer first.5152---5354# Placement Rules5556After calling `get_avoid_rect_position()` → `[left, top, right, bottom]`:57- First object: `[left, bottom + 50]`58- Same row: x += previous_width + 2559- New row: x = left, y += 506061---6263# Subpatchers6465**Use subpatchers** for: effects, voices, drums, sequencers, mixers, modulation.6667```68create_subpatcher([x, y], "varname", "display_name")69enter_subpatcher("varname")70 add inlet/outlet objects71 build internal logic72exit_subpatcher()73connect from parent74```7576---7778# MCP Tools7980| Tool | Purpose |81|------|---------|82| `get_avoid_rect_position()` | **REQUIRED** before placing |83| `add_max_object(pos, type, var, args)` | Create object |84| `move_object(var, x, y)` | Reposition |85| `recreate_with_args(var, args)` | Change creation-time args |86| `get_object_connections(var)` | Get all connections |87| `create_subpatcher(pos, var, name)` | Create p object |88| `enter_subpatcher(var)` / `exit_subpatcher()` | Navigate subpatchers |8990**line~ messages** - must have EVEN number of values (pairs):91- `[0, 0, 1, 500, 0, 500]` for instant→0, ramp→1 in 500ms, →0 in 500ms92- Odd count rejected (set `not_line_msg=True` to bypass)9394---9596# Message Boxes9798- Use numbers: `[200, 0, 50]`99- NOT strings: `["200", "0", "50"]` (creates literal quotes)100- Fixed 70px width (user adjusts)101102---103> Source: [ersatzben/maxmsp-mcp](https://github.com/ersatzben/maxmsp-mcp) — distributed by [TomeVault](https://tomevault.io).104<!-- tomevault:4.0:skill_md:2026-06-22 -->