3 band EQ controls via script
-
Your GUI has a lot of controls, I have no idea which knob controls the EQ.
Make a simple project with 2 EQs and 2 knobs, once you get that working you'll know what to do.
-
@d-healey Ok will do, thanks :)
-
@d-healey Sorry to bother you again David, here is a snippet with two controls only.
As you can see, they both affect EQ1...HiseSnippet 1538.3oc6YssaSbDFdW6rs3kCBPbQuoRqP8BGEZv1DNHkVwhcrCQEm3XGPUBgPS1cr8HVOyxrylhoBItr8In21WfJ0q508cnu.8Qf2f1+YO3cViavwkRQf8UY9OMe++y+IG2gybvAALtldoCF6i0zOiQuwTwvFCQDp1NaooeNi1n.AlaESp9XeTP.1USWu31RB5kVQK5yqtccjGh5fyHoo8.FwAeOxHhHiZG6ug340B4hOfLRQ5Mr2wgQav7Xg.dJZTQyG47Dz.7tHoXELzz+jltDAi2SfD3.M8UpybG2aH66nwx+.R.4POr7PUsdfghI2h44JQr7u0ZLj341I0uCz.i1IKJTLNJbIi1DWxD5YQiyGwvJSC03gdgiCdUWP3oq.uUhg2EL54vI9hLNRrcZicnvCUeD7DnBqXY0J7KELZv.Inh0GgdBtEGNLQix2nRkqXc8JUVcyyZdVSSyqd0s4nCsfWDAm4Yww8wbL75FXBjBDVGg3VM225qsd3i1LGoG2XucOn6d2qGvqlJq9b7SSj2rOiaUl.mproEw5q.AsHqs1pleuYol6+Pxi.NQ4gqO.KZ1uO1QT9xM2+xqUlrV0UWcSyWXV50rgxUOwZVvG48FaxT2GLZC1HeFENT9xR9pVV56sBoNBBiZNiaYcOLcfXXxcTBfbojqX8.ogiBXMPddGBoukcFhnCffM9oPn0zrDXeB0iPwV8StCKEQJ6jhqq.wLuPrzIjWv+P7pToXeT8ST.TBk6HDbxggBb4XRxaH0raVBz8EluXBHXzcYB7dzxQOBPXvZZV86OSdINrGlOS1xZb9woXYZ3nCwbE+MRPHYOe0zomupIm32XEAYzcnDwd93jyY0aRdwdcJ2JZSbVURY9nJ0HWaFhkQ50Km0RxAgB6BIhChJhJqOWRYcOOhKlqQ.L9oFxT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ct4BnysNVcjKecmPAaT7nGfPmlwIV5J84z9azMWTdF
-
As you can see, they both affect EQ1...
They also both affect EQ2
Is there a reason you're using a callback instead of parameter/processor ID?
I think you'll benefit from this video
https://www.youtube.com/watch?v=T40GCkxx8iwThis piece of code should be 1 loop, you have 3. (Edit: Actually I see in your real project you have consolidated them) :) .
for (i = 0; i < 2; i++) { EQ[i] = Synth.getEffect("EQ"+(i+1)); } for (i = 0; i < EQ_CONTROLS; i++) { freq[i] = Content.getComponent("freq"+(i+1)); } //Function for (i = 0; i < EQ.length; i++) { freq[i].setControlCallback(changeFreq0); }
This array could have a better name
const var freq = [];
Something like:
const var sliFreq = []
So we know it contains sliders and not frequency values for example.
-
@d-healey Thanks a lot!
-
@d-healey The reason why I'm not using the parameter/processor ID is that in my real project is that I have a lot of controls and I wanted to avoid having hundreds of lines of scripting repeating the same commands. Maybe I am wrong :)
-
@alepan Parameter ID requires no scripting, just select the processor and parameter in the interface designer.
-
@d-healey said in 3 band EQ controls via script:
@alepan Parameter ID requires no scripting, just select the processor and parameter in the interface designer.
Yeah I know, the fact is that only the first band is accessible in that way, and I have three bands in each eq.
I really can't figure out why all eqs are controlled by each slider. If you think it possible, can you explain me where the problem lies?
-
@alepan said in 3 band EQ controls via script:
Yeah I know, the fact is that only the first band is accessible in that way
Oh I didn't know that.
I really can't figure out why all eqs are controlled by each slider. If you think it possible, can you explain me where the problem lies?
You have a loop that is doing the same thing to each EQ. Dismantle your loop and write it out line by line instead and you'll see why it's doing what it's doing.
-
@d-healey OK I managed to do it :)
I needed a local variable to get the IDs of the component being used and an if statement to compare that number with the counter:inline function changeFreq0(component, value) { local idx = freq.indexOf(component); for (i = 0; i <= 13; i++) { if (i == idx) EQ[i].setAttribute(EQ[i].Freq, value); } }
Thanks a lot for the support David :)