Kontakt Scripting

KONTAKT SCRIPTING WAVE FORME
Professional script to create wave forme or audio image in the kontakt interface. This script for peoples Interested in programming who want to benefit from it. Using it or modifying it as needed and create your own kontakt libraries to edit your music.
There is a complet model of this script in kontakt library with all resources and container and pictures and texts for download on the end of poste.


{********begin of script**********}


on init
  make_perfview 
  set_ui_height_px(120)
  set_script_title("EFFECT_TUNING")
   set_control_par($INST_ICON_ID,$CONTROL_PAR_HIDE,$HIDE_WHOLE_CONTROL)
   
    declare $keys_black
    while ($keys_black<128)
        set_key_color($keys_black,$KEY_COLOR_BLACK)
        inc($keys_black)
    end while
    $keys_black := 0
    while ($keys_black<128)
        set_key_color($keys_black+1,$KEY_COLOR_WHITE)
        set_key_color($keys_black+3,$KEY_COLOR_WHITE)
        set_key_color($keys_black+6,$KEY_COLOR_WHITE)
        set_key_color($keys_black+8,$KEY_COLOR_WHITE)
        set_key_color($keys_black+10,$KEY_COLOR_WHITE)
        $keys_black := $keys_black+12
    end while
declare $keys_range
    $keys_range := 48
    while ($keys_range<61)
        set_key_color($keys_range,$KEY_COLOR_RED)
        inc($keys_range)
    end while

   declare ui_label $label (0,0)
    set_control_par_str(get_ui_id($label), $CONTROL_PAR_TEXT, "WAVE FORME")
    set_control_par(get_ui_id($label), $CONTROL_PAR_WIDTH, 613)
    set_control_par(get_ui_id($label),$CONTROL_PAR_FONT_TYPE,19)
    hide_part($label,$HIDE_PART_BG .or. $HIDE_PART_TITLE .or. $HIDE_PART_VALUE .or. $HIDE_PART_MOD_LIGHT)
    move_control_px($label,280,90)
   
  declare $noteid
  declare $selZone
  declare $playpos
  declare $selZoneRAW
  declare ui_waveform $my_waveform(3,3)
  set_control_par(get_ui_id($my_waveform),$CONTROL_PAR_HEIGHT,66)
    set_control_par(get_ui_id($my_waveform),$CONTROL_PAR_WIDTH,396)
    set_control_par(get_ui_id($my_waveform),$CONTROL_PAR_FONT_TYPE,3)
    set_control_par_str(get_ui_id($my_waveform),$CONTROL_PAR_TEXT,"")
    set_control_par_str(get_ui_id($my_waveform),$CONTROL_PAR_PICTURE,"switch")
    move_control_px($my_waveform,123,12)
  end on

on note
  $selZoneRAW := get_event_par($EVENT_ID,$EVENT_PAR_NOTE)
 
  $selZone := $selZoneRAW - 23
  message ($selZone)
 
  attach_zone ($my_waveform,$selZone,0)
 
  while ($NOTE_HELD = 1)
  $playpos := get_event_par ($EVENT_ID,$EVENT_PAR_PLAY_POS)
  set_ui_wf_property ($my_waveform,$UI_WF_PROP_PLAY_CURSOR,0,$playpos)

  message("id zone number:" & $selZoneRAW & " || selected Zone:" & $selZone &...
     " || event id:" & $EVENT_ID & " || note id:" & $EVENT_NOTE)
  wait (10000)
  end while
end on

{********end of script**********}



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.

Download the library model here