everything you always wanted to know about linuxsampler

LinuxSampler is an odd beast — it can be tricky to install, and confusing to configure, but it’s undoubtedly the best tool for working with large sampled instruments under Linux. With its next release adding support for the increasingly popular SFZ format, and the fact that it’s one of the few LV2 synth plugins ready for use with Ardour 3, I think it’s about to get a lot more important.

Let’s not get too far ahead of ourselves, though. What exactly is LinuxSampler, what’s it useful for, and perhaps most importantly, how do we use it?

LinuxSampler GUI

LinuxSampler handles large sampled instruments with ease

LinuxSampler basics

LinuxSampler is a sample-based synth that lets you use very large sampled instruments. Rather than loading the entire instrument in to RAM, LinuxSampler loads just the start of each sample, and then reads the rest from disk as it’s needed. Because of this, it can load instruments much larger than your system would be able to handle with other software, such as Hydrogen or Fluidsynth/Qsynth.

Realistic piano sounds are perhaps the classic use for LinuxSampler — a good piano, like the Salamander Grand Piano, can reach 2GB or more in size — but it works just as well for electric pianos, guitars, violins, trumpets, drum kits (a personal favourite), or any other instrument that calls for large samples, or a lot of samples, to provide a realistic result.

LinuxSampler can be run standalone — it supports ALSA and JACK for both MIDI input and audio output, and can handle an arbitrary number of inputs and outputs mapped to different instruments. It can also run as a plugin; the LV2 plugin runs well under both Ardour 3 and Qtractor.

File formats

The inspiration for LinuxSampler was a Windows app called Gigasampler, which was the first sampler to incorporate on-demand streaming of sample data. It’s a standard feature in professional samplers today, and Gigasampler itself has been defunct for some time, but its legacy lives on in the “.gig” file format, which is also LinuxSampler’s primary file format.

You can still find some great commercial sample libraries in .gig format, but it’s definitely falling out of favour today. To address that, the development branch of LinuxSampler has added support for a new format called SFZ. It’s a young format, but it’s growing in popularity thanks to the availability of free SFZ plugins across all platforms. Also, because of its design (the SFZ file itself is a simple text file, separate from the actual sample data), you can download third-party SFZ mappings for some commercial instruments.

Even though .gig is fading away commercially, it’s still useful for bundling your own sounds. The LinuxSampler project includes a .gig editor called “gigedit”, which you can use to create your own instruments.

Hopefully you now have an idea of what LinuxSampler is and what it can do for you. Now all that remains is to learn how to install and configure it!

jconvolver, inserts, and sends: a triple-header tutorial

Earlier today, when I was setting up another quick impulse response recording that I made, it occured to me that some of this stuff is really non-obvious — setting up Jconvolver takes some work, and using sends to share a single reverb within Ardour instead of using a separate reverb on each track can be a bit of a leap, too. Here, then, is a three-part tutorial that covers:

  • Setting up Jconvolver
  • Connecting Jconvolver in to Ardour as an insert effect
  • Using sends effects within Ardour

There’s a lot to get through, so let’s get cracking!
Continue reading

converting MIDI to WAV (or MP3), the easy way

This is a question that comes up all the time: what’s the easiest way to convert a MIDI file in to an audio file, like an MP3, under Linux? The old answer was TiMidity++ (usually just called “timidity”), a software MIDI synth that’s nearly as old as Linux itself, but it’s awkward to use and isn’t actively maintained. Today, though, I discovered that FluidSynth can do the job, and very easily at that.

FluidSynth is a synth that plays SoundFonts; in the studio it’s usually used through the Qsynth GUI, or as a DSSI plugin in a sequencer like Qtractor, but you can also use it stand-alone, through the “fluidsynth” command-line tool. To use it, you’ll need at least one SoundFont, and there’s a good General MIDI SoundFont called “Fluid” (which, despite the similar name, is unrelated to FluidSynth) that’s packaged in most distros.

This will install both the “fluidsynth” tool and the Fluid SoundFont on an Ubuntu or Debian system:

sudo apt-get install fluidsynth fluid-soundfont-gm

Then, just run the “fluidsynth” tool, specifying the SoundFont file to use and the MIDI file to play, and adding the “-F” option to dump the output to a file:

fluidsynth -F out.wav /usr/share/sounds/sf2/FluidR3_GM.sf2 myfile.mid

If you want the result in MP3, you can transcode it using LAME:

lame --preset standard out.wav out.mp3

or in to Ogg Vorbis using oggenc:

oggenc -q 5 out.wav

The great thing about using FluidSynth, apart from its simplicity, is that you can easily substitute whatever SoundFont you want. For instance, if you find Fluid too big to work with, you can user a smaller alternative, like the GeneralUser GS SoundFont, or if the piece is a solo work, you could use a higher-quality solo instrument SoundFont, like jRhodes3, which is a great Rhodes sound.

linux music tutorial: seq24, part 2

In the first part of my seq24 tutorial series, I looked at creating patterns in the pattern editor, and then triggering those patterns in real-time from the QWERTY keyboard. In part 2, I go in to more detail on both features. This video covers:

  • Advanced pattern triggering techniques: queuing and snapshots
  • Basic note editing: copying/pasting notes and changing velocities
  • MIDI CC automation
  • Background patterns
  • MIDI note entry (step-sequencing) and MIDI recording

It’s a little longer than I’d have liked, but there’s a lot in there! If you’d prefer smaller, shorter tutorials in future, feel free to leave a comment and let me know.

For downloaders, there’s also a 720p WebM version available (107MB).

linux music tutorial: seq24, part 1

I promised I’d make an introductory tutorial to seq24, and now, I’ve delivered! If you’ve tried seq24 in the past and been confused by it, hopefully this will clear up some of the mysteries; if you’ve never tried it, this might just encourage you to give it a go!

There’s an unspoken “step zero” here — get yourself a working copy of seq24. I’m not sure about other distributions, but on Ubuntu, especially 64-bit, the packaged version seems very unstable. The best thing to do is to grab the 0.9.1 version from the seq24 Launchpad and install that — this new release includes a bunch of bug-fixes, and a few new features, too.

The original plan was for a straight screencast, like my earlier synth tutorials, but I was so impressed by Kdenlive that I decided to have a bit of fun with it — hopefully the fun I had comes through in the finished product.

For downloaders, there’s also a 720p WebM version available.

a demo of live sequencing with seq24

Despite a whole bunch of idiosyncrasies, I love seq24, and even though I tend to think of Qtractor as my MIDI sequencer of choice under Linux, it’s actually seq24 that I’ve used the most in producing my tracks. I’m planning on making some video tutorials for it, since it’s such a strange beast to deal with at first, but before doing that, I want to demonstrate the kind of things you can do with it.

Here, then, is a “performance” of my track tiny droplets — the various MIDI loops used are all pre-sequenced, but I’m triggering them all in realtime using my QWERTY keyboard. In this case, seq24 is driving Hydrogen and my Blofeld, and I’m using Ardour as a live mixer to process and mix the audio from those synths in to a stereo stream.

UPDATE: If you’d prefer to download the video rather than streaming it on YouTube, I’ve uploaded a WebM version of it. WebM is still quite new, but current versions of VLC and MPlayer support it.

On a brief side note, I have to give a shout-out to my good friend AutoStatic for describing his new video capture process using Xephyr and FFmpeg — I used it here, and the results look great. The audio was captured with JACK TimeMachine, and in another first for me, I edited it all together using the brilliant Kdenlive.

fingerplay: a midi controller for android

I’ve been slack in updating ye olde blog, but I have an excuse — I got a new phone! It’s a HTC Desire, running Android of course, and I’ve been having great fun trying different apps and discovering what I can do with it. I started a lengthy post covering my thoughts on both the Desire and Android, but in lieu of finishing that, I present you instead with an introduction to FingerPlay MIDI, a very cool MIDI controller app for Android.

Continue reading

The Salamander Grand Piano, and LinuxSampler CVS

NOTE: The link below was to an older version of the Salamander, so the link now goes to a download page that lists the latest version. Also, LinuxSampler isn’t as temperamental as it once was when it comes to loading SFZ files, so you don’t have to follow the instructions below to the letter any more — just add a sampler channel, set it to SFZ mode, and load the SFZ file, and you should be good to go.

After a bit of a wait, what’s perhaps the ultimate free piano sample library, the Salamander Grand Piano is available! One of the guys on the linux-audio-user spent I’d-hate-to-think-how-long recording every note on a Yamaha C5 grand at 16 different volume levels with a pair of stereo mics, and the result — all 1.9GB of it — sounds lovely.

Getting it running, however, is a bit fiddly right now. Due partly to its heft, it’s distributed in SFZ format, instead of the more common GigaSample “.GIG” format. Linuxsampler supports SFZ in CVS, but it’s buggy, and the instrument needs to be set up just right to load without crashing Linuxsampler. Once you’ve installed Linuxsampler from CVS — a bit of effort, but fairly straightforward, especially since it comes with Debian package scripts — follow these steps, in order, to get the Salamander up and running:
Continue reading

linux synth tutorial: part 6

Another long one! In part 6, I jump from Xsynth to Specimen, a simple sampler, which is ideal for when you want to take a simple sound and quickly transform it in to a playable instrument. Specimen does much more than just playing samples, though — it can sculpt and shape them with envelopes, filters, and LFOs, just like you’d find in Xsynth.

Hi-res Ogg Theora version is here, or watch the Youtube version after the jump!

Continue reading

linux synth tutorial: part 5

In part 5 of my Linux soft synth tutorial, I look at the concept of modulation — changing synth parameters over time. We saw an example of this in part 4, where we used an envelope to control the volume of a sound over time; modulation extends this to other parameters, such as the pitch of the oscillators and the filter cutoff. Modulation can use envelopes to change parameters over the length of the sound — in fact, there’s a second envelope in Xsynth-DSSI just for modulation — or the low frequency oscillator, or LFO, to perform repeating rhythmic changes.

Modulation can produce effects ranging from subtle vibrato through to sweeping soundscapes and alien sound effects. Either way, it’s a powerful way to breathe life and movement in to what might otherwise be a dull sound.

High-res Ogg Theora version is here, or watch the Youtube version after the jump!

Continue reading