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

Audacity Bugzilla



Bug 1360 - Confusing error messages in Analyze contrast
Confusing error messages in Analyze contrast
Status: RESOLVED QUICKFIXED
Product: Audacity
Classification: Unclassified
Component: Built-in FX
2.1.3
Per OS All
: P4 Repeatable
Assigned To: Default Assignee for New Bugs
:
: 512 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-22 06:46 UTC by Peter Sampson
Modified: 2018-08-20 11:45 UTC (History)
7 users (show)

See Also:
Steps To Reproduce:
1) set Snap to to "on" and set time format in Selection Toolbar to "Seconds" (just makes accurate selection easier) 2) Generate a 30 second tone 3) select from 30 to 35 seconds 4) Analyze>Contrast>Measure Selection 5) Error message "Nothing to measure. Please select a section of a track." 6) now select from 35 to 40 seconds 7) Analyze>Contrast>Measure Selection 8) Error message: Times are not reasonable! Please enter reasonable times. 9) Now select and measure e.g. 15 to 20 seconds as foreground and 20 to 25 seconds as background. 10) Press "Reset". The error message in step 5 appears twice.
Release Note:
First Git SHA:
Group: ---
Workaround:
Closed: 2018-08-20 00:00:00
petersampsonaudacity: Test‑OK‑Win+
petersampsonaudacity: Test‑OK‑Mac+
stevethefiddle: Test‑OK‑Lin+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Sampson 2016-03-22 06:46:23 UTC
Why is the error messge in steps 7-8 different to the one in 4-5 in the steps to reproduce?

Both cases can surely be covered by the more meaningful and informative one at Step 5 surely.

The message at step 8 about "reasonable times" totally confused a recent poster on the Forum and as it stands it's pretty meaningless to me.  We don't tell the user what the real problem is - plus we should not be shouting at users in error messages with the use of exclamation marks.

Is it possible to use the step 5 message in the steps 7-8 use case, or is there a technical reason that prevents us from doing that?
Comment 1 Steve Daulton 2016-03-22 07:08:56 UTC
I've broadened the bug summary as there are currently a lot of error messages in "Contrast" and several of them are unclear as to what the actual problem is.

Most of the error messages are produced in the same part of the code, so I think it's probably easiest to deal with them as one bug (at least for now).
Comment 2 Gale Andrews 2016-03-22 21:42:37 UTC
(In reply to Steve Daulton from comment #1)
> Most of the error messages are produced in the same part of the code, so
> I think it's probably easiest to deal with them as one bug (at least for now).
OK so I will close bug 512 as a duplicate of this. Bug 512 steps added to the steps for this bug.
Comment 3 Gale Andrews 2016-03-22 21:44:04 UTC
*** Bug 512 has been marked as a duplicate of this bug. ***
Comment 4 Martyn Shaw 2016-03-26 16:10:28 UTC
(In reply to Peter Sampson from comment #0)
In steps 7-8 the cursor is not within some audio whereas in steps 4-5 at least one end does cover some audio (albeit just 1 sample).  I'm sure the messages can be improved.
Comment 5 Steve Daulton 2016-06-22 04:09:47 UTC
I have updated several of the error messages and tweaked the underlying logic (there was error handling left over from ancient versions of Contrast that is no longer relevant, so was triggering some weird error messages).

With the "step to produce" test case:

1) set Snap to to "on" and set time format in 
2) Generate a 30 second tone
3) select from 30 to 35 seconds
4) Analyze>Contrast>Measure Selection
5) Error message "Nothing to measure. Please select a section of a track."
New version:
"Nothing to measure.
Please select a section of a track."

6) now select from 35 to 40 seconds
7) Analyze>Contrast>Measure Selection
8) Error message: Times are not reasonable! Please enter reasonable times.
New version:
"Invalid audio selection.
Please ensure that audio is selected."

9) Now select and measure e.g. 15 to 20 seconds as foreground and 20 to 25 seconds as background.
10) Press "Reset". The error message in step 5 appears twice.
New version: No error on reset.
Comment 6 Peter Sampson 2016-06-22 11:01:16 UTC
(In reply to Steve Daulton from comment #5)
Testing Steve's steps on audacity-win-r3410b60-2.1.3-alpha-22-jun-16

Messages have changed as Steve writes

Though I'm still puzzled why I still get different messages at steps 5 and 8 - both are entirely empty non-audio, the only difference is that at step 5 the left end of the blank selection just touches the end of the audio.
Comment 7 Steve Daulton 2016-06-22 11:48:54 UTC
(In reply to Peter Sampson from comment #6)

If the start of the selection is before the start of the track audio, then the start for the analysis is adjusted to the start of the audio.

Similarly, if the end of the selection is beyond the end of the track, we only analyze up to the end of the track.

What the error checking tests for, is that there is selected audio data that can be analyzed. If for any reason there isn't then an error message is thrown. The error checking attempts to narrow down why the selection is invalid and provide a clue to the user as to what they may have done wrong.

In step 5, the end of the analysis is at the same point as the start of the analysis (zero length selected audio). There is "Nothing to measure".

In step 8, the end of the analysis is BEFORE the start of the selection (it has been adjusted to the end of the audio track). This is a weird situation where the region to be analyzed has negative length. We have an "Invalid audio selection".

For safe and effective validation, it is necessary to validate "correct" user input and fail everything else. The other approach is to invalidate "incorrect" user input and accept everything else, but this is dangerous as it requires anticipating every possible way of producing errors. Thus with 'good' validation, when an error is thrown, the exact cause could be one of a number of things, but the application is safe because it has reject the "not correct" input. The error message therefore needs to be as specific as possible so as to help the user, but general enough to describe whatever the user did to create invalid input. In essence this is the difference between "white list validation" and "black list validation".
Comment 8 Peter Sampson 2016-06-30 14:26:40 UTC
Testing on d618716 build on Mac that Gale built for me.

The messages on Mac are also as Steve describes - and I accept Steve's explanation for the differeing messages.

Assuming this works on Linux (and I'm sure that's the platform that Steve tested his fix on) then this is a candidate for marling as Resolved
Comment 9 Gale Andrews 2016-07-17 10:57:47 UTC
Thanks, Steve. 

For reference, the commit was https://github.com/audacity/audacity/commit/03915b4 .

(In reply to Steve Daulton from comment #7)
Of course the error messages are an improvement. 

But personally I don't think we help the user with the different messages at step 5 and 8, when selecting in white space between two clips, whether the selection touches audio or not, all measure "zero" without error message. 

The errors (or not) seem merely to suit the validation routine. Giving the user the same error (or measuring zero) wherever they have an empty selection, and giving "Invalid audio selection. Please ensure that audio is selected" or similar when there is only a cursor point would seem more consistent from the user's POV.

I know you could argue that selecting before or after any clips is a more stupid user error than selecting between clips, so it "might" be reasonable to "measure" between clips.
 
This is (just about) below P5 IMO, so RESOLVED - QUICKFIXED.