At the Sounding Edge: Using QSynth and QJackCtl

June 9th, 2005 by Dave Phillips in

Two strong GUIs for fluidsynth and JACK make Linux audio tasks easier and faster, letting you get straight to the music.
Your rating: None Average: 4.9 (7 votes)

In last month's column, I introduced seq24, a minimal but powerful MIDI sequencer. The final screenshot for that column shows off seq24 at work here in Studio Dave. In that screenshot you can see two of my favorite Linux audio programs, Rui Nuno Capela's QJackCtl and QSynth. In this month's column, we look at those applications more closely to learn what they do and how you can use them in your own Linux MIDI music workstation.

QSynth and QJackCtl are GUI front-ends for other software. QSynth provides a friendly user interface for the fluidsynth soundfont-based synthesizer. QJackCtl supplies a similar interface for the JACK audio server/transport control system. Both applications use a recent version of the Qt graphics toolkit and up-to-date versions of their other required components. Complete instructions for installing and configuring QSynth and QJackCtl can be read on their respective Web sites (see Resources), and most of the necessary software is included in mainstream Linux distributions. JACK and fluidsynth typically are not found in mainstream distros, but the QSynth/QJackCtl Web sites include URLs for those and all other required parts.

When I refer to a feature of QSynth or QJackCtl in many instances the feature really belongs to the underlying application. The GUIs organize the available functions of fluidsynth and JACK for easier access and control, so for convenience I've written as though QSynth and QJackCtl are complete in themselves.

QJackCtl

JACK is an audio server and transport control system designed for low-latency and robust performance up to professional levels of use. Given a properly tuned base system--low-latency kernel, optimized disk throughput and so on--client applications can be routed and connected freely, sharing audio data without dropouts and potentially working with synchronized transport control. The system has been adopted throughout the Linux audio development community and has become a necessary part of any modern Linux-based music and sound production system.

JACK can be launched and controlled from the command prompt. But, when working in X, it's much nicer to use a GUI to configure the parameters of the JACK system. QJackCtl provides that GUI.

If you're running an audio-optimized Linux system, such as AGNULA/Demudi or Planet CCRMA, QJackCtl either is activated by default or is available as a menu item. If you start QJackCtl from the command prompt you can add the --help option to see a few possible startup options.

Figure 1 shows off QJackCtl's main panel. Its buttons control the JACK system active state (start/stop/quit), messaging and status reports, device connection management, transport control (play/pause), the setup configuration and a program information pop-up. The main panel also includes a visual display of the information reported by the status button.

Figure 1. QJackCtl

Click the Setup button to open the system configuration dialog shown in Figure 2. This article is not about JACK, so I am going to skip a detailed explanation of JACK's parameters. QJackCtl attempts to configure itself with sensible defaults, but you will be able to tune JACK for better performance as you learn more about its capabilities. (See the JACK reference materials for more information).

Figure 2. The Settings Tab

The Setup panel contains tabs for startup/shutdown scripts, font display settings and some miscellaneous options. The Display tab includes two items of special note, an option for connections to be drawn as Bezier curves and an option for renaming the clients and their ports. They may not seem so remarkable, but they are thoughtful and useful touches.

Assuming you have a working system, you now can click on the Start button to start using JACK. Figure 3 demonstrates QJackCtl at work with my M-Audio Delta 66. JACK typically handles only one soundcard at a time, so I have separate server configurations for my SBLive and Delta 66 cards. Figure 3 also shows the system status represented by the status panel and its visual display.

Figure 3. QJackCtl with the M-Audio Delta 66 Soundcard

Now that we have a running JACK system, we can use it with QSynth. However, before making the connections, let's look at QSynth.

QSynth

The fluidsynth project provides Linux musicians with a free and open-source soundfont-based synthesizer. A soundfont is a soundfile format combining audio data and performance control data. Soundfonts are not merely played back, they require an engine (synthesizer) designed to apply the performance controls to the raw audio data. fluidsynth is such an engine.

Like JACK, fluidsynth can be run from the command line, but its configuration at the prompt can be a bit complicated (see 'man fluidsynth'). QSynth is the GUI solution to that problem.

Figure 4. QSynth

Figure 4 shows QSynth's default appearance. The main panel is arranged clearly and is comprehensible. As with QJackCtl, QSynth employs helpful tooltips to clarify the function of each interface component.

Again, we start our little tour with the Setup panel. Options here include tabs for audio and MIDI driver configuration, soundfont bank selection and a summary of QSynth's default and current settings. QSynth supports audio and MIDI drivers for ALSA and OSS, a MIDI-only driver for MidiShare and an audio-only driver for JACK. In Figures 5 and 6, QSynth has been configured as an ALSA sequencer client and as a JACK audio client, respectively.

Figure 5. MIDI Options

Figure 6. Audio Options

Click the Soundfonts tab to specify the soundfont banks you want to assign to the QSynth engine. As Figure 7 shows, you can list multiple banks, but only the last font listed is active.

Figure 7. Soundfont Selector

Close the Setup panel and click on the Channels button to open the channel/instrument assignment panel shown in Figure 8. The maximum number of channels is determined in the Setup/MIDI tab, with a default of 16 channels to the allowable maximum of 256, all in increments of 16. Right-click on an entry in the Channels dialog and select an instrument from the soundfont instrument list seen in Figure 9. Repeat per channel as necessary.

Figure 8. Channels Dialog

Figure 9. Instrument Selector

QSynth is a multitimbral synthesizer, meaning that you can assign a different instrument to each channel for a mixed ensemble of independent players. Alternatively, you can assign a single instrument to multiple channels to create rich layered sound textures. Or, you can mix all of these methods as you please. To use different soundfonts at the same time, right-click on the engine selector tab at the bottom left corner of the main panel--labeled qsynth1 in Figure 4--to add another instance of QSynth to the fun. Each engine can access a different soundfont, with independent master gain and effects settings. With the right fonts, you might find that QSynth is all the synthesizer you'll ever need.

Figure 10. Multiple QSynth Engines

By the way, if you want to expand your collection of soundfonts, be sure to check out the listings at Hammersound (see Resources), which link to some excellent free fonts. You might also want to peruse the Linux Audio Users mail list archives for links to free fonts. Some list members have designed fonts for truly free redistribution, but the community still needs a truly free and open-source general MIDI soundfont.

Back to JACK

At this point, return to QJackCtl and start the JACK server if it isn't already running. Click on the Connections button and select the Audio tab to make your JACK audio connections. Figure 11 illustrates one arrangement of multiple QSynth engines with independent output ports connected to the ALSA PCM input ports; it's a good example of how QJackCtl simplifies complex routing arrangements.

Figure 11. Audio Connections in QJackCtl

Now select the MIDI tab to set your MIDI connections. Here we find the same flexibility found in the audio tab, as shown in Figure 12. In that screenshot the input from my physical MIDI port--SBLive with adapter connected to a Casio CZ101 MIDI keyboard--is routed to the first QSynth engine. The first ALSA virtual MIDI port is connected to the second QSynth engine and to the EMU10k1 synthesizer on the SBLive. Finally, the last virtual MIDI output port is connected to the third QSynth engine and to the EMU10k1 synth. Again, a complex configuration is simplified by using QJackCtl.

Figure 12. MIDI Connections in QJackCtl

Click the Patchbay button to view, edit and save/load your audio and MIDI connections as user-defined presets. Figure 13 illustrates this neat feature, showing the Patchbay preset defined for the connections in Figures 11 and 12.

Figure 13. QJackCtl Patchbay

We've made QSynth's audio and MIDI connections, so now it's time to put them to use. Figure 14 illustrates seq24 using QSynth with multiple engines, with each engine driven by a separate sequence in seq24. Remember, seq24 makes its MIDI connections internally, there's no need to use the MIDI Connections tab in QJackCtl. QSynth autoconnects to the ALSA PCM input ports, but you need to reconnect if you want to route QSynth's output elsewhere. Figure 14 also demonstrates such a connection, with one engine's output routed to a LADSPA effects processor in the JACK Rack, the output of which is sent to the ALSA PCM ports.

By the way, the screenshot in Figure 14 is included for demonstration only. QSynth's own effects processors, reverb and chorus, are quite serviceable, but they're not going to equal the performance of a dedicated software or hardware processor.

Figure 14. A Complete Mini-MIDI Studio for Linux

The Final Mix

QSynth and QJackCtl are essential components of my Linux sound studio, and I certainly can't imagine working in X without them. Yes, you can do everything with their host applications at the command prompt. But, these helpful GUIs make the work much easier, which means I get to make music with less hassle in configuring the gear.

These applications are easy to learn and use, and they serve their humble purposes simply and directly, so there's not much to criticize in QSynth or QJackCtl. I'd like to see MIDI activity indicators in QJackCtl, perhaps in the MIDI connections tab, but that's hardly a pressing need.

So how does this little studio sound ? Check out the demos and let me know what you think. Personally, I'm impressed by the power now available to Linux musicians. I hope this article has revealed some of that power to you.

Acknowledgments

The author wishes to thank Peter Hanappe and all the other developers of fluidsynth for that marvelous software. Vast thanks also to Paul Davis and all JACK developers for one of the finest achievements in open-source audio software. And of course, great thanks to Rui Nuno Capela for his work on QSynth and QJackCtl.

__________________________


Special Magazine Offer -- Free Gift with Subscription
Receive a free digital copy of Linux Journal's System Administration Special Edition as well as instant online access to current and past issues. CLICK HERE for offer

Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Martin's picture

Latency w. Delta 66 and Fluidsynth?

On January 10th, 2007 Martin (not verified) says:

What kind of latency do you get from the Delta+Fluidsynth combo? I have a MIDI instrument (Akai EWI 4000s) and I'd like to send MIDI from the EWI to the computer and have it render the sounds. But with my current, (and crappy) onboard soundcard, the latency is simply terrible. I'd like a MIDI-in => audio-out latency of something < 10ms; is that feasible at all?

Cheers,

/Martin.

velotron's picture

akai 4000s

On February 15th, 2007 velotron (not verified) says:

Hiya,

I've been trying to edit the patches on my EWI 4000s from my Debian box with no success. I successfully got the Uniquest software installed under Wine, but can't seem to get it to find the EWI. I configured it with OSS drivers to my emu10k (SB Live) card, but no luck. Any pointers? Thanks!

Bird's picture

cant find ewi

On August 26th, 2007 Bird (not verified) says:

My Uniquest software can't find my ewi too.
Do you know how to solve this?
Bird.

Anonymous's picture

Hammersound

On November 27th, 2006 Anonymous (not verified) says:

You forgot to put Hammersound in the Resources. Here is the URL:

http://www.hammersound.net/

Thanks for this article.

Anonymous's picture

In the soundfonts-list (Figur

On June 18th, 2005 Anonymous (not verified) says:

In the soundfonts-list (Figure 7 - Soundfont Selector)
select a soundfont with right mousebutton and choose edit.
You now can set the offset (wich is the bank number !)
This way you can play different soundfonts on different banks, without
adding another qsynth-engine.

Anonymous's picture

doesn't work in ubuntustudio default install

On May 22nd, 2007 Anonymous (not verified) says:

tried, but that edit button shows up under the mouse cursor, but doesn't work. nothing happens, no dialogs or choices.
:-(
niyam

Anonymous's picture

Author's reply

On June 21st, 2005 Anonymous (not verified) says:

Thank you, I didn't realize that's what the Offset label meant.

I'm still learning something new everyday... :)

Best,

Dave Phillips

Anonymous's picture

Author's addenda

On June 10th, 2005 Anonymous (not verified) says:

Two additions:

To select a new synth engine in QSynth click anywhere in the bottom strip of the GUI. You don't have to click on just the qsynth1 tab (see Figure 4).

The Options dialog also includes a selector for a very handy VU meter (not shown in the screenshots, sorry about that). The meter indicates the sum of amplitudes from each engine, making a handy tool for avoiding clipping (i.e. amplitude distortion).

Best regards,

Dave Phillips

Post new comment

Please note that comments may not appear immediately, so there is no need to repost your comment.
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <pre> <ul> <ol> <li> <dl> <dt> <dd> <i> <b>
  • Lines and paragraphs break automatically.

More information about formatting options

Newsletter

Each week Linux Journal editors will tell you what's hot in the world of Linux. You will receive late breaking news, technical tips and tricks, and links to in-depth stories featured on www.linuxjournal.com.
Sign up for our Email Newsletter

Tech Tip Videos

From the Magazine

December 2009, #188

If last month's Infrastrucuture issue was too "big" for you then try on this month's Embedded issue. Find out how to use Player for programming mobile robots, build a humidity controller for your root cellar, find out how to reduce the boot time of your embedded system, and if you're new to embedded systems find out the basics that go into one. You can also read about the Beagle Board, the Mesh Potato and a spate of other interestingly named items. And along with our regular columns don't miss our new monthly column: Economy Size Geek.







Read this issue