Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compressor works incorrectly when selected audio is partly in negative time #1512

Closed
petersampsonaudacity opened this issue Aug 19, 2021 · 8 comments
Labels
bug An error, undesired behaviour, or missed functionality Effects (EGATs) Effects, Generators, Analyzers and Tools P3 Medium Priority regression Bug is a regression against previous version Scheduled for replacement won't get fixed soon or at all.

Comments

@petersampsonaudacity
Copy link

Describe the bug
The Compressor effect works incorrectly when selected audio is partly in negative time.

When the compressor is used on an audio selection that is partially in negative time erroneous effects occur

  1. Audio from negative time is added from =0 for the duration of the selection that is in negative time
  2. The waveform that was in positive time is trimmed from the right by the amount of negative time in the selection

My steps show the effect with an initial silence for clarity - but similar happens if you omit the silencing and just work the steps with a complete 30 second chirp.

This happens consistently for me on W10 and Mac Big Sur with 3.0.2 - Steve says this does also fail on Linux

This is a regression on 2.4.2 where it works properly.

Rated as P2 as
i) it's a recent regression
ii) it results in the loss of waveform data on the right end of the track (which the user may easily fail to notice until it is too late)

It's actually an improvement on 3.0.) where
a) on Windows, Audacity crashes at Step 9
b) on Mac, Audacity generates an error

Internal error at WaveTrack.cpp line 1374

This was originally reported on the Forum by user tac2
https://forum.audacityteam.org/viewtopic.php?f=70&t=117577

This does not appear to affect other Effects when they are used at Step 9 in place of Compressor (I tried several - but not all).

To Reproduce
Steps to reproduce the behavior:

  1. Generate 30 second chirp

  2. select from 0-10 seconds

  3. Silence that selection with Ctrl+L

  4. Ctrl+A to select all

  5. Effect>Compressor
    5b) Ensure that "Makeup gain" is enabled.
    5.1) Observe proper compression (see attachment TBP)

  6. Undo to remove the compression

  7. Drag track leftwards with Timeshift tool so 9 seconds are in negative time

  8. Ctrl+A to select all

  9. Effect>Compressor
    9.1) Observe erroneous compression (see attachment TBP)

  10. drag waveform right with Timeshift tool so that all the audio is in positive time starting at T=0
    10.1) Observe: extra silence and truncated waveform (see attachment TBP)

Expected behavior
The Compressor should work

Screenshots
See: https://bugzilla.audacityteam.org/show_bug.cgi?id=2753

Additional information (please complete the following information):

  • OS: All
  • Version 3.0.3

Additional context
This was originally logged as Bugzilla 2753
https://bugzilla.audacityteam.org/show_bug.cgi?id=2753

@petersampsonaudacity petersampsonaudacity added bug An error, undesired behaviour, or missed functionality regression Bug is a regression against previous version Bug severity: High labels Aug 19, 2021
@AnitaBats AnitaBats added good first issue Issues suitable for first-time contributors. See https://github.com/audacity/audacity/contribute P3 Medium Priority and removed Bug severity: High labels Aug 19, 2021
@san-coding
Copy link
Contributor

Hey can you help me out, I am new to open source, what files should I change

@SteveDaulton
Copy link
Member

Hey can you help me out, I am new to open source, what files should I change

Start with /src/effects/Compressor.cpp and /src/effects/Effect.cpp

@Paul-Licameli
Copy link
Contributor

We think that fixing this bug will be mostly investigation in the debugger to find out the place in the code to fix, and then a small fix once that is known.

@NoobMaster1999
Copy link

I can't reproduce the bug in windows 10 after step 9 windows alpha 3.0 version crashed

@san-coding
Copy link
Contributor

Hey can you help me out, I am new to open source, what files should I change

Start with /src/effects/Compressor.cpp and /src/effects/Effect.cpp

What changes should be made

@SteveDaulton
Copy link
Member

What changes should be made

That's what the developer that fixes the bug needs to figure out.
When fixed, the compressor should work on all selected audio, whether it is visible in the track window or not. (Compare with the behavior in Audacity 2.x to see how it should work).

@AnitaBats AnitaBats removed the good first issue Issues suitable for first-time contributors. See https://github.com/audacity/audacity/contribute label Aug 26, 2021
@LWinterberg LWinterberg added the Effects (EGATs) Effects, Generators, Analyzers and Tools label Jan 14, 2022
@LWinterberg LWinterberg removed this from Help wanted in Community Contribution May 17, 2022
@LWinterberg LWinterberg added Scheduled for replacement won't get fixed soon or at all. and removed Help wanted labels May 17, 2022
@LWinterberg
Copy link
Member

this is unlikely to get fixed any time soon, if at all - negative time is such a niche concept in an audio editor

@LWinterberg LWinterberg closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2022
@SteveDaulton
Copy link
Member

negative time is such a niche concept in an audio editor

Some DAWs support "negative time" by offsetting (or allowing to be offset) the timeline so that there's a few bars space before t=0. Personally, that's always seemed like a much better way to handle it. Typically the "before zero" region would be used for adding a "count in" when overdubbing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error, undesired behaviour, or missed functionality Effects (EGATs) Effects, Generators, Analyzers and Tools P3 Medium Priority regression Bug is a regression against previous version Scheduled for replacement won't get fixed soon or at all.
Projects
None yet
Development

No branches or pull requests

7 participants