Skip to content

spectral-discord/SuperCollider-StreamerContainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SuperCollider Streamer Container

SCSC is a web-based audio live coding environment in a docker container.

Features:

Deploying

Hosting on the web

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?

 🥺
👉👈

docker compose

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

Environment variables

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)

Usage

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.

Start fresh

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.

Customization

By mounting the /config volume like in the docker compose example above, you can:

  • edit init.el and tmux.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

Issues

"I had sound before but now I don't"

Try refreshing the page. You might just need to reestablish the WebRTC connection.

"There's a little latency between running code and hearing the output"

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.

"My issues isn't listed here"

Open an issue and I'll try to help!

Services

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

Contributing

Know how to make SCSC better, or just wish it was in some way? Open a PR or issue!

TODO

  • 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

Remarks

This project builds on the caster-sound container from the Gencaster project. Big thanks to Vinzenz Aubry and Dennis Scheiba for their great work!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published