Expansion Tutorial
-
@Lindon Expansions can contain their own JSON files in the additional source code directory, maybe that would be the way to go with your presests...
-
@d-healey - I'm not really worried about the presets its the sounds I'm concerned about - a picture may help: this is the "sound browser":
So you can see there are 4 voices:
- and a list of expansions (and the "Factory" - so sounds shipped with the base product)
I want to be able to select Voice 1, and then load the sample map called Bassica from the Factory sample maps, and it loads and stays there in voice 1.
Then select Voice 2 and choose to the Substrate expansion from the list on the left, then select a sample map called "BigBadBass" (which is shipped with the Substrate expansion only) and it loads into Voice 2 and stays there.
I now want to be able to play these sounds AT THE SAME TIME - voice 1 and voice 2
I can do all the displaying of names and sample maps no problem, but I'm not sure I can use sample maps from different expansions at the same time...
-
@Lindon I don't think that's possible. Switching expansions is like loading a different HISE plugin so you only get access to what's in that expansion. We'd need some kind of sub-expansion system for that.
-
@d-healey damn damn damn damn damn damn.....
~@Christoph-Hart !!!! Help!!!
-
It might be possible to hack it with the file system API. When the user switches expansion you get the name of the expasion they want, then they select the sounds, which will give you the name of the sounds, and then you load the sample map manually using the File System API. I have no idea if it will work but might be a route to investigate.
-
@d-healey - yeah I was sorta thinking along the same lines - can I not
Sampler1.asSampler.loadSampleMap(<some name>)
where <some name> might be:
Bassica -- which loads the sample map from the factory shipped set
{EXP::Substrate}BigBadBass -- which would load a sample map from the expansion...- I guess (before I go see if this is possible even) I wanted to check to see if anyone has done this and it works/doesnt work...
-
@Lindon I think you're in new territory, let us know if it works :)
-
@d-healey well currently I cant get any of the expansion commands to work at all:
from your video I have
HISE_ENABLE_EXPANSIONS=1
HI_ENABLE_EXPANSION_EDITING=1but in hi_core
there is no HISE_ENABLE_EXPANSIONS
so I cant set that, there is however:
HISE_USE_CUSTOM_EXPANSION_TYPE
-- worryingly for my project the tutorials from Christoph seem to work oK...
-
@Lindon Those flags are no longer required. Christoph added a new option in the project preferences that he forgot to tell anyone about until last month :p
Set it to
FilesOnly
- nobody knows what the other choices do.
-
@d-healey Ok cool thanks..
-
Success!!!
- Yep all you need do is refer to the sample map in the expansion and it will load - even if other samplers in your project are loaded with sample maps from somewhere else...
Cool.
Forwards!!!
-
Hello. So I just created 8 expansion which each has about 80 sample maps. I have been working on this project for over a year. so i have about 700 hr1 sample. when switching to the extension, I had to modify the preset files manually (right click, notepad ....) so that each preset correspond to its successful sample map.mission. however I have a few small bugs sometimes. when i load a preset, it will release a sample map which has nothing to do with the preset. I just have to load 2 3 different presets and everything goes back to normal. do you think there may be conflicts somewhere? moreover, since the last scriptnode verison, the next / prev buttons of the presets cause hise to crash.
-
@Lindon said in Expansion Tutorial:
Success!!!
- Yep all you need do is refer to the sample map in the expansion and it will load - even if other samplers in your project are loaded with sample maps from somewhere else...
Cool.
Forwards!!!
I'm exploring this too. So when you say "refer to the sample map in the expansion", do you mean you use the file system API to get them?
I have a similar use case to the one you explained above. I just need to provide new samples/samplemaps/presets and use them at the same time as the factory ones. -
It's just a different "wildcard" in the reference. So for factory content you use
{PROJECT_FOLDER}MySampleMap
, and for a sample map in the expansion you just load{EXP::MyExpansion}MySampleMap
and the system will detect magically that this is a samplemap from the expansionMyExpansion
and search its content for the samplemap. You can load multiple assets from different expansions at the same time as well as mix it with factory content.What might be a little bit confusing is that there is an additional concept of an "active" expansion. That means as soon as you load a user preset from an expansion (or call
ExpansionHandler.setCurrentExpansion()
manually), the expansion system will set this expansion to be "active" and there can only be one "active" expansion at the same time. This doesn't have any impact on the availability of the content of other expansions, it just gives you the option to do certain stuff like swapping the background image depending on the current expansion. -
@Christoph-Hart Oh that's much clearer, especially about the active expansion thing, I thought it was much more intrusive but it's in fact just a state info.
So I imagineimportSamples()
works with expansions too? Like importing an expansion sample into a factory sample map right? -
Well that won't work unfortunately. A sample outside of the project's sample folder (or the expansion's subfolder) will not be resolved using the wildcard but as absolute path.
I'm afraid your plan of swapping samples inside a samplemap reveal a blind spot in the sample management system which takes samplemaps as somewhat static entities for granted and for the sake of future-proofness I would try to think of a solution that doesn't change samplemaps dynamically.
-
@Christoph-Hart Ouch, that one hurts... So what would be the best solution in my case:
I am using sample maps with 4 RRgroups (with group XFade)
I need to replace any of the samples in a RRgroup with any other sample (factory or expansion)
Of course, I need the user to be able to save all of that in presets... -
@Christoph-Hart Oh I might have explained badly since I don't want to import user samples from anywhere, but only from expansion/factory sample maps... That'll work using the corresponding wildcards right?
-
@ustk You can only load samples from one expansion + factory at a time.
-
@d-healey But Christoph said:
You can load multiple assets from different expansions at the same time as well as mix it with factory content.
So everything's accessible apparently