# Useful Creator Tools functions



## EvilDragon

Here are some *very *useful functions for various group/zone processing with Creator Tools Lua scripts:









GitHub - Yaron-NI/Kontakt-Public: Resources for Native Instruments Kontakt builders


Resources for Native Instruments Kontakt builders. Contribute to Yaron-NI/Kontakt-Public development by creating an account on GitHub.




github.com






(@creativeforge - please sticky this!)


----------



## Patrik Herman

The link seems to be broken :/


----------



## EvilDragon

That's because it was wrong.  Fixed!


----------



## Patrik Herman

Is it a private repo? I am still getting a 404 error and I am unable to see the repo in his list of repositories.


----------



## Jaap

I also see only a 404 error


----------



## EvilDragon

Ah darn it, it could well indeed be private. Oops. Will ask Yaron about opening it up.


----------



## Yaron_NI

Hey everyone! Sorry for the confusion, now EvilDragon got the correct link on top and you can access.

Some background: 

I am the QA engineer of the Kontakt platform and since I have joined I have of course often been playing around with our tools and slowly came up with a collection of functions that I then decided to try to clean up and prepare them in a re-usable manner for the community.

So this is not "official NI stuff" at this point, but it is presented to you with the blessing of everyone in the team. 

Feel free to contribute by submiting your own code and functions, asking for functions to be implemented, suggesting fixes or anything really.

Also, we would love to know if you find these useful, how often you use them and if they make your Creator Tools LUA experience better.


----------



## chimuelo

Yaron and Evil Dragon teaming up?
Awesome.
FaxiNadu makes great stuff...


----------



## d_thomas

Thank you!


----------



## Yaron_NI

Bump!

- Added some documentation and an easy for copy pasting functions list.
- Added a Creator Tools template project


----------



## Yaron_NI

- Also added some NCKC file examples. Feel free to contribute more of these...









Kontakt-Public/Creator Tools NCKC GUI Widgets at master · Yaron-NI/Kontakt-Public


Resources for Native Instruments Kontakt builders. Contribute to Yaron-NI/Kontakt-Public development by creating an account on GitHub.




github.com





_"The control files (.nckc) are files that are created by exporting a single control or a panel container of controls. These files can then be imported in a later GUI Designer project, shared with collaborators or set the foundation for building custom UI libraries."_


----------



## Yaron_NI

- Updated the main readme file with LOTS of links, check it out!
- Small bug fix to one of the Lua functions.


----------



## Yaron_NI

Hey all! An update to the repository!

https://github.com/Yaron-NI/Kontakt-Public/tree/master/Kontakt%20Mapping%20Editor%20-%20Lua%20Auto%20Mapper
*Kontakt Mapping Editor - Lua Auto Mapper*
This script will parse information from file names in order to fill a sample mapping.

Suppose we have a high number of samples that we want to map according to tokens we place in the sample name.

We can let the script know which token corresponds to which mapping parameter and then use that in order to map each sample.

This script is built to be highly generic and re-usable for many scenarios.

The first section contains user variables that can be set in order to adapt the script. It is possible to use various naming conventions by telling the script where each token located.

The second section declares a number of helper functions used in the script.

The third section looks at the file system and prepares tables containing the paths and the tokens.

The fourth section prepares the mapping itself.

The example samples use the following naming convention: sampleName_root_lowKey_highKey_lowVel_highVel_roundRobin_articulation_signalType e.g.: broken piano_r60_lk0_hk127_lv0_hv127_rr0_normal_close

*Example Usage*

Download the script folder from the repository
Launch Kontakt
Double click on the Kontakt rack to create a new NKI
Enter the NKI's edit mode
Launch Creator Tools
Navigate to the Lua tab in Creator Tools
Drag and drop the Lua script unto the Lua tool
Press play in the Lua tool
Click the arrow in Creator Tools to push to Kontakt
*Adapt Scenario*

Click the "Open in text editor" icon next to the play button in Creator Tools
Edit the USER VARIABLES section according to your scenario


----------



## shapednoise

Yaron_NI said:


> I am the QA engineer of the Kontakt platform and since I have joined I have of course often been playing around with our tools and slowly came up with a collection of functions that I then decided to try to clean up and prepare them in a re-usable manner for the community.
> So this is not "official NI stuff" at this point, but it is presented to you with the blessing of everyone in the team.





Hi there. the C T are obviously very powerful but somewhat opaque to non code save, humans. Is there any plan to create a set of strings for an entire workflow from importing, Normalising, pitch detection, to group creation etc? 
Something that an old drunkard with no skills could perhaps slowly wrap his head around? 
Maybe some YouTube Demos and scripts us luddites could attempt to come to grips with?


----------



## Yaron_NI

shapednoise said:


> Hi there. the C T are obviously very powerful but somewhat opaque to non code save, humans. Is there any plan to create a set of strings for an entire workflow from importing, Normalising, pitch detection, to group creation etc?
> Something that an old drunkard with no skills could perhaps slowly wrap his head around?
> Maybe some YouTube Demos and scripts us luddites could attempt to come to grips with?




All valid. There are of course various plans and things. 

Just to emphasise - this repository is something I do in (mostly) my free time to give something back to the community, so it is separate from any "official" development that goes on at NI for Kontakt and Creator Tools.


----------



## Truthtrader

I dont want to start a new thread, so mods please remove if its not allowed here.

Is it worth upgrading to Kontakt 6 for creator tools. I have watched a few videos and read the manual and still not sure if you have to use lua or if you can still use ksp.

The copy paste is a grind.

Thanks


----------



## Yaron_NI

Creator Tools and Lua are just an additional way to map samples into an instrument.

There is no obligation to use it in any way, and the instrument itself is built with KSP, nothing changed in that regard.


----------



## Truthtrader

Yaron_NI said:


> Creator Tools and Lua are just an additional way to map samples into an instrument.
> 
> There is no obligation to use it in any way, and the instrument itself is built with KSP, nothing changed in that regard.


So I won't be able to write KSP code and sync and upload it to kontakt so I can not have to copy paste all the time?


----------



## Yaron_NI

I am not exactly sure what the question is, but you CAN push a KSP script to Kontakt from Creator Tools


----------



## Yaron_NI

I propose the original question is actually not the right one you should be asking yourself - aside from Creator Tools, Kontakt 6 by now has added, changed, fixed, improved so many things over Kontakt 5.

You should be asking yourself if the overall package is worth it for you, not focus only on a single feature/workflow


----------



## Truthtrader

What I basically want to achieve is the following. 

I want to be able to organise code into different files. 

Ie) KSP for filter envelope
KSP for ADSR

Then I want to reference those files in a "master" script

Then if possible push that into kontakt. 

I have been trying to understand the import keyword as I'm assuming this is what I am looking for


----------



## d.healey

Truthtrader said:


> So I won't be able to write KSP code and sync and upload it to kontakt so I can not have to copy paste all the time?


You don't have to copy and paste in Kontakt 5 either.

You can link a text file to the editor that will automatically update when you save it. And you should use SublimeKSP if you're not already.


----------



## Truthtrader

d.healey said:


> You don't have to copy and paste in Kontakt 5 either.
> 
> You can link a text file to the editor that will automatically update when you save it. And you should use SublimeKSP if you're not already.


David you are a legend

I am using Sublime KSP...

Would you mind giving me an indication of linking the text file

Please See attached screenshot

So to my understanding..................

My seperate pieces of code like "Filter envelope", "Instrument ADSR"

need to be TXT files in the scripts folder.

Then i would have a master text file "Importing" ("Filter envelope") etc.

If so what would i need the ksp fie for, or does Kontakt just recognise the syntax in the text file?

Thank you so much for your help


----------



## d.healey

Truthtrader said:


> My seperate pieces of code like "Filter envelope", "Instrument ADSR"
> 
> need to be TXT files in the scripts folder.
> 
> Then i would have a master text file "Importing" ("Filter envelope") etc.
> 
> If so what would i need the ksp fie for, or does Kontakt just recognise the syntax in the text file?
> 
> Thank you so much for your help


I think this explanation of the import keyboard is probably the simplest - https://nilsliberg.se/ksp/scripts/tutorial/editor.html#import

For linking an external script to the editor you need to use the "Apply From" drop down menu in the KSP editor. More details in the KSP reference manual (starting at page 200) https://www.native-instruments.com/.../kontakt/KONTAKT_602_KSP_Reference_Manual.pdf


----------



## Truthtrader

d.healey said:


> I think this explanation of the import keyboard is probably the simplest - https://nilsliberg.se/ksp/scripts/tutorial/editor.html#import
> 
> For linking an external script to the editor you need to use the "Apply From" drop down menu in the KSP editor. More details in the KSP reference manual (starting at page 200) https://www.native-instruments.com/.../kontakt/KONTAKT_602_KSP_Reference_Manual.pdf


David. 

Thank you so much. 

I really really appreciate it. 

Especially after my kontakt is protools thread. Funnily enough I'm really starting to enjoy the scripting. 

Also love all your YouTube videos.


----------



## Truthtrader

I seem to have hit a road block. 

I think that by seperating my code into smaller text files and using the import function that I have created some kind of loop that keeps erroring out with the error, syntax x already declared.

Or variable redecalared. 

I am really a code novice and I'm trying to build a decent framework that I can keep working off of. 

I don't really understand the syntax and reading it is getting me somewhere slowly. 

In a nutshell I have seperated my declarations into smaller text files and using them as an import for other code such as UI and filter envelope etc. 

I think that is where the loop occures .

I call let's say ui control to one file and then call it to the master init file and that's where the readeclare comes in.

Is there an easier way to do this or maybe call the the declare UI control and then cancel it after it has done its job. 

Or is it more simple to have the declares in the same file so I don't need to worry about the errors.

I have folders as 

Main.txt where the code gets copied after the compile. 

Then 

Filter envelope adsr. This is where I put the UI controls mainly for ui spacing 

Then filter .txt 

I put the UI for the filter. 

I then import the UI filter into the main on init file. 

So I guess I'm confusing the program because I'm calling the same declares into different files. 

I hope there is a simple answer to this


----------



## d.healey

Truthtrader said:


> I seem to have hit a road block.
> 
> I think that by seperating my code into smaller text files and using the import function that I have created some kind of loop that keeps erroring out with the error, syntax x already declared.
> 
> Or variable redecalared.
> 
> I am really a code novice and I'm trying to build a decent framework that I can keep working off of.
> 
> I don't really understand the syntax and reading it is getting me somewhere slowly.
> 
> In a nutshell I have seperated my declarations into smaller text files and using them as an import for other code such as UI and filter envelope etc.
> 
> I think that is where the loop occures .
> 
> I call let's say ui control to one file and then call it to the master init file and that's where the readeclare comes in.
> 
> Is there an easier way to do this or maybe call the the declare UI control and then cancel it after it has done its job.
> 
> Or is it more simple to have the declares in the same file so I don't need to worry about the errors.
> 
> I have folders as
> 
> Main.txt where the code gets copied after the compile.
> 
> Then
> 
> Filter envelope adsr. This is where I put the UI controls mainly for ui spacing
> 
> Then filter .txt
> 
> I put the UI for the filter.
> 
> I then import the UI filter into the main on init file.
> 
> So I guess I'm confusing the program because I'm calling the same declares into different files.
> 
> I hope there is a simple answer to this


I suggest you make a new thread and post some code examples to demonstrate the issue.


----------

