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()
p = {"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 = p | {
            "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.8.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

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

superdirtpy-0.8.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file superdirtpy-0.8.0.tar.gz.

File metadata

  • Download URL: superdirtpy-0.8.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0

File hashes

Hashes for superdirtpy-0.8.0.tar.gz
Algorithm Hash digest
SHA256 08fd820fc2c402b2f2689da09fcf5d98c80dafc0b342fe52144e56ebb60ee94c
MD5 e5fcec665788535c1f2881596153051d
BLAKE2b-256 6f302806335bc73f076ca5456ef3d18f4418cedc08d22c1e692d84748aeebf4b

See more details on using hashes here.

File details

Details for the file superdirtpy-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: superdirtpy-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0

File hashes

Hashes for superdirtpy-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 921ae3ade44952a9813412e879a676e9cc76c8ec98edbc05f9822cbb61591af4
MD5 44533c2cc6a10a8ef2494d0a28f96a7a
BLAKE2b-256 44c87d8b7e450c620189b5ba33789a1f812dccd3fe1c56eaaeaa19032c4abb05

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