Skip to main content

Python API for making MaxMSP patches.

Project description

MaxPyLang

CI

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

Introduction to MaxPy
Mark demonstrates the basics of installing MaxPy, creating patches, and placing objects.

Variable-Oscillator Synth

Variable-Oscillator Synth Explanation
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

Using Replace() function with MaxPy
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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maxpylang-0.1.1.tar.gz (9.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maxpylang-0.1.1-py3-none-any.whl (537.6 kB view details)

Uploaded Python 3

File details

Details for the file maxpylang-0.1.1.tar.gz.

File metadata

  • Download URL: maxpylang-0.1.1.tar.gz
  • Upload date:
  • Size: 9.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for maxpylang-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6df8b847c1c9e28cbd5fd2901051cf5765952d09a06669bfd06b137be6ed3f64
MD5 714d2d79075d05b944a0af2722b1652d
BLAKE2b-256 8ab7101f0643d034f286300e5e55099a39ca80a15458c37ff6f8cbbe7d8be95e

See more details on using hashes here.

File details

Details for the file maxpylang-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: maxpylang-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 537.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for maxpylang-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be0954e5516d75bf9250efe07dff7dd3baab05ec3562eae3448f4d648e6869f1
MD5 58d7366a160be0acf70470592cb28c28
BLAKE2b-256 98f683513e71afe1c546d79cc053f1c1308e63daa30c6b89e05edac5fa359df6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page