supersonic-scsynth-core
v0.96.0
Published
The WebAssembly synth and AudioWorklet of SuperSonic, a scsynth-compatible synth powered by Clockwork
Maintainers
Readme
supersonic-scsynth-core
The SuperSonic engine for the browser: SuperCollider's scsynth synthesis engine compiled to WebAssembly, running on the clockwork substrate inside an AudioWorklet. It takes OSC in, renders audio out, and answers the scsynth command set. The client that talks to it is supersonic-scsynth, which loads this package from wherever you tell it to: a CDN, or a path on your own server.
Contents
wasm/clockwork-scsynth.wasm- the enginewasm/clockwork_midi_bg.wasm,wasm/clockwork_gamepad_bg.wasm- the Web MIDI and gamepad modules, fetched only when the client turns them on (midi: true,gamepad: true)workers/clockwork_audio_worklet.js- the AudioWorklet processor that runs the engine on the audio threadindex.js- CDN URLs for this release of the package (CORE_CDN,WASM_CDN,WORKLET_CDN)
Usage
The client needs to be told where this package is, with coreBaseURL. From a CDN:
import { SuperSonic } from 'https://unpkg.com/supersonic-scsynth@latest/dist/supersonic.js';
const supersonic = new SuperSonic({
baseURL: 'https://unpkg.com/supersonic-scsynth@latest/dist/',
coreBaseURL: 'https://unpkg.com/supersonic-scsynth-core@latest/'
});Without coreBaseURL the client looks for the engine under baseURL, and the client package ships no wasm, so init() fails.
Self-Hosting
To host the core yourself, point coreBaseURL at your copy, alongside the client's own files:
import { SuperSonic } from 'supersonic-scsynth';
const supersonic = new SuperSonic({
workerBaseURL: '/path/to/supersonic-scsynth/dist/workers/',
coreBaseURL: '/path/to/supersonic-scsynth-core/'
});Installation
npm install supersonic-scsynth-coreThen serve the wasm/ directory and workers/clockwork_audio_worklet.js from your static file server.
License
AGPL-3.0-or-later. The synthesis code is GPL-3.0-or-later, forked from SuperCollider's scsynth by James McCartney and the SuperCollider community; it runs on clockwork (AGPL-3.0-or-later), and the combined work is AGPL.
Related Packages
supersonic-scsynth- the client API (AGPL-3.0-or-later)supersonic-scsynth-synthdefs- synth definitions (MIT)supersonic-scsynth-samples- audio samples (CC0)supersonic-scsynth-bundle- everything together
