Can't Load Samplemaps After Changing Directory?
-
I'd really appreciate som help here…having a rough time with this. My code to do this was running fine, but I refactored a bunch of seemingly unrelated other stuff, and now it doesn't seem to work in the compiled plugin.
It works inside HISE. And in the compiled version, it prints the name of both the sample directory and the SampleMap correctly (same as when it's running inside HISE).
I change the sample directory:
// Change the location of the Sample folder (by creating a Link file). Settings.setSampleFolder(global_prismIntermediatesFolder);
And that creates a LinkOSX file with the correct string:
/Users/shaft/Downloads/PRISM/Dreams.prism.bundle
Then I call this, which seems to be necessary for some reason:
// Reload samples using the new Sample folder location. Engine.reloadAllSamples ();
And finally, I load a SampleMap:
mySampler.loadSampleMap(global_activeSampleSet);
But nothing seems to happen.
Specifically, the SampleMap loading broadcaster receiver doesn't fire.
Is there any way to get information about an internal error that might have been thrown or something?
Thank you for any help here. This one is killing me. 🤪
-
@clevername27 said in Can't Load Samplemaps After Changing Directory?:
And that creates a LinkOSX file with the correct string:
Where?
-
/Users/shaft/Library/Application Support/my_plugin_company/my_plugin_name
(I forgot to mention that works inside HISE.)
-
@clevername27 That's only used by the compiled plugin. If you're working in HISE then it's going to read from the Samples folder within your project folder - you can redirect it (I think there's a way to do it through project preferences).
-
@clevername27 said in Can't Load Samplemaps After Changing Directory?:
(I forgot to mention that works inside HISE.)
Oh so the problem is only in your compiled project? Did you try removing and readding the plugin instance (or restarting the standalone application if that's what you've made) after relocating the samples?
-
@d-healey Thank you - I did, same result. The weird thing is I've run this code for over a year, and everything worked fine. It's been torture-tested by dozens of people, and I've refactored everything many times.
But when I refactored elsewhere in the programme, this time, I must have done something? I'm also doing every type of file error-check I can think of, and all that says it's fine. I should also mention the specific issue is that the SampleMap broadcast receiver isn't firing (in the compiled version).
-
@clevername27 said in Can't Load Samplemaps After Changing Directory?:
I should also mention the specific issue is that the SampleMap broadcast receiver isn't firing (in the compiled version).
Was it working before your refactor?
-
@d-healey Yeah - so you think I could just work backwards. But for whatever reason, and I know this sounds crazy, that doesn't work. If I start with the project that has the refactored code base, and comment out every line of code, and just put in the code from the working version…it still doesn't work!
-
@d-healey I'm building the working one again just to check my sanity.
UPDATE: It works. Somehow, lol.