Get text name of selected device/param?

Questions and discussion about building and using Max for Live devices
Post Reply
solconnection
Posts: 76
Joined: Fri Aug 24, 2007 4:14 am

Get text name of selected device/param?

Post by solconnection » Sun Apr 11, 2010 4:42 pm

Hi HI,

I am working on a midi patch that remotely controls some knobs, it all works fine, you select the device to control using M4L.api.SelectDevice and the parameter from the output of that using m4L.api.SelectParameter, which is all pretty standard.

however i also want to be able to get the text value of the selected dropdown ie "my device name" for the device dropdown, and "filter cutoff" for the parameter dropdown and display them in a text label, does anyone know of a good way to do this? would really appreciate any help

have a nice day
-Dan

Surreal
Posts: 560
Joined: Wed May 17, 2006 1:18 am

Re: Get text name of selected device/param?

Post by Surreal » Mon Apr 12, 2010 11:35 am

there is an abstraction that does that. i think you might even be using it to do the select parameter bit.

M4L.api.SelectDevice
M4L.api.SelectParameter

solconnection
Posts: 76
Joined: Fri Aug 24, 2007 4:14 am

Re: Get text name of selected device/param?

Post by solconnection » Mon Apr 12, 2010 12:01 pm

Surreal wrote:there is an abstraction that does that. i think you might even be using it to do the select parameter bit.

M4L.api.SelectDevice
M4L.api.SelectParameter

thanks for the reply, though my problem is i cant seem to get it to output text values of whatever was selected to a message box or label :(

Palmer Eldritch
Posts: 525
Joined: Thu Jun 23, 2005 9:47 pm
Location: Universe>Earth>Europe>Germany

Re: Get text name of selected device/param?

Post by Palmer Eldritch » Mon Apr 12, 2010 12:53 pm

Hi solconnection,

Maybe this might help you:

<pre><code>
----------begin_max5_patcher----------
853.3ocyXksbaBCE8Y7WgFd10CRr22Z+M5jICKp1jZDLfbZZyj+8htR3hcrY
SwD+B1WIYz4dz4tH+5JCy3hWn0lnuh9Axv30UFFvPhALT1Fl4QujrOpFVlYR
QdNkwMWKmiSegCiWFUEkS4zJDq4y1oKi3I6xXaerhlvkaiCNbi0ZDlXK9HzC
LB1XgdP8aXGxKNv2S4vFZoFMKE1lh3m9hcP6q+mELNrcho9VUVzdz2K1m1c5
5r+BSis1z9pJqn0MtPDOqfcBvB.rHwmk5QWXkwZQEVL1aqVIdrVSlKk9bVBc
HZC6IQGAHLuvYPa95QaZS.4z55ns8qMjNoKAzFXvv6pNI9BNo8HcR4qg+mRp
bqMMOtIwaSJ1WTo3c.CcebbcSSdYqj5NtCKuHyfcYze2P.uScEUVRYonigm0
HmdN.rknSIuv3ATYW5.fn+AvsR.dEJppAJCF+YKyWgskDjy.LC48LCwa1Ly5
OP44shE2m8LcSCwsqW4EDCDBpe2gTW1WfC80hCWOBU10BecgC9P6aSwg9H0l
IDvnOsItS7pa3ziZIAKST6bRrEefyKX839DoGCkNHVsOmfy6dUuKNhs07leJ
yQwn39bPOoWAtoMYi6jS8L6jx.Ar9bhXoSsTDkJAx0aOxwGxKCA.tyH..qEC
cWW5hHy5hkMWMqRWVeLkt975rDKq4njI9NSuyRb3mdmkZmJ8Ldpyk236PhZM
OVS4HdUTxupQVH4MSZ9VehKeHZyQVzQU6YZDq28asGM50g3CJN+Y2qC14l2q
ymaaKp7Rg9ysqEL49U4bsPssMAXCku1BBobkEylSpJ+kmWfeXyAO67+NIvAE
ieJYUWbnJocaaudD5+NYJslmwftv6rHw06Q3iKZWVZJk08+6HOKsrHiwUfvV
0sjGD+4HI1yrbbjIvBgUJrPObwC7Q6I9m.xK6IhNtmhmnIlDRhAYW.SViGSD
rifyB.Bj3AwwmXHusjsskXYBCcY1fw3EdSyKzDSh+vigwj+hhI7nhkHKJlD2
AYvnBr2xiog3I7xd1ItM5v5oE9rCOFL4NMLgaJv4JxN.ILjoRN0PlIIP8cci
IFUbp0xxqViQ+Ed+Uo.SzoRQyEzUF5hUmwjSgrr72Xx8B.et5rFi2V8OPlLW
R.
-----------end_max5_patcher-----------
</code></pre>


regards, palmer
Live 8_3_4 + 4b7_32+64 -Suite- Max4Live 5_1_9 _ core2DuoMacBook 2*2,16 Ghz + external FW HD _ OSX 10.6.8 _ 3G RAM _ M.H. MIO 2882 + 5.4d208 Driver _ Faderfox LV1 _ Akai MPK25 _ Logitec wheel mouse _______ PeacE will be the SOLution of LIVE

solconnection
Posts: 76
Joined: Fri Aug 24, 2007 4:14 am

Re: Get text name of selected device/param?

Post by solconnection » Mon Apr 12, 2010 9:17 pm

thanks palmer, much appreciate your help.

unfortunately the patch you sent me doesn't really work (error: live.object: get: no valid object set) or i am using it incorrectly , but it gives me some interesting objects to look in to/learn about

thanks
-Dan

Palmer Eldritch
Posts: 525
Joined: Thu Jun 23, 2005 9:47 pm
Location: Universe>Earth>Europe>Germany

Re: Get text name of selected device/param?

Post by Palmer Eldritch » Mon Apr 12, 2010 10:39 pm

Hi solconnection,

Have a look at the message "path live_set tracks 0 devices 0"

This is the path for the first device on the first track - If there is no device at this path (no device on track one) then there is "no valid object set".

Try to insert a device at track one and push the button inside of my example patch.
Now you should get the name of this device in the message box below the comment "device name".

If that device has at least 5 (published) parameters then you should get the name of the fifth parameter in the message box below the comment "parameter name".

Have fun in further examinations :]
, palmer
Live 8_3_4 + 4b7_32+64 -Suite- Max4Live 5_1_9 _ core2DuoMacBook 2*2,16 Ghz + external FW HD _ OSX 10.6.8 _ 3G RAM _ M.H. MIO 2882 + 5.4d208 Driver _ Faderfox LV1 _ Akai MPK25 _ Logitec wheel mouse _______ PeacE will be the SOLution of LIVE

solconnection
Posts: 76
Joined: Fri Aug 24, 2007 4:14 am

Re: Get text name of selected device/param?

Post by solconnection » Mon Apr 12, 2010 10:51 pm

thanks for clearing that up :) much appreciated.

-Dan

Palmer Eldritch
Posts: 525
Joined: Thu Jun 23, 2005 9:47 pm
Location: Universe>Earth>Europe>Germany

Re: Get text name of selected device/param?

Post by Palmer Eldritch » Mon Apr 12, 2010 11:20 pm

:D
Live 8_3_4 + 4b7_32+64 -Suite- Max4Live 5_1_9 _ core2DuoMacBook 2*2,16 Ghz + external FW HD _ OSX 10.6.8 _ 3G RAM _ M.H. MIO 2882 + 5.4d208 Driver _ Faderfox LV1 _ Akai MPK25 _ Logitec wheel mouse _______ PeacE will be the SOLution of LIVE

Post Reply