Page 1 of 2

Align tracks end to end

Posted: Thu May 16, 2013 1:45 am
by steve
This topic is in parallel with a discussion on the Audacity QA e-mail list. As most forum users are not on that list I thought that it would be useful to also raise the issue here (and also post some screenshots).

The question of how to join files end to end comes up quite regularly (for example: http://forum.audacityteam.org/viewtopic ... 46&t=72490)
Currently, it is quite awkward to append more than a few audio files. The options are to either import the files and then use the Time Shift tool to move them into position, or there are Nyquist plug-ins (Append Import and Chain it Up), which though quite powerful are not simple to use (mostly due to the lack of a file browser for Nyquist plug-ins and other limitations of the Nyquist plug-in interface).

Audacity is already able to import multiple audio files, but they are arranged one above the other. What is missing is the ability to quickly and easily arrange the imported files end-to-end. This could be accomplished by extending the functionality of "Tracks > Align Tracks" with a new option "Align End to End".
track-menu.png
track-menu.png (63.08 KiB) Viewed 21128 times
To concatenate (join end to end) a number of files:
1) "File > Import > Audio". Select the files that you want to import and they are imported in alphanumeric order, one above the other.
(Note: the ordering may be slightly different between Windows, Linux and Mac)
tracks007.png
tracks007.png (24.59 KiB) Viewed 21128 times
2) If the tracks need to be adjusted in any way, now is a good time to do it - for example you may want to normalize the tracks, or adjust the equalization so that they sound well together, or adjust the track order (by dragging tracks up or down).

3) Select all of the tracks ("Edit > Select > All" Ctrl+A)

4) "Tracks > Align Tracks > Align End to End" and the tracks are immediately aligned end to end:
tracks008.png
tracks008.png (18.85 KiB) Viewed 21128 times
5) (optional) If you want all of the tracks to be merged into a single track - Select All (as before) then "Tracks > Mix and Render" and the tracks will be mixed down into a single track. Note that "Mix and Render can be quite slow with large projects and may not be necessary as tracks are automatically mixed into a single mono or stereo file when the project is Exported.
firsttrack000.png
firsttrack000.png (10.63 KiB) Viewed 21128 times
For anyone that is able to build Audacity from the source code that wants to try out this proposed feature, here is an experimental patch:
AlignTracksEndToEnd-2.patch
(1.93 KiB) Downloaded 284 times

Re: Align tracks end to end

Posted: Thu May 16, 2013 4:46 pm
by steve
After concatenating the tracks, the project becomes much longer, so only a short section of the modified project is visible. Perhaps it would be preferable if "Align End to
End" also zoomed out to fit?

This new patch automatically zooms out to fit the project within the project window after aligning the tracks end to end.
AlignTracksEndToEnd-3b.patch
(1.99 KiB) Downloaded 320 times
To demonstrate the difference between AlignTracksEndToEnd-2 and AlignTracksEndToEnd-3, here is a project with three audio tracks before aligning:
tracks002.png
three tracks selected
tracks002.png (20.66 KiB) Viewed 21101 times

and after aligning with AlignTracksEndToEnd-2
tracks001.png
Only track 1 and the start of track 2 are visible
tracks001.png (16.3 KiB) Viewed 21101 times
and after aligning with AlignTracksEndToEnd-3
tracks003.png
The project is automatically zoomed to fit
tracks003.png (16.46 KiB) Viewed 21101 times
Is this new behaviour of automatically zooming to fit the project preferable?

Re: Align tracks end to end

Posted: Thu May 16, 2013 11:41 pm
by Edgar
steve wrote: Is this new behaviour of automatically zooming to fit the project preferable?
Very helpful patch--I have something similar in my custom build but it adds everything to a single track. I like the terminal zoom-to-fit.

Re: Align tracks end to end

Posted: Fri May 17, 2013 1:12 am
by steve
I've still got a bug affecting stereo tracks - I'm working on it ;) (don't expect the last posted patch to be perfect - it isn't).

Re: Align tracks end to end

Posted: Sun May 19, 2013 2:58 pm
by waxcylinder
Edgar wrote: I like the terminal zoom-to-fit.
+1 me too

Peter.

Re: Align tracks end to end

Posted: Sun May 19, 2013 7:26 pm
by steve
Keeping this topic up to date - the latest patch also fixes a few other minor issues with the Align functions, in particular, the behaviour of label tracks.

The functions "Align with Cursor" and "Align with Selection Start" were identical in all but name, so these have been merged into a single "Align from Cursor / Selection Start" command.
Similarly "Align End with Cursor" and "Align End with Selection Start" have been merged into a single "Align End to Cursor / Selection Start".

Re: Align tracks end to end

Posted: Mon May 20, 2013 10:09 am
by waxcylinder
Perhaps a further option to perform an automated Mix and Render so that the user ends up with a single track would be useful too?

Peter.

Re: Align tracks end to end

Posted: Mon May 20, 2013 10:35 am
by steve
waxcylinder wrote:Perhaps a further option to perform an automated Mix and Render so that the user ends up with a single track would be useful too?
As the sounds will not be overlapping, it would be much faster (and lossless) to "move" the tracks into one track (and delete the empty tracks) rather than "mixing" to create one track. Also, "moving" the clips would maintain the splits between tracks, which would probably be useful.

Any idea how we could work that into the interface?

Re: Align tracks end to end

Posted: Mon Jul 01, 2013 9:31 am
by waxcylinder
@Steve: ami I right in thinking (from past posts on devel/quality) that you are dealing with this? Can I therefore archive this thread?

Peter

Re: Align tracks end to end

Posted: Mon Jul 01, 2013 9:56 am
by steve
waxcylinder wrote:@Steve: ami I right in thinking (from past posts on devel/quality) that you are dealing with this?
I have submitted my code.
Can we keep this here as a reminder for now just so that it doesn't get completely forgotten about?