A Basic Text-Based Recording Studio

Shrinkwrapped audio gear too expensive? Too inflexible? Perhaps not geeky enough? Why not use a Linux box as the main workhorse in your studio?
Overdubbing of Subsequent Tracks

Unless you're recording a live stereo track, you're likely to want to overdub other tracks. It is possible to use Ecasound to listen to tracks you've already recorded while recording (and listening to) a new track.

To listen to an already-recorded track while recording a second track, create three Ecasound chains (Table 2).

Table 2. Chains for Listening to an Already-Recorded Track While Recording a Second Track

ChainInput SourceOutput Destination

Creating a chain setup like this causes the contents of track1.wav to be sent to JACK to be played, and any input from JACK is sent back to JACK and saved to a file called track2.wav. track2.wav will contain only the new track—not the new track mixed with the old track. We'll mix them later.

Converting this chain setup to an actual Ecasound command is straightforward:

ecasound -c -b:64 \
-a:1 -i track1.wav \
-a:2,3 -i jack_auto \
-a:1,2 -o jack_auto \
-a:3 -o track2.wav

Recording further tracks is a similar process. We create a chain for each of our already-recorded tracks and set their output to JACK. We also set up two chains to take input from JACK and send it to a file and back to JACK, so we can hear it. The chain setup in Table 3 would suffice.

Table 3. Chains for Recording More Tracks

ChainInput SourceOutput Destination

This chain setup translates into the following Ecasound command:

ecasound -c -b:64 \
-a:1 -i track1.wav \
-a:2 -i track2.wav \
-a:3,4 -i jack_auto \
-a:1,2,3 -o jack_auto \
-a:3 -o track3.wav

Recording a Software-Based Sound Source

I'm not a drummer, but some of the things I record need drums. Although the Hydrogen drum machine is probably the best that I have seen on Linux, it hasn't yet attained the magical 1.0 version number and isn't yet perfect. One feature that's broken in the snapshot I'm running is the ability to export to a PCM audio .wav file. As luck, or rather good design, would have it, Hydrogen can use JACK to output digital audio.

To use JACK and Ecasound to record the output of an audio application such as Hydrogen, we can perform the following steps:

  1. Configure Hydrogen to use JACK for its output.

  2. Configure Hydrogen to play in song mode, as opposed to pattern mode.

  3. Execute the the following command:

    ecasound -a:1 -i jack_auto -o drum_track.wav -G jack,ecasound,recv

  4. Click the play button in Hydrogen.

The above command configures a single chain within Ecasound that draws input from JACK and sends output to a file called drum_track.wav. The -G jack,ecasound,recv instructs Ecasound to listen to JACK for a start command, which is sent when we click the Play button in Hydrogen, as a JACK client called ecasound.

It can take a second or so for Ecasound to start and initialise after receiving the start command, so I like to have a pattern of silence at the start of the Hydrogen track.

Unless you have impeccable timing, you would most likely record any software sources first. It is harder to synchronise a software source, such as a drum machine, with an existing human-recorded track than is is to record the human tracks around the machine-created tracks. This includes any MIDI tracks you intend to use.

Mixing All Tracks to a Single Stereo Master

At this point, we have a series of .wav files that correspond to each of the audio tracks we have recorded. Should we need to, we could use Ecasound, SoX or even Audacity to add effects or make minor corrections or alterations to any of the tracks. Once we're happy with the individual tracks, we can mix a single master track.

The process of turning our multiple tracks into a single stereo master track is straightforward. We create a chain for each track and set the output to be a .wav file.

Table 4. Turning Multiple Tracks into a Single Stereo Master

ChainInput SourceOutput Destination

Ecasound provides a means to make this particular case easier. The all pseudo-chain name can be used to redirect the output of all of our tracks to a single place, namely a file called all_tracks.wav:

ecasound -a:1 -i track1.wav \
-a:2 -i track2.wav \
-a:3 -i track3.wav \
-a:all -o all_tracks.wav

To listen to the result, enter:

ecasound -a:1 -i all_tracks.wav -o jack_auto

It is also possible to write the master directly to the sound card without writing to a file first:

ecasound -a:1 -i track1.wav \
-a:2 -i track2.wav \
-a:3 -i track3.wav \
-a:all -o jack_auto

You also can attach a series of effects, including reverb, compression and amplification to each chain before it is written to the output destination. It is even possible to add delay and alter the panning of a particular track or even perform noise reduction; however, such topics are beyond the scope of this article.


One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix