MaxPy is a Python package for metaprogramming of MaxMSP that uses Python to generate and edit Max patches. MaxPy allows users to move freely between text-based Python programming and visual programming in Max, making it much easier to implement dynamic patches, random patches, mass-placement and mass-connection of objects, and other easily text-programmed techniques.
MaxPy was published as a demo paper for NIME 2023.
Mark demonstrates the basics of installing MaxPy, creating patches, and placing objects.
Ranger explains a MaxPy script that dynamically generates an additive synth with a variable number of oscillators. The code for this synth is under examples/variable-osc-synth.
Satch explains using the replace() function to selectively replace objects in a loaded patch to sonify stock data. The code for this is under examples/stocksonification_v1.
You can read the docs here (under construction).
To aid the development of MaxPy, we attempted to define a formal grammar of MaxMSP as a programming language. However, we discovered three major issues: 1) typing problems, 2) irregular objects, and 3) mismatches between saved program files and in-environment program behavior. See this Google doc (in progress) for a writeup of these issues.
Ranger Liu (developer)
Dr. Mark Santolucito (PI)
Richard Lee (documentation and examples)
Satchel Peterson (documentation and examples)