How to install and configure Scala tuning software on modern Linux systems: Part 1

Post fully complete "how to" guides and tutorials here. This is a great place to get feedback on stuff you might put in the wiki.

Moderators: khz, MattKingUSA

Post Reply
oddy.o.lynx
Established Member
Posts: 63
Joined: Sat Jun 30, 2018 2:54 am
Has thanked: 5 times
Been thanked: 8 times

How to install and configure Scala tuning software on modern Linux systems: Part 1

Post by oddy.o.lynx »

To paraphrase from the Huygens-Fokker website…

“Scala is a powerful software tool for experimentation with musical tunings, such as just intonation scales, equal and historical temperaments, microtonal and macrotonal scales and non-Western scales. It supports scale creation, editing, comparison, analysis, storage, tuning of electronic instruments, MIDI file generation and tuning conversion all integrated into a single application with a wide variety of mathematical routines and scale creation methods. Scala is ideal for the exploration of tunings and becoming familiar with the concepts involved. In addition, a very large library of scales is available for Scala and can be used for analysis or music creation.”

source: https://www.huygens-fokker.org/scala/

The reason for this article as the title suggests is to provide the instructions to get Scala working on modern Linux systems. The current 64 bit Linux version of Scala uses libraries that are no longer available on more recent Linux distributions, so for people using a more recent flavour of Linux, Scala doesn’t work out of the box. However it can work with a few system tweaks and it can work quite well at that, but getting it to work is tricky if one isn’t aware of the steps involved.

This article will explain those steps; how to get Scala, how to set it up with the necessary system tweaks to get it working… and finally how to configure it for sound.

The system being used for this demonstration is Mint 20.2 with Cinammon as the desktop environment and Pipewire as its audio server. This can work on any Debian based system, however if Pipewire is not installed it will require PulseAudio. Part 1 deals solely with installation up to the point of getting Scala to load.

At the time of this tutorial, Scala is at version 2.46d and is available for download at the Huygens Fokker website. For 64 bit systems the file to download would be Scala 2.46d for 64-bit GNU/Linux on PC/Intel

The instructions on the website for download recommend to install aconnectgui and playmidi but they are very old school software and not needed. For this demonstration we will be using qjackctl and timidity as their replacement. It is also recommended to install libgnat-4.9 which cannot be done as there are dependency breaks. There is a workaround which we’ll get to in a bit.

The following software is required by Scala; to get them, from a terminal run the following command…

Code: Select all

sudo apt install gnat gnuplot qjackctl timidity timidity-daemon fluid-soundfont-gm
or install gnat gnuplot qjackctl timidity timidity-daemon fluid-soundfont-gm via any package manager

I’ve created a folder ~/opt for local software. When the file scala-22-pc-linux.tar.bz2 is unzipped in that location the full folder path will be ~/opt/scala-22-pc64-linux

If we open a terminal and navigate to the location

Code: Select all

cd ~/opt/scala-22-pc64-linux
and try to run Scala with

Code: Select all

./scala
from the command line, it produces the following: ./scala: error while loading shared libraries: libgtkada.so.2.24.4: cannot open shared object file: No such file or directory

Fortunately the unpacked archive contains the needed library libgtkada.so.2.24.4. The solution as spelled out in the INSTALL text file is to copy libgtkada.so.2.24.4 into the /usr/local/lib folder.

From the ~/opt/scala-22-pc64-linux location run the following command:

Code: Select all

sudo cp libgtkada.so.2.24.4 /usr/local/lib
After it’s copied:

Code: Select all

sudo ldconfig
Now running

Code: Select all

./scala
will return a new error: ./scala: error while loading shared libraries: libgnarl-4.9.so.1: cannot open shared object file: No such file or directory

The files needed to remedy this are available in the package libgnat-4.9_4.9.2–1_amd64.deb and is available for download here:

However trying to install this package as one would install a standard deb file will not work.

Image

The workaround solution is to extract the needed files and place them in /usr/local/lib and then tell the system where to look for the needed libraries.

Typically I work in the folder ~/src

From that location

Code: Select all

mkdir libgnat
cd libgnat
if you haven’t already downloaded the file we can download it using wget

Code: Select all

wget http://ftp.debian.org/debian/pool/main/g/gnat-4.9/libgnat-4.9_4.9.2-1_amd64.deb
Then these commands to unpack and prepare the folder structure:

Code: Select all

dpkg-deb -R libgnat-4.9_4.9.2–1_amd64.deb tmp
rm -R tmp/DEBIAN/
mkdir tmp/usr/lib/libgnat4.9
mv tmp/usr/lib/x86_64-linux-gnu/* tmp/usr/lib/libgnat4.9
rm -R tmp/usr/lib/x86_64-linux-gnu/
move the files to /usr/local/lib by running…

Code: Select all

sudo cp -R tmp/usr/* /usr/local/
This will create the folder libgnat4.9 under /usr/local/lib/ with the two files libgnarl-4.9.so.1 and libgnat-4.9.so.1

It should look like this…

Image

The next step is to update the file /etc/ld.so.conf

I typically use nano to modify system files…

Code: Select all

sudo nano /etc/ld.so.conf
add the line /usr/local/lib/libgnat4.9 to /etc/ld.so.conf

The file will look something like this…

Image

Ctrl+S (to save) and then Ctrl+X (to exit)

After that run the command

Code: Select all

sudo ldconfig
and now Scala opens.

Image
Scala version 2.46d for 64 bit Linux

*It is also possible to extract the libgnat-4.9_4.9.2–1_amd64.deb package using an archive manager and place the files libgnarl-4.9.so.1 and libgnat-4.9.so.1 in /usr/local/lib/ directly as we did with libgtkada.so.2.24.4 and then running sudo ldconfig

This will achieve the same results without the need to update the file /etc/ld.so.conf
nicopal
Posts: 1
Joined: Tue May 17, 2022 2:39 pm
Location: France (south)

Re: How to install and configure Scala tuning software on modern Linux systems: Part 1

Post by nicopal »

Hi, thanks for your valuable instructions.
In my case I couldn' get any sound out of scala, therefore I modified slightly your recommendations in order for it to work properly, may be because I have no midi hardware.

Other Instructions for installation of scala on (recent) linux :
I customised these instruction because I had no sound comming out of Scala... And these instructions are inspired (except timidity and Qjack recommendations) from message above (which is itself an update of original installation instructions from scala author on his website).

I repeat here the above message and summarise it a bit :
• download scala from  https://www.huygens-fokker.org/scala/  . For 64 bit systems the file to download would be Scala 2.46d for 64-bit GNU/Linux on PC/Intel here : http://www.huygens-fokker.org/software/ ... ux.tar.bz2
• The following software is required by Scala ; to get them, from a terminal run the following command(or from any package manager) : sudo apt install gnat gnuplot fluid-soundfont-gm
• then create a folder for local software SCALA. When the file scala-22-pc-linux.tar.bz2 is unzipped in that location the full folder path will be    /your_directory_location/scala-22-pc64-linux
you can try to run Scala with (but it probably won't work) by typing in terminal:
/your_directory_location/scala-22-pc64-linux/scala
then do the following to install the missing libraries (the unpacked archive contains the needed library libgtkada.so.2.24.4. The solution as spelled out in the INSTALL text file is to copy libgtkada.so.2.24.4 into the /usr/local/lib folder)
• From the /your_directory_location/scala-22-pc64-linux location run the following command in terminal: sudo cp libgtkada.so.2.24.4 /usr/local/lib sudo ldconfig
• And also it is possible to extract the  libgnat-4.9_4.9.2–1_amd64.deb    package ( https://www.ubuntuupdates.org/package/c ... ibgnat-4.9 )  using an archive manager and place the files libgnarl-4.9.so.1    and    libgnat-4.9.so.1 directly in directory /usr/local/lib/ (as we did with libgtkada.so.2.24.4 ) (or perhaps more simple, copy them directly into your    scala-22-pc64-linux   directory)
• then as before run sudo ldconfig into terminal : sudo ldconfig

This should allow the software scala to lauch properly.

Note from original message : if buttons not visible or active, do not use gnome, but preferably XFCE  (at some point there was a bug related to gnome...)

to go directly to software directory and launch scala :

type into terminal:
cd /your_directory_location/scala-22-pc64-linux/           
./scala        

or directly and more simple type into terminal:
/your_directory_location/scala-22-pc64-linux/scala

and if sound is not comming out, mentioning factice sound output, use the specific instructions herebelow for scala sound connection.
Hope this is fine for you too.
--
possible reasons why sound is not comming out (seen on the forums, can't remember which one) :
timidity bug :
Conditions for this bug to appear are:
  * timidity-daemon is installed
  * timidity service (from the timidity-daemon package) is enabled or
    timidity gets started by hand
  * No midi device is provided by the kernel
plenty or solutions ar proposed on the forums, I didn't try them all but from those I tried none easily worked... so I give information on what worked finaly for me on the specific instructions above for scala sound connection.


---------------------

Further informations if sound doesn't work
In case NO midi hardware is present and sound is not playing from scala, here is what worked for me :
(thankfully inspired from https://en.xen.wiki/w/How_to_get_sound_ ... _in_Ubuntu but slightly different)
before starting to launch scala:
• timidity should NOT be present at all on the system (see bug details in connection with Qjack at the end below)
• playmidi should be installed (doesn't need to be started)
• Qjack must NOT be started (and not launched at all is good too)

now be very carrefull of the ORDER of starting the devices :
1. first, lanch virtual midi device midi virmidi by typing in terminal : sudo modprobe snd-virmidi
2. then launch  YOSHIMI   (install it if not present) (yoshimi is a synth which has a role of midi player) (and we can play yoshimi keyboard if we want)
3. then launch scala by typing in terminal : /your_directory_location/scala-22-pc64-linux/scala
(midi connections are done automatically and can can be seen on aconnectgui or on Qjack (qjack NOT STARTED, only looking at the graph of connections. and if qjack is started,  scala doesnt play sounds anymore !!!!, idem if yoshimi is stopped)
----------------------------------------------------
Details of scala options to get sound
here are the details of scala options which work fine for me (to be chosen simply while scala is running, if you don't see the buttons, see install note below regarding gnome) :
scala user options:
• SYNTH midi player program :   playmidi -e
• MIDI midi file player program (PLAY)     « set to scala » midi player :                 scala
• MIDI SOUND SETTINGS midi output device :  dev/snd/midiC1D0   (Pick the one with a 0 in the name)

and that's it... :D
may be all this is not necessary, or there are better solutions, but this worked for me.

detail of my configuration :
debian 11 (very close to ubuntu)
  with gcc 4:10.2.1-1  and gcc 10 and gcc 9 all installed by default on my system
  with playmidi
 
note 1 : I still have problem with the plots which scala can not perform  (probably because i have only gnuplot 5.4.1)
Last edited by nicopal on Tue May 17, 2022 3:20 pm, edited 1 time in total.
Beginner in linux music, liking original scales and beautiful harmonies, and motivated...
Post Reply