Page 1 of 2
Best way to move some labels to another label track
Posted: Tue Nov 20, 2012 3:56 am
by pshute
I've got three long label tracks full of labels and I'd like to merge them into one. I can copy and paste sections of them from track to track, but it will overwrite any already there.
I can export them and reimport them, but the label export function doesn't include information about which track they're in, and there are other tracks I don't want merged.
All I can think of is to edit the aup file.
If I do that, will audacity mind if they aren't in chronological order, or will I have to sort them?
Is there any other way?
Re: Best way to move some labels to another label track
Posted: Tue Nov 20, 2012 8:13 am
by Gale Andrews
pshute wrote:I've got three long label tracks full of labels and I'd like to merge them into one. I can copy and paste sections of them from track to track, but it will overwrite any already there.
What do you mean by overwrite? Have you dragged the label track down to see all the labels? See below for the one case where I do see a pasted label replacing another.
Are you pasting audio with the labels, or just the labels as I assume?
The problems I see with merging labels (without audio) between tracks is that:
- There is no really easy way to move a single point label
- If you select over a label or group of labels to cut or copy them, the length of the selection is taken into account, and so doesn't paste the labels where you click.
pshute wrote:All I can think of is to edit the aup file.
If I do that, will audacity mind if they aren't in chronological order, or will I have to sort them?
From a quick test, Audacity doesn't mind when you open a project if the first listed label in the AUP file is at a later timeline position than the next listed one.
pshute wrote:Any other way?
If you want to merge a group of labels by moving them from one label track into another label track, without affecting the labels in the track you are moving into, I think you can do the following (it works for region or point labels):
- In the label track, click above the left edge of the first label so you see the yellow Snap To Guide (take care not to click the triangle or circle handles)
- Drag to the last label until you see the Snap To Guide, then release (if it's a region label, drag to the right edge of the label)
- Edit > Remove Audio > Cut
- Click in the label track at the point you want to paste, then Edit > Paste.
If you want to move the labels to right of the paste point by the length of the paste, press the Sync-Lock Tracks button in Edit Toolbar before pasting.
Now, the problem (a bug I think). If in step 4 you click to paste where an existing point label is, the point label is removed. This occurs if you paste a point or a region label, but does not occur if you paste at either border of a region label.
Gale
Re: Best way to move some labels to another label track
Posted: Tue Nov 20, 2012 9:07 am
by steve
You could use:
Tracks menu > Edit Labels.
Click once on the track name (second column) to select the one that you want to change, then click again to select which track you want from the list that will appear.
Another way to move all labels to one track is to export the labels (File menu > Export Labels) then import them again (File > Import > Labels). This will create a new label track containing all of the previous labels. To exclude some label tracks from the export, delete those tracks, then export, then Undo the deletion(s).
Re: Best way to move some labels to another label track
Posted: Tue Nov 20, 2012 9:44 am
by waxcylinder
pshute wrote:I've got three long label tracks full of labels and I'd like to merge them into one. I can copy and paste sections of them from track to track, but it will overwrite any already there.
I can export them and reimport them, but the label export function doesn't include information about which track they're in, and there are other tracks I don't want merged.
I just did some experimentation and see what you mean about cut&paste and overlap
So I did some further experimentation
(based on Steve's suggestion above) ...
OK try this:
1) Select the just the label tracks that you want to merge
2) use File > Export Labels to export the set of labels to a .txt file
3) open the .txt file in Excel - you will see all the required labels,
but "not necessarily in the right order"
4) Sort the data set in Excel by column A ascending (this is the time data) -
all labels will now be in correct time order
5) Save the file (this will update the .txt file and not create a .xls file)
5) Go back to Audacity and use File > Import > Labels to import the sorted label set
6) delete the unwanted label tracks
If you are hyper-confident you can minimize clicking by deleting the selected label tracks immediately after step 2
WC
Re: Best way to move some labels to another label track
Posted: Tue Nov 20, 2012 11:15 am
by Gale Andrews
waxcylinder wrote:I just did some experimentation and see what you mean about cut&paste and overlap
OP said "overwrite" rather than overlap, so we'll have to wait for OP's reply.
But apart from the paste result looking confusing if you paste inside existing labels (or you aren't zoomed in), did you find anything that definitely seemed to be wrong?
Gale
Re: Best way to move some labels to another label track
Posted: Tue Nov 20, 2012 11:44 am
by steve
Gale Andrews wrote:
But apart from the paste result looking confusing if you paste inside existing labels (or you aren't zoomed in), did you find anything that definitely seemed to be wrong?
Testing on Linux, when pasting labels into a label track that already contains labels, the result seems wrong (unpredictable).
I'm not quite sure what is going on there, but to get the labels to paste correctly,
1) Select the destination label track
2) Press the "Home" key
3) Paste the labels.
Re: Best way to move some labels to another label track
Posted: Tue Nov 20, 2012 1:50 pm
by waxcylinder
Gale Andrews wrote:waxcylinder wrote:I just did some experimentation and see what you mean about cut&paste and overlap
OP said "overwrite" rather than overlap, so we'll have to wait for OP's reply.
But apart from the paste result looking confusing if you paste inside existing labels (or you aren't zoomed in), did you find anything that definitely seemed to be wrong?
But OP also said that they wanted to "merge" the label tracks.
Cut&Paste does not produce a merge - whereas the technique I posted does
In fact cut and paste produces erroneous results - steps to replicate (Audacity 2.0.3
1) Generate 12 seconds of audio
2) create a label track and label the odd seconds 1,3,5,7,9
3) create a second label track and label the even seconds 2,4,6,8,10
4) select the second label track and use Copy to make a copy of it
5) select the first label track and use Paste
6) all odd number labels are "lost" leaving only 9, incorrectly positioned at Time=0
That's what I meant by "overlap" - in fact it's more serious than that.
Update: however if at step 5 you:
5) select the first label track
6) then move the cursor to Time=0 (first label track remains focussed but no longer slected)
7) use paste
8) The labels are interleaved correctly
So the problem appears to be when the first label track is selected but no cursor position exists to initiate the start of the paste (you can start the past from any cursor position in the timeline and thga seem to work ok - but for a true "merge" as per the OP's request then cursor at T=0 is required).
And this is simpler than my previous workaround recipe
Peter.
Re: Best way to move some labels to another label track
Posted: Tue Nov 20, 2012 1:57 pm
by steve
waxcylinder wrote:In fact cut and paste produces erroneous results - steps to replicate
1) Generate 12 seconds of audio
2) create a label track and label the odd seconds 1,3,5,7,9
3) create a second label track and label the even seconds 2,4,6,8,10
4) select the second label track and use Copy to make a copy of it
5) select the first label track and use Paste
6) all odd number labels are "lost" leaving only 9, incorrectly positioned at Time=0
That's what I observed on Linux too.
Workaround:
Before pasting the labels, press the "Home" key.
Re: Best way to move some labels to another label track
Posted: Tue Nov 20, 2012 2:02 pm
by waxcylinder
@Steve: you were typing while I was updating my post - see the update
I suspect that this is a bug?
Peter
Re: Best way to move some labels to another label track
Posted: Tue Nov 20, 2012 2:22 pm
by steve
Actually the behaviour has been the same since at least 1.3.14, but it looks a bit weird since the option for "Retain Labels if selection snaps to a selection edge" was introduced.
Turning off the option:
"Edit > Preferences > Interface > "Retain Labels if selection snaps to a selection edge"
makes the behaviour the same as in 1.3.14 and it is easier to see what the limitation is.
As with audio, pasting over a selection will replace the current selection.
Unlike audio tracks, pasting at a specific point (not a selection), the labels will be merged with any existing labels.
The slight weirdness that occurs when clicking on a track to select it, is because by default the final label is not included in the selection, so it is not replaced.
I don't think this is a bug. I think it is an undocumented feature that looks odd.