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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file superdirtpy-0.7.0.tar.gz.
File metadata
- Download URL: superdirtpy-0.7.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
130992716025cc01b58d8c73208ffbca9bce4103e746d05a2ad5949e7ce830de
|
|
| MD5 |
bdf40710cfcf87913305dcb883c34ca6
|
|
| BLAKE2b-256 |
be9c53458688028ba4668256c064e4d79dd004355f997871fdbef25f50e1b187
|
File details
Details for the file superdirtpy-0.7.0-py3-none-any.whl.
File metadata
- Download URL: superdirtpy-0.7.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a558c1cfeed5430e953fa01202cd972d0ce11141cb196679a3f6ca4aab9d5a6
|
|
| MD5 |
a0273cb3b69b434aea96bdd522d2d45f
|
|
| BLAKE2b-256 |
ac8911b3d4c04a68e773f15eac0c6d6b851a0933de562a3e65782f0eb5bca70f
|