Dynamically load instruments over the Internet?
-
@bthj Since the samples maps are predefined anyway why not just include them with the plugin instead of downloading them?
-
@d-healey The aim is not to have the sample maps predefined, but generated mechanically.
For a bit of a context: I'm exploring those possibilities for the synth.is project, where you can evolve sounds[1], render them as sample packs and currently download them along with programmatically generated SFZs[2]. Many things broken there and I aim to continue working on this research project in the coming years, but all are very much welcome to play with this (I know the interactive evolution part is broken, which is a regression resulting from work on quality diversity search for sounds - I welcome requests for accelerated fixes : )
Just as SFZs can currently be rendered and downloaded, it would be nice to be able to obtain those sounds directly in a plugin.
[1] https://youtu.be/dm2cgPqQVP0
[2] https://youtu.be/3eLo8qORiMQ
(YouTube links here as inlining above was causing problems) -
The approach I have currently implemented is maybe ok - sample maps are not large so redundant downloading isn't a big problem - but if it is possible to persist them in the plugin folder structure, then it would be interesting to try that out as well.
-
@bthj said in Dynamically load instruments over the Internet?:
The approach I have currently implemented is maybe ok - sample maps are not large so redundant downloading isn't a big problem - but if it is possible to persist them in the plugin folder structure, then it would be interesting to try that out as well.
You could write the string to a file.
-
@d-healey Wouldn't it be best placed in the SampleMaps folder? - then I'm wondering how to get a filesystem handle on that folder.
-
Tried something like:
samplesFolder.getParentDirectory().getChildFile("SampleMaps").getChildFile(sampleMapFileName);
which works, so I'll probably go that route, if it isn't some kind of an anti-pattern?
-
@bthj said in Dynamically load instruments over the Internet?:
@d-healey Wouldn't it be best placed in the SampleMaps folder?
There is no sample maps folder once your project is compiled to a plugin, all the sample maps are embedded in the binary.
-
@d-healey Thanks for the insight. Then it makes sense that there is no Special Location FileSystem constant for that folder. I'll just download the sample maps to the Samples folder, alongside the monoliths, Base64 encoded for loading with
Sampler.loadSampleMapFromBase64
. -
The above procedure of downloading the files to
FileSystem.Samples
works fine, until running on iOS, where theSamples
folder seems to be part of the read-only app bundle. So downloading toFileSystem.Documents
might be a better idea, but after loading the sample map, the Sampler seems to be fixed on searching for the files inFileSystem.Samples
.Is there some way to instruct Sampler to look for the (monolith) samples in
FileSystem.Documents
? -
Made a couple of changes which solve this issue on iOS, discussed here: