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.5b0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19dd89ce4825b6bfbd5c7c6fee01a70551fc0b76bbc698fedc459f4fd61a6de3 |
|
MD5 | 5774d64c1658f4e19d984328d22ae256 |
|
BLAKE2b-256 | c95c4c29663c631cd66b004ff4218cdfa883127d5afb0c4d5e647d8d511246b2 |
Hashes for supriya-23.5b0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49e0494789ad5394b8c0fa16fc98d84f8bff192533892c260d0cc74762a50cf6 |
|
MD5 | c24e462a07450fde962de213edf7ab37 |
|
BLAKE2b-256 | 26394069564329da92fc1bf32ff2bab165d799c7a95ddefa585cf07707d6e9c3 |
Hashes for supriya-23.5b0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47e0b3531e692e39b3771499563b2a7c86af8e812715af3e1e3f7d0355ca3d10 |
|
MD5 | de45cccd96094efca26b5d51bc507114 |
|
BLAKE2b-256 | 93df0622285abcd31e7a6c9df643ecb0d07a2ffcf7bf032bd234fc5859e9d52b |
Hashes for supriya-23.5b0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f3bc323c15262b47882e56a2d304f87e72d303a9d07951eaed8c6ac4928182d |
|
MD5 | 52ba372fa3e4a0ed9020a3822b5366f2 |
|
BLAKE2b-256 | ca8c9e5879cea4f19c215d587ff47ca13d1ea5d1260265a0cc6809e10b3d0c5a |
Hashes for supriya-23.5b0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | beae27e8858e75f6b47bbef64c44eb76be45b2de60ab89ae0545aa5cf555b3db |
|
MD5 | 7d66b0b26b0c2c9c5676467924027de9 |
|
BLAKE2b-256 | eceaff5b529ba372d40bb808d2cfb67fb80c25c6c4e8a087e347f177f7c20416 |
Hashes for supriya-23.5b0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b878f229fc6303c3abd6e60d2f3d5af09e9ca3b429498413ab16d8f0da91dfc |
|
MD5 | b7872269ad49d94b33b98c3a7544ee5c |
|
BLAKE2b-256 | db2e1ff408f50d0a2c6721c2d38714fe2f1ecc6bd2a723a2ce0e0eaf805cfbde |
Hashes for supriya-23.5b0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dc6c904b763e7de4a7b53919df505db17f5470fc144c6a3aefcc2ca7b516406 |
|
MD5 | 1d94b78b780f17b46d3e87a91f895a54 |
|
BLAKE2b-256 | 9387437f89a8547da8901cc8d65866e68e759717f4afcf4d685a51cefa25daf3 |
Hashes for supriya-23.5b0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 796849c70beb04d3ea5c65a4e71324d3ebb9b949390a02aeb8d33386493876b9 |
|
MD5 | 7472ed7370aee60adae9cbc5eec15bc6 |
|
BLAKE2b-256 | 3fe6d2f382c37804560932cb0c128562111d1da5f29b116abecc82ff96d111ae |
Hashes for supriya-23.5b0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c6ee8a07b34058191f4d2030eb9315f253bf28468a49995861414433845213b |
|
MD5 | d7f091443197c627ce3b4ad7e108e909 |
|
BLAKE2b-256 | f2790b46a91b8123cd6c3a2fbb2d273821c30b30b57f7966537ebdabad84f378 |
Hashes for supriya-23.5b0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e04b3c0e6dbb0fa36aa659d9945373447ec072364c7fb61050244771349fbef |
|
MD5 | fb938ada4d493e92b074a56d2a876360 |
|
BLAKE2b-256 | c7ba9c2ca21e9be54d474e19ab6f63552ebb057881ad91e0fbd88c3102eb016f |
Hashes for supriya-23.5b0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fbd5961b1ea7f86b5dbc9dd08b24becb4bd8782181aa485e9974af80a4d973c |
|
MD5 | 8a610015cb7d83dfbed700280edccdbc |
|
BLAKE2b-256 | e08a569383200b8084f2e1bc5094745b0fe76f8529b08fae060dc39e5a1eb787 |
Hashes for supriya-23.5b0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0ab15918cd35097feaf7c70d59096b54f7f9bc509d1b38dacc3f07db69b272c |
|
MD5 | 4d96243b719d3cd2e87164ba822985d8 |
|
BLAKE2b-256 | 19ea013e40f3d88883bd35175bd367ed822a3b4fef7c42bf44ab88636c5d86f3 |
Hashes for supriya-23.5b0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e31e00a6e4f1ad9a7712db7adbfc5ef01421887e458f64bb28d71c051f07a31b |
|
MD5 | 9165a1a98bf047794e88f995e200b80d |
|
BLAKE2b-256 | 221a8c278ab0bf1bf2a1f0e8d0c8e93dbb4346fee60afcf29a86986106e6ce5d |
Hashes for supriya-23.5b0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6f8e13a8e0d1ef6900b498b7fc09288ce81bc1293975598615b080c2c18f8dd |
|
MD5 | f3d7b309200ea64d6510f59594e03a82 |
|
BLAKE2b-256 | 4bd78e132e0d1701180905ba4d0d9521bf7d722b4444636e92c401cd22510c61 |
Hashes for supriya-23.5b0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd67e778015a9c7c4ba2dd2b52141f608a6478bf7203948ef2ba711049c5f47f |
|
MD5 | a0586bb144997e84e9adf1d0fabcc0f6 |
|
BLAKE2b-256 | 018a435bffdccd20a22e53fb726b3a31c777a222910ee1a19f55d16999d5022d |
Hashes for supriya-23.5b0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7e67619b8b32ef8a8bd5c4f614a85d041983c88e14696c8c0060a809f3f9fc1 |
|
MD5 | 7654927aab59ffb9c7905a5b9fd2495b |
|
BLAKE2b-256 | 636c6e6e9c5b1f3b9eaaf0998c23c7b18c395e9a917b5a6e0d1834f89df56a86 |
Hashes for supriya-23.5b0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cf95f0b6ee989b5bcbb52403149f1dcaef7689db3f3bae24565759541e9f7e8 |
|
MD5 | 467e6c468b2ff8f4d2a7c480956393e1 |
|
BLAKE2b-256 | 036dd3c86a5441bc7bfa6a33428ce219ba49e9449bde84eb8ce297e41f05af62 |
Hashes for supriya-23.5b0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f29698aabe137ceb67bc0cab54aa6b5d727bd06b735da3a670516f83d476a73b |
|
MD5 | afebdcb5da9bb0f2a407f8e27a65bcd1 |
|
BLAKE2b-256 | 1edff9c668af0fb47d9f2e77ec8921d4e30306eb430ee19ab253bd8f119d0b81 |
Hashes for supriya-23.5b0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5550e75d54c6aeda92541c85db5329d2cdd19a06427a7ad8127b284b88dc1b9 |
|
MD5 | 3dc46956b7ceedd9632164d458d8acd8 |
|
BLAKE2b-256 | 8c44930c16bd2741044c21f5a3d136f16e400819ffc72780f3f2781c326b9801 |
Hashes for supriya-23.5b0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f3dcfeec4a8ceec7311ce49cd490cc8b88cac06609e618d963065e763ef6b0a |
|
MD5 | 09b4a5360c26c9fff99ac44745a6a786 |
|
BLAKE2b-256 | fe5a5a0151b33c31ad6cc281cb7a5a72e207c68680ef93dcf7ba77494428f8bf |
Hashes for supriya-23.5b0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72258dc6ea45c956cbbfe85efac320a99faabeed1b3aa28d1baaf4e3322ef628 |
|
MD5 | c745c2e1d200857d3aece41e7a01d72b |
|
BLAKE2b-256 | dec97c921683bb6923e1fa3cd85ca6a87a2aca346205ef01c218770af57401f1 |