Modular slotFX with programmatically assigned knobs, not possible?
-
I have 6 hardcoded fx and my original idea was that I would have a GUI that lets the user choose one, then it would load that dsp and programmatically draw knobs for each parameter in the fx. Each fx dsp has the same first 3 parameters and then after that some have 1 more, some have 2 or 3 more and those additional knobs are different for each dsp.
It doesn't seem like this is possible in Hise.
Issues i've run into:
-
Knobs can't be added after init. This sucks but isn't a deal breaker. I can add the max number of knobs needed on init and then hide or show them as needed while reassigning their function for the currently active dsp.
-
Biggest issue, slotfx seems buggy. If I have one fx loaded and I switch to another, it loads with default parameter values but if immediately send a knob.changed() for the knob that's controlling those parameter for some reason it's not always receiving that old knob value. Sometimes it stays at the default until it's moved by the user, sometimes it gets the changed() and updates to the knob value.
-
Despite calling a setAttribute by name, it needs each parameter to be in the same order or it gets messed up. If my first parameter is Mix and my second parameter is Depth on my 1st FX, if I swap to a different FX and Depth is now the 3rd parameter, it messes up and despite calling myFX.setAttribute(myFX.depth, value) it will try to adjust the 2nd parameter, not the one called depth.
-
.setAttribute() seems to only work with my fx defined by Synth.getEffect()
While .setEffect() seems to only work when defined by Synth.getSlotFX()
So I am defining the same FX slot both ways at the same time and calling each type as needed. This feels wrong but it seems to work? -
Odd behavior but an easy work around, if I try to programmatically check how many parameters are in an fx it will always return true even for ones that don't exist. If my fx has 3 controls and I ask if there is a 4th it returns true with a name of blank "".
There are other issues and odd behaviors but these alone have made me think I probably shouldn't try to do this and should just manually draw knobs and panels for each fx, load them all and then just turn them on and off since I don't actually need to reorder them.
-
-
@whoopsydoodle nope not buggy as far as I can tell - I've had this working fine for a couple of years now...
-
Let me be more specific...
@whoopsydoodle said in Modular slotFX with programmatically assigned knobs, not possible?:
I have 6 hardcoded fx and my original idea was that I would have a GUI that lets the user choose one, then it would load that dsp and programmatically draw knobs for each parameter in the fx. Each fx dsp has the same first 3 parameters and then after that some have 1 more, some have 2 or 3 more and those additional knobs are different for each dsp.
It doesn't seem like this is possible in Hise.
As I say - def. possible...
Issues i've run into:
- Knobs can't be added after init. This sucks but isn't a deal breaker. I can add the max number of knobs needed on init and then hide or show them as needed while reassigning their function for the currently active dsp.
Correct. You will need to define a max number of controls used in your fx set and create that many controls - hiding them as required..
- Biggest issue, slotfx seems buggy. If I have one fx loaded and I switch to another, it loads with default parameter values but if immediately send a knob.changed() for the knob that's controlling those parameter for some reason it's not always receiving that old knob value. Sometimes it stays at the default until it's moved by the user, sometimes it gets the changed() and updates to the knob value.
Cant say i've found this - but Im loading a "new" fx and instantiating the knobs to their default position - are u doing that? You may need to wait until the FX is actually loaded - so a timing issue.
- Despite calling a setAttribute by name, it needs each parameter to be in the same order or it gets messed up. If my first parameter is Mix and my second parameter is Depth on my 1st FX, if I swap to a different FX and Depth is now the 3rd parameter, it messes up and despite calling myFX.setAttribute(myFX.depth, value) it will try to adjust the 2nd parameter, not the one called depth.
You will need to define the attribute(setAttribute) that is used by each control in each FX and reference this index in the controls callback (see Control Target Number below....)
- .setAttribute() seems to only work with my fx defined by Synth.getEffect()
While .setEffect() seems to only work when defined by Synth.getSlotFX()
So I am defining the same FX slot both ways at the same time and calling each type as needed. This feels wrong but it seems to work?
- if it works....
- Odd behavior but an easy work around, if I try to programmatically check how many parameters are in an fx it will always return true even for ones that don't exist. If my fx has 3 controls and I ask if there is a 4th it returns true with a name of blank "".
as I say define a data record for each FX, and reference it when the FX changes, here's my latest example
{ "FXName" : "Spectral Tilt", "EffectHardCodedName":"SpectralTilt", "NumControls": 3, "ControlText": ["Tilt","Frequency","BandWidth"], "ControlArc": [2.5,2.5,2.5], "ControlPopUp": ["Above","Above","Above"], "ControlTargetNumber": [0,1,2], "ControlMinimums": [0,0,0], "ControlMaximums": [1,1,1], "ControlMultipliers": [1,1,1], "ControlModes": ["Linear", "Linear","Linear"], "ControlStepSize":[0.01,0.01,0.01], "ControlSuffix":[" %"," %"," %"], "ControlMiddlePosition":[0.5,0.5,0.5], "ControlDefaultValue":[0.2,0.5,0.5], "Layouts" : ["BAR","BAR","BAR"], "Colours" : ["STD","STD","STD"], "Primary": 0xFFCCCCCC, "Secondary": 0xFF333333, "Tertiary" : 0xFF003344, "AltPrimary": 0xFF114444, "AltSecondary": 0xFFAAFFDD, "AltTertiary" : 0xFF223399, "TextColour": [0xFF999999,0xFF999999,0xFF999999], "ControlXPos" : [110,110,110], "ControlYPos" : [145,290,435], "ControlSize" :[70,70,70] }
Theres a bunch of additional stuff in there to tell LAF how to draw this control Layouts, Colours etc.
There are other issues and odd behaviors but these alone have made me think I probably shouldn't try to do this and should just manually draw knobs and panels for each fx, load them all and then just turn them on and off since I don't actually need to reorder them.
Depends on how many FX you have - my current project is aiming at 60+ FXs so this approach will never work...(well it might but I would go mad..)
Oh one thing to note _ Im doiing all of this using HardCodedMasterFX in the slot.
-
@Lindon appreciate this reply. I will give it another go.