Expansions sample maps
-
I have searched the forum as well as watching both of David's videos on expansions but I can't figure out what I need to do so hoping somebody can help me on here.
I have a project and have added a couple of expansions to it, I followed David's video to setup a combo box selection for the expansion as well as editing the laf of the preset browser, all that works correctly but what I can't do is get the samplemaps to populate correctly in a combo box. By extension I also can't get the samplemap to be selected in the sampler.
I have never really dabbled with expansions before and am finding it a little challenging. If somebody help me that would be great as I've been trying to figure this out for most of the week and have had varying degrees of success and failure.
-
@rzrsharpeprod said in Expansions sample maps:
I have searched the forum as well as watching both of David's videos on expansions but I can't figure out what I need to do so hoping somebody can help me on here.
I have a project and have added a couple of expansions to it, I followed David's video to setup a combo box selection for the expansion as well as editing the laf of the preset browser, all that works correctly but what I can't do is get the samplemaps to populate correctly in a combo box. By extension I also can't get the samplemap to be selected in the sampler.
I have never really dabbled with expansions before and am finding it a little challenging. If somebody help me that would be great as I've been trying to figure this out for most of the week and have had varying degrees of success and failure.
To try and explain myself a bit better (as I was sitting in A&E in the early hours of this morning and didn't have access to any code)
here is the code used to populate the expansions combobox//Expansions const var expHandler = Engine.createExpansionHandler(); const var expansions = Engine.getExpansionList(); const var expansionNames = []; for(e in expansions) { var p = e.getProperties(); expansionNames.push(p.Name); } const var cmbExpansions = Content.getComponent("cmbExpansions"); cmbExpansions.set("items", expansionNames.join("\n")); inline function oncmbExpansionsControl(component, value) { expHandler.setCurrentExpansion(component.getItemText()); }; Content.getComponent("cmbExpansions").setControlCallback(oncmbExpansionsControl);
How can I do something similar but for the samplemaps that are inside the expansion so that I can build presets with them?
In the API there is
Expansion.getSampleMapList
but this give me an unknown function error and I can't see anything in the expansionHandler section relating to samplemaps so I am not sure how to call/reference them?
What I would like to do is populate the 'regular samplemap' combo box with the factory samplemaps if no expansion is selected and then populate it with the expansion samplemaps if an expansion is loaded so I can build presets using them. I can do this via an if statement once I can call the expansion samplemaps but I am falling at that previous step.
Unless I am being overly complicated and there is a much simpler solution that I am missing?
Any advice & help is appreciated as my project has ground to a halt until I can solve this issue.
-
@rzrsharpeprod said in Expansions sample maps:
but this give me an unknown function erro
Where did you use it?
Expansion
needs to be an expansion object (from your expansion list). -
In another inline function trying to call the current expansion using getCurrentExpansion (I'm not at my pc right now so I think it was that function)
Do I need to replicate these vars from the expansions code I posted but for the sample maps?
const var expansions = Engine.getExpansionList();
const var expansionNames = [];As you can probably tell I'm a little lost after trying various combinations over the past week and getting mixed results.
-
This is terrible coding I am aware but I am on about my 10th iteration of trying to get it to do something and ghot myself in a bit of a muddle.
inline function oncmbSampleControl(component, value) { local expansionToLoad = component.getItemText(); if(cmbExpansions.getValue() < 2) //1 is factory all expansions are 2 or higher { SampleMapSwitch.set("items", sampleMaps.join("\n")); Sampler1.asSampler().loadSampleMap(sampleMaps[value-1]); } else { local cx = expHandler.getCurrentExpansion(); local xs = cx.getSampleMapList(); SampleMapSwitch.set("items", xs.join("\n")); Sampler1.asSampler().loadSampleMap(xs[value]); } }; Content.getComponent("cmbSample").setControlCallback(oncmbSampleControl);
This will not give the unknown function error but it also won't select the correct sample map.
What it does do is take one from the same position in the factory list (I think) and loads that instead of an expansion samplemap.
As an aside, it appears to load the expansion and shows the rest of the samplemaps from the expansion in the sampler, but it won't select them via the preset browser and they aren't listed in the samplemapswitch combo box, they only appear in the sampler itself as shown below
Hopefully it is something very silly I have done and you can point it out as I am at a loss with it at the moment.
-
SampleMapSwitch.set("items", xs.join("\n"));
At this point what do you see in your combo box?
-
@d-healey In the combobox itself just the factory/non expansion samplemaps populating the list and a seemingly random one is chosen - presumably it is actually in the same position number as the one I want it to load in the expansion.
The sampler itself looks like the screenshot so there is a disparity between what is in the combo box and what is in the sampler at this point which is not the case for the non expansion samplemaps
-
First verify that cx does actually contain a reference to the current expansion.
Then verify the contents of xs. -
@d-healey I have moved cx to const var outside of the function or else it doesn't show up at all in the scriptwatchtable. Now that I have moved it it exists but is blank
As a result the combobox is now completely empty and I have these errors in the console
So I guess the question is how do I get the var cx to populate correctly?
-
@rzrsharpeprod said in Expansions sample maps:
it doesn't show up at all in the scriptwatchtable.
Is your if statement else clause actually being triggered?
-
@d-healey it should be I think as the cmbExpansion value is changing correctly which is the value that the if/else is looking at
If I choose the first entry in the combobox it looks like this
and it changes accordingly if I choose another entry further down the list
That being said cx still doesn't show up in the scriptwatchtable if it is a local var in the else clause, should it?
Would it be easier if I made a minimal snippet or very light version on the project as I feel I have probably set something up fundamentally wrong and you won't be able to spot it from my poorly explained snippets of code above
-
@rzrsharpeprod said in Expansions sample maps:
Would it be easier if I made a minimal snippet or very light version on the project
Always
-
@d-healey Ok thankyou. I have created a minimal project and sent it to you via DM
-
Sometimes to view local variables in the script watch table, you need to expand the function that they are in
HiseSnippet 1981.3oc0X80baaiDGz1rWDat9uoObuzaX8bOH0wipjrrcbZ6DYYI25oQIZjby0Yx0oGDInDtPBvADzw9RyLseitOB2Go7M3tE7OhfzxoJtIo2oGr4hcWfeX2E6t.iEbGRTDWfLrN6xPBx31lSujIWb7BLkgNc.x38LGQYz.rusjDIQ8uLDGEQbQFFa90JYLpsEJ42KtWerOl4PJFBgdDm5PtOMfJKFcbuuk56eB1kbFMPS5t8N0gyNl6yiA7roYKTH14I34jGfUhsgI5avQKPFel4L7rVXGOu86L6Nds51YuNyl00sKLxrCN7vC81qMducOvwAY7NCcoRtXpDCnGYrUet6kSWveJKcAdDMhNymnHZilBqb5vmv8cUaQ0nniWP8cGmanhPHCywElsMSMaeLXkboKGuv78AILrKzP2.ZrQY3sYI30VGdszf2JfjgFj1JERen4TGAMTVvQgm207TljH7vfeRGJoxh13tllGyAIXxlA3mPNQ.DK0n99sZsiM7mFegk0m+4CuHDyhnbVjE33hj1miE1SwAg9DQa6uxNIRp4bhLAuIT02Nm+1vbTnkSvrTFivgfl4PPoKOHjy.h5aqKTY0IWD9MXlKLufxCYyoLRSGAArpKwXF+5U0KaGTnGrlKU59zH40ngJnTo0i+AvV3wE0I1Tl1D1v5YV0TZn1OIyJ3HBIBIkDolxZkmolgwQKpG1TQ.betUYiyPcfdsVmBoRLO5CzLh.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+RuED57EZWUQ1Cc0FqgV54tw9XY497U2FJiADCVp4ZUCzfSRdodpxWaM+utP7CMGSkNKVMF2XEXTUb4M.FytxzezbnmGwQV.vsLO46eyb+H8k+SRW9OxbpDhnCf3xr1fRvfkYd+QuNtpa3ZeUWHuIjv0cJ8epI1+tW+XvFIJO5+pWxRcT.DKWZsxP9DRHbyGUp+Bl2p2jIesfGGVUqWbujfhyDPKnfoPmwCYDvVK02iGK3QQdv1IYthzYMNVLWYqJFYB4bhHp7XpTRKvLFwW0ejgALz2EQT9WpyHrTPuPW5jUo0Y3DeLb++D51Un6Tgd2JzcqPuWE58qPePA8xVMTQF+YymM76Ge26VTt84cSaOnu5gQp172eX8Z9Cl7wXvbnIYe57hdbRFQ+8HV5BRfo1aYrhWE3cdS8PEasdGDe4uix+GjZsz6pTKGiSoJuyP14vQVXDEF+HnYVObruLezxoOFwY7vEbF0o7ADHfe9bhPG6qbCcjTBmO06WeBzu.NR6D9eo28gacgEkO2+JYKZ+J+FSqze8mLSgqsJmm8uE+1a0vrWZ4wMWqxiu1w6MuT4aUS26kUzzFVcg7+w8y21LIMuspp7uWPcBOVc2p7JdlPYwoPq.ND8hianJ3lR2RQq.zTByMg3+.+xX1NuRphY6blHm7oB1aYembaJiMgqg.PNoqOenFsudHcDzvgBRP0u2JnL.6H3+nS5iOnv5sRFAPIK4U+qYNRQa2t5aMfPAP8peT8H+5S0UTryMUwcuoJ18lp3d2TE2+lp3A2TEuyuthp1INJVxCRSlhPiFOLM.zX3x.vMQ+W.ywUdvC
-
Ah I see, so it was there just collapsed inside the function as it was created inside a function?
-
@rzrsharpeprod Yes - although sometimes they don't show up in there either, no idea why.
-
@d-healey ah ok strange.
Thankyou for your help as I now have it working properly and selecting the correct samplemaps.
I've also got the expansion load working in daw as well so I can progress with my project which is great news.
Thanks again, your help is always invaluable