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.4.0.tar.gz
(11.2 kB
view hashes)
Built Distribution
Close
Hashes for superdirtpy-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba5ca9bcf6e3d195a4b4b9307ccee0269088373f631a82b90fbd989620b7993c |
|
MD5 | 836c0b645e345709664bb53233b17ce7 |
|
BLAKE2b-256 | 3beb5588fcf827b65d49ee10653da15ae7a390d8ae8a69a8f7aebf3aa3540c09 |