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.5b3-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fb55346e58e34158ef14f6a6601633debc5d05c295347fa840a8a91bfdd1410 |
|
MD5 | 7843d8e4bd310aa45e3ed4271b4d8cf7 |
|
BLAKE2b-256 | 79a7a92ef648833c0d93757419eb9800efced89e6ec7da574e3cbc2209fba333 |
Hashes for supriya-23.5b3-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92c652bfdc9ac5a81b52d6344073c72b093fb1a722c40b8e20727c339c370162 |
|
MD5 | 6628aa17d0f449c59a8ff767eff83493 |
|
BLAKE2b-256 | cd3a7cded24a549595da65690caae90b6a2b9051735aa29d6fa7f5b553e7cada |
Hashes for supriya-23.5b3-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5d91baa4543d62d4f8752e0ceac013d1d758ec066d96ac745c9d3f30e585731 |
|
MD5 | b8c1407adcb160ae7e9443dcee28d536 |
|
BLAKE2b-256 | 9080d5e55f4bd3c8efc532d25bd7d1a89e76a9d771ffee40e000819890b3e109 |
Hashes for supriya-23.5b3-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e74022ad7017b72f18ffc7173822b55e078036b2ef60884bd059f66a529b16fe |
|
MD5 | e993b0f8601561c2a87d4eb89b3f17ce |
|
BLAKE2b-256 | 367890d8ca629b4834588e8d0b354ad8fa45aa7d0d78fad0d7d4bf1d05c2493a |
Hashes for supriya-23.5b3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d4da306c468647876d142c3e54cd3d9487079dc0a972185ad24753eb7d26be5 |
|
MD5 | d5d648db9bc0fb09d6df71f816ad078f |
|
BLAKE2b-256 | 09f95711f66b9801c2b5d9597f3616cccbe7722cd8d9aaf1ae68abbed9f320ee |
Hashes for supriya-23.5b3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e434f34bb837fc3130add0588b2bf18338878868cc9a22243ddbe757d8568ffb |
|
MD5 | 73c913d4fe9c823b5e5eb4a5a243f098 |
|
BLAKE2b-256 | 3a6536290762bd56d4c927904a960958a784fbde4d6f0a4b86124fbd3a2c9361 |
Hashes for supriya-23.5b3-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e2a17e845b01cb20bc40e4db6d6d646cc03b897122e3ec3a24d66a29a0676d9 |
|
MD5 | bb92bfc5f6c8696d99b6ba245b516293 |
|
BLAKE2b-256 | 26a96fd22f4e1e04acd86759e835af5417f52b53b6dd0a32ceb985ec9e222fab |
Hashes for supriya-23.5b3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 390ccb2326f89487bf4c32ea00c88b2e936ab06dfe7e65499e3add40a359be26 |
|
MD5 | 85692aed4c4766cb9df35a6160d2d46c |
|
BLAKE2b-256 | 341898673b0855c17bf2103f337fba144110fe03762363feedb27324f301cc25 |
Hashes for supriya-23.5b3-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2b7bcc2a1fa7b86c0e7068b832c30dfcb678fa52360d3f48c8cfee1dc2de1c1 |
|
MD5 | 602b220a77a94d7f8481f4e7d9338856 |
|
BLAKE2b-256 | c68fb7ad5b869e82cf5138e3587b24c363872f7efe687de8140ca3bc706c441c |
Hashes for supriya-23.5b3-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8e4dd606ecc6c390a3d4a622ffa54f1a37077e907737ea0d829e7aad04c8a16 |
|
MD5 | 57f7e3ac228a61dccac3b38dc64c1a73 |
|
BLAKE2b-256 | c64f03e4a609f14df3c11753344035f1dedcd716f9184c388026ca9560ef950e |
Hashes for supriya-23.5b3-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 240695fefc4c5ae5f3163e9651f1ba658eac323bd7c6498a47f2937178b162af |
|
MD5 | a5ba1ccd0fd5c04502e07f1c90094f2d |
|
BLAKE2b-256 | 899c751471521e31b5c8c52b06d839298917eb77c5d4b312b8cbe9926e4547e4 |
Hashes for supriya-23.5b3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26d302ee7e98ec9caa87bc4a1e5ea662e538b02ec30e72218ca4c96572c0e9ff |
|
MD5 | 8c68fb01ffc7ae0d7864290b2338f419 |
|
BLAKE2b-256 | 7d635ea58212f26cd6b25f36949a8bfc1e680a17da0962e810912ee66a66c59b |
Hashes for supriya-23.5b3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8d0bc9228eba0155e533ae50172fe0bfe8b8e869c938d2f3a15910805aa18cc |
|
MD5 | abf1af4a31e4f99b4ef205eab2feb04b |
|
BLAKE2b-256 | 3c8c80d25355c6a78a6e2e96995df4be55bb38fb7d2c3ff92ac26e8649478910 |
Hashes for supriya-23.5b3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ccc41ca917a9ab19a4d06102c67282240c97f7e35fb4a46d47408851c272b51 |
|
MD5 | 9c5ab377ab9f7b0721f7c667b3acc481 |
|
BLAKE2b-256 | fd36229f36791475fc4e657a3c032f3d6c38c2af7acaa2410e3fecf1da2c92af |
Hashes for supriya-23.5b3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8c3b8d760691dc822ae81e141e6276dc73c34c0366cb337277345f84427e127 |
|
MD5 | 70d372481af1c6e3e1a06ba36912874d |
|
BLAKE2b-256 | 5dd2e2608763d05608857a61686b75ce9ffc3c0340074b8f61d5e9eda6928442 |
Hashes for supriya-23.5b3-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e41c6b75f1e2a62062ee35d164ef333deaa743b6cec00ca9cf9ba66871a3404f |
|
MD5 | a2d21aebce124d9dacc163f590196c5d |
|
BLAKE2b-256 | ad21297ee54f51910082181a098cdd01b44109d8cbdabdef3c35e56139dfe3ca |
Hashes for supriya-23.5b3-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6b9176eca8ef0ebc3acf0c2af13d64e5307889219a3021e8c9cd403539c1523 |
|
MD5 | 75bfc61605889e6bc8429c415043eee2 |
|
BLAKE2b-256 | df15f835569a19d1f79d3f6c8eb5d06e5c8a3b9f095cf2b770b349dfc39a8257 |
Hashes for supriya-23.5b3-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cbd61057a7dde2e0939efdb71374bda9a509dcbe3e352f1e4a4c1898e95a0fa |
|
MD5 | 56397b00d5e11f18b68c673c2522d18d |
|
BLAKE2b-256 | d06d29e5ef9ab4b3bd4c91f66889005fd9d420ee742b4deec6c74aa835feedd4 |
Hashes for supriya-23.5b3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9036ccc8d53c5473bc1a7bfc1a78b982c8605ad55e0fea17f7b69ebfac2a48a |
|
MD5 | ce9ca61f1e86be9df80128555e8009b4 |
|
BLAKE2b-256 | a5e5ec13ab7b4d87eff2d0fcb842cfd9407b108ef047b86f7cdc133f9ba44a34 |
Hashes for supriya-23.5b3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16dc3ddb8ea11bbc080bc02a360d66d091f7c410868d5d3286dc449c622384bc |
|
MD5 | 5333d15b84f42815f6b1709df124b919 |
|
BLAKE2b-256 | eaba6debe13110d65cf1535fbaa4ee60eaa985e6ed31e2788cb3b567d71b250e |
Hashes for supriya-23.5b3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53797d299797b4d895a68be38a849c9bce69b16d2e70d714e92ed4979e9caf64 |
|
MD5 | bef5b5e15704e86f8c8e231468303c6c |
|
BLAKE2b-256 | 27afae4abeb211d9e8b0142da7da1edd2cb9848a8f71abd203c0477c68bee1d3 |
Hashes for supriya-23.5b3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59aee3fee66c50b9e6d8dba6213faa266fc6c3ccc63796344ef28ba95126d77b |
|
MD5 | 1703c7b6b6696e5fc4b49f04388e3568 |
|
BLAKE2b-256 | ae9f0039cd1324363a2a5cca2ddb6a44a6c1344fb178b381a62824e6872c2285 |
Hashes for supriya-23.5b3-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c4854b6ce715a6f5570846e837e53bb5f18f752a6431565f5b6d6d0a822245b |
|
MD5 | 024ff302a07c6e34ea696482bbb89738 |
|
BLAKE2b-256 | 057c0055ab0f4742a40534ea85fb75a69358ad61a8d6277660e97a09aab66978 |
Hashes for supriya-23.5b3-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb406e2a6007a0eefcfc3b12bfa9b6fe7f6f8ca3af6bbb7182e26374dfb4c0e2 |
|
MD5 | 81887437b49dbea48b8c9df9e1659a30 |
|
BLAKE2b-256 | 674b6ec539b17f58e31bd0584b62b6c68eb924da2372d93223e3acd914333abd |
Hashes for supriya-23.5b3-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ea5979d52f08d88097b71f0f42859a17bfe4bf663ab3e0f563f93443368b46a |
|
MD5 | 6353286e5a75fef8e38832e05cc0d80c |
|
BLAKE2b-256 | 30242cec8b8f84585be5f202308ca499a29456b864ff89a5ad0eb9e0c9c0b002 |
Hashes for supriya-23.5b3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5e6158a4c349dce95c25cb3f58639125821527c25c858481bcf81d76184ebc5 |
|
MD5 | 0b8f7ce5e0949b2fe611347df0b92e60 |
|
BLAKE2b-256 | dc7093751347f2ef8449b5a3bbbd853f584a7ba03da7125a8350bbd1330030b6 |
Hashes for supriya-23.5b3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 147d1de22fd014d0738a9b192ae9f08f7e66344bf9e2b937a6edebe7bb5590af |
|
MD5 | 214c7724db6a1f19231016eeaf966268 |
|
BLAKE2b-256 | 70f10667ed47d0104775dd750acb5556ebc51e28b654264e34e9e9ae1397b3a2 |
Hashes for supriya-23.5b3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25949458d2f26d5da5af69ebf395030e1d47f18885854c6d3034e618e33400a0 |
|
MD5 | c5543caf1c8643cd589f7ab35416378a |
|
BLAKE2b-256 | f884dbd51cef35a8693300bfbc27a30dd78d602b302b8a970b258d0e7941a919 |