Welcome to the new and improved Native Instruments online community. Join our active forum of 40,000+ members for discussions and much more.

how to control bus volume by custom slider?

Vblamed Member Posts: 4 Sine
edited February 6 in Scripting Workshop

Hi! junior here!) I am writing a library in which 3 parallel channels should be played. I assigned groups of samples to different buses manually. The volume should be controlled by custom sliders, but when I try to change the volume it drops to a minus infinite value and is not adjustable.

Thanks for any help! Here's the code!

on init



{create the control - must be a slider}

declare ui_slider $cleanVolumeSlider (-100, 100)


$cleanVolumeSlider := 50

declare ui_slider $distortionVolumeSlider (-100, 100)

declare ui_slider $subVolumeSlider (-100, 100)


{hide the slider parts}

hide_part($cleanVolumeSlider, $HIDE_PART_BG .or. $HIDE_PART_MOD_LIGHT .or. $HIDE_PART_TITLE .or. $HIDE_PART_VALUE)

{hide the slider parts}

hide_part($DistortionVolumeSlider, $HIDE_PART_BG .or. $HIDE_PART_MOD_LIGHT .or. $HIDE_PART_TITLE .or. $HIDE_PART_VALUE)

{hide the slider parts}

hide_part($subVolumeSlider, $HIDE_PART_BG .or. $HIDE_PART_MOD_LIGHT .or. $HIDE_PART_TITLE .or. $HIDE_PART_VALUE)

{assign the image file}

set_control_par_str(get_ui_id($cleanVolumeSlider), $CONTROL_PAR_PICTURE, "fader")

{assign the image file}

set_control_par_str(get_ui_id($distortionVolumeSlider), $CONTROL_PAR_PICTURE, "fader")

{assign the image file}

set_control_par_str(get_ui_id($subVolumeSlider), $CONTROL_PAR_PICTURE, "fader")

{place it on the performance view}

move_control_px($cleanVolumeSlider, 365, 356)

{place it on the performance view}

move_control_px($distortionVolumeSlider, 490, 415)

{place it on the performance view}

move_control_px($subVolumeSlider, 608, 356)

{control how mouse movements should affect the control}

set_control_par(get_ui_id($cleanVolumeSlider), $CONTROL_PAR_MOUSE_BEHAVIOUR, -500)

{control how mouse movements should affect the control}

set_control_par(get_ui_id($distortionVolumeSlider), $CONTROL_PAR_MOUSE_BEHAVIOUR, -500)

{control how mouse movements should affect the control}

set_control_par(get_ui_id($subVolumeSlider), $CONTROL_PAR_MOUSE_BEHAVIOUR, -500)

end on

on ui_control ($cleanVolumeSlider)

set_engine_par($ENGINE_PAR_VOLUME,$cleanVolumeSlider,-1,-1,$NI_BUS_OFFSET +1)

end on


  • Gee_Flat
    Gee_Flat Member Posts: 642 Saw
    Answer ✓

    re-post this in the subforum 'Scripting Workshop' and you might have your answer in minutes.

  • Vblamed
    Vblamed Member Posts: 4 Sine

    Thanks! Done)

Back To Top