Making Music on Linux

pieterhpieterh wrote on 27 Feb 2013 15:01


I've always loved music, and have always been a terrible musician. Recently I found myself playing a cheap Casio keyboard and graduated to a rather nicer Kawai electronic piano. The Kawai has midi outputs, so as an experiment I've been recording some of my rambling piano compositions. I'll explain how I got these into a nice digital format using just a dead cat and a length of garden string.

The starting point is a midi piano, some free time and a Linux laptop, and a midi-to-USB cable from Yamaha that costs $50. Plug in the cable and you're ready to go. On Linux instead of buying a large all-in-one studio application, you take various smaller applications and tie them together. It's easier than it sounds.

The cable that ties your pieces together is called Jack, and the GUI I use is QJackCtl. You can experiment with the Connect window but the place to go is the Patchbay. Create a patchboard with all your input plugs and output plugs and you can connect pieces together nicely.


The app that records midi is Rosegarden. It's nice though my installation crashes if it can't find Jack. I restart one or the other and it works. First thing to do in Rosegarden is go to Studio / Manage metronomes and switch off the metronome. Save your studio.

Recording is easy, I don't think I changed any settings. You can edit tracks after you record them but my pieces were all single takes. Rosegarden does a whole lot but I'm using it just for midi recording and playback.

Next app is Qsynth, a front end for Fluid. You plug the midi output from Rosegarden into Qsynth/Fluid's input port, then you plug Qsynth's output to the system speakers. Now you can playback in Rosegarden and you'll get sound coming out of your speakers. Or, you can plug Rosegarden back into your midi piano, and it will play back your recording.

Next up is a WAV recorder. I use qarecord, and start it from the command line with "—jack" as argument so it shows on my patchboard. Plug that into the output of Qsynth, and now you can record WAV files. Qsynth uses soundfonts; by default a Yamaha piano which is quite nice. You can adjust the synthesizer effects to please.

Doing all this right gives a nice fat WAV file. Next step is "lame somefile.wav somefile.mp3", which gives me an MP3 I can upload and share. I also save the Rosegarden workspace, and the recordings as midi files, for later.

It took me a few hours to get this working. There are a few weirdnesses, e.g. when you run Jack, apps that use sound can randomly block. This Youtube video kept blocking after 4 seconds. Finally I killed Jack and it continued playing. But on the whole, Linux is really fantastic for this and I love the concept of wiring together your own studio out of different pieces.

You can hear the "Moving Pieces" set on SoundCloud.


Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License