LOM devices parameters value unit
following this post I was wondering if it's possible to get access from max for live to the full value of any parameter from any device (including live devices and vsts), meaning not only the value but the unit (dB / Hz...) and when the value is a symbol get this symbol (like 'on'; 'off' and so on). basically what you get when you map a macro to any parameter or from the configure menu inside of a vst, to be able to reconstruct the full value and get like '12 dB' '120 ms', 'on', 'off'...
I suspect it's not possible; but I'm curious if you know a way (besides listing every device and making a custom map). there are a few items I don't understand; those are ___str___ ; str_for_value and value_items; the first two send a kind of cryptic string of letters and numbers; not sure what I can do with those. besides I'm not sure I know of any controller that can list them; besides the push of course.
edit: I suspect that is_quantized + value_items would be part of the answer (I'll try another day; it's getting late).
Been a while on this stuff for me, but...
"value_items" applies to "enum" (or any non-continuous type) DeviceParameters. As you suspected, those are the things which would return "is_quantized" as 1.
For continuous / float values (is_quantized=0), IIRC str_for_value __str__ returns the the string text for only the current value. So it's possible to extract *roughly* all the text labels the user can see, but there is some granularity which is lost (e.g. finer frequency decimal places after the two that get displayed).
The trick is that some things (I think just all VST2 parameters) are always is_quantized 0 even though that parameter seems to have discrete values.
Anyway, get a parameter... ask if it is_quantized. If so, then you should be able to use value_items. If not, you will need to crawl through values calling str_for_value (after setting the parameter value). . If not, you should be able to do "call str_for_value <floatvalue>" to get the stings back for different values. There was some case I found where str_for_value didn't work sometimes, and so I instead had to use call __str__ after setting the parameter value (over and over again).
thanks, I'll give it another try. don't remember which one gave me a weird string of letters.
ok I don't get it; I only can get something with "get str_for_value" and what I get is something like this:
<bound method str_for_value of <DeviceParameter.DeviceParameter object at 0x147e1be00>>
in the LOM:
str_for_value
Parameter: value [float] Returns: [symbol] String representation of the specified value.
If I pass a parameter to it like "get str_for_value 1" it reports an error. Am I missing something? I don't understand the specificity of functions in the LOM either.
str_for_value is a function, so you say "call str_for_value <valuefloat>", not "get str_for_value". Also, note that having checked the LOM again I'd mixed up how str_for_value works, so I edited my previous response.
ah that's what I was missing; thanks; I still have a few things to learn in the arcane of the Live object model. I guess I should have red this first.
It does work apparently without fuss. I had trouble with live.observe (a bunch of errors due to recursive stuff) so I just metro the value at around 50ms; I just have to call this as well at the same time and it should refresh, for quantized or unquantized it works as well. Since I already use a scale with the max and min value I only have to deal with 0. 1. scales or midi to set values. Shouldn't be too hard to implement (unless I have other weird hang up because recursivity).