Music studio

Musicians nowadays use computers to compose their songs. Linux has had tools for creating music for quite some time, but not every part of setting up a working musician's studio seems to be obvious. This tutorial will try to help you setting up a music studio ready for mixing, effects processing and composing of music.

Configuring your kernel
There's not a lot to configure about your kernel, except for your midi hardware devices, if you have any. For example, a piano keyboard which is connected to your computer is a midi device. If you don't know, you can probably skip this step.

If your midi device is a USB device:

If your midi device is not a usb device and has a normal midi connector:

You don't have to build and install your kernel yet, unless you've already installed JACK. Whatever, just read the next section. If you have a MIDI hardware device, you should now be able to use it. Rosegarden (will be discussed later) will automagically recognize it, but you may have to connect it to Rosegarden in qjackctl.

Jackd
The keyword in linux music studios is jackd. jackd (part of media-sound/jack-audio-connection-kit) is a server which aims to virtualize the world of jack connections. In practice, it provides you low-latency interfaces to audio hardware and software. jackd is a server to which clients (both audio-in and audio-out) connect to exchange their sounds. jackd then sends sounds to alsa's drivers as needed to actually get you some music.

Before continuing, please make sure you have JACK installed.

Installing editing software
There is tons of software for doing audio work in linux, much of it in Portage. Below is a short list of things generally considered good or useful.

Note that most of these packages in portage has a different/new versions in one or more overlay (including a number of live ebuilds for those that like to live on the edge).

The Gentoo Pro-Audio site contains a list of all the audio programs in that overlay.

Option 1: starting jackd manually
Obviously, what we want is a setup in which we only need to start one application to launch the entire studio, but for troubleshooting purposes we will first try to launch on a per-program basis.

If you can't start jackd, please make sure no application is currently using ALSA, as jackd will, depending on whether you have hardware mixing (if you do you're lucky!), want exclusive access to your ALSA hardware device.

Option 2: Getting a bit of magic from QjackCtl
You can also get a helping hand from QjackCtl. Find it in your start menu or launch it from the terminal:

And simply press the play button.

Starting Rosegarden
Now, we're basically done with configuring our setup. If you are using Gnome, you can find Rosegarden in Applications->Multimedia->Rosegarden. In KDE, open the K-menu->Multimedia->Rosegarden. Of course, you can also simply start rosegarden from your terminal:

Does everything work all right? You'll probably get messages about XML-Twig missing, as well as KDialog. Those packages are needed for certain exporting features. If you want those, feel free to emerge them:

Now that Rosegarden itself works, you might already be there. If you only want to compose music, and have hardware with everything you need, you should basically be done now. However, if you don't have midi hardware, for example, you'll need some software emulation of that. Keep on reading.

Virtual MIDI output
You will not need timidity if you have an audio device which can play midi. However, most (cheap) audio hardware doesn't and therefore you probably need timidity. If you don't you can skip this step. For virtual MIDI output, we'll use. There's an official guide about this, but that's only useful when you don't use jack. You are using jack, however, so you'll need a different approach. Get started by emerging timidity++:

Normally, timidity++ is used to play one midi file. However, you want to use it as a kind of daemon, where every jack client which outputs midi does so to timidity++. To do this, simply run (with jackd running!):

Yep, that's it. Virtual MIDI output should be setup for you now. If you have a global ALSA timidity daemon running as well, please make sure to select the right one in rosegarden.

Virtual MIDI Piano
If you don't have a real MIDI piano (it's a real pleasure if you're serious about music composing), you can use instead.

Make sure jackd is running before launching vkeybd.

username  28684 11.4  1.0 116000 89464 ? SLsl 18:32  1:50 /usr/bin/jackd -dalsa -r44100 -p128 -n2 -s -Xraw -D -Chw:0,0 -Phw:0,0 Start vkeybd

vkeybd assumes that you are using the QWERTY (us) keyboard layout.

Check its man page for more information

Starting the entire studio at once
Make a new file called musicstudio wherever you want in your normal user's home directory (a good location would be ). In that file, put the following:

Now make it executable:

And of course, try it!

Happy composing!