everything you always wanted to know about linuxsampler

The tricky bits — installation and setup

If you’ve ever searched for LinuxSampler in your distribution’s package list, you’ve probably hit your first snag — it’s nowhere to be found. LinuxSampler has a slightly odd licence that runs afoul of the package policies of most major distributions.

There are some packages available — Autostatic’s PPA includes packages for Ubuntu Lucid, for example — but I just build it myself from source. At a minimum, you need to install build the “libgig” and “linuxsampler” tarballs from the LinuxSampler download page. If you want to test the SFZ support, the download page has instructions for grabbing the development versions of “libgig” and “linuxsampler” from Subversion.

Once it’s installed, you can run LinuxSampler from the command line:

linuxsampler

You should soon see a “LinuxSampler initialization completed.” message, and then not much else. This LinuxSampler backend handles all of the hard work — accepting MIDI input, loading samples, and producing audio output — but it needs to be told what to do. The best tool for that is the official LinuxSampler GUI, called Fantasia; you can download it from the LinuxSampler download page. It’s a Java app, and it’s distributed as a JAR file. Assuming you have Java installed, you can run it like this:

java -jar Fantasia-0.9.jar

Setting up an instrument

LinuxSampler before configuration

Fantasia, the official LinuxSampler GUI


The Fantasia GUI is large, but for now you can focus on two sections: the right-hand panel, where you create MIDI inputs and audio outputs, and the centre panel, where you load your instruments. Follow these steps to set up a working instrument:

  1. In the right panel, click the little power button within the “MIDI Devices” section. In the settings panel that appears, select your preferred MIDI driver (ALSA or JACK) from the drop-down list, and then hit “Create”:
  2. In much the same way, click the power button within the “Audio Devices” section, select your preferred audio driver (ALSA or JACK), and hit “Create”.
  3. Click the power button within the middle section to create a new instrument slot:
  4. If you’re planning to use an SFZ file, click on the “GIG engine” text within the instrument slot, and select “SFZ engine”
  5. Click “Load Instrument…” to open the instrument selection dialog. To load an instrument from a file, click on the lower “Browse” button, in the “Select instrument from file” section, and select your instrument file
  6. For .gig files, one file can contain multiple variations on the one instrument — these appear in the “Instrument Index” drop-down box, so you can click in there and change the default selection if required
  7. Click “OK” to close the dialog and load the instrument
  8. LinuxSampler ready to go

    Setup complete! LinuxSampler is ready to roll

    Loading a large instrument may take 10-20 seconds, as LinuxSampler caches some of the sample data. Once it’s loaded, parts of the keyboard within the GUI will turn white — these are the notes within the instrument’s range. At this point, you’re ready to play! Connect LinuxSampler’s audio outputs to your sound hardware (assuming you’re using JACK), and then either click on the on-screen keyboard, or connect a MIDI keyboard and hit some keys on that.

    Repeating those setup steps each time you wanted to use LinuxSampler would get old very quickly, but thankfully there’s a way to save and restore all of your settings.

4 thoughts on “everything you always wanted to know about linuxsampler

  1. Pingback: the salamander drumkit is out! | woo, tangent

Leave a Reply

Your email address will not be published. Required fields are marked *