{ Initialization when first loaded } on init { Sets a message in Kontakt status bar } message("Initializing my script") { Turn on performance view and set size } make_perfview set_ui_height(1) { Create the knob UI element with its ranges } declare ui_knob $myCutoffKnob(0, 1000000, 1) { Position the knob X/Y (0-6/0-16) } move_control($myCutoffKnob, 2, 1) { Get the current value of parameter and display it } set_knob_label($myCutoffKnob, get_engine_par_disp($ENGINE_PAR_CUTOFF, -1, 0, 1)) { Have the knob position stored as part of the instrument snapshot } make_persistent($myCutoffKnob) end on { Callback when knob is twisted } on ui_control($myCutoffKnob) { ENGINE_PAR_CUTOFF is for a filter effect, so the first INSERT effect needs to be a filter } set_engine_par($ENGINE_PAR_CUTOFF, $myCutoffKnob, -1, 0, 1) { set_engine_par(, , , , ) -1 = no specific group, apply to instrument 0 = 1st effect in the list (slot 0) 1 = insert effect (0 would be send effect) } { Update the UI label now that the value has changed } set_knob_label($myCutoffKnob, get_engine_par_disp($ENGINE_PAR_CUTOFF, -1, 0, 1)) end on