Macros: Change Pitch intermittently zero'd out

Bug reports for Audacity 2.3.1 alpha
Forum rules
This forum is only for feedback and bug reports for the specified version of Audacity.

All bug reports must include the following information:
  • Exact version number of Audacity
  • Operating system version
  • Brief description of the problem
  • Detailed, step by step instructions for how to reproduce the problem
Bug reports that do not include the above information will be deleted

Additional information and / or screenshots should be included as necessary to adequately describe the problem.
LivingInternet
Posts: 82
Joined: Thu Jun 15, 2017 11:19 am
Operating System: Windows 10

Macros: Change Pitch intermittently zero'd out

Post by LivingInternet » Wed Oct 24, 2018 11:47 pm

Audacity 2.3.0
Windows 10

I created a macro that speeds up tempo 6%, reduces pitch -5%, and normalizes. Ran it on a dozen projects, worked fine. Then checked some of them just to be sure, and found the last six the change pitch stopped being applied.

I checked the macro. As shown in the picture below, the parameter appeared to be correct. (It changes the -5 to -5.011 by itself, whether in a macro or not, so that part is fine). However, when I clicked Edit, the window that opened shows the percent change set back to 0, as shown in the picture.

I reset it to -5. The macro then ran fine, including change pitch, on several projects. Closed Audacity, reopened, and found same problem: the change pitch was not being applied, and on checking got the same result as in the picture, the parameter appeared to be fine, but on edit found it was back to zero. So changed it to -5 again, and the macro again ran fine.

Closed all Audacity projects, reopened, and same behaviour - reset back to zero.

Workaround: keeping one Audacity "Temp" project with just a label track open at all times.
Attachments
Audacity-macro-bug.PNG
Audacity-macro-bug.PNG (27.26 KiB) Viewed 147 times

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

Re: Macros: Change Pitch intermittently zero'd out

Post by steve » Thu Oct 25, 2018 12:20 am

LivingInternet wrote:
Wed Oct 24, 2018 11:47 pm
It changes the -5 to -5.011 by itself
I think that's because the slider covers such a large range (-99% to +400%) that the slider updates the % value to the nearest "tick" position. The % value itself is stored to much higher precision (0.001 %), so as long as you don't open the interface, "-5.000 %" really is "-5.000 %".
LivingInternet wrote:
Wed Oct 24, 2018 11:47 pm
Then checked some of them just to be sure, and found the last six the change pitch stopped being applied.
That is very strange.
Could you check the macro text file. After setting the pitch change to -5.000 you should see:

Code: Select all

ChangePitch:Percentage="-5" SBSMS="0"
or

Code: Select all

ChangePitch:Percentage="-5" SBSMS="1"
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

LivingInternet
Posts: 82
Joined: Thu Jun 15, 2017 11:19 am
Operating System: Windows 10

Re: Macros: Change Pitch intermittently zero'd out

Post by LivingInternet » Thu Oct 25, 2018 12:24 am

The change from -5 to -5.011 is not an issue.

As per the pic in my post, the macro text file has the correct setting. And on close and reopen of Audacity it has the right setting.

The issue is that, on close and reopen, it no longer gets applied. And as per the pic in my post, when you click Edit, the setting is shown as a zero "0", even though the macro text, as shown in the pic, is -5.011.

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

Re: Macros: Change Pitch intermittently zero'd out

Post by steve » Thu Oct 25, 2018 12:36 am

Please you post your macro text file so that I can see if I can reproduce the problem. Thanks.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

LivingInternet
Posts: 82
Joined: Thu Jun 15, 2017 11:19 am
Operating System: Windows 10

Re: Macros: Change Pitch intermittently zero'd out

Post by LivingInternet » Thu Oct 25, 2018 12:50 am

Ok, please find macro file attached. Note however the problem is not in that file, it is fine. Again, if you look at the pic I posted, it shows the macro parameters are correct, drawn from that file. The issue is that after closing and reopening Audacity, the pitch percentage parameter no longer gets passed to the Change Pitch effect.

And even more interestingly, you can watch it happen. If you click Edit on the effect from the Manage macros window, you can see the pitch percentage does not get passed to the Change Pitch effect, and the pitch percentage is zero.

This is shown very clearly in the pic I posted. I suggest starting by checking that pic out.
Attachments
DPPMeffects1.txt
(158 Bytes) Downloaded 9 times

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

Re: Macros: Change Pitch intermittently zero'd out

Post by steve » Thu Oct 25, 2018 10:51 am

LivingInternet wrote:
Thu Oct 25, 2018 12:50 am
Note however the problem is not in that file, it is fine.
Yes it is, but I was having difficulty following your "steps to reproduce", and I wanted to try and follow your steps exactly so I could see what you are seeing.
LivingInternet wrote:
Thu Oct 25, 2018 12:50 am
And even more interestingly, you can watch it happen. If you click Edit on the effect from the Manage macros window
This is the key. When the Change Pitch GUI opens, it tries to get the "From" frequency from the start of the selection, but when it is opened via the macro editor, it is opened without the selection, so the analysis fails and it falls back to defaults.

I'll log this bug, and I think I can see a fix for it.

In the meantime, this macro should give you almost the same effect. The difference is that "SlidingStretch" always uses SBSMS, whereas you were using the "SoundTouch" algorithm in Change Tempo and Change Pitch.

Code: Select all

SlidingStretch:PitchHalfStepsEnd="-0.888" PitchHalfStepsStart="-0.888" PitchPercentChangeEnd="-5" PitchPercentChangeStart="-5" RatePercentChangeEnd="6" RatePercentChangeStart="6"
Normalize:ApplyGain="1" PeakLevel="-1" RemoveDcOffset="1" StereoIndependent="0"

9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

LivingInternet
Posts: 82
Joined: Thu Jun 15, 2017 11:19 am
Operating System: Windows 10

Re: Macros: Change Pitch intermittently zero'd out

Post by LivingInternet » Thu Oct 25, 2018 11:50 am

Thanks much. I want to make sure though that you know what happened. The Change Pitch effect was not working after Audacity was closed and reopened, without me doing anything. I did not open the Macro manager and edit the pitch. It simply was not working. Rather unexpected and distressing, only found by luck after many tracks already processed.

So at that point, the first thing I did was:

1. Simply open the change pitch effect directly from the Effects menu to see what the percentage was. In the past, I have always found it retained the last setting used, so was curious. But the percentage was set to zero! Indeed, the last pitch change had done nothing.

2. So then I went to Tools / Macros and looked at the macro to see if it had become corrupted. However, the parameter was set correctly to -5.011, as you can see in the pic. But it had obviously not been applied, so I was rather confused.

3. So then I clicked Edit from within the Macro manager just to double-check, and when the GUI opened saw that despite the parameter being -5.011 in the macro file, it was set to zero in the GUI! The parameter in the macro was not being passed to the effect! Or was somehow being over-ridden. As shown in the posted pic.

So again, I did nothing other than simply close all Audacity windows, and reopen them. Then when I applied the macro, the change pitch ignored the macro settings, and did a zero percentage change. All of the above steps and investigation, and the pic posted, happened after I found by listening that the pitch had not been changed.

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

Re: Macros: Change Pitch intermittently zero'd out

Post by steve » Thu Oct 25, 2018 12:13 pm

Thanks for the extra detail.

Unfortunately the problem is more complex that I initially thought. There are at least 3 separate bugs in Change Pitch.

Can you tell me which was the most recent version of Audacity in which Change Pitch worked correctly? In particular, that last version that you know of where the effect remembered its setting?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

LivingInternet
Posts: 82
Joined: Thu Jun 15, 2017 11:19 am
Operating System: Windows 10

Re: Macros: Change Pitch intermittently zero'd out

Post by LivingInternet » Thu Oct 25, 2018 12:33 pm

Unfortunately I just installed 2.3, and don't recall which version I had previously. It was installed around June 2017.

However, that might not be the key, since I only just learned macros and started using those this week, after installing 2.3. And this seems, at least to me, like a macro parameter read problem. After all, one might use the Change Pitch effect by itself, and set all sorts of values, and then wish to apply a macro, upon which the parameter in the macro should take precedence over any setting used by the effect in the recent past. This is what is not happening - the parameter in the macro file is not being passed to the effect.

And come to think of it, there must be another bug too, that is in fact Audacity version dependent. With the older version, the last change pitch percentage was remembered even if Audacity was closed and reopened. Now it gets reset to zero. And *then* the macro read problem occurs - the macro parameter does not over-ride this zero'd parameter.

(Thanks for the SBSMS tip and macro using the Sliding Stretch effect, however I tried it and the quality is much worse. I just read up on SBSMS and that the quality should be better, however the result was my voice sounded like it was in a well. I also tried both the Change Tempo and Change Pitch effects with the "high quality" box checked, and both of them individually have the same problem - strong distortion in the result. Strongly recommend these checkboxes be removed, or renamed to "Not as good and slower too". Only half joking ;-)

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

Re: Macros: Change Pitch intermittently zero'd out

Post by steve » Thu Oct 25, 2018 1:49 pm

LivingInternet wrote:
Thu Oct 25, 2018 12:33 pm
With the older version, the last change pitch percentage was remembered even if Audacity was closed and reopened. Now it gets reset to zero.
That's the bug that I'm trying to track down now.
There have been a lot of sweeping changes since June 2017 which makes it difficult to see from the code which change broke it.
LivingInternet wrote:
Thu Oct 25, 2018 12:33 pm
I just read up on SBSMS and that the quality should be better,
It is very dependent on the source material. With some types of sound the quality is much better. With other types it is not so good. One benefit of SBSMS is that it always keeps the duration exactly the same when pitch shifting. (Try applying a 1 semitone shift to a generated "Pluck" sound.)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply