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

Audacity Bugzilla



Bug 826 - Mis-handling of envelopes when split-deleting, or when cutting with cut lines enabled
Mis-handling of envelopes when split-deleting, or when cutting with cut lines...
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: Application Core
2.1.0
Per OS All
: P4 RepeatableAll
Assigned To: Default Assignee for New Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-01-15 17:33 UTC by Paul L
Modified: 2019-06-25 09:40 UTC (History)
5 users (show)

See Also:
Steps To Reproduce:
New project. Generate 2 s of white noise. Use multi-tool. Make two envelope control points, one near the start, another near the end. View in Waveform dB. Drag the right point down so the envelope of the noise drops to about -60 dB. 1) Turn off "Enable cut lines" in Preferences. Select a middle portion. Cut with ctrl-x. Observe results. The envelope drops discontinuously where the cut was. This makes sense. Undo. 2.1) Turn on "Enable cut lines" in Preferences. 2.2) Now Cut. Different envelope from the last! No discontinuity! Inconsistent! 3) Expand the cutline with left click. The envelope is not restored to its original state! 4) Undo twice. Now split-cut (ctrl-alt-k). The envelope loses its slope! Now you get two different, level envelopes in the two clips. (Do it with or without the cut lines preference, results are alike.) 5) Undo and Trim (ctrl-T). Wrong result. Note that Delete (not Cut) works right regardless of the preference. Also splitting a clip (ctrl-I) works right. The things that work right should be verified again with any fix.
Release Note:
First Git SHA:
Group: Envelope
Workaround:
Closed: 2019-06-25 00:00:00
petersampsonaudacity: Test‑OK‑Win+
petersampsonaudacity: Test‑OK‑Mac+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul L 2015-01-15 17:33:41 UTC

    
Comment 1 Paul L 2015-01-16 11:19:27 UTC
The fix might be entirely in Envelope::CollapseRegion. It is used in WaveClip::Clear and WaveClip::ClearAndAddCutLine and nowhere else.
Comment 2 Paul L 2015-01-17 14:05:32 UTC
Now I think there should be more to the fix than that.

WaveTrack.cpp takes care to insert extra control points when needed for splitting of clips, deletion, and cut without cut lines.  It neglects to do this in other cases.

However, I think it should be the reponsibility of WaveClip::Clear() to do this.  Such code should not be in WaveTrack in several places.

So code should be removed from WaveTrack, and the three named correct cases should be verified as still correct, while the other cases are fixed.
Comment 3 James Crook 2015-01-24 12:16:28 UTC
PX->P4
Comment 4 Peter Sampson 2019-06-24 10:28:41 UTC
Testing on W10 with audacity-2.3.3-alpha-271-d84ab5948d544eec6ba6a648d76d31ef9d5edc88

a) Step 2 is not now inconsistent - it produces the same result as Step 1

b) at Step 3 the envelope is properly restored

c) at step 4 the envelope retains its proper shape either side of the split-cut

d) Step 5 cannot be done as Cut (and Silence) buttons are grayed out and inoperable as are the shortcuts Ctrl+T and Ctrl+L - but that is a different issue to be logged separately

This looks to be fixed for Windows
Comment 5 Peter Sampson 2019-06-24 10:38:08 UTC
On macOS 10.14.5 with 2.3.3 alpha jc001

a) Step 2 is now fine

b) Step 3 does not restore the envelope to its original state

c) Step 4 is now OK - the envelope retains its proper shape either side of the split-cut

d) Trim is available here and produces the correct expected result


Step 3 will need re-testing when I get a more up to date alpha - this Mac alpha is several days older and many commits older that the Windows audacity-2.3.3-alpha-271-d84ab5948d544eec6ba6a648d76d31ef9d5edc88
Comment 6 Peter Sampson 2019-06-24 10:46:15 UTC
(In reply to Peter Sampson from comment #4)
Step d cannot be tested until Bug #2132 is fixed
Comment 7 Peter Sampson 2019-06-25 09:34:47 UTC
(In reply to Peter Sampson from comment #6)
Bug #2132 now works on Windows do Step 5 (d) can bed tested and the Trim (Ctrl+T) works OK as expected

Retested other steps - all still OK
Comment 8 Peter Sampson 2019-06-25 09:40:47 UTC
(In reply to Peter Sampson from comment #5)
I retested on mac)S 10.14.5 with 2.3.3 alpha jc001

and now

b) Step 3 does restore the envelope to its original state

So all is well with this on Mac too



I suspect that yesterday I omitted Step 2.1 - I did the same today when testing initially on W10 - that'ts the problen with mutiple sub-steps in a "step" - so today I teased out Step 2 to 2.1 and 2.2 for clarity