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

Audacity Bugzilla



Bug 2367 - Change Pitch effect may create spurious clip at end
Change Pitch effect may create spurious clip at end
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: Built-in FX
2.4.0
Per OS All
: P1 RepeatableAll
Assigned To: Default Assignee for New Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-03-21 09:04 UTC by Steve Daulton
Modified: 2020-09-22 06:15 UTC (History)
5 users (show)

See Also:
Steps To Reproduce:
1) Generate a 30 second tone 2) Apply "Change Pitch" -10%, HQ off. 3) Zoom in close on the end of the track. Observe: A: There is a short audio clip beyond the end of the original clip. 4) Generate a 30 second STEREO tone 5) Apply "Change Pitch" -10%, HQ off. 6) Zoom in close on the end of the track. Observe: B: There is a short audio clip beyond the end of the original clip.
Release Note:
First Git SHA:
Group: ---
Workaround:
Closed: 2020-09-22 00:00:00
james.k.crook: Must‑Test‑All‑OS+
stevethefiddle: Regression+
stevethefiddle: Test‑OK‑Win?
petersampsonaudacity: Test‑OK‑Win+
stevethefiddle: Test‑OK‑Mac?
petersampsonaudacity: Test‑OK‑Mac+
leland: Test‑OK‑Lin+


Attachments
unnecessary clip line in 2.2.1 (31.66 KB, image/png)
2020-03-21 10:38 UTC, Peter Sampson
Details
End of waveform after Change Pitch (731.24 KB, image/png)
2020-03-30 23:10 UTC, Leland Lucius
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Daulton 2020-03-21 09:04:20 UTC
Tested on Linux but probably all platforms.

After applying Change Pitch effect, selected audio clips may gain short, or zero length clips at the end. The problem is most noticeable when the HQ setting is not enabled. The problem is most dangerous when using the HQ setting as this is more likely to produce zero length clips which are invisible unless zoomed in to samples.

This is a regression against 2.2.1

As the Change Pitch effect aims to keep the original length of the audio, any "extra" samples returned should be deleted rather than being in a separate clip.
Comment 1 Steve Daulton 2020-03-21 09:07:21 UTC
I've upgraded this to P1 because we know that zero length clips can cause very hard to find problems for users.
Comment 2 Peter Sampson 2020-03-21 10:38:49 UTC
Created attachment 938 [details]
unnecessary clip line in 2.2.1

>This is a regression against 2.2.1

Actually even 2.2.1 seems to have an issue too.  

It adds an unnecessary clip line at the end of where the original audio was.  

The audio in Steve's steps causes a shrinkage in the audio of 180 samples
Comment 3 Peter Sampson 2020-03-21 10:46:51 UTC
(In reply to Peter Sampson from comment #2)
>It adds an unnecessary clip line at the end of where the original audio was.  

And this is a regression on 2.0.5  -   the single extraneous clip line at the end was introduced in 2.0.6
Comment 4 Steve Daulton 2020-03-21 11:00:01 UTC
(In reply to Peter Sampson from comment #2)
This bug is not producible in Audacity 2.2.1 on my (Linux) machine. If the Change Pitch effect returns more or less samples than the selection, the processed audio is trimmed or padded to exactly the same length as the original selection. In my opinion this is the "correct" behavior.
Comment 6 Peter Sampson 2020-03-22 06:59:03 UTC
(In reply to James Crook from comment #5)
Testing on W10 and macOS 10.15.3 with Audacity 2.4.0 a072e21

Works properly on both platforms - no clip is created at the end of the audio when using Change Pitch now.


But testing around shows that Change Speed places an unnecessary Clip line at the end of the changed audio (on Win and Mac)

Change Tempo however does not place such a clip line at the end of the audio.


Do we want to treat Change Speed as a residual here or should I raise a new bug for it?
Comment 7 Peter Sampson 2020-03-22 07:01:54 UTC
(In reply to Peter Sampson from comment #6)
>Change Speed places an unnecessary Clip line at the end of the changed audio

This is a regression on 2.3.3
Comment 8 James Crook 2020-03-22 07:56:31 UTC
*** STEPS UPDATED ***

I fixed Change Speed too, though it should have been reported as a separate bug.

I also fixed Change Pitch for Stereo, which was another residual.  Must test both effects with mono and stereo since this is a P1 bug.

DEVEL - FIX MADE

https://github.com/audacity/audacity/commit/d809745a55b608b0796f9b24ea1a44ff47564368
Comment 9 Peter Sampson 2020-03-22 08:30:54 UTC
(In reply to James Crook from comment #8)
Tested on W10 and macOS 10.15.3 with Audacity 2.4.0 210fc28

Tested
1) Change Pitch
1) Change Speed
1) Change Tempo

with mono and stereo tracks.

All tested OK with no extraneous clip added at the end of the audio.
Comment 10 Leland Lucius 2020-03-30 23:06:41 UTC
I see no extra clips on Linux either.
Comment 11 Leland Lucius 2020-03-30 23:10:45 UTC
Created attachment 944 [details]
End of waveform after Change Pitch

While I didn't see any extra clips on Linux, I did notice on both Windows and Linux (didn't try it on OSX) that after the Change Pitch @ -10% is complete, the waveform is a tad bit shorter than before.  If I recall correctly this can be normal for some effects.

But, I did both tracks at the same time expecting the reduced length to be the same, but it wasn't.  Steps to recreate

1) Delete all tracks
2) Generate square tone
3) Duplicate the new track
4) Change Pitch using -10%, no other changes.
5) Apply and zoom in to the end of the tracks.
Comment 12 Leland Lucius 2020-09-06 04:43:16 UTC
(In reply to Leland Lucius from comment #11)
> Created attachment 944 [details]
> End of waveform after Change Pitch
> 
> While I didn't see any extra clips on Linux, I did notice on both Windows
> and Linux (didn't try it on OSX) that after the Change Pitch @ -10% is
> complete, the waveform is a tad bit shorter than before.  If I recall
> correctly this can be normal for some effects.
> 
> But, I did both tracks at the same time expecting the reduced length to be
> the same, but it wasn't.  Steps to recreate
> 
> 1) Delete all tracks
> 2) Generate square tone
> 3) Duplicate the new track
> 4) Change Pitch using -10%, no other changes.
> 5) Apply and zoom in to the end of the tracks.

Fix for this committed in:

https://github.com/audacity/audacity/commit/5342d98

But, hold off on testing as further changes for this bug and bug #2534 will be coming.
Comment 13 Leland Lucius 2020-09-06 15:58:25 UTC
(In reply to Steve Daulton from comment #4)
> (In reply to Peter Sampson from comment #2)
> This bug is not producible in Audacity 2.2.1 on my (Linux) machine. If the
> Change Pitch effect returns more or less samples than the selection, the
> processed audio is trimmed or padded to exactly the same length as the
> original selection. In my opinion this is the "correct" behavior.

Steve, what do you expect to happen if you do something line:

1) Add 30 second tone
2) Select 5 seconds in the middle of the tone
3) Change pitch with +10 Percent Change

As of now, this reduces the length of the entire track.  If the intent is to keep the track the same length, should silence be added to the end of the track?  Or should it be added to the end of the selection?
Comment 14 Steve Daulton 2020-09-21 09:37:41 UTC
This is looking good on Linux.
As we have previously seen platform dependent differences in this bug, best that we test on all platforms I think.
Comment 15 Peter Sampson 2020-09-22 06:11:41 UTC
Testing on W10 with Audacity 3.0.0 e3bd5cf

No spurious clips are created at the end of the tone
a) mono without HQ
b) mono with HQ
c) Stereo without HQ
d) Stereo with HW
Comment 16 Peter Sampson 2020-09-22 06:15:07 UTC
Testing on macOS 10.15.6 Catalina with Audacity 3.0.0 e3bd5cf

No spurious clips are created at the end of the tone
a) mono without HQ
b) mono with HQ
c) Stereo without HQ
d) Stereo with HQ