Install sonic pi 3.2 dev on ubuntu 18.04 LTS

Bonjour, bonjour !

just an adaptation of this script

git clone
cd sonic-pi/

get the following script

place into ~/sonic-pi/app/gui/qt$

chmod +x build-ubuntu-18-04
sudo ./build-ubuntu-18-04
~/sonic-pi/app/gui/qt$ ./sonic-pi

Hope it works for you !


Hi. I’ve had some success with this but have no sound.
I’m on a fresh xubuntu 18.04 LTS virtual machine. Sonic-pi seems fine, but there’s no sound. Would you have any pointers to try?
I removed pulseaudio. No change but I don’t need it. Sonic-pi is the only thing I’ll use this vm for.
Tried looking at settings in jack through qjackctl… I’m lost.
Tried a sample in supercollider. Again, no sound.

Hi @DavidMc,

as an introduction to how Jack/qjackctrl can be configured, I find this introduction useful.

Before that you should make sure that you can play and hear any sound at all. Can you? Then forget about the rest of this posting and try to set up Jack. You can use Audacious to check (in case there are still or other problems with Sonic Pi).

If no sound at all: You might start with speaker-test and aplay (something like aplay -D front foo.wav at the command line).

You definitely don’t have to remove pulse-audio to use Jack; it might even be better to have it until your sound works. It will be suspended once you start Jack (I might be able to give some advice at this point allthough I am not an expert).

I hope that does help a bit.

1 Like

Thanks, that did help. It led me down a path that at least got SP 2.10 working on my real machine. :slight_smile:

For Kubuntu 18.04 LTS :
sudo apt install sonic-pi sonic-pi-server-doc supercollider pulseaudio-module-jack
In qjackctl: Setup > Options: “Execute script after Startup:” pacmd set-default-sink jack_out

To run sonic-pi:
In qjackctl: Press Start
sonic-pi &

There’s probably a way to start jack directly but this works.
If I get brave, maybe I’ll have another shot at compiling SP3. Meanwhile it looks like 2.10 for me.


@DavidMc: You might have already tried this, but maybe not: I don’t start Jack via qjackctrl; this did not work for me a while ago (never found out why) and so I created a - very simple - script called jack-internal, which I run. (Additionally I have an external audio device which, if pluged in, I trigger with another audio start script.)

It looks something like that for my internal soundcard:

#! /bin/bash
pulseaudio --kill &
jackd -d alsa --device hw:0 --rate 44100 --period 1024 & # internal soundcard
sleep 3
qjackctl --start &

This is called by another script e. g. audio-internal-sonicpi, which I adjust according to what I need. E. g.:

#! /bin/bash
pulseaudio --kill &
jack-internal &
sleep 1
a2jmidi_bridge &
sleep 1
sonicpi &
# start some softsynth or other things ...

Accordingly I do also have a stop script audio.stop to restart pulse-audio and quit Sonic Pi and other things:

#! /bin/bash
killall -9 sonicpi sonic-pi m2o o2m beam.smp ruby &
killall -9 qjackctl &
killall -9 carla &
#killall -9 helm &
sleep 3

This can surely be done much more elegantly and more profoundly but so far it is a working and practical solution.

Thanks for posting that. It is really helpful, and I think I almost have my DIY build sonic-pi ready to build. However I don’t want to use the script, as I already have supercollider and sc3-plugins installed (from TidalCycles usage) and erlang etc etc BUT I would like to build the rest of sonic-pi and have a play with it.

I’m having a really hard time figuring out your paths in the script. For example {OSMID_DIR}. Where should that be? If I have the sonic-pi source checked out at ~/my_dev_stuff/sonic-pi, then OSMID_DIR is where, please? Answering that should answer the same question I have about the erlang code.


Hi @russelldb

Well i’m not the author of that script i have just changed some lines and sadly i do not master at all all the stuff. so i can not help.
All i know is that i use this script from the github repo last week, and it works.
I guess there will be soon a lot of changes in the way of building the app with the next version if i believe the intense activity on github.

Thanks for replying. I figured it out. Although I think in future I’d be better just to install my Tidal stuff in /opt and use the apt package for sonic-pi. Simpler!

I have this error

In file included from mainwindow.cpp:50:0:
visualizer/scope.h:25:10: fatal error: kiss_fft/kiss_fft.h: No such file or directory
 #include "kiss_fft/kiss_fft.h"

in the last step in the build script. But I didn’t run the whole script, I ran all the bits except building supercollider+sc3-plugins, as I have those already

There is a kiss_fft.h in sonic-pi/app/gui/qt/external/kiss_fft/

The latest installation for linux now uses cmake scripts. Still under development, but it works OK on my Pi4 under Raspbian Buster.
The cmake scripts includes the new kiss_fft/kiss_fft stuff which is used for the new scope spectrum trace
Have a look at the and scripts. At present MacOS is handled a little differently. On Raspbian I had also to build and install osmid binaries to app/server/native/osmid, to build the two erlang beam files from osc.elr and pi_server.erl using erlc, to add a soft link to ruby in /app/server/native/ruby/bin and to gem install aubio. Otherwise these two scripts prepared the whole build which was executed in the build folder they set up with cmake --build . --config All

You will notice that Sam Aaron has now moved many of other build scripts in Sonic Pi to an archive folder. The intention is to produce a unified scheme using cmake to build either for Windows Mac or Linux.

Things are still evolving and change fairly frequently, but looking along these lines above should get you on the way.

Thanks for that. It certainly built some stuff before errorring out this time. Which feels like progress. I’ll keep chipping away at it.

Ah, OK, so I osmid in app/gui/qt/external/, moved it to app/server/native/ as you wrote (and I skipped over!) and it has built and is working. That’s great! Thanks for the help

Hi @robin.newman

Would you give us some tips to use this new method ? Which files to we have to use to build under Linux…

is that all to do ?

A bit more than that. I’ll try and put some more details together for you. Things are still a bit fluid and changing at present.
I haven’t forgotten, but there are quite a few changes taking place at present, and I prefer to wait until the dust has settled. For example I have just added a PR to allow RPi to utilise the latest scope change, as I was getting compile errors.

1 Like

@robin.newman don’t worry i know you haven’t forgotten. Good luck !

Basically you have to make sure you have all the supporting packages loaded via apt-get, build osmid as before, and install the binaries m2o and o2m to native/osmid, have erlang installed (I used erlang-base on the Pi) and build the osc.erl and pi_server.erl files to their equivalent beam files in the erlang folder. As far as scsynth and the plugins go these were picked up automatically by installing supercollider-server and sc3-plugins.
for the rest, create a short cut to the ruby binary in server/native/ruby/bin
I used (from the qt folder):

 ln -s `which ruby` ../../server/native/ruby/bin

to do this.


#now for some stuff using cmake
#I think I had to `gem install aubio` first on RPi too

./ #builds the documentation

./ #sets up the build folder

cd build
cmake --build .

when this has finished you should have the new sonic-pi binary in the newly created build folder
You can run it from there, or from <SONIC-PI_SRC>/bin/sonic-pi

You may have problems with the prebuild script. It deletes an existing ruby-aubio-prerelease gem from the vendor folder. (subsequent runs will show an error which you ignore. However I found I needed the gem aubio install (It was version 0.3.3). You also need as part of the initial packages installed libaubio5 (on debian)

NB at time of writing the latest commit to Sonic Pi is #3e587fc. There is a bug in the earlier commit Merge pull request #2234 from cmaughan/feature/threaded_analyzer
I have submitted a PR Update scope.h syntax #2237 to cure this, but you will have to carry out the changes yourself manually if you build right now.

Hope these rough notes are helpful.

1 Like

do you mean that all your first paragraph operations are done by the ./ and so on ?

to get to the commit mentionned by Robin

nlb@devbox:~/audio/testRepo/sonic-pi$ git reset --hard 3e587fc
HEAD is now at 3e587fc5f Translated using Weblate (Polish)

from the qt folder, the path seems to be

ln -s `which ruby` ../../server/ruby/bin/

Well too hard for me. don’t lose time to try explaining… I will wait.

OK. Are you building on a Pi4 or on ubuntu 18.04 LTS? If the latter, I tried this on a virtual machine today, and there are a significant number of problems there, particularly with rugged and aubio, which I haven’t solved. I think a later ubuntu version may be OK, and hope to try that.
If you are building on a Pi then it builds OK. Yes the prebuild does all the documentation stuff, and the config script builds the gui, so things are much simpler.

ah sorry as the subject is “on ubuntu 18.04” i was thinking it waf for ubuntu. so yes i try under 18.04.04. I will try tomorrow under pi buster.