Change AudioParameterRange on runtime


#1

Hej guys
Currently I am programming some kind of effect-rack where the user can add multiple effects. So far everything is working just fine, but now I want to add parameters so one can automate everything from within the DAW. I figured that I can’t use addAndCreateParameter on runtime, which makes sense to me (or maybe I have overseen something? maybe I can use the add and create on runtime?)
so this is what I do know: I initialize the AudipProcessorValueTreeState in the constructor of the Processor. then I create like…50 parameters or what so ever. Now when the user creates an effect, this effect attaches itself to the value tree of the processor. done. no problem so far BUT: Since I have to define the parameterRange within the createAndAdd the range of the button gets messed up, which of course effects how the button works.
So what I want to know:
either: How can I change the range of the parameter? I can’t find any setRange(), and if im not mistaken, the range seems to be const.
or: would another way be more efficient? I thought about just adding listeners instead of attachment, so I can just scale everything in the callbacks method but I think that would cause the parameter not to change, when the button itself is moved which is pretty… unintuitive. furthermore I think this would not be the most elegant method.
the most…easy way…would be to say all buttons have a range from 0 to 1 and they have to be scaled anyways but I think this can not be the only way to do it… it just seems wrong.
So guys thats it
thanks in advance
Benny