Hardcoded FX get properties of attribute
-
Is it possible to get the properties of one of the hardcoded FX knobs? I'm interested in getting the min/max/step size specifically.
-
@d-healey Yes, I could return a JSON object for each parameter that you could then just pass on to the sliders with our old friend
setPropertiesFromJSON()
. -
@Christoph-Hart Sounds like a very good idea to me.
-
@d-healey Alright, I've pushed this.
const var HardcodedMasterFX1 = Synth.getSlotFX("HardcodedMasterFX1"); const var obj = HardcodedMasterFX1.getParameterProperties();
It returns an array with these properties:
[ { "text": "Oversampling", "min": 0.0, "max": 4.0, "stepSize": 1.0, "middlePosition": 2.0, "defaultValue": 0.0 }, { "text": "Frequency", "min": 20.0, "max": 20000.0, "stepSize": 0.1000000014901161, "middlePosition": 1000.000048402122, "defaultValue": 7804.89990234375 } ]
and setting up a slider is now as easy as
const var Knob1 = Content.getComponent("Knob1"); inline function onButton1Control(component, value) { Content.setPropertiesFromJSON("Knob1", obj[value]); Knob1.setValue(obj[value].defaultValue); }; Content.getComponent("Button1").setControlCallback(onButton1Control);
-
@Christoph-Hart Oh that's excellent, thank you!
-
@Christoph-Hart I don't know if you saw this yet but I'm trying to get the name of the currently loaded effect.
-
@d-healey Done.
-
@Christoph-Hart You're on fire!
-
I have an object that stores the parameter properties for some slot effects like below:
const fxSlotParamList = { "Saturator" : [ { "text": "Saturation", "min": 0.0, "max": 1.0, "stepSize": 0.01, "middlePosition": 0.5, "defaultValue": 0.22 }, { "text": "Wet", "min": 0.0, "max": 1.0, "stepSize": 0.01, "middlePosition": 0.5, "defaultValue": 0.9 }, { "text": "Post Gain", "min": -24.0, "max": 0.0, "stepSize": 0.01, "middlePosition": -10.0, "defaultValue": -1.0 } ], "SimpleReverb" : [ { "text": "Room", "min": 0.0, "max": 1.0, "stepSize": 0.01, "middlePosition": 0.5, "defaultValue": 0.0 }, { "text": "Damping", "min": 0.0, "max": 1.0, "stepSize": 0.01, "middlePosition": 0.5, "defaultValue": 1.0 }, { "text": "Wet", "min": 0.0, "max": 1.0, "stepSize": 0.01, "middlePosition": 0.5, "defaultValue": 1.0 } ], };
I have an idx value that captures the index of the dedicated slot in the array and when we combine these for setting the knob properties from JSON, let's say WetAmount parameter of the Saturator:
Content.setPropertiesFromJSON("arrayed_FXSlot_Slider" + [idx], fxSlotParamList.Saturator[1]);
Slider properties aren't updated, am I doing a syntax error, couldn't figure it out.