superkabel
v0.3.2
Published
a language to control supercollider's synth on the web.
Downloads
655
Maintainers
Readme
superkabel
a language to control supercollider's synth on the web.
super kabel is still EXPERIMENTAL, so tread carefully..
play with the superkabel repl on https://superkabel.salat.dev/
usage
here's how to run a superkabel patch in an html file:
<!doctype html>
<button id="playButton">play</button>
<button id="stopButton">stop</button>
<script type="module">
import {
registerLanguage,
runPatch,
stopPatch,
} from "https://unpkg.com/[email protected]/superkabel/src/index.js";
registerLanguage();
function patch() {
// sprinkler, ported from sc examples
LFPulse(0.09, 0, 0.16)
.mul(10)
.add(7)
.LFPulse(0, 0.25)
.mul(0.1)
.mul(WhiteNoise())
.BPZ2()
.out();
}
playButton.onclick = () => runPatch(patch);
stopButton.onclick = () => stopPatch();
</script>that's all you need! save this as index.html and in the same folder, run:
npx superkabel # open server with coop/coep headers..then open http://localhost:7070/ and you should hear the sprinkler patch when clicking play.
because superkabel uses shared memory, when serving an application that uses it, you need to have a cross-origin isolated document. that's what npx superkabel does for you for quick local testing.
superkabel server
run npx superkabel to run the superkabel repl on any machine that runs node.
to make sure it works offline, run npm i -g superkabel, then run superkabel.
the server will serve any files below the folder where you run it, so you can access files from disk. the server also serves the superkabel lib under /superkabel so it works without internet. you can bring your own index.html for a custom ui.
on npm
superkabel is available on npm:
npm i superkabelbuilding with vite
to make vite build behave, add this to your vite.config.js:
export default { worker: { format: "es" } };learn more
the development of superkabel started as a series of blog posts:
- scsynth wasm
- scsynth bytecode
- superkabel
- superkabel multichannel
- superkabel feedback
- superkabel ugens
- superkabel language-design
- superkabel reference
publishing to npm
npm pack --dry-run
npm version patch
npm login
npm publish
git push && git push --tags