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.

Saturday, August 8, 2009

Choosing an Operating System

What is the best linux distro for making music?

This is perhaps one of the most commonly asked questions among beginners wanting to take advantage of GNU/Linux and its DAW, recording, composing capabilities. There are thousands of Linux distros out there and quite a few tuned directly for audio capabilities. The answer is whatever suits you, and perhaps that is the underlying theme among GNU/Linux distros. I have tried a few over the past few years and have settled on two.

I use Ubuntu Studio on my laptop. I had to sneakernet it (via thumbdrive) to my computer, so I am relatively stubborn on removing it to try anything else. It installed with relatively few problems, although I had to learn how to use NDISwrapper in order to enable my wireless card, and my laptop has an extremely funky soundcard and I still do not have microphone capabilities. But I would have had those problems with almost any Linux distro. Ubuntu Studio is really easy for me to use, although I have been using Linux for several years now. I am by no means a Linux expert, but I may have a slight advantage. I can see why some people would think Ubuntu is the easiest Linux distro to pick up and use though. Ubuntu Studio came with all my favorite audio applications preinstalled and I will cover some of them in the near future. I also did not have to do any funky kernel reconfigurating, it was fine-tuned for low latency upon installation.

My desktop system has Fedora Core 3 with PlanetCCRMA packages. This isn't the hardest way to go, but it also wasn't the easiest. Before the Fedora community flames my comments with questions as to why I'm still using FC3 while FC11 is now available let me say this, it still works. I spent countless hours learning Linux with this system, custom configuring things to work the way I want them to, installing funky software that had to be built from source because RPMs for these programs are still not available. I honestly like the way this system works. That and it's installed on an old machine that doesn't have a lot of RAM or processor speed, I'm not interested in upgrading. With that said, Fedora itself is easy to use, PlanetCCRMA was not, but a quick look at PlanetCCRMA's website now tells me that it is easier nowadays. PlanetCCRMA is a separate repository of packages for Fedora that will fine tune your system for low latency and also has a plethora of available audio software ready to go. There is also a nice easy option in their repository to install all their software at once.

I have also used DyneBolic in the past. It's nice to have a Live CD/Live DVD to see if your computer will even recognize what Linux is, but personally I like to be able to save my work hassle-free. I don't know enough about Linux to be able to manually mount external drives every time I boot the computer up. I did have fun showing other people some of my capabilities in the middle of Circuit City though.

My best advice to the novice is to aim and fire. Pick something and see if it works. If you've never used Linux before then your fields of fire are pretty wide. Linux-sound.org has a nice small list availabe at http://linux-sound.org/distro.html

Don't get frustrated though. This is your learning stage, so take the time to learn. If you've spent 3 hours installing something and it still doesn't work you're probably either doing something wrong or it's just not going to work. Don't be afraid to ask questions, but don't be afraid to dig through the manuals either. If you go to the #fedora IRC chat and get the infamous "RTFM" then it may be time to take a second look at the manual. (Trust me, I've been there a few times)