need help with programming slider #375
-
My slider needs values in the range from -2400 to 2400. That part is easy. But the values in between are a bit unusual. They start at 2400, 2200, 2000 etc., but then at 1000 they in/decrement in steps of 50, so 950, 900, 850 etc. At 200 they in/decrement in steps of 5, like 195, 190 , 185 etc. Then again at 160 they in/decrement in steps of 2. At last at 100 the in/decrement is in steps of 1, but then at 90 it is again in steps of 2. I hope you get the picture. I can probably solve this by many if-then-else and each time setting the in/decrement value, but maybe one of you has an easier solution? BTW what is the statement for setting the in/decrement value. Is it something like panel:getModulatorByName("tkScale"):getComponent():setIncrement(5,false) All help much appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi,
to catch the "mappedValue" use : Or you can use a regular slider assigned to a lookup table with LUA, with all the following corresponding values in a chain. And if you need to generate long lists of numbers with x increment, you can use this generator here : https://pinetools.com/generate-list-numbers (courtesy of @dnaldoog) PS: I never succeed to make the component value interval work properly. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the answer and tip about generating lists with various in/decrements! This uiFixedSlider seems indeed the solution to my "issue" and now I can use it also for the other odd in/decrement tables of my MIDI device. |
Beta Was this translation helpful? Give feedback.
Hi,
You need to use a uiFixedSlider for that and in the slider content box you have to put every single value from -2400 to 2400 with the non linear increments. (one value per line)
to catch the "mappedValue" use :
mod:getComponent():getProperty("uiFixedSliderContent")
(here : value 0 = mappedValue -2400, value 1 = mappedValue -2200... )
Or you can use a regular slider assigned to a lookup table with LUA, with all the following corresponding values in a chain.
I talked about this subject (for a different problematic) a while ago, you can take a look at this thread here #255
and here #275 for the lookup table …