Repository navigation
The default layout is now "topdown": a vertical grid whose optimize_layout() sorts boxes into signal order and aligns ports.
Upgrading from 0.5.x:
- A patch that names no layout is placed top to bottom instead of left to right.
Patcher(layout="horizontal")restores the 0.5 placement. Named layouts are unchanged.py2max new --layoutdefaults totopdowntoo, andnew --template stereonow lays out its patch.
Added
-
optimize_layout(align_ports=True)shifts boxes sideways so each cord from a box above drops straight; y is kept. It works with every layout manager and is off by default. Boxes with an explicit rect never move, and a shift that would put the box or its cord on another box is skipped. A window-anchoredezdac~shifts too, which is the common case: it no longer sits offset below a vertical chain. -
layout="topdown": the"vertical"grid withalign_portson by default, sooptimize_layout()aligns without the flag.optimize_layout(align_ports=False)still turns it off. Also apy2max new --layoutchoice. -
Patcher(auto_layout=True):save()/save_as()runsoptimize_layout()first, but only if boxes or cords changed since the last layout. A blanket re-run would discard an explicitoptimize_layout(...)call's options, and flow recomputes every position. Moves made by hand after a layout are kept. Off by default, sosave()never moves boxes unless asked. Subpatchers inherit the setting; patches loaded from a file have it off;to_dict()/to_json()never lay out.p = Patcher("patch.maxpat", layout="topdown", auto_layout=True)
Fixed
-
Every
add_*method raisesTypeErrorwhenpatching_rectis not 4 numbers. A misplaced positional argument used to be saved as the box's rect:add_message("start", "stop")stored the string"stop", andadd_comment("note", box)stored the box. -
add_table(data=[...])saved an empty table. The values go inarray=, anddatawas on the attribute whitelist for every object, so the stray key passed without a warning.add_tablenow raisesTypeErrorfordata=.datais now a known attribute only fordict, soadd_coll(data=...)(it takesdictionary=) warns as an unknown attribute. The examples and docs used both forms, so their tables and colls were empty. -
optimize_layout()raisedAttributeError: 'list' object has no attribute 'y'on a patch of two or more boxes when one was added withpatching_rect=[x, y, w, h]. The list was stored as given, and the overlap pass readsrect.y. Loaded patches were already converted;add_boxnow converts too.
Examples and docs
-
The examples (
tests/examples/) and the user guide used objects that do not exist in Max:crossfade~,freeverb~,reverb~,chorus~,compressor~,eq~,inlet~,outlet~. These are now real objects (svf~,lores~,comb~,omx.comp~,selector~,tapin~/tapout~,inlet/outlet).biquad~was given a frequency, Q or filter type, though it takes 5 coefficients.delay~was given a time in ms, though its arguments are in samples.- Delay feedback now goes through
tapin~/tapout~, since MSP rejects a signal loop throughdelay~.
-
Several example patches could not make sound:
- The custom and modular synths never triggered their
adsr~.CustomPatcher.add_gatenow adds a[1((note-on) and a[0((note-off) to each one. - The generative tutorial sent
starttometro, which has no such message. Its stop message was never created:add_message("start", "stop")passed"stop"as the rect. Both are now[1(and[0(. - The custom synth wired the wrong boxes into its oscillator mixer. It also sent the envelope into a filter inlet that does not exist; the envelope now scales a
*~. - The wavetable example read
wave~fromtableobjects.wave~reads abuffer~, so the example now writes WAV files thatbuffer~loads. - The sequencer's
colls were empty, and itsselectwas never connected.
- The custom and modular synths never triggered their
-
Subpatcher examples now wire the
add_subpatcherbox itself, with thepprefix Max needs. Before, they wired a second, emptypbox. -
The matrix mixer is now an abstraction,
matrix-mixer.maxpat: 4 signal inlets, a 5th inlet forsrc dst gainmessages, and 4 outlets. A host patch uses it by file name. -
svg_preview_demo.pyimportedexport_svgfrompy2max; it now imports frompy2max.export.
Tests
- Test patches are built with
validate_connections=Trueand use only cords Max accepts. Tests about invalid input are the exception.metrono longer feedscycle~orscope~, nothing is wired out ofscope~, andgain~no longer feeds+.- The random-graph layout tests sample cords until the requested number are valid.
- The Pure Data
osc~is nowcycle~.
Removed
- The
signal_orderA/B test fixture. Layout tests run once again, andbuild/test-output/signal_order_ab.mdis no longer written. It saved every patcher undertest_layout*twice, which produced too many files to inspect.