Build LinuxSampler—Beginner’s guide
- 7 minutes read - 1318 words[Updated 12 July 2014]
LinuxSampler is one of the best samplers available for Linux, yet the installation process requires a high level of technical expertise. I took several months to work successfully through the official instructions. Below is an attempt to simplify the process for others. If you are a musician on Ubuntu or Ubuntu Studio and want a decent sampler, these instructions should get you there.
My instructions differ from the official instructions by observing the following rules:
- The instructions are strictly sequential.
- The instructions explain any technical terms that are beyond the vocabulary of a typical computer user.
- The instructions are current. They refer to the latest versions of Ubuntu and the latest code for LinuxSampler
The instructions may be lengthy, but hopefully they are clear. If you get stuck, post a question in the LinuxSampler forums or contact me.
Obtain source code
Source code is a set of files created by computer programmers. The files tell the computer exactly how LinuxSampler should look and behave. The first step in your journey is to obtain the latest source code for LinuxSampler.
At the time of this writing the “latest official releases” from July 2009 are out-of-date and not recommended. However you can obtain the very latest source code using software called Subversion.
- Start the application called “Terminal Emulator”.
(If you have never used the Terminal before you might find Using the Terminal—Basic Guide helpful.) - To install Subversion type the following (then press the Enter key):
sudo apt-get install subversion
(Subversion is a tool used by software developers to access the very latest source code for a given software project.) - Type your password when prompted and type
Y
when asked to confirm the installation. - Create a folder called “lssvn”, by typing the following command:
mkdir lssvn
(The special commandmkdir
stands for “Make Directory”. Technically you can call your directory/folder almost anything, except it cannot contain spaces or use the name “linuxsampler”.) - Open the folder you just created by typing the following:
cd lssvn
(The special commandcd
stands for “Change Directory”.) - Copy and paste the following line into Terminal. (Note: Terminal does not let you used keyboard shortcuts to paste. Instead you can right-click on the window and choose Paste.)
svn co https://svn.linuxsampler.org/svn/libgig/trunk libgig
(This downloads the first section of source code you need and saves it to a folder called “libgig”.) - Copy and paste the following line into Terminal.
svn co https://svn.linuxsampler.org/svn/linuxsampler/trunk linuxsampler
(This downloads the second section of source code and saves it to a folder called “linuxsampler”. For now we only need two sections of the LinuxSampler source code, but the official site lists how to obtain all seven.)
Compile source code
Now that you have the source code, the next step is to convert this human-readable code into something that the machine can read and run. This process of converting into machine code is called compiling. It can take a while to convert, but the end result is a program that runs very fast.
Compile libgig
-
Copy and paste the following line into Terminal:
sudo apt-get install g++ debhelper pkg-config automake libtool fakeroot libsndfile1-dev doxygen uuid-dev lv2core lv2-dev
(This installs several software tools required to compile libgig and linuxsampler. The last two, lv2core and lv2-dev are required if you want to use LinuxSampler as a plugin within another program such as Ardour, Rosegarden, etc.) -
Open the libgig folder:
cd libgig
-
Copy and paste the following line:
dpkg-buildpackage -rfakeroot -b
(This starts the compilation process for libgig. It takes several minutes.) -
Go back to the lssvn folder.
cd ..
(The double dot (..
) means go to the folder directly above the current one.) -
If libgig compiled successfully you should see three “.deb” files in the lssvn folder.
ls
(The special commandls
stands for “List” and displays the files and folders in the current directory.) -
Install each of the three “.deb” files that you see listed in the previous step. Note: The exact filenames differ for 64-bit Linux and 32-bit Linux, and the version numbers may change with time. So replace the filenames listed below with the ones you saw listed in the previous step. (Start with libgig6 because the other packages depend on it).
sudo dpkg -i libgig63.3.0-6amd64.deb sudo dpkg -i gigtools3.3.0-6amd64.deb sudo dpkg -i libgig-dev3.3.0-6amd64.deb
Compile linuxsampler proper
-
Copy and paste the following line:
sudo apt-get install bison libjack-jackd2-dev flex
(Bison is an additional software tool required to compile linuxsampler. The libjack-jackd2-dev package installs files needed to support MIDI via JACK 2. If you want to use JACK 1 instead install libjack-dev. Flex is required to for the instrument script parser.) -
Open the linuxsampler folder.
cd linuxsampler
-
Copy and paste the following line:
dpkg-buildpackage -rfakeroot -b
(This starts the compilation process for linuxsampler. It takes longer to compile than libgig.) -
If you get an error “No rule to make target
parser.h', needed by
all’.” then type:
make parser
And repeat the previous step to restart the compilation process. -
Go back to the lssvn folder.
cd ..
-
If linuxsampler compiled successfully you should see three new “.deb” files in the lssvn folder.
ls
-
Install each of the three new “.deb” files that you see listed in the previous step. Note: As before, the exact filenames on your computer may differ from the ones listed below, but they should all contain the word “linuxsampler” and end with “.deb”. Just replace the filenames listed below with the ones you saw listed in the previous step.
sudo dpkg -i liblinuxsampler1.0.0-1amd64.deb sudo dpkg -i liblinuxsampler-dev1.0.0-1amd64.deb sudo dpkg -i linuxsampler1.0.0-1amd64.deb
Future updates
Now that you successfully compiled libgig and linuxsampler, you are ready to proceed to the next section, “Download and run Fantasia”. However the next time you want to update libgig or linuxsampler you can skip many of the steps listed above. All you need to do is use the cd
command to open the libgig folder, type svn update
to obtain the latest code, then proceed with step 3 listed in the instructions above. Do the same with the linuxsampler folder.
Download and run Fantasia
The code you have compiled so far is the backend of LinuxSampler. The backend is basically invisible to the user when running, but performs all the computational duties. The last part you need is the frontend which displays a window and gives you access to all the features of LinuxSampler. The frontend of LinuxSampler is called “Fantasia”. Unlike the backend, Fantasia doesn’t require any compilation. You just need to check you have Java installed, download Fantasia, and set it to run as a program.
- Copy and paste the following line into Terminal:
sudo apt-get install default-jre
- Download Fantasia:
http://downloads.sourceforge.net/jsampler/Fantasia-0.9.jar - Go back to the Terminal and open the Downloads folder:
cd ~/Downloads
(Linux is case-sensitive. Be sure to spell with an upper-case “D”.) - Since this file was downloaded from the Internet you need to manually give it permission to run as software.
chmod a+x Fantasia-0.9.jar
- Open the Downloads folder using your normal point-and-click File Manager (rather than Terminal).
- Right-click on Fantasia-0.9.jar and choose “Open With Other Application…”
- From the list of Recommended Applications select “OpenJDK Java 7 Runtime” (the exact name may vary, but should include the word “Java).
- Click “Open”.
Congratulations! After a few moments the Fantasia window should display and you are ready to use LinuxSampler.
If you have not used LinuxSampler before, set aside a few evenings to learn it. The OpenOctaveProject created a guide that is more complete than the official documentation. See https://github.com/ccherrett/oom/wiki/Linuxsampler_guide.pdf
Optimize LinuxSampler
You can optimize LinuxSampler to run even faster on your particular machine. The optimization process is beyond the scope of this simplified guide, but the official site has instructions (see LinuxSampler for Debian HOWTO). At the time of this writing the official instructions are a little disorganized. You need to read two sections all the way through, “3. Building the Backend” and “4. Benchmark”, before you can understand what to do.