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

Audacity Bugzilla



Bug 2096 - High quality stretching in Change Pitch/Tempo causes the Preview to malfunction and remove the selection
High quality stretching in Change Pitch/Tempo causes the Preview to malfuncti...
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: Built-in FX
2.3.2
Per OS All
: P1 RepeatableAll
Assigned To: Default Assignee for New Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-04-16 09:39 UTC by Peter Sampson
Modified: 2019-04-23 05:13 UTC (History)
7 users (show)

See Also:
Steps To Reproduce:
1) get some audio and make a selection 2) Effect>Change Pitch or Effect>Change Tempo 3) select 'use high quality stretching (slow)' 4) Use the Preview button 5) Observe: a) the Preview plays at normal pitch/tempo b) on completion of the preview, the selection is removed 6) Click the OK button - to apply the effect 7) observe error message telling you that you need to make a selection
Release Note:
First Git SHA:
Group: ---
Workaround:
Closed: 2019-04-18 00:00:00
james.k.crook: Must‑Test‑All‑OS-
petersampsonaudacity: Regression+
petersampsonaudacity: Test‑OK‑Win+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Sampson 2019-04-16 09:39:00 UTC
Using high quality stretching in Change Pitch and Change Tempo causes the Preview to malfunction and remove the selection - and it is not just a visual loss of selection - the selection is fully discarded, which means the Apply will not work after this errant preview.

I have graded this as P2 as the user may have carefully made a selection and this is now lost and must be recreated.

Assume all three platforms.

This was originally caught and reported by a Forum user - See:
https://forum.audacityteam.org/viewtopic.php?f=68&t=104395&p=368118
Comment 1 Steve Daulton 2019-04-16 11:42:23 UTC
I don't see this with Audacity 2.3.2 alpha on Linux.
I've not tested on Mac.
Comment 2 Peter Sampson 2019-04-16 12:56:02 UTC
Testing on 2.3.2 latest alpha build jc002 with macOS 10.14.4 Mojave.

I see the same symptoms on Mac as I see on W10 - except that on Mac the selection is removed while the preview is progressing, before it finishes
Comment 3 Peter Sampson 2019-04-16 13:01:08 UTC
Does not happen on either platform when the "Use high quality stretching (slow)" is unchecked.


Aside:  But note that even with that off, Change Pitch is still extremely slow on Mac
Comment 4 David Bailes 2019-04-17 06:11:38 UTC
This appears to have been caused by this commit by Paul: 0aad028

There's a fix in my fork which simply reverts the commit to fix the problem:
https://github.com/DavidBailes/audacity/commit/fe22b2ae228ebd79f1ea0161bd33eb4ef2a47bf1

However, Paul or someone else may want to work out what was going wrong, and fix that, rather than just reverting the commit.
Comment 5 James Crook 2019-04-17 17:08:47 UTC
DEVEL - FIX MADE, per David's investigation.
https://github.com/audacity/audacity/commit/fe22b2ae228ebd79f1ea0161bd33eb4ef2a47bf1

The old way of preview made a copy of the selection, and it was the copy that got changed, not the actual selection.  And that is what we wanted.  So went back to old way.
Comment 6 Peter Sampson 2019-04-18 04:34:13 UTC
(In reply to James Crook from comment #5)
Testing on W10 with audacity-2.3.2-alpha-237-fe22b2ae228ebd79f1ea0161bd33eb4ef2a47bf1

This mow works fine on Windows:

a)cthe Previews for both effects play as expected

b) the selction is retained

c) the OK button can than apply the effect to the selection


As this is flagged for single platform testing I shall mark this RESOLVED
Comment 7 David Bailes 2019-04-18 06:30:57 UTC
(In reply to Peter Sampson from comment #6)
> (In reply to James Crook from comment #5)
> Testing on W10 with
> audacity-2.3.2-alpha-237-fe22b2ae228ebd79f1ea0161bd33eb4ef2a47bf1
> 
> This mow works fine on Windows:
> 
> a)cthe Previews for both effects play as expected
> 
> b) the selction is retained
> 
> c) the OK button can than apply the effect to the selection
> 
> 
> As this is flagged for single platform testing I shall mark this RESOLVED

There is a flag set: Must-Test-All-OS

I think it should be tested on all platforms.
Comment 8 James Crook 2019-04-18 06:38:23 UTC
Re Comment #7 flags can be + or -, and it is set - to indicate there is no need to test on all platforms.
Comment 9 David Bailes 2019-04-18 06:44:33 UTC
(In reply to James Crook from comment #8)
> Re Comment #7 flags can be + or -, and it is set - to indicate there is no
> need to test on all platforms.

OK, I misread.
Comment 10 Peter Sampson 2019-04-18 07:10:21 UTC
I'm still gonna be testing it on Mac when eventually I get a Mac build ...
Comment 11 Paul L 2019-04-20 12:29:17 UTC
I do not like David's fix, which reverted some of my earlier work.

I will fix it differently.
Comment 12 Paul L 2019-04-20 12:39:26 UTC
Fixed as I prefer at commit https://github.com/audacity/audacity/commit/55f7c0f6af48ffe7c40919d292eb905c1c9ddf97

which is now just a one-line fix.  (And a comment.)
Comment 13 Peter Sampson 2019-04-21 05:04:50 UTC
(In reply to Paul L from comment #12)
Testing on W10 with audacity-2.3.2-alpha-238-9df28dc5719436813c4a6bb4c1227abe9d734987

This is now NOT fixed.

Yes the selection is preserved - but once again when using "High Quality Stretching" - the preview just plays at normal tempo/pitch - and so is no a preview
Comment 14 Peter Sampson 2019-04-21 05:15:47 UTC
(In reply to Peter Sampson from comment #13)
Actually the preview just starts up at normal speed and then partway through it just degenerates and breaks up.

In fact, further testing shows that with the "high quality stretching" turned off the preview still has problems - both effects start off with a proper preview and then also degenerate and break up too.
Comment 15 Peter Sampson 2019-04-21 05:23:59 UTC
Further testing shows that this is a regression on 2.2.2 - and was introduced in 2.3.0
Comment 16 James Crook 2019-04-21 05:34:10 UTC
It's a regression.  I won't release with it.  So P1.
Comment 17 Paul L 2019-04-21 08:52:04 UTC
I am not reproducing the problems Peter reports, for Mac.

Do you observe that it is a bug only on Windows?

Please specify precisely the length of the audio and example settings.

Possibly the underlying problem is separate from the change of selection.
Comment 18 Peter Sampson 2019-04-21 11:03:17 UTC
tested on my MacBook Pro with macOS 10.14.4 2min45sec song and 10 sec selection
Pich change D3=>D7   and D3=>F#-3
Twmpo shange 259% and -95%

And yes I do see the same problem on MacWith 2.3.1 and 2.3.2jc002
a) the preview plays at normal speed (s not a preview)
b) the selection is lost

Note carefully that this is only with the "high quality stretching" checked on - with that off (default) the preview works fine and the selection is not lost

And on Mac it's also a regression on 2.2.2 as it works fine on that and earlier versions.

The Mac implementation shows a slight improvement over the W10 in that there is no defradation of the preview part way through - the preview, when it plays, plays properly all the way through
Comment 19 Paul L 2019-04-21 23:33:19 UTC
(In reply to Peter Sampson from comment #18)

More precision please... you tested with the 2.3.1 release or with a recent 2.3.2 build?

If you mean a 2.3.2 build, does that not contradict what you say at comment #13 that selection is no longer lost, but other problems remain?

When you use Pitch Change, playing at "normal speed" is what one should expect, though with change of pitch.  I assume you meant, there was just no effect, on pitch or speed?
Comment 20 Paul L 2019-04-22 00:09:29 UTC
(In reply to Paul L from comment #19)

I have reproduced the problem on Mac.

I have completed the fix at https://github.com/audacity/audacity/commit/b83781ccde2fb79394e1e5f82a6fd7103908f4c5
Comment 21 Peter Sampson 2019-04-22 06:15:32 UTC
(In reply to Paul L from comment #20)
Testing on W10 with
audacity-2.3.2-alpha-239-b83781ccde2fb79394e1e5f82a6fd7103908f4c5

It mostly works - but there is a visual residual (which does not affect the playback of the previews for the two effects.

1) get a 5 minute steeo song
2) Select a short section - or the whole track
3) Effect Change Pitch/Tempo
4) set the "high quality strectching" flag "on"
5) click Preview
6) observe the dialog "Applying High Quality Pitch/Tempo change"
7) also observe that while this temporary pitch/tempo change for the preview is being worked on that temporarily the selkection visually shifts from the actual selection to a smal strip about 0.3cm wide starting at T=0 (this 0.3cm size appears to be independent of the zoom level.
This is the residual - it does not look good (and will alarm users)

8) after the temporary calculation has been made the preview starts 
9) and the selection is returned to where it was in Step 2
10) The preview plays correctly
Comment 22 Peter Sampson 2019-04-22 07:35:31 UTC
David's original fix in audacity-2.3.2-alpha-237-fe22b2ae228ebd79f1ea0161bd33eb4ef2a47bf1 on W10

works fine on W10 without that residula at Step 7 in Comment #21
Comment 23 Paul L 2019-04-22 11:03:13 UTC
Try it once more at 8d489b9c6f6078f700d5ecfdd9e1d1a5cc81732b
Comment 24 Peter Sampson 2019-04-23 05:13:05 UTC
(In reply to Paul L from comment #23)
Testing on W10 with audacity-2.3.2-alpha-240-28ce4e568b282e9e8d88c6be399bc651eb2e2741

The residual has been fixed, the selection remains intact throughout with both effects and the preview plays at the required changed tempo/pitch.
Tested with short selections long selctions and whole track selections.

Also tested the previews with "High quality stretching" turned off - all works fine there with bith effects,