- The host OS is Linux
- You're running
jack_dbus
, it is correctly configured and working. - We're going to run Jack with a
period
of 4096 and anperiod
of 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 ansclang
terminal,Ctrl-D
to exitsclang
and the container.run-bash
: runs the image, but doesn't startsclang
, instead leaves you at abash
prompt.shell
: gives you abash
prompt on an already running instance (e.g. either frommake run
ormake run-bash
).jack-restart
: restartsjack
via DBus, setsperiod
to 4096 andnperiod
to 4, then loads thenetmanager
plugin.jack-connect
: attempts to connect the Jack outputs from the container tosystem:playback_*
-
Clone this Gist, and
cd
to it. -
Copy
jackdrc_sample
tojackdrc
and changeXX.XX.XX.XX
to your computer's primary IP address. -
Open 2 terminals.
-
In the first terminal, run:
make build make run
This should leave you at an
sclang
prompt. (TypeCtrl-D
if you need to exitsclang
, that will also exit the Docker container.) -
In the second terminal, either run:
make jack-restart
Or 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 bootscsynth
by running:s.boot;
Watch the output messages, it can be somewhat tricky figuring out if it hasn't succeeded.
(You may need to press
enter
to 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-connect
Now if you run
jack_lsp -c
you should hopefully see the connection.Alternatively you could use
catia
to 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.