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.7b0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52c10583a4f3cc1b28b6e85341ec5db25163e5031c542061c1b0e0215e5e6974 |
|
MD5 | 861234389630743be9179db94a16c63c |
|
BLAKE2b-256 | 69bc80d0890a20a3cd70687876cfc8dbcffcdc5efd9ebb87c4d7a2714eada3ff |
Hashes for supriya-23.7b0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 105b263cadd2cef7d0e0305c2107c3c3df8de4fd6128e9a2554504ef990f31ab |
|
MD5 | 56ea57ceeb76430729115eade096e6f3 |
|
BLAKE2b-256 | 7847eee66d9967eaa6c6fcdf08a503a86076c0a65a41547bec63d4a9b101e4d0 |
Hashes for supriya-23.7b0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d8d12bc8d0bfab3465122100eef95042fe481b22dfb41c6c045202f79f70d85 |
|
MD5 | 0c87ecd808810b8c711bd2f2b3428ae5 |
|
BLAKE2b-256 | 6389747ff3373b0218821aad3a8c3e2219bcabef64e033d1dbf5fb3a6aea9836 |
Hashes for supriya-23.7b0-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 683a54f3b79b2145e8ac15259f74166904340e7b48673628ba59d9cdaf90fce2 |
|
MD5 | b11ef5f56e29bd34b015a98cf5c26051 |
|
BLAKE2b-256 | 896fa2f6279e4151c119061a411b81cd74b8d1c9d91b802c4086b67081b48580 |
Hashes for supriya-23.7b0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df002372a1441ab500f4d9d257b08dff11e530c6833ca7abed8d154654b607e1 |
|
MD5 | 0e52c6902dbc61b81d0d9ab48a5e2029 |
|
BLAKE2b-256 | 53115f5b8e96915d02f600a97efaeca5cd0c4dcd61219534e559c9da0ce665fc |
Hashes for supriya-23.7b0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4952770a31b0165963620c54d0f6199b62af1a31e08b567b83b5c4e2518fe738 |
|
MD5 | b2ef9d568fcb7b25e998e869e2940f93 |
|
BLAKE2b-256 | 019e3f08ec94ea75fe1bde99f9eb46e80fb09f716b253975e2c6972a519f210f |
Hashes for supriya-23.7b0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0184188a5399f0d508bb8489ee195b1a9a641b9c01e2e1a2790b7368056575d7 |
|
MD5 | 5271432d4ba73e51f0b6e38087400941 |
|
BLAKE2b-256 | 522c1fd3fff207ca83286f7bf114b08a3afdb7d8d14f680157c3a54cd0ccb876 |
Hashes for supriya-23.7b0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 649a6f2ba7c24eb4d34b87d1f72ad7a1009af046ae719245bd6c73cdd0aa7599 |
|
MD5 | 313391bc1fba871d9934a589dceea678 |
|
BLAKE2b-256 | 15aaf6e74b1de3fd9ce4b2013f219dac03620d85888b80479b338174482634e2 |
Hashes for supriya-23.7b0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 921557b848396e152c25c9f709e1b30434fdb1e950999fecd4db436733ea05c6 |
|
MD5 | a8169872d87598870614119178a38060 |
|
BLAKE2b-256 | 8c3f2c3adcf9b99857ced922f22ce9f40c02ff83a4b19b4f0c69040727f238ab |
Hashes for supriya-23.7b0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82d1f45a26becae2a8e998d549ac7f871483497624d016cfd0fad9e186a9fc09 |
|
MD5 | eb6e84f1f98678ea2f46124fb6cd3dc4 |
|
BLAKE2b-256 | f9552589bdbe617437a09607d46a0f09646486e26c8fc42d272f9326e5585a0a |
Hashes for supriya-23.7b0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4a9638d6a50bbbdd8a810881f0cdeff38c4edd90ff25fcbcee19abd4fbc8128 |
|
MD5 | e3a0ea3878013814478e081b327c2e40 |
|
BLAKE2b-256 | 1a541316e59122bc93d70384fdd006184c786ba34f445e021810f03743b3b560 |
Hashes for supriya-23.7b0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b1f9274ff8af0ecfd059dddce1469c39f0fee17b518649b141f283d6374e919 |
|
MD5 | f73904ffa71f37aa4a024d5b402c8732 |
|
BLAKE2b-256 | 32e4044e31520cfb8400b141712f4d9134a77c4630825bb01a3dacc22082584b |
Hashes for supriya-23.7b0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad2148350f91440bde4d33cd5d5f4eb39e89d3e3ceba1ce72bf365840c7973df |
|
MD5 | 8d1f054251720b82f72499f149a2d265 |
|
BLAKE2b-256 | 4405c403dc6da4dd8d1e3912191dc9ed2ef0739112b8fdc37239fde5186b25fa |
Hashes for supriya-23.7b0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c994ae5a12dba91788bedd35b1c10d2ba6287328ebb589f8cbbaaa3df154491 |
|
MD5 | da39eebbe789dcfd659a2f2e1f71ddcd |
|
BLAKE2b-256 | 16c4919ae1d476b11ae9a71c7273739c104deeabe28476d4c425bcdb02d7065e |
Hashes for supriya-23.7b0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e43aa14836e1a4dc8d4e2ed69d2aee7ff5e497d61976e9f5ba9eac83f405faa2 |
|
MD5 | 024ae05dc95c17137fed515d91b2d2ca |
|
BLAKE2b-256 | b400cecea2a0deb2369391387779fe012e160889fee8e392e539147c5893ae66 |
Hashes for supriya-23.7b0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6242dd90bee0b28cc11c110b0e2466915461994d12644fe257448999f4c8635a |
|
MD5 | 0dc3357e864c99f72b5da418f9514687 |
|
BLAKE2b-256 | 03ce5972d57f533d63a5244540fbdd493d7a0285b0f4f1e22e8d759080680ab3 |
Hashes for supriya-23.7b0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e0ddea7fe81f2cf772937e154677e1477e6ee3248962e5efb342083b16137f2 |
|
MD5 | cd26dfcabc56db20c8f3c797058b6e5d |
|
BLAKE2b-256 | 9199c5e93a5aa82db48f9594b9e12bbcde4db9c545e77f78867b399f7c1b6d6c |
Hashes for supriya-23.7b0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92d80ac61a67633d780531c04f6985981912f6d8f685646cd5ca9f47ba27b27d |
|
MD5 | cc3d98d9c6a8b9707e14e8a1e933f662 |
|
BLAKE2b-256 | 53722cf41f458d6e5390038577f9c974b921c6a24d0eb6efba3a2de9c3d28ca0 |
Hashes for supriya-23.7b0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 734c4c36bd10a0710164a63e8555b16331d5455bd9de28ae19e4c0c16dd6033e |
|
MD5 | cbeee9a4db64f6de82bdcb6a1fe034cb |
|
BLAKE2b-256 | fdb475a4e79e44b768989f979a37941ac27f917a3f1df4dde8eabfe66b376c05 |
Hashes for supriya-23.7b0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77813934e7faa4ded2ac539b5756c0bc5e12bccfc21c2ac4b596c61c81fc3379 |
|
MD5 | 7f829a208b51a49a82d0e9174b7946f3 |
|
BLAKE2b-256 | c5de56e533b3915d7c75e73d5f9111dcd19615b9f2f46b97ef67c96c7f62eae8 |
Hashes for supriya-23.7b0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39b7a18e8c1cac221f0a8a85b6bedc20dcd5c0b448732b2fd3fe515434fc39b5 |
|
MD5 | 6ad887ada809b614c946b4c9afa1129c |
|
BLAKE2b-256 | 75baf6c270cb7dfb448aaa9ccb337571a8ddf58fa08296208d627d342d3d0992 |
Hashes for supriya-23.7b0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c7535ef77f8d6e1fa99faf5ad43e72063485d118fd138d4c77bca2e63e8062b |
|
MD5 | 953aa162c035213dc3dfebcee6378056 |
|
BLAKE2b-256 | 2345ac929605c96834a429ba32eb166176fb89dea332140ba23144b950d77354 |
Hashes for supriya-23.7b0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb9df117e0bb13b477081e839c3cec43eb057f64d3675a6e6f801fe00db36032 |
|
MD5 | 3f52d3c36424c3d02e3f12adfb8a2814 |
|
BLAKE2b-256 | 77bff6e108622e502ed4385982ad513187026c73ff8c5dde35dd0447917127ac |
Hashes for supriya-23.7b0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19eee51a685dc0dae77c95a9c9f649cf9902bf1faeac20fc649bb90ff0a24e85 |
|
MD5 | 0e036a6ab98f8d849e9beeaeadac0a94 |
|
BLAKE2b-256 | 953cd9ef4bbb5e8144b67238500a69d832d3c5dc8b75a2fb394bddb0eec0e857 |
Hashes for supriya-23.7b0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f3172dedd9700080c16f197d140cf55d6413d778e93ed7d6962e21b51fb64b3 |
|
MD5 | b57b7d82942cabb9148abcf826957f7a |
|
BLAKE2b-256 | 208ac32b59850d9fb6b445d2b885dccedec9e3ae5c1a78d7867cb6566990db17 |
Hashes for supriya-23.7b0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 555a513d8b13dfd58082168ab27948673ad8b53bc8c27c76700ede8614247dc0 |
|
MD5 | 0f414fe7f186ac4de6cf369ea2795384 |
|
BLAKE2b-256 | c4e82dba26d9abbadb02ff9e764d2e746e87de7c41e269a19784e7814132d645 |
Hashes for supriya-23.7b0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73accb85c2baac3ecf7af00d3d2d21194f495db57564bbfa5ffb20cc65f4835c |
|
MD5 | 0730e567db662a83dca19cd737306d00 |
|
BLAKE2b-256 | c89d68d534023f10e1cdf4a8b21b7fab69c8b07a51940d7441d58e58881d4c48 |
Hashes for supriya-23.7b0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfe3fe4eeb49cc32f0a9113f7b70f1312e8b4e9019716aa9f279790241cd3a6e |
|
MD5 | fd372f0ccce187ea1481adf4519867a8 |
|
BLAKE2b-256 | 107b08c8cdf587e214bce941e14aeeedc90850ea428d67a5baa8b33b48f3c704 |