What's new

Resource files handling for a newbie ?

Fredeke

Senior Member
Hi!
Could someone explain to me (or point me to an explaination of) how to manage resource files, folders and container, and keep relative paths working when moving everything around ?

Could it be explained like I'm a total noob, because apparently I must be one ?

The following is a lengthy description of my ignorance (I honestly don't know whether it is necessary, but at least for the curious) :

Here's my (relatively vague) experience :
I go to instrument options, create a nkr and link to a wallpaper file. Then kontakt creates a resource folder that I seem to understand is a temporary place for the nkr file's content. Then the next day I try to open my nki instrument and kontakt 5.2 (I know - sorry) can't find the wallpaper and nkr (and resource folder) and I have to re-link everything every time - this even though I haven't moved anything. But 5.7 does find them, so ok let's use 5.7, which I should have been doing since long anyway.
But when I move everything around together (to make sure no path is absolute and everything will work on everybody's computer as long as relative paths are preserved), then even Kontakt 5.7 can't find the resources anymore.

And here are my questions :
- Am I having problems because of still using the temporary "resource" folder ?
- How do I finalize and lock down my design ? How do I get rid of the "resource folder" and start using the actual nkr file ?
- Is there a way of including the resource images and wallpaper directly into the nki (a kind of graphical equivalent of a monolith) just to be sure they'll always be found, instead of using nkr or otherwise external files ?
- Is it a problem to use the same "resource" folder for several instruments when they require the same graphics ?
- Does what scripts I put in the resources actually matter, since scripts are also directly typed (or pasted) into the nki's script editor, and apparently stored in the nki itself? (I would like the answer to be no, because all my instruments use the same resources, except for slightly different scripts)
- Does any of my questions even make sense, or am I going about this the very wrong way ?

Btw, I don't think this matters but just to be thorough: I plan to keep the WAVs in an accessible folder ( = not monolithed into the nki), so they can be used into other samplers too - without my amazing kontakt interface, but still ;)
 
Last edited:
Do not use monoliths if you're going to use NKRs. When saving the NKI, make sure that Absolute sample paths checkbox is disabled.

To rebuild the NKR, just repeat the procedure of creating it, and overwrite the current NKR.

- Is there a way of including the resource images and wallpaper directly into the nki (a kind of graphical equivalent of a monolith) just to be sure they'll always be found, instead of using nkr or otherwise external files ?

No, this is why NKR exists in the first place.

- Is it a problem to use the same "resource" folder for several instruments when they require the same graphics ?

Absolutely not, this is why NKRs were created as a feature in the first place.

- Does what scripts I put in the resources actually matter, since scripts are also directly typed (or pasted) into the nki's script editor, and apparently stored in the nki itself? (I would like the answer to be no, because all my instruments use the same resources, except for slightly different scripts)

When you put scripts as .txt files in Resources folder/NKR, you can link to them from the NKI file. Then when you update the script(s), they are updated across all your NKIs. Killer feature.
 
When you put scripts as .txt files in Resources folder/NKR, you can link to them from the NKI file. Then when you update the script(s), they are updated across all your NKIs. Killer feature.
It's the opposite of what I'm looking for right now, but I understand that it can be super handy.
 
Regardless you should definitely link the script(s) you're using to the NKR. Just makes sense, plus it's sort of intended workflow.
 
Then what workflow would you suggest?

I have a long common script that is the same for all instruments, and a short config script (essentially setting constants and arrays) which will be different for each instrument.

I essentially see 2 solutions:
- use SublimeKSP's include function (I don't remember whether it's actually called include but you see what I mean). That would generate one compiled script that would be different for each instrument.
- use 2 script slots in my instruments: one for the common script and one for the config script, then pass everything between them through PGS. That would require a slightly longer and more complicated code (I mean complicated for the Human reader).

How would you do it?
 
I'd use the second method. The first method completely bypasses the benefit of linking scripts, which is: link once to many files, then modify for all of them at the same time from that single script.

Also, you don't necessarily have to transfer stuff via PGS to the other script slot. You can just set the PGS values in the first slot (in persistence_changed callback, and of course, every control's UI callback), then just get them from the second (or any other slot) whenever you need to access some parameter. There's no need to litter the second script with variables that contain values from PGS arrays, unless you really really need that for some reason.

Hmm I haven't been linking scripts, that does sound handy.

You have been missing out!
 
Top Bottom