Changelog
Kontakt 8.5.1
New Features
UI Module
- Added constructor with
visibleBoolproperty forPopoverand removed experimentalclose_policy
Fixed
UI Module
- Arc thickness not constrained to parent frame properties
Language
- Error message when parsing invalid unicode codepoints not describing the issue
Kontakt 8.5
New Features
UI Module
- Drag and drop modifiers to enable drag and drop functionality on components are now stable:
Language
- Enums can now be used as keys in maps
- Compile time improvements
Kontakt 8.4
New Features
Kontakt Module
- KSPButton, KSPKnob, KSPSwitch, and KSPValueEdit expose the KSP property
$CONTROL_PAR_TEXTvia thetextproperty. - KSPTextEdit adds a setter to the property text
UI Module
- Added experimental close_policy property to
Popover - Added TextInput component
Fixed
Kontakt Module
- An issue where the menu entries visibility in
KSPMenuinstances was not synchronized with their counterparts in KSP.
Language
- An issue where using the declarative for loop wouldn't update before its body
- An issue where the declarative if statement wouldn't update before its body
- An issue where some modifiers caused a cycle error
Kontakt 8.3
New Features
Kontakt Module
- KSPTable exposes
lengthproperty.
Kontakt 8.2.1
Fixed
UI Module
- Fixed an issue where Popover was not displayed when its
visibleproperty was initially set totrue. - Fixed an issue where Popover was not following its anchor.
- Resolved a crash that occurred when the UI was reloaded and a Popover was present.
Kontakt 8.2
New Features
Language
-
Angle: Helps dealing with degrees and radians conversion
The components and modifiers that take angles as arguments now use the Angle global class instead of
Floattype. This affects Rotation, Arc, and the Canvas methods draw_arc, draw_pie, and rotate. -
Maps: A new associative container to store key-value pairs.
-
Unicode code points allowed in string literals
-
Named arguments can be listed in arbitrary order now
-
enumerated() was added to Array to iterate over elements with their index.
-
nilcan now be used as result of a ternay branch:var x: Int? = 0 > 1 ? 4 : nil -
clamped(min:max) added to Float.
-
Range utility to express ranges and iterate over them
-
Type deduction for templates and function expressions
You can now omit the parameter type annotation when using templates and function expressions. In the case of function expressions the return type can also be omitted. Examples:
old syntaxvar fun_expr: (Int) -> (Int) =
fun (x: Int) -> (Int) {
return x + 1
}new syntaxvar fun_expr: (Int) -> (Int) =
fun (x) {
return x + 1
}old syntaximport { VStack, Text } from ui
component MyList {
@property item: Template(String)
VStack {
for i in Range(3) {
self.item("\{i}")
}
}
}
export var main: Component = MyList(
item: template (text: String) {
Text(text)
}
)new syntaximport { VStack, Text } from ui
component MyList {
@property item: Template(String)
VStack {
for i in Range(3) {
self.item("\{i}")
}
}
}
export var main: Component = MyList(
item: template (text) {
Text(text)
}
)
UI Module
- Text modifiers: Affect the default style of text:
Kontakt Controls Package
- XYPad component to display the values of the active cursor of a KSP
ui_xy - Stepper component to display the value of a KSP
ui_value_edit
Breaking Changes
Komplete UI Setup In Kontakt
The load_komplete_ui() KSP command was removed. To load the main Komplete UI module you can now select the module file in the Instrument Options dialog. Find a step-by-step guide in Get Started
Language
-
countparameter ofArray.subsequencewas renamed tolength -
Array.filterwas renamed tofiltered(by)old syntaxvar res = ([1, 2, 3]).filter(fun (value: Int) -> (Bool) {
return value > 2
})new syntaxvar res = ([1, 2, 3]).filtered(by: fun (value: Int) -> (Bool) {
return value > 2
}) -
String.index(of)no longer returns 0 when searching for an empty string -
String.replace_allrenamed toreplacing_all -
String.removingwas removedYou can achieve the same by using
removing_subrangeandindex:var example = "some words that I know"
var remove = "that "
var result = example.removing_subrange(
from: example.index(of: remove)!,
length: remove.length
) -
String methods providing an offset didn't accept from to be after the last character
This includes
substring,index(of)andremoving_subrange. -
Exported types can not refer to un-exported types anymore
old syntaxexport var main = Main()new syntaxexport var main: Component = Main() -
if-else expression syntax updated to ternary conditional expression
The syntax for using an if-else conditional expression to produce a value was updated to
a ? b : c. Here is an example:old syntaxvar x = if 0 < 1 {"Hello"} else {"World"}new syntaxvar x = 0 < 1 ? "Hello" : "World"Note that this applies to any place that accepts an expression. Here is an example of a conditional expression used within a component:
import { Hover, Text } from ui
component HoverText {
hovered: Bool = false
Text( self.hovered ? "Hovered" : "Not Hovered" ) with {
Hover(self.$hovered)
}
}clampInt method renamed toclamped
The naming is now aligned with the Float
clampedmethod.
UI Module
-
Ring renamed to Arc
-
Text component font size changed to Int
This was a bug and we never supported rendering in between pixel values. Migrate your code to use integers only for font sizes.
-
FontFamily renamed to FontFamilyName
Simply replace all occurences of
FontFamilywithFontFamilyName. This was done so we can use the name for the newFontFamilymodifier (see below). -
TapGesture
cancelanduptrigger changesCancel is only triggered when another gesture takes over. This means it is no longer triggered when the pointer left the component, or when the pointer moved too far from the "down" location.
Up is triggered even if the gesture completes outside of the component, unless cancel was triggered before.
Math Module
-
degrees_to_radiansandradians_to_degreesremoved in favor of the new Angle class. -
clampandclampfmethods removed in favor of Int.clamped and Float.clamped
Kontakt Controls Package
TogglePolicywas renamed to TriggerPolicy
Fixed
Language
-
Parameter names sometimes not included in error messages
-
Bitwise operations inside a string interpolation caused a runtime error
-
Float.to_intdidn't raise an error on over-/underflow -
String.substring(from:length)didn't validate from for empty strings -
String.index(of)raised an error when used on an empty string -
String literals allowed trailing line breaks
String literals cannot contain unescaped line breaks. The trailing line breaks where also not part of the actual string value.
-
String.splitcouldn't handle a trailing separator -
String.splitwould hang when separator was an empty string -
For loop body inside property getter interpreted as declarative block
-
Escaped newline in string causes runtime error
-
Constructor delegation argument with optional ternary doesn't type check
-
Parsing error when the unwrap (!) operator is followed by an equality (==) operator, e.g.
x! == 5 -
Assigning a lambda to a variable of optional function type erroneously produced a type error
var f: () -> ()? = fun () {} // typecheck error occured -
Templates have now a proper string interpolation
var t = template () {}
var s = "\{t}" // == "template(x)", where x is some memory addressAlso templates are now properly "printed" when they are part of another aggregate, like a class.
-
Referencing variables which start with nil, true or false
var nil_index: Int? = nil
var x = nil_index // invalid parser error was generated here -
Fixed several string methods not treating different unicode normalization forms the same way
The same unicode character using different normalization forms should be treated as the same. Example: The letter Å can exist in composed form, i.e.
"\u{00c5}", or in decomposed form, i.e."\u{0041}\u{030A}"(A◌̊).Methods affected by this fix:
String.index,String.has_prefix,String.has_suffix,String.removing_allandString.replacing_all.
UI Module
Paddingdidn't validate it's propertiesTextdidn't validate itsline_limitandfont_weightpropertiesOpacitydidn't validate it's propertiesFramedidn't validate it's propertiesTextgets truncated instead of wrapped on Windows in some casesTapGestureaccepts right mouse button when left is pressed- Calling
load_fontwith empty list causes an error - ZStack layout didn't take into account the priority of its children
Kontakt Controls Package
- Slider dragging doesn't match mouse movement 1:1
Kontakt 8.1 (Komplete UI Beta)
New Features
Kontakt Module
KSPTextEditto connect to aui_text_editin KSPKSPLabelto connect to aui_labelin KSP
Kontakt 8 (Komplete UI Beta)
Introduction of Komplete UI public beta. Creating a resource container will now create a new folder called komplete_scripts.
A Komplete Script file has the file extension .kscript and can be loaded from KSP with load_komplete_ui("module_name").
Have a look at Get Started for more details.