Can't control bus volumes by custom sliders

Vblamed
Vblamed Member Posts: 4 Newcomer

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

set_ui_height_px(600)

set_ui_width_px(1000)


{create the control - must be a slider}

declare ui_slider $cleanVolumeSlider (-100, 100)

set_control_par(get_ui_id($cleanVolumeSlider),$CONTROL_PAR_DEFAULT_VALUE,50)

$cleanVolumeSlider := 50

declare ui_slider $distortionVolumeSlider (-100, 100)

declare ui_slider $subVolumeSlider (-100, 100)

make_perfview


{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

Comments

  • corbo-billy
    corbo-billy Member Posts: 70 Helper
    edited January 31

    Try this value for all sliders: declare ui_slider $cleanVolumeSlider(0, 1000000)

  • Vblamed
    Vblamed Member Posts: 4 Newcomer

    Thanks you! It works!)

Back To Top