KONTAKT - Script of menus working in chain

VST, AU, AAX, CLAP, etc. Plugin Virtual Instruments Discussion
Post Reply New Topic
RELATED
PRODUCTS
Kontakt$299.00Buy

Post

Hi everybody

On this script I'm trying to make it work in chain, that way if is increased one the menus,
the next ones will increase the same amount as the difference is shown on the box, so
when the box is returned to 0, it will keep the original values (menu1 = 0, menu2 = 1 and etc.).
So far I've only achieved this by row, but not globally and its turning a mess.

Cheers

Code: Select all

on init
	set_ui_height(2)

	declare $count
{menu}
	declare ui_menu $menu_1
	declare ui_menu $menu_2
	declare ui_menu $menu_3
	declare ui_menu $menu_4

	declare %menus[4]
		%menus[0] := get_ui_id($menu_1)
		%menus[1] := get_ui_id($menu_2)
		%menus[2] := get_ui_id($menu_3)
		%menus[3] := get_ui_id($menu_4)

	declare @temp

{boxes}
	declare ui_value_edit $box_1 (0,16,1)
	declare ui_value_edit $box_2 (0,16,1)
	declare ui_value_edit $box_3 (0,16,1)
	declare ui_value_edit $box_4 (0,16,1)

	declare %boxes[4]
		%boxes[0] := get_ui_id($box_1)
		%boxes[1] := get_ui_id($box_2)
		%boxes[2] := get_ui_id($box_3)
		%boxes[3] := get_ui_id($box_4)
{}
	declare $pos_x := 65
	declare $space := 20

		@temp := "off"
		add_menu_item($menu_1, @temp,-1)
		add_menu_item($menu_2, @temp,-1)
		add_menu_item($menu_3, @temp,-1)
		add_menu_item($menu_4, @temp,-1)

		$count := 0
		while ($count < 16)
			add_menu_item($menu_1, $count, $count)
			add_menu_item($menu_2, $count, $count)
			add_menu_item($menu_3, $count, $count)
			add_menu_item($menu_4, $count, $count)
			if ($count < 4)
				set_control_par(%menus[$count],$CONTROL_PAR_VALUE, 1 + $count)
				set_control_par(%menus[$count],$CONTROL_PAR_POS_X, $pos_x+33)
				set_control_par(%menus[$count],$CONTROL_PAR_POS_Y, 0 +($space*($count)))
				set_control_par(%boxes[$count],$CONTROL_PAR_POS_X, $pos_x+122)
				set_control_par(%boxes[$count],$CONTROL_PAR_POS_Y, 0 +($space*($count)))
				set_control_par(%boxes[$count],$CONTROL_PAR_WIDTH,38)
				set_control_par_str(%boxes[$count],$CONTROL_PAR_TEXT,"")
			end if
			inc($count)
		end while

	declare $temp
	declare $selected

	message("")
end on

{menus}
on ui_control($menu_2)
	if ($menu_2 > -1)
		$box_1 := $menu_2 - 1
	end if
end on

on ui_control($menu_3)
	if ($menu_3 > -1)
		$box_2 := $menu_3 - 2
	end if
end on

on ui_control($menu_4)
	if ($menu_4 > -1)
		$box_3 := $menu_4 - 3
	end if
end on


{boxes}
on ui_control($box_1)
	if ($box_1 > -1)
		$menu_2 := $box_1 + 1
	end if
end on

on ui_control($box_2)
	if ($box_2 > -1)
		$menu_3 := $box_2 + 2
	end if
end on

on ui_control($box_3)
	if ($box_3 > -1)
		$menu_4 := $box_3 + 3
	end if
end on
Last edited by hellishvictor on Fri May 31, 2019 12:55 pm, edited 3 times in total.

Post

Come on, 38 views and nobody can help me with this?

Post Reply

Return to “Instruments”