How to make modules in expansions?
-
Hey guys!
I'm trying to add expansions to my player instrument, but the thing is that the expansions should be modules. Basically, my player interface has multiple parameter knobs, the main being three gain knobs for three "morph" layers. Each expansion/instrument put out would have three of these "morph" layers included in each expansion. Let's say I'm putting out a piano instrument. In the expansion, I'd be adding three different sound layers (previously I created each sound layer with their own sampler instance). How do I make it so that the player would be in total using three samplers, but the sounds get swapped out for each layer in the expansions if that makes any sense. Basically, all the expansions would have is the sample files, sample mapping, and other info (pictures and data). The UI info would be mainly handled by the player and the expansions contain a set of 3 "samples". How would I go about doing such a thing? Is it even possible?
-
@Casmat If I understood right - you can use
const myCoolSampleMap = "{EXP::myCoolExpansion}myCoolSampleMap"; SamplerA.asSampler().loadSampleMap(myCoolSampleMap );
If you want this sample-loading handled automatically when an Expansion is loaded, you need to add it to the expansion's loading method, something like:
const expHandler = Engine.createExpansionHandler(); inline function loadSamples() { local sampleMap = "{EXP::myCoolExpansion}myCoolSampleMap"; //better ways to do this, note the EXP::expansion wildcard SamplerA.asSampler().loadSampleMap(sampleMap); } function expCallback() { currentExpansion = expHandler.getCurrentExpansion(); //useful to access subfolders ie "the better way" to do the above method :) loadSamples(); } expHandler.setExpansionCallback(expCallback); //calls our functions when we change expansions