New : this blog now accepts comments without being logged in, without creating account, and even anonymous comments ! Please tell us what you think !

Wednesday, August 27, 2008

Writing and recording a song using Seq24, Zynaddsubfx, Hydrogen and Ardour

License of this post.

When I started to try to make music on Linux, I gave a try to Wired and Lmms. But I could not manage to install Wired, and Lmms 4 beta was too unstable to be usable, at least on my system. Then I started to investigate on how to make music on Linux the hard way, by connecting audio softwares trough the jack daemon. I've found some useful links, so I made this short tutorial. It's about Seq24, but you may want to use Muse instead.


Here we go. First you need a realtime kernel along with jackd and it's user control GUI. Refer to this post.

Start Qjackctl with

qjackctl &

You can then click on the Start button to start jackd. Your linux station is now set up to play music.

Now we can begin to write our song.


(I will only give short instructions. You may want to prefer to refer to this tutorial on the ubuntu documentation if you get a bit lost).

(from now this document is an adaptation from this tutorial by The Ubuntu Community Documentation).

Install Zynaddsubfx, Seq24 and Hydrogen with the command :

sudo apt-get install seq24 zynaddsubfx hydrogen

Then enter the following command :

seq24 --manual_alsa_ports & zynaddsubfx -r 48000 -b 128 & hydrogen -d jack &

Click on the "Connect" button of QJackctl. Check on the "Audio" tab that Zynaddsubfx and Hydrogen outputs are connected to ALSA's PCM input.

On the ALSA tab, connect Seq24 first output to Zynaddsubfx's input, and connect Seq24 second output to Hydrogen's input.

Select an instrument in Zynaddsubfx in the Instrument>Show Instrument Bank menu. Then set the MIDI channel of Zynaddsubfx to 2 (It currently shows "1"). Select another instrument for the second midi channel. Repeat the operation for a third instrument.

Right-click in Seq24's grid and choose new. You will get a sequence edition window. You can adjust the length of the sequence, which is by default 1 bar.Let's tell Seq24 we want to play on the Hydrogen rhythmbox :
In the Output Bus menu left to the field that shows "[1] seq24 1" and set it to "[2] seq24 2". Remember we connected Seq24's second midi output to Hydrogen.

There's three MIDI buttons in the down left corner of the window. Click on the first one to tell Seq24 to send midi events to Hydrogen. You can now edit your pattern by holding right-mouse's button and left-clicking to paste notes. You can adjust their length with the field next to the sequence length. You can click on the piano keyboard to ear how each note sounds. Hydrogen set's runs from C2 to D#3. Press "Play" to listen to your sequence.

Once you have a Drum sequence, you can repeat theses steps to add our three Zynaddsufx's instruments. Just select the first Output Bus for the sequence (we connected the first seq24 output to Zynaddsubfx already). To select one of the three Zynaddsubfx instruments, click on the button showing a MIDI plug next to the Output Bus field and select one from 1 to 3.

Once you have some sequences, you can use them to compose the song : on the main Seq24 windows, there's a 'Song Edition' button in the right down corner. Click on it. In the new window, you can click the same way that in the sequence windows to draw song sequences. Click on "Play" to play your song.

(end of the adaptation from the document from The Ubuntu Community Documentation).

In a few time I had a basic song with a drum sequence and four Zynaddsubfx tracks. The question is now : how to record it ? Enter the following command to install the Ardour multitrack recording software :

sudo apt-get install ardour

Launch Ardour and create a new project. Insert two new audio tracks in Ardours. In the "Audio" tab of the QJackctl "Connect" window, connect Hydrogen's and Zynaddsubfx's audio outputs to your Ardour's tracks audio inputs, one instrument per track.

You can then press "Record" in Ardour and "Play" in Seq24 to record your song. You can then export it to .wav using Ardour's export function.

(If you are using many other synths besides Zynaddsubfx, you may end with recording glitches and synths that start late, especially on low-end hardware. To avoid this you can :

-add four bars of silence at the beginning of your song
-minimize all windows while recording
-record several synths on a single track, since multitrack recording can be heavily resource-consuming. To do so, just connect several synth audio outputs in qjackctl to the same ardour input.)

I used then Audacity to generate a fade ending, and lame to encode the song in mp3 format. You can install them with

sudo apt-get install audacity lame

Happy music making !

3 comments:

helios said...

Great! Thanks! But as most of Linux audio tutorials, there is a lack of images explaining how tos. I find your blog very helpful, but it would have been a lot better with pictures.

Nico said...

Thank you very much for your comment, which is the very first one posted in more than two years.

This blog hasn't seen an update for years. It is now a bit outdated. I'd strongly recommend to consider using LMMS now, this software is now very usable and useful. You can get it from the repositories in many Linux distributions.

I've been pretty busy with some other projects (mainly creating music), and did not work much on this blog, that is only a quickly made one. As you say, with pictures it would be a lot better. From time to time I think about making a LMMS tutorial with pictures, but I'm lacking time and (essentialy) motivation.

If you want to take a listen to my work, you can get some songs from Still Living Creature, which is my electro project, here, but the first 4 Still Living Creature releases, and the 2010 Still Living Creature EP 'Lost Tracks EP', weren't made with Linux - also, the Me In The Bath releases, and my solo "career" albums, were made with Linux too, but this ain't no electronic music.

Thanks again for your nice comment.

Nico said...

oops sorry I was wrong two releases among my solo career, namely 32kbps Tales Volume 1 & Volume 2 weren't made with Linux.