Sunday, August 9, 2009

Getting to Know Jack

Perhaps the most essential tool in my toolkit is JACK, the Jack Audio Connection Kit. It's a little more abstract than a synthesizer or sequencer but it doesn't take much to understand what it does. It serves essentially as the engine that runs the audio and routes your audio signal from program to program so that you can achieve the exact effect you want. GNU/Linux works primarily on the ALSA sound system and JACK serves as an extra layer on top of it before you put it out to your speaker. Also, it may help to understand that JACK is not the graphical user interface that you'll be playing with so often, its an underlying system, QJackCtl gives you the ability to see and configure JACK.

(For future reference a GUI is a graphical user interface, which basically means the windows you see on your screen.)

On my Ubuntu Studio system QJackCtl fires up automatically, however on my old Fedora Core 3 system I have to go into the Sound & Video menu and open up QJackCtl.

This is how it usually looks when you first open it up. You'll notice that in a greyed out yellow color it says "Stopped" which means that it's not running. Here's where you may or may not have some "fun". Click the "Start" button and cross your fingers that it successfully starts up. If your computer is configured correctly you should have no problems, but on my old Fedora Core 3 system I had to do some manual configuring to get it to work.

If every thing worked correctly you should see something similar to the above picture. Do not panic about the "Stopped" message in green, that is referring to the transport, which syncs up your MIDI controlled programs. If you should need to do some configuring you can click on the "Setup" button on the right hand side of the window and you should see something like the following:

The above screenshot was taken from my Fedora Core 3 system and I had to do some experimenting with Periods/Buffer, the Frames/Period, and the Timeout to get it to start up properly. I wouldn't recommend changing things drastically unless you understand what you are doing or at least remember what the values are before you change them.

Once you have JACK running you can check out the "Connect" button.

And you will see something similar to the above screen. This is where most of the magic happens in JACK. Items listed on the left are readable, such as a microphone. The computer can read the data coming from a microphone. Items listed on the right are writable, such as the speakers. The computer can write data out to the speaker. You can make connections between the two columns by clicking and dragging between items in separate columns that you want to connect, or you can highlight something in each column and click the "Connect" button there at the bottom. You also have two tabs, one for Audio, and the other for MIDI. If you have a keyboard or other MIDI controller hooked up to your computer you will see them listed there. For example I have a cheap Yamaha keyboard that I bought at Wal-Mart hooked up to my computer via a USB MIDI cable that I bought at Radio Shack.

Here you see the MIDI device shown in the Readable column connected to ZynAddSubFX, a popular synthesizer available for Linux that I will cover later. This means that I can play the keys on my Yamaha and it will play the notes in ZynAddSubFX on whatever voice I have active. If I were to connect something in the left column to the USB Uno MIDI on the right column that would mean the computer would be controlling the keyboard.

Lets take a look at an example of some audio routing:

This is a bit more complex example. I have everything opened up so that you can see that almost everything has two channels, one for left and one for right. Alsa_pcm in the left column is the microphone and that is hooked up to Jack Rack, a popular effects processor. I also have ZynAddSubFX hooked up to Jack Rack to apply the same effects to my synthesizer. Jack Rack in the left column is hooked up to alsa_pcm on the right, which takes the output from Jack Rack and puts it out to the speakers. You don't necessarily have to look at the expanded view of everything like this, generally you can just connect one to the other without worrying about the left and right channels, but it's important to understand in case you have problems with it in the future.

Earlier I mentioned the transport that will sync up your MIDI controlled operations. As you delve deeper into synthesizers and sequencers you will find this more important to you. For now understand that if you have two sequencers running, for example Hydrogen (a popular drum machine) and Seq24 (a simple sequencer program), the transport will keep them both on the same beat.

That, in the proverbial nutshell, is JACK. Not all programs are JACK compatible but most of the ones I will cover are, I will make sure to mention when they are not.

1 comment:

  1. Nice article and good screen shots. Thanks for posting the link to the LAU list.