Multiple control for a slider ...

Hi _
I have a logic problem around a slider acting as a switch; I explain myself a little better.
This slider has 4 positions and depending on its position, I would have liked to give a different role to another slider; I tried with a function but it blocks me the other slider. For better understanding, here is my script:
Maybe I should try with an if ($tapeselector = 0...end if function ..?
on init set_ui_height(2) make_perfview declare ui_slider $tapeselector(0, 3) set_control_par(get_ui_id($TAPESELECTOR),$CONTROL_PAR_MOUSE_BEHAVIOUR,-1100) set_control_par_str(get_ui_id($TAPESELECTOR),$CONTROL_PAR_PICTURE,"pv_world_knob_small") move_control_px($tapeselector,98,8) make_persistent($tapeselector) declare ui_slider $wear (0, 1000000) set_control_par(get_ui_id($wear),$CONTROL_PAR_MOUSE_BEHAVIOUR,-500) move_control_px($wear,215,18) end on function control select ($tapeselector) case 0 $wear := get_engine_par($ENGINE_PAR_PHASIS_AMOUNT, -1, 1, -1) $wear := get_engine_par($ENGINE_PAR_PHASIS_MOD_MIX/2, -1, 1, -1) case 1 $wear := get_engine_par($ENGINE_PAR_TP_WARMTH,-1,1, $NI_MAIN_BUS) $wear := get_engine_par($ENGINE_PAR_TP_HF_ROLLOFF,-1,1, $NI_MAIN_BUS) case 2 $wear := get_engine_par($ENGINE_PAR_TP_WARMTH,-1,1, $NI_MAIN_BUS) $wear := get_engine_par($ENGINE_PAR_TP_HF_ROLLOFF,-1,1, $NI_MAIN_BUS) $wear := get_engine_par($ENGINE_PAR_SK_DRIVE, -1, 0, -1) case 3 $wear := get_engine_par($ENGINE_PAR_SK_DRIVE, -1, 0, -1) $wear := get_engine_par($ENGINE_PAR_BITS,-1,0, $NI_MAIN_BUS) $wear := get_engine_par($ENGINE_PAR_BITS,-1,0, $NI_MAIN_BUS) $wear := get_engine_par($ENGINE_PAR_FREQUENCY,-1,0, $NI_MAIN_BUS) end select end function on ui_control($WEAR) call control end on
Comments
-
You probably want
set_engine_par()
notget_engine_par()
. And you should call the same function from UI callback for$tapeselector
.0 -
Ok, I test it _
0 -
Hi _
I finally adopted another solution, certainly less elegant. I have created four identical sliders and each is concerned with one or another position of the slider at ' positions .
Those who are not concerned, I do not make them appear and that creates an illusion.
on init set_ui_height(2) make_perfview declare ui_slider $tapeselector(0, 3) set_control_par(get_ui_id($TAPESELECTOR),$CONTROL_PAR_MOUSE_BEHAVIOUR,-1100) set_control_par_str(get_ui_id($TAPESELECTOR),$CONTROL_PAR_PICTURE,"pv_world_knob_small") move_control_px($tapeselector,98,8) make_persistent($tapeselector) declare ui_slider $wear (0, 1000000) set_control_par(get_ui_id($wear),$CONTROL_PAR_MOUSE_BEHAVIOUR,-500) move_control_px($wear,215,18) declare ui_slider $WEAR2 (0, 1000000) set_control_par(get_ui_id($WEAR2),$CONTROL_PAR_MOUSE_BEHAVIOUR,-500) move_control_px($WEAR2,215,18) set_control_par(get_ui_id($WEAR2),$CONTROL_PAR_HIDE,16) declare ui_slider $WEAR3 (0, 1000000) set_control_par(get_ui_id($WEAR3),$CONTROL_PAR_MOUSE_BEHAVIOUR,-500) move_control_px($WEAR3,215,18) set_control_par(get_ui_id($WEAR3),$CONTROL_PAR_HIDE,16) declare ui_slider $WEAR4 (0, 1000000) set_control_par(get_ui_id($WEAR4),$CONTROL_PAR_MOUSE_BEHAVIOUR,-500) move_control_px($WEAR4,215,18) set_control_par(get_ui_id($WEAR4),$CONTROL_PAR_HIDE,16) select($TAPESELECTOR) case 0 set_control_par(get_ui_id($WEAR2),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR3),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR4),$CONTROL_PAR_HIDE,16) wait(1) set_control_par(get_ui_id($WEAR),$CONTROL_PAR_HIDE,0) case 1 set_control_par(get_ui_id($WEAR3),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR4),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR),$CONTROL_PAR_HIDE,16) wait(1) set_control_par(get_ui_id($WEAR2),$CONTROL_PAR_HIDE,0) case 2 set_control_par(get_ui_id($WEAR),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR2),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR4),$CONTROL_PAR_HIDE,16) wait(1) set_control_par(get_ui_id($WEAR3),$CONTROL_PAR_HIDE,0) case 3 set_control_par(get_ui_id($WEAR),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR2),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR3),$CONTROL_PAR_HIDE,16) wait(1) set_control_par(get_ui_id($WEAR4),$CONTROL_PAR_HIDE,0) end select make_persistent($TAPESELECTOR) make_persistent( $wear) make_persistent( $WEAR2) make_persistent( $WEAR3) make_persistent( $WEAR4) end on on ui_control($TAPESELECTOR) select($TAPESELECTOR) case 0 set_control_par(get_ui_id($WEAR2),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR3),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR4),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR),$CONTROL_PAR_HIDE,0) case 1 set_control_par(get_ui_id($WEAR3),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR4),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR2),$CONTROL_PAR_HIDE,0) case 2 set_control_par(get_ui_id($WEAR),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR2),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR4),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR3),$CONTROL_PAR_HIDE,0) case 3 set_control_par(get_ui_id($WEAR),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR2),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR3),$CONTROL_PAR_HIDE,16) set_control_par(get_ui_id($WEAR4),$CONTROL_PAR_HIDE,0) end select on ui_control($wear) set_engine_par($ENGINE_PAR_PHASIS_AMOUNT,$WEAR,-1,1,1) set_engine_par($ENGINE_PAR_PHASIS_MIX,$WEAR/2,-1,1,1) set_engine_par($ENGINE_PAR_PHASIS_FEEDBACK,$WEAR/3 ,-1,1,1) end on on ui_control($WEAR2) set_engine_par($ENGINE_PAR_TP_WARMTH,$WEAR2,-1,1,$NI_MAIN_BUS) set_engine_par($ENGINE_PAR_TP_HF_ROLLOFF,$WEAR2,-1,1,$NI_MAIN_BUS) end on on ui_control($WEAR3) set_engine_par($ENGINE_PAR_TP_WARMTH,$WEAR3,-1,1,$NI_MAIN_BUS) set_engine_par($ENGINE_PAR_TP_HF_ROLLOFF,$WEAR3,-1,1,$NI_MAIN_BUS) set_engine_par($ENGINE_PAR_SK_DRIVE,$WEAR3,-1,0,1) end on on ui_control($WEAR4) set_engine_par($ENGINE_PAR_SK_DRIVE,$WEAR4,-1,0,1) set_engine_par($ENGINE_PAR_BITS,750000 -($WEAR4*21/31),-1,0,$NI_MAIN_BUS) set_engine_par($ENGINE_PAR_FREQUENCY,990000 -($WEAR4*10/11),-1,0,$NI_MAIN_BUS) end on
0 -
That's really not necessary, one slider for mode and one for amount is all you really need. This is overcomplicating.
0
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 62 NI News
- 786 Tech Talks
- 4.1K Native Access
- 16.6K Komplete
- 2K Komplete General
- 4.3K Komplete Kontrol
- 5.7K Kontakt
- 1.6K Reaktor
- 380 Battery 4
- 847 Guitar Rig & FX
- 429 Massive X & Synths
- 1.3K Other Software & Hardware
- 5.8K Maschine
- 7.3K Traktor
- 7.3K 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