Change Tempo Bug

Help for Audacity 2.x.x on Windows.
Forum rules
ImageThis forum is for Audacity 2.x.x on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Post Reply
KenL
Posts: 2
Joined: Sat May 09, 2020 2:07 pm
Operating System: Windows 10

Change Tempo Bug

Post by KenL » Sun Jan 10, 2021 9:27 pm

Windows 10
Audacity 2.4.2

In a long string of notes, sometimes I want to fix the rhythm of some notes that don't sync with others playing at the time.
Eg, one note was too fast and the next note too slow. The note rhythms do not sync with other instruments in the passage this way.

If I select the shorter note and 'Change Tempo' by a -0.15 for instance, the note should get longer by a certain length, but it does not!
It gets shorter and then inserts a length of silence and some garbage (especially after some Ctl-R's) equivalent to the proper (I think) length.

However if I Copy the selection and Paste it in a scrap track, 'Change Tempo' works fine and the proper length is generated and I can Copy/Paste that version back into the 'too short' original.

My way, the notes following move over for the longer changed note.
Audacity's way is to keep the original length and squeeze the new note into the available space that the original note, had by compressing it down to a size that will fit.

I am a retired professional clarinet player and 26 year programming veteran.
I am a long time user of this great software.
Thank you for fixing this. It is extra time consuming to make it work, and probably an easy fix for a programmer.
[email address removed to avoid attracting spam]

steve
Site Admin
Posts: 78775
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Change Tempo Bug

Post by steve » Sun Jan 10, 2021 9:36 pm

Enabled the "High quality stretching" option in the Change Tempo effect.

Change Tempo and Change Pitch effects are much more complex than they appear. Audacity provides two different algorithms. The default usually provides reasonable results and is pretty quick, but it may create an echoey sound and the length of sound produced is inexact. The "High quality" algorithm usually produces very good results provided that the amount of stretch is not too much, and the length is more accurate, but it is a lot slower.
More info: https://manual.audacityteam.org/man/change_tempo.html
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

KenL
Posts: 2
Joined: Sat May 09, 2020 2:07 pm
Operating System: Windows 10

Re: Change Tempo Bug

Post by KenL » Sun Jan 10, 2021 10:16 pm

High Quality stretching has always been set - and being a programmer, I appreciate the difficulty if stretching without changing pitch. But it puzzles me that it works if I do it by hand, but the program makes it shorter, then fills in the blanks.
Any way, i have found a way that works for me. If the pitch, amplitude and tone color is steady, the wave is very uniform, so I can copy/paste by finding a section of similar wave shapes and duplicating them as many as I need to fill the time. There were pops when I first tried, but now they are seamless and I use that process all the time.

steve
Site Admin
Posts: 78775
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Change Tempo Bug

Post by steve » Sun Jan 10, 2021 10:42 pm

KenL wrote:
Sun Jan 10, 2021 10:16 pm
High Quality stretching has always been set - and being a programmer, I appreciate the difficulty if stretching without changing pitch. But it puzzles me that it works if I do it by hand, but the program makes it shorter, then fills in the blanks.
I'm not able to test on Windows at the moment, but for me there are no added gaps if I use "High quality". :?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 78775
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Change Tempo Bug

Post by steve » Sun Jan 10, 2021 11:06 pm

steve wrote:
Sun Jan 10, 2021 10:42 pm
I'm not able to test on Windows at the moment, but for me there are no added gaps if I use "High quality"
Works for me on Windows 10 as well.

I'd like to be able to reproduce the problem, but I need more details:
Are you processing a mono track or a stereo track?
How long is the selection?
What settings are you using in "Change Tempo"?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

jademan
Posts: 580
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Please select

Re: Change Tempo Bug

Post by jademan » Tue Jan 12, 2021 1:14 am

KenL wrote:
Sun Jan 10, 2021 9:27 pm
If I select the shorter note and 'Change Tempo' by a -0.15 for instance, the note should get longer by a certain length, but it does not!
It gets shorter and then inserts a length of silence and some garbage (especially after some Ctl-R's) equivalent to the proper (I think) length.
OK, I can see a definite problem here, especially when high quality is NOT selected.

1) Generate 0.3 seconds of a 440Hz tone.
2) Select the audio from approx. 0.1 seconds to 0.2 seconds
3) Count the cycles between .1 and .2 (spoiler: there will be 44 cycles)
4) Apply Effect > Change Tempo > -.15 percent change
5) Count the cycles: 39, with 5 cycles of zero.
6) Ctrl-R, and the problem gets worse.
7) It only takes 8 repeats and there is no audio left at all! :shock: :o :?

steve
Site Admin
Posts: 78775
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Change Tempo Bug

Post by steve » Tue Jan 12, 2021 10:13 am

jademan wrote:
Tue Jan 12, 2021 1:14 am
OK, I can see a definite problem here, especially when high quality is NOT selected.
I think that's just a limitation of the SoundTouch algorithm. The algorithm is based on "synchronized overlap-add" (See: https://en.wikipedia.org/wiki/Audio_tim ... aling#SOLA) and is one of the main reasons that I added the SBSMS option to Change Pitch and Change Tempo.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Scarfase
Posts: 2
Joined: Mon Jan 11, 2021 10:06 am
Operating System: Windows 10

Re: Change Tempo Bug

Post by Scarfase » Tue Jan 12, 2021 2:05 pm

I agree with steve, it's all because of the SoundTouch algorithm

Post Reply