A Python API for SuperCollider
Project description
Supriya
Supriya is a Python API for SuperCollider.
Supriya lets you:
-
Boot and communicate with SuperCollider's
scsynth
synthesis engine: servers in realtime. -
Compile SuperCollider SynthDefs natively in Python code
-
Explore nonrealtime composition with scores.
-
Build time-agnostic asyncio-aware applications with context interface.
-
Schedule patterns and callbacks with tempo- and meter-aware clocks
Quickstart
1. Get Supriya
Install from PyPI:
pip install supriya
Or from source:
git clone https://github.com/josiah-wolf-oberholtzer/supriya.git
cd supriya
pip install -e .
2. Get SuperCollider
Get SuperCollider from http://supercollider.github.io/.
3. Boot the server
Start your Python interpreter and import Supriya:
>>> import supriya
Boot the SuperCollider server:
>>> server = supriya.Server().boot()
4. Build a SynthDef
Import some classes:
>>> from supriya.ugens import EnvGen, Out, SinOsc
>>> from supriya.synthdefs import Envelope, synthdef
Make a synthesizer definition:
>>> @synthdef()
... def simple_sine(frequency=440, amplitude=0.1, gate=1):
... sine = SinOsc.ar(frequency=frequency) * amplitude
... envelope = EnvGen.kr(envelope=Envelope.adsr(), gate=gate, done_action=2)
... Out.ar(bus=0, source=[sine * envelope] * 2)
...
Visualize the SynthDef (requires Graphviz):
>>> supriya.graph(simple_sine)
Allocate it on the server:
>>> _ = server.add_synthdefs(simple_sine)
5. Create some nodes
Create and allocate a group:
>>> group = server.add_group()
Create some synthesizers with the previously defined synthesizer definition, and allocate them on the server as a child of the previously created group:
>>> for i in range(3):
... _ = group.add_synth(simple_sine, frequency=111 * (i + 1))
...
Query the server's node tree:
>>> print(server.query_tree())
NODE TREE 0 group
1 group
1000 group
1003 simple_sine
amplitude: 0.1, frequency: 333.0, gate: 1.0
1002 simple_sine
amplitude: 0.1, frequency: 222.0, gate: 1.0
1001 simple_sine
amplitude: 0.1, frequency: 111.0, gate: 1.0
6. Release and quit
Release the synths:
>>> for synth in group.children[:]:
... synth.free()
...
Quit the server:
>>> server.quit()
License
This library is made available under the terms of the MIT license.
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 Distributions
Hashes for supriya-23.3b0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 918aaff4acbe1fa33b43097d19c6e8e445ccedc1f6713a63896f64aedc6bc80f |
|
MD5 | 00b9ad7f7cfc928bc273fb9b48da66d5 |
|
BLAKE2b-256 | 802bad993f0afd0b8508a70fa13f2f13d5878e8bf14446bdcc3efdb31e63b7a6 |
Hashes for supriya-23.3b0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04e6986a14d41b4bab90af7b8ba4b0f51db59ce3b108560f1fb6243ef7145db7 |
|
MD5 | d5d310d2a78c0a8493998ad99a671e0e |
|
BLAKE2b-256 | e0490a87879ea4a5690bebf0de3f3b2b46c90362bc5e995a1f20e5fe38768dae |
Hashes for supriya-23.3b0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2dd7e0b69a3abc506fe58f97c05752caabf45b67f4e4716d02317962ce5ced4 |
|
MD5 | f3890ce08aeb1c0f6f8ae9f723cc233d |
|
BLAKE2b-256 | 6e39420860d8bdf85cafb7fcd4e103a5221ab438fcf8b48884d9f49980443fe3 |
Hashes for supriya-23.3b0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e5b49ca566f81e81f16d2215f3336a72ef7aacabafceede471e178ef22e23e4 |
|
MD5 | fadc10f29166495d279cb333bb4ac15e |
|
BLAKE2b-256 | 7a79e63eb88f919d8da26a36809343129b43bdcc09acbd02a0834bea011cb82b |
Hashes for supriya-23.3b0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88792f3dec760aaf71a198e78a10bf1cf8ac3b65216c1d334d2adc0065a309a5 |
|
MD5 | 6e9d7e88d9777f30aa6c01e363bab003 |
|
BLAKE2b-256 | 4c3e87c225554b0629ebbc91118d9513d4887bd1cd65052e1fa854eaefb5d0fc |
Hashes for supriya-23.3b0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2af58bf99eaff8119c863f82473f7be803423a12a1f78948ab7bb636d6abf497 |
|
MD5 | 534a1fe24ed8be474cb98ff9bec6a7f9 |
|
BLAKE2b-256 | 29f2520cb8043607b0533c2c2b091222a2e0f82ba937a8f351fba0abfda27fe1 |
Hashes for supriya-23.3b0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f1e133cd8832b8c98392745358fe0879236d10438b930c25d1158b14e2ce508 |
|
MD5 | 51bbd584d4a23ff1f150f0efb9160b6f |
|
BLAKE2b-256 | 86db3afab2359173d59adb3b9ce266d79c19b05d150a37216d48f650c7a0c566 |
Hashes for supriya-23.3b0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74f6f37ff8a9b1f647889453e7d31eacf65beb5365239f643a731b2024943b9a |
|
MD5 | 1f34683d2a43b1898a3ac9bbf5b6107f |
|
BLAKE2b-256 | ed92b74687763befcfbd1c7eb6af169a991503e16397ec88d0023ee93e8c1532 |
Hashes for supriya-23.3b0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9d066d19ffdd08a8892f5c3eddd57534946ef23cb43a40c64fde243c5aaac57 |
|
MD5 | 38d85e890a59c2fe14f5551a368d342c |
|
BLAKE2b-256 | f4bf8ae54850fa697129ce9ad67c617f26dc429dc16ef9fd8b8cde7f13ebc3ca |
Hashes for supriya-23.3b0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11afe93e2537036a6cbda831e6464f380247228419dee53c4b7f01b3bbaf9208 |
|
MD5 | c660e6636b4378495482a8429ef90efb |
|
BLAKE2b-256 | 098fe4554332139c3f52939550651174bda901ae77eeba81b4a5588f6145394d |
Hashes for supriya-23.3b0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16f0b5449136acab682eb4f202f1e9f8210cc0c63c019bb0ac89a2f43359c8f2 |
|
MD5 | f3556830dfb6ef042df3ebfe60ee752e |
|
BLAKE2b-256 | 318597dc49d7298d5974a976b0e3f76b75f8993322fe5e4674ff5648b0d4ca6b |
Hashes for supriya-23.3b0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | faf30d56c84dd65ca6ddd2f27683753d975b0c3a2ee49c2c80be9e307a4ed327 |
|
MD5 | 7b8fcbd7627d7d93a98e93797d825bdc |
|
BLAKE2b-256 | 1fcb3a9c996acb2a505cc453e984d389fe6f11648b60bb19b350f67308d4187c |
Hashes for supriya-23.3b0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d9369e407019ab207081aa7faf62775283749b33aa0e11dd6c7456396e5147e |
|
MD5 | 37e3c4139a9ed5ee051eb29ea9eb3387 |
|
BLAKE2b-256 | f83634e2a975d5b02423a9275b844b6326e8f7acf404006c1b0c9bc556ce4533 |
Hashes for supriya-23.3b0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f0f7a2155f14ed026ffea504100b2f9be5f6286c17f4b1ce97454f81136de13 |
|
MD5 | 065a3acc7a430d48e55bc996f5da4694 |
|
BLAKE2b-256 | 85d659ac9a24abd6714d03bf73a7a74f75d93c3c4209ab89d9f6ebf2bbb23cea |
Hashes for supriya-23.3b0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65c0270b38e59284e7ff45f26c05e7bed247dced7e8a3473e2d5c1dc1a9aea64 |
|
MD5 | ed0e23fbc11c6d97c14542c797fa193d |
|
BLAKE2b-256 | 334643dcbebc1afeff78dbb92fc4b857c7b3e5fafc0f2e3ac16ac7bd825081e4 |
Hashes for supriya-23.3b0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a21c6231536424e26c0139be7853914e750e6f2b8d0dc82fcf637e06d5c26bb |
|
MD5 | def34c6c1dc5928d564b1a92c5047ac8 |
|
BLAKE2b-256 | 584069cc4e3f3ba99b9ad6a5818a2953b8f9806b1cbdb42f82f493e8d95876c1 |
Hashes for supriya-23.3b0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf2bffa09a70f316a6033612d92156dc49739319777d1ff9c43d812bfdd545d3 |
|
MD5 | 44f5f1841e8ce6bf8008917cfae67eea |
|
BLAKE2b-256 | 072a5bf81aface1be06415fc469893da1771230b1bfcc7149170ab99bce237ed |
Hashes for supriya-23.3b0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3515b5339a351c0a7ec8b09b7396023ee765e18faaf309afb1506c4a4716330 |
|
MD5 | ab427135a016fbecd5e6e17cb2db5503 |
|
BLAKE2b-256 | 403dda3b424b3a6d86ef927a4f54ff0db9714961862f0c4896fc467556c4aa27 |
Hashes for supriya-23.3b0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adf331c0e5070f45bd0cf8d2303d9a9ee6189daf9ebb6e8e86d028e569a9c8ee |
|
MD5 | c24764cc9fac91ab499725fe260f484b |
|
BLAKE2b-256 | b2ccdcc4ab6d9488be90a8073ad7092e80fd7c7d8c8e068eb49e2cd2da30aa87 |
Hashes for supriya-23.3b0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 011f4d90869c41f06de9b3183bb62a3e3cbc041f07c67470d739bf105a7e2ae4 |
|
MD5 | 5130c69b5c4b124706b25225a2268da4 |
|
BLAKE2b-256 | 5e937083c0fab362a69a26d8d68dfd5c2d1a784d05fc65aedd37973084ae41d4 |
Hashes for supriya-23.3b0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e7c26e4100ec019f014ecf9d07f96daf0a3a8aec63c30c021f39854b6a0117b |
|
MD5 | d334a575901117c70c84cd9faeace659 |
|
BLAKE2b-256 | a41daa05d2a62c77fa4bd7d224c78bb0805b593f58473ecbca669dea6af515c3 |