Control Parameter with single Slider from Sliderpack?
-
Hey Gang,
Can you control a plugin parameter, in my case an EQ Band, with a single slider from a SliderPack?
-
@trillbilly Yes but you need to do it through scripting. Have a search on the forum about controlling EQ bands, I can't remember the details but it's a little fiddly.
-
@d-healey Hi David,
Im able to control EQ bands with something like a knob no issue. I've scoured the forum for any info about controlling a plugin parameter with a sliderpack but have come up empty handed. I've seen some thing about controlling/linking knobs with a slider pack but nothing about a single parameter to a single slider.
Maybe Im overlooking something. Theres not to many pages to dig through, I will search about SliderPacks again and see what I come up with.
-
@trillbilly said in Control Parameter with single Slider from Sliderpack?:
m able to control EQ bands with something like a knob no issue.
How are you doing it?
-
@d-healey Like This
const var Knob1 = Content.getComponent("Knob1"); const var ParametriqEQ1 = Synth.getEffect("Parametriq EQ1"); inline function onKnob1Control(component, value) { ParametriqEQ1.setAttribute(ParametriqEQ1.Gain + 5 * 0, value); }; Content.getComponent("Knob1").setControlCallback(onKnob1Control);
-
@trillbilly Ok so you do the exact same thing with a sliderpack. The
value
parameter of the sliderpack callback is the index of the slider that you moved.Also note that using a bidirectional sliderpack, where the min/max are not equally apart, prevents the sliderpack from drawing properly - bug for @Christoph-Hart
If you draw it yourself with LAF then you shouldn't have a problem.
HiseSnippet 1158.3oc2W0saaaCElJNpn1csnsnXXWxErKbVKLraRy1PwPsi+oHX0IdQtYaXWzwHQaSDJREJJuZLz2s8DLrGkd2tb6PI4HoFgLGiNTrpKDDO+P9cN7vuC0HkzkFFJUHqpiWDPQVehsyBgdV2YDl.cPOj0crGRB0TENQz9KBHggTOjkUkmaDXUcST7yae19DNQ3RyDgPmHYtzWv7Y5LoiZ+cLNe.wiNl4my5caefqTzUxkQ.dpX2DEPbOiLkdHwX1F1Hqaz2iokJGMQSCAa1W5svYl7WEI1eBKjcJmZFzB4.SThXT2YLt2nkwZHBYYOJKxqjD4OvdHyicg7rLvciUfy7HeNvZiqBRstFPxJGj1LAR2y1wUwBzYZL34V1GHfMjIDHUmGJI1h13urr6JAKD5F9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s3TcIGe7553Nqqi6ttN9j00w8VWG+p00wu9e2QSW9NQZoeB2GBMbT+3eUvxJ2oNz+fxSipG
-
@d-healey Great, that works. But now it seems I cannot choose the Slider Index. i tried changing the
getSliderValueAt(value);
tosetSliderAtIndex(0, value);
with no luck.Also, is there anyway I can use this in an ELSE function?
Here is my snippet. When I turn the power OFF, i'd like the slider to be manually editable and still control the EQ Band.
HiseSnippet 3176.3oc6bs8abbUFeFaONYcaCIgpBUhGFYwCavI16NydKkKYhWuapUr8t16l1zRjZGu6YWOMyNylYl0wtQQMRHjPvCEg3EDBoJgDOwCHPPe.gnuv+.fPBDRnHPkWPnFwkWo7cNm4xY1KyNqsaaZYshVumuy2224247c4b0opkYCjssoEGeh5G1Eww+jB0NzvYuh6opYvs9Zb7mQXSUaGjkHkzpG1U01F0jime1qgIvmXNNxOO5JqppqZz.EPhi6EL0Zf1PqilS.0pJWWSWurZSTcsNLbmQY8FlFEM0M6A3YVgTbcUaba01nsTwrMi.G+7kZp4XZUyQ0AYywO2plMOr1dl20fx+KnYqsqNBWHMWMPQTxkM0ahQLlJWw8zzaV0qeaywwKTMXTXV5nvSKroVSMe5AiFmkTgXfDriG7yDFdyFBdoYgWJF3MDHwy.o4nP5bB0ZXo00InFLddBg0M.iSKUXXmEJTd4lo9SKTzD3vvY4Np2FU1BJ3KQxboRcQQ3iK7EWXAXn21QbeUKwZ5ZMQVUgw9zheYQOwaibJZ1oqoATH4hL7rXXoutg4tiVNRsXIBKfTjBHMn.xQJfLASqrxFkqXyHHTbSyl8zUAaDFhDOcr39TStHviX.SgaXV4khi7RiVd43Hu7nkOSbjOynkOabjO6nkOWbjO2nkOebjO+nkuPbjufqePosYzRUUKHehik1cJscHufRsZgZ.dPALHBbzm6sCHQIi1ZFnkaXgf3bbNLqJ69ZXQos1NWcq0proXksVoR4xKnYnCLK1pmQCGMSCQSiU643XZHgcesL0S1vy28hPCn2CcgEt2BIzZIlzsTBnXhUVgzNK.e0YYajCoTQUc8cgPvjdJ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Mn+k0PdmPDJfsxfz+SHrItrXve6QBoVNEWGslZuRiF3m91kRywMbYjNBxHeDjIyQPlrGAYxcDjI+QPlBQJC9Q+d0dvtLnKlBHTsDM7hmIqN2+CP54ziL
-
@trillbilly said in Control Parameter with single Slider from Sliderpack?:
But now it seems I cannot choose the Slider Index
What do you mean?
@trillbilly said in Control Parameter with single Slider from Sliderpack?:
Also, is there anyway I can use this in an ELSE function?
Again, not sure what you mean. Else is part of an if statement, it's not a function. You can call any function from within the else clause though.
-
@d-healey said in Control Parameter with single Slider from Sliderpack?:
@trillbilly said in Control Parameter with single Slider from Sliderpack?:
But now it seems I cannot choose the Slider Index
What do you mean?
I now cannot choose which slider within the SliderPack controls which EQ band. They all just control the same bands.
@trillbilly said in Control Parameter with single Slider from Sliderpack?:
Also, is there anyway I can use this in an ELSE function?
Again, not sure what you mean. Else is part of an if statement, it's not a function. You can call any function from within the else clause though.
My aplogies for incorrect wording of the ELSE Clause.
In the last snippet I posted, I have an Inline Function with IF & ELSE statements. I cannot nest the Inline Function you created within the first Inline Function (in the ELSE clause).
-
@trillbilly said in Control Parameter with single Slider from Sliderpack?:
I now cannot choose which slider within the SliderPack controls which EQ band. They all just control the same bands.
The
value
parameter is theindex
. You can use that in your code that calculates the band to move.@trillbilly said in Control Parameter with single Slider from Sliderpack?:
I cannot nest the Inline Function you created within the first Inline Function (in the ELSE clause).
To be honest it all looks a little janky to me, you are dynamically creating a timer callback within an inline function which doesn't seems like a good idea.
Also you have tons of unnecessary duplication.
This:
var v = LFOModulator1.getCurrentLevel(); var v1 = LFOModulator2.getCurrentLevel(); var v2 = LFOModulator3.getCurrentLevel(); var v3 = LFOModulator4.getCurrentLevel(); var v4 = LFOModulator5.getCurrentLevel(); var v5 = LFOModulator6.getCurrentLevel(); var v6 = LFOModulator7.getCurrentLevel(); var v7 = LFOModulator8.getCurrentLevel(); //Sliderpack SliderPack1.setSliderAtIndex(0, v); SliderPack1.setSliderAtIndex(1, v1); SliderPack1.setSliderAtIndex(2, v2); SliderPack1.setSliderAtIndex(3, v3); SliderPack1.setSliderAtIndex(4, v4); SliderPack1.setSliderAtIndex(5, v5); SliderPack1.setSliderAtIndex(6, v6); SliderPack1.setSliderAtIndex(7, v7);
Could be written as:
for (i = 0; i < SliderPack1.getNumSliders(); i++) SliderPack1.setSliderAtIndex(i, modulators[i].getCurrentLevel();
For this to work you'd need to put your modulator references into an array called modulators.
I think once you refactor your code it will be easier to add in additional features.
-
The
value
parameter is theindex
. You can use that in your code that calculates the band to move.I think we are looking at 2 different indexes. Im speaking about the SliderPack Index. How does your snippet know which Slider in the SliderPack (8 total sliders) controls which EQ Band?
To be honest it all looks a little janky to me, you are dynamically creating a timer callback within an inline function which doesn't seems like a good idea.
What would be a better way to power this on and off? Should I leave the timer on at all times and shut off the LFOs instead?
And yes, I need to learn how to compress my script in a more efficient manner.
-
@trillbilly said in Control Parameter with single Slider from Sliderpack?:
How does your snippet know which Slider in the SliderPack (8 total sliders) controls which EQ Band?
It doesn't, I just copied from your original bit of code:
ParametriqEQ1.setAttribute(ParametriqEQ1.Gain + 5 * 0, value);
You tell me which band will be affected?
@trillbilly said in Control Parameter with single Slider from Sliderpack?:
What would be a better way to power this on and off? Should I leave the timer on at all times and shut off the LFOs instead?
You could put an if in your slider pack callback that checks the status of the power button.
-
It doesn't, I just copied from your original bit of code:
ParametriqEQ1.setAttribute(ParametriqEQ1.Gain + 5 * 0, value);
You tell me which band will be affected?
The first EQ Band, but tell me which Slider in the SliderPack will affect it? This is the issue Im having. I cant determine which Slider in the SliderPack effects which EQ Band with
getSliderValueAt(value);
. I am unable to get the Index of the SliderPack to be chosen. If I try and add something with thesetSliderAtIndex(0, value):
it breaks the SliderPack/EQ connection.That original bit of code was strictly to show you how I would connect a knob to the Band of an EQ.
You could put an if in your slider pack callback that checks the status of the power button.
Thanks, I will try this instead.
-
@trillbilly said in Control Parameter with single Slider from Sliderpack?:
The first EQ Band, but tell me which Slider in the SliderPack will affect it?
You're overthinking it. Remember
value
is the index of the slider that you moved. So if you want slider 0 to control band 0 all you need to do is change0
tovalue
.ParametriqEQ1.setAttribute(ParametriqEQ1.Gain + 5 * value, v);
v
here is from the snippet I posted, where I get the actual value of the slider that was moved. -
@d-healey Holy Shit, thank you.
Thank god its almost the weekend. I've been in this dungeon long enough. I've overlooked everything.