What's new

Kontakt Creator Tools - GUI Designer: basic approach to integrate in a script and how to manage persistent variables

rattala

New Member
I'm a newbie so thanks in advance for the patience: I'd like to understand the basic approach on how to "strip down" the code created by means of Kontakt Creator Tools and how to manage some "leftover lines of codes" that I have written to manage my GUI controls, in particular the statements make_persistent() and read_persistent_var().
I would have thought to simply leave these statements in the on init call back inside the text script file that's inside the \scripts folder of the NKI instrument.
Imagine to have this:

{VOLUME - SLIDER - INSTRUMENT MASTER LEVEL} declare ui_slider $Volume(1, 1000000) move_control_px($Volume, 21,150) [COLOR=rgb(235, 107, 86)]make_persistent($Volume) read_persistent_var($Volume)[/COLOR] declare $VolumeId $VolumeId := get_ui_id($Volume) set_control_par_str($VolumeId, $CONTROL_PAR_PICTURE, "MyAnimatedKnob") set_control_par($VolumeId,$CONTROL_PAR_MOUSE_BEHAVIOUR,-1000) read_persistent_var($Volume) end on

I think that by using CT "I have moved" all the parameters and statement of the GUI control, except for the "persistent ones", into the file called "instrument.nckp" that is recalled by the ON INIT call back of the shortened and revisited code (let's call it "the CT version", and the result should be something like this:

on init make_perfview load_performance_view("instrument") {VOLUME - SLIDER - INSTRUMENT MASTER LEVEL} make_persistent($Volume) read_persistent_var($Volume) end on

Is that the right approach to strip down the code that it seems will be managed by the CT's GUI Designer from the code that seems related to what the GUI Designer can't manage or am I missing something fundamental ?

PS:Not sure if in my code (just related to GUI controls) there might be other parameters or statements that could not be managed by CT (for example some hide\show attribs or assignment to UI_panels ?) but for the sake of a clear view I'd like to understand the general principle.

Thanks in advance, still on the learning path...
 
Top Bottom