Help with Dynamic FX System - Duplicating and Mapping UI Panels
-
Hello HISE community,
I’m currently working on improving my dynamic FX system, but I’ve hit a challenge that might not even be possible to solve in HISE (or perhaps I’m missing something).
Current Setup:
I have a system where the user can load different effects into FX slots, and a corresponding panel for each effect will show up on the UI. Here's what I have set up for each effect:- 4 Effect Slot Modules (fxSlots[i])
- 4 fxPanels[i] (UI panels where the effect controls are shown)
- 4 templatePanels[i] (predefined panels for each effect containing their child components)
- 4 comboboxes (for selecting the effect)
The Goal:
I’ve created template panels for each effect, which contain their respective child components (e.g., draggable filters for EQ, IR loaders and waveform displays for convolution, etc.).However, I’m struggling to map these templatePanels to multiple FX slots without creating redundancies. I want to avoid simply moving the templatePanels around when an effect is selected; instead, I want the contents of the selected template panel to populate the corresponding fxPanel.
Let’s say a user selects the same effect for all 4 slots (e.g., 4 instances of an EQ). I only have one templatePanel for the EQ, so I need to find a way to duplicate this panel and its contents for each slot without creating multiple template panels manually.
I understand it’s possible to simply move a templatePanel to different locations on the UI, but this doesn’t solve the problem of needing multiple independent instances of the same effect in different FX slots.
I’ve considered using a Broadcaster object to update the contents of the panels dynamically, but I’m not sure if it’s even possible to update and duplicate the contents like this in HISE.
Is there any way in HISE to duplicate a template panel and its components (sliders, knobs, buttons, etc.) for multiple FX slots? Or am I correct in thinking that HISE doesn’t allow adding new components after the initial compilation?
I’m trying to avoid creating 4 template panels for each effect, and instead want the flexibility to load multiple copies of the same effect into different slots dynamically.
Any suggestions or guidance on how to approach this (or whether it’s even possible) would be much appreciated! Even recommendations on how to think about this issue and approach it differently!
Here is a crappy snippet I threw together to elucidate what I am discussing:
HiseSnippet 2210.3oc6ZstbabaEdWIsJVz1MNYxzeuki+A0X0jkKI0k35DYQIlpIV1rlpINiqqlk6BJhQKAX2ETVLdzL9G84oOG8wnOB4Mv8.f8BVwcoHouTOSs9glE.mKe3bN3fC.X6.pKJLjFnou1wiGhzzukQmwDV+l8cvDsC2G52n0Ec7orPs8FOzILD4ooqu7OvGVesUzD+8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yxh+46QjM4y5bGiindi7cXYekI9SqEM.FpjP8oc3OeCIDyFq9zaW8omVY1d5oo+xXyJb+Bi1Xla+7w6R4fWH0+6pmJSaxGu61Fxa4JEfqXz5Yumdotbd7vaXHe5lLubZ0r5e4YV+Um8WJb43ygKhNi.vmGCfSD899AFZOkNhu07QNr.LOb+wiFzA10zEANAB+ZQ4KAVhu1T11J976cPDOQi2.+EMXUda8nAqFO3GDcLidS6O.dyuTpekyBwQvWFifSR5N6SxyPGP3U63otbi28w8CPg8gE7WcfGxXNtmolMg26SQ9HmPjZYH77pABzkiJRGLWEkN7S4oHT0V5PWEI2UQk4fGwuq.TdfIZjbQRzXSNqiFXBEohhibNCMZXNhaxA9zhqEbwUsO.KtLhSUFskcz9XQ.3j3dUABXQjmfHLdp2p0wIwdeJY5B6uq++5sFq+osF+HQGCbbCnm3Je0BtO7Fhd.aKQ7a.aMii3sMy44hFf8vm35lUTSvn8hxXsEkw5KJiMVTF2bQYbqEkwsudF4+r4d3HFcf7.BZZG09.4knnqjCU6+BfhgX3G
-
This post is deleted! -
If I'm honest with you, the way I would approach this would be to use panels for each entire FX graphic. This includes the knobs.
I'd program the knobs myself instead of using the ones built into Hise.
This would give the advantage of being able to store 'presets' of what each module should look like and how it should function (number of knobs, how they connect up to the FX).However, somebody else may be able to give you a better solution that works with your current method.
The reason I would do it from scratch is mostly that you cannot procedurally create and remove knobs. And it would be a pain to create a matrix that manages the knobs.
(Imagining a scenario where the user selects eq in every slot, that could potentially be a lot of knobs, all of which would need to be created in advance and waiting to be managed into whatever config necessary).
Instead I would have a panel for each slot, each of which are capable of procedurally creating the 'knobs' (child panels) needed for any given effect.The cool thing about panels is that you can procedurally create and destroy child panels, meaning you can spawn in as many knobs as you like, whenever you like, and reliably delete them when you need to.
I'd have one panel per slot (even these could be procedural in the form of a child panel, but there isn't really any need apart from to save memory if not all slots are full) and then those create children for your controls (knobs, ect).I just wish Hise script was fully featured, as far as objects are concerned, that would make it easier for sure. I did something similar the other day to create these knobs with procedural label panels, so I know that it's possible to communicate robustly between panels using ids stored in the panel data.
eg:
panel.data.knobId = knob.getId(); // Store knob ID in panel data -
@griffinboyThanks that is some good advice, and certainly a method I have considered before.
I have managed with just sliders in the past, and reassigning their properties depending on the nature of the FX, but as you said it was a hassle to get this setup. The main reason I want to do it the way I have been referring to is to retain many of the UI elements already implemented in HISE (comboboxes, slider packs, the floating tile options, etc.).
I am thinking custom built panels is probably the way to go here: add/destroy children, data storage, generally more flexibility. The only real disadvantage is the time it will take to develop the children components (which seems like an even bigger hassle but might be worth it in the end).
My idea is similar to how Ableton effects work or like Baby Audio's Transit plugin, so it isn't super complicated but maybe HISE is not the right environment or I am thinking about this all wrong.
-
Yeah I think Hise isn't set up to do this kind of thing.
It's definitely possible but I think the hassle is inevitable.
I'll look into it in the future and see if I can create a solution because I need it myself. -
@griffinboy Great I will post here if I come across anything.
-