how to link button to reverb parameter
-
Hi. Finally created the button use vectors in the setPaintRoutine function. I've set this button to "Clicks only" and linked with the Reverb.
I'm new to scripting, what I wanted to do is that whenever I click the button, the wet size increases or decrease by 15%.
Please how can I do that ? Thanks so much -
@nesta99 first you need to create a reference to your reverb FX.
so go to the FX and right click on the black bar over on the right side... select "Create generic script reference"
go to your init script and at the top paste in this reference
you should get something like:
const var SimpleReverb1 = Synth.getEffect("Simple Reverb1");
in your button call back you now need to set this FX's wet level. The documentation page tells you what parameters you have for simple reverb:
so to set the value you need to say;
SimpleReverb1.setAttribute(SimpleReverb1.WetLevel, somevalue);
where somevalue is the value you want to set the parameter to...
-
This post is deleted! -
@Lindon Thanks! The problem now is that when I set the value, the wet parameter goes to up once and stops there even if I press ... How can I let the value increase as I press the button x times?
-
@nesta99 Here you go:
HiseSnippet 1616.3oc2X0raaaDDlzxrHVoJnoHoMGWXz.HgD6H57SKfQgkskbhPhrErRrK5kfUjqjVXxcEHW5eRP.5SQA7s7ZzSIW6s9HDfdp25aP6rbIMWZI6nJij1FdvPyO6reyryNyrtc.2gDFxCLLm6oGMjXX94VcNhIFr9.LkYzrtg4UrZgCEj.jh0ZGMDGFRbMLMK7PICy4l0H96OWYMrGl4PxXYXrCm5PdB0mJx31t1ioddafcIOk5qo88p0zgyVm6wi.7TvppwPryd39jMwR0lwxv7yZ3RE7fNBrfDZXN6Zb2i5Lfe.So+NzPZWOhjv1nCXHE6M3dtRDK+sw5CndtsS86PCCSq1YQgBpnv0rZQcomvOKZ7EwBPYqPOdXNy4AOac3UcxgmoF7lUAuqZ0wIfNTjIQhsKa0jAGT8vvQfNrT5ZLyOZYsNGzfIVzGuGYi.f3jUT9AUqdaz8qVsxxkJVpHbPDJP6iCPcn9C8HaS1mDz0F88n3ziE6SDM50i3HJOuRAThFyKWe1pOfHTBdD00kvdLqKXhTT.FYct+PNCHJO+npNuBKkJdm6fZxbBH3PBZMAqTQJyixHndQLGAkyPbFMQNHVZ9.tWYmTaea.JdQjJ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ONDe8X5dvkVzCILRfL009bdl2uMoOya3D+LusbD.DdJLeU3PdHwVyxu8TxVR6R8apSDQrbpanXsjNKo6sA3dZ5coZoL0z7F0ZiY4LFPmyRsnGpWspACCGzcHf23tUnC3rxXmdUm1Qdgj37Ja8ElwdIc1OBG3BmKN4pCTXpt7ku7nl9i4l3m8elm+dQpwdwaITXxf6jUKKsvUCFTkAltIFieILNSObjmHka96Ys3L9vAv6DykArMAJOzuOIWh0XcHX3aXF5LNWq11DO4HGYr9lZOAl4GGnUT6eZrvdxiEm240MrTvEIKNf9znUdgOgZk+g3FJT+7+OmzesETSeIT7wM5e+y6OFCK7wXO7wNA7m6ndLorfwkh4.9MK9+x6bVsjzH6zGNZYUcwpx2LPetiiLmdAH9L90rzTrl6NEq4dSwZt+TrlGLEq4amh07cm6Zjc7WMRv8U4+.i1Mhe.uooZBn3qBF+MvgQrFF
Note that I use a hidden knob so the value can be saved in presets. So the inc/dec buttons are not directly setting the reverb, but they are updating the hidden knob, which then sets the reverb amount.
-
@nesta99
currentValue = SimpleReverb1.getAttribute(SimpleReverb1.WetLevel);
this tells you what it is right now , then add to your increment to this (checking that you havent reached the max value)
SimpleReverb1.setAttribute(SimpleReverb1.WetLevel, curretnValue + myIncrementAmount);
-
@ustk Thanks!! Sorry but I'm new to scripting and I don't understand this Hise snippet here , (ahaha so embarrassing !) .But yes, I tried to copy and paste it on the script but nothing happened.
-
@nesta99 Go to file >> import hise snippet.
-
@ustk Finally copied. Thanks for the time. You are a Genius. Now I can Understand the concept behind what you did!! Thanks again!!!!
-
@d-healey Thanks so Much David!!!
-
@Lindon Thanks sooo much , super grateful!
-
@nesta99 The concept is that the two buttons are calling the same function, one with +10% as a parameter (
amount
), the other with -10%.
You need to use +0.1 and -0.1, because, in Hise,NormalizedPercentage
sliders are in fact 0-1 based by 0.01 increments...The function called has a variable
newVal
that takes the current reverb levelwetReverbHiddenKnb.getValue()
(which is in fact the hidden slider value) and adds theamount
parameter (so +0.1/-0.1) to it.
ThennewVal
is limited to the 0-1 range (0-100%) so you don't risk having weird values like 130% or -50%...
newVal
is then applied to the slider that is hidden on the interfacewetReverbHiddenKnb.setValue(newVal);
.
At this stage, the reverb hasn't changed yet.Knowing that the variable
newVal
is volatile, this is the reason you need to use a dummy slider on the interface. So this slider can save/recall the reverb value with presets (in fact not the reverb value but the slider value, which is not the same thing). If you simply set the reverb amount using the local variablenewVal
, this cannot be saved in preset (only interface components can). This is why it is the job of the slider to set the reverb amount via its own callback. This slider callback is called either by the function viawetReverbHiddenKnb.changed();
or automatically when you switch presets... -
@d-healey @Lindon @ustk
https://youtu.be/h67Och427iA
Guys I've been trying figuring out how to link this 2 sliders to the parameter and I've been accurately followed your instructions but still can't do it... The worst part is that i do know the concept but i can't implement it in the script. I need help -
!!Solved!! After Trying all the night I've made it...
Console.print(this.getValue());
var interValueA = this.getValue()/120;
Ambience.setAttribute(Ambience.WetLevel, interValueA);
Now, the moment that i raise the slider, the wet level of the reverb rises. Thanks @Lindon , the code was perfect. Just that i didn't know how to implement it in this scenario. Totally new to coding/scripting so this achievement means a lot to me.