Cockos Incorporated Forums v6.70+dev1117 - November 17 2022
 Register Search Today's Posts Mark Forums Read

11-27-2022, 04:32 PM   #41
ErBird
Human being with feelings

Join Date: Jan 2017
Location: Los Angeles
Posts: 1,148

Quote:
 Originally Posted by Justin 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 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.

11-27-2022, 06:01 PM   #42
Justin

Join Date: Jan 2005
Location: NYC
Posts: 15,344

Quote:
 Originally Posted by ErBird 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!

11-30-2022, 06:23 PM   #43
bwsd
Human being with feelings

Join Date: May 2011
Location: KZ ALA
Posts: 104

Reverse (Inverse) slider has no fine tuning

Attached Images
 Inverse Slider.gif (248.1 KB, 402 views)

12-01-2022, 01:05 AM   #44
Tale
Human being with feelings

Join Date: Jul 2008
Location: The Netherlands
Posts: 3,579

Quote:
 Originally Posted by bwsd 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).

01-04-2023, 08:19 AM   #45
Justin

Join Date: Jan 2005
Location: NYC
Posts: 15,344

Quote:
 Originally Posted by bwsd Reverse (Inverse) slider has no fine tuning
thanks! fixing

01-04-2023, 11:08 AM   #46
TonE
Human being with feelings

Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 3,945

Quote:
 Originally Posted by Tale It does work if you set your step size to -0.001
Good hack.

01-04-2023, 02:56 PM   #47
Justin

Join Date: Jan 2005
Location: NYC
Posts: 15,344

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

01-08-2023, 09:42 AM   #48
mawi
Human being with feelings

Join Date: Apr 2011
Location: Germany
Posts: 1,142

Quote:
 I've always dreamt of 3-point exponential sliders like: slider1:0 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

01-09-2023, 12:43 AM   #49
Tale
Human being with feelings

Join Date: Jul 2008
Location: The Netherlands
Posts: 3,579

Quote:
 Originally Posted by mawi 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.

01-09-2023, 04:28 AM   #50
mawi
Human being with feelings

Join Date: Apr 2011
Location: Germany
Posts: 1,142

Quote:
 Originally Posted by Tale AFAIK the step size is the same for all of the slider, so I don't think this is possible.
ok, thank you!

 07-24-2023, 04:24 AM #51 mawi Human being with feelings   Join Date: Apr 2011 Location: Germany Posts: 1,142 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)
 07-24-2023, 04:52 AM #52 Tale Human being with feelings     Join Date: Jul 2008 Location: The Netherlands Posts: 3,579 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. __________________ Martinic Audio Plugins - Tale's JSFX Pack
 07-24-2023, 05:09 AM #53 mawi Human being with feelings   Join Date: Apr 2011 Location: Germany Posts: 1,142 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?
 07-24-2023, 05:43 AM #54 mawi Human being with feelings   Join Date: Apr 2011 Location: Germany Posts: 1,142 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.
 07-24-2023, 07:08 AM #55 Tale Human being with feelings     Join Date: Jul 2008 Location: The Netherlands Posts: 3,579 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. __________________ Martinic Audio Plugins - Tale's JSFX Pack
 07-26-2023, 05:57 AM #56 mawi Human being with feelings   Join Date: Apr 2011 Location: Germany Posts: 1,142 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)
07-26-2023, 06:58 AM   #57
Tale
Human being with feelings

Join Date: Jul 2008
Location: The Netherlands
Posts: 3,579

Quote:
 Originally Posted by mawi 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 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).

07-26-2023, 07:38 AM   #58
mawi
Human being with feelings

Join Date: Apr 2011
Location: Germany
Posts: 1,142

Quote:
 Originally Posted by Tale 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)

 07-26-2023, 08:17 AM #59 Tale Human being with feelings     Join Date: Jul 2008 Location: The Netherlands Posts: 3,579 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. __________________ Martinic Audio Plugins - Tale's JSFX Pack Last edited by Tale; 07-27-2023 at 04:06 AM. Reason: Simplified formula
07-26-2023, 09:04 AM   #60
mawi
Human being with feelings

Join Date: Apr 2011
Location: Germany
Posts: 1,142

Quote:
 Originally Posted by Tale 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;```

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home REAPER Forums     REAPER General Discussion Forum     newbieland     REAPER Q&A, Tips, Tricks and Howto     Recording Technologies and Techniques     REAPER Compatibility     REAPER Color Themes and Icon Sets     MIDI Hardware, Control Surfaces, and OSC     REAPER Non-English Speaking User Forums         Forum de REAPER en français         Foro de REAPER en Español         Fórum do REAPER em português         Forum di REAPER in italiano         Deutschsprachiges REAPER Userforum         Pyccкоязычный фopyм REAPER     REAPER Bug Reports     REAPER Feature Requests     Dstruct's Casa De Nitpicks     REAPER for Live Use     REAPER for Video Editing/Mangling     REAPER for Spatial Audio     ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum     REAPER for macOS     REAPER for Linux     REAPER Pre-Release Discussion     REAPER Music/Collaboration Discussion NINJAM Discussion     NINJAM User Discussion     NINJAM Developer Discussion Other Software Discussion     WDL users forum     LICEcap Discussion     OSCII-bot forum     Old Cockos Products Forum

All times are GMT -7. The time now is 01:19 AM.

 -- Cockos ---- REAPER 5 ---- Reaper 3 ---- Reaper 2 ---- Reaper 1 Contact Us - Çockos Incorporated - Archive - Top