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-24.1b1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 615664373ed5c61555c65c26fed9a857b607d04338a3478318be682ab1c7cd40 |
|
MD5 | f5d644439a81b6afee48e3e0d88ed748 |
|
BLAKE2b-256 | 59f7faff18e3ff2efc61ab1579402c0558107cdd2f5f47653f73442e759c1284 |
Hashes for supriya-24.1b1-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a64241c8277524a4708cfd8f61550cdc3cb41595a35d8209e55f0d35f3e1a437 |
|
MD5 | 3d3efa2a00456072a40b70072360595c |
|
BLAKE2b-256 | 667ded9567568f4e78d474f31079f32cc7f6f06405075355d7247bf9d4a48c02 |
Hashes for supriya-24.1b1-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a21dc4e3084be50707e000aae93f5a1a0a9fa7b90e1fc4b022d3d03c8ef899b |
|
MD5 | 03e25d38bfe875ded5017dcd7fd1cfd3 |
|
BLAKE2b-256 | 16c8756b9460e6938974f4c7abf64cd2a6c33585da2e09bcd6fcf917537f452a |
Hashes for supriya-24.1b1-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dc9ed9cfc55b4613fb4e32cb8f90804707815531f4b3c3f5819b100b02f0ee6 |
|
MD5 | 75874d9ab49e393e428ce45b5fee9e2f |
|
BLAKE2b-256 | e9fb55d70442270cd84e759d77e61be4a2eb9ac973d1bb29350c5d03050d138c |
Hashes for supriya-24.1b1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 419305cff6e8a7dfa9847fa30258a86787dc44e6ed5baf39a2df1f30e6e796ea |
|
MD5 | 9344ce1404e230496dde49d278fb06e4 |
|
BLAKE2b-256 | d324b9c1fa659e55f278784de6f88102db9bea1b729c8e7197c92305fdc9d448 |
Hashes for supriya-24.1b1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee4037e2dd6d5b274e9786bfad6b1debb4a9c63c66d96252f0f4c66f6f7972f8 |
|
MD5 | 8ff181bb4403e4d064a28ff0e490b66c |
|
BLAKE2b-256 | 16a1ec7c2bb51f4a62e32ba67753ffc39a13582142e575541d8fb02742d6283f |
Hashes for supriya-24.1b1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5210031dcb1bfa606cd6b833a27fd67edd81ed6a4a743f5546579f27d37bfde |
|
MD5 | 1103850c2c05ee8913a08917dc7bf070 |
|
BLAKE2b-256 | 237b588f2f548c24220fda6326ffb8fa6d1fa72501b81307c7af097031eaf55b |
Hashes for supriya-24.1b1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3de0d211cb1b2db4b4d85ae7f8cf4d4c7bc9a61114baeeffb667bc3942c89ea |
|
MD5 | 2cc3f012a78e444e00b4ecf267567ee6 |
|
BLAKE2b-256 | 6d7dd5089ad079b6cc6e1b27820cfaa51029e2a6e4f65c1405d62268107834ab |
Hashes for supriya-24.1b1-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae2b1bdb68ce089dabd0449f41a4575ae00c3eab78bc94efbf103eb8fab0cbb5 |
|
MD5 | 356a6438e0ea03f0542690edd0cd3959 |
|
BLAKE2b-256 | 21274495facdd0cec62170179e95f2ac516aa8afbd1fa0687bf02208f0d41d1b |
Hashes for supriya-24.1b1-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23fe04b0d2bc599ea0738175d93362b0f3decd41bee76e0cc708e05c7c05aa0d |
|
MD5 | e6ea3a5989fbf56308b13cfd126715cf |
|
BLAKE2b-256 | 2f6f007ec9a1678bd65f2ba45af0c80c3823b1688f38dec84a91fd14348ff3aa |
Hashes for supriya-24.1b1-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbef9425aba34d099b5cedee1b10127300e2cdde6b4f43d492a0567590360732 |
|
MD5 | b0fc63b36be28165b04170293e4df59a |
|
BLAKE2b-256 | b88897d003207469e75b8813cd1064290563b37fff0a1cd52481c70e208429fc |
Hashes for supriya-24.1b1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66f8acb326945efd41344de90e280fcefacec54fdac159ccf968553f34d123e3 |
|
MD5 | 37dce673b2dc15a35c64d7e3a5a4bc38 |
|
BLAKE2b-256 | 13db2cf60d7d0a50eb2e2c6dd1f164fedc7753e800565e34abbd569981f6e8d0 |
Hashes for supriya-24.1b1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8dd81954a319cbec90bdb5db8c49709102bb54807f76f0ab64a300d8d4bfeb8 |
|
MD5 | 4790dd5da19b98f56ebede690914fdbd |
|
BLAKE2b-256 | 0939bf88949fd35f278692c45a8ac74a91b9f553b25c3cf879355e1f96e2f7b1 |
Hashes for supriya-24.1b1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2d95aba1a9b536a2d45856d76392dc76a001e936710fa7575cc810e49387802 |
|
MD5 | 30887729c2f9928641adc6a38d56dad4 |
|
BLAKE2b-256 | 4ef4eb8c0a6464bc8f5db10eda6c4385519a900a43c29332dfc8d4d70ce3aae4 |
Hashes for supriya-24.1b1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4eff5a9b89947ba145162127eeb74be48c1515e7da12ae4c0fc1b1b03755b410 |
|
MD5 | a8a12d2d2990d404d89ee70a5825b722 |
|
BLAKE2b-256 | 7aae5a339d3305db2e3b7a98ef9ceb333dd9c37dbc7c2aed29d1dda5246068fc |
Hashes for supriya-24.1b1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e8e581e2f954cf7409818537e3ab8c572aeb5625934134e38807e3127d63ddb |
|
MD5 | f8c75f119a27599aaf6de872fc2a91f4 |
|
BLAKE2b-256 | 44197e347374208e4e996b6f283a8b308be1bb91e318e84d49436ace1b4b4308 |
Hashes for supriya-24.1b1-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2027e6ff56eadde4ccc994e7378fb5710aeac11eeefe300238fde5a4619cc55 |
|
MD5 | 4da27f44fc7bc034690666f8cc03d9e9 |
|
BLAKE2b-256 | ae4833bfad42b0ad84c5179fc0eb91e84595f8ca28466d2966836f4d860f0f8e |
Hashes for supriya-24.1b1-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 767eef390a7aed10e1f2410b0136863db254cfb0272403dd264439831c9fcfc0 |
|
MD5 | e198b014ad5e590d8f7ca22ec55440da |
|
BLAKE2b-256 | ac78d7a3acacd3109f0453e6eddffc8c6ddf751004b5246066dd15484f183482 |
Hashes for supriya-24.1b1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adba2125a9e6d8904d12043051098f32d03f59b3d52377d5a5e0ed7cb974df0b |
|
MD5 | 893d81126e7b0de4d7b897d6da61b93c |
|
BLAKE2b-256 | 6b82e87574dead8f7604140422af700775728fddebea3c9c5ea575e44af57b61 |
Hashes for supriya-24.1b1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 570e36414c338519ab5d3b656c1f25637553b602d5eff1e58c274584c76893b9 |
|
MD5 | 3cc731bca74e5735d078aad4a50d821c |
|
BLAKE2b-256 | 2c93e5433f17ed17588662e2b3d5ffe40ddfc0a943886cfb9bd4ed6e22c400a4 |
Hashes for supriya-24.1b1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e130342e1931a0152fe8b7581fb04113e4ac7957aa46037dd9f9afc388a9825 |
|
MD5 | b334d9296919b3357f4a9478df75cf7d |
|
BLAKE2b-256 | a30b83b3b25be20932597aecf42d61c2d0faca291c1345ec33e21ddf74a4c7fd |
Hashes for supriya-24.1b1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac1325f8235a4f3b1e4e704ba91f71e1eedae7d3ab2b98830b3679b049640ed9 |
|
MD5 | b4e0cb55477f47cfa9ce4b0c324770f6 |
|
BLAKE2b-256 | d3e892b3d4f760d702f9c59a18ad01dc750e3b0a2964a5bed1abcc2830375d25 |
Hashes for supriya-24.1b1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbb72e2d07ada6121570adc06e9c2c54af8f8423d145c71d253f55dd0f2ecc7c |
|
MD5 | f51ad763e09f8db228cb2e92efbdbb89 |
|
BLAKE2b-256 | a0b39a2187e94c9abefe24fa99367cefbd49c770463aedf9a0a689d3288e9051 |
Hashes for supriya-24.1b1-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8df193ae38f9e7846ef834279587bfce96349eeb881dd35d1d1ffa7184ddf314 |
|
MD5 | a755ddc838b378ed6868d4893eb95634 |
|
BLAKE2b-256 | 9554fec670834dbc635d107ae4567c14463970913b086f5403655497b7b0c0e8 |
Hashes for supriya-24.1b1-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb48599e6fca429fc80cf6a93183d4cee6ba9926e2d2cbd5f1601251111a84ca |
|
MD5 | 092792f221c4b72b7e7c773aea1bce36 |
|
BLAKE2b-256 | 407ea00ee1e2df89cce69c3d4a3a3758062747a0fed109d2751edd25e6540b60 |
Hashes for supriya-24.1b1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48f066820d597521edc10f3bba4fb37467a84e4d4e9ef9a1c647a68fab2a9afb |
|
MD5 | 2d739f9f81ca4e248ad3e4ce2de5f978 |
|
BLAKE2b-256 | 2e90b377452df3d69a1a07773d83fb2ec86350d5c58434d8d3da65ebaf02c44b |
Hashes for supriya-24.1b1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03e5440520c8327db72cc442d0e53ebe7afc2e60452683ded97d74f55889d2cb |
|
MD5 | 0bcd9b6f5ff586513058b826ac5d22c8 |
|
BLAKE2b-256 | 392062c248f1f89231f6407673f23816aacd07fbf0a78fc2354f51f467ff561f |
Hashes for supriya-24.1b1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a6c3c4a3705f61d0678459d7b257be3585e29709f270d46b7f6e86a3a6bd71e |
|
MD5 | b83d166ffb9c9e80e8e5182d861e8a3a |
|
BLAKE2b-256 | 5bbae8410dec1eb5a6b1812b4b41055007f6664c313f06077f3c6bd4f601a6f2 |