Coder Social home page Coder Social logo

migush / supriya Goto Github PK

View Code? Open in Web Editor NEW

This project forked from supriya-project/supriya

0.0 0.0 0.0 48.28 MB

A Python API for SuperCollider

Home Page: http://josiahwolfoberholtzer.com/supriya/

License: MIT License

Python 99.81% Makefile 0.10% HTML 0.04% Shell 0.05% SuperCollider 0.01%

supriya's Introduction

supriya 0.1

Supriya is a Python interface to SuperCollider.

Supriya lets you:

  • boot and communicate with SuperCollider's scsynth synthesis server
  • construct and compile SynthDef unit generator graphs in native Python code
  • build and control graphs of synthesizers and synthesizer groups
  • object-model scysnth OSC communications explicitly via Request and Response classes
  • compile non-realtime synthesis scores via Supriya's nonrealtime.Session class

Note

This project is still under heavy development, is not yet stable, and is not yet intended for deployment in the field.

Send compliments or complaints to [email protected], or register an issue at https://github.com/josiah-wolf-oberholtzer/supriya/issues.

Supriya is compatible with Python 3.6+ only.

image

GitHub | PyPI | Documentation | Issue Tracker | Mailing list |

Quickstart

1. Get Supriya and SuperCollider

Get Supriya from GitHub:

~$ git clone https://github.com/josiah-wolf-oberholtzer/supriya.git
~$ cd supriya
supriya$ pip install -e .

Get SuperCollider from http://supercollider.github.io/.

Run the tests to make sure everything's OK:

supriya$ pytest

Consult our installation instructions for detailed help on getting Supriya, setting it up, and installing any additional dependencies like Graphviz.

2. Make some noise

Start your Python interpreter and import Supriya:

>>> import supriya

Boot the SuperCollider server:

>>> server = supriya.Server.default()
>>> server.boot()
<Server: udp://127.0.0.1:57751, 8i8o>

Create and allocate a group:

>>> group = supriya.realtime.Group().allocate()

Make a synthesizer definition and send it to the server:

>>> builder = supriya.synthdefs.SynthDefBuilder(
...     amplitude=1.0,
...     frequency=440.0,
...     gate=1.0,
...     )
>>> with builder:
...     source = supriya.ugens.SinOsc.ar(
...         frequency=builder['frequency'],
...         )
...     envelope = supriya.ugens.EnvGen.kr(
...         done_action=supriya.DoneAction.FREE_SYNTH,
...         envelope=supriya.synthdefs.Envelope.asr(),
...         gate=builder['gate'],
...         )
...     source = source * builder['amplitude']
...     source = source * envelope
...     out = supriya.ugens.Out.ar(
...         bus=0,
...         source=source,
...         )
...
>>> synthdef = builder.build().allocate()

Synchronize with the server:

>>> server.sync()
<Server: udp://127.0.0.1:57751, 8i8o>

Create a synthesizer with the previously defined synthesizer definition:

>>> synth = supriya.Synth(synthdef)
>>> synth
<Synth: ???>

Allocate it on the server as a child of the previously created group:

>>> group.append(synth)
>>> synth
<Synth: 1001>

Query the server's node tree:

>>> response = server.query_remote_nodes(include_controls=True)
>>> print(response)
NODE TREE 0 group
    1 group
        1000 group
            1001 f1c3ea5063065be20688f82b415c1108
                amplitude: 0.0, frequency: 440.0

Release the synth:

>>> synth.release()

Quit the server:

>>> server.quit()
<Server: offline>

supriya's People

Contributors

josiah-wolf-oberholtzer avatar kureta avatar marksweiss avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.