1.0.0 • Published 4 years ago

@supercollider/scapi v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

@supercollider/scapi

NPM downloads MIT License

Node to SuperCollider communication using OSC and the API quark.

This works together with the 'API' quark to implement a simple two-way communication protocol for node <-> SuperCollider.

It connects with an sclang process using UDP OSC and then sends OSC messages to '/API/call'

The SuperCollider quark is here: https://github.com/supercollider-quarks/API

And this package is the nodejs side.

Sent messages return a promise, the responses are received here from sclang and the promises are resolved (or rejected if there was an error).

This requires writing named handlers in SuperCollider and registering them with the API. From the node side, you make a call using that name and pass it some args and get back your response.

This was an older solution. Probably just using @supercollider/lang is easier now.

Note: this is not included in the supercolliderjs package.

Install

npm install @supercollider/scapi

Start SuperCollider Install the API quark ( > 2.0 )

Usage

Start SuperCollider and activate the OSC responders:

API.mountDuplexOSC

Documentation

Documentation

Compatibility

Works on Node 10+

Source code is written in TypeScript and is usable in JavaScript es2018 or TypeScript projects.

Contribute

License

MIT license