Python API for making MaxMSP patches.
Project description
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
git clone https://github.com/Barnard-PL-Labs/MaxPyLang.git
cd MaxPyLang
pip3 install .
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maxpylang-0.1.0.tar.gz.
File metadata
- Download URL: maxpylang-0.1.0.tar.gz
- Upload date:
- Size: 114.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a683f7c4369f7484ad58d4861f02ab882e5a31fe131f69196916946197cecd56
|
|
| MD5 |
abbd17ca7a6eaa01af4c4cb7ced837cb
|
|
| BLAKE2b-256 |
d88c051ee13350c5f7569d9981afe7950c2e628cc567047102ac6578fc07b9cd
|
File details
Details for the file maxpylang-0.1.0-py3-none-any.whl.
File metadata
- Download URL: maxpylang-0.1.0-py3-none-any.whl
- Upload date:
- Size: 508.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00df4e337aefb6edec36ca214dae71d0ec96f317c5e8668def08da291f399f29
|
|
| MD5 |
3e00e052cd9e2fc9ad43b53f47c1bcb1
|
|
| BLAKE2b-256 |
f737eb4f0588feb93f0012ab733bc9ea199d60bc0cdf85fd51b3ba45b8c5143e
|