Expansions / Combo Box + SampleMaps
-
@d-healey will have a crack :)
-
@d-healey said in Expansions / Combo Box + SampleMaps:
everytime I add something it automatically gets added to it - https://github.com/christophhart/HISE/pull/192 - I have no idea how it works but it's a mess
I just figured out how to make cleaner pull requests for individual changes, which should be much more pleasant for Christoph to merge. So here it is - https://github.com/christophhart/HISE/pull/195
-
@d-healey Morning, hope you had a good weekend!
Looking into this solution and struggling to make it work with what I've got.
So you've suggested running the names in a loop. My names (sample map names) are (I guess?) inside my 'sampleMap' array (which changes every time you switch expansion).
I'm at a loss of how to access any kind of 'text' parameter of the sample maps, like you have done in your laf video with the icons.
I also wondered if I need to define the bit I want to remove as below. I got this far befoe realising I'm missing a couple of pieces of the puzzle
local prefix = ("EXP::"); for (i = 0; i < sampleMaps.length; i++) { sampleMaps[i].replace("EXP::"); prefix[i].replace(""); }
-
@DanH That looks good to me, just remove the prefix thing, you don't need that, and remember that replace returns a new string so you need to assign that to the array element
-
@d-healey Thanks David, how do I assign the new string?
-
sampleMaps[i] = sampleMaps[i].replace(blahablahblah);
You could use a for in loop here if you want to be
fancyefficient. -
@d-healey brilliant, that works, thank you :)
The name of the expansion is prefixed as well - which I might keep. But would there be a way of referencing that within the brackets?
So currently it looks like:
{*nameofexpansion}*sampleMapname
eg {DAN EXP 1}BASS 1
-
@DanH Just add a second replace command on the next line.
-
@d-healey that's clever!
-
@d-healey Argh
So possibly by changing the naming system the sampler now can't find the sample maps
Hmmmm... So this whole thing was to display the names nicely in the combo box which is used for switching sample maps. Perhaps I can link another combo box to actually select the sample maps and this one just displays the names nicely?
Or a knob?
Actually that would probably break the system I'm already using
EDIT - Actually a parallel combo box might be the one
-
Add the
{EXP:
part back in when you load the sample map. -
You might find
Expansion.getWildcardReference(var relativePath)
helpful -
@d-healey Thanks David, the parallel combo box is working for now. If I'm feeling brave later on I'll try this!
-
@d-healey Ran into a slight glitch wit my combobox method. Just to refresh:
I'm using a combo box to switch between Expansions on my UI. Everything working nicely except:
I've got the combo box set to 'Save in Preset'. This means that everything gets loaded as I want it in a DAW project. Great.
However, the combo box saves a value, not an expansion. Therefore if a user changes the list of expansions (either by adding or removing expansions) then this system breaks, and potentially loads the wrong expansion etc.
Removing Save in Preset creates a kind of hybrid when reopening the DAW project (saved in exp mode) where the samples maps are factory (as per my script) but the UI is in Expansion mode (extra images etc). Even the Preset Browser is combined, displaying the Factory folders on the left but the expansion presets on the right
And if the value is higher than the amount of Expansions installed it reverts to Factory
Am I screwed?
-
@DanH said in Expansions / Combo Box + SampleMaps:
Am I screwed?
Maybe, but I think I will be too because I'm planning something similar in my project. Once I get there I'll find a solution :)
-
@DanH said in Expansions / Combo Box + SampleMaps:
Therefore if a user changes the list of expansions
.. how are they doing this?
Can yo use it to write/re-write a list of valid expansions to disk - and then use that to load up your combo box.?
-
@Lindon the combo box callback searches available expansions and makes a list
-
@DanH That sounds like a weird way to do it. Why not juse use
expHandler.getExpansionList()
? -
@d-healey that is how I'm doing it actually
const var expansionNames = []; expansionNames.push("FACTORY"); for(e in expHandler.getExpansionList()) expansionNames.push(e.getProperties().Name); const var ExpansionSelector = Content.getComponent("ExpansionSelector"); ExpansionSelector.set("items", expansionNames.join("\n")); inline function onExpansionSelectorControl(component, value) { expHandler.setCurrentExpansion(component.getItemText()); }; Content.getComponent("ExpansionSelector").setControlCallback(onExpansionSelectorControl);
ExpansionSelector is the combo box
-
@DanH said in Expansions / Combo Box + SampleMaps:
that is how I'm doing it actually
Aha, that isn't what you said :p Now it makes sense.