MaxPyLang
MaxPyLang is a Python package for metaprogramming of MaxMSP that uses Python to generate and edit Max patches. MaxPyLang 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.
Installation
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install maxpylang
Documentation
Quick Start
See this example in examples/hello_world.
To run this, python3 examples/hello_world/main.py will create a Max patch file hello_world.maxpat that contains a simple audio oscillator connected to the DAC.
You can then open this patch in MaxMSP and click the DAC to hear a 440 Hz tone.
import maxpylang as mp
patch = mp.MaxPatch()
osc = patch.place("cycle~ 440")[0]
dac = patch.place("ezdac~")[0]
patch.connect([osc.outs[0], dac.ins[0]])
patch.save("hello_world.maxpat")
Citation
MaxPy was published as a demo paper for NIME 2023. The package name was updated to MaxPyLang in 2025 to avoid confusion with other similarly named packages.
Video Demos
Basics
Mark demonstrates the basics of installing MaxPy, creating patches, and placing objects.
Variable-Oscillator Synth
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.
Replace() function
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.
Metadata
Release files for maxpylang 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| maxpylang-0.1.1.tar.gz | 9.0 MB | Without provenance | Details for maxpylang-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| maxpylang-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for maxpylang-0.1.1-py3-none-any.whl |
Total release size: 9.6 MB
Release files / maxpylang-0.1.1.tar.gz
| Download URL | maxpylang-0.1.1.tar.gz |
|---|---|
| Size | 9.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6df8b847c1c9e28cbd5fd2901051cf5765952d09a06669bfd06b137be6ed3f64
|
|
BLAKE2b-256 checksum How to use checksums |
8ab7101f0643d034f286300e5e55099a39ca80a15458c37ff6f8cbbe7d8be95e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / maxpylang-0.1.1-py3-none-any.whl
| Download URL | maxpylang-0.1.1-py3-none-any.whl |
|---|---|
| Size | 537.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
be0954e5516d75bf9250efe07dff7dd3baab05ec3562eae3448f4d648e6869f1
|
|
BLAKE2b-256 checksum How to use checksums |
98f683513e71afe1c546d79cc053f1c1308e63daa30c6b89e05edac5fa359df6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for maxpylang 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.