I've been using the Live.API explorer patch to find various paths.
How would one send a command to view a specific device?
You can make the view jump to a specific track,
but if I have several devices on a track, I can't actually jump to the device that I
want to see?.
The viewing functions for Live.path and Live.object in general are a little unclear to me.
Can anyone help? -Thanks.
device viewing with Live.object
Re: device viewing with Live.object
Okay thanks for the response. I'm familiar with the LOM and alot of this is available premade in the the Live.API resoures folder. But I'm still no closer to my solution. If I have this:
<pre><code>
----------begin_max5_patcher----------
677.3oc2W0zbZCCD8r4WwN9LkwK9KnW5zdp8TuzacxjQHq.JwVhAISRZl7eu
1R1ExGPjcotzd.ynUxRu8s69z5GF44uPdGS4CuG9N348vHOOioZCdMi87KH2
QyIJyx7KXJEYIyercNM6NswNOCBZMdkTnU7evpm.ClDzXdMQSWwEKubCipsm
YTT8z.Z+K1NHYR.bQy6HJK3hbl1b3SaLxyLGobw0ua578OTAovbn9ebCmjCe
Rlm4uaijk51cBarZMoueMyhGee3h5Ydbzn5GicjTnxhBlP+BR4yxagLI7EXK
mcKnWwUfZMixuhSgL1VNk8g12ImKXTYoPuui5NQFiSq4tnXCCZIxoyODQhuB
QFzKhLnGr0hRsVJ7ORVQJZblDiWDz9zceIriQ8EDwx9E4EraqNwWD3ykjLyl
18JBquiQlBBa3bVW78nSaAQ+olCoTT4zqfb9V1kJlFzaHzaTPPS8.f8lxl0j
6G0cQjjyAQjCkJUwTSp4r9mKgV0Ur6ISo8hXBOHwLt42IUk8q2PtebkHKkHf
qKKVCZYa1jQ2UJ.B7s57rImH0VbdzNAJLA6rZKN+7QscZpwWR6oXKF8WWQgR
xyAEKuxktjKT5Mk6mm3dX0xDyRsEMIcVGACNGzQdy.NFG9aEwS+2810FWGi6
4sqwmKWtdrKKpln1g6N4fVxIzjXDO+3ryqj+GcNj92w1Npugn24QyrZDgcWp
H7+yNNZquPrmcbfCQCGFzX5A3Ye5qwips+TRSIK2Pa2x19hfcNUFSo4BhlWI
6t2hptiGvesnU7rLlY9V9qfmsVxE5FPbfPnyXJzELk7jE8GGSQtfovgESItf
ozAEStD5vAEQnCHJZPyuic.QCaTqtcOmHogCRtnKMrkanKR.OiI6FlpF73ne
BTOOVeO
-----------end_max5_patcher-----------
</code></pre>
... I can view a device on a track. But how do I say which device on that track I want my blue hand to land on?
If I have my device id, I can't use that id with any view commands.
<pre><code>
----------begin_max5_patcher----------
677.3oc2W0zbZCCD8r4WwN9LkwK9KnW5zdp8TuzacxjQHq.JwVhAISRZl7eu
1R1ExGPjcotzd.ynUxRu8s69z5GF44uPdGS4CuG9N348vHOOioZCdMi87KH2
QyIJyx7KXJEYIyercNM6NswNOCBZMdkTnU7evpm.ClDzXdMQSWwEKubCipsm
YTT8z.Z+K1NHYR.bQy6HJK3hbl1b3SaLxyLGobw0ua578OTAovbn9ebCmjCe
Rlm4uaijk51cBarZMoueMyhGee3h5Ydbzn5GicjTnxhBlP+BR4yxagLI7EXK
mcKnWwUfZMixuhSgL1VNk8g12ImKXTYoPuui5NQFiSq4tnXCCZIxoyODQhuB
QFzKhLnGr0hRsVJ7ORVQJZblDiWDz9zceIriQ8EDwx9E4EraqNwWD3ykjLyl
18JBquiQlBBa3bVW78nSaAQ+olCoTT4zqfb9V1kJlFzaHzaTPPS8.f8lxl0j
6G0cQjjyAQjCkJUwTSp4r9mKgV0Ur6ISo8hXBOHwLt42IUk8q2PtebkHKkHf
qKKVCZYa1jQ2UJ.B7s57rImH0VbdzNAJLA6rZKN+7QscZpwWR6oXKF8WWQgR
xyAEKuxktjKT5Mk6mm3dX0xDyRsEMIcVGACNGzQdy.NFG9aEwS+2810FWGi6
4sqwmKWtdrKKpln1g6N4fVxIzjXDO+3ryqj+GcNj92w1Npugn24QyrZDgcWp
H7+yNNZquPrmcbfCQCGFzX5A3Ye5qwips+TRSIK2Pa2x19hfcNUFSo4BhlWI
6t2hptiGvesnU7rLlY9V9qfmsVxE5FPbfPnyXJzELk7jE8GGSQtfovgESItf
ozAEStD5vAEQnCHJZPyuic.QCaTqtcOmHogCRtnKMrkanKR.OiI6FlpF73ne
BTOOVeO
-----------end_max5_patcher-----------
</code></pre>
... I can view a device on a track. But how do I say which device on that track I want my blue hand to land on?
If I have my device id, I can't use that id with any view commands.
Re: device viewing with Live.object
"You have the function select_device in the Song.View class; so just use that one."
Yeah, thats what I'm doing, but then I have to arrow back and forth to control the device I actually want to use.
I was hoping there was something slicker.
Yeah, thats what I'm doing, but then I have to arrow back and forth to control the device I actually want to use.
I was hoping there was something slicker.
Re: device viewing with Live.object
Ah Ha! Thank you kind sir, now I can finally get rid of these darn IAC busses!
-
flowdesigner
- Posts: 930
- Joined: Sun Dec 21, 2008 5:58 am
Re: device viewing with Live.object
ShelLuser wrote:I'd suggest using the Live Object Model instead. At least until you have a little more experience with all this.Fairland wrote:I've been using the Live.API explorer patch to find various paths.
The LOM will clearly show you which devices you can access and how (either getting values or actually observing them) as well as the path to use.
First its important to know the difference between live.object, live.observer and their relation with live.path. Also see the API overview which gives some more details about the way the LOM is setup.How would one send a command to view a specific device?
In short; you use live.path to point either an object or an observer to a certain device (better put; a certain class) after which you can then tell it to give you information about said class.
Now, let me take my reasoning step by step here. Normally I'd skip a lot, but that's solely due to experience. So:
First something simple; the name of a track.
I go to the LOM, I click on 'Track' and there I can see that 'canonical path' to reach a track is 'live_set tracks N' (where N is obviously a number).
There I can also see the properties of the Track class; one of them is 'name'. Behind it I see the type ('Symbol') and the access possibilities: get, set and observe.
So what I need to do here is to point live.object to that path. Then tell it to 'get' me the name of the track.
I made a small patch to demonstrate this behavior. This is fully "Max compliant" so it works from right to left
First press the button; this tells live.path to send out the id of the class I want to check (the first track in the Live set). Then press the message object ('get name') which tells the live.object (which now points at the first track) to give me its name. Which is then printed out (check your Max window).
Here you go:
Get the name of a trackHow to use this: Pull in a Max audio effect, click the edit button, then select all objects (control-a) and remove 'm. Now copy this code block, right click in the patcher and select 'paste'.Code: Select all
----------begin_max5_patcher---------- 993.3ocwWssbZCCD8YxL4evielxfMP.5as+FYxvHrjMpQVxijLgzLse6UVxx H4KDtjz7PLNZWs5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pWiVta5XeArzxOZVxzLZkdJ8EqemdQeQrjB16BpdaiPkW I4fjmEASGf0l0Cqs3Dr135+tJ1yzxZtog9rnO3V4lv3O1cMc1ddUKo1YN0kd ieNvLpUyw35U2ATGX3zdupOarEEeNfawWB1VeNPa4WBzV38ChNAzhtInUsf5 i+gAUs3R -----------end_max5_patcher-----------
Now something a bit harder...
Yes you can.You can make the view jump to a specific track,
but if I have several devices on a track, I can't actually jump to the device that I want to see?.
Back to the LOM again; one child of the Track class is 'devices', its type is 'Device' and its access get and observe.
So why not try to see what this does?
Load some devices onto track 1. Say an EQ8, grain delay, flanger and obviously a limiter last (so we can make sure that the noise stays down).
Now, use the patch above; change 'name' to 'devices' and see what happens. Be sure to click the button, then click the message object again.
Now you'll probably see something in the Max window like: "devices id 2 id 3 id 4". iow; it tells you exactly how many devices are on this track, and gives their id's as well.
According to the live.object reference page it can take a message into the right inlet in the form of: "id nn". quote: "Gets object id message id nn to select the object to operate upon.". Basically; all which live.path does is "translate" a path into an id, then you can use that id with live.object to access it. But there are many more ways to get id's.
Quick side-step, proof of concept: We already determined through the LOM that the path of the first device is basically "live_set tracks 0 devices 0" right?
EDIT: Wrong! Sorry, forgot: So, "devices" is of type "Device". "Device" is actually yet another class, like "Track" is. You can see for yourself at the top of the LOM. So; either pagedown from the Track class or go to the top of the page and click "Device".
Now check its canonical path; this tells us the exact path. Keep in mind: counting always starts at 0. So; track 1 in a set is actually "live_set tracks 0". And so on.
So lets ask live.path what its really sending into a live.object:
Check what live.path really sends outOnly id xx eh ?Code: Select all
----------begin_max5_patcher---------- 532.3ocqU0raaCCC9rKPeGD7Yu.amtTfcaOGEAFJVzMZ0lxPhNKcE6ceRx+D 6U4fzsdvlDjTze7Sjzuc+cQwGTmASL6armXQQuYsD4s4rDMZHJtgetrla7AF WKOAaNzQjBiSFB3DWi7FXU+XWipipAxmhrQyRg+DpC+3KONEaefzqsPOthiY 6G80xoxiR74BMTR8tyd3wMoIrrzGbh7o2yOj1hMBzE.xOTCKffEYR7c.yvOA hBNQZosRfKZlAlYjZbkdcGnpFsO4X920bTooPDzSY6Gq6EGnQIrbtGR4txKP H0J74OZJknK5zURnDewkPeIltVJTBXU+RrR4gSP.zgxdVNrakV.5USs.pthW SK.hZYimv1rB1NIMxga+vIgf10qcNhJhSREVLw5AqCv1QMz3ppphSrB7RG7x PO2pP.oq.aOoQuNzzF9VYrSYyJtu5s93bVdXRSRRd8r4lzgn98820qMpLHsh jadSBB+zN5OM3SvYOUD2pkVRI7tiz.6N1MEakBIi7W8rU9TEes8F69pSr0+N Oc9divqFbehoNfuqszS7mNA3GmsX9HyoUX.hQZd4KFVJS.mjkfUaEBZa.BJ6 JKWSFdtT2+Cj31c8zW9mGK1mAKUfu6GTdf3b7WbqQ0oKGKrgepvlAEAXHI5G hmET1xfNJEB.Wzp0HEsJaK4.NX6W+B+lgV1s.sc+2PyYvJ9C0aV4oC -----------end_max5_patcher-----------
Now; care must be taken here since working with id's alone can be tricky. Esp. if certain devices change place and such. But since my goal here is to give some background info on how you could do some stuff we'll ignore this for now. But do keep it in mind!
So... Why not use a new live.object and point it to this device?
Device has a child called 'parameters', type DeviceParameter which we can get and observe. And several properties; class_name and name.
Lets start by doing something simple; like getting the name of the device. Its no different from getting the name of a Track, see the example below. Remember; you need to press all buttons and messages again; from right to left.
Get the name of a deviceAs you can see we get a perfect name here.Code: Select all
----------begin_max5_patcher---------- 1137.3oc2X00jhhCE8Ympl+CT7bOVDTz18sc+azUWVQHpY5PBEIX2yN0t+1m 7AfIZ.QaG0ZdPvh6M2b3jy8lK4me8KiBWw9.wCC9qfWBFM5mxmLR+L0SF07f Qg4vORIPt1wPJ5c1puG9TsMA5Cg94EkXpHHCsCmJCYiYZUNqRPPB8fiZdLNS OFYf917YsNulQEb7+hT1.Qia8t.JR2hoaVVhREFzFGsPZOXwD004wpqfmGGE 7p0DioMyKvdFnvb8LD92kXHI3eXjrPs4+6qeQcWd6oOOa.SeKfGD0AQ.7PDy Vz5rwSwOJPl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gwsuyZ97vF1ZX0iaTatSCXc0kla+bdZQqi1y7tXOXvMHroNr+6.1TGs9oAm ldA2dvMUNswmBb5Wg6D3.CBbOnRN8avsGapiYdfRtaO3.wCAbI2ErMnT06Cs kLjbgOeQD0Cj29E.LsAZ7 -----------end_max5_patcher-----------
I'm using the unpack & pack objects to get rid of the 'devices' in the message. So; first I unpack the (for example) "devices id 2" into symbol, symbol, integer. Then I grab the last 2 parts and pack these up again. Now I've re-constructed "id 2".
So far, so good.
Now, I know what you're gonna say (or so I think). So far I demonstrated with only a single device. And your question actually was about multiple devices.
Do you recall when my example checked for devices and we got something like "devices id 2 id 3 id 4" ? And since we already determined here that basically a single "id xx" is enough to point a live.object to a device...
All you'd need to do is pick out the right device you want to use.
So lets take this one step further and set something up to print the name of all the devices on a single track.
We already determined how to get the ID's, we already determined how to get the name for a single device. All we need now is to build something to go over each individual id. For this we have the iter object; to iterate over a list.
Since we already know we'll be using something like: "id 2 id 4 id 1" all we're basically interested about here is processing the numbers. We can always attach the "id" later if we want to.
SO... First we go back to the patch which send out that "devices id 2 id 4 id 5" etc. Now all we need to do is to apply a little Max-fu to extract the info we want.
First we iterate over the info which live.object gave us. Then we'll make sure to only extract the id numbers. You can do that by using, for example, a select object. Simply use something like 'select devices id'. Everything which doesn't match either "devices" or "id" will be send out through the right outlet (iow; the id numbers we're after).
Prepending 'id' will give us a nice list of "id 2", "id 3" and so on.
Now, all we need now is to point a live.object to these id's and tell it to give us the names of the devices. The easiest way to do that is by using a trigger object. Every time a number comes in we tell it to send out the number, then a bang. The number is prepended with "id" and send into a live.object. Then we'll simply create a message with the command we want to give it ("get name") and use the bang to send this into the live.object as well.
And because Max works from right to left we can be pretty sure the sequence will always be met (so: first setting the id, then giving the command).
And here it is:
Get the names of all devices on a trackCode: Select all
----------begin_max5_patcher---------- 1188.3oc2Y1siZiCE.9ZpTeGhx0rn3.gLr2s80nZDxPLf2wwNJ1gYZq18Ye8 OIgXvFRXXZFsWTL0mSrO74yewyu95W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KsyYYRfaNLS6jJqiJDFc+fVOL8rxsVqFl9hZ031QUmsDrLj W4X5NlsyYWoUTrgutEyJyLcO5bokN4WQJu.gxH3bMsl4w15zxi6EQfJ7+aGR oLSmfquLFz16pJuI20tcpRUpbYO6T02jsngLsT4wr0PS7iZ2U2mJMtIy7H9p m5MAXwtgFVHSWzIhIpVq1zoumbHW8tAqee6g7piO52bLoS+AlKR8+AWMX5il Rlq6JM4S50BpojzrODn91Ztz0RTB29BOHZ.WjSxUn1z5+ce2Ngotk4ZnaJh8 3tcByxX21YMOOuesFpdYeZQ18O5oKM8eohtpcYOZd5Oy4w8.LuE8y7hGIyKp el2hQx7.8mdfQhdfaadfQgdp62MH91VWz3Xc8xya03ftzdYaiC3R5iOW5nDP rpOXKcbRkzqxDu+hDpIjC+GPn6Bw3 -----------end_max5_patcher-----------
Now, this is probably a lot to take in at once so I'm leaving it here for now. As you can see its relatively easy to disect all the device ID's on a track, and going over 'm one by one.
You can even easily expand on this; as soon as you found, say, the "Limiter" (by checking the device names for example) you can then simply start using that one (for example if you need to search for a specific device to control).
The options are limitless... IMO that is
Hope this is helpful to you.
Thanks !