NewBe Question about Link
-
A control can either use a custom callback or parameter ID, not both.
-
And how do I get it to work via script?
Or rather how do I get the ProcessorID and ParameterID
into my custom callback?Can you show me an example script/snippet
I learn fast when I see this than when I just read it -
First 15 minutes of this video should cover it
-
@MikeB There are several ways to do this. I would do something like that:
HiseSnippet 1129.3oc6XEtaaaCDlxNrK1atncX+eBA6GJ.YAx1sYCXXXtwIYvnKoFycYq.EHiQhNlHTjFRzYyHH.8QZuK6EXOB6MH6HkTDsisiqA5vxPjARLu69H+3cGOdxcikAzjDYLxoxqGOjhb9DbuwB0f1CHLApydHmGiOjjnnwtoh1c7PRRBMD43T960BbprFx772e2tDNQDPKDgPGKYAzefEwTER615kLN+.RH80rHKqeVqNARQaIWNB3SYrOZHI3bxYziHZyJgQNOZ+PlRF2SQTzDjyZ6JCG2af72Do1eLKgcJmpGTG0ClnTwGH4gZFqkhZOfwC6luuSPvrzsvKTN0K7Y3CYgrajW3MdhQgaABa+gSoEQu51zye4omiE8VKkdOE2KHlMTUnQysOF2Q.Ap9DHDXSqTaQk9yx31RvBgZ6Hx4zChgA2fvaGe+sbetu+leSsp5OPnHQ4dAI1sGKZHmpC10c+VWS5w1mQU62uOMP4sgk5MzfmEvFKFXiMRW0BnuTHOUuZ4DFf0VFMTJfAdaXzN0hok0bgHZNEhcGoTRwNyESl9Mx8HLAmInt8GIBTLovUJxrPCOVx8BxwtEL+7QzMqU8xZUq35x565kKwEdtL8e5GtLfvS2tmXLAnygDvQESDgPzwChJ02QSgain47Q3ain3al0Y6Dp5XMPOqk01dybOoUMusUEeyJCPi5EJUL6zQJpmsB8e2xcNqnUpv7lgFVyvTr4pZUuxDiti3ndpyhUsIb9oP0EuoCh4A6I+XEyORpnuR3sY0KqVo5UUcmVU+9yTW1zyowyTstRX7h.5IFEcJMNOyJ2Pnjvj0bvyulicIwfTOkkgRQGAS8pgTw7pDgxbuPMoxYrB9lxTQ5wYUj5wYgzXDCJ77QXSvFYHLPLm0QYywRAr4RBLM7Y.VAmEKygVbOD5m5rGQQzkSy1EvNaHMVwzNMm8nW.2SkVbsBdOZx4J4Py1LKKBX0ctQ+8hE7ssFeyfeseqHhkN+VCycpc.z0vVmRfa7hgK6fZxZUOBatgE8dvhlVr3OTVrn0Tr3KlOKZbmr.uDgfh05cmawi28lVrjCkQv7PhAwNkP299M3VVY3HNQM4UuZdjo.NaLwcb56wDIL0X69Q9fbe7xR2mh6xTAClMeKMC9B4len4aV2M0voWAWP10vG7KqZqLytSK+Y0JSIKtr9M8adShmgJSddXNsa9WWe8m2ZOJmLg+6mYgpAEBdSqYzPZGwEvo9tRNIdZue4I2xkWts7czP4hSQzaI26MozeJ13xuOQXSJw8GB+DbWx+ERH9Q4HESbFzVYLCJjiOZTTO3sxBn.UEBJW2nAT4VC0L1WOVSndTQnYv0vSlx55wNYJqmqD8dVKnwC0BdnVvC0B9+Ysf+MViHRPr7jfzWiPezbciDXeKL+9RUvGpG6V7FKX+s8QQrP1IAA5dj9Rv+LaLMVALMWALOaEv77U.yNq.luZEv70KDi9mZ6EiTxnz7ePP28MuEmiy9BBjIaNJf9G.B8+lmB
I used 2 Simple Gain units in this example.
Or alternatively, you can directly get the Knob values with
.getValue()
and use this value in the.setAttribute
. -
It works - both according to David's video as well as
your snippet - thanks
BUT: Now I get although all seems right constantly the error message: Line 32, column 23: API call with undefined parameter 0If I comment out the line the next one is shown
-
@MikeB Is this error happening in the snippet you posted?
-
yes and in this:
const var SimpleGain1 = Synth.getEffect("SimpleGain1"); const var SimpleGain2 = Synth.getEffect("SimpleGain2"); const var Knob1 = Content.getComponent("Knob1"); const var Knob3 = Content.getComponent("Knob3"); const var Button6 = Content.getComponent("Button6"); inline function onButton6Control(component, value) { if (value) { local Knob1_value = Math.randInt(0, 16); local Knob3_value = Math.randInt(0, 10); Knob1.setValue(Knob1_value); Knob3.setValue(Knob3_value); SimpleGain1.setAttribute(SimpleGain1.Gain, Knob1_value); SimpleGain2.setAttribute(SimpleGain2.Gain, Knob3_value); } }; Content.getComponent("Button6").setControlCallback(onButton6Control);
Whereas this is line 31: Knob1.setValue(Knob1_value);
-
Nothing obvious is standing out to me. Could you post a HISE snippet? and I'll try it on my system.
-
Works all of a sudden again - Strange.
But I have already read here that this probably occurs more often Probably more often if you try around so much as I still do. Copy/Paste/Compile/Delete etc. -
Slight changes to your code -
- Shout if its not making sense...
const var SimpleGain1 = Synth.getEffect("SimpleGain1"); const var SimpleGain2 = Synth.getEffect("SimpleGain2"); const var Knob1 = Content.getComponent("Knob1"); const var Knob3 = Content.getComponent("Knob3"); const var Button6 = Content.getComponent("Button6"); inline function onButton6Control(component, value) { if (value) { Knob1.setValue(Math.randInt(0, 16)); Knob1.changed(); Knob3.setValue(Math.randInt(0, 10)); Knob3.changed(); } }; Content.getComponent("Button6").setControlCallback(onButton6Control); inline function onKnob1Control(component, value) { SimpleGain1.setAttribute(SimpleGain1.Gain, value); }; Content.getComponent("Knob1").setControlCallback(onKnob1Control); inline function onKnob3Control(component, value) { SimpleGain2.setAttribute(SimpleGain2.Gain, value); }; Content.getComponent("Knob3").setControlCallback(onKnob3Control);>