Tools for working with the SuperCollider music synthesis language and synthesis server.
JavaScript SuperCollider
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin eslint Apr 18, 2016
declarations
docs
examples
src
.babelrc add flow for type checking and babel transforms to remove annotations Aug 17, 2016
.eslintrc
.flowconfig
.gitignore
.jscsrc docs Dec 3, 2015
.npmignore npmignore docs etc. Apr 19, 2016
.travis.yml
LICENSE update version to 0.9.0-alpha.1 Dec 2, 2015
README.md
esdoc.json
index.js export top level functions: dryadic() play() and h() Mar 29, 2016
package.json update dryadic Aug 19, 2016

README.md

supercollider.js

Build Status NPM downloads MIT License Dependency Status devDependency Status

Node.js tools for working with the SuperCollider language and synthesis server.

SuperCollider is an environment and programming language for real time audio synthesis and algorithmic composition. It provides an interpreted object-oriented language which functions as a network client to a state of the art, realtime sound synthesis server.

This library provides functionality for working with:

  • scsynth (the synthesis server)
  • sclang (supercollider language interpreter)

Documentation

http://supercolliderjs.readthedocs.org/en/latest/ https://doc.esdoc.org/github.com/crucialfelix/supercolliderjs/

Features

  • Start SuperCollider language interpreters (sclang)
  • Interpret SuperCollider code from node js and get results or errors returned as equivalent JavaScript types

  • Start SuperCollider synthesis servers (scsynth)

  • Send and receive OSC messages to scsynth
  • Call async commands on scsynth and receive results as Promises
  • Comprehensive library for calling all commands the server understands
  • Node-id/Bus/Buffer allocators with clean immutable state implementation
  • Server state and synth/group tracking

  • Dryadic: declarative DSL for managing component trees. Documentation coming in 0.11.0

Example

var sc = require('supercolliderjs');

sc.lang.boot()
  .then(function(sclang) {

    sclang.interpret('(1..8).pyramid')
      .then(function(result) {
        // result is a native javascript array
        console.log('= ' + result);
      }, function(error) {
        // syntax or runtime errors
        // are returned as javascript objects
        console.log(error);
      });

  });
var sc = require('supercolliderjs');

sc.server.boot()
  .then(function(server) {

    // raw send message
    server.send.msg(['/g_new', 1, 0, 0]);

    // using sc.msg to format them
    server.send.msg(sc.msg.groupNew(1));

    // call async messages with callAndResponse
    // and receive replies with a Promise
    server.callAndResponse(sc.msg.status())
      .then(function(reply) {
        console.log(reply);
      });

  });

Compatibility

Works on Node 4+

Source code is written in ES2015 and transpiled with babel.

Contribute

License

The project is licensed under the MIT license.