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 the 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.5b4-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2f17af8053c35229cf43784dba2dd4c49fcf87f44175b99d597da085863e3bc |
|
MD5 | 0795c125f92d87d1d6ae20145fe084b7 |
|
BLAKE2b-256 | 2abc93910c586d8f791b8a9e877b2286047104d6c057d93e97b83c997c20ee16 |
Hashes for supriya-23.5b4-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddd7b3e916d2288c4b3cdf48441317dccc10e57f1c4855eb46ae91005e06322a |
|
MD5 | 05742556efe4676acb8bc58700bac4ff |
|
BLAKE2b-256 | 4eb96888b9dbc422d742299051a7bbabc5257591e7a5c491e2aa125a89e109a8 |
Hashes for supriya-23.5b4-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0aba641669c766936082e822b3178bc8435af2d8b23098aec7f6272a1565c91a |
|
MD5 | 24a0d78f697b70fd475e44a747d9406b |
|
BLAKE2b-256 | b9fa00d5c39c1cdb6caeda4b1d866181012bbc42e8db2859ea30cd6d6bb13208 |
Hashes for supriya-23.5b4-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96537927ca8e11e58e69854298f37cc4a0338651a97e494a926fc248c84a6820 |
|
MD5 | 52b0b5f06d82f8f72de292e01d3dfba4 |
|
BLAKE2b-256 | b9523869b8745e60f4e22e13f88551b98c224c9dec281ba249dde7cbaf7b3c7b |
Hashes for supriya-23.5b4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbf08090c71c8278d84968da86bbde4b30d012b3d073aaa5c6901349178491e1 |
|
MD5 | a9c6b8cd73720b815f02b97400477f7c |
|
BLAKE2b-256 | ff10ccac2528214f71e6ec7e7741ab9400801d23ca94e380d7712e0e51ff2324 |
Hashes for supriya-23.5b4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ab834fe366b3c3fcfe7764107b6bf0036ee10c83e768c0d1b1e781338f3027d |
|
MD5 | 65e00c87f3be9556434b15aec3044253 |
|
BLAKE2b-256 | 1ff16644df38a9b17162b63ce36ed6a3fa780d6c11b2e707de2b3535c2f3b831 |
Hashes for supriya-23.5b4-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f17d3f9fc1ededf1141de53739a3c93c3c006c1e1a869a116f01f7166cd0bf62 |
|
MD5 | 2b050b5348e59c1f8bb5b56316444776 |
|
BLAKE2b-256 | 73625501d597ca5aff30b59baae3e191f6fd4b3fb843c18a47328a5481118722 |
Hashes for supriya-23.5b4-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09acdf1aa45a9363ef9125fbf66b9726de7c1d490547cec5fd53f087c2ce70ea |
|
MD5 | 1d64dc2f8cb18f4ee160e8b27c269c21 |
|
BLAKE2b-256 | ba67c06835299f5f72e622c3590cf3ed874cf2e503c4dcd006f057c26099973e |
Hashes for supriya-23.5b4-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbdac2265004b9829c8aaa12f5027bd20dd9f88abc14557af171cf127f679ec9 |
|
MD5 | b5d131f6dca1165f14d6daa93aa50c5e |
|
BLAKE2b-256 | be3ef6cc89afb1418ce75303bb777fa89cbc2b6327e060a4b2522ebb44fb884b |
Hashes for supriya-23.5b4-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86311b0667290d93a132c5593063b1c3132ffda50eed9a138bc2d64fdaab9001 |
|
MD5 | 6dabadb0b4fe5d7c954eecb11a6e0e27 |
|
BLAKE2b-256 | a605b346b04dbfbb8c33fce957496394b62b25068838dd1a1de0020df4d3996d |
Hashes for supriya-23.5b4-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c01a10c5728e492c0e5eb2be93dc817282e82e221acd06fdb11934882c8d4bef |
|
MD5 | fa978cf9f3a0e3f92f4e3ca56892be64 |
|
BLAKE2b-256 | e49b5133ab92dbef6d5b94b6c0db8a068cf70f117daa27286bf7fe5461d348dd |
Hashes for supriya-23.5b4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 417787f50a79a3600d2c3129ea7cb6551a2416a264292d26e2ee5ea55c441ad3 |
|
MD5 | b691de12a1fe927464dd4e1a2e290d9e |
|
BLAKE2b-256 | 4afa31bffdecfcba3a82477b177ae3fd16e1e74953d59da8a3d3945761779eed |
Hashes for supriya-23.5b4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78a78dfbce4470da4cce093397b9f073b4b766a9e43a3b1d72bae4fbb6628d3e |
|
MD5 | 3ac2ffa772cc5170c212c495b0cdbf91 |
|
BLAKE2b-256 | a71ed8d52a0498ac7212cbb7070ec94da10eed6d9ea9a33f8132b8650d839a97 |
Hashes for supriya-23.5b4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8cae343c38c50b4c884e875459fd066302eabf8243cd31b1d1956af1c1b4497 |
|
MD5 | 38d23243e0280bb3a133db6d1926cd58 |
|
BLAKE2b-256 | 7ce0c1dc143c1cd2e6260a66fb9f1df4dd27a8288503166d0137559cbfd6cb56 |
Hashes for supriya-23.5b4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78736190237c8acc30b4e2e606dca3d1dcb992689d0f08be343eb7fdb030405e |
|
MD5 | 9eb75732714094b4c364047d0420e494 |
|
BLAKE2b-256 | 5b9557292bda1e35edd0f2a61feea49e021e62a4ad18470148dcacddc695a437 |
Hashes for supriya-23.5b4-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d89cc3dc459edcea8b7355b6110c1d9b4c638963bccfe43e2232bfe4d58ddc3 |
|
MD5 | 69fa749310b0cfbb5941bd7cae92d862 |
|
BLAKE2b-256 | 7f97ed44f1b9029100d125e812c421ad7a2020422158ac3e5d6a75249f7b58ad |
Hashes for supriya-23.5b4-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1920477caa4e8ed803a9781a2a5e6fca625f60d52e4aaaefa7b8c9e79c9ab182 |
|
MD5 | 855a2afde877ead3b242074d542b67cc |
|
BLAKE2b-256 | 302f85def8990f05c6a0aea2ebb74a2539688d13f4722fbeed43ba5ae097053e |
Hashes for supriya-23.5b4-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b8281cf08e0f454300b164ccedbe3ef80c871edf1f462cf577fd8c7533141a4 |
|
MD5 | 4ab34a810090c1305929fbcfc924cb3b |
|
BLAKE2b-256 | 20e05104078770d60d1fd6b57041eb4775fe59c230c138501465671f0cb449e7 |
Hashes for supriya-23.5b4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cf2f9c979719d9e2efa423b75d6a1b755a37959fef3615f4456e2f8452f78c7 |
|
MD5 | c67f2f6309794ce4487e141abf6d7a99 |
|
BLAKE2b-256 | 222bc90b707d615cc2ae8f0b28f4dd9bdf7d6a67f214ab27b725c38fc37dd2df |
Hashes for supriya-23.5b4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad8e3f167296e30fd765eda3ad2c58ad30facfedc408d97350e5ac218f863337 |
|
MD5 | 2fd31e2b6a55ba81c721731da95b59dc |
|
BLAKE2b-256 | bfd276efd590b7a3b287d0981ec7673e52e2e7dabc0ae9b36b135266b6c94817 |
Hashes for supriya-23.5b4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fc5ffd896e4a9156eb7ed17c5c846c958950cab8486b127fc9a6b4e43359f78 |
|
MD5 | e0672cc2d69a1dde578315f9da4c40cf |
|
BLAKE2b-256 | 24d13dcc9cba2e8eb29c1d7b97e381b1526dff5edcaf18d3b0e26ea47f88169b |
Hashes for supriya-23.5b4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1adf1301dd11488dd1ac480abbbc634a2abd3d6c8f5a67a6775984e6af9697b5 |
|
MD5 | 00eb689e7ee8b589c152a215e7be2a6c |
|
BLAKE2b-256 | 036cdfe6ddd81d8bbf11ccf9856c6cefa298d4f73ed2e2105ff533238eaca03a |
Hashes for supriya-23.5b4-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1ce218195d179da0d917aaca65707581b54e92fa64a748363c157d436910c5d |
|
MD5 | e34e3d7a6de2c5ecc75a64ef0eed3013 |
|
BLAKE2b-256 | e43e2e2814aad1d761daead1fe2c01e2fdcf30a430d751a81561e6a21484f936 |
Hashes for supriya-23.5b4-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c401618b5957068815349e91da2f64a59d4427da598fbe10617841fdad743d3e |
|
MD5 | 40513450af5b8d675ceca050fb9efe73 |
|
BLAKE2b-256 | 7d515ef86a5709ccd9e4cfc138733ba5903677da3d0c7f03b21562a2c54affb0 |
Hashes for supriya-23.5b4-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 797b7b4228edc89f387b2662ed7d776af924a4e18cb13a90531baad5060a6db6 |
|
MD5 | ca9c3c92fe53c16b69f2d8a74e769c18 |
|
BLAKE2b-256 | 64b97fd40c53ff1d17bb4d688672370db054009fd3694811608032b74e9d2d3a |
Hashes for supriya-23.5b4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afed778998094301c590188d18577c9ed1698ab35a86770c682419a62a8c3b91 |
|
MD5 | 9ba563bc81d79d2dc308d92696e6c5a8 |
|
BLAKE2b-256 | 4c782b436ea0109e9eff2fb80f8967589439df4460c5355c4772b525d3cc85c3 |
Hashes for supriya-23.5b4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 382100cc59d1859fdffe48f7156e2ed15211909a379f1ef3c6f18f6a5bb8aab7 |
|
MD5 | b94ee278c899c26b9ca0df9bfb19b523 |
|
BLAKE2b-256 | 3f7b863c2e5be337c59ef5da65f0cf24a1f179f90ba14d5a5cc2c0a4957d7211 |
Hashes for supriya-23.5b4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31ed6908461878b91772187d223b1cd040ad3c7196166b47e948566e4e2784ca |
|
MD5 | a206843c50753e1bf3fb995b6d82f5d2 |
|
BLAKE2b-256 | 75da32324be242dfa5c323f0c25990395d189d381d6aee234c56aa347053f149 |