is it possible to control a hidden ui_slider with another ui_slider?

Hi there,
is it possible to control a hidden ui_slider with different effects with another ui_slider?
Thanks
Comments
-
For a question like this one would need to know when the slider is supposed to hide
0 -
___________________
0 -
@noY_T the whole time it should be hidden
0 -
on ui_control ($whateverName) // do stuff the control does // and: set_control_par(get_ui_id($controlToHide),$CONTROL_PAR_HIDE,$HIDE_WHOLE_CONTROL) end on
0 -
Wait a second, what exactly are you trying to achieve with your script here?
0 -
I want to control another different effect with it that I can't script to the one slider that shouldn't be hidden.
0 -
I've read something that this doesn't work when callbacks scripted to the second slider
0 -
Hm. Well if you want to control another slider with your slider so that another effect will be controlled, why not cut out the middle man of the hidden slider?
You can actually just set both effects with one slider
on ui_control (mySlider) set_engine_par(...1 set_engine_par(...2 ... set_engine_par(...1000 end on
0 -
the other slider should have different values for the effects
0 -
Then scale it.
mySlider * someNumber
or
mySlider / someNumber
0 -
so it works for me like this but the $hidden slider goes very fast now.
when I turn up $SLIDER1 to the half the $HIDDEN slider is already at 100%
is it possible to get this to the same speed?
on init
declare ui_slider $SLIDER1(0, 795000)
make_persistent($SLIDER1)
declare $k_SLIDER1
$k_SLIDER1 := get_ui_id($SLIDER1)
set_control_par_str($k_SLIDER1, $CONTROL_PAR_PICTURE, "")
set_control_par($k_SLIDER1, $CONTROL_PAR_POS_X, 100)
set_control_par($k_SLIDER1, $CONTROL_PAR_POS_Y, 100)
set_control_par($k_SLIDER1, $CONTROL_PAR_MOUSE_BEHAVIOUR, $mouse_resp)
declare ui_slider $HIDDEN(165000*2,1)
declare $value
make_persistent($HIDDEN)
declare $k_HIDDEN
$k_HIDDEN := get_ui_id($HIDDEN)
set_control_par_str($k_HIDDEN, $CONTROL_PAR_PICTURE, "")
set_control_par($k_HIDDEN, $CONTROL_PAR_POS_X, 200)
set_control_par($k_HIDDEN, $CONTROL_PAR_POS_Y, 200)
set_control_par($k_HIDDEN, $CONTROL_PAR_MOUSE_BEHAVIOUR, $mouse_resp)
set_control_par(get_ui_id($HIDDEN),$CONTROL_PAR_HIDE, $HIDE_WHOLE_CONTROL)
end on
on ui_control ($SLIDER1)
set_engine_par($ENGINE_PAR_VOLUME, $SLIDER1, 2, -1, 0)
set_engine_par($ENGINE_PAR_VOLUME, $SLIDER1, 3, -1, 0)
set_engine_par($ENGINE_PAR_VOLUME, $SLIDER1, 4, -1, 0)
set_engine_par($ENGINE_PAR_VOLUME, $SLIDER1, 5, -1, 0)
set_engine_par($ENGINE_PAR_VOLUME, abs($SLIDER1 - 795000), 0, -1, 0)
$HIDDEN := $SLIDER1
if ($HIDDEN < 165000)
$value := $HIDDEN
else
$value := 165000 - ($HIDDEN - 165000)
end if
set_engine_par($ENGINE_PAR_GN_GAIN, 629961 + $value, -1, 2, $NI_MAIN_BUS)
end on
0 -
Yes, the hidden slider is supposed to go up faster if you set it up tat way.
When you write a sliders name, you are simply using its value. So if a slider is set to 1000, and you then write the sliders name in your script, is is THE SAME THING AS WRITING 1000.
Try this test
on init declare ui_slider valueTest (0, 1000000) end on on ui_control (valueTest) message(valueTest) end on
Look at the little bar at the very botom of Kontakt while moving the slider.
So right now you are plain and simple setting your hidden slider to the other slider. But your hidden slider only goes from 165000 * 2 and your other slider goes til 795000.
It perfectly checks out that hidden slider is at its maximum when your other slider is at about half.
You got to do some algebra to scale you slider value down before assigning that scales version to hidden. A simple example would be something like this inside the slider callback. I changed the numbers for demonstration to hidden always being 1/4 of slider1:
on init declare ui_slider $SLIDER1(0,1000000) declare ui_slider $HIDDEN(0,250000) // This variable is a real number to make more precise math possible declare ~valueHelper end on on ui_control($SLIDER1) ~valueHelper := int_to_real($SLIDER1)/4.0 $HIDDEN := real_to_int(~valueHelper) message("Slider1: " & $SLIDER1 & "Hidden Slider: " & $HIDDEN) end on
0 -
THANKS 🙏🏼 its works know but the $SLIDER1 needs to go down from 6db that's this value (795000) to -init because the sound is very distorted at 1000000.
0 -
Yeah as I said, I changed the numbers as an example. You can scale everyhing up or down by using math
0 -
math is my biggest weakness but I try it
0
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 65 NI News
- 798 Tech Talks
- 4.1K Native Access
- 16.8K Komplete
- 2K Komplete General
- 4.4K Komplete Kontrol
- 5.8K Kontakt
- 1.6K Reaktor
- 386 Battery 4
- 854 Guitar Rig & FX
- 435 Massive X & Synths
- 1.3K Other Software & Hardware
- 5.9K Maschine
- 7.4K Traktor
- 7.4K Traktor Software & Hardware
- Check out everything you can do
- Create an account
- See member benefits
- Answer questions
- Ask the community
- See product news
- Connect with creators