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.6.0.tar.gz (11.2 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.6.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: superdirtpy-0.6.0.tar.gz
  • Upload date:
  • Size: 11.2 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.6.0.tar.gz
Algorithm Hash digest
SHA256 b8d0c24edcfba8174671e371448f3a6886eebfa82f12d00fe9b8c9521e627151
MD5 0e68f12daa86751a52d2a4475b7475dc
BLAKE2b-256 69c792a355349001d38cfa4b3e907d19c70c822a43ee762dab0f7f5b6f71a0db

See more details on using hashes here.

File details

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

File metadata

  • Download URL: superdirtpy-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38de896b562d8ed98821af4d52dbc6425f879f96ce873a0341c67fc9b6f373c4
MD5 ea2b619ab1f53b42686f9741d63c22e4
BLAKE2b-256 05504e603d4e48e09f4d4333c5959467eda0e82bf0b9802fdad6d912701f0c4c

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