Overdubbing and Monitoring Tracks in Ecasound
This article outlines the optimal command-line workflow for overdubbing new audio tracks while monitoring existing takes in Ecasound. By configuring separate processing chains for playback and recording, managing buffer sizes for low latency, and leveraging interactive mode, you can record new layers in perfect synchronization with your backing tracks.
Understanding the Chain Architecture
Ecasound processes audio using chains. To overdub, you must assign playback files and recording inputs to different chains running within the same chainsetup. This ensures that the recording starts at the exact sample the playback begins, maintaining phase accuracy and synchronization.
- Playback Chain (
-a:play): Directs the existing take from a file to your audio interface output. - Recording Chain (
-a:rec): Captures the live signal from your interface input and streams it directly to a new file.
The Basic Overdub Command
To play an existing take (take1.wav) while recording a
new take (take2.wav), open your terminal and run:
ecasound -B:rt -r -a:play -i:take1.wav -o:alsa -a:rec -i:alsa -o:take2.wavKey options used in this command include:
-B:rt: Sets the buffer mode to real-time, reducing latency between inputs and outputs.-r: Raises the scheduling priority to real-time to avoid buffer underruns (xruns).-a:play: Defines the playback chain routingtake1.wavto your ALSA sound output.-a:rec: Defines the recording chain capturing the ALSA input totake2.wav.
Configuring Live Monitoring
There are two primary ways to monitor your performance while overdubbing:
1. Hardware/Direct Monitoring (Recommended)
The most reliable method to eliminate latency entirely is to monitor
your input signal via your audio interface's direct monitoring switch or
internal mixer. In this scenario, the command above is all you need, as
only the backing track (take1.wav) passes through the
software to your headphones.
2. Software Monitoring
If you must monitor through Ecasound (for instance, to hear real-time software effects or if your hardware lacks direct monitoring), route the live input to both the disk and the output simultaneously:
ecasound -B:rt -b:128 -r \
-a:play,mon -o:alsa \
-a:play -i:take1.wav \
-a:rec,mon -i:alsa \
-a:rec -o:take2.wavIn this setup, the -b:128 parameter sets a low buffer
size (128 sample frames) to minimize audible delay. The mon
chain takes the incoming audio and routes it directly to the ALSA output
alongside the playback track.
Streamlining the Workflow with Interactive Mode
Invoking a new command for every take is inefficient. Use Ecasound’s
interactive mode by adding the -c flag:
ecasound -c -B:rt -r -a:play -i:take1.wav -o:alsa -a:rec -i:alsa -o:take2.wavOnce inside the interactive prompt, manage your takes using standard control commands:
start: Begins simultaneous playback and recording.stop: Halts the transport.setpos 0: Rewinds the playback and recording heads back to the beginning.aio-register: Updates inputs and outputs if you choose to rename the destination file for another take.
To record another take without exiting, adjust the output file with:
-a:rec
-o:take3.wav
setpos 0
start
Low-Latency Optimization with JACK
For complex sessions involving multiple tracks, replacing the native
ALSA engine with JACK (-i:jack, -o:jack)
provides lower round-trip latency and allows dynamic routing to other
digital audio software. Set the JACK server to a low frame size (such as
64 or 128 frames) prior to launching Ecasound to achieve seamless,
zero-distraction overdubbing.