So I’m trying to make a sandboxed AUv3 sampler plugin that can load SFZ files from my hard drive. My app/plugin will be fully sandboxed so that it can run within Logic/GarageBand. As part of the app’s functionality, I want the user to be able to load an SFZ file from their hard drive in much the same way that a user might load a Kontakt library, or in fact an SFZ into a plugin like Sforzando.
I’m able to pop up the Open dialog box which selects the SFZ file in question, and I’m able to read and parse that SFZ file. I am, however, not able to open the wave files which are referenced by that SFZ file (the wave files are right there on disk next to the SFZ file). If I dig into the code, I can see that the OS returns an “Operation not permitted” error. I’ve read through the Apple Documentation on the Sandbox. If I understand correctly, it seems that because the user did not explicitly choose the wave files in the Open dialog box (they chose the SFZ, of course), the sandbox hasn’t made the WAV files available to my app.
So my obvious question is: Is it therefore impossible to make an SFZ player in AUv3 format? Is there actually no way to open files that aren’t explicitly selected by a user (or within one of the special protected directories, which is obviously not useful).
Needless to say, if I rewrite my code to read zip files, and I zip up the SFZ and the wave files, and then choose that zip file in the open files dialog box, I can then I have my code unzip them into a system-provided temp directory, and, yes, I am then able to open the SFZ just fine. Obviously, I can’t expect users to do that, though.