What's new

Question on get_folder_library_dir

azrulsaleh

Member
Developing for Kontakt 6, what determines the location of $GET_FOLDER_LIBRARY_DIR?

Focusing on just OS X to simplify the examples, the location of unencoded libraries seem to point here:
<Username>/Documents/Native Instruments/Kontakt/

While for encoded libraries, the location seem to point here:
<UserName>/Library/Application Support/<Library Name>/

Are these path always at these fixed location? Can the user change this?
 
Last edited:
User cannot change this. The path gets changed to actual library path after you encode it for Kontakt Player. It is advised for non-KP libraries to use $GET_FOLDER_PATCH_DIR instead.
 
Thank you for confirming.

Why would it not be advised for non-KP libraries to use $GET_FOLDER_LIBRARY_DIR? Is there a flaw to this approach?
 
Well it requires users to manually place files at that fixed location that is not in the root folder of your library, it's just way more hassle and people forget about that path when moving libraries between computers etc. Best use $GET_FOLDER_PATCH_DIR.
 
So if I'm delivering a library for encoding I should replace for example this:

@filepath := get_folder($GET_FOLDER_PATCH_DIR) & "/Resources/data/“
to
@filepath := get_folder($GET_FOLDER_LIBRARY_DIR) & "/Resources/data/“

in order the encoded library will read and write the preset arrays properly correct?

If that's the case it shouldn't work anymore with the unencoded version isn't it?
 
Just an update:

So if I'm delivering a library for encoding I should replace for example this:

@filepath := get_folder($GET_FOLDER_PATCH_DIR) & "/Resources/data/“
to
@filepath := get_folder($GET_FOLDER_LIBRARY_DIR) & "/Resources/data/“

in order the encoded library will read and write the preset arrays properly correct?

If that's the case it shouldn't work anymore with the unencoded version isn't it?

That won't work for an encoded library, since there will be no Resources folder.
Resources will be read from the Nkr.

For that situation, there is load_array mode 2.
Since a .nka can't be saved to a Resource container, save_array mode 1 is recommended.
 
Last edited:
Top Bottom