Page 1 of 1

Get text name of selected device/param?

Posted: Sun Apr 11, 2010 4:42 pm
by solconnection
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

Re: Get text name of selected device/param?

Posted: Mon Apr 12, 2010 11:35 am
by Surreal
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

Re: Get text name of selected device/param?

Posted: Mon Apr 12, 2010 12:01 pm
by solconnection
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 :(

Re: Get text name of selected device/param?

Posted: Mon Apr 12, 2010 12:53 pm
by Palmer Eldritch
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

Re: Get text name of selected device/param?

Posted: Mon Apr 12, 2010 9:17 pm
by solconnection
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

Re: Get text name of selected device/param?

Posted: Mon Apr 12, 2010 10:39 pm
by Palmer Eldritch
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

Re: Get text name of selected device/param?

Posted: Mon Apr 12, 2010 10:51 pm
by solconnection
thanks for clearing that up :) much appreciated.

-Dan

Re: Get text name of selected device/param?

Posted: Mon Apr 12, 2010 11:20 pm
by Palmer Eldritch
:D