Deviceparameter: No Info about enums and booleans?

Learn about building and using Max for Live devices.
Post Reply
wackazong
Posts: 19
Joined: Fri Jun 15, 2007 9:32 am

Deviceparameter: No Info about enums and booleans?

Post by wackazong » Mon Dec 08, 2014 10:48 pm

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?

leighhunt
Posts: 31
Joined: Mon Mar 30, 2009 9:41 am
Location: London UK
Contact:

Re: Deviceparameter: No Info about enums and booleans?

Post by leighhunt » Tue Dec 09, 2014 6:29 pm

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

wackazong
Posts: 19
Joined: Fri Jun 15, 2007 9:32 am

Re: Deviceparameter: No Info about enums and booleans?

Post by wackazong » Tue Dec 09, 2014 6:32 pm

8) THX!

S4racen
Posts: 5987
Joined: Fri Aug 24, 2007 4:08 pm
Location: Dunstable
Contact:

Re: Deviceparameter: No Info about enums and booleans?

Post by S4racen » Tue Dec 09, 2014 7:36 pm

Nice....

Cheers
D

wackazong
Posts: 19
Joined: Fri Jun 15, 2007 9:32 am

Re: Deviceparameter: No Info about enums and booleans?

Post by wackazong » Tue Dec 09, 2014 10:56 pm

In a world like this, maybe there even exists a field which contains an array of all possible values?

wackazong
Posts: 19
Joined: Fri Jun 15, 2007 9:32 am

Re: Deviceparameter: No Info about enums and booleans?

Post by wackazong » Wed Dec 10, 2014 1:15 am

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.

leighhunt
Posts: 31
Joined: Mon Mar 30, 2009 9:41 am
Location: London UK
Contact:

Re: Deviceparameter: No Info about enums and booleans?

Post by leighhunt » Wed Dec 10, 2014 12:11 pm

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

wackazong
Posts: 19
Joined: Fri Jun 15, 2007 9:32 am

Re: Deviceparameter: No Info about enums and booleans?

Post by wackazong » Wed Dec 10, 2014 4:39 pm

Exactly, that's what I figured. Thanks!

Post Reply