Change Slider value rang

Hello everyone :)!

My name is Achi and I just started tinkering with Spark AR :smiley:
I usually don´t use forums so please don´t be frustrated with my writing :smiley:

So I was trying to create a Filter with Josh Beckwith Spark Color Adjust so you can create your desired settings with pickers and sliders and then start recording :slight_smile: but I came across some issues and the biggest one was creating a slider with negative values.

Is that possible and if so how would I do that?

My problem is some values can´t go “darker” and I don´t want the filter start with negative values but rather with neutral ones and the user can then decide how to change the values

English isn´t my first language, if something isn´t clear try to ask :smiley:

Hi Achi!

If your slider is returning values in the 0-1 range you can use the To Range Patch to remap them.

If you want to clamp the slider values you can use either clamp/min/max depending on the case.

You could also use the From Range patch (again depending on the output you want)

Here’s a list of all the Math Patches in spark:

I hope I was of help :heart:

1 Like

Thank you Tomas :heart: :smiley:!

It actually helped, I watched a video that Udart posted on youtube related to From/To Range patch after you mentioned it :smiley: and it worked.

At first I thought it didn´t work but I just had to set the start value in slider ui to 0.5 then it worked like i wanted to :slight_smile:

For fellow beginners: :smile:

Slider UI (Start value 0.5) -> To Range (connect to the first value, set range) -> connect to desired patch

1 Like