Bugzilla – Bug 2016
Multiple problems with Change Pitch
Last modified: 2018-11-10 07:54:02 UTC
1) Add "Change Pitch" to a macro and set a non-zero percentage change. 2) Close the Macro editor 3) Reopen the Macro editor and select "Change Pitch" in the right window. 4) Click the "Edit" button. In a Linux debug build of 2.1.1, Audacity crashes. In Windows with 2.3.0 release, the Change Pitch dialog opens but the percentage change is now zero. The crash on Linux is because of: void EffectChangePitch::DeduceFrequencies() { auto track = *( inputTracks()->Selected< const WaveTrack >() ).first; When Change Pitch is opened via the Macro editor, inputTracks() is a nullptr. #0 0x0000000000baa68f in std::__cxx11::list<std::shared_ptr<Track>, std::allocator<std::shared_ptr<Track> > >::begin (this=0x58) at /usr/include/c++/5/bits/stl_list.h:832 #1 0x0000000000ba912d in TrackList::getBegin[abi:cxx11]() const (this=0x0) at ../../src/effects/../Track.h:1472 #2 0x0000000000f03ca7 in TrackList::Tracks<WaveTrack const, bool (Track::*)() const> (this=0x0, pred=@0x7ffd937191a0: (bool (Track::*)(const Track * const)) 0xe34f48 <Track::IsSelected() const>) at ../../src/effects/../Track.h:1436 #3 0x0000000000f039ce in TrackList::Selected<WaveTrack const> (this=0x0) at ../../src/effects/../Track.h:1224 #4 0x0000000000f127ae in EffectChangePitch::DeduceFrequencies (this=0x3b3d3c0) at ../../src/effects/ChangePitch.cpp:412 That can be fixed by checking that inputTracks() is not NULL, but then there are asserts (Linux debug build) because m_nFromPitch and other variables are not initialized. That can be fixed by ensuring that all member variables are initialized in the constructor, but then Change Pitch does not recall its settings after a restart. (see also bug 1207).
Is this a regression on 2.3.0 or on 2.2.2?
DEVEL - FIX MADE https://github.com/audacity/audacity/commit/cc2c3dc2fcc4f2a94dca36ce518ecaedbadd2d46
Testing on W10 with audacity-2.3.1-alpha-207-4c76e598d5859dc172e063d37287cc510fa7850f I confirm that this now works on W10 - the percentage change is retained for the edit of the macro. Also tested on W10 on 2.3.0 to confirm that the percentage change is erroneously reset to zero. Looks to be fixed on Windows.
Tests OK on macOS 10.14.1 Mojave with Steve's 3.3.1 build of 09Nov18
It is not working correctly for me on Linux. 1) Launch Audacity 2) Macros > New 3) Make a macro with "Change Pitch" command in it 4) Edit the Change Pitch parameters to transpose up 1 octave (12 semitones). Note that the macro correctly shows "100" as the percent change. 5) Close the macro editor 6) Generate a 440 Hz sine tone 7) Apply the macro. Expected result: the tone is pitch shifted to 880 Hz. Actual result: The 440 Hz tone is unchanged.
(In reply to Steve Daulton from comment #5) This is weird. I've reset preferences, and not it is working perfectly for me. I'm a little concerned about what I saw in comment 5, but as it is now working flawlessly I'll close this bug as FIXED.