Preset Browser Ideas
-
Hey!
I’m kind of in a pickle due to not being able to run any scripts in expansions, first off being the preset browser. As of now, the preset browser displays the UserPresets folder in three columns. The first would show the folders in UserPresets, then the second would show subfolders of that folder, then third would be the .preset files within the sub folder. Here was my initial idea:
User would import expansion, the player would run a script in the expansion which creates folders/subfolders/.preset files inside the UserPresets folder to access that expansion. Then the preset browser would pick up the new folders/files with a refresh and display them.
However, as of I know, it can’t happen that way… how do you think I should go about this? In the long run I’m also thinking of adding title images in the browser (like expansions in rhapsody), and I’m wondering if storing everything in an object would work? But I don’t know how updating the object with expansion info would happen, if at all.
Thanks!
-
User would import expansion, the player would run a script in the expansion
Why not run the script in the player (since it's the only choice you have anyway)?
-
@d-healey wait so I can run scripts from expansions in the player, could you explain more?
Thanks!
-
@Casmat The expansion is dumb, it's just a collection of presets, samples, and sample maps (and maybe some images). The thing that does all the work is your main project.
Your main project triggers the installation, when the installation completes you main project knows this, so just have a function you call when that happens to do all the stuff you want.
-
@d-healey got you! I guess what I’m trying to say is that each expansion may be different from the other, so when installing the expansion, in the function that runs when the installing is done, can I make it so that it takes the callback code from a file within the expansion so it’s customized for that expansion? Or do we need to make the code be the same for every expansion? And the function that runs after the installing is the preload callback, right?
-
I guess what I’m trying to say is that each expansion may be different from the other,
What is the action you want to perform after the installation?
And the function that runs after the installing is the preload callback, right?
It's the installation callback you want - https://docs.hise.audio/scripting/scripting-api/expansionhandler/index.html#setinstallcallback
-
@d-healey Im really speculating for future expansions and for resources they have. This is how we are planning to move forward on instrument releases. We have a one time membership for monthly instruments which are called “Morphology” instruments. In the preset browser, we’d like to have an entry in the first column called “Morphology” and the second column include all actual expansions/instruments. So if a person installs a morphology instrument for the first time, a “Morphology” entry would be created in the first column with the instrument added to the second and the instrument’s preset in the third. We are also planning on selling standalone instruments, which will have their own entry in the first column. Then the second column will be categories of the different samplemap arrangements for that come with that one instrument. Due to the two types of instruments as of now, morphology and standalone, I’m planning on making there being slightly modified code for both. This could be solved via an if statement, but really the whole reason why I would want the installation callback to get custom code within the expansion, like a json file, is to be more flexible if we release a different type of instrument that requires a different process of updating the ui. If there wasn’t custom code, then an update to the player itself would be needed to accommodate for the new type of instrument. The main things that the callback code will do is:
-
Updating the preset browser entries
-
Updating the layer/samplemap switching browser
Thanks!
-
-
@Casmat said in Preset Browser Ideas:
If there wasn’t custom code, then an update to the player itself would be needed to accommodate for the new type of instrument.
This.
An if or a switch statement is the way to go. Something else you can do is include a JSON file with the expansion which has information unique to that expansion that the player can use to know stuff about the expansion. Like what files to expect and where you want them, is it a Morphology expansion or not, etc.
-
@d-healey will give it a go! Thanks David!