Adventures in ScriptNode- Part 2 - setting Params...
-
Okay so todays exercise has been in how to set a value(param) for a ScriptNode object from the interface UI...(script based)
So I created a simple ScriptNodeFX component with a LWR filter in it. I added a control in the scriptnode to manage the freq and one to manage the mode...
I created a couple of sliders in the UI to join up to these.
Here's my simple onInit script:
const var ScriptFX1 = Synth.getEffect("Script FX1"); inline function onFreqKnobControl(component, value) { ScriptFX1.setAttribute(ScriptFX1.LWRFreq,value); }; Content.getComponent("FreqKnob").setControlCallback(onFreqKnobControl);
Okay moving these around I get movement in the ScriptNode LWR filter..great!
One small problem -- lets say I set the UI widget freq slider = 5000, I look in the scriptNodeFx and see my parameter that is connected to the Freq is saying its value is: 15604.4, and the frequency control in the LFR filter(that it is connected to) tells me it is 67.4
The Filter display looks like it s in the right place for a value of 5000, maybe the display values arnt being updated properly...or am I doing something wrong?
Here's the snippet:
HiseSnippet 1434.3ocuX80aaTDDeOGuoDSozJPhWsRewUJXYmTJHEghSbhAq1j5VGR6akM2stdk2a2i6V2DGTkPBdneK3S.OwWfJwqEDR8S.eCJeBfY16ruy+AWWSAGoHu+Yl42L6L+lIoUn1kGEoCINqc7f.Nw4xz1CTlt06xDJRy8INWg1hEx7ayMGyiLj8FDvhh3dDGmU9B7NNqkmX+7pc1iIYJWd5VDxIZgK+NBegIc2V0tsPJav73GK7yb6aVqoqVUWK08A7rBsBIf41i8X9QL7Z4nDmUOvSXzgsMLCOBtydZuAs6pOSEe+SDQhSkbbQURaPQwaSp2UH8ZMzWiHDm7sR87Uh87OjdnvSLZ+zHvUsGTLUhrw.mbyCRUeCfjSFHkOFRWi11MTDXROAwy6RapL7vNLHTmEJw2kj6mbn00vMTlx9rd7FgvhQRT5VUprQQ3W2X6BEJ.w6HSwmvBKFKbiGVs3mWzlAT9wbyAc5vcMkVO9vhvoqaESnjBEuXm9JWiPqJpUMB4eysU5SQCGpkkb09AZE.gM.sK6yuQgusvZirQ4HtYWiITbZeCuT5124A2GUzFwhrcgmtcggdBfl5C0Yo0GZ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Awg4gi0nGnX.ar27R.vZhbYwRrjIivSdqVgXM8HQ2B+bwuUyNsnha6.EkL7XxxD1xldSS5LBx3gYq3HyzYruHu4O211Xy2MFMGy+d2HIwgrmV2ymYaWsTyT++RyUelan9QtwyKfN76X2AhYJ6em+ZzCw0EqN7OTfhc.woqEOx0Em95igI2lsLatDxr0RHyMWBY9jkPlasDx7oKgLe1bkA+2ejvAgIkvFsNHtKoyPhBn4L4uQdKmcV
-
@Lindon If you use the hard coded fx module you can connect controls via processor/parameter ID. You have to compile the network to a DLL first.
-
@d-healey said in Adventures in ScriptNode- Part 2 - setting Params...:
@Lindon If you use the hard coded fx module you can connect controls via processor/parameter ID. You have to compile the network to a DLL first.
yep sure , but I cant recall the last time I used processor/parameter ID for anything where there was a workable scripted version. I plan on doing a bunch of compiles for the stuff I build - but for performance reasons rather than wiring-up convenience.
Still it'd be nice to know that these visual errors are just that not something I've done wrong....anyone?
-
@Lindon Your skew values are different for both your Freq. parameters :
The simplest way to get everything right is to click on the small arrown on the top-left of the controls to open the range editor, and click on "copy range to source" :
There are also more info/tips here :
https://docs.hise.audio/scriptnode/101/gain_example.html -
@Lindon And if you really want to use another middle point for your controls, you can do so by SHIFT+clicking in the range editor :
Click & drag works too and obviously, every middle points have to be the same.
-
@Matt_SF thanks - well that sorta made it work better.....tho the param is still showing a wrong value - but the freq in the Filter is actually matching the value from the UI now...
-
@Lindon meanwhile what does "make Sticky" do ? Just make the display sticky?
-
This post is deleted! -
@Lindon said in Adventures in ScriptNode- Part 2 - setting Params...:
@Matt_SF thanks - well that sorta made it work better.....tho the param is still showing a wrong value - but the freq in the Filter is actually matching the value from the UI now...
I noticed this happens sometimes but the value of the destination parameter is indeed still correct.
@Lindon said in Adventures in ScriptNode- Part 2 - setting Params...:
@Lindon meanwhile what does "make Sticky" do ? Just make the display sticky?
Clicking on it just closes the range editor.