- The host OS is Linux
- You're running
jack_dbus, it is correctly configured and working. - We're going to run Jack with a
periodof 4096 and anperiodof 4 to make things as easy as possible. - You've got Docker setup correctly and are able to run
docker run hello-world
For reference I'm running Arch Linux.
build: build the Docker imagenorns/supercollider.run: run the image, leaves you at ansclangterminal,Ctrl-Dto exitsclangand the container.run-bash: runs the image, but doesn't startsclang, instead leaves you at abashprompt.shell: gives you abashprompt on an already running instance (e.g. either frommake runormake run-bash).jack-restart: restartsjackvia DBus, setsperiodto 4096 andnperiodto 4, then loads thenetmanagerplugin.jack-connect: attempts to connect the Jack outputs from the container tosystem:playback_*
-
Clone this Gist, and
cdto it. -
Copy
jackdrc_sampletojackdrcand changeXX.XX.XX.XXto your computer's primary IP address. -
Open 2 terminals.
-
In the first terminal, run:
make build make runThis should leave you at an
sclangprompt. (TypeCtrl-Dif you need to exitsclang, that will also exit the Docker container.) -
In the second terminal, either run:
make jack-restartOr if restarting your Jack daemon is more complex, do it manually and then run:
jack_load netmanager -
Back in the first (
sclang) terminal we need to bootscsynthby running:s.boot;Watch the output messages, it can be somewhat tricky figuring out if it hasn't succeeded.
(You may need to press
enterto get thesc3>prompt back.) -
In the second terminal run
jack_lsb, hopefully you'll see 4 extra entries with names starting withnorns:. To connect these to your speakers run:make jack-connectNow if you run
jack_lsp -cyou should hopefully see the connection.Alternatively you could use
catiato make the connections in a GUI. -
Finally, it's time generate some audio from SuperCollider, in the first (
sclang) terminal:{ SinOsc.ar(440)!2 }.play;then to stop (all) sound:
s.freeAll;Fingers crossed it worked and there were no audio glitches.
Try some of the sc140 compositions (be-warned some of them are deliberately glitchy). After pasting one into the sclang command line you'll need to type s.freeAll; to stop audio.
No 11 works well:
play{VarSaw.ar((Hasher.ar(Latch.ar(SinOsc.ar((1..4)!2),Impulse.ar([5/2,5])))*300+300).round(60),0,LFNoise2.ar(2,1/3,1/2))/5}//#supercollider
I have had constant XRUNs from Jack causing audio glitches just with a SinOsc playing, but at other times no XRUNs at all. I think that the "network latency" value (set with -l in the jackdrc file) and the period and nperiod values set in the Makefile affect this. Sometimes it works perfectly, sometimes not!
For OS X / Windows users, when running with Docker for Mac / Windows there will be issues getting a network connection from the container to the host (due to the intermediate VM that is used). It's possible that the gateway.docker.internal network address may be part of the solution to that issue.