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.1b0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d5a293a1f00bea9ab7935d94d60adb029f873ccbc7c0abb58a51a55dfceb0a7 |
|
MD5 | 6fec051c39920d02a94740e1384a316e |
|
BLAKE2b-256 | 7bcea3969b69720d2989f13b31064769131b86f2e0dc5fe54fe12576027276aa |
Hashes for supriya-24.1b0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30937cbc3da51c8eb2b17aabd3ecddad51ed6f5e4b10b363a9e51c934ee97f74 |
|
MD5 | ad54e28c41ffd8ca5dd2af5b995cacb9 |
|
BLAKE2b-256 | 1b673daa7d87697880eb90620aee42c10d6c23120aae98a3270458266d7fc70c |
Hashes for supriya-24.1b0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6381b8ce83fa39858c84f16156933a451f02998135feb3855bf6f022c585ace9 |
|
MD5 | a50695dbb0be54479badccd3370373ad |
|
BLAKE2b-256 | 8655dda27584f60434c9db2524ec183a2d81419c6957395d7d98e578d1022e5a |
Hashes for supriya-24.1b0-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bfcf1bf374b84ad0100767f36c6118a376cef44109059357cfb8f503f03051e |
|
MD5 | 46fc4019ace65f0a55c4a614e66616ca |
|
BLAKE2b-256 | 07e1f8981ccbd9f5162ac38df6deedde9827a3ffb1f92bdfa4fbad735ed3b1da |
Hashes for supriya-24.1b0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b19c0d0756a75c071a0f01f7ac575bfabd0c6888571dd2a5616ac5ca9946c3e |
|
MD5 | 70a2468aed4304b2f97212912b1ca0ba |
|
BLAKE2b-256 | 32791e55ae3bf5acebcc0e7ea3c3186443bcc611b1bb09193d6719723f1a11f0 |
Hashes for supriya-24.1b0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12cae455dfa198610fb8559d6944b399e117c05bd1c9c173714beb2b977b1c2f |
|
MD5 | 4a60ccae21d2d5f687164069ae833c6a |
|
BLAKE2b-256 | ae5d8451589fa976bf8b0d60389a1e3ea777ca8cbc852204d8419d6de0f8b3ba |
Hashes for supriya-24.1b0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d7d792682cc9d0feaa033f4f6676d1fd00fdb2e34d06a5d7e047fd50deb93fd |
|
MD5 | b3003ac90dfe54877ff1e1f79d1ababd |
|
BLAKE2b-256 | f7caab04966505b84fa2c6bc9b0404ad15dcbd0b9241a0906e2f5992d2d228e5 |
Hashes for supriya-24.1b0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f726d515693b5a30f99a45fa0091034b93190231466f02a05347c972ae0e2d9e |
|
MD5 | f964f0d9374600874176963cfa1e314e |
|
BLAKE2b-256 | 6f85856cf056fe2b4b8aa25d9338f625173b215defeea5ad3ad4fcd2e394e7a5 |
Hashes for supriya-24.1b0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4aa87890c7368f514d13cff0073f78b1e25a53e7967b71beb5a200ca9517cf7 |
|
MD5 | 4f4624d58f7cb93b1bb9a2aabab8e709 |
|
BLAKE2b-256 | dd2a9939cb854c29ad328f5b639ddeece1f119154da152849dcd1215e737b3e0 |
Hashes for supriya-24.1b0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d02e4fa3a31688a6b0c9dd62ded46b1868ddaefdaf62c2c25c5da9532b55bfa1 |
|
MD5 | 7041de8f6393555d7831ef9faa0f2025 |
|
BLAKE2b-256 | eb29eb7e3d68ca505360a351686197b57f82827c7bb0f45f865940f216bd9a1d |
Hashes for supriya-24.1b0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9fff86a39a12c43ea11b9c5112276dbab3e71d347b446fc3e59a9332991a856 |
|
MD5 | 7047c545b17099239e88276d44e0552e |
|
BLAKE2b-256 | d88004d66238450cb86442f2495935cae7cf45033ff6c1eb685c4337f0671443 |
Hashes for supriya-24.1b0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cc5fa2206ed970fac61b0eae901490f41005a6d5141a6552fb528c4af51db1c |
|
MD5 | b4ebff54a99806cfbc3055b17fff5fb7 |
|
BLAKE2b-256 | 88014f1e5d5253ae572b00409636f1ce3654b62395968dd53650dce573d90dab |
Hashes for supriya-24.1b0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8073589496c90f8dfd62d79ee819de7acead60baff18c053dcd3e2ddb455c533 |
|
MD5 | f9ee4318feda60233f5505c4d563b9d4 |
|
BLAKE2b-256 | 8f0855154efc30da383785f341b2db538da2a88dd6d263570a5fd15c0cf77bf7 |
Hashes for supriya-24.1b0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c213f41bd8a4e2ec58996df0900f91291e180f578ad3496f63f412776d1e044 |
|
MD5 | da0925da681287e0c70e712054bd9a4c |
|
BLAKE2b-256 | 1cfe6efebda1b318f864042c21b8cf39da653d11afe3860d584add702d497fa7 |
Hashes for supriya-24.1b0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 041217a8f09bc16dd9c397b6f8103472fe23df3ff091810b1707084124191b8b |
|
MD5 | 4528079ff0aa8ffcfb927198773f23a8 |
|
BLAKE2b-256 | 977ce5c7fbe46edfe5242192cd2583166423215c241f55d3777455118018808f |
Hashes for supriya-24.1b0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f369eb7e42a1d8dfac518bbd8ec95ae9b0aecb2ad14e3b4e3b61cd395af149d |
|
MD5 | a4ba934358188b55b6b2bfc3cb80bcbd |
|
BLAKE2b-256 | 893dc0cc0cac2336668ecf1a5e28010bb35d9e04a1b8f220d775e12681c368e3 |
Hashes for supriya-24.1b0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ee7fbcd8b3b308385d1b58612deac026786e0c5db2302bc2ac6e1bf587e4276 |
|
MD5 | eae6c894d3c1f2493112d7f645466429 |
|
BLAKE2b-256 | 2c57ba39aa8dba5cb81071a9f88d0713ee40ac5b2b657f546aec5d1e6b3e1da0 |
Hashes for supriya-24.1b0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6bbcf9fd7dd59444a7f4b93c7dedce61620a6acf1a67ac9029293260735e682 |
|
MD5 | b8bd4be257a1c19a8452604047eb32d8 |
|
BLAKE2b-256 | 810ae27256ba1a1b8f750042c8084df874ab2e2360a7cc51f3cf02c521a91f1c |
Hashes for supriya-24.1b0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26a8e42359c0ccf013003b6c8a56045d230795dae425e802c18bf5a225da4f70 |
|
MD5 | c1c91a7f267bd3d35b26087651e939de |
|
BLAKE2b-256 | 08157dace2fafe6cdc906f107fc28252f2ebceea01a2c243a3b42cc99fc0dfb0 |
Hashes for supriya-24.1b0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f4dc472347a3f494777ed77fee1bdc961d8b957b82f1a3d4698a8addee610ac |
|
MD5 | 6243d7347905a477ce02a2d32d7dc86c |
|
BLAKE2b-256 | 73e530d64dd82d394153177f77babfde8da38805ad74f85da195ab7fe7005d6c |
Hashes for supriya-24.1b0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63b781564c069454c6021cd6116b60795c1dd33e5c11396556819fc3502a9adb |
|
MD5 | 161cb993f5ca18384e63eaa378e761e1 |
|
BLAKE2b-256 | 11ccd1da6d1bb37da3498f7fd671088ec8d8bae02357bde06bc139f9004e92f1 |
Hashes for supriya-24.1b0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2251bb8fc6aba738ab5b59635183ccf27eb3dbbad111a9076138877a8c8eea6 |
|
MD5 | c6eb817e98f8507dada50468fd606933 |
|
BLAKE2b-256 | 5a60cb27f9704d8270342faa2b6def01eed825ee36f781ac9b84e3465192a20b |
Hashes for supriya-24.1b0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 937c940aa2f979a18b7b44a6b4ab3f7beb4bc8ca97da449c34d7d24ca2040b2e |
|
MD5 | fff16e9defcb99a8568f75a2e5bc8d57 |
|
BLAKE2b-256 | 5dd8b76d4be91c06fae271856745833485f8049c3ee0e62dff9b22decef76bbb |
Hashes for supriya-24.1b0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fc5e1f5048fa0a9db8077c8bbe2f5855fa9970068410b61199222acd34fc982 |
|
MD5 | a60bda2c39b6c6ca9bc19111d9e55bd6 |
|
BLAKE2b-256 | 73c48e12ab28c231cfab43ac87e1c142f83959c78bc5b17454819034f191f837 |
Hashes for supriya-24.1b0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f8efd6c447180c70a380ac909f98de6d57e6b367ca95d2dc64bf9bf83d6600d |
|
MD5 | eeb2be438fbb91e42449c6c7fbef8d5a |
|
BLAKE2b-256 | f7fe5a159d89fd06127436b96dcb5f9aa84b3335da9cf36a10be17ff7febdc8a |
Hashes for supriya-24.1b0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 300a6b4ebeee2f4ffd1fb535553e42eafa77e62688c8deb94364a2cf273410ef |
|
MD5 | 41ec55359b2c5105acfc89743dffcc9a |
|
BLAKE2b-256 | 28c3cb15c4ac5145bbe73cd4434648e4e764664d7201ed11b16f0c1e4901bc0a |
Hashes for supriya-24.1b0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53f3239c9279ab488212d758e13dd165885f1183b33faadbd1a779425096ccca |
|
MD5 | 2d3e4a3b5339cda84b02f4cf92f46a23 |
|
BLAKE2b-256 | ae36127701a45c37e04b749e9caac9c889c4160a2bbce8717c1e0b062b57cecd |
Hashes for supriya-24.1b0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2996d763848a12c68a896f2f232d0664567d35a09d9355a9c5c58bdb07eed5a6 |
|
MD5 | a7dd405e99d3a3a69f48304efeba6bfc |
|
BLAKE2b-256 | 998fdef16f73bfd9f1c95f502039c8bc8b22cb06825eb874e3ded541acdee742 |