Skip to main content

PureData Compiler

This package allows you to write patches for PureData in Python.

Install

python -m pip install puredata-compiler  # requires Python >=3.5

Usage

The compiler gives you creator functions to compose a patch. These functions add elements to the patch, using the content and connections you provide.

from puredata_compiler import Patch, write_file


def example():
    """Patch that increments a counter"""
    patch = Patch()
    obj, msg, floatatom, connect = patch.get_creators('obj, msg, floatatom, connect')

    bang = msg('bang')
    delay_params = msg('500', new_row=0, new_col=1)
    delay_trig = obj('t b f', delay_params[0])
    delay = obj('delay', delay_trig[0], delay_trig[1])

    start_val = obj('f', (bang[0], delay[0]), x_pos=25, y_pos=125)
    increment = floatatom(new_row=0)
    current_val = obj('+', start_val[0], increment[0])
    # connect is different - it takes an existing element and adds connections,
    # so you can create circular structures
    connect(start_val, (), current_val[0])
    current_val_display = floatatom(current_val[0])

    return patch

if __name__ == "__main__":
    pd_example = example()
    write_file('pd_example.pd', str(pd_example))

Result

pd_example.pd

Release files for puredata-compiler 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for puredata-compiler 0.0.1
File Size Uploaded
puredata-compiler-0.0.1.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for puredata-compiler 0.0.1
File Interpreter ABI Platform
puredata_compiler-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.9 kB

Release files / puredata-compiler-0.0.1.tar.gz

Download URL puredata-compiler-0.0.1.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3f595b910de27e82119b645db5a9d3a7f3fc5ce2502386794742a45a242cd282
BLAKE2b-256 checksum
How to use checksums
81d3dc91a6634ea1acc28912b411dec7733a07c3c19172793974a9f8f7aa1995
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

Release files / puredata_compiler-0.0.1-py3-none-any.whl

Download URL puredata_compiler-0.0.1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d42009c518b549cf764eef04f37eb2bab93a518d8af0cdc41ca8dd2543bea52
BLAKE2b-256 checksum
How to use checksums
e8f49d63d50bac18a586c055981a169b22bcb725b01ee5fbb450d96470d98261
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page