Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Pre-Release Discussion

Reply
 
Thread Tools Display Modes
Old 11-27-2022, 04:32 PM   #41
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
Default

Quote:
Originally Posted by Justin View Post
hmm yeah that's nice. and the math can be simplified a bit since e^(2*ln(x)) = x^2, reduces down to ((m-1)/m)^2... not that it's that complex to begin with. we'll do that, :exp=2000 or whatever for the midpoint.
True, ((m-1)/m)^2 can be the base of the exponential b^x. I left it in e^ax form to show the relationship between "m" and "a" since Tale was advocating for setting "a" directly.
I see some value in that since e^ax is widely used and "m" (sorta like a midpoint percentage) is just something I worked out. No idea if it's a standard or known method.

But as you see "m" has two advantages:
1) It's intuitive, you can deduce the exponential shape easier when reading m=0.05 compared to a=5.89.
2) There's a simple relationship between m and the actual slider value at the midpoint (mid-slider-travel).

Very important, m HAS to be >0 and <1 or it doesn't work properly. I'm sure this is obvious, but just in case.

Quote:
Originally Posted by Justin View Post
we'll do that, :exp=2000 or whatever for the midpoint.
Exponentially-scaled sliders would be so great, thank you if this happens regardless of the input parameters.
ErBird is offline   Reply With Quote
Old 11-27-2022, 06:01 PM   #42
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Quote:
Originally Posted by ErBird View Post
Very important, m HAS to be >0 and <1 or it doesn't work properly. I'm sure this is obvious, but just in case.



Exponentially-scaled sliders would be so great, thank you if this happens regardless of the input parameters.
Yep yep! Coming in the next +dev. Thanks for working out the math!
Justin is offline   Reply With Quote
Old 11-30-2022, 06:23 PM   #43
bwsd
Human being with feelings
 
Join Date: May 2011
Location: KZ ALA
Posts: 110
Default

Reverse (Inverse) slider has no fine tuning

Attached Images
File Type: gif Inverse Slider.gif (248.1 KB, 448 views)
bwsd is offline   Reply With Quote
Old 12-01-2022, 01:05 AM   #44
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by bwsd View Post
Reverse (Inverse) slider has no fine tuning
Confirmed! It does work if you set your step size to -0.001, but that's indeed not how it works in v6.70 (and v6.71).
Tale is offline   Reply With Quote
Old 01-04-2023, 08:19 AM   #45
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Quote:
Originally Posted by bwsd View Post
Reverse (Inverse) slider has no fine tuning

thanks! fixing
Justin is offline   Reply With Quote
Old 01-04-2023, 11:08 AM   #46
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,031
Default

Quote:
Originally Posted by Tale View Post
It does work if you set your step size to -0.001
Good hack.
TonE is offline   Reply With Quote
Old 01-04-2023, 02:56 PM   #47
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Quote:
Originally Posted by TonE View Post
Good hack.
bad hack, it will not work in old or new jsfx versions

but a helpful diagnostic tool
Justin is offline   Reply With Quote
Old 01-08-2023, 09:42 AM   #48
mawi
Human being with feelings
 
Join Date: Apr 2011
Location: Germany
Posts: 1,185
Default

Quote:
I've always dreamt of 3-point exponential sliders like:
slider1:0<min,mid,max,inc>

For example:
slider1:0<0,0.5,100,0.01>Attack (ms)
slider3:0<20,632.455,20000,0.1>Frequency (Hz)
the example is good. suppose i have a Q-slider from 0.5 to 5 for an eq.
and the center point should be 1.
the slider in the range 0.5 to 1 should resolve in even 0.1 steps,
the range 1 to 5 should resolve in even 1.0 steps. is this possible?

Example:
slider1:1<0.5,1,5,0.01>Q
mawi is offline   Reply With Quote
Old 01-09-2023, 12:43 AM   #49
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by mawi View Post
the slider in the range 0.5 to 1 should resolve in even 0.1 steps,
the range 1 to 5 should resolve in even 1.0 steps. is this possible?
AFAIK the step size is the same for all of the slider, so I don't think this is possible.
Tale is offline   Reply With Quote
Old 01-09-2023, 04:28 AM   #50
mawi
Human being with feelings
 
Join Date: Apr 2011
Location: Germany
Posts: 1,185
Default

Quote:
Originally Posted by Tale View Post
AFAIK the step size is the same for all of the slider, so I don't think this is possible.
ok, thank you!
mawi is offline   Reply With Quote
Old 07-24-2023, 04:24 AM   #51
mawi
Human being with feelings
 
Join Date: Apr 2011
Location: Germany
Posts: 1,185
Default

A question about the logarithmic slider. If I use this code:
Code:
slider1: 5<0,10,0.0001,:log>Logarithmic Slider (Bug?)
Then the 5 is exactly in the middle of the slider and the slider behaves like a linear slider. I would expect the 5 to be to the right of the center and the slider to be logarithmic. If I enter 1 for the minimum value instead of 0, then everything is as I expect.
Code:
slider2: 5<1,10,0.0001,:log>Logarithmic Slider
Or if I specify a midpoint it behaves as expected, even though the minimum value is 0.
Code:
slider3: 9<0,10,0.0001,:log=9>Logarithmic Slider with Midpoint
Have I misunderstood something or is this a bug?

Reaper v6.81 x64, Win10 x64

Translated with www.DeepL.com/Translator (free version)
mawi is offline   Reply With Quote
Old 07-24-2023, 04:52 AM   #52
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Although the documentation doesn't sem to state this explicitly, if you the the :log syntax instead of :log=X syntax, then it uses the default slider value for the midpoint X. I.e. slider1:5<0,10,0.0001:log> is the same as slider1:5<0,10,0.0001:log=5>, which results in a linear slider, because the midpoint 5 is exactly between 0 and 10.

So I would say this isn't a bug, but I guess the documentation could be improved.
Tale is offline   Reply With Quote
Old 07-24-2023, 05:09 AM   #53
mawi
Human being with feelings
 
Join Date: Apr 2011
Location: Germany
Posts: 1,185
Default

Thanks for the clarification. I didn't know that if I don't specify a midpoint, the default value is taken as the midpoint. Using 5 as the midpoint is perhaps a bad example. But if I take any other number between 0 to 10, then there should be a difference between a logarithmic and linear slider or?
mawi is offline   Reply With Quote
Old 07-24-2023, 05:43 AM   #54
mawi
Human being with feelings
 
Join Date: Apr 2011
Location: Germany
Posts: 1,185
Default

And what do I have to do so that a logarithmic slider without a specified midpoint does not take the default value as the midpoint? This does not seem to me to be good behavior, because a default value is not automatically a midpoint.
mawi is offline   Reply With Quote
Old 07-24-2023, 07:08 AM   #55
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Just to be clear: I think :log always needs a midpoint, so you can either explicitly specify the midpoint using :log=X, or you can be lazy and use :log, but then it uses the default value as the midpoint.

So I guess it's probably better to always specify the midpoint using :log=X, becasue that way the curve doesn't change when you change the default value.
Tale is offline   Reply With Quote
Old 07-26-2023, 05:57 AM   #56
mawi
Human being with feelings
 
Join Date: Apr 2011
Location: Germany
Posts: 1,185
Default

I have looked at this again. If I don't specify a center point for a logarithmic slider, then the default value is not taken as the center point. You can see that in this example:
Code:
slider7:5<0.1,10,0.0001,:log>Logarithmic Slider
After all, it wouldn't make sense to provide two different logarithmic specifications if they do the same thing. As you can see from this example, the logarithmic slider does not behave like a linear slider, although the minimum value is very close to 0. Only if I set the minimum value to exactly 0, then the logarithmic slider behaves like a linear slider. This is a mistake in my eyes.

Translated with www.DeepL.com/Translator (free version)
mawi is offline   Reply With Quote
Old 07-26-2023, 06:58 AM   #57
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by mawi View Post
I have looked at this again. If I don't specify a center point for a logarithmic slider, then the default value is not taken as the center point. You can see that in this example:
Code:
slider7:5<0.1,10,0.0001,:log>Logarithmic Slider
Yes, you're right, I stand corrected.

Quote:
Originally Posted by mawi View Post
Only if I set the minimum value to exactly 0, then the logarithmic slider behaves like a linear slider. This is a mistake in my eyes.
Well, I guess 0 would result in some sort of mathematical impossibility like e.g. log(0).
Tale is offline   Reply With Quote
Old 07-26-2023, 07:38 AM   #58
mawi
Human being with feelings
 
Join Date: Apr 2011
Location: Germany
Posts: 1,185
Default

Quote:
Originally Posted by Tale View Post
Well, I guess 0 would result in some sort of mathematical impossibility like e.g. log(0).
I considered that too, but the argument against it is that a logarithmic slider with midpoint works. As you can see in this example:
Code:
slider8:5<0,10,0.0001,:log=9>Logarithmic Slider with Midpoint
So it is possible to have a logarithmic slider with a minimum value of exactly 0. This can also be seen in other manufacturers with logarithmic knobs/sliders and is also stated in Reaper's JSFX documentation.
Quote:
slider1:5<0,10,0.1:log>slider description -- REAPER 6.74+
This is off topic now, but it would be useful to be able to specify the midpoint for linear sliders. For example like this:
Code:
slider1:5<0,10,0.0001,:lin=9>Linear Slider with Midpoint
That would be very interesting.

Translated with www.DeepL.com/Translator (free version)
mawi is offline   Reply With Quote
Old 07-26-2023, 08:17 AM   #59
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

FWIW, here is some code that shows what formula is probably used for :log without specifying a midpoint:

Code:
desc:Log slider test

slider1:100<10,1000,1:log>Log Slider
slider2:100<10,1000,1>Follow Log Slider Position

@init

min_value = 10;
max_value = 1000;

@slider

slider2 = log(slider1 / max_value) / log(min_value / max_value) * (min_value - max_value) + max_value;
This formula indeed breaks for zero or negative numbers, which I guess is why JSFX then reverts to linear.

Last edited by Tale; 07-27-2023 at 04:06 AM. Reason: Simplified formula
Tale is offline   Reply With Quote
Old 07-26-2023, 09:04 AM   #60
mawi
Human being with feelings
 
Join Date: Apr 2011
Location: Germany
Posts: 1,185
Default

Quote:
Originally Posted by Tale View Post
FWIW, here is some code that shows what formula is probably used for :log without specifying a midpoint:

Code:
desc:Log slider test

slider1:100<10,1000,1:log>Log Slider
slider2:100<10,1000,1>Follow Log Slider Position

@init

min_value = 10;
max_value = 1000;

@slider

slider2 = (log(slider1) - log(max_value)) * (min_value - max_value) / (log(min_value) - log(max_value)) + max_value;
This formula indeed breaks for zero or negative numbers, which I guess is why JSFX then reverts to linear.
I have tried a little bit. It seems that you are right. 0 does not work in this script.
Code:
desc:Log slider test

slider1:5<0,10,0.1>Lin Slider
slider2:5<0,10,0.1>Log Slider Position

@init

min_value = 0.1; // 0 don't work
max_value = 10;

@slider

slider2 = (log(slider1) - log(max_value)) * (min_value - max_value) / (log(min_value) - log(max_value)) + max_value;
mawi is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:00 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.