SCSC is a web-based audio live coding environment in a docker container.
Features:
- A SuperCollider instance, with sc3-plugins and Tidal Cycles
- Emacs, with SuperCollider and Tidal modes
- A web-based terminal (ttyd)
- SuperCollider's audio output is streamed to your browser via low-latency WebRTC
Don't. You'll be giving a shell to whoever finds it. Access it through a secure, private VPN if you must.
plz thx ok?
🥺
👉👈
scsc:
image: hobgoblina/scsc:latest
container_name: scsc
ports:
- 1312:1312
environment:
- MODE=both
- TTYD_BG_COLOR=1e1e2e
volumes:
- /some/path/on/your/machine:/config # optional
restart: unless-stopped
Variable | Description | Valid values | Default |
---|---|---|---|
MODE | For choosing which mode to enter on starting a new session | sclang , tidal , both |
both |
TTYD_BG_COLOR | Sets the ttyd background color (the border around the emacs session) | A 6-digit, hexadecimal color code | 1e1e2e (to match the default Catpuccin Mocha theme) |
Visit localhost:1312
The first time you visit the page, some Emacs dependencies will install. Be patient, it won't take long.
Windmove keybindings are activated by default, so you can use Shift + arrow keys to navigate between windows.
Exiting emacs via C-x C-c
will kill the stream/synth/etc and end your ttyd session. It should immediately reconnect, and you'll have a fresh new session to play with.
By mounting the /config
volume like in the docker compose
example above, you can:
- edit
init.el
andtmux.conf
to get a more preferred terminal experience - put SuperCollider dependency files in the
sclang-includes
directory (they'll get loaded when you start a fresh session) - edit the webpage and nginx configs in the
web
directory - edit the scripts that get run when you start or exit an emacs session
- edit the SuperCollider startup file that gets run when you start an emacs session
Try refreshing the page. You might just need to reestablish the WebRTC connection.
See how it says Couldn't set realtime scheduling priority 1: Operation not permitted
in the post window? I haven't worked that out yet. Also, the stream currently uses a large buffer size to prevent skipping, due to the container's limited resources. I'll optimize it at some point.
Open an issue and I'll try to help!
Service | Comment |
---|---|
Supervisor | As we need multiple services in this container we use this for service management - something like systemd |
SuperCollider | Audio engine |
PipeWire | Acts as a virtual soundcard |
GStreamer | Swiss army knife for converting media - converts the SuperCollider output to an Opus RTP stream which is sent to Janus |
Janus | WebRTC server for streaming audio to your browser |
ttyd | A terminal in the browser |
nginx | Web server and reverse proxy for hosting the webpage |
For delivering audio to your browser, the services are chained like this:
SuperCollider --> Pipewire --> GStreamer --> Janus --> nginx --> your browser
Know how to make SCSC better, or just wish it was in some way? Open a PR or issue!
- optimizations + realtime priority
- add Vim support
- allow users to choose between Vim & Emacs via env variable
- update Alpine version
- streaming static compositions, with code displayed in plaintext
- streams defined via config file & generated on container startup
- audio & data inputs via WebRTC
- add WebRTC video streaming of the ttyd session, for streaming live coding performances over the net
- getViewportMedia would be sick... Chrome supports some stopgaps
This project builds on the caster-sound container from the Gencaster project. Big thanks to Vinzenz Aubry and Dennis Scheiba for their great work!