Page 1 of 2
Logarithmic Sliders
Posted: Tue Jan 07, 2014 6:11 pm
by steve
There are a few places that would benefit from logarithmic sliders.
For example:
- Mixer Board, level sliders.
- Track Gain slider.
- Change Speed.
- Amplify.
- Compressor, all dB sliders.
- Reverb, Wet Gain and Dry Gain sliders.
- Various Nyquist plug-ins
wxWidgets does not provide a log scale slider so it would need to be a custom widget within Audacity.
Re: Logarithmic Sliders
Posted: Tue Jan 07, 2014 8:17 pm
by Robert J. H.
Do you mean for instance a slider that goes from -120 dB to 0 dB, with -12 dB exactly in the middle?
This would be probably also be good for frequencies. Currently, 1/4 of the Nyquist frequency is in the middle (e.g. 11025 Hz at 44.1 kHz), hence, the most important region has only about a fifth of the whole slider range.
It is also thinkable to have a highly customizable slider mapping.
For the frequency slider, this could mean:
0 Hz at 0 %
40 Hz at 10 %
160 Hz at 20 %
320 Hz at 30 %
640 Hz at 40 %
1000 Hz at 50 %
2000 Hz at 60 %
4000 Hz at 70 %
8000 Hz at 80 %
16000 Hz at 90 %
22050 Hz at 100 %
or something similar.
A exponential curve would also go, with for example 1000 Hz in the middle but the values inbetween might not be very nice to look at.
Anyways, You'll need some kind of range definition for the slider.
logarithmic/exponential curves need naturally more than the lower and upper limits, leastways if it should be a general control type.
Re: Logarithmic Sliders
Posted: Tue Jan 07, 2014 9:41 pm
by steve
Robert J. H. wrote:Do you mean for instance a slider that goes from -120 dB to 0 dB, with -12 dB exactly in the middle?
Currently the slider widgets are linear.
In the case of a "volume slider" (for example the main sliders in the Mixer Board) it would be useful to have a logarithmic scale from -infinity to, say +12 dB with 0 dB about 15 to 20% from the top. Most real mixers have slider scales similar to this. The Mixer Board currently has a scale of +.- 36 dB with 0 dB in the middle.
Audacity does have at least one slider that is not a simple linear scale.
The Change Speed slider goes from -99 to 0 in the left half (0 in the middle of the slider) and from 0 to +400 in the right half. Each half is linear.
Ideally the start, end and curve would be defined.
Internally (in the current widget code) all of the sliders actually have a range from 0 to 100. This range is mapped to the required Minimum and Maximum values and intermediate values are calculated by linear interpolation. For sliders that have a a text box (most of them) this interpolated value is displayed and is editable in the text box.
Log/exponential curves are frequently useful for audio, so the widget code could take values that define the minimum and maximum values on the curve logb(x) or the curve b^x
. By selecting appropriate values of x-Min, x-Max and 'b', appropriate curves could be defined for many audio purposes.
Re: Logarithmic Sliders
Posted: Wed Jan 08, 2014 6:34 am
by Robert J. H.
The gain slider is especially sensitive with the linear scale.
Well, I don't actually use the slider but increase/decrease track gain instead. The one dB steps are much too much at a high level. You'll hear the steps in a real-time rendering. Whereas 1 dB is not enough at the bottom end of the scale.
Hence, the gain resolution around 0 dB should be much finer since the first step reduces the amplitude by 11 % at full scale (1 to 0.89).
In contrast, a slider notch means 0.72 dB.
A similar problem exists for the pan slider. Here, the scale should actually follow the tangent, neither linear nor logarithmic.
But I go astray.
Steve, what you actually need is a proper mathematical definition for the slider scale.
We have currently:
Y = Start + End * X
or Y = A + B * X.
Possible extensions are: + C^X + X^D.
However, I would probably take the approach from Nyquist with PWL and PWE respectively.
Thus you could give the important points for the slider range 0 to 100, where two values only represent a linear scale, 3 points a curve, 5 points two curves for e.g. below and above 0, and so on.
I'm not sure if I would use a special logarithmic or exponential scale at all, I'd rather define it with more points and a optional interpolation scheme (e.g., spline, polynomial, LaGrange, Chebichev) to smooth the curve. I don't believe that there's a big error for only 100 values.
As an example, The scale arguments could be: scale(0, 20, 100, quadratic) with 0 at 0, 20 at 50 and 100 at 100 %.
The constraints for the chosen interpolation method are:
For a ascending slider scale, the current value mustn't be less than the one before (the increment is always positive)
The given values have to be included in the curve if they do not violate rule one.
That's only a problem for more than 3 passed points.
Re: Logarithmic Sliders
Posted: Tue Feb 18, 2014 5:38 pm
by waxcylinder
BUMP
@Steve: are you planning to write a proposal for this - or do you just want it transferred to Wiki > PFR
Peter
Re: Logarithmic Sliders
Posted: Tue Feb 18, 2014 7:23 pm
by steve
Thanks wc. Just transferred to Wik for now. I may write a proposal later.
The forum topic title is perhaps a bit "abstract". The first post contains the "concrete" feature request(s).
Re: Logarithmic Sliders
Posted: Wed Feb 19, 2014 3:38 pm
by Edgar
I asked about this over on the wxWidgets user list but got resounding silence.
Re: Logarithmic Sliders
Posted: Wed Feb 19, 2014 10:06 pm
by Gale Andrews
steve wrote:Thanks wc. Just transferred to Wik for now.
Um, you didn't and Peter didn't either. I've captured it now, so I'll put it on Wiki FR's. But only 1 vote for it?
Gale
Re: Logarithmic Sliders
Posted: Wed Feb 19, 2014 10:52 pm
by steve
Gale Andrews wrote:Um, you didn't and Peter didn't either.
Oops, an unfortunate typo.
That should have been:
"Thanks wc. Just transfer to Wik for now."
Thanks for sorting it Gale.
Gale Andrews wrote:But only 1 vote for it?
I presume there was a reason why Edgar was asking about it?
Re: Logarithmic Sliders
Posted: Thu Feb 20, 2014 4:02 am
by Gale Andrews
steve wrote:Gale Andrews wrote:But only 1 vote for it?
I presume there was a reason why Edgar was asking about it?
I assumed Ed was asking on your behalf of you as he is subscribed to the widgets list. But he can type a quick +1 if he wants to vote.
Gale