New feature: Global Sample Path
-
Hi everybody,
this is just a new feature that was added recently that you might want to be aware of:
Global Sample Path
In some workflow setups, the sample data needs to be stored on an external location. This might be an dedicated hard drive or a folder in your Dropbox. In order to use these files you had two options:
- Use absolute paths to this location. The absolute worst option, since it's impossible to port your project on another computer let alone loading samples in your compiled project.
- Redirect the sample folder. Create a link file in your projects sample folder. It will point to another location and resolve any references with
{PROJECT_FOLDER}
to this directory instead of the Samples subdirectory of your project folder. The samples are kept out of the project folder, Git is happy and everything is perfect. Well...
While the first option should be avoided at all cost, the second option might be a good fit. However there are a few pitfalls: the folder redirection is part of the Git repository and thus subject to version control. However it is not guaranteed that the folder will exist on all machines that checkout the repository so instead of having to fix a few thousand missing file references like in solution 1, you brought it down to just one. However, that's still one above the desired number, so: Global Sample Path to the rescue.
How it works
Instead of saving an absolute path in the linkfile called LinkWindows / or LinkOSX in your sample folder, you can use the
{GLOBAL_SAMPLE_FOLDER}
wildcard to make it a relative reference. Now you may ask RELATIVE TO WHAT??? and the answer is: to the folder you specify in the Hise settings dialogue under Global Sample Path. The advantage of this approach is clear: there will be never a absolute file path reference in your git repository. The task to resolve that reference is deferred to HISE, which uses a per-system property to resolve it locally.Using it with multiple projects
Be aware that it also works as part of a path which might be come in handy if you are working on more than one project. Let's assume you are collaborating on a project with some dude and you are both using Dropbox. The samples are stored in a drop box folder called Funkytown Samplez (yes, it's spelled correctly because we're funky in Funkytown). However at the same time you're working with a more serious but slightly boring company on a project called Grand Piano, also on Dropbox. Now in order to use this trick for both projects, you need to choose your root Dropbox folder as Global Sample Folder in the settings. Then the contents of the Link files are:
{GLOBAL_SAMPLE_FOLDER}Funkytown Samplez
and
{GLOBAL_SAMPLE_FOLDER}Grand Piano Samples