3 Quick Questions about Expansions!
-
@Lindon Yup, didn't do what I thought it did. Scroll up until you find my post with a link to a demo project, wasn't that far back.
@Christoph-Hart We need a way to accurately link to other posts in a thread, clicking the timestamp appears not to work.
-
@d-healey said in 3 Quick Questions about Expansions!:
@Lindon Yup, didn't do what I thought it did. Scroll up until you find my post with a link to a demo project, wasn't that far back.
OK thanks.
-
@Lindon Here's where I'm at so far, note that it's still very much a WIP (loaded expansions aren't persistent in a DAW yet, for example)
/*Basic Player plugin with on-the-fly sample-loading and image-changing + hiding of GUI elements. I've also hidden the init sample locate dialog with: HISE_SAMPLE_DIALOG_SHOW_INSTALL_BUTTON=0 HISE_SAMPLE_DIALOG_SHOW_LOCATE_BUTTON=0 In the Extra Definitions [Your OS] Preferences */ const var expHandler = Engine.createExpansionHandler(); const var SamplerRR = Synth.getChildSynth("SamplerRR"); var currentExpansion = ""; expHandler.setAllowedExpansionTypes([expHandler.FileBased, expHandler.Intermediate, expHandler.Encrypted]); var expansionDirectory = FileSystem.getFolder(FileSystem.Samples); //Changes using the Custom Setting FloatingTile reg hr; const var Image_BG = Content.getComponent("Image_BG"); //Set Sample Folder Button (Just shows a panel, which contains the CustomSettings FloatingTile) inline function onButton1Control(component, value) { Panel_ChangeSampleFolder.showControl(value); }; Content.getComponent("Button1").setControlCallback(onButton1Control); //Install Library Button inline function onButton2Control(component, value) { if (value) { FileSystem.browse(expansionDirectory, false, "", function(result) { hr = result; expHandler.installExpansionFromPackage(hr,FileSystem.getFolder(FileSystem.Samples)); expHandler.refreshExpansions(); }); }; }; Content.getComponent("Button2").setControlCallback(onButton2Control); //Library Select (Like Kontakt's Browser) //Bloom inline function onExpansions_ButtonBloomControl(component, value) { Engine.setCurrentExpansion("Bloom"); currentExpansion = "Bloom"; //This is used in other functions elsewhere. //Put Stuff Under This //Setting Background Image backgroundImage = ("{EXP::Bloom}bg_bloom.png"); Image_BG.setAlpha(1); Image_BG.set("fileName", backgroundImage); //Hiding/Showing UI Elements for Specific Libraries ComboBox_Atlas.set("visible", 0); //Setting up different Samplers SamplerRR.setAttribute(12, 0); Sampler_NoRR.setAttribute(12, 1); SamplerRR.setBypassed(1-value); Sampler_NoRR.setBypassed(value); //Loading the sample map into the right sampler SamplerRR.asSampler().loadSampleMap("{EXP::Bloom}Bloom_SampleMap"); };
-
@iamlamprey - thanks - looks not "too" complex...
-
How would I make the loaded expansion re-load on DAW close/reopen?
Making currentExpansion a const var obviously breaks the button functions that change it, and it doesn't default to a string unless I give it an initial value of "", which means calling that won't load the right expansion..
-
@iamlamprey Expansions are automatically loaded when one of the expansion's presets is used, so as long as the DAW is saved and closed after a preset has been selected it "should" be there when you reopen the DAW.
-
@d-healey Guess it's time to add a preset system then...
-
Unrelated but has anyone else had the Custom Keyboard FloatingTile randomly play a high F and stick when clicking GUI elements?
I thought was my old midi controller but it only happens when I click something on the GUI, both in HISE and in DAW.
Super weird
-
I still need help regarding making expansions persistent and loading on DAW open/close.
I can install the libraries and load them manually just fine. But on DAW save/load it defaults back to no expansion HOWEVER if I hit "Open Preset Folder" in the preset browser, it directs me to the right expansion folder.
So somehow the currentExpansion is saved, but I can't figure out how to restore it.
I've tried making init presets and using
Engine.loadNextUserPreset(1);
in both button callbacks and onInit, without any success.
//init stuff: include("CustomExpansionLoading.js"); const var expHandler = Engine.createExpansionHandler(); var currentExpansion; //Load expansions switch (currentExpansion) { case "Cloudburst": loadCloudburst(); break; case "Atlas": loadAtlas(); break; case "Blackout": loadBlackout(); break; case "Bloom": loadBloom(); break; default: };
inline function loadBloom() { //Initialize Expansion Engine.setCurrentExpansion("Bloom"); currentExpansion = "Bloom"; //Put Stuff Under This //Setting BG Image backgroundImage = ("{EXP::Bloom}bg_bloom.png"); Image_BG.setAlpha(1); Image_BG.set("fileName", backgroundImage); //Setting up Samplers SamplerRR.setAttribute(12, 0); Sampler_NoRR.setAttribute(12, 1); Sampler_Loops.setAttribute(12, 1); SamplerRR.setBypassed(0); Sampler_NoRR.setBypassed(1); Sampler_Loops.setBypassed(1); SamplerRR.asSampler().loadSampleMap("{EXP::Bloom}Bloom_SampleMap"); //Setting Key Colours colourKeysReset(); colourKeysBloom(); //Hiding othe GUI Elements ComboBox_Atlas.set("visible", 0); Button_LoopSpeedHalf.showControl(0); Button_LoopSpeedDouble.showControl(0); Label_LoopSpeedHalf.showControl(0); Label_LoopSpeedDouble.showControl(0); }; //Button to switch to this expansion. inline function onExpansions_ButtonBloomControl(component, value) { if (value) { loadBloom(); } };
A lot of it is dependant on the variable currentExpansion, and I think somehow it isn't saving that right.
I've probably massively overcomplicated this...
-
I've just realized there's a
Engine.setCurrentExpansion and a expHandler.setCurrentExpansion.
This might be the cause of my woes...
-
OKAY got it working (I think), I didn't know about the expHandler.setExpansionCallBack() function and was trying to do things manually this whole time
-
@iamlamprey hey, how did you get image covers from every expansion?
-
@arminh Each expansion has an images folder, put your image in there.
-
@d-healey i made it, but even if i have image in Images folder i have error
Interface:! Image {EXP::Factory}exp_cover.png not found
-
@arminh I would assume this is necessary
-
@d-healey oh i tried create this by painroutines but as i can see we can't just put image path?
Here's example
g.drawImage(expansionsArr[i].cover, [50,50,50,50], 0, 0);
-
You need to load the image into the panel first with the
loadImage
command. -
var backgroundImage = ""; const var Image_BG = Content.getComponent("Image_BG"); inline function loadAtlas() { //Setting BG Image backgroundImage = ("{EXP::Atlas}bg_atlas.png"); Image_BG.setAlpha(1); Image_BG.set("fileName", backgroundImage); }
So the "Image_BG" is an Image component, and we're just setting the filename of it to whichever expansion is loaded. You probably should do it with a panel but I set this up before I learned panels existed :)
-
@iamlamprey Tahnks so much, i figured it out :)
-
Hi guys. quick question for me as well. My projects is a synth so I dont have samples. However I want to be able to create user presets expansions. How can I do it?