Skip to main content

superdirtpy is a client library for Super Dirt written in python.

Project description

superdirtpy

superdirtpy is a client library for Super Dirt written in python.

features

  • timing control
  • no framework or DSL
  • can be used for algorithmic composition, live coding, integration with python libraries such as numpy and scipy and developing tools for your own use.

prerequisite

Install Tidal Cycles. Especially Super Dirt.
https://tidalcycles.org/

examples

import logging

import numpy as np

import superdirtpy as sd

rng = np.random.default_rng()
client = sd.SuperDirtClient()
s = "mydevice"
midichan = 0


def main():
    tctx = sd.TemporalContext()
    scale = sd.Scale(sd.PitchClass.C, sd.Scales.messiaen3)
    for _ in range(16):
        n = rng.integers(1, 5, endpoint=True)
        chord = rng.choice(10, n, replace=False).tolist()
        chord = scale.bind(degrees=chord)
        params = {
            "s": s,
            "midichan": midichan,
            "n": [chord],
            "amp": rng.uniform(0.4, 0.9),
            "delta": rng.uniform(0.8, 2.0),
        }
        sd.Pattern(client=client, params=params).play(tctx)


if __name__ == "__main__":
    try:
        logging.basicConfig(level=logging.DEBUG)
        main()
    except KeyboardInterrupt:
        pass

See more examples.

parameters

This library internally handles only s, sound, n, and delta, but you can also use parameters such as amp and room. (source)

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

superdirtpy-0.5.0.tar.gz (11.1 kB view hashes)

Uploaded Source

Built Distribution

superdirtpy-0.5.0-py3-none-any.whl (12.7 kB view hashes)

Uploaded Python 3

Supported by

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