Kontakt scripting

AHDSR KONTAKT SCRIPTING

This is the script of Envelope AHDSR for peoples Interested in programming who want to benefit from it. Using it or modifying it as needed and create your own kontakt library to edit your music.
Is a very cool and professional script to controlling all Envelope AHDSR elements.

(begining of script)


on init
    make_perfview 
    set_script_title("MASTER")    
    set_ui_height_px(100)
    set_control_par_str($INST_WALLPAPER_ID,$CONTROL_PAR_PICTURE,"wallpaper") 
set_control_par_str($INST_ICON_ID,$CONTROL_PAR_PICTURE,"pv_world_logo")

{------------------------------------ labels---------------------------------}   
    declare ui_label $lbl_1(1,1)
    move_control_px($lbl_1,95,70)
    hide_part ($lbl_1,$HIDE_PART_BG)
    set_text($lbl_1,"CURVE          ATTACK           HOLD            DEACY         SUSTAIN       RELEASE")
    set_control_par(get_ui_id($lbl_1),$CONTROL_PAR_FONT_TYPE,19)
    set_control_par(get_ui_id($lbl_1),$CONTROL_PAR_HEIGHT,20)
    set_control_par(get_ui_id($lbl_1),$CONTROL_PAR_WIDTH,600)     
{------------------------------------ declare ---------------------------------}

declare ui_slider $Atk_Curve (0,1000000)
set_control_par_str(get_ui_id($Atk_Curve),  $CONTROL_PAR_PICTURE, "pv_world_knob_big")
set_control_par(get_ui_id($Atk_Curve),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
_set_engine_par($ENGINE_PAR_ATK_CURVE, $Atk_Curve, 0, 0, -1)


declare ui_slider $Atk (0,1000000)
set_control_par_str(get_ui_id($Atk),  $CONTROL_PAR_PICTURE, "pv_world_knob_big")
set_control_par(get_ui_id($Atk),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
_set_engine_par($ENGINE_PAR_ATTACK, $Atk, 0, 0, -1)


declare ui_slider $Hold (0,1000000)
set_control_par_str(get_ui_id($Hold),  $CONTROL_PAR_PICTURE, "pv_world_knob_big")
set_control_par(get_ui_id($Hold),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
_set_engine_par($ENGINE_PAR_HOLD, $Hold, 0, 0, -1)


declare ui_slider $Decay (0,1000000)
set_control_par_str(get_ui_id($Decay),  $CONTROL_PAR_PICTURE, "pv_world_knob_big")
set_control_par(get_ui_id($Decay),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
_set_engine_par($ENGINE_PAR_DECAY, $Decay, 0, 0, -1)


declare ui_slider $Sus (0,1000000)
set_control_par_str(get_ui_id($Sus),  $CONTROL_PAR_PICTURE, "pv_world_knob_big")
set_control_par(get_ui_id($Sus),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
_set_engine_par($ENGINE_PAR_SUSTAIN, $Sus, 0, 0, -1)


declare ui_slider $Rel (0,1000000)
set_control_par_str(get_ui_id($Rel),  $CONTROL_PAR_PICTURE, "pv_world_knob_big")
set_control_par(get_ui_id($Rel),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
_set_engine_par($ENGINE_PAR_RELEASE, $Rel, 0, 0, -1)


move_control_px($Atk_Curve,100,20)
move_control_px($Atk,170,20)
move_control_px($Hold,240,20)
move_control_px($Decay,310,20)
move_control_px($Sus,380,20)
move_control_px($Rel,450,20)
end on


{------------------------------------ control---------------------------------}
on ui_control ($Atk_Curve) 
_set_engine_par($ENGINE_PAR_ATK_CURVE, $Atk_Curve, 0, 0, -1) 

end on 

on ui_control ($Atk) 
_set_engine_par($ENGINE_PAR_ATTACK, $Atk, 0, 0, -1) 

end on 

on ui_control ($Hold) 
_set_engine_par($ENGINE_PAR_HOLD, $Hold, 0, 0, -1) 

end on 

on ui_control ($Decay) 
_set_engine_par($ENGINE_PAR_DECAY, $Decay, 0, 0, -1) 

end on 

on ui_control ($Sus) 
_set_engine_par($ENGINE_PAR_SUSTAIN, $Sus, 0, 0, -1) 

end on 

on ui_control ($Rel) 
_set_engine_par($ENGINE_PAR_RELEASE, $Rel, 0, 0, -1) 

end on 


(and of script)




Do not forget to add the Envelope AHDSR like the Image.




this script is valid for all versions of kontakt just copy it in the slot text and add your wallpaper.
You can use this script alone or you can add it to another script.
This script edited and scripted by BOUZIANE MOHAMMED FAYCEL