The Penguin Makes Music

My fourth and final overview of open-source software for creative people involves music. In my youth I had many years of musical training, which until recently was going to waste. It’s not that I didn’t have the means – I own several electronic pianos – but I wasn’t motivated to play on a regular basis. Linux changed that, by making it easy to compose my own music, which makes things a lot more interesting.

Penguin_music

Linux has no shortage of musical tools available on-line. One thing that differs from the other areas I’ve discussed so far is that with music, one must use several tools in tandem. This is more in the spirit of the UNIX/Linux tradition of discrete components, rather than an all-in-one application such as “The Gimp” image editor or Libre-Office Suite. This allows for more flexibility but also makes things more complex. I’ll list the open-source tools I use for creating music, and you can be the judge.

* JACK

JACK (the JACK Audio Connection Kit) is a sound daemon (server) which provides the backbone of all music applications listed below. It’s like a virtual patch-board, allowing the interconnection of audio and MIDI (Musical Instrument Digital Interface) data between “JACK aware” applications. Unfortunately, not all programs are configured to use JACK, which is why it’s not yet the de facto Linux sound system. Because it takes control of your system’s audio, you will need to turn it off to play sound from your web browser, for example.

* QjackCtl

This is a graphical tool for controlling JACK without the use of typed commands. QjackCtl creates a list of audio devices, both hardware and software, that can be used as inputs and outputs. It lets the user define input and output connections between them, like a virtual patch bay. It’s not strictly necessary but makes JACK a lot easier to use.

* Fluidsynth

In order to create music on a computer, you either need to record sound from an external device, or to create sounds using a digital specification. “Sound Font 2” is a popular format for the latter; it’s been widely distributed on-line. Like JACK, Fluidsynth doesn’t have its own graphic interface. I found it interesting that Fluidsynth’s default sound fonts contain all the same instrument voices (piano, organ, guitar, trumpet, etc.) as the built-in selections on my Yamaha electronic keyboards. I’ve also found free sound fonts on-line which can produce other sounds such as percussion.

* Qsynth

This is a graphical front-end application for using Fluidsynth, much as QjackCtl is an interface for JACK. I haven’t used Qsynth extensively, except to select sound fonts (voices) for the MIDI sequencer application I’ll describe next.

* Rosegarden

This is the program I spend most of my time using. Rosegarden is a application for music composition and editing. It includes a MIDI sequencer, which can be used as an input to capture notes played on a MIDI instrument (such as my aforementioned Yamaha keyboards.) To do this, I invested in a bit of hardware, the E-mu Xmidi 1×1, a specialized cable which connects the twin round MIDI connectors on my instruments to a USB port on my computer. (I ordered one from Amazon.com for under $30.) If you’re new to this technology, I should note that a sequencer does not record sounds but notes (pitch, duration, attack, etc.) which can be mapped to any sound. This allowed me to make my piano sound like a guitar, ukelele, and an electric bass. As an alternative to Qsynth, you can install the Fluidsynth plugin, which allows you to map an instrument voice to a given track directly in Rosegarden.

Once your melodies and harmonies have been captured, you can edit them in several formats, including the standard sequencer matrix display and old-fashioned music notation. Having had classical training, the latter is my preferred method. This allows me to capture a melody on paper simply by playing it on the piano. Since I’m not very adept in improvisation, it really helps to have the music in front of me. Thus I can improve and embellish on that first performance, re-recording and re-printing it as many times as necessary.

Sadly, I had issues with bugs. In the Linux world, we install applications from the Internet using a command called “apt-get”; this fetches a version of the program created specifically for your current version of Linux. Because I use an older installation of Ubuntu (14.04) and don’t want to update until the next stable long-term Ubuntu is released next spring, I was “stuck” with Rosegarden 13.06. This worked fine for composing, but there were problems when exporting my musical tracks as sheet music. Therefore I downloaded and built a newer Rosegarden (15.12) from source code. It’s a task not for the faint hearted, but it fixed most of my problems.

* LilyPond

If you want to print out the musical scores you create in Rosegarden, the LilyPond program is the best way to do it. LilyPond is a music engraving program, which produces high-quality sheet music from the LilyPond-format (.ly extension) files you can export from Rosegarden. It’s a command line program which accepts a file called “somefile.ly” and converts it to “somefile.pdf” in Adobe Acrobat format, which allows it to be viewed onscreen or sent to a printer.

As I stated earlier, Rosegarden 13 had a bug in producing the lilypond “ly” input files. This caused the Lilypond program to become “confused” about how music was to be broken up into measures, to the point that it would sometimes make a line of music run right off the page! I was able to edit the “ly” files in a text editor to fix these issues, but that was a time-consuming annoyance that made it well worth upgrading to Rosegarden 15.

* JACK Timemachine

If you want to convert your new music into an MP3 file that can be played on your phone or iPod, there are a few more missing pieces. Rosegarden lets you play your music files over your computer’s speakers, but to hear it on another device, you need a “recorder” application such as JACK Timemachine. When you launch this program it appears as a device in the configuration list of Qjackctl. You connect the output of Rosegarden to the input of JACK Timemachine, and then play and record your piece, which is saved as an audio file in 64-bit WAV (w64) format.

* Sox and LAME

Bear with me; we’re on the home stretch. The aforementioned JACK Timemachine is a very simple program that only records music in one format. To change it into a more usable file, you need a music converter such as Sox (Sound Exchange) the “Swiss Army knife” of audio file conversion. Sox is a command-line tool that allows you to convert the w64 files into more playable formats such as WAV and OGG. Unfortunately the popular MP3 file format is patented and technically requires royalties to be paid; therefore Sox (being free of charge) does not include the MP3 plug-in. For do that you must recompile the Sox program from source with an MP3 plugin (requires a fair bit of computer expertise) or better yet, install the “LAME” MP3 encoder to do that last conversion. Why Sox can’t include this function, and yet it can be in LAME as a separate program, I have no idea. Leave that one to the lawyers.

I apologize for this long post and hope it hasn’t been too intimidating. If open-source music tools are complicated, they make up for it in their flexibility and power. Best of all, they’re free, with plenty of help available online. Remember, most of these open-source programs are also available for Windows and Mac. Happy composing!

 

Linux Art Tools for the Talented (and untalented)

PenguinKB

The movie Naked Lunch would not have been nearly so dark if, instead of turning into a cockroach, the protagonist’s typewriter would have turned into an adorable penguin. So in honor of the second installment in my Linux posts, which deals with image manipulation programs, I decided to create one. Unfortunately, due to my lack of artistic talent, it ended up looking more like penguin roadkill than anything – but you get the idea.

For what it’s worth, I did the attached illustration with the GIMP, an open-source image editing program similar to Photoshop, without the hefty price tag. The name is an acronym, GNU Image Manipulation Program. (The word “Gnu,” which you’ll see applied to a lot of things Linux, stands for “Gnu is Not Unix,: a bit of computer geek humor.) Like many of these open-source programs, it has versions for Windows and MacOS as well as Linux. The GIMP has a steep learning curve, but you don’t need a manual, just Google. There are thousands of fellow GIMP users out there who are more than willing to help you. Like any serious imaging program, it lets you work with layers and transparency. I have used GIMP for finalizing the cover art for my last two books. Once the artist has completed the illustrations, I use it to add the title and author name, the back cover blurb, and the lettering on the spine. GIMP saves images to its own format, XCF, but you can export things as PNG, JPG, and all other major formats. When I imported the Fidelio cover art from a Photoshop file; it wouldn’t display correctly, but I was still able to extract the layers and paste them into a new document. All in all, the GIMP is a very powerful program.

Inkscape is another image program I’ve recently started using. Unlike GIMP, it’s not a photo editor but a vector drawing program. It’s more equivalent to Adobe Illustrator or Corel Draw. Vectors are not fixed-size pixel drawings; rather they’re abstract mathematical objects that can be scaled up or down with ease. I’ve got a lot of experience with the latter because I use it in my day job to create files for our laser engraver. Therefore I was looking for an equivalent program I could use on Linux. The first thing I tried was to import a Corel Draw file. It was only partially successful, as the “hairline” (zero width) vectors did not come across. It does far better if you export from Corel to SVG format. Inkscape does, however, have its own hairline vectors, a necessity for drawing “cut” lines for the laser. As with the GIMP, Inkscape also has versions for Windows and MacOS.

In the Linux world, one of the paradigms seems to be, why use an existing application when you can create your own? Consequently there are many open-source graphics programs to choose from. The ones I mentioned above are the ones I use the majority of the time. However, I can’t neglect mentioning a handy little program called xfce4-screenshooter, which in Ubuntu Linux pops up every time to press the Print Screen Key. It shows a thumbnail of your screen image, and gives you the option of saving it, copying it to the clipboard, opening it in a graphics viewer or editor, or posting it to ZimageZ, a free hosting site for images and photo galleries.

Penguin photo from publicdomainpictures.net.