{ ****************************************************
KGM TEMPLATE INSTRUMENT
Author: RIGID AUDIO
**************************************************** }

{ BEGIN ON INIT }
on init
    hide_inst_icon
    make_perfview
    set_ui_height_px(540)  { adjust size to your needs here }
    set_skin_offset(0)     { SKIN OFFSET }
    set_script_title("Main")
    
    { 3D DEPTH                                              1 }
    declare const        $KGM_GROUP_OFFSET               := 1
    declare              $KGM_GROUP_COUNT                := 1
    declare              $KGM_FX_QUERY                   := 1
    declare              $KGM_SEND_QUERY                 := 1 
    
    declare              $KGM_GROUP_A                    := 0
    declare              $KGM_GROUP_B                    := 0
    declare              $KGM_GROUP_C                    := 0
    declare              $KGM_GROUP_D                    := 0
    declare              $KGM_GROUP_E                    := 0
    declare              $KGM_GROUP_F                    := 0
    declare              $KGM_GROUP_G                    := 0
    declare              $KGM_GROUP_H                    := 0
    declare              $KGM_GROUP_I                    := 0
    declare              $KGM_GROUP_J                    := 0
    declare              $KGM_GROUP_A_ACTIVE             := 1
    declare              $KGM_GROUP_B_ACTIVE             := 0
    declare              $KGM_GROUP_C_ACTIVE             := 0
    declare              $KGM_GROUP_D_ACTIVE             := 0    
	declare              $KGM_GROUP_E_ACTIVE             := 0
    declare              $KGM_GROUP_F_ACTIVE             := 0
    declare              $KGM_GROUP_G_ACTIVE             := 0
    declare              $KGM_GROUP_H_ACTIVE             := 0
	declare              $KGM_GROUP_I_ACTIVE             := 0
    declare              $KGM_GROUP_J_ACTIVE             := 0
    declare              $KGM_CONTROL_ALL_GROUPS         := 1
    declare              $KGM_ACTIVE_GROUPS              := 1
    
    declare              $KGM_MULTISAMPLE_MODE           := 0
    
    { BUSSES }
    declare              $BUS1_VOLUME                    := 630000
    declare              $BUS2_VOLUME                    := 630000
    declare              $BUS3_VOLUME                    := 630000
    declare              $BUS4_VOLUME                    := 630000
    declare              $BUS5_VOLUME                    := 630000
    declare              $BUS6_VOLUME                    := 630000
    declare              $BUS7_VOLUME                    := 630000
    declare              $BUS8_VOLUME                    := 630000
    declare              $BUS9_VOLUME                    := 630000
    declare              $BUS10_VOLUME                   := 630000
    declare              $BUS11_VOLUME                   := 630000
    declare              $BUS12_VOLUME                   := 630000
    declare              $BUS13_VOLUME                   := 630000
    declare              $BUS14_VOLUME                   := 630000
    declare              $BUS15_VOLUME                   := 630000
    declare              $BUS16_VOLUME                   := 630000
    make_persistent     ($BUS1_VOLUME)
    make_persistent     ($BUS2_VOLUME)
    make_persistent     ($BUS3_VOLUME)
    make_persistent     ($BUS4_VOLUME)
    make_persistent     ($BUS5_VOLUME)
    make_persistent     ($BUS6_VOLUME)
    make_persistent     ($BUS7_VOLUME)
    make_persistent     ($BUS8_VOLUME)   
    make_persistent     ($BUS9_VOLUME)
    make_persistent     ($BUS10_VOLUME)
    make_persistent     ($BUS11_VOLUME)
    make_persistent     ($BUS12_VOLUME)   
    make_persistent     ($BUS13_VOLUME)
    make_persistent     ($BUS14_VOLUME)
    make_persistent     ($BUS15_VOLUME)
    make_persistent     ($BUS16_VOLUME)
    read_persistent_var ($BUS1_VOLUME)    
    read_persistent_var ($BUS2_VOLUME)
    read_persistent_var ($BUS3_VOLUME)
    read_persistent_var ($BUS4_VOLUME)
    read_persistent_var ($BUS5_VOLUME)    
    read_persistent_var ($BUS6_VOLUME)
    read_persistent_var ($BUS7_VOLUME)
    read_persistent_var ($BUS8_VOLUME)   
    read_persistent_var ($BUS9_VOLUME)    
    read_persistent_var ($BUS10_VOLUME)
    read_persistent_var ($BUS11_VOLUME)
    read_persistent_var ($BUS12_VOLUME)   
    read_persistent_var ($BUS13_VOLUME)    
    read_persistent_var ($BUS14_VOLUME)
    read_persistent_var ($BUS15_VOLUME)
    read_persistent_var ($BUS16_VOLUME)               
    
    { BEGIN PGS DECLARE }
    pgs_create_key (PGS_ARP_ON,1)
    pgs_create_key (PGS_ARP_ORDER,1)
    pgs_create_key (PGS_ARP_OCTAVE,1)
    pgs_create_key (PGS_ARP_STRIKE,1)
    pgs_create_key (PGS_ARP_RATE,1)
    pgs_create_key (PGS_ARP_DURATION,1)
    pgs_create_key (PGS_ARP_SWING,1)
    
    pgs_create_key (PGS_MONO_MODE,1)
    pgs_create_key (PGS_MONO_PRIO,1)
    pgs_create_key (PGS_GLIDE_MODE,1)
    pgs_create_key (PGS_GLIDE_RATE,1)
    
    pgs_create_key (PGS_UNI_VOICES,1)
    pgs_create_key (PGS_UNI_DETUNE,1)
    pgs_create_key (PGS_UNI_SPREAD,1)
    { END PGS DECLARE }
    
    { LISTENERS }
    set_listener        ($NI_SIGNAL_TIMER_MS,18000)
    declare              $KGM_ANIM_STEP                  := 0
    declare              $KGM_ANIM_FRAMES_MAX            := 99

    { KGM NOTE SEQUENCER }
    declare              $KGM_NOTE_SEQUENCER_ARR_COUNT   := 0

    declare              %KGM_NOTE_SEQUENCER_ARRAY[128]
    make_persistent     (%KGM_NOTE_SEQUENCER_ARRAY)    
    read_persistent_var (%KGM_NOTE_SEQUENCER_ARRAY)
        
    declare              $KGM_NOTE_SEQUENCER_STEPS_SHOWN := 16
    make_persistent     ($KGM_NOTE_SEQUENCER_STEPS_SHOWN)    
    read_persistent_var ($KGM_NOTE_SEQUENCER_STEPS_SHOWN)        
    
    declare              $KGM_NOTE_SEQUENCER_ENABLE      := 0
    make_persistent     ($KGM_NOTE_SEQUENCER_ENABLE)
    read_persistent_var ($KGM_NOTE_SEQUENCER_ENABLE)
    
    declare              $KGM_NOTE_ID                    := 0
    declare              $KGM_FIRST_NOTE                 := 0
    declare              $KGM_WAIT_EVENT                 := 0
    declare              $KGM_CHK_NOTES                  := 0
    declare              $KGM_NCOUNT                     := 0
    declare              $KGM_SEQUENCER_POS              := 0
    declare              $KGM_SEQUENCER_DURATION         := 0
                         $KGM_SEQUENCER_DURATION         := $DURATION_SIXTEENTH
    make_persistent     ($KGM_SEQUENCER_DURATION)
    read_persistent_var ($KGM_SEQUENCER_DURATION)

    { GROUPS }
    make_persistent     ($KGM_GROUP_A)
    make_persistent     ($KGM_GROUP_B)
    make_persistent     ($KGM_GROUP_C)
    make_persistent     ($KGM_GROUP_D)
    make_persistent     ($KGM_GROUP_E)
    make_persistent     ($KGM_GROUP_F)
    make_persistent     ($KGM_GROUP_G)
    make_persistent     ($KGM_GROUP_H)
    make_persistent     ($KGM_GROUP_I)
    make_persistent     ($KGM_GROUP_J)
    make_persistent     ($KGM_GROUP_A_ACTIVE)
    make_persistent     ($KGM_GROUP_B_ACTIVE)
    make_persistent     ($KGM_GROUP_C_ACTIVE)
    make_persistent     ($KGM_GROUP_D_ACTIVE)
	make_persistent     ($KGM_GROUP_E_ACTIVE)
    make_persistent     ($KGM_GROUP_F_ACTIVE)
    make_persistent     ($KGM_GROUP_G_ACTIVE)
    make_persistent     ($KGM_GROUP_H_ACTIVE)
	make_persistent     ($KGM_GROUP_I_ACTIVE)
    make_persistent     ($KGM_GROUP_J_ACTIVE)
    make_persistent     ($KGM_CONTROL_ALL_GROUPS)
    make_persistent     ($KGM_ACTIVE_GROUPS)

    read_persistent_var ($KGM_GROUP_A)
    read_persistent_var ($KGM_GROUP_B)
    read_persistent_var ($KGM_GROUP_C)
    read_persistent_var ($KGM_GROUP_D)
    read_persistent_var ($KGM_GROUP_E)
    read_persistent_var ($KGM_GROUP_F)
    read_persistent_var ($KGM_GROUP_G)
    read_persistent_var ($KGM_GROUP_H)
	read_persistent_var ($KGM_GROUP_I)
    read_persistent_var ($KGM_GROUP_J)
    read_persistent_var ($KGM_GROUP_A_ACTIVE)
    read_persistent_var ($KGM_GROUP_B_ACTIVE)
    read_persistent_var ($KGM_GROUP_C_ACTIVE)
    read_persistent_var ($KGM_GROUP_D_ACTIVE)
	read_persistent_var ($KGM_GROUP_E_ACTIVE)
    read_persistent_var ($KGM_GROUP_F_ACTIVE)
    read_persistent_var ($KGM_GROUP_G_ACTIVE)
    read_persistent_var ($KGM_GROUP_H_ACTIVE)
	read_persistent_var ($KGM_GROUP_I_ACTIVE)
    read_persistent_var ($KGM_GROUP_J_ACTIVE)
    read_persistent_var ($KGM_CONTROL_ALL_GROUPS)
    read_persistent_var ($KGM_ACTIVE_GROUPS)

    { BEGIN DECLARE               $slider7892064 }
    declare ui_slider             $slider7892064(0,1000000)
    make_persistent              ($slider7892064)
    read_persistent_var          ($slider7892064)
    set_control_par_str(get_ui_id($slider7892064),$CONTROL_PAR_PICTURE,"kgm_encoder_red_led")
    set_control_par_str(get_ui_id($slider7892064),$CONTROL_PAR_HELP,"")
    set_control_par_str(get_ui_id($slider7892064),$CONTROL_PAR_TEXT,"")
    set_control_par_str(get_ui_id($slider7892064),$CONTROL_PAR_AUTOMATION_NAME,"slider7892064")
    set_control_par    (get_ui_id($slider7892064),$CONTROL_PAR_ALLOW_AUTOMATION,1)
    set_control_par    (get_ui_id($slider7892064),$CONTROL_PAR_MIN_VALUE,0)
    set_control_par    (get_ui_id($slider7892064),$CONTROL_PAR_MAX_VALUE,1000000)
    set_control_par    (get_ui_id($slider7892064),$CONTROL_PAR_DEFAULT_VALUE,0)
    set_control_par    (get_ui_id($slider7892064),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
    set_control_par    (get_ui_id($slider7892064),$CONTROL_PAR_WIDTH,70)
    set_control_par    (get_ui_id($slider7892064),$CONTROL_PAR_HEIGHT,70)
    set_control_par    (get_ui_id($slider7892064),$CONTROL_PAR_POS_X,96)
    set_control_par    (get_ui_id($slider7892064),$CONTROL_PAR_POS_Y,435)
    { PNG FILENAME                $slider7892064, "user/kgm_encoder_red_led.png" }
    { IS 3D                       $slider7892064, 0 }
    { 3D SHAPE                    $slider7892064, 1 }
    { 3D RADIUS                   $slider7892064, 1 }
    { 3D LENGTH                   $slider7892064, 1 }
    { BEGIN ACTION                $slider7892064 }
    { ACTION FILE                 $slider7892064, "envelope/grp ampenv decay.txt" }
    declare $slider7892064_GRP_CURRENT := 1
    declare $slider7892064_GRP_BEGIN   := 1
    declare $slider7892064_GRP_END     := 0
            $slider7892064_GRP_END     := $NUM_GROUPS-1 { REQUIRED }
    { END ACTION                  $slider7892064 }
    { GROUP MODE                  $slider7892064, 0 }
    { GROUP SINGLE                $slider7892064, 1 }
    { GROUP FROM                  $slider7892064, 1 }
    { GROUP TO                    $slider7892064, 1 }
    { RANDOMIZE LAYER             $slider7892064, 0 }
    { END DECLARE                 $slider7892064 }

    { BEGIN DECLARE               $slider1046315 }
    declare ui_slider             $slider1046315(0,1000000)
    make_persistent              ($slider1046315)
    read_persistent_var          ($slider1046315)
    set_control_par_str(get_ui_id($slider1046315),$CONTROL_PAR_PICTURE,"kgm_encoder_red_led")
    set_control_par_str(get_ui_id($slider1046315),$CONTROL_PAR_HELP,"")
    set_control_par_str(get_ui_id($slider1046315),$CONTROL_PAR_TEXT,"")
    set_control_par_str(get_ui_id($slider1046315),$CONTROL_PAR_AUTOMATION_NAME,"slider1046315")
    set_control_par    (get_ui_id($slider1046315),$CONTROL_PAR_ALLOW_AUTOMATION,1)
    set_control_par    (get_ui_id($slider1046315),$CONTROL_PAR_MIN_VALUE,0)
    set_control_par    (get_ui_id($slider1046315),$CONTROL_PAR_MAX_VALUE,1000000)
    set_control_par    (get_ui_id($slider1046315),$CONTROL_PAR_DEFAULT_VALUE,0)
    set_control_par    (get_ui_id($slider1046315),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
    set_control_par    (get_ui_id($slider1046315),$CONTROL_PAR_WIDTH,70)
    set_control_par    (get_ui_id($slider1046315),$CONTROL_PAR_HEIGHT,70)
    set_control_par    (get_ui_id($slider1046315),$CONTROL_PAR_POS_X,176)
    set_control_par    (get_ui_id($slider1046315),$CONTROL_PAR_POS_Y,435)
    { PNG FILENAME                $slider1046315, "user/kgm_encoder_red_led.png" }
    { IS 3D                       $slider1046315, 0 }
    { 3D SHAPE                    $slider1046315, 1 }
    { 3D RADIUS                   $slider1046315, 1 }
    { 3D LENGTH                   $slider1046315, 1 }
    { BEGIN ACTION                $slider1046315 }
    { ACTION FILE                 $slider1046315, "envelope/grp ampenv release.txt" }
    declare $slider1046315_GRP_CURRENT := 1
    declare $slider1046315_GRP_BEGIN   := 1
    declare $slider1046315_GRP_END     := 0
            $slider1046315_GRP_END     := $NUM_GROUPS-1 { REQUIRED }
    { END ACTION                  $slider1046315 }
    { GROUP MODE                  $slider1046315, 0 }
    { GROUP SINGLE                $slider1046315, 1 }
    { GROUP FROM                  $slider1046315, 1 }
    { GROUP TO                    $slider1046315, 1 }
    { RANDOMIZE LAYER             $slider1046315, 0 }
    { END DECLARE                 $slider1046315 }

    { BEGIN DECLARE               $slider1646665 }
    declare ui_slider             $slider1646665(0,1000000)
    make_persistent              ($slider1646665)
    read_persistent_var          ($slider1646665)
    set_control_par_str(get_ui_id($slider1646665),$CONTROL_PAR_PICTURE,"kgm_encoder_red_led")
    set_control_par_str(get_ui_id($slider1646665),$CONTROL_PAR_HELP,"")
    set_control_par_str(get_ui_id($slider1646665),$CONTROL_PAR_TEXT,"")
    set_control_par_str(get_ui_id($slider1646665),$CONTROL_PAR_AUTOMATION_NAME,"slider1646665")
    set_control_par    (get_ui_id($slider1646665),$CONTROL_PAR_ALLOW_AUTOMATION,1)
    set_control_par    (get_ui_id($slider1646665),$CONTROL_PAR_MIN_VALUE,0)
    set_control_par    (get_ui_id($slider1646665),$CONTROL_PAR_MAX_VALUE,1000000)
    set_control_par    (get_ui_id($slider1646665),$CONTROL_PAR_DEFAULT_VALUE,0)
    set_control_par    (get_ui_id($slider1646665),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
    set_control_par    (get_ui_id($slider1646665),$CONTROL_PAR_WIDTH,70)
    set_control_par    (get_ui_id($slider1646665),$CONTROL_PAR_HEIGHT,70)
    set_control_par    (get_ui_id($slider1646665),$CONTROL_PAR_POS_X,256)
    set_control_par    (get_ui_id($slider1646665),$CONTROL_PAR_POS_Y,435)
    { PNG FILENAME                $slider1646665, "user/kgm_encoder_red_led.png" }
    { IS 3D                       $slider1646665, 0 }
    { 3D SHAPE                    $slider1646665, 1 }
    { 3D RADIUS                   $slider1646665, 1 }
    { 3D LENGTH                   $slider1646665, 1 }
    { BEGIN ACTION                $slider1646665 }
    { ACTION FILE                 $slider1646665, "envelope/grp ampenv sustain.txt" }
    declare $slider1646665_GRP_CURRENT := 1
    declare $slider1646665_GRP_BEGIN   := 1
    declare $slider1646665_GRP_END     := 0
            $slider1646665_GRP_END     := $NUM_GROUPS-1 { REQUIRED }
    { END ACTION                  $slider1646665 }
    { GROUP MODE                  $slider1646665, 0 }
    { GROUP SINGLE                $slider1646665, 1 }
    { GROUP FROM                  $slider1646665, 1 }
    { GROUP TO                    $slider1646665, 1 }
    { RANDOMIZE LAYER             $slider1646665, 0 }
    { END DECLARE                 $slider1646665 }

    { BEGIN DECLARE               $slider6252498 }
    declare ui_slider             $slider6252498(0,1000000)
    make_persistent              ($slider6252498)
    read_persistent_var          ($slider6252498)
    set_control_par_str(get_ui_id($slider6252498),$CONTROL_PAR_PICTURE,"slider_60mm_gold_gr")
    set_control_par_str(get_ui_id($slider6252498),$CONTROL_PAR_HELP,"")
    set_control_par_str(get_ui_id($slider6252498),$CONTROL_PAR_TEXT,"")
    set_control_par_str(get_ui_id($slider6252498),$CONTROL_PAR_AUTOMATION_NAME,"slider6252498")
    set_control_par    (get_ui_id($slider6252498),$CONTROL_PAR_ALLOW_AUTOMATION,1)
    set_control_par    (get_ui_id($slider6252498),$CONTROL_PAR_MIN_VALUE,0)
    set_control_par    (get_ui_id($slider6252498),$CONTROL_PAR_MAX_VALUE,1000000)
    set_control_par    (get_ui_id($slider6252498),$CONTROL_PAR_DEFAULT_VALUE,755000)
    set_control_par    (get_ui_id($slider6252498),$CONTROL_PAR_MOUSE_BEHAVIOUR,-2750)
    set_control_par    (get_ui_id($slider6252498),$CONTROL_PAR_WIDTH,46)
    set_control_par    (get_ui_id($slider6252498),$CONTROL_PAR_HEIGHT,242)
    set_control_par    (get_ui_id($slider6252498),$CONTROL_PAR_POS_X,32)
    set_control_par    (get_ui_id($slider6252498),$CONTROL_PAR_POS_Y,131)
    { PNG FILENAME                $slider6252498, "sliders/slider_60mm_gold_gr.png" }
    { IS 3D                       $slider6252498, 0 }
    { 3D SHAPE                    $slider6252498, 1 }
    { 3D RADIUS                   $slider6252498, 1 }
    { 3D LENGTH                   $slider6252498, 1 }
    { BEGIN ACTION                $slider6252498 }
    { ACTION FILE                 $slider6252498, "filter/grp fx filter cutoff.txt" }
    declare $slider6252498_GRP_CURRENT := 1
    declare $slider6252498_GRP_BEGIN   := 1
    declare $slider6252498_GRP_END     := 0
            $slider6252498_GRP_END     := $NUM_GROUPS-1 { REQUIRED }
    { END ACTION                  $slider6252498 }
    { GROUP MODE                  $slider6252498, 0 }
    { GROUP SINGLE                $slider6252498, 1 }
    { GROUP FROM                  $slider6252498, 1 }
    { GROUP TO                    $slider6252498, 1 }
    { RANDOMIZE LAYER             $slider6252498, 0 }
    { END DECLARE                 $slider6252498 }

    { BEGIN DECLARE               $slider4831332 }
    declare ui_slider             $slider4831332(0,1000000)
    make_persistent              ($slider4831332)
    read_persistent_var          ($slider4831332)
    set_control_par_str(get_ui_id($slider4831332),$CONTROL_PAR_PICTURE,"slider_60mm_gold_gr")
    set_control_par_str(get_ui_id($slider4831332),$CONTROL_PAR_HELP,"")
    set_control_par_str(get_ui_id($slider4831332),$CONTROL_PAR_TEXT,"")
    set_control_par_str(get_ui_id($slider4831332),$CONTROL_PAR_AUTOMATION_NAME,"slider4831332")
    set_control_par    (get_ui_id($slider4831332),$CONTROL_PAR_ALLOW_AUTOMATION,1)
    set_control_par    (get_ui_id($slider4831332),$CONTROL_PAR_MIN_VALUE,0)
    set_control_par    (get_ui_id($slider4831332),$CONTROL_PAR_MAX_VALUE,1000000)
    set_control_par    (get_ui_id($slider4831332),$CONTROL_PAR_DEFAULT_VALUE,755000)
    set_control_par    (get_ui_id($slider4831332),$CONTROL_PAR_MOUSE_BEHAVIOUR,-2750)
    set_control_par    (get_ui_id($slider4831332),$CONTROL_PAR_WIDTH,46)
    set_control_par    (get_ui_id($slider4831332),$CONTROL_PAR_HEIGHT,242)
    set_control_par    (get_ui_id($slider4831332),$CONTROL_PAR_POS_X,96)
    set_control_par    (get_ui_id($slider4831332),$CONTROL_PAR_POS_Y,131)
    { PNG FILENAME                $slider4831332, "sliders/slider_60mm_gold_gr.png" }
    { IS 3D                       $slider4831332, 0 }
    { 3D SHAPE                    $slider4831332, 1 }
    { 3D RADIUS                   $slider4831332, 1 }
    { 3D LENGTH                   $slider4831332, 1 }
    { BEGIN ACTION                $slider4831332 }
    { ACTION FILE                 $slider4831332, "filter/grp fx filter type.txt" }
    declare $slider4831332_GRP_CURRENT := 1
    declare $slider4831332_GRP_BEGIN   := 1
    declare $slider4831332_GRP_END     := 0
            $slider4831332_GRP_END     := $NUM_GROUPS-1 { REQUIRED }
    { END ACTION                  $slider4831332 }
    { GROUP MODE                  $slider4831332, 0 }
    { GROUP SINGLE                $slider4831332, 1 }
    { GROUP FROM                  $slider4831332, 1 }
    { GROUP TO                    $slider4831332, 1 }
    { RANDOMIZE LAYER             $slider4831332, 0 }
    { END DECLARE                 $slider4831332 }

    { BEGIN DECLARE               $slider8352948 }
    declare ui_slider             $slider8352948(0,1000000)
    make_persistent              ($slider8352948)
    read_persistent_var          ($slider8352948)
    set_control_par_str(get_ui_id($slider8352948),$CONTROL_PAR_PICTURE,"kgm_encoder_red_led")
    set_control_par_str(get_ui_id($slider8352948),$CONTROL_PAR_HELP,"")
    set_control_par_str(get_ui_id($slider8352948),$CONTROL_PAR_TEXT,"")
    set_control_par_str(get_ui_id($slider8352948),$CONTROL_PAR_AUTOMATION_NAME,"slider8352948")
    set_control_par    (get_ui_id($slider8352948),$CONTROL_PAR_ALLOW_AUTOMATION,1)
    set_control_par    (get_ui_id($slider8352948),$CONTROL_PAR_MIN_VALUE,0)
    set_control_par    (get_ui_id($slider8352948),$CONTROL_PAR_MAX_VALUE,1000000)
    set_control_par    (get_ui_id($slider8352948),$CONTROL_PAR_DEFAULT_VALUE,0)
    set_control_par    (get_ui_id($slider8352948),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
    set_control_par    (get_ui_id($slider8352948),$CONTROL_PAR_WIDTH,70)
    set_control_par    (get_ui_id($slider8352948),$CONTROL_PAR_HEIGHT,70)
    set_control_par    (get_ui_id($slider8352948),$CONTROL_PAR_POS_X,16)
    set_control_par    (get_ui_id($slider8352948),$CONTROL_PAR_POS_Y,435)
    { PNG FILENAME                $slider8352948, "other/kgm_encoder_red_led.png" }
    { IS 3D                       $slider8352948, 0 }
    { 3D SHAPE                    $slider8352948, 1 }
    { 3D RADIUS                   $slider8352948, 1 }
    { 3D LENGTH                   $slider8352948, 1 }
    { BEGIN ACTION                $slider8352948 }
    { ACTION FILE                 $slider8352948, "envelope/grp ampenv attack.txt" }
    declare $slider8352948_GRP_CURRENT := 1
    declare $slider8352948_GRP_BEGIN   := 1
    declare $slider8352948_GRP_END     := 0
            $slider8352948_GRP_END     := $NUM_GROUPS-1 { REQUIRED }
    { END ACTION                  $slider8352948 }
    { GROUP MODE                  $slider8352948, 0 }
    { GROUP SINGLE                $slider8352948, 1 }
    { GROUP FROM                  $slider8352948, 1 }
    { GROUP TO                    $slider8352948, 1 }
    { RANDOMIZE LAYER             $slider8352948, 0 }
    { END DECLARE                 $slider8352948 }

    { BEGIN DECLARE               $slider8904292 }
    declare ui_slider             $slider8904292(0,1000000)
    make_persistent              ($slider8904292)
    read_persistent_var          ($slider8904292)
    set_control_par_str(get_ui_id($slider8904292),$CONTROL_PAR_PICTURE,"attack")
    set_control_par_str(get_ui_id($slider8904292),$CONTROL_PAR_HELP,"")
    set_control_par_str(get_ui_id($slider8904292),$CONTROL_PAR_TEXT,"")
    set_control_par_str(get_ui_id($slider8904292),$CONTROL_PAR_AUTOMATION_NAME,"slider8904292")
    set_control_par    (get_ui_id($slider8904292),$CONTROL_PAR_ALLOW_AUTOMATION,1)
    set_control_par    (get_ui_id($slider8904292),$CONTROL_PAR_MIN_VALUE,0)
    set_control_par    (get_ui_id($slider8904292),$CONTROL_PAR_MAX_VALUE,1000000)
    set_control_par    (get_ui_id($slider8904292),$CONTROL_PAR_DEFAULT_VALUE,0)
    set_control_par    (get_ui_id($slider8904292),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
    set_control_par    (get_ui_id($slider8904292),$CONTROL_PAR_WIDTH,96)
    set_control_par    (get_ui_id($slider8904292),$CONTROL_PAR_HEIGHT,16)
    set_control_par    (get_ui_id($slider8904292),$CONTROL_PAR_POS_X,3)
    set_control_par    (get_ui_id($slider8904292),$CONTROL_PAR_POS_Y,500)
    { PNG FILENAME                $slider8904292, "user/attack.png" }
    { IS 3D                       $slider8904292, 0 }
    { 3D SHAPE                    $slider8904292, 1 }
    { 3D RADIUS                   $slider8904292, 1 }
    { 3D LENGTH                   $slider8904292, 1 }
    { BEGIN ACTION                $slider8904292 }
    { ACTION FILE                 $slider8904292, "N/A" }
    { END ACTION                  $slider8904292 }
    { GROUP MODE                  $slider8904292, 0 }
    { GROUP SINGLE                $slider8904292, 1 }
    { GROUP FROM                  $slider8904292, 1 }
    { GROUP TO                    $slider8904292, 1 }
    { RANDOMIZE LAYER             $slider8904292, 0 }
    { END DECLARE                 $slider8904292 }

    { BEGIN DECLARE               $slider7977316 }
    declare ui_slider             $slider7977316(0,1000000)
    make_persistent              ($slider7977316)
    read_persistent_var          ($slider7977316)
    set_control_par_str(get_ui_id($slider7977316),$CONTROL_PAR_PICTURE,"decay")
    set_control_par_str(get_ui_id($slider7977316),$CONTROL_PAR_HELP,"")
    set_control_par_str(get_ui_id($slider7977316),$CONTROL_PAR_TEXT,"")
    set_control_par_str(get_ui_id($slider7977316),$CONTROL_PAR_AUTOMATION_NAME,"slider7977316")
    set_control_par    (get_ui_id($slider7977316),$CONTROL_PAR_ALLOW_AUTOMATION,1)
    set_control_par    (get_ui_id($slider7977316),$CONTROL_PAR_MIN_VALUE,0)
    set_control_par    (get_ui_id($slider7977316),$CONTROL_PAR_MAX_VALUE,1000000)
    set_control_par    (get_ui_id($slider7977316),$CONTROL_PAR_DEFAULT_VALUE,0)
    set_control_par    (get_ui_id($slider7977316),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
    set_control_par    (get_ui_id($slider7977316),$CONTROL_PAR_WIDTH,96)
    set_control_par    (get_ui_id($slider7977316),$CONTROL_PAR_HEIGHT,16)
    set_control_par    (get_ui_id($slider7977316),$CONTROL_PAR_POS_X,83)
    set_control_par    (get_ui_id($slider7977316),$CONTROL_PAR_POS_Y,500)
    { PNG FILENAME                $slider7977316, "user/decay.png" }
    { IS 3D                       $slider7977316, 0 }
    { 3D SHAPE                    $slider7977316, 1 }
    { 3D RADIUS                   $slider7977316, 1 }
    { 3D LENGTH                   $slider7977316, 1 }
    { BEGIN ACTION                $slider7977316 }
    { ACTION FILE                 $slider7977316, "N/A" }
    { END ACTION                  $slider7977316 }
    { GROUP MODE                  $slider7977316, 0 }
    { GROUP SINGLE                $slider7977316, 1 }
    { GROUP FROM                  $slider7977316, 1 }
    { GROUP TO                    $slider7977316, 1 }
    { RANDOMIZE LAYER             $slider7977316, 0 }
    { END DECLARE                 $slider7977316 }

    { BEGIN DECLARE               $slider6325944 }
    declare ui_slider             $slider6325944(0,1000000)
    make_persistent              ($slider6325944)
    read_persistent_var          ($slider6325944)
    set_control_par_str(get_ui_id($slider6325944),$CONTROL_PAR_PICTURE,"sustain")
    set_control_par_str(get_ui_id($slider6325944),$CONTROL_PAR_HELP,"")
    set_control_par_str(get_ui_id($slider6325944),$CONTROL_PAR_TEXT,"")
    set_control_par_str(get_ui_id($slider6325944),$CONTROL_PAR_AUTOMATION_NAME,"slider6325944")
    set_control_par    (get_ui_id($slider6325944),$CONTROL_PAR_ALLOW_AUTOMATION,1)
    set_control_par    (get_ui_id($slider6325944),$CONTROL_PAR_MIN_VALUE,0)
    set_control_par    (get_ui_id($slider6325944),$CONTROL_PAR_MAX_VALUE,1000000)
    set_control_par    (get_ui_id($slider6325944),$CONTROL_PAR_DEFAULT_VALUE,0)
    set_control_par    (get_ui_id($slider6325944),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
    set_control_par    (get_ui_id($slider6325944),$CONTROL_PAR_WIDTH,96)
    set_control_par    (get_ui_id($slider6325944),$CONTROL_PAR_HEIGHT,16)
    set_control_par    (get_ui_id($slider6325944),$CONTROL_PAR_POS_X,164)
    set_control_par    (get_ui_id($slider6325944),$CONTROL_PAR_POS_Y,500)
    { PNG FILENAME                $slider6325944, "user/sustain.png" }
    { IS 3D                       $slider6325944, 0 }
    { 3D SHAPE                    $slider6325944, 1 }
    { 3D RADIUS                   $slider6325944, 1 }
    { 3D LENGTH                   $slider6325944, 1 }
    { BEGIN ACTION                $slider6325944 }
    { ACTION FILE                 $slider6325944, "N/A" }
    { END ACTION                  $slider6325944 }
    { GROUP MODE                  $slider6325944, 0 }
    { GROUP SINGLE                $slider6325944, 1 }
    { GROUP FROM                  $slider6325944, 1 }
    { GROUP TO                    $slider6325944, 1 }
    { RANDOMIZE LAYER             $slider6325944, 0 }
    { END DECLARE                 $slider6325944 }

    { BEGIN DECLARE               $slider1802641 }
    declare ui_slider             $slider1802641(0,1000000)
    make_persistent              ($slider1802641)
    read_persistent_var          ($slider1802641)
    set_control_par_str(get_ui_id($slider1802641),$CONTROL_PAR_PICTURE,"release")
    set_control_par_str(get_ui_id($slider1802641),$CONTROL_PAR_HELP,"")
    set_control_par_str(get_ui_id($slider1802641),$CONTROL_PAR_TEXT,"")
    set_control_par_str(get_ui_id($slider1802641),$CONTROL_PAR_AUTOMATION_NAME,"slider1802641")
    set_control_par    (get_ui_id($slider1802641),$CONTROL_PAR_ALLOW_AUTOMATION,1)
    set_control_par    (get_ui_id($slider1802641),$CONTROL_PAR_MIN_VALUE,0)
    set_control_par    (get_ui_id($slider1802641),$CONTROL_PAR_MAX_VALUE,1000000)
    set_control_par    (get_ui_id($slider1802641),$CONTROL_PAR_DEFAULT_VALUE,0)
    set_control_par    (get_ui_id($slider1802641),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
    set_control_par    (get_ui_id($slider1802641),$CONTROL_PAR_WIDTH,96)
    set_control_par    (get_ui_id($slider1802641),$CONTROL_PAR_HEIGHT,16)
    set_control_par    (get_ui_id($slider1802641),$CONTROL_PAR_POS_X,243)
    set_control_par    (get_ui_id($slider1802641),$CONTROL_PAR_POS_Y,499)
    { PNG FILENAME                $slider1802641, "user/release.png" }
    { IS 3D                       $slider1802641, 0 }
    { 3D SHAPE                    $slider1802641, 1 }
    { 3D RADIUS                   $slider1802641, 1 }
    { 3D LENGTH                   $slider1802641, 1 }
    { BEGIN ACTION                $slider1802641 }
    { ACTION FILE                 $slider1802641, "N/A" }
    { END ACTION                  $slider1802641 }
    { GROUP MODE                  $slider1802641, 0 }
    { GROUP SINGLE                $slider1802641, 1 }
    { GROUP FROM                  $slider1802641, 1 }
    { GROUP TO                    $slider1802641, 1 }
    { RANDOMIZE LAYER             $slider1802641, 0 }
    { END DECLARE                 $slider1802641 }

    { BEGIN DECLARE               $slider4508950 }
    declare ui_slider             $slider4508950(0,1000000)
    make_persistent              ($slider4508950)
    read_persistent_var          ($slider4508950)
    set_control_par_str(get_ui_id($slider4508950),$CONTROL_PAR_PICTURE,"lfo")
    set_control_par_str(get_ui_id($slider4508950),$CONTROL_PAR_HELP,"")
    set_control_par_str(get_ui_id($slider4508950),$CONTROL_PAR_TEXT,"")
    set_control_par_str(get_ui_id($slider4508950),$CONTROL_PAR_AUTOMATION_NAME,"slider4508950")
    set_control_par    (get_ui_id($slider4508950),$CONTROL_PAR_ALLOW_AUTOMATION,1)
    set_control_par    (get_ui_id($slider4508950),$CONTROL_PAR_MIN_VALUE,0)
    set_control_par    (get_ui_id($slider4508950),$CONTROL_PAR_MAX_VALUE,1000000)
    set_control_par    (get_ui_id($slider4508950),$CONTROL_PAR_DEFAULT_VALUE,0)
    set_control_par    (get_ui_id($slider4508950),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
    set_control_par    (get_ui_id($slider4508950),$CONTROL_PAR_WIDTH,96)
    set_control_par    (get_ui_id($slider4508950),$CONTROL_PAR_HEIGHT,16)
    set_control_par    (get_ui_id($slider4508950),$CONTROL_PAR_POS_X,4)
    set_control_par    (get_ui_id($slider4508950),$CONTROL_PAR_POS_Y,375)
    { PNG FILENAME                $slider4508950, "user/lfo.png" }
    { IS 3D                       $slider4508950, 0 }
    { 3D SHAPE                    $slider4508950, 1 }
    { 3D RADIUS                   $slider4508950, 1 }
    { 3D LENGTH                   $slider4508950, 1 }
    { BEGIN ACTION                $slider4508950 }
    { ACTION FILE                 $slider4508950, "N/A" }
    { END ACTION                  $slider4508950 }
    { GROUP MODE                  $slider4508950, 0 }
    { GROUP SINGLE                $slider4508950, 1 }
    { GROUP FROM                  $slider4508950, 1 }
    { GROUP TO                    $slider4508950, 1 }
    { RANDOMIZE LAYER             $slider4508950, 0 }
    { END DECLARE                 $slider4508950 }

    { BEGIN DECLARE               $slider5082755 }
    declare ui_slider             $slider5082755(0,1000000)
    make_persistent              ($slider5082755)
    read_persistent_var          ($slider5082755)
    set_control_par_str(get_ui_id($slider5082755),$CONTROL_PAR_PICTURE,"lfo type")
    set_control_par_str(get_ui_id($slider5082755),$CONTROL_PAR_HELP,"")
    set_control_par_str(get_ui_id($slider5082755),$CONTROL_PAR_TEXT,"")
    set_control_par_str(get_ui_id($slider5082755),$CONTROL_PAR_AUTOMATION_NAME,"slider5082755")
    set_control_par    (get_ui_id($slider5082755),$CONTROL_PAR_ALLOW_AUTOMATION,1)
    set_control_par    (get_ui_id($slider5082755),$CONTROL_PAR_MIN_VALUE,0)
    set_control_par    (get_ui_id($slider5082755),$CONTROL_PAR_MAX_VALUE,1000000)
    set_control_par    (get_ui_id($slider5082755),$CONTROL_PAR_DEFAULT_VALUE,0)
    set_control_par    (get_ui_id($slider5082755),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
    set_control_par    (get_ui_id($slider5082755),$CONTROL_PAR_WIDTH,96)
    set_control_par    (get_ui_id($slider5082755),$CONTROL_PAR_HEIGHT,16)
    set_control_par    (get_ui_id($slider5082755),$CONTROL_PAR_POS_X,71)
    set_control_par    (get_ui_id($slider5082755),$CONTROL_PAR_POS_Y,375)
    { PNG FILENAME                $slider5082755, "user/lfo type.png" }
    { IS 3D                       $slider5082755, 0 }
    { 3D SHAPE                    $slider5082755, 1 }
    { 3D RADIUS                   $slider5082755, 1 }
    { 3D LENGTH                   $slider5082755, 1 }
    { BEGIN ACTION                $slider5082755 }
    { ACTION FILE                 $slider5082755, "N/A" }
    { END ACTION                  $slider5082755 }
    { GROUP MODE                  $slider5082755, 0 }
    { GROUP SINGLE                $slider5082755, 1 }
    { GROUP FROM                  $slider5082755, 1 }
    { GROUP TO                    $slider5082755, 1 }
    { RANDOMIZE LAYER             $slider5082755, 0 }
    { END DECLARE                 $slider5082755 }
end on

{ BEGIN FUNCTIONS }
{ END FUNCTIONS }

{ BEGIN UI_CONTROL DEFINITIONS }
on ui_control ($slider7892064)
    $slider7892064_GRP_CURRENT := $slider7892064_GRP_BEGIN { $slider7892064 }
    while ($slider7892064_GRP_CURRENT < $slider7892064_GRP_END+1) { $slider7892064 }
    	set_engine_par ($ENGINE_PAR_DECAY,$slider7892064,$slider7892064_GRP_CURRENT,find_mod($slider7892064_GRP_CURRENT,"AMPENV"),-1) { $slider7892064 }
    	inc($slider7892064_GRP_CURRENT) { $slider7892064 }
    end while { $slider7892064 }
end on
on ui_control ($slider1046315)
    $slider1046315_GRP_CURRENT := $slider1046315_GRP_BEGIN { $slider1046315 }
    while ($slider1046315_GRP_CURRENT < $slider1046315_GRP_END+1) { $slider1046315 }
    	set_engine_par ($ENGINE_PAR_RELEASE,$slider1046315,$slider1046315_GRP_CURRENT,find_mod($slider1046315_GRP_CURRENT,"AMPENV"),-1)     { $slider1046315 }
    	inc($slider1046315_GRP_CURRENT) { $slider1046315 }
    end while	 { $slider1046315 }
end on
on ui_control ($slider1646665)
    $slider1646665_GRP_CURRENT := $slider1646665_GRP_BEGIN { $slider1646665 }
    while ($slider1646665_GRP_CURRENT < $slider1646665_GRP_END+1) { $slider1646665 }
    	set_engine_par ($ENGINE_PAR_SUSTAIN,$slider1646665,$slider1646665_GRP_CURRENT,find_mod($slider1646665_GRP_CURRENT,"AMPENV"),-1)     { $slider1646665 }
    	inc($slider1646665_GRP_CURRENT) { $slider1646665 }
    end while	 { $slider1646665 }
end on
on ui_control ($slider6252498)
    $slider6252498_GRP_CURRENT := $slider6252498_GRP_BEGIN { $slider6252498 }
    while ($slider6252498_GRP_CURRENT < $slider6252498_GRP_END+1) { $slider6252498 }
    	set_engine_par ($ENGINE_PAR_CUTOFF,$slider6252498,$slider6252498_GRP_CURRENT,0,-1) { $slider6252498 }
    	inc($slider6252498_GRP_CURRENT) { $slider6252498 }
    end while	 { $slider6252498 }
end on
on ui_control ($slider4831332)
    $slider4831332_GRP_CURRENT := $slider4831332_GRP_BEGIN { $slider4831332 }
    while ($slider4831332_GRP_CURRENT < $slider4831332_GRP_END+1) { $slider4831332 }
    	set_engine_par ($ENGINE_PAR_FILTER_TYPEA,$slider4831332,$slider4831332_GRP_CURRENT,0,-1) { $slider4831332 }
    	inc($slider4831332_GRP_CURRENT) { $slider4831332 }
    end while { $slider4831332 }
end on
on ui_control ($slider8352948)
    $slider8352948_GRP_CURRENT := $slider8352948_GRP_BEGIN { $slider8352948 }
    while ($slider8352948_GRP_CURRENT < $slider8352948_GRP_END+1) { $slider8352948 }
    	set_engine_par ($ENGINE_PAR_ATTACK,$slider8352948,$slider8352948_GRP_CURRENT,find_mod($slider8352948_GRP_CURRENT,"AMPENV"),-1) { $slider8352948 }
    	inc($slider8352948_GRP_CURRENT) { $slider8352948 }
    end while { $slider8352948 }
end on
on ui_control ($slider8904292)
    { }
end on
on ui_control ($slider7977316)
    { }
end on
on ui_control ($slider6325944)
    { }
end on
on ui_control ($slider1802641)
    { }
end on
on ui_control ($slider4508950)
    { }
end on
on ui_control ($slider5082755)
    { }
end on
{ END UI_CONTROL DEFINITIONS }

{ BEGIN ON NOTE }
on note
    ignore_event($EVENT_ID)    
    if ($KGM_MULTISAMPLE_MODE = 1)
        allow_group($ALL_GROUPS)
        if ($KGM_NOTE_SEQUENCER_ENABLE = 1)
            if ($KGM_FIRST_NOTE = 0)
                $KGM_FIRST_NOTE := 1
                $KGM_SEQUENCER_POS := 0
                $KGM_WAIT_EVENT := $NI_CALLBACK_ID
                while ($KGM_FIRST_NOTE = 1)
                    if (%KGM_NOTE_SEQUENCER_ARRAY[$KGM_SEQUENCER_POS] > 0)
                        $KGM_NOTE_ID := play_note($EVENT_NOTE,%KGM_NOTE_SEQUENCER_ARRAY[$KGM_SEQUENCER_POS],0,$KGM_SEQUENCER_DURATION)
                    end if
                    if ($KGM_SEQUENCER_POS < $KGM_NOTE_SEQUENCER_STEPS_SHOWN-1)
                        inc($KGM_SEQUENCER_POS)
                    else
                        $KGM_SEQUENCER_POS := 0
                    end if   
                    wait($KGM_SEQUENCER_DURATION)
                end while
            end if
        else
            $KGM_NOTE_ID := play_note($EVENT_NOTE,$EVENT_VELOCITY,0,-1)
        end if
    else
        disallow_group($ALL_GROUPS)
        if ($KGM_GROUP_A_ACTIVE = 1)
            allow_group($KGM_GROUP_A+$KGM_GROUP_OFFSET) 
        end if
        if ($KGM_GROUP_B_ACTIVE = 1)
            allow_group($KGM_GROUP_B+$KGM_GROUP_OFFSET)    
        end if
        if ($KGM_GROUP_C_ACTIVE = 1)
            allow_group($KGM_GROUP_C+$KGM_GROUP_OFFSET)    
        end if  
        if ($KGM_GROUP_D_ACTIVE = 1)
            allow_group($KGM_GROUP_D+$KGM_GROUP_OFFSET)    
        end if
        if ($KGM_GROUP_E_ACTIVE = 1)
            allow_group($KGM_GROUP_E+$KGM_GROUP_OFFSET)    
        end if
        if ($KGM_GROUP_F_ACTIVE = 1)
            allow_group($KGM_GROUP_F+$KGM_GROUP_OFFSET)    
        end if
        if ($KGM_GROUP_G_ACTIVE = 1)
            allow_group($KGM_GROUP_G+$KGM_GROUP_OFFSET)    
        end if  
        if ($KGM_GROUP_H_ACTIVE = 1)
            allow_group($KGM_GROUP_H+$KGM_GROUP_OFFSET)    
        end if
		if ($KGM_GROUP_I_ACTIVE = 1)
            allow_group($KGM_GROUP_I+$KGM_GROUP_OFFSET)    
        end if
        if ($KGM_GROUP_J_ACTIVE = 1)
            allow_group($KGM_GROUP_J+$KGM_GROUP_OFFSET)    
        end if
        if ($KGM_NOTE_SEQUENCER_ENABLE = 1)
            if ($KGM_FIRST_NOTE = 0)
                $KGM_FIRST_NOTE := 1
                $KGM_SEQUENCER_POS := 0
                $KGM_WAIT_EVENT := $NI_CALLBACK_ID
                while ($KGM_FIRST_NOTE = 1)
                    if (%KGM_NOTE_SEQUENCER_ARRAY[$KGM_SEQUENCER_POS] > 0)
                        $KGM_NOTE_ID := play_note($EVENT_NOTE,%KGM_NOTE_SEQUENCER_ARRAY[$KGM_SEQUENCER_POS],0,$KGM_SEQUENCER_DURATION)
                    end if
                    if ($KGM_SEQUENCER_POS < $KGM_NOTE_SEQUENCER_STEPS_SHOWN-1)
                        inc($KGM_SEQUENCER_POS)
                    else
                        $KGM_SEQUENCER_POS := 0
                    end if   
                    wait($KGM_SEQUENCER_DURATION)
                end while 
            end if
        else
            $KGM_NOTE_ID := play_note($EVENT_NOTE,$EVENT_VELOCITY,0,-1)
        end if
    end if
end on
{ END ON NOTE }

{ BEGIN ON RELEASE }
on release
    if ($KGM_NOTE_SEQUENCER_ENABLE = 1)
        $KGM_NCOUNT := 0
        $KGM_CHK_NOTES := 0
        while ($KGM_NCOUNT < 127)
            $KGM_CHK_NOTES := $KGM_CHK_NOTES+%KEY_DOWN[$KGM_NCOUNT]
            inc($KGM_NCOUNT)
        end while
        if ($KGM_CHK_NOTES = 0)
            $KGM_FIRST_NOTE := 0
            stop_wait($KGM_WAIT_EVENT,0)
        end if  
    end if    
end on
{ END ON RELEASE }

{ BEGIN ON LISTENER }
on listener
    if ($NI_SIGNAL_TYPE = $NI_SIGNAL_TIMER_MS)
        if ($KGM_ANIM_STEP < $KGM_ANIM_FRAMES_MAX)
            inc($KGM_ANIM_STEP)
        else
            $KGM_ANIM_STEP := 0
        end if
    end if
end on
{ END ON LISTENER }

