Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 2616 - Labelled Audio Cut and Delete disabled by Sync-Lock
Labelled Audio Cut and Delete disabled by Sync-Lock
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: Application Core
3.0.0
All All
: P2 RepeatableAll
Assigned To: Default Assignee for New Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-12-30 06:31 UTC by Peter Sampson
Modified: 2021-01-21 10:33 UTC (History)
8 users (show)

See Also:
Steps To Reproduce:
1) Get some audio 2) range label some sections 3) Edit>Labeled Audio 4) make a selection in the label track that covers all or some of step 2's labels 5) Observe Cut and Delete are black and usable 6) Turn on Sync-Lock 7) Observe: Cut and Delete are grayed-out and un-usable
Release Note:
Group: Labeled Audio *When Sync-Lock is "on" the two commands: Edit>Labeled Audio>Cut and Edit>Labeled Audio>Delete are grayed-out and unavailable.
First Git SHA:
Group: ---
Workaround:
To use these commands on Labeled Audio, turn off Sync-Lock, but not carefully that they will only act on the audio and not the label track thereby losing synchronization between the audio and the label track.
Closed: 2021-01-21 00:00:00
petersampsonaudacity: Regression+
petersampsonaudacity: Test‑OK‑Win+
petersampsonaudacity: Test‑OK‑Mac+
stevethefiddle: Test‑OK‑Lin+


Attachments
Sample project (1.64 MB, application/x-gzip)
2021-01-17 07:02 UTC, Leland Lucius
Details
Sample project (1.64 MB, application/x-zip-compressed)
2021-01-17 07:07 UTC, Leland Lucius
Details
Delete labeled audio before the delete (62.51 KB, image/png)
2021-01-17 15:19 UTC, Peter Sampson
Details
Delete labeled audio after the delete (44.53 KB, image/png)
2021-01-17 15:23 UTC, Peter Sampson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Sampson 2020-12-30 06:31:29 UTC
When Sync-Lock is "on" the two commands 
> Edit>Labeled Audio>Cut  or   
>Edit>Labeled Audio>Delete
Are grayed-out and unavailable.


This contrasts with the situation when Sync-Lock is "off" whereby these commands can operate on the labeled audio - but note carefully that they only operate on the audio in this case and not the label track, thereby losing sync between remaining audio and labels. 
This is expected and documented behavior: https://alphamanual.audacityteam.org/man/Edit_Menu:_Labeled_Audio


It would make better sense, and be more consisitent, if when Sync-Lock is "on" that the Labelled Audio Cut and Delete commands were available and usable - and would retain synchronization by cutting / deleting from both the audio track and the Label track.

----------------------------------------------------------------------

This ENH is the end result of a longish email discussion on the Quality thread.
There David Bailes pointed out that 10 years ago Al Dimond had resonded to Bill regarding tghis:
https://sourceforge.net/p/audacity/mailman/message/26197598/

Steve and I do not agree with that earlier statement.
Comment 1 Peter Sampson 2020-12-30 09:12:34 UTC
Technically this is a regression on 1.3.6

In 1.3.0 there was no Edit > Labeled Region command
In 1.3.2-1.3.5  I see Edit > Labeled Region command- there is no Sync-Locking
Edit > Labeled Region> Delete   just deletes the audio and not the labels

--------------------------------------------------------------

In 1.3.6 we temporarily introduced sync locking, but it wasn't called that it was
Tracks > Link Audio and Label Tracks
a) there is no visual cue - no chains, no clocks
b) it always defaults to "on" every time you relaunch

But 1.3.6 exhibits the behaviors that Steve summarized in the quality email thread and I wrote up in the bug thread in Comment #0

i) with that "Link..." set "on" - then Edit > Labeled Region> Delete/Cut deletes both the audio and the labels - maintaining sync

ii) with that "Link..." set "off" -  then Edit > Labeled Region> Delete/Cut deletes just the audio and loses sync

-------------------------------------------------

1.3.10-1.3.13 (I do not have 1.3.8 or 1.3.9) the Tracks > Link Audio and Label Tracks is missing, removed.


1.3.14 proper Tracks > Sync-Lock Tracks gets introduced
i) with Sync-Lock "off" (default) -  then Edit > Labeled Region> Delete/Cut deletes just the audio and loses sync
ii) with Sync-Lock set "on" -  then Edit > Labeled Region> Delete/Cut  are both grayed-out and inoperable

This behavior obtains all the way through to 2.4.2 and alpha 3.0.0
The only change being that in 2.0.3 and onwards  Edit > Labeled Region...  was changed to   Edit > Labeled Audio... 


So this is thus a regression on the behaviors in 1.3.6 - and in that version it was possible for the user who wanted to maintain sync between audio and label tracks when using Labelled Regions/Labelled Audio commands could do so by turning on Sync-Lock.  And thus I believe we should restore this behavior and not just gray-oy the Labeled Audio>Cut/Delete commands when Sync-Lock is "on".
Comment 2 Peter Sampson 2020-12-30 09:13:05 UTC
And raised to P2 due to the regression.
Comment 3 Leland Lucius 2021-01-16 08:33:30 UTC
I've committed a change in:

https://github.com/audacity/audacity/commit/086caca

All it does is allows those two menu items to be enabled if sync-lock is turned on. I just wanted to get it enabled so you guys can have a go.

However, when sync-lock IS on, I do not believe the "cut" or "delete" actions are working as you guys expect.

I'll try to follow the QA thread, but some guidance on what is desired would be helpful.
Comment 4 Leland Lucius 2021-01-16 09:00:17 UTC
Nevermind, I understand what's expected. I'll see if I can make it work as desired.
Comment 5 Peter Sampson 2021-01-16 10:33:09 UTC
(In reply to Leland Lucius from comment #4)
I was just about to start work on this - but on the basis of your comment, Leland, I'll hold off till you've worked on the "FIX"
Comment 6 Leland Lucius 2021-01-17 07:02:22 UTC
Created attachment 1050 [details]
Sample project

(BTW: Much easier to attach sample projects now.)

Notice in the sample project that ONLY the 1st label track is selected.

Near as I can tell, none of the "Labeled Audio" items take into account Sync-Lock'd tracks. Open the unmodified project and select "Split Cut" from the "Labeled Audio" menu. Notice that audio from both audio tracks was cut.  

Shouldn't that be just from the 1st audio track or rather all audio tracks in the selected Sync-Lock'd group?
Comment 7 Leland Lucius 2021-01-17 07:04:50 UTC
Comment on attachment 1050 [details]
Sample project

Replacing with uncompressed version.
Comment 8 Leland Lucius 2021-01-17 07:07:10 UTC
Created attachment 1051 [details]
Sample project

Well, the plan was to attach an uncompressed version, but it's too big, so here's a zip'd version.
Comment 9 Leland Lucius 2021-01-17 08:32:33 UTC
(In reply to Leland Lucius from comment #6)
> Created attachment 1050 [details]
> Sample project
> 
> (BTW: Much easier to attach sample projects now.)
> 
> Notice in the sample project that ONLY the 1st label track is selected.
> 
> Near as I can tell, none of the "Labeled Audio" items take into account
> Sync-Lock'd tracks. Open the unmodified project and select "Split Cut" from
> the "Labeled Audio" menu. Notice that audio from both audio tracks was cut.  
> 
> Shouldn't that be just from the 1st audio track or rather all audio tracks
> in the selected Sync-Lock'd group?

I think the normal "Edit -> Remove Special -> Split Cut" does this correctly. It only processes the tracks within the selected sync-lock group(s). (This goes for the rest of the "normal" Edit items as well.)
Comment 10 Peter Sampson 2021-01-17 15:19:05 UTC
Created attachment 1052 [details]
Delete labeled audio before the delete

Well strictly speaking the bug as described is fixed, as with Sync-Lock on the two commands Edit>Labelled Audio>Cut and Edit>Labelled Audio>Delete are no longer grayed out and can be used to make deletions.

Whether they do what we want when Sync-Lock is on is another matter ...

See my attached image her with two labelled sections selected in the label track just before using Edit>Labelled Audio>Delete.

You'll need the next comment and attachment to see the result
Comment 11 Peter Sampson 2021-01-17 15:23:16 UTC
Created attachment 1053 [details]
Delete labeled audio after the delete

This is the follw-on from Comment #10

Here we observe that indeed the "labelled audio" has been deleted.

BUT the related label track which is 
a) sync-locked 
b) selected
is left untouched.

You might argue that strictly speaking the command has done "what it says on the tin" as it has deleted "labelled audio" - no mention in the command of related labels.

However this flies in the face of sync-locking.

If we want to maintain the behavior this way and are happy with it then I can document it - but it looks a bit odd to me.
Comment 12 Peter Sampson 2021-01-17 15:25:00 UTC
I do like the way that if part of the selection is over only part of any of the labeled audio chunks then the Edit>Labeled Audio commands are all grayed out and inaccessible, including the Cut and Delete.
Comment 13 Peter Sampson 2021-01-17 15:31:26 UTC
(In reply to Peter Sampson from comment #11)
In contrast if you make the same selection as in the image in the attachment in Comment #11  (just selection in the label track - but sync-lock clocks in the audio) and then use Edit>Cut or Edit>Delete

The the Sync-lock is honored and the deletion is made from both the label track and the audio track - thus keeping the two tracks in sync (particularly) the label "4" and its associated audio - the reverse chirp.

This is why I think the behavior in Comment #11 is wrong - it is not consistent.
Comment 14 Leland Lucius 2021-01-19 21:40:28 UTC
Further changes committed in:

https://github.com/audacity/audacity/commit/26d8fcad66479754b1481b4136022379d2240030

These address the residual of the Label Audio items not acting the way they should. Please give each a try with and without sync-lock enabled.

The only difference you should see with sync-lock enabled and not enabled is that all tracks in a sync-lock group, even it not specifically selected, will be modified.  With sync-lock disabled, only the selected tracks will be modified.

In both cases, selected labels still control what portions of a track get modified.

(At least, I hope that's the way everything works.  :-))
Comment 15 Peter Sampson 2021-01-20 10:07:20 UTC
(In reply to Leland Lucius from comment #14)
Testing on W10 with Audacity 3.0.0 f2abbce
Testing using my project from Comment #10

It now works properly when Sync-Lock is set "on", with both the labelled audio and its associated labels being deleted.


But when Sync-Lock is "off a major issue has been introduced.

a) when selection is made in the label track and in the audio, then both labels and audio are deleted (I think this is probably fine - and better than what used to happen in 2.4.2 and earlier where only the audio was deleted and the labels were left untouched - if you want to just delete audio and leave labels then you can select the audio and use the normal Cut and Delete commands).

b) BUT if you select in just the label track and use the labelled audio cut or delete then it is the labels in the label track that are deleted and not the audio.  This is wrong.

c) If you  select in just the audio and use Edit>Labeled Audio
you will observe that the commands are all grayed out, including the Cut and Delete.  This was always the case previously (in 2.4.2 and previous 3.0.0 alphas)


So:
a) is, I think, an improvement
c) stays the same
b) is a serious residual bug that has been introduced and MUST be fixed.
Comment 16 Leland Lucius 2021-01-20 15:35:31 UTC
(In reply to Peter Sampson from comment #15)
> b) BUT if you select in just the label track and use the labelled audio cut
> or delete then it is the labels in the label track that are deleted and not
> the audio.  This is wrong.
> 

If sync-lock is off and you have only labels selected, which audio should it delete?  With it off, there's basically no sync-lock groups, so should it just automatically delete from all audio tracks?
Comment 17 Leland Lucius 2021-01-20 16:47:45 UTC
Try this commit on for size:

https://github.com/audacity/audacity/commit/235cc24
Comment 18 Leland Lucius 2021-01-20 17:34:39 UTC
Don't test this yet.  My brain kicked in while in the shower and this is (slightly) incorrect.  "Final" fix coming soon.
Comment 19 Leland Lucius 2021-01-20 18:35:14 UTC
Okay, now give it a try:

https://github.com/audacity/audacity/commit/e8b2602
Comment 20 Steve Daulton 2021-01-20 20:26:18 UTC
(In reply to Leland Lucius from comment #19)
Looks good on Linux.
Comment 21 Peter Sampson 2021-01-21 10:33:21 UTC
(In reply to Leland Lucius from comment #19)
Tested on W10 and macOS 11.1 with Audacity 3.0.0 b5ee77f

This now looks good to me on both platform.

1) with sync-lock OFF
a) Audacity deletes all audio in all tracks within the selected label ranges
b) all label tracks are left untouched, including the selected labels


2) with sync-lock ON
a) only the audio tracks in the SLTG(s) are deleted - all other audio tracks are unchanged
b) the selected labels in the label track(s) for the STLG(s) are deleted, thereby maintaining sync in the SLTG(s) between audio and labels.
c) multiple SLTGs can be selected - each is operated on independently.

I will take a further look at the Manual to ensure that these behaviors are properly explained.