a great article on using multiple audio devices with JACK

I’ve been meaning to write a tutorial describing how to use multiple audio devices with JACK, using the “alsa_in” and “alsa_out” tools, but as it turns out, I don’t have to now! Linux Home Recording is a new-ish blog that already has a number of great articles about various Linux recording topics, and the most recent post there is all about using alsa_in and alsa_out.

It pays special attention to one of the most common cases — using a USB microphone — so it’s well worth a read.

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!

favourite features in ardour 3: stacked regions, connection matrix, aux bussing

Easter is a holiday weekend in Australia, and the extra days off gave me time to get back to the piano-driven song that I’ve been working on for some time. I’ve had the arrangement largely complete for a while, so I quickly finished the lyrics and then recorded the vocals.

Until now, this track was all MIDI in Qtractor, and I tried recording the vocals there, too, but I need a lot of takes to get a good vocal down, and Qtractor didn’t make that easy. I suspected that Ardour 3 might, though, so I started a new session, synced it to Qtractor using the JACK transport, and recorded the vocals there.

Stacked region view

Ardour 3 can stack overlapping regions within the one track vertically, making it much easier to work with multiple takes

Ardour has long allowed you to record multiple takes in to the same track, but switching between them in Ardour 2 was time-consuming. In Ardour 3, you can switch a track to “Stacked” mode (under Layers in the track’s right-click menu), which displays the overlapping regions within the track separately, stacked vertically on top of each other. In Stacked mode, you can see clearly what’s in each region (at least, once you’ve expanded the height of the track enough!), and you can rearrange them by clicking and dragging.

It’s also easy to select multiple stacked regions and run the same edit operation on them, such as splitting them at the playhead. It took very little time to split my takes in to individual phrases, and then rearrange and audition them to find the best takes for each part of the vocal.

Matrix-style connection manager

A more fundamental change in Ardour 3 is the new connection manager interface, which is a massive improvement on the old UI for managing connections to tracks, buses, and inserts/sends. It’s intimidating at first, but it’s really quite simple to use: it’s a matrix, with outputs running top-to-bottom on the left, and inputs running left-to-right on the bottom. For each combination of input and output, there’s a box on the grid, and clicking in those boxes creates or deletes a routing between that input and that output.

In specific parts of the UI, you’ll just see subsets of this; for instance, if you open the connections for a specific track, you’ll see the potential outputs on the left, but just the track’s inputs down the bottom. However, there’s also a master connection manager (well, two really — one for audio, and one for MIDI, both available from the Window menu), which lets you make connections to multiple tracks or buses very quickly.

The connection manager can be intimidating at first, but it's super-quick to use

After I finished recording my vocals, I decided to record audio tracks from my MIDI instruments in to Ardour so I could work with just audio for the final mix. For the drums, I used LinuxSampler (discussed a little here), with five separate copies of Analogue Drums’ RockStock kit loaded (one each for kick, snare, toms, hats, and cymbals), each routed to its own pair of JACK outputs. In Ardour 2, it would’ve taken ages to connect those LinuxSampler outputs to my track inputs, but with the master connection manager in Ardour 3, it took just 10 clicks and about as many seconds.

Aux busses (again)

Aux buses and sends make shared effects even easier to set up

I’ve mentioned it before, but the aux bussing in Ardour 3 is great. Once I’d recorded all my instruments in to Ardour, I set up a reverb bus (a convolution reverb using the excellent IR plugin), and added sends from some of my tracks. Not only are they easier to add, but you can see and adjust the send levels straight from the mixer.

While I ran in to some problems with MIDI in Ardour 3 last week, working with just audio this weekend has been rock-solid. A lot of bug fixes have gone in to Subversion since the last alpha release, so I’m hoping we’ll see a beta release soon.

new studio toys

In the last few weeks I’ve added two great bits of gear to my home studio. The first, which I actually received for Christmas, is the Korg nanoKONTROL (Amazon link), a brilliant little MIDI controller that I think just everyone could find a use for.

Korg nanoKONTROL

Korg's nanoKONTROL is a brilliant, affordable MIDI controller

The nanoKONTROL is part of Korg’s nano series of tiny, laptop-friendly controllers which also includes the nanoPAD, with 12 drum pads and an X/Y touch controller, and the nanoKEY, a 25-key keyboard (of sorts). While I don’t think much of the nanoKEY — Akai’s LPK25 (Amazon link), while slightly larger, looks far more practical — the nanoPAD looks good, but I still think the nanoKONTROL is the pick of the bunch.

Its layout, with nine faders, nine knobs, and eighteen buttons, along with a set of transport controls, certainly lends itself to DAW mixer control, but it’s flexible enough to control just about anything. It did a fine job of handling synth parameters on PHASEX, for instance — using PHASEX’s MIDI learn features (just right-click on a control and move the appropriate MIDI controller) I was quickly able to set up the nanoKONTROL’s faders to configure the amp and filter envelopes, and the knobs to control filter cutoff, resonance, and envelope amount, among other things. It’s also brilliant as a SooperLooper controller, letting you pan, fade, and mute individual loops on-the-fly.

As a class-compliant USB MIDI device, it goes without saying that it works perfectly under Linux, but I’ll say it anyway — the nanoKONTROL works perfectly under Linux, with true plug-and-play simplicity. If you want to reconfigure the device, to change the MIDI messages that each controller sends, there’s a native app for that, called Nano-Basket, but Korg’s official app runs flawlessly under Wine, too.

Korg has announced updated versions of its nano controllers, but there’s no hard word on when they’ll be available yet. The nanoKONTROL2 adds a third set of buttons but loses one fader and knob, so I’m glad to have the original.

The Saffire PRO 40 has 8 inputs with preamps, 8 line outs, and ADAT expandability

The other new addition is somewhat bigger: it’s a Focusrite Saffire PRO 40 (Amazon link), a Firewire audio interface with eight channels of analogue I/O. Each input is a combo XLR/TRS jack with a preamp and phantom power, so it can handle up to eight condenser mics, but it’s just as happy handling line inputs from synths. In addition to the analogue I/O, there are S/PDIF and ADAT ports, which can add up to another 10 inputs and outputs.

As a sysadmin I’m quite familiar with how big standard 19″ rackmounted gear is, but for some reason, I was still surprised when I got it home — this thing is big! Now that I’ve made room for it, though, it’s fine, and beacuse it’s replacing not just my old PCI sound card, but also my Behringer mixer, it doesn’t actually take up much more space than my old setup did. Having to run just a single Firewire cable down to the PC is great — I certainly won’t miss running 3.5mm audio cables between my mixer and my PC’s back panel.

Like all supported Firewire audio devices, the PRO 40 uses drivers from the FFADO project, but support for the PRO 40 (as well as the smaller PRO 24, and some competing devices that use the same DICE chipset) is only available in the development FFADO code from Subversion. The current FFADO build in Ubuntu 10.10 is actually a Subversion build that’s recent enough to handle the PRO 40, but before I realised that I’d already installed the drivers manually. It wasn’t exactly plug-and-play, but once I switched to the old Firewire stack (playback doesn’t work on DICE devices with the new stack right now), and got the PRO 40 talking to my Firewire controller successfully (annoyingly, turning everything off and on again helped with this), getting it running with JACK was actually fairly straightforward.

So far, the performance has been fantastic. I haven’t given its preamps a good test with my mic yet, but recordings of my Blofeld via line-in were very clean and noise-free. Even my analogue delay pedal, which I know is a bit noisy, sounds much quieter than before, and with eight ins and outs on the one device, it’s very easy to hook up that delay pedal, send audio to it from Ardour, and then receive the output back in to Ardour. Even with Ubuntu 10.10’s stock generic kernel, I’m running pretty solidly at 8ms latency, which is low enough for my needs.

testing ubuntu lucid

Ubuntu 10.04, aka Lucid Lynx, is just a couple of days away, so I’ve been testing it on my laptop to see just how it’s coming along. I rely too much on both my laptop and my desktop to mess with new OSs before they’ve been released (or even just after they’ve been released), but I do keep a little 4GB partition spare on my laptop, so that I can install and test new releases without messing up my primary install.

So far, it’s looking really good. The new visual theme is great to look at, and while it still insists on moving the close/minimise/maximise widgets in window title bars, it at least puts the close button in most accessible place, in the far left. It also has “teh snappy” — Firefox 3.6 on 10.04 snaps tabs around just as quickly as Chrome did on 9.10. I’m not sure what’s going on here, but I suspect it’s an Intel video driver update at play.

In terms of music-making, 10.04 gets two big improvements: JACK is now in the “main” repository, which means that a bunch of apps that didn’t ship with JACK support in earlier versions now can (and do), and LV2 support is much more widespread, with major apps like Ardour supporting LV2 out-of-the-box, and more LV2 plug-ins (such as the Invada pack) available as standard packages. The JACK package now automatically sets itself up to get realtime priority access, removing a manual configuration step that’s often a stumbling block for users new to Linux audio.

living in the future

I spend a lot of time talking to Americans on the Internet, and they’re always reminding me that, due to the timezone difference, I live in the future compared to them. Today, though, I had a moment that reminded me that all of us really are living in the future.

It was simple enough, really — I was sitting on IRC, and someone pasted a URL in to channel, but instead of linking to some lewd image from 4chan, it was a live stream of the recording session he had in progress in his home studio. Streaming audio isn’t exactly a new thing — Internet radio and live online concerts date back to the days of RealPlayer and dialup — but there was just something fascinating about being able to listen in on someone else’s bedroom studio as they put a track together, with everyone on channel listening and giving feedback, and even recording and emailing across their own snippets of audio.

The best part of it all is that the technology isn’t that hard to get running. I installed Icecast on my virtual server, and DarkIce on my desktop at home, and before too long I had a live stream of my Ardour session up-and-running. DarkIce runs as a JACK client, so it can take its input from anywhere in your JACK signal path, and it can encode to Ogg Vorbis, which is supported natively in Firefox 3.5.