Control Parameters
General
|
---|
Nothing will be applied to the widget. |
|
---|
Sets or returns a custom value bound to a specific UI widget. This allows custom tagging of UI widgets, for instance to bind them to a specific parameter in the script. |
|
---|
Returns the type of the UI widget. Only works with Possible return values are:
|
Size, Position and Look
|
---|
Sets or returns the horizontal position in pixels. |
|
---|
Sets or returns the vertical position in pixels. |
|
---|
Sets or returns the horizontal position in grid units. |
|
---|
Sets or returns the vertical position in grid units. |
|
---|
Sets or returns the width of the control in pixels. |
|
---|
Sets or returns the height of the control in pixels. |
|
---|
Sets or returns the width of the control in grid units. |
|
---|
Sets or returns the height of the control in grid units. |
|
---|
Sets or returns the hide status. Can be used with the following built-in constants:
|
|
---|
Sets or returns the picture name. Full path and extension are not required if the instrument references a resource container. In this case, Kontakt will look for the specified filename in the Every picture must be accompanied with a text file of the same name, containing important information on how should Kontakt render this image. For example, if we have a Has Alpha Channel: yes Number of Animations: 6 Horizontal Animation: no Vertical Resizable: no Horizontal Resizable: no Fixed Top: 0 Fixed Bottom: 0 Fixed Left: 0 Fixed Right: 0
NOTE: This .txt file must have one empty line at the end, and end of line (EOL) type should be Windows (CR/LF)! |
|
---|
Sets or returns the picture state of the control for |
|
---|
Assigns a widget to a particular |
|
---|
Sets or returns the Z layer position of the widget. Widgets can be placed in one of three layers. Within these layers they are then positioned by widget type, and then by declaration order. 0: Default layer. All widgets are assigned to this layer by default. -1: Background layer. Widgets in this layer are placed below the default layer. 1: Foreground layer. Widgets in this layer are placed on top of the default and background layers. Z layer order by widget type (from top to bottom):
|
Values
|
---|
Returns the minimum declared value of the widget. This control parameter only makes sense for Only works with |
|
---|
Returns the minimum declared value of the widget. This control parameter only makes sense for Only works with |
|
---|
Sets or returns the value of the widget. Note that doing this does NOT execute the UI callback of the widget! |
Text
|
---|
Sets or returns the widget text, similar to |
|
---|
Adds a text line to multiline labels, similar to |
|
---|
Returns the name of the UI widget as declared in the script, without the type specifier ( Only works with |
|
---|
Sets or returns the help text, which is displayed in Kontakt's Info pane when hovering above the widget. |
|
---|
Sets or returns the widget label, similar to This is also the string published to the host when using host automation. |
|
---|
Sets or returns the short name of the widget. |
|
---|
Sets or returns the knob unit, similar to |
|
---|
Sets or returns the font type. Numbers 0 ... 25 are used to select any of the 26 factory fonts, as shown below. Combine with For responsive widgets (
Not using any of the five additional state fonts will result in the default ( |
|
---|
Deactivates text position shifting when clicking on |
|
---|
Shifts the vertical position in pixels of text in |
|
---|
The text alignment in 0: Left 1: Centered 2: Right |
Automation
|
---|
Sets or returns if a UI widget can be automated (1) or not (0). By default, automation is allowed for all automatable widgets ( This control parameter can only be used in the When allowing automation for |
|
---|
Sets or returns an automation name to a UI widget when used with
When assigning automation names to |
|
---|
Sets or returns an automation ID to a UI widget, in range 0 ... 2047. Can only be used in the init callback. Automation IDs can only be assigned to automatable widgets ( When assigning automation IDs to |
Key Modifiers
|
---|
Returns 1 when the shift key was pressed (0 otherwise) while clicking the UI widget.
The basic [Shift] modifier functionality on |
|
---|
Returns 1 if the [Alt] (Windows) or [Opt] (macOS) key was pressed (0 otherwise) while clicking the UI widget.
|
|
---|
Returns 1 if the [Ctrl] (Windows) or [Cmd] (macOS) key was pressed (0 otherwise) while clicking the UI widget.
The basic [Ctrl]/[Cmd] modifier functionality on |
Specific UI Widgets
Instrument Icon and Wallpaper
|
---|
The ID of the instrument icon. It's possible to hide the instrument icon:
It's also possible to load a different picture file for the instrument icon:
|
|
---|
The ID of the instrument wallpaper. It is used in a similar way as
This command can only be used in on init callback. Note that a wallpaper set via the script replaces the one set in Instrument Options dialog, and it will not be checked in the Content Missing dialog when loading the wallpaper from the resource container. This command only supports wallpapers that are located within the Resource Container. If you use it in different script slots, then the last script slot in which wallpaper was set will be the one that is loaded. |
ui_file_selector
|
---|
Sets or returns the basepath of ui_file_selector. This control parameter can be used in any callback. Be careful with the number of subfolders in the basepath, as it might take too long to scan the filesystem. |
|
---|
Sets or returns the width of ui_file_selector columns. This control par can only be used in on init callback. |
|
---|
Sets or returns the actual path (full path of the file) currently selected in ui_file_selector. The file path must be a subpath of the instrument’s basepath. This control parameter is useful for recalling the prior state of the file selector upon loading the instrument. Can only be used in on init callback. |
|
---|
Sets or returns the file type for ui_file_selector. Can only be used in on init callback. The following file types are available:
|
ui_label
|
---|
Sets or returns the drag and drop behavior for ui_label. Using a value of 1 sets the label as a drag and drop area, allowing the user to export the MIDI object currently held in memory by a simple drag and drop action. For more information on MIDI handling in KSP, refer to MIDI Object Commands. |
|
---|
Assigns one of 512 available MIDI object export areas to be drag and drop exported via a particular ui_label. For more information on MIDI handling in KSP, refer to MIDI Object Commands. |
ui_level_meter
|
---|
Sets or returns the background color of ui_level_meter. |
|
---|
Sets the second background color of ui_level_meter. |
|
---|
Sets the main level meter color of ui_level_meter. |
|
---|
Sets the color of ui_level_meter overload section. |
|
---|
Sets the color of the little bar showing the current peak level. |
|
---|
Aligns ui_level_meter vertically (1) or horizontally (0, default). |
|
---|
Sets the minimum and maximum display range of ui_level_meter, with default range 0 ... 1000000. If the maximum value is smaller than the minimum value (or vice versa), the display is inverted. |
ui_mouse_area
|
---|
Enables ui_mouse_area to accept audio, MIDI or NKA array files. These can be set to one of the following values:
|
| |
---|---|
Configures whether The UI callback has two built-in variables: | |
| Specifies the event type that triggered the callback and can have one of the following values:
|
| 1: The mouse has entered ui_mouse_area on a drag event 0: The mouse has left ui_mouse_area on a drag event |
Example: on ui_control ($mouseArea) if ($NI_MOUSE_EVENT_TYPE = $NI_MOUSE_EVENT_TYPE_DROP) message(num_elements(!NI_DND_ITEMS_AUDIO)) end if if ($NI_MOUSE_EVENT_TYPE = $NI_MOUSE_EVENT_TYPE_DRAG) message(num_elements(!NI_DND_ITEMS_AUDIO)) message($MOUSE_OVER_CONTROL) end if end on |
ui_slider
|
---|
A value from -5000 to 5000, setting the move direction of ui_slider and its sensitivity. Settings are relative to the size of the slider picture. Negative values give a vertical slider behavior, positive values give a horizontal behavior. |
ui_table
|
---|
Returns the index of the ui_table column that triggered the on ui_control callback. |
|
---|
Sets or returns the color of the step bar in ui_table. Colors are set using a hex value in the following format:
The 0 at the start is just to let Kontakt know the value is a number. The h or H at the end is to indicate that it is a hexadecimal value. |
|
---|
Sets or returns the color of the middle line in ui_table. |
ui_value_edit
|
---|
Hides the arrows of ui_value_edit. 0: Arrows are hidden 1: Arrows are shown |
|
---|
Shifts the vertical position in pixels of the parameter value in |
ui_waveform
Waveform Flag Constants | |
---|---|
To be used with | |
| Display the zone’s slice markers. |
| Display a per-slice table. NOTE: this only works if the slice markers are also active. |
| Make the table bipolar. |
| Display a MIDI drag and drop icon. NOTE: this only works if the slice markers are also active. |
Waveform Property Constants | |
---|---|
To be used with get_ui_wf_property() and set_ui_wf_property(). | |
| Sets or returns the play cursor position, in microseconds. |
| Used to set new flag constants after the |
| Sets or returns the value of the indexed slice’s table. |
| Highlights the indexed slice within the ui_waveform widget. |
| Defines the start note for the MIDI drag and drop function. |
|
---|
Changes the way the waveform is drawn. Valid values:
|
|
---|
Sets or returns the background color of ui_waveform. |
|
---|
Sets or returns the color of the waveform drawn in ui_waveform. |
|
---|
Sets or returns the color of the playback cursor in ui_waveform. |
|
---|
Sets or returns the color of the slice markers in ui_waveform. |
|
---|
Sets or returns the alpha channel (opacity) of the background of ui_waveform. Range: 0 (fully transparent) to 255 (fully opaque). |
ui_wavetable
|
---|
Attaches a zone to ui_wavetable, taking the zone ID as the argument. |
|
---|
Sets or returns the visualization mode of ui_wavetable. Can be set to the following values:
|
|
---|
Sets or returns the X-axis parallax of ui_wavetable (only applicable to 3D mode). Range: -1000000 ... 1000000 |
|
---|
Sets or returns the Y-axis parallax of ui_wavetable (only applicable to 3D mode). Range: -1000000 ... 1000000 |
|
---|
Sets or returns the color of the waveform drawn in 2D visualization mode, or the current waveform drawn in 3D visualization mode of ui_wavetable. |
|
---|
Sets or returns the alpha channel (opacity) of the waveform drawn in 2D visualization mode, or the current waveform drawn in 3D visualization mode of ui_wavetable. Range: 0 (fully transparent) to 255 (fully opaque). |
|
---|
Sets or returns the color of the background waveforms in 3D visualization mode of ui_wavetable. |
|
---|
Sets or returns the alpha channel (opacity) of the background waveforms in 3D visualization mode of ui_wavetable. Range: 0 (fully transparent) to 255 (fully opaque). |
|
---|
Sets or returns the background color of ui_wavetable. |
|
---|
Sets or returns the alpha channel (opacity) of ui_wavetable. Range: 0 (fully transparent) to 255 (fully opaque). |
Additional Color and Alpha Parameters | |
---|---|
To be paired with the above control parameters in order to create gradient effects. If not explicitly set, they inherit the value of their match from above, resulting in no gradient. | |
| Sets or returns the color for the end of the gradient applied to the waveform (2D) or current waveform (3D). |
| Sets or returns the alpha channel (opacity) for the end of the gradient applied to the waveform (2D) or current waveform (3D). |
| Sets or returns the color for the end of the gradient applied to the background waveforms (3D). |
| Sets or returns the alpha channel (opacity) for the end of the gradient applied to the background waveforms (3D). |
ui_xy
|
---|
Mouse behavior, i.e. the drag scale, of the X axis of all ui_xy cursors. |
|
---|
Mouse behavior, i.e. the drag scale, of the Y axis of all ui_xy cursors. |
|
---|
Sets the way ui_xy responds to mouse clicks and drags. 0: Clicks anywhere other than on a cursor are ignored. Clicking on a cursor and dragging, sets new values respecting the usual 1: Clicks anywhere on the XY pad are registered but don't change the values. Clicking anywhere and dragging, sets new values; the cursor moves parallel to the mouse cursor with distances scaled based on the 2: Clicks anywhere on the XY pad are registered and immediately change the values, with the cursor immediately matching the mouse cursor. Clicking anywhere and dragging has a similar effect; the |
|
---|
Sets and gets the index of the active ui_xy cursor. Only relevant in multi-cursor setups. The 0 and 1: The active cursor can only be changed manually by setting this control parameter. Inactive cursors don't receive any clicks. 2: Active cursor is set automatically based on the last clicked cursor. Setting it manually within on ui_control callback of ui_xy can result in unexpected results, but using it in other callbacks is fully encouraged and makes sense in many scenarios. The returned value is -1 when not clicking on any cursor. The index can only ever be an even number (with the exception of the -1 value) that matches the index of the X axis of the cursor in the main array representing the XY control, e.g. the first cursor has an index of 0, the second one has an index of 2, etc. |
|
---|
Sets the cursor image. Each cursor can have its own image set using the Using The cursor images can have up to 6 frames, corresponding to the following states. Frame selection is automatic, exactly like with 1: Inactive 2: Active 3: Inactive pressed 4: Active pressed 5: Inactive mouse over 6: Active mouse over |
|
---|
When used with set_control_par_arr(), this can be used to hide specific ui_xy cursors. Below is a simple example: if ($hide = 1) set_control_par_arr($id, $CONTROL_PAR_HIDE, $HIDE_PART_CURSOR, $index) else set_control_par_arr($id, $CONTROL_PAR_HIDE, $HIDE_PART_NOTHING, $index) end if The index should be an even number that matches the index of the X axis of the cursor in the main array representing the XY control, so the first cursor has an index of 0, the second has an index of 2, and so on. |
|
---|
Returns the index of the cursor that triggered the on ui_control callback of a ui_xy widget. Note that indices are always even numbers starting from 0, so the first cursor has an index of 0, the second has an index of 2, and so on. |
|
---|
Returns the type of mouse event that triggered the on ui_controlcallback of a ui_xy widget. Can only be used within the on ui_control callback. The following mouse event types are available:
|