How do I get the current value of a control?

I have a control with id ref#1. How do I get the current value of that control? I do not want to get the value when the control is changed, I know how to do that. I want to get it at any time from any part of my lua code.

If you have the parameter number, at any time you can do:

CurValue = parameterMap.get(1, PT_VIRTUAL, paramNumber)

Check the on line docs for the full meaning of course. Use the appropriate PT_ constant for the type of control you are using.

If you only have the control id, you need the extra steps of

cntrl = controls.get(1)
Pnum = cntrl:getValue(“value”):getMessage():getParameterNumber()

(I think I have that right, if not, with the docs, it will get you close)

2 Likes

Thanks so much. That was exactly the information I needed.