Page 2 of 2

Re: Noise Reduction Trick

Posted: Sun Dec 26, 2010 2:28 am
by Edgar
I grabbed the most current code (10AM PST, 25Dec2010) and tried the Unicode Debug build with a Microsoft wireless mouse with a typical scroll wheel then a Logitech wired TrackMouse with a scroll ring. Both worked fine with all four of the sliders in the noise Reduction dialog.

Now that I am looking at the code, I recall more detail but still do not want to guess who wrote/applied the final patch on this. I do know that I did some of the pre-alpha testing of the patch before it was posted. I seem to recall that there was a granularity issue related to different OSes. I do not know why/how some sliders would behave one way and others a different way as they are all built on the same code.

If you build the most current code (I know some work has been done with this code recently) and still experience the problem let me know and I will ask for more complete details and see if I can pin point the problem.

Re: Noise Reduction Trick

Posted: Sun Dec 26, 2010 3:26 pm
by billw58
steve wrote: Unfortunately there is still a minor bug in that two of the sliders (Sensitivity and Attack/decay) don't respond correctly to arrow keys or mouse wheel bug 227 I don't know if this is anything that Edgar or Bill could have a look at?
Steve:
On Mac, I can tab to the sliders, and they respond to the arrow keys but not the mouse wheel. This is true for all effect and generate dialogs. Also, if I tab to the "Cancel" button and press return or enter, the effect is applied (as if the OK button were clicked). I'll add this to the bug report.

-- Bill

Re: Noise Reduction Trick

Posted: Tue Dec 28, 2010 10:01 pm
by steve
Edgar wrote:If you build the most current code (I know some work has been done with this code recently) and still experience the problem let me know and I will ask for more complete details and see if I can pin point the problem.
Just installed the latest SVN (revision 10831) and still got problems with the Sensitivity slider and Attack/decay sliders.

In the case of the Sensitivity slider, the left cursor key will make the slider move very slowly to the left, but for the right cursor key there is either no movement, or a movement of 0.01 or 0.02 and then no further movement to the right.

In the case of the Attack/decay slider there is no response to either the left cursor key or the right cursor key.

Similarly with the mouse wheel.

The Noise Reduction slider and Frequency slider work correctly with either cursor keys or mouse wheel.

Re: Noise Reduction Trick

Posted: Tue Dec 28, 2010 10:54 pm
by Edgar
steve wrote:
Edgar wrote:If you build the most current code (I know some work has been done with this code recently) and still experience the problem let me know and I will ask for more complete details and see if I can pin point the problem.
Just installed the latest SVN (revision 10831) and still got problems with the Sensitivity slider and Attack/decay sliders.

In the case of the Sensitivity slider, the left cursor key will make the slider move very slowly to the left, but for the right cursor key there is either no movement, or a movement of 0.01 or 0.02 and then no further movement to the right.

In the case of the Attack/decay slider there is no response to either the left cursor key or the right cursor key.

Similarly with the mouse wheel.

The Noise Reduction slider and Frequency slider work correctly with either cursor keys or mouse wheel.
What OS (include all update info) & platform (CPU); what mouse & driver w/version? Are you building wxWidgets yourself? Are you building Audacity yourself?

I am looking at the code:

Code: Select all

#define SENSIVITY_MIN 0      // Corresponds to -20 dB 
#define SENSIVITY_MAX 4000    // Corresponds to 20 dB

#define GAIN_MIN 0
#define GAIN_MAX 48    // Corresponds to -48 dB

#define FREQ_MIN 0
#define FREQ_MAX 100    // Corresponds to 1000 Hz

#define TIME_MIN 0
#define TIME_MAX 1000   // Corresponds to 1.000 seconds
and note that the two you have problems with have much larger MAX values--hmmm...

More code:

Code: Select all

        mGainT = S.Id(ID_GAIN_TEXT).AddTextBox(_("Noise re&duction (dB):"),
                                                wxT(""),
                                                0);
         S.SetStyle(wxSL_HORIZONTAL);
         mGainS = S.Id(ID_GAIN_SLIDER).AddSlider(wxT(""), 0, GAIN_MAX);
         mGainS->SetName(_("Noise reduction"));
         mGainS->SetRange(GAIN_MIN, GAIN_MAX);
         mGainS->SetSizeHints(150, -1);

         mSensitivityT = S.Id(ID_SENSIVITY_TEXT).AddTextBox(_("&Sensitivity (dB):"),
                                                wxT(""),
                                                0);
         S.SetStyle(wxSL_HORIZONTAL);
         mSensitivityS = S.Id(ID_SENSIVITY_SLIDER).AddSlider(wxT(""), 0, SENSIVITY_MAX);
         mSensitivityS->SetName(_("Sensitivity"));
         mSensitivityS->SetRange(SENSIVITY_MIN, SENSIVITY_MAX);
         mSensitivityS->SetSizeHints(150, -1);

         mFreqT = S.Id(ID_FREQ_TEXT).AddTextBox(_("Fr&equency smoothing (Hz):"),
                                                wxT(""),
                                                0);
         S.SetStyle(wxSL_HORIZONTAL);
         mFreqS = S.Id(ID_FREQ_SLIDER).AddSlider(wxT(""), 0, FREQ_MAX);
         mFreqS->SetName(_("Frequency smoothing"));
         mFreqS->SetRange(FREQ_MIN, FREQ_MAX);
         mFreqS->SetSizeHints(150, -1);

         mTimeT = S.Id(ID_TIME_TEXT).AddTextBox(_("Attac&k/decay time (secs):"),
                                                wxT(""),
                                                0);
         S.SetStyle(wxSL_HORIZONTAL);
         mTimeS = S.Id(ID_TIME_SLIDER).AddSlider(wxT(""), 0, TIME_MAX);
         mTimeS->SetName(_("Attack/decay time"));
         mTimeS->SetRange(TIME_MIN, TIME_MAX);
         mTimeS->SetSizeHints(150, -1);
and note that ALL are created exactly the same with only textual differences and the above noted MAX differences.

More code:

Code: Select all

void NoiseRemovalDialog::OnSensitivitySlider(wxCommandEvent & event)
{
   mSensitivity = mSensitivityS->GetValue()/100.0 - 20.0;
   mSensitivityT->SetValue(wxString::Format(wxT("%.2f"), mSensitivity));
}

void NoiseRemovalDialog::OnGainSlider(wxCommandEvent & event)
{
   mGain = mGainS->GetValue();
   mGainT->SetValue(wxString::Format(wxT("%d"), (int)mGain));
}

void NoiseRemovalDialog::OnFreqSlider(wxCommandEvent & event)
{
   mFreq = mFreqS->GetValue() * 10;
   mFreqT->SetValue(wxString::Format(wxT("%d"), (int)mFreq));
}

void NoiseRemovalDialog::OnTimeSlider(wxCommandEvent & event)
{
   mTime = mTimeS->GetValue() / 1000.0;
   mTimeT->SetValue(wxString::Format(wxT("%.2f"), mTime));
}
This is the only Audacity code dealing with these sliders and should not impact the reaction to mouse wheel (nor keyboard operation which I have not tested). Keyboard and mouse interface is all done in wxWidgets as far as I can determine. I cannot imagine how it is going astray unless it is related to those considerable differences in MAX values. If I were trying to test this on your system, I would change the very large values to under 100 and see if the sliders all behaved the same (and then for completeness would set them all to over 1000 and again see if they all behaved the same); of course, this requires you to build Audacity after each change as this is hard-coded effects not Nyquist.

Audacity is a long way behind current in respect to wxWidgets (and having participated in the changing of the current wxWidgets slider code, I know Audacity will need to make changes in ALL its slider code when we adopt the new wxWidgets).

Re: Noise Reduction Trick

Posted: Tue Dec 28, 2010 11:26 pm
by steve
Ubuntu 10.10 (fully updated)
Intel(R) Core(TM)2 Duo CPU T5800 @ 2.00GHz
Generic wheel mouse
WxWidgets 2.8.11.0-Oubuntu4
Audacity built from SVN today.
Edgar wrote:the two you have problems with have much larger MAX values
I think that may be the key. I vaguely remember a similar issue with the sliders in Nyquist plug-ins quite some time ago that was to do with the step size of the slider movement being smaller than the step size of the value which meant that the slider would try to move but could never reach the next numerical value. I'll see if I can find some info on that.