Linking knobs together via a button
-
@pcs800 You have all of your knobs connected via 'Property Editor' so those arent going to react to any script like you have.
You can only do one or the other. If you know you're going to have scripting controlling the button/knob/slider, dont connect it via the 'Property Editor'.
Also, you're not declaring any reference to your knob before you have it trying to execute an action, so that will cause an error as well on its own.
Dave's 101 video is a great place to start. Best wishes!
-
Best advice....
-
@Chazrox I watched a lot of the video above, and others.
I now have a script that works as intended.Content.makeFrontInterface(566, 300); const var LDelay = Content.getComponent("LDelay1"); const var RDelay = Content.getComponent("RDelay1"); const var LFeedback = Content.getComponent("LFeedback"); const var RFeedback = Content.getComponent("RFeedback"); const var linkButton = Content.getComponent("LinkButton"); inline function onLDelayControl(component, value) { if (linkButton.getValue()) { RDelay.setValueNormalized(LDelay.getValueNormalized()); } } inline function onRDelayControl(component, value) { if (linkButton.getValue()) { LDelay.setValueNormalized(RDelay.getValueNormalized()); } } inline function onLFeedbackControl(component, value) { if (linkButton.getValue()) { RFeedback.setValueNormalized(LFeedback.getValueNormalized()); } } inline function onRFeedbackControl(component, value) { if (linkButton.getValue()) { LFeedback.setValueNormalized(RFeedback.getValueNormalized()); } } LDelay.setControlCallback(onLDelayControl); RDelay.setControlCallback(onRDelayControl); LFeedback.setControlCallback(onLFeedbackControl); RFeedback.setControlCallback(onRFeedbackControl);
-
@pcs800 Nice :)
-
@d-healey
So I overlooked something...
Yes the delay time and feedback knobs are locked when the button is engaged, but they are not actually controlling the delay time and feedback, because I removed those assignments from the properties panel.
I am struggling to figure out how to assign processorid and parameterid in the code editor.
Can you help? -
@pcs800 said in Linking knobs together via a button:
I am struggling to figure out how to assign processorid and parameterid in the code editor.
Use
.setAttribute
to set the module parameters directly from the control callback.First you need to get a reference to the module (right click the header and select create generic script reference).
Then in the callback you can call something like
myModule.setAttribute(myModule.parameterName, value);
To find out the parameterName you can again right-click the module header and select dump Parameter IDs and values.
-
@d-healey said in Linking knobs together via a button:
myModule.setAttribute(myModule.parameterName, value);
Ok, I added the following to the code
const var Delay1 = Synth.getEffect("Delay1"); Delay1.setAttribute(Delay1.DelayTimeLeft, 0.00);
It compiles without error, but the knob doesn't control delay time.
-
This needs to go in
on init
const var Delay1 = Synth.getEffect("Delay1");
This needs to go within the control callback. It takes two parameters, the first parameter is the property you want to set (in this case DelayTimeLeft), the second parameter is the value you want to set that property to, you've put
0.00
but you want to use the knob's value, so putvalue
there instead.Delay1.setAttribute(Delay1.DelayTimeLeft, 0.00);
-
@d-healey adding on init gives this error
Line 3, column 4: Found identifier when expecting ';'
I tried function onInit() but it then doesn't like the next line -
@pcs800 said in Linking knobs together via a button:
Line 3, column 4: Found identifier when expecting ';'
That tells you that you are missing a semi-colon, probably on line 2
-
@d-healey Yes, i knew it was telling me I was missing a semi colon, but I've tried adding one in a few spots without success.
Here's what I have when adding it to line 2Content.makeFrontInterface(566, 400); ; on init const var Delay1 = Synth.getEffect("Delay1"); Delay1.setAttribute(Delay1.DelayTimeLeft, 0.00);
Still get the same error
It says line 3, column 4, which would make it like this on; init -
@d-healey If I do this
on ;init;
it compiles without error -
@d-healey
Back to your post above, when I set the word value instead of 0.00, I get this. -
@pcs800 your code is getting crazy now
go watch the scripting 101 video if you haven'tWait you already did.
You never need to write on init. Just remove that bit and put the set attribute stuff within your callback - the callback is triggered when the knob is moved and that's when you want to change the value in the effect
-
@d-healey It is now working with the help of some online resources