Abstractions

Abstractions

Any patch you have created and saved can be used as an object in another patch, just by typing the filename of your patch into an object box as if it were an object name. Patches used in this way are called abstractions.

To create an abstraction, you need to identify what information your patch always uses, and that its output is. Those things become the inlets and the outlets of your abstraction.


Creating an abstraction from a subpatcher

  • Command-double-click (Macintosh) or Alt-double-click (Windows) on the patcher object in an unlocked Patcher window. The Patcher window for the subpatch will be shown or brought to the front if it is already open.
  • Unlock the subpatcher window.
  • Add as many inlet and outlet objects as you need.
  • Choose Save As.... from the File menu. Give it a name that is memorable and useful, and be sure to save your object somewhere in the search path, so that Max can locate the object.

If you save your abstraction with either .pat or .maxpat file extensions, your abstractions will be available if autocompletion is enabled.


Once you create the abstraction file, you can return the main patcher, create a new object box, and type in the name of file (the extension is not required). Once you type the name of an abstraction once, it is added to the object box autocompletion list.

You can locate and display abstractions you create in the file browser by tagging your files. Once tagged, they'll be easy to locate in the future.

Tagging an abstraction

  • Open the abstraction file you have created and unlock the patcher window.
  • Choose Inspector from the Object menu to open the Patcher Inspector.
  • In the Descriptions tab of the Patcher Inspector click in the Setting column for the Tags attribute to show a cursor and text box. Type "abstraction" into the text box and hit return.