Page 1 of 1
Deviceparameter: No Info about enums and booleans?
Posted: Mon Dec 08, 2014 10:48 pm
by wackazong
Just to make sure I am not missing something: it is not possible to get textual information about the value of a deviceParameter in the LOM? Just a float? Really?
In
https://cycling74.com/docs/max5/refpage ... eParameter I only see the float value. What about e.g. a deviceParameter to select filter type? Would be nice to be able to get the values BP, LP, HP. Right? Not possible?
Re: Deviceparameter: No Info about enums and booleans?
Posted: Tue Dec 09, 2014 6:29 pm
by leighhunt
I think 'str_for_value' might be what you are looking for.
I know it's not listed in the LOM, but it exists, and works.
Hope this helps!
Leigh
Re: Deviceparameter: No Info about enums and booleans?
Posted: Tue Dec 09, 2014 6:32 pm
by wackazong

THX!
Re: Deviceparameter: No Info about enums and booleans?
Posted: Tue Dec 09, 2014 7:36 pm
by S4racen
Nice....
Cheers
D
Re: Deviceparameter: No Info about enums and booleans?
Posted: Tue Dec 09, 2014 10:56 pm
by wackazong
In a world like this, maybe there even exists a field which contains an array of all possible values?
Re: Deviceparameter: No Info about enums and booleans?
Posted: Wed Dec 10, 2014 1:15 am
by wackazong
Ok, got it. Just to be complete here:
str_for_value is a function of the live.object. You have to send a message like "call str_for_value 3" to live.object if it is assigned to a deviceParameter and then you will get the name for that specific value.
Re: Deviceparameter: No Info about enums and booleans?
Posted: Wed Dec 10, 2014 12:11 pm
by leighhunt
wackazong wrote:Ok, got it. Just to be complete here:
str_for_value is a function of the live.object. You have to send a message like "call str_for_value 3" to live.object if it is assigned to a deviceParameter and then you will get the name for that specific value.
Yes, indeed, I forgot to mention , it is a function call, not an observable parameter.
I, and others have used an live.observer to observe the 'value' of a device parameter, the output of which is used to trigger a call to the str_for_value function on a live.object.
Cheers,
Leigh
Re: Deviceparameter: No Info about enums and booleans?
Posted: Wed Dec 10, 2014 4:39 pm
by wackazong
Exactly, that's what I figured. Thanks!