Expansions / Combo Box + SampleMaps
-
You have to clear the items before you can replace them - not sure why, just a HISE quirk.
HiseSnippet 958.3ocuVs0aaaCElxwJaRqqnEX+.H7Sx.pARJWZGJFlqcRJLZcpQcWw.VK5Xnni4hDogDUVMFBv9oteB8k875gRxVxYJYIdXSuct+cN7bQiSjTVZpLAYX8lEyYHi6YNYgPMavLBWfFdHx39liHoJVBtfU+EyIoorPjgwVOWyvvpMJ+6SeeeRDQPYUrPn2J4T1K4wbUE2w8dAOJ5XRH6M73ZZuWugToXfLRlA3YKSOzbB8bxYrSHZ0ZYhL19nPtRlLQQTrTPm9xvESlI+UQg9ukmxOMhoI7QS.GUvFMXFOJb7xbMEgLZOtJy2pHy+FyQ7P9J9UUfGjK.WYQ8ZfQq0gT60fj+0AoikQgZGbMvynF7ZW.uGZNglvmqpjnw1WYNT.ONSIPYuNrJzE05OaYNPBZHT6DSNmcbBPrxBmC77bw66408o11PoOUgi3oJe72g+IeWbfKdWW7dfFu+o0DGnEefK9wt3m3h+VWrGH1lKh3BFdZlfp3RAVJ5moTRguN7IxHGpLdtT..wEeAIJi0092rs3SwNkTV.o0.Y7ox9xO5uSJS4zgqXwocbwc5.H7Zkli4c9EIW3z4chNc05dokk8k.rVl7mwTCVB.mNkPqSWsiJA3.RTzoP+lyUQd2aH6B9+I6BtZ18OlaA2btETK2JdYuf.S3KQ.7B2ryWogFx10JGmHUrWIbxSa6KswWUzzoMJqDFQrjFEq2OjbSF5HxhOkkTunqUDFZVepb6a2TIsHoqonTLTvUuZNqjtZt0ug4VTYUSOAWhPPUU976CJmeWVBQ7P836pJJJOEpu6D8CCOjnHKcF3WHVyYIJtNkLNjcArasX4fk4grzyUx4P3V8bgL9hhPe+xPW71mGXKyxlbzGWExe+Y8VTQ7hd7zQxXvOjDfsQKlf.kL8pvWxHIB8VlTxErghwILnUSSitSwNnVr+in5wdz+xXu8srjWEeDsV7+4o8hIfLSCSfJePTamucf8t16YuObB6usdFNRHCyhHp0ubnOQVJ.ZbWaEsdMrHkqVT+D5c3bhWimSZrs7VB2GZNlqnyZFusZ.uPq4+03s737WadzzoLppBrsMO9G2zKw2An7ZYlhKNaDQkv0sDmjEOA9+DJCPhPvhR0sIszi9EzdZZckYBSDlS7WvWoPeMsQoP+kBQwDZh7CzhEF5y+eYNG.Sh7+7wB9ELfFuZGgoo2NdnXXb3CTptT7H.6MaSvFXytafM6sA1r+FXyAafMOdCr4I2nM5MQOKSIiKFS.FiOJeWsgwQ4qpx6HQeFP3tGG.
-
@d-healey lovely, seems to work so far, thanks!
-
So below is the combox box callback for selecting a sample map. I was hoping that 'sampleMaps' would update when switching between expansions but it doesn't (I don't think).
The combox displays the available sample maps, however it continues to select the corresponding sample maps from the factory list. The sampler in Hise even has the expansion's sample maps in its menu, but obviously the callback is processing the original 'sampleMaps' list. So I guess I need to make 'sampleMaps' dynamic somehow...
Any clues welcome
const var sampleMaps = Sampler.getSampleMapList(); inline function onSAMPLEBOXControl(component, value) { Sampler1.asSampler().loadSampleMap(sampleMaps[value-1]); }; Content.getComponent("SAMPLEBOX").setControlCallback(onSAMPLEBOXControl);
-
@DanH said in Expansions / Combo Box + SampleMaps:
I was hoping that 'sampleMaps' would update when switching between expansions but it
It will if you use the previous example you posted
local cx = expHandler.getCurrentExpansion(); local xs = cx.getSampleMapList();
-
@d-healey I've done that (if that's what you mean). It feels like I need to push the list into 'sampleMaps' each time I switch expansion
-
I need to push the list into 'sampleMaps' each time I switch expansion
Instead of
local xs = cx...
you needsampleMaps = cx..
-
@d-healey hmmmm, getting the error:
Can't assign to this expression!
-
@DanH Need more info.
-
@d-healey What would help?
-
@DanH Seeing the error message :) What is the expression that can't be assigned?
-
-
@DanH sampleMaps is a const, you can't overwrite a const.
-
@d-healey doh
-
@d-healey right, so now I need to get the factory sample maps back for the else statement, they currently stay in the expansion!
Is there a way to call 'factory' sample maps?
I've tried:
sampleMaps = Sampler1.asSampler().getSampleMapList();
-
sampleMaps = Sampler.getSampleMapList();
Doesn't that work?
-
@d-healey yes, huge thanks!
-
@DanH said in Expansions / Combo Box + SampleMaps:
@d-healey yes, huge thanks!
I just copied it from your earlier post :)
-
@d-healey still working this morning which is a relief
Back to the wrapper. I don't know where to begin doing this. Are there any examples?
-
@DanH Yes, the scripting api in the source code is mainly a collection of wrappers. Also I did a video about about it, tinkering in c++ or something like that.
-
@d-healey Thanks David. Going the route shown in the video, I want to add the function to ScriptingApiObjects.h first. There's no obvious section for the preset browser to stick it into, it's mostly effects, modulators, tables etc.
Can I put it anywhere?!