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.1b3-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fd7f64d2201a901e87bebdd1156abcd80e7cb9a9dd6add1cb45992cb31a9c25 |
|
MD5 | 66c0c803ded16185d7b03282b09152bb |
|
BLAKE2b-256 | 5339fcac615eb1cf844d17be9a7c6ca5694a027cafc7f4232790c4ff7e64dbd2 |
Hashes for supriya-24.1b3-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e525f9a81254c619eb301ad9a99aee4ffa646e0484a5f0a8c4d5dfa5d9e1914b |
|
MD5 | 20eaef9c6546cd90b2964c757c1a6274 |
|
BLAKE2b-256 | 3a15c44ce20ae4508f1f4b4b54e4ab28cbb69fbe774e738530ecc7172f6ebfa8 |
Hashes for supriya-24.1b3-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f045b228392ceb91a36ebe3659773cc32b25cb36fb839816afb83df84d2c24fb |
|
MD5 | f5ac60027eb9dab8bc78e86948578335 |
|
BLAKE2b-256 | 1ce74178505de0df0a6132f710947bfe60831bcc2857e8089721ce0d59ca41f4 |
Hashes for supriya-24.1b3-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc99a091c6797d45e76f9638416ec3df518d0d05d40b3feb9cbacae146381ec8 |
|
MD5 | a5b093e896b3a8d599a0318103003167 |
|
BLAKE2b-256 | a25814cdeacf3bfab6389764a58924a5a4ee0c581f9851e1539ce6d8a8671459 |
Hashes for supriya-24.1b3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15e4ee77c143fda93aa505e4f028cc7112fd24341f3f8b588a6c7e1bb15896b6 |
|
MD5 | 63ccb1ea4dfbba133e66409b3b7466d5 |
|
BLAKE2b-256 | ac93dd73f98bf5704b46238e63a4101cc57ef21c43f497056b54fc9a782ec61c |
Hashes for supriya-24.1b3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 788384ec3176c8efaec6b94bd6b5d28b04fb5a37bdfb16f521e8324354298685 |
|
MD5 | 473026f67b08405f92ec2710b4412304 |
|
BLAKE2b-256 | 7e134a370bc130c6cffba98c0ac47635659693b9e5fcb126d2a30a0e7410e35e |
Hashes for supriya-24.1b3-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6e1a648d717daa5f2c7b66966fea4e219724f35a71e998457d20be9118e52b8 |
|
MD5 | 4e13c884114735561da03dc4221b9567 |
|
BLAKE2b-256 | a4276f6965d4fd130f969ce5d675c07715f14dd3d342d44b0a69b4eabeb2bd1e |
Hashes for supriya-24.1b3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46f46f679567446247ce05977cfb6fe7d62857f05d7004a2a53fbecb0e766c4e |
|
MD5 | ae5ec9a8a839813c8c482f0d7080513a |
|
BLAKE2b-256 | 97161806a6e46311ed33bf30071f20e035c705c85fa29fdbf158e6e2a42859f5 |
Hashes for supriya-24.1b3-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 080439860bbf99f6ca0f1e1b46804b5489a97e54f0cd9f8b03d16b6e1f66be55 |
|
MD5 | 849bad2823cbefb058d7c37eb8701767 |
|
BLAKE2b-256 | 320ad148b5981149ab4cbbdadce3f22bd6a9ddc1dc2c10e6aedd5310b38f801c |
Hashes for supriya-24.1b3-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4aa99c3c70cb36d356c0a363fdbfdda61b82587974f91a4a41299420068f5ce |
|
MD5 | e52a6b6242ab1c71f1ef27357aa83a9d |
|
BLAKE2b-256 | 65d290f93dd0047d121d75cf3d08fd04447317429597910582713b520f6a0eb3 |
Hashes for supriya-24.1b3-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbb477e915e1746b3693e5385b241ca0924344d5904a0751b7720517e9f537cc |
|
MD5 | f58ce43163d9f04518ae8f459ba6d021 |
|
BLAKE2b-256 | b070d499db33a6adab8366ecd981a58229c0631eb359e4d44a8a987ee54cc808 |
Hashes for supriya-24.1b3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b8b88ee77dc0042fbd7a225c3278d4cf84455ad3f9ac3c6d2f440d20ecf2abe |
|
MD5 | 98979587acdf71f52c1609801089eed1 |
|
BLAKE2b-256 | 82a3bc9a68522077b1928ead5bcfb1f97de265a6484086b8cff79d21f5ca19ed |
Hashes for supriya-24.1b3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8923d36dd971fba20cb7822ceb1e405f0b4fad5b635cb0082e7e1e5344e0493f |
|
MD5 | 317cea04427a2322b7635496d7e08572 |
|
BLAKE2b-256 | 4aaa63388b2aff33d9210a93eb75fc8180b4b4412f8c9c425412527a0e93e28c |
Hashes for supriya-24.1b3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cca095ee8ef3ecd29b7f7c9b174bab8035f7c12638a496e69e6f98adb402111 |
|
MD5 | 4cb00d453c7bf9e916bb9c60ebaa284d |
|
BLAKE2b-256 | bd85c41284bc2cec147923e555914cf56fc723e92ac65407842f45b0773b142b |
Hashes for supriya-24.1b3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdae83557a0281140f80a8a4fce8a54f29970f8ef9c96410cc515bbed4dd8f31 |
|
MD5 | cb769debf563221d67e028b15c9594f1 |
|
BLAKE2b-256 | f827c33b33f1f0efeea89df8aebb30b06b417bc97d8eea4e4bf897e950e7a700 |
Hashes for supriya-24.1b3-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b004004bd5ceec85f088594afac1f660d08d6ef927900a9c5476d143062b034 |
|
MD5 | d90c2946208ac503ff18bfc905fc550d |
|
BLAKE2b-256 | 51dea8202ed1cf532435c7f7f552e2d5e74b81302538d68b2aeef614de8586a6 |
Hashes for supriya-24.1b3-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b65d934cfc9e6efc708acc7a1b59774deff693aff089c0f35c6814784470174 |
|
MD5 | 18fb7ccbe6280a271da0c75900c7b127 |
|
BLAKE2b-256 | 5b6ece23828f2a33e5e6922840be200634c44f7e70c941f14421591152da0992 |
Hashes for supriya-24.1b3-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c3ac5742fb65ab6c8fe8fc295b4b944e6ea11ff8bd650436c043a8e8eae6134 |
|
MD5 | 6b1c38045d954dd31b47bc2463da5c16 |
|
BLAKE2b-256 | ee021c344a70087c93aa7f415c1953cbc2c25954d1416dd0fb9e0d6fc6ea50ca |
Hashes for supriya-24.1b3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 682e7ad9ee2581769ad44ae289373f8095eca3b91c88f09d5d80076d56daef37 |
|
MD5 | 540192edceb765c8d4894967a32cb090 |
|
BLAKE2b-256 | 8170508d57e5a509adbf4b8edb6ca12a694ef4b8f6c46189a2205d054e11e56b |
Hashes for supriya-24.1b3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e877841fae51fe9c281e223e38b9f684d7fbf70f5ba9ec8106d8eabced747ae |
|
MD5 | c9a57eaf02a7e80d2228b1f4564e7cc2 |
|
BLAKE2b-256 | 0163c86a2c8a1935a0da42c78951b78ccd5068049e2ba752ca606afe0c033823 |
Hashes for supriya-24.1b3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c53b0648eb6a52b28e85e16fb576ab2552396cab05faabfea88dbab4c75f71f |
|
MD5 | c22422aace2b148db16ef166d2e94fbf |
|
BLAKE2b-256 | b7b366fbdfa3a87c8f4ab6aae8e7e85a102590ad1ab74d908b001604387df2f5 |
Hashes for supriya-24.1b3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c6151ada9fd1de6e426cf1f853d6f0322c73c00d51a2aa12e93f3fb75fd24a7 |
|
MD5 | 66840c944a96360ee30859756c2c08ac |
|
BLAKE2b-256 | eaeb93940b11541ad405f53b8a6a8527c56ab76a55252a3ba0917b599591a7dd |
Hashes for supriya-24.1b3-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0233f0fbe63988468a3b35c9a14e8cf3b5a463903c8b58d4ede992474a003c29 |
|
MD5 | 0c8b28ef99e3f24050f8a868f42665eb |
|
BLAKE2b-256 | 761ae9c354b8a6576bf9f9f77577303bd74beedc6055d533f68b6b9f163dc248 |
Hashes for supriya-24.1b3-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97c9e838c75ce5729971c98dbfdf7ad51fd7aac478285df901a606f5b251afc7 |
|
MD5 | bb28d774adabc2589d836a65f68a0d9c |
|
BLAKE2b-256 | 8bf53931bad0e31b967f6bcc01c51d04303e80843ec7c35a73e7136bc2d6b3cf |
Hashes for supriya-24.1b3-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d54a8424e4b8539b1012bcd6587fecefd4e7343c4ab13f34827acce3d761b8a8 |
|
MD5 | c4b5e35779b1f9dd53daa6d2e8e22057 |
|
BLAKE2b-256 | 7c4dcb32f75501a26d62c1e76e64a602a2a7e47b1f8a7d41f809bb304907f7a1 |
Hashes for supriya-24.1b3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38415aa454630167ac2e411d7cde2aecf4053e63c244241976153b2830400975 |
|
MD5 | 7f70cfe5999ea67f5f2f53023aa40891 |
|
BLAKE2b-256 | d45f44ab5fc77263c2f3e67cb6196a44281127ca6018173a49da5f227effc71f |
Hashes for supriya-24.1b3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fa203240b70abf61bd49d267032a89c41d0c210477dc1573620064421c8d8be |
|
MD5 | 32a6be796a7eb9ac550c9229ec9c165b |
|
BLAKE2b-256 | 4045b728b49667f7a9b4abf6133ef6735e2e4644e3012ba6a72ad8f5c9fcd9f1 |
Hashes for supriya-24.1b3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6baf32e49c36119a69b4dc0fc7aa702015b802fb803cadcffc3ecde85bd7130 |
|
MD5 | d3d5e6b3b83c3f95e19e4db0de109ec9 |
|
BLAKE2b-256 | 2fac04fb395eb9a7cd19105d3d7c4cc61a0260075f5db544621f46ceb821ab91 |