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.6b0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40bedde555d785c98207fb849fb26adb88e02f691cadda756a5db126b9254d44 |
|
MD5 | edfc690d6a874cb6115cb9427e6922b0 |
|
BLAKE2b-256 | a2ba1efeddeeee274bc66c99a235c9490cafbfdd42aeabc2c8c164caf1c32acf |
Hashes for supriya-23.6b0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b69d981fd0a6f60fd5a95b1aad8d824700a410c75ee380dc3ffc2dbe8d598b3e |
|
MD5 | f03f206aa107a1e7c68ffd29ddc8485f |
|
BLAKE2b-256 | 626d0ae2ad1974731bbbc8e4c8f422a730ecdbaba7da8fc65bcc2556b5649a75 |
Hashes for supriya-23.6b0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e29972d8c6a4aa16026d8a1f7419c2f1b93053edec36db27630ccc8190dc0159 |
|
MD5 | 1b97a8e912a57ec19a7e7d32d38af844 |
|
BLAKE2b-256 | 4d6465b801744695060dbf74766a705406fa410f8609d922bb7baa9e6e556ded |
Hashes for supriya-23.6b0-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | abef7bb8fc41bf826e91217e8f85da76ba0f3c34425930ff96fc79f0c0ed5c6b |
|
MD5 | 04f604b8a49d455683a09896aa4d09ff |
|
BLAKE2b-256 | 5ccd16b818d453e48ceb869aa5197c31e5964138907936e6b638c424c426a329 |
Hashes for supriya-23.6b0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d00987bae5472145275fe6c9d9400255b95bb0efb951e8023b093e1ee37dd54b |
|
MD5 | cc922431f3d1270c2c9dec5f0f56f792 |
|
BLAKE2b-256 | 07d3df8124f119e15384764517b3167ab1679a1470bbdae8e214a9d601d4b739 |
Hashes for supriya-23.6b0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | beed550260a0bf7daf07a619cb9aa6aabb781a991065ee5d5245b193f1e20626 |
|
MD5 | ab47c501bbcec5e166a40c35d966cff0 |
|
BLAKE2b-256 | 7178dbc3f60eb47d2ff7edd2075aa44a950ff87b23d98689813942d6d961a5aa |
Hashes for supriya-23.6b0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57d718337a16432a4523e9511623b50c2785e6ed07a857316fddc382a8b6f6cd |
|
MD5 | 7c31f205193c1dfcec59ae8ebec72d6d |
|
BLAKE2b-256 | 27b8aff7e8e64667a1420b207284cabf3b79d2a91681c6adcbddfa3f328ca620 |
Hashes for supriya-23.6b0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 614cb0adf23dfe112848a8b90b040f19be145fe26b7e2f6475ce32a4e385973b |
|
MD5 | 3e3d94d9d5256a4ae5d6200d08d5a30a |
|
BLAKE2b-256 | 46c0b78eb0635bb72dc90a09e29601c6706cdc09bf9bf55f5e92282fe8e46941 |
Hashes for supriya-23.6b0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a918c4c37968cc8ec653ea900a62e2383e308f65df58c5c46fc784407e6e99d |
|
MD5 | 3999754c83e829a905f37f7413700648 |
|
BLAKE2b-256 | c7048bdf3631c4427febe39c38ff15207bce42be04378b57320a91ca69a7f11d |
Hashes for supriya-23.6b0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14a256c2a9e93cd3132804f9ce6d4bcc84e6dee52dd9e43da2a725582aa6cf59 |
|
MD5 | c295246d32d78e0c5d49ddf52eb8a21a |
|
BLAKE2b-256 | b342f48dee8dbd5a949f10185315877de67cb0f7877dbefbb6bb9f0bee80afc1 |
Hashes for supriya-23.6b0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76b0a744b97efe4c45d0daa5b9377781b5adb78b14c08fcec3365be172be5207 |
|
MD5 | 28133002b72d6bdfae21ad1bf771b32b |
|
BLAKE2b-256 | a12ac5bfba2cdcd2251ba4d49ea831b137e57e24ebaadad4cb6425f7971b422c |
Hashes for supriya-23.6b0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 228a928bb21811cdc94e19bff2bdc35fd51f9a40995beca3ffb38385ff553e14 |
|
MD5 | 786354c51dde94b500b5aead33911b2e |
|
BLAKE2b-256 | dfbfef837fe39293d9ca7867571536a10ab2d1ebde7f8bb4ddc62518beaf88d0 |
Hashes for supriya-23.6b0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 668c60fe712a90f558e2ae1c1f21e3756bd2aaab9b57501a8e4ea7bff02c239d |
|
MD5 | e664f854bb2b84d4edd3af44b2b6b742 |
|
BLAKE2b-256 | d3984d0d6922544007703b2219b36df9cf098f7673ed55e1389283804caba224 |
Hashes for supriya-23.6b0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b28cd907201acb287240706bf1d7be38267814941e24235b03a1aa54a2c9fe07 |
|
MD5 | fa65498b81fc9ae058759a68f557db9e |
|
BLAKE2b-256 | cb3274dcdb641a3e6483dce23bc758a10690f4d98735e7b915fd5658e956ac61 |
Hashes for supriya-23.6b0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 322049ae10541b6d2af299fcfdb5835ffd4bdbc123363f92e122db36ec8fbad2 |
|
MD5 | 59d56fc0df4d13fdcab808907fb70db6 |
|
BLAKE2b-256 | 9c5360652103446ba65860d10ca12e0227a76988423d621759149129729b359e |
Hashes for supriya-23.6b0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83118ea5562446c1d705cb89e8d9415d571ee42049c054b9b7a32d65916e96f9 |
|
MD5 | 23addd140f91e0e727bab040c95f4648 |
|
BLAKE2b-256 | 86a112886bfe9ca654e4b97df63fbd32c07db174d4fb212c982a4e9fa2895a42 |
Hashes for supriya-23.6b0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fffaea89e2de6a3387d4517088e014da4dddc8f6a1207edf05e98c6bd3dd2e1 |
|
MD5 | fc5de2a5ec1c8c134a319ddfb16886da |
|
BLAKE2b-256 | 298ea0321dfd6fe3c3399e9833e3193dc8bd8c02635232a2fcc112f75923220b |
Hashes for supriya-23.6b0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7dd084f0f4b43ef109a5cab8506adfcbee4683d0555cf20dcf74cfb7728ca4a3 |
|
MD5 | ffbb57c25012bdac6fcb931ea0bc5c27 |
|
BLAKE2b-256 | af1132eb969330368065db210f6ab1ddd5677e8a6d05f39708e45db555a97874 |
Hashes for supriya-23.6b0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1eb9ec6daaea30b1ed85579760b7bba5a68ccf743d9d4ee260c1af58bda71ae |
|
MD5 | 0766e449aa54b8fb507d739fb63d56ac |
|
BLAKE2b-256 | ce183bb45a85325b42c5e4a54735e20f7ed383e756f41eb2dd2d25e64818b5c0 |
Hashes for supriya-23.6b0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1bdf86fba4a54e4dcf69c739cbbe93226a0d03e450d29c38bcaad860b153a5b |
|
MD5 | d7c3e09d918d1a560192fcdb97e2377e |
|
BLAKE2b-256 | 6b8107ebfe5152887505211c73e7524f2ddb59ab234bdf1c85050670d2aa873d |
Hashes for supriya-23.6b0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3255dfc54022c7ac08cc3bacc84401a01152835f983a4649c4d956b934c9405d |
|
MD5 | 2e8120357f511916aa50d7fec63e6cf6 |
|
BLAKE2b-256 | 04b61d890c161bde15c993d357195a96288502f21d76513123b201ed74c7623b |
Hashes for supriya-23.6b0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b7b6e3e6fbf69ce123c241d41cbcb778fd7e89b78572d52132b490fc1f9b9d4 |
|
MD5 | 958a3d1b863c6c39e5c87ae9f5295c9f |
|
BLAKE2b-256 | 1699f7ede94bb07df58e2aac6e85c9d5df5b754c781a9c2a6fe5a5c2b727a389 |
Hashes for supriya-23.6b0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e25b310bc0fe070ab36dc1f83880b156b3fcc805cecffcbe7a5c7fd7c4bacd2 |
|
MD5 | f640991792d822bd55d7489ca24227f3 |
|
BLAKE2b-256 | 3ea77ff13fef76a72d31942a454eaeb87d08cf0a904f7c0b07eb8c638a9382fd |
Hashes for supriya-23.6b0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a67df7ba59f90d076c3f4f7ff4346ce95715eca4a76faf047ea1f018014601aa |
|
MD5 | 4d55673f3eb3b253e4d575b9a184e7d5 |
|
BLAKE2b-256 | cd84b1ce9ad76feb18a0b25c86cc6e0abbacffcd515ad29e479a99e1c3d849dd |
Hashes for supriya-23.6b0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1336cf5f91a7ba5e12ff590819ddeaf341831eca715acb1a80ed499345fd89d |
|
MD5 | be3dc888174367c59bac82a8dfe92f02 |
|
BLAKE2b-256 | 15c07494c43577e0351e95c1c094581ff9e2ccd14358c557437321562435fe32 |
Hashes for supriya-23.6b0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 460e5517aa65f5fbf81637a5a90b322f5d7247e2464afad6fc02ad0debd4f25c |
|
MD5 | 2cd76e61f4a184832c4414c636204fc8 |
|
BLAKE2b-256 | b91e30e3c53cc84819e109a65922f5ff3908f159d7d9b539e910749883d2a652 |
Hashes for supriya-23.6b0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e064ac9f102ffa2a1a51bab1a0a4262800f1af2562c6cde6de85a85dc34d4fe6 |
|
MD5 | 63f8940833d6ac5be93c9edfc2b1680e |
|
BLAKE2b-256 | 30547a1efc0231cc23f66f9b766bfea29d5ea24d9eab33795498ee10f5986a15 |
Hashes for supriya-23.6b0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6aadc11b1ffcc356b5432d27ed4457b417fe22be70514dce1ed09dd5981c0707 |
|
MD5 | f6f2149fdb2322de916a02c8c3083b9b |
|
BLAKE2b-256 | 414ec4eff93700deb8d9f0b73c80260ee5fbac24010915f1ab8ca5698c98736a |