# Two Multiscript Questions



## dfhagai (Apr 9, 2018)

Hi,

I have two questions regarding multi-scripting please:
1. Since snapshots are not an option, what's the best practice for creating accessible multi-script user presets?

2. Since set_ui_color isn't an option, what's the best practice for changing to UI color?

Thanks!!!!!!!
HD


----------



## EvilDragon (Apr 10, 2018)

1. NKA import/export

2. Best do nothing there, honestly, since multiscripts don't support resource containers. Just work with the flat gray background and that's it.


----------



## dfhagai (Apr 10, 2018)




----------



## dfhagai (Apr 10, 2018)

Can a NKA file hold more then one array?


----------



## Levitanus (Apr 10, 2018)

dfhagai said:


> hold more then one array?


hold one, thansplit to multiple)


----------



## dfhagai (Apr 10, 2018)

You mean I actually need to create one huge array that will hold the info off all the tables, value edits, knobs etc, and on load - resplit it? Sounds like a nightmare 

If anyone happens to have a code that demonstrated it, I'll be very greatfull!


----------



## Levitanus (Apr 10, 2018)

This is pretty poor code, but only I have on the hand now. It can be 10 times smaller)

```
function set_master_preset
    print ("!!!SET_PRESET!!!")
    
    iterate_macro(UnitsToMasterPreset) := 1 to UNITS_INSERTS_AMOUNT
    master_preset[8*PRESET_ELEMENTS_MAX] := IRCImpulse
    master_preset[8*PRESET_ELEMENTS_MAX+1] := Layout.DelayTimeUnit
    iterate_macro(LfoToMasterPreset) := 0 to 3
    iterate_macro(SeqToMasterPreset) := 0 to 3
    master_preset[8*PRESET_ELEMENTS_MAX + 2 + 12 + 36*4+5] := Layout.IRCBypButton
end function

macro UnitsToMasterPreset (#unit#)
        iterate_macro(SetUnitMasterPresetElement(#unit#,#n#)) := 1 to INSERTS_ELEMENTS_MAX
        master_preset [(#unit#-1)*PRESET_ELEMENTS_MAX+INSERTS_ELEMENTS_MAX*PRESETS_IN_ELEMENT+1] := Layout.Unit#unit#PluginButton
        master_preset [(#unit#-1)*PRESET_ELEMENTS_MAX+INSERTS_ELEMENTS_MAX*PRESETS_IN_ELEMENT+2] := Layout.Unit#unit#PluginOn
        master_preset [(#unit#-1)*PRESET_ELEMENTS_MAX+INSERTS_ELEMENTS_MAX*PRESETS_IN_ELEMENT+3] := Unit#unit#PluginType
        master_preset [(#unit#-1)*PRESET_ELEMENTS_MAX+INSERTS_ELEMENTS_MAX*PRESETS_IN_ELEMENT+4] := Unit#unit#PluginSubtype
        print ("master_preset ["&(#unit#-1)*PRESET_ELEMENTS_MAX+INSERTS_ELEMENTS_MAX*PRESETS_IN_ELEMENT+1&"] = Layout.Unit#unit#PluginButton: "&Layout.Unit#unit#PluginButton)
        print ("master_preset ["&(#unit#-1)*PRESET_ELEMENTS_MAX+INSERTS_ELEMENTS_MAX*PRESETS_IN_ELEMENT+2&"] = Layout.Unit#unit#PluginOn: "&Layout.Unit#unit#PluginOn)
        print ("master_preset ["&(#unit#-1)*PRESET_ELEMENTS_MAX+INSERTS_ELEMENTS_MAX*PRESETS_IN_ELEMENT+3&"] = Unit#unit#PluginType: "&Unit#unit#PluginType)
        print ("master_preset ["&(#unit#-1)*PRESET_ELEMENTS_MAX+INSERTS_ELEMENTS_MAX*PRESETS_IN_ELEMENT+4&"] = Unit#unit#PluginSubtype: "&Unit#unit#PluginSubtype)
end macro
```


----------



## EvilDragon (Apr 10, 2018)

Yeah, NKA file is one array only.


----------



## dfhagai (Apr 11, 2018)

Thanks Levitanus. really appreciate you taking the time to replay!
Sorry for being a noob, but is this code totally KSP? there are commands that I can't find on the KSP manual (print?)

Another question if I may please, does $CONTROL_PAR_KEY_CONTROL works on Multi-scripts? It fails me and the manual says nothing about this...generally speaking, the manual seem to have a lot of holes


----------



## Levitanus (Apr 11, 2018)

enjoy: https://github.com/nojanath/SublimeKSP



dfhagai said:


> $CONTROL_PAR_KEY_CONTROL


theorethically, should...


----------



## dfhagai (Apr 11, 2018)

I am using sublime....
Will dig deeper, thanks!


----------



## EvilDragon (Apr 11, 2018)

$CONTROL_PAR_KEY_CONTROL is used for only certain types of UI controls to find out if Ctrl was held while the control was clicked on. Very useful for buttons and switches.


----------



## dfhagai (Apr 11, 2018)

Got it now, works great!

Is there a command for knowing which of the UI table slot has been clicked?


----------



## Levitanus (Apr 11, 2018)

$NI_CONTROL_PAR_IDX


----------



## Levitanus (Apr 11, 2018)

you can also use control_par_arr(id, CONTROL_PAR_VALUE, idx, val)


----------



## dfhagai (Apr 12, 2018)

Thank you Levitanus!


----------



## dfhagai (Apr 13, 2018)

Have you noticed this weird behavior?
When you click a table while holding control, draging the value up doesn't work...
When you click a table while holding control, draging down snaps the value to zero....no in-between...
I've encountered this while trying to put $CONTROL_PAR_KEY_CONTROL to good use...

Anyway around this?


----------



## EvilDragon (Apr 13, 2018)

Ctrl+click sets the table value to default value, that's normal. Feel free to use Shift and Alt for things you might want to do (do note that when using Shift, you also get the "precise" mode enabled, you cannot disable this, just like you can't disable the default behavior of Ctrl+click/drag in the table).


----------



## dfhagai (Apr 23, 2018)

OK! I'm done.
BUT: when I try to open my saved multi-script nkp on a different computer, it doesn't work...
Even though my script appears on the multi-script drop-down menu (so I know it's not misplaced), it simply opens nothing....

Here's a https://app.box.com/s/k9x44qtqf4jmjpyhc5isf1555lc5dt0t (link) to the nkp.

Any ideas? what am I missing?


----------



## Levitanus (Apr 23, 2018)

Try to save it once more. It's empty now


----------



## dfhagai (Apr 23, 2018)

Did that many times...
https://app.box.com/s/8qppgwrnbcvuger7pho9y29rvx9hdkw3 (Now?)


----------



## Levitanus (Apr 23, 2018)

nope...
Don't know... My nkp are working:
https://bitbucket.org/Levitanus/multi-scripts


----------



## dfhagai (Apr 23, 2018)

What's your process of saving? I'm at lost here....


----------



## Levitanus (Apr 23, 2018)

as usual - save preset)


----------



## EvilDragon (Apr 24, 2018)




----------



## dfhagai (Apr 24, 2018)

Yes. of course I've done that 
I erased the old one and tried again. is it working now?


----------



## EvilDragon (Apr 24, 2018)

I just opened this in 5.8.0. Doesn't work in versions before 5.8.0 (this is quite important, to save out NKPs in the Kontakt version you wanna target - of course if it's for your own usage, then it's all good, but for sharing, you'd wanna actually share the code, perhaps - then anyone can copy it to multiscript and save it on their side themselves).


Here's NKP which will work in K5.6.8 and above:


----------



## dfhagai (Apr 24, 2018)

Thank you very much Mr. Dragon & Levitanus!


----------



## dfhagai (May 5, 2018)

Could you please tell me what's the multi-script path on a mac? I want to put it on my site, so people will know where to put it


----------



## EvilDragon (May 5, 2018)

/Users/<username>/Documents/Native Instruments/Kontakt */Presets/Multiscripts

* - Kontakt version number (4 or 5)


----------



## dfhagai (May 5, 2018)

Thank you!!!


----------

