Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PyPI Documentation Status PyPI - Python Version

SuperCollider library for Python

This project is a port of core features of SuperCollider's language to Python 3. It is intended to be the same library in a different language and to keep sclang elegance in a pythonic way (if possible).

The main reason for this port is Python's capacity of interaction with other libraries applicable to composition, sonic-art and research. My wish is for this project to be useful for the SuperCollider community.

Note that this project is still under development and there are missing parts, bugs you are welcome to report, and documentation is under construction. The best way to learn about SuperCollider is going to the source.

Examples

The idea is that you can write the same in Python as in sclang, with the same logic regarding multichannel expansion, arguments conversion to Control ugens, etc., it should be the same result. For example:

from sc3.all import *

s.boot()

@synthdef
def sine(freq=440, amp=0.1, gate=1):
    sig = SinOsc(freq) * amp
    env = EnvGen(Env.adsr(), gate, done_action=2)
    Out(0, (sig * env).dup())

sine.dump_ugens()

Wait for boot...

n = Synth('sine')
n.set('amp', 0.05)
n.set('freq', 550)
s.dump_tree(True)
n.release()
# s.free_nodes()  # If something went wrong free all nodes.
s.quit()  # Stop server at the end of interactive session or just quit ipython.

More examples can be found as python notebooks in the following repo:

https://github.com/pabloriera/SC3_notebooks

Install

Depending on your operating system you may need to use python3 and pip3 commands instead of python and pip.

From source using pip (recomended by now):

pip install git+https://github.com/smrg-lm/sc3.git

Or with optional MIDI support:

pip install "sc3[midi] @ git+https://github.com/smrg-lm/sc3.git"

From source in develop mode (having a clone of this repo already):

python setup.py develop

For optional MIDI support also install mido and rtmidi backend:

pip install mido python-rtmidi

From PyPI (usually outdated by now, there will be a more stable beta version soon):

pip install sc3  # [midi] or [midi-nrt] for MIDI support, the nrt variant
                 # installs mido but not the driver.

License

The sc3 library is free software available under Version 3 of the GNU General Public License. See COPYING for details.

NB: The sc3 library is a Python translation of the SuperCollider's library and inherits its same license and community guidelines.

Metadata

Release files for sc3 1.1.3a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sc3 1.1.3a0
File Size Uploaded
sc3-1.1.3a0.tar.gz 224.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sc3 1.1.3a0
File Interpreter ABI Platform
sc3-1.1.3a0-py3-none-any.whl Python 3 none any Details

Total release size: 479.8 kB

Release files / sc3-1.1.3a0.tar.gz

Download URL sc3-1.1.3a0.tar.gz
Size 224.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0d8e7d55e1f4a288bda7c35bf590496733c9f2c055b5dc345813d5e9a7413e92
BLAKE2b-256 checksum
How to use checksums
f5019d512fa99c99975cede4127645dab23f371739d5ad7eb045a646eac0130e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / sc3-1.1.3a0-py3-none-any.whl

Download URL sc3-1.1.3a0-py3-none-any.whl
Size 255.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
862bd00c5263e83ef03678be5d2945e977e8de4228c68e5dfa301ace96157a21
BLAKE2b-256 checksum
How to use checksums
420c3c2af8f91d68e946304d440b3ab641ac2499b566cc871f89a1ce4c27325b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page