1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Need someone to help with my scripts

Discussion in 'Scripting Workshop' started by Brian Wong, Aug 5, 2019.

  1. Brian Wong

    Brian Wong New Member

    Messages:
    4
    Hello there,

    My name is Brian and I am a student studying audio engineering. Current I'm doing a project via self study KSP as part of my course started approximately 2/3 months ago and I learned a lot from the start and to me this is a big jump. I'm still interesting a lot but due to lack of experience and limited resources from uni. I am struggling with how to apply multi scripts function on my design.

    I wonder would anyone be able to spare some time to check out my code / project and give me some guidance please? I really need someone who has experience feedback. So I'm sincerely hope you can help.

    The main things I couldn't found out how to fix the problem right now:
    1. Group's audio couldn't match with shoes selection dropdown menu what I selected, every time when I hit C3 it keep play specific groups ID together. For example: play every 6 til the end of the groups ID list together.
    2. Shoes vol knob - volume not change at all.
    3. Shoes on off switch - couldn't change the sound on and off.
    4. surface selection - any chance I can make it without select specific one it have no sound.
    5. close and far slider - every group had 6 close and 6 far samples, how can I used one slider to make an adjustment?
    Each shoes had 6 round ribbon and 6 velocity with close and far mic.
    Below the links its the instrument looks like:
    https://1drv.ms/u/s!AhlfrR1K6HjvgUW8o5TfIZKSuK2A


    Looking forward to your reply.
    If you want me to upload the project, please do let me know or inbox me.
    Code:
    on init
    
        make_perfview                                 {**********  WALLPAPER  **********}
        set_ui_height_px(632)
        set_control_par_str($INST_WALLPAPER_ID,$CONTROL_PAR_PICTURE,"my_wallpaper")
     
        declare $i
        declare $ID
    
        declare %groups_index[138] := (-1)          {**********  (WorkShoes) WS_master_Groups  **********}
        declare %groups_ID[138]
        declare $_i
        declare $_n := 1
        $_i := 0
        $_n := 1
        while ($_i<=5)   
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 1
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 18
        while ($_i<=23)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 2
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 36
        while ($_i<=41)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 3
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 54
        while ($_i<=59)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 4
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 72
        while ($_i<=77)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 5
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 90
        while ($_i<=95)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 6
        inc($_n)
        inc($_i)
        end while
    
    
        declare %WS_master_included_groups[6] := (1, 2, 3, 4, 5, 6) {CLOSE = 1,2,3  -----  FAR = 4,5,6}
        declare %WS_master_array[36]
        declare $_i2
        declare $_p
        declare $_n2
    
        $_p := 0
        $_i2 := 0
        while ($_i2<138)
        $_n2 := 0
        while ($_n2<num_elements(%WS_master_included_groups))
        end while
        if (%groups_ID[$_i2]=%WS_master_included_groups[$_n2])
        %WS_master_array[$_p] := %groups_index[$_i2]
        inc($_p)
        end if
        inc($_n2)
        inc($_i2)
        end while
    
        $_n := 1                             {**********  (TRAINERS) TS_master_Groups  **********}
        $_i := 6
        while ($_i<=11)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 7
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 24
        while ($_i<=29)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 8
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 42
        while ($_i<=47)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 9
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 60
        while ($_i<=65)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 10
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 78
        while ($_i<=83)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 11
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 96
        while ($_i<=101)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 12
        inc($_n)
        inc($_i)
        end while
    
        declare %TS_master_included_groups[6] := (7, 8, 9, 10, 11, 12) {CLOSE = 7,8,9  -----  FAR = 10,11,12}
        declare %TS_master_array[36]
        $_p := 0
        $_i2 := 0
        while ($_i2<138)
        $_n2 := 0
        while ($_n2<num_elements(%TS_master_included_groups))
        end while
        if (%groups_ID[$_i2]=%TS_master_included_groups[$_n2])
        %TS_master_array[$_p] := %groups_index[$_i2]
        inc($_p)
        end if
        inc($_n2)
        inc($_i2)
        end while
    
        $_n := 1                      {**********  (DRESSING SHOES) DS_master_Groups  **********}
        $_i := 12
        while ($_i<=17)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 13
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 30
        while ($_i<=35)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 14
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 48
        while ($_i<=53)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 15
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 66
        while ($_i<=71)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 16
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 84
        while ($_i<=89)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 17
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 102
        while ($_i<=107)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 18
        inc($_n)
        inc($_i)
        end while
    
        declare %DS_master_included_groups[6] := (13, 14, 15, 16, 17, 18) {CLOSE = 13,14,15  -----  FAR = 16,17,18}
        declare %DS_master_array[36]
        $_p := 0
        $_i2 := 0
        while ($_i2<138)
        $_n2 := 0
        while ($_n2<num_elements(%DS_master_included_groups))
        end while
        if (%groups_ID[$_i2]=%DS_master_included_groups[$_n2])
        %DS_master_array[$_p] := %groups_index[$_i2]
        inc($_p)
        end if
        inc($_n2)
        inc($_i2)
        end while
    
    
        $_n := 1                            {**********  JEANS_master_Groups  **********}
        $_i := 120
        while ($_i<=125)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 19
        inc($_n)
        inc($_i)
        end while
        declare %JEANS_master_included_groups[1] := (19)
        declare %JEANS_master_array[6]
        $_p := 0
        $_i2 := 0
        while ($_i2<138)
        $_n2 := 0
        while ($_n2<num_elements(%JEANS_master_included_groups))
        end while
        if (%groups_ID[$_i2]=%JEANS_master_included_groups[$_n2])
        %JEANS_master_array[$_p] := %groups_index[$_i2]
        inc($_p)
        end if
        inc($_n2)
        inc($_i2)
        end while
    
        $_n := 1                          {**********  SPORT_master_Groups  **********}
        $_i := 126
        while ($_i<=131)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 20
        inc($_n)
        inc($_i)
        end while
        declare %SPORT_master_included_groups[1] := (20)
        declare %SPORT_master_array[6]
        $_p := 0
        $_i2 := 0
        while ($_i2<138)
        $_n2 := 0
        while ($_n2<num_elements(%SPORT_master_included_groups))
        end while
        if (%groups_ID[$_i2]=%SPORT_master_included_groups[$_n2])
        %SPORT_master_array[$_p] := %groups_index[$_i2]
        inc($_p)
        end if
        inc($_n2)
        inc($_i2)
        end while
    
        $_n := 1                           {**********  TROUSERS_master_Groups  **********}
        $_i := 132
        while ($_i<=137)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 21
        inc($_n)
        inc($_i)
        end while
        declare %TROUSERS_master_included_groups[1] := (21)
        declare %TROUSERS_master_array[6]
        $_p := 0
        $_i2 := 0
        while ($_i2<138)
        $_n2 := 0
        while ($_n2<num_elements(%TROUSERS_master_included_groups))
        end while
        if (%groups_ID[$_i2]=%TROUSERS_master_included_groups[$_n2])
        %TROUSERS_master_array[$_p] := %groups_index[$_i2]
        inc($_p)
        end if
        inc($_n2)
        inc($_i2)
        end while
    
        $_n := 1        {**********  COINS_master_Groups  **********}
        $_i := 108
        while ($_i<=113)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 22
        inc($_n)
        inc($_i)
        end while
        declare %COINS_master_included_groups[1] := (22)
        declare %COINS_master_array[6]
        $_p := 0
        $_i2 := 0
        while ($_i2<138)
        $_n2 := 0
        while ($_n2<num_elements(%COINS_master_included_groups))
        end while
        if (%groups_ID[$_i2]=%COINS_master_included_groups[$_n2])
        %COINS_master_array[$_p] := %groups_index[$_i2]
        inc($_p)
        end if
        inc($_n2)
        inc($_i2)
        end while
    
        $_n := 1        {**********  KEYS_master_Groups  **********}
        $_i := 1114
        while ($_i<=119)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 23
        inc($_n)
        inc($_i)
        end while
        declare %KEYS_master_included_groups[1] := (23)
        declare %KEYS_master_array[6]
        $_p := 0
        $_i2 := 0
        while ($_i2<138)
        $_n2 := 0
        while ($_n2<num_elements(%KEYS_master_included_groups))
        end while
        if (%groups_ID[$_i2]=%KEYS_master_included_groups[$_n2])
        %KEYS_master_array[$_p] := %groups_index[$_i2]
        inc($_p)
        end if
        inc($_n2)
        inc($_i2)
        end while
    
        $_i := 0                        {**********  (HW) HW_master_Groups  **********}
        $_n := 1
        while ($_i<=5)   
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 1
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 6
        while ($_i<=11)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 2
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 12
        while ($_i<=17)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 3
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 54
        while ($_i<=59)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 4
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 60
        while ($_i<=65)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 5
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 66
        while ($_i<=71)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 6
        inc($_n)
        inc($_i)
        end while
    
    
        declare %HW_master_included_groups[6] := (24, 25, 26, 27, 28, 29) {CLOSE = 24,25,26  -----  FAR = 27,28,29}
        declare %HW_master_array[36]
    
        $_p := 0
        $_i2 := 0
        while ($_i2<138)
        $_n2 := 0
        while ($_n2<num_elements(%HW_master_included_groups))
        end while
        if (%groups_ID[$_i2]=%HW_master_included_groups[$_n2])
        %HW_master_array[$_p] := %groups_index[$_i2]
        inc($_p)
        end if
        inc($_n2)
        inc($_i2)
        end while
    
    
        $_i := 0                          {**********  (PVC) PVC_master_Groups  **********}
        $_n := 18
        while ($_i<=23)   
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 1
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 24
        while ($_i<=29)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 2
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 30
        while ($_i<=35)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 3
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 72
        while ($_i<=77)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 4
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 78
        while ($_i<=83)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 5
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 84
        while ($_i<=89)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 6
        inc($_n)
        inc($_i)
        end while
    
    
        declare %PVC_master_included_groups[6] := (30, 31, 32, 33, 34, 35) {CLOSE = 30,31,32  -----  FAR = 33,34,35}
        declare %PVC_master_array[36]
    
        $_p := 0
        $_i2 := 0
        while ($_i2<138)
        $_n2 := 0
        while ($_n2<num_elements(%PVC_master_included_groups))
        end while
        if (%groups_ID[$_i2]=%PVC_master_included_groups[$_n2])
        %PVC_master_array[$_p] := %groups_index[$_i2]
        inc($_p)
        end if
        inc($_n2)
        inc($_i2)
        end while
    
    
        $_i := 0                                {**********  (CARPET) CAP_master_Groups  **********}   
        $_n := 36
        while ($_i<=41)   
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 1
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 42
        while ($_i<=47)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 2
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 48
        while ($_i<=53)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 3
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 90
        while ($_i<=95)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 4
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 96
        while ($_i<=101)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 5
        inc($_n)
        inc($_i)
        end while
        $_n := 1
        $_i := 102
        while ($_i<=107)
        %groups_index[$_i] := $_i
        %groups_ID[$_i] := 6
        inc($_n)
        inc($_i)
        end while
    
    
        declare %CAP_master_included_groups[6] := (36, 37, 38, 39, 40, 41) {CLOSE = 36,37,38  -----  FAR = 39,40,41}
        declare %CAP_master_array[36]
    
        $_p := 0
        $_i2 := 0
        while ($_i2<138)
        $_n2 := 0
        while ($_n2<num_elements(%CAP_master_included_groups))
        end while
        if (%groups_ID[$_i2]=%CAP_master_included_groups[$_n2])
        %CAP_master_array[$_p] := %groups_index[$_i2]
        inc($_p)
        end if
        inc($_n2)
        inc($_i2)
        end while
    
    {[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]}
    {[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[  Shoes on off & dropdown & display   ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]}
    {[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]}
    
    
        declare ui_switch $Shoes_on_off_switch{**********  SHOES ON OFF SWITCH  **********}
        move_control_px($Shoes_on_off_switch,40,25)
        make_persistent($Shoes_on_off_switch)
        set_control_par(get_ui_id($Shoes_on_off_switch),$CONTROL_PAR_WIDTH,30)
        set_control_par(get_ui_id($Shoes_on_off_switch),$CONTROL_PAR_HEIGHT,30)
        set_control_par_str(get_ui_id($Shoes_on_off_switch),$CONTROL_PAR_TEXT,"")
        set_control_par_str(get_ui_id($Shoes_on_off_switch),$CONTROL_PAR_PICTURE,"switch_on_off")
        set_control_par_str(get_ui_id($Shoes_on_off_switch),$CONTROL_PAR_HELP,"Shoes: On / Off switch.")
    
        declare ui_menu $Shoes_DropDown_Menu{**********  SHOES DROP DOWN MENU  **********}
            make_persistent($Shoes_DropDown_Menu)
        
            set_control_par(get_ui_id($Shoes_DropDown_Menu),$CONTROL_PAR_WIDTH,136)
            set_control_par(get_ui_id($Shoes_DropDown_Menu),$CONTROL_PAR_HEIGHT,25)
            set_control_par(get_ui_id($Shoes_DropDown_Menu),$CONTROL_PAR_FONT_TYPE,18)
            set_control_par(get_ui_id($Shoes_DropDown_Menu),$CONTROL_PAR_TEXT_ALIGNMENT,1)
            set_control_par(get_ui_id($Shoes_DropDown_Menu),$CONTROL_PAR_TEXTPOS_Y,6)
            set_control_par_str(get_ui_id($Shoes_DropDown_Menu),$CONTROL_PAR_PICTURE,"big_drop_down_menu")
            set_control_par_str(get_ui_id($Shoes_DropDown_Menu),$CONTROL_PAR_HELP,"Selection of Shoes")
    
        declare ui_label $Shoes_Display (100, 100){**********  SHOES DISPLAY  **********}
        
            set_text($Shoes_Display, "")
            move_control_px($Shoes_Display, 45, 115)
            set_control_par(get_ui_id($Shoes_Display), $CONTROL_PAR_HEIGHT , 150)
            set_control_par(get_ui_id($Shoes_Display), $CONTROL_PAR_WIDTH, 200)
            set_control_par_str(get_ui_id($Shoes_Display), $CONTROL_PAR_PICTURE, "Shoes_Display")
    
            add_menu_item ($Shoes_DropDown_Menu, "WORK SHOES", 0)
            add_menu_item ($Shoes_DropDown_Menu, "TRAINERS", 1)
            add_menu_item ($Shoes_DropDown_Menu, "DRESSING SHOES", 2)
    
    
         $Shoes_on_off_switch := 0 {$Shoes_on_off_switch is off by default, so hide $ShoesDropDownMenu}
             move_control ($Shoes_DropDown_Menu,0,0)
             move_control ($Shoes_Display, 0, 0)
             move_control_px ($Shoes_on_off_switch,40,25)
             make_persistent ($Shoes_on_off_switch)
             make_persistent ($Shoes_DropDown_Menu)
             make_persistent ($Shoes_Display)
        
            read_persistent_var($Shoes_DropDown_Menu)
            read_persistent_var ($Shoes_on_off_switch)
     
        if ($Shoes_on_off_switch = 1)
            move_control_px ($Shoes_DropDown_Menu, 0,80)
            move_control_px($Shoes_Display, 45, 115)
        else
            move_control ($Shoes_DropDown_Menu,0,0)
            move_control($Shoes_Display, 0, 0)
        end if
    
        declare ui_slider $SHOES_Vol(1, 1000000){**********  SHOES VOLUME KNOB  **********}
        move_control_px($SHOES_Vol,12,115)
        make_persistent($SHOES_Vol)
        read_persistent_var($SHOES_Vol)
        set_knob_defval($SHOES_Vol,500000)
        set_control_par_str(get_ui_id($SHOES_Vol),$CONTROL_PAR_PICTURE,"gold_vol_knob")
        set_control_par(get_ui_id($SHOES_Vol),$CONTROL_PAR_MOUSE_BEHAVIOUR,-600)
        set_control_par_str(get_ui_id($SHOES_Vol),$CONTROL_PAR_HELP,"Volume: Change current playback level of shoe.")
    
    {[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]}
    {[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[   EXTRA on off & dropdown & display  ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]}
    {[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]}
    
        declare ui_switch $Extra_on_off_switch{**********  EXTRA ON OFF SWITCH  **********}
        move_control_px($Extra_on_off_switch,550,25)
        make_persistent($Extra_on_off_switch)
        set_control_par(get_ui_id($Extra_on_off_switch),$CONTROL_PAR_WIDTH,30)
        set_control_par(get_ui_id($Extra_on_off_switch),$CONTROL_PAR_HEIGHT,30)
        set_control_par_str(get_ui_id($Extra_on_off_switch),$CONTROL_PAR_TEXT,"")
        set_control_par_str(get_ui_id($Extra_on_off_switch),$CONTROL_PAR_HELP,"Extra: On / Off switch.")
        set_control_par_str(get_ui_id($Extra_on_off_switch),$CONTROL_PAR_PICTURE,"switch_on_off")
    
        declare ui_menu $Extra_DropDown_Menu{**********  Extra DROP DOWN MENU  **********}
            make_persistent($Extra_DropDown_Menu)
    
            set_control_par(get_ui_id($Extra_DropDown_Menu),$CONTROL_PAR_WIDTH,136)
            set_control_par(get_ui_id($Extra_DropDown_Menu),$CONTROL_PAR_HEIGHT,25)
            set_control_par(get_ui_id($Extra_DropDown_Menu),$CONTROL_PAR_FONT_TYPE,18)
            set_control_par(get_ui_id($Extra_DropDown_Menu),$CONTROL_PAR_TEXT_ALIGNMENT,1)
            set_control_par(get_ui_id($Extra_DropDown_Menu),$CONTROL_PAR_TEXTPOS_Y,6)
            set_control_par_str(get_ui_id($Extra_DropDown_Menu),$CONTROL_PAR_PICTURE,"big_drop_down_menu")
            set_control_par_str(get_ui_id($Extra_DropDown_Menu),$CONTROL_PAR_HELP,"Selection of Extra Material")
    
        declare ui_label $Extra_Display (100, 100){**********  Extra DISPLAY  **********}
        
            set_text($Extra_Display, "")
            move_control_px($Extra_Display, 385, 98)
            set_control_par(get_ui_id($Extra_Display), $CONTROL_PAR_HEIGHT , 100)
            set_control_par(get_ui_id($Extra_Display), $CONTROL_PAR_WIDTH, 100)
            set_control_par_str(get_ui_id($Extra_Display), $CONTROL_PAR_PICTURE, "Extra_Group")
    
            add_menu_item ($Extra_DropDown_Menu, "JEANS", 0)
            add_menu_item ($Extra_DropDown_Menu, "SPORTS", 1)
            add_menu_item ($Extra_DropDown_Menu, "TROUSERS", 2)
            add_menu_item ($Extra_DropDown_Menu, "COINS", 3)
            add_menu_item ($Extra_DropDown_Menu, "KEYS", 4)
    
         $Extra_on_off_switch := 0 {$Extras_on_off_switch is off by default, so hide $ShoesDropDownMenu}
             move_control ($Extra_DropDown_Menu,0,0)
             move_control ($Extra_Display, 0, 0)
             move_control_px ($Extra_on_off_switch,550,25)
             make_persistent ($Extra_on_off_switch)
             make_persistent ($Extra_DropDown_Menu)
             make_persistent ($Extra_Display)
        
    
            read_persistent_var ($Extra_on_off_switch)
     
        if ($Extra_on_off_switch = 1)
            move_control_px ($Extra_DropDown_Menu,495,80)
            move_control_px($Extra_Display, 385, 98)
        else
            move_control ($Extra_DropDown_Menu,0,0)
            move_control($Extra_Display, 0, 0)
        end if
    
        declare ui_slider $EXTRA_Vol(1, 1000000){**********  EXTRA VOLUME KNOB  **********}
        move_control_px($EXTRA_Vol,575,115)
        make_persistent($EXTRA_Vol)
        read_persistent_var($EXTRA_Vol)
        set_knob_defval($EXTRA_Vol,500000)
        set_control_par_str(get_ui_id($EXTRA_Vol),$CONTROL_PAR_PICTURE,"gold_vol_knob")
        set_control_par(get_ui_id($EXTRA_Vol),$CONTROL_PAR_MOUSE_BEHAVIOUR,-600)
        set_control_par_str(get_ui_id($EXTRA_Vol),$CONTROL_PAR_HELP,"Volume: Change current playback level of extra material.")
    
    {[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]}
    {[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[        CLOSE & FAR SLIDER        ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]}
    {[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]}
    
        declare ui_slider $close_far(0, 100000)         {**********  CLOSE & FAR SLIDER  **********}
        $close_far := 50000
        move_control_px($close_far,314,50)
        set_control_par_str(get_ui_id($close_far),$CONTROL_PAR_PICTURE,"close_far_slider")
        set_control_par(get_ui_id($close_far),$CONTROL_PAR_WIDTH,15)
        set_control_par(get_ui_id($close_far),$CONTROL_PAR_HEIGHT,220)
        set_control_par(get_ui_id($close_far),$CONTROL_PAR_MOUSE_BEHAVIOUR,-2000)
        set_control_par(get_ui_id($close_far),$CONTROL_PAR_DEFAULT_VALUE,0)
        set_control_par_str(get_ui_id($close_far),$CONTROL_PAR_HELP,"Proximity: Use pitchbend to blend from close (pitch down) to far perspective (pitch up).")
        make_persistent($Shoes_Vol)
        make_persistent($EXTRA_Vol)
    
        declare ui_button $HARDWOODswitch          {**********  HARDWOOD SWITCH  **********}
        move_control_px($HARDWOODswitch,145,359)
        make_persistent($HARDWOODswitch)
        read_persistent_var($HARDWOODswitch)
        set_control_par_str(get_ui_id($HARDWOODswitch),$CONTROL_PAR_PICTURE,"HARDWOOD_on_off")
        set_control_par(get_ui_id($HARDWOODswitch),$CONTROL_PAR_WIDTH,146)
        set_control_par(get_ui_id($HARDWOODswitch),$CONTROL_PAR_HEIGHT,46)
        set_control_par_str(get_ui_id($HARDWOODswitch),$CONTROL_PAR_TEXT,"")
        set_control_par_str(get_ui_id($HARDWOODswitch),$CONTROL_PAR_HELP,"Hardwood flooring Surface: On / Off switch. (When the tab is light mean ' On ' , When the tab is dark ' Off ').")
    
        declare ui_button $CARPETswitch           {**********  CARPET SWITCH  **********}
        move_control_px($CARPETswitch,305,359)
        make_persistent($CARPETswitch)
        read_persistent_var($CARPETswitch)
        set_control_par_str(get_ui_id($CARPETswitch),$CONTROL_PAR_PICTURE,"CARPET_on_off")
        set_control_par(get_ui_id($CARPETswitch),$CONTROL_PAR_WIDTH,176)
        set_control_par(get_ui_id($CARPETswitch),$CONTROL_PAR_HEIGHT,46)
        set_control_par_str(get_ui_id($CARPETswitch),$CONTROL_PAR_TEXT,"")
        set_control_par_str(get_ui_id($CARPETswitch),$CONTROL_PAR_HELP,"Carpet flooring surface: On / Off switch. (When the tab is light mean ' On ' , When the tab is dark ' Off ').")
    
     
        declare ui_button $PVCswitch                {**********  PVC SWITCH  **********}
        move_control_px($PVCswitch,465,359)
        make_persistent($PVCswitch)
        read_persistent_var($PVCswitch)
        set_control_par_str(get_ui_id($PVCswitch),$CONTROL_PAR_PICTURE,"PVC_on_off")
        set_control_par(get_ui_id($PVCswitch),$CONTROL_PAR_WIDTH,146)
        set_control_par(get_ui_id($PVCswitch),$CONTROL_PAR_HEIGHT,46)
        set_control_par_str(get_ui_id($PVCswitch),$CONTROL_PAR_TEXT,"")
        set_control_par_str(get_ui_id($PVCswitch),$CONTROL_PAR_HELP,"PVC flooring surface: On / Off switch. (When the tab is light mean ' On ' , When the tab is dark ' Off ').")
    
    function UpdatePic {**********.      DISPLAY CONTROL  **********}
        set_control_par(get_ui_id($Shoes_Display), $CONTROL_PAR_PICTURE_STATE, $Shoes_DropDown_Menu)
        set_control_par(get_ui_id($Extra_Display), $CONTROL_PAR_PICTURE_STATE, $Extra_DropDown_Menu)
    end function
    
    on persistence_changed
        call UpdatePic
    end on
    
    
    
    on ui_control($SHOES_Vol)
    if ($Shoes_DropDown_Menu=0)
    $i := 0
    while ($i<num_elements(%WS_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$SHOES_Vol,%WS_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    if ($Shoes_DropDown_Menu=1)
    $i := 0
    while ($i<num_elements(%TS_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$SHOES_Vol,%TS_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    if ($Shoes_DropDown_Menu=2)
    $i := 0
    while ($i<num_elements(%DS_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$SHOES_Vol,%DS_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    end on
    
    on ui_control($EXTRA_Vol)
    if ($Extra_DropDown_Menu=0)
    $i := 0
    while ($i<num_elements(%JEANS_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$EXTRA_Vol,%JEANS_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    if ($Extra_DropDown_Menu=1)
    $i := 0
    while ($i<num_elements(%SPORT_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$EXTRA_Vol,%SPORT_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    if ($Extra_DropDown_Menu=2)
    $i := 0
    while ($i<num_elements(%TROUSERS_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$EXTRA_Vol,%TROUSERS_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    if ($Extra_DropDown_Menu=3)
    $i := 0
    while ($i<num_elements(%COINS_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$EXTRA_Vol,%COINS_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    if ($Extra_DropDown_Menu=4)
    $i := 0
    while ($i<num_elements(%KEYS_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$EXTRA_Vol,%KEYS_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    end on
    
    
    
    on ui_control($Shoes_DropDown_Menu)
        select ($Shoes_DropDown_Menu)
        case 0
            $i := 0
            while ($i<138)
            purge_group($i,0)
            inc($i)
            end while
            if ($Shoes_DropDown_Menu=0)
            $i := 0
            while ($i<num_elements(%WS_master_array))
            purge_group(%WS_master_array[$i],1)
            inc($i)
            end while
            end if
            if ($Shoes_DropDown_Menu=1)
            $i := 0
            while ($i<num_elements(%TS_master_array))
            purge_group(%TS_master_array[$i],1)
            inc($i)
            end while
            end if
            if ($Shoes_DropDown_Menu=2)
            $i := 0
            while ($i<num_elements(%DS_master_array))
            purge_group(%DS_master_array[$i],1)
            inc($i)
            end while
            end if
            if ($HARDWOODswitch = 0)
            $i := 0
            while ($i<num_elements(%HW_master_array))
            purge_group(%HW_master_array[$i],0)
            inc($i)
            end while
            end if
            if ($CARPETswitch = 0)
            $i := 0
            while ($i<num_elements(%CAP_master_array))
            purge_group(%CAP_master_array[$i],0)
            inc($i)
            end while
            end if
            if ($PVCswitch = 0)
            $i := 0
            while ($i<num_elements(%PVC_master_array))
            purge_group(%PVC_master_array[$i],0)
            inc($i)
            end while
            end if
        end select
    end on
    
    
    on ui_control($Extra_DropDown_Menu)
        select ($Extra_DropDown_Menu)
        case 0
            $i := 0
            while ($i<138)
            purge_group($i,0)
            inc($i)
            end while
            if ($Extra_DropDown_Menu=0)
            $i := 0
                while ($i<num_elements(%JEANS_master_array))
                purge_group(%JEANS_master_array[$i],1)
                inc($i)
                end while
            end if
            if ($Extra_DropDown_Menu=1)
            $i := 0
                while ($i<num_elements(%SPORT_master_array))
                purge_group(%SPORT_master_array[$i],1)
                inc($i)
                end while
            end if
            if ($Extra_DropDown_Menu=2)
            $i := 0
                while ($i<num_elements(%TROUSERS_master_array))
                purge_group(%TROUSERS_master_array[$i],1)
                inc($i)
                end while
            end if
            if ($Extra_DropDown_Menu=3)
            $i := 0
                while ($i<num_elements(%COINS_master_array))
                purge_group(%COINS_master_array[$i],1)
                inc($i)
                end while
            end if
            if ($Extra_DropDown_Menu=4)
            $i := 0
                while ($i<num_elements(%KEYS_master_array))
                purge_group(%KEYS_master_array[$i],1)
                inc($i)
                end while
            end if
        end select
        end on
    
    
    on ui_control ($Shoes_DropDown_Menu)
        call UpdatePic
    end on
    
    on ui_control ($Extra_DropDown_Menu)
        call UpdatePic
    end on
    
    on ui_control ($Shoes_on_off_switch){**********  SHOES ON OFF CONTROL DISPLAY+MENU, POP UP & DISAPPEARED **********}
        if ($Shoes_on_off_switch = 1)
          move_control_px ($Shoes_DropDown_Menu,0,80)
          move_control_px ($Shoes_Display, 45, 115)
        else
          move_control ($Shoes_DropDown_Menu,0,0)
          move_control($Shoes_Display, 0, 0)
        end if
    end on
    
    
    on ui_control ($Extra_on_off_switch){**********  Extra ON OFF CONTROL DISPLAY+MENU, POP UP & DISAPPEARED **********}
        if ($Extra_on_off_switch = 1)
          move_control_px ($Extra_DropDown_Menu,495,80)
          move_control_px ($Extra_Display, 385, 98)
        else
          move_control ($Extra_DropDown_Menu,0,0)
          move_control($Extra_Display, 0, 0)
        end if
    end on
    
    on note
    if ($Shoes_on_off_switch = 0)
    disallow_group(0)
    end if
    if (Extra_on_off_switch = 0)
    end if
    
    $vol_value := get_control_par(get_ui_id($SHOES_Vol),$CONTROL_PAR_VALUE)
    if ($Shoes_DropDown_Menu=0)
    $i := 0
    while ($i<num_elements(%WS_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$vol_value,%WS_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    if ($Shoes_DropDown_Menu=1)
    $i := 0
    while ($i<num_elements(%TS_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$vol_value,%TS_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    if ($Shoes_DropDown_Menu=2)
    $i := 0
    while ($i<num_elements(%DS_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$vol_value,%DS_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    
    $vol_value := get_control_par(get_ui_id($EXTRA_Vol),$CONTROL_PAR_VALUE)
    if ($Extra_DropDown_Menu=0)
    $i := 0
    while ($i<num_elements(%JEANS_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$EXTRA_Vol,%JEANS_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    if ($Extra_DropDown_Menu=1)
    $i := 0
    while ($i<num_elements(%SPORT_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$EXTRA_Vol,%SPORT_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    if ($Extra_DropDown_Menu=2)
    $i := 0
    while ($i<num_elements(%TROUSERS_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$EXTRA_Vol,%TROUSERS_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    if ($Extra_DropDown_Menu=3)
    $i := 0
    while ($i<num_elements(%COINS_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$EXTRA_Vol,%COINS_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    if ($Extra_DropDown_Menu=4)
    $i := 0
    while ($i<num_elements(%KEYS_master_array))
    set_engine_par($ENGINE_PAR_VOLUME,$EXTRA_Vol,%KEYS_master_array[$i],-1,-1)
    inc($i)
    end while
    end if
    
    
    end on
    
     
    Last edited: Aug 5, 2019
  2. showard

    showard NI Product Owner

    Messages:
    69
    What's up with the shoes, jeans, trousers, keys, coins, carpet, and hardwood?
    Is there a musical instrument in there somewhere?
     
  3. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    It's foley sounds.