live.path and relative paths

Learn about building and using Max for Live devices.
Post Reply
Because789
Posts: 440
Joined: Thu Apr 28, 2011 1:26 pm

live.path and relative paths

Post by Because789 » Mon Nov 04, 2013 11:58 am

Can someone explain me, why live.path acts as observer (i.e. it spits out the id with change of selection) with "path live_set view selected_track" or "path live_set view selected_scene", but it doesn't act like this with "path live_set view highlighted_clip_slot"?

Code: Select all

----------begin_max5_patcher----------
590.3oc6V10aaBCEF9ZpT+OXw0LjMeXfc219Izc2zTjKbZh6bLHrSZ1p1+8Y
rCYz1TFMMhsI0Kv.G+0KObNuv8Wdgm+006.kO58nuf77t2DwyFqKhWe.O+0r
ckBlxNPeIbW8025GruOMrSai2zxkZzUkfDNz4M0RsjsFrC3Csbl.8wZQ0g9k
aVWuQK.scow8g4U1IX1l2keXrMLc4Jtb4hVnT6jLMGGlkFfJJBwAHZZWKIOD
i95fMfK6WexPYo3+vJKBNDaC+yKun6r4TvjYwZPoXKgi.CldERv2BKTfFskC
2gTfvHbnZg5UfHxQPDAOJinQcXI11RxbmnCYja40euAbyv2+Y3WzYmeOWtTG
4B6X3Iho39vk0h5V2iENrHOIljDXtJmTPw4cWgSwElKHCAxP1Rl.aowcsozv
zGm98TzFr+X1RQGub8ysrxucFKWSGCWI4zgkqQyd453r3SBdyUhZ8YDGwigi
nzzvCzHK9+CyK8qHg4XlWwiZvmPyGXd4t4MyqIadkMA19Os40KIEcEe4Jg4n
KKszTJuPc50xGKSMBO52BhhyFjpV7Vp5KJUMBGMA3dHWEOa4ptoa.k7I+mrU
mcc7Hxqp2zV1qi9eh.Q9sPp.klKYZdsbvnLFgnAOQq3UUf7AeXohqXWK.K0F
IWX55B+vs735xp9YVXYSAXoyttrYo+YgEO6BKNeRuIy9KPLxTTlCrmtz1Wkx
ZZ1Bsp8qsSUFivacVSz.28bo6dmEfeKrk2OkDWHVqw.Rabe1z5LB2QS7M8X2
PSyu.n3WmsM
-----------end_max5_patcher-----------
Live 9.5 (64bit), Max 7.0.6, Windows 10, Push 2, Korg electribe2, Bass Station II, Launch Control XL, Faderfox DJ3

M4L

chapelier fou
Posts: 6021
Joined: Mon May 15, 2006 12:15 pm

Re: live.path and relative paths

Post by chapelier fou » Mon Nov 04, 2013 12:11 pm

no idea !
But thank you very much, i didn't know that live.path would act as an observer (what's the point of observers in these cases ??).
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1

Because789
Posts: 440
Joined: Thu Apr 28, 2011 1:26 pm

Re: live.path and relative paths

Post by Because789 » Mon Nov 04, 2013 12:40 pm

You're welcome!

I discovered it by accident, but it's stated in the Live API Overview that "live.path can also observe the given path, and when the object at this path changes, its id is sent to the middle outlet." So I'd say in cases where it works, there's no point of using an observer.

But I thought that it would work for all relative paths. Obviously this isn't the case. It smells a bit like a bug, or at least a lack of documentation...
Live 9.5 (64bit), Max 7.0.6, Windows 10, Push 2, Korg electribe2, Bass Station II, Launch Control XL, Faderfox DJ3

M4L

broc
Posts: 1151
Joined: Mon Jul 26, 2004 8:37 am

Re: live.path and relative paths

Post by broc » Mon Nov 04, 2013 12:51 pm

Notice that the LOM doesn't list 'observe' access for highlighted_clip_slot, in contrast to the others.
So there is probably a technical reason for the difference.

Because789
Posts: 440
Joined: Thu Apr 28, 2011 1:26 pm

Re: live.path and relative paths

Post by Because789 » Mon Nov 04, 2013 1:17 pm

broc wrote:Notice that the LOM doesn't list 'observe' access for highlighted_clip_slot, in contrast to the others.
So there is probably a technical reason for the difference.
Interesting! It still seems a bit strange to me, but at least it doesn't look like a bug or lack of documentation anymore. Thanks broc!
Live 9.5 (64bit), Max 7.0.6, Windows 10, Push 2, Korg electribe2, Bass Station II, Launch Control XL, Faderfox DJ3

M4L

Myralfur
Posts: 114
Joined: Wed Feb 18, 2009 4:53 am
Location: London, England
Contact:

Re: live.path and relative paths

Post by Myralfur » Mon Nov 04, 2013 7:01 pm

yes, live.path's can do some handy observer type stuff! it is explained in the documentation and live.path help file, i seem to remember anyway. the left outlet of live path outputs the id of whatever object is currently at the path you send it. the middle outlet outputs the id of whatever object is currently at the path but then also keeps observing for any changes.

for instance if you use a live path to monitor the id of what track is the 1st track, or track 0. so you send live.path the message "path live_set tracks 0". if you then look at the output from the middle outlet you'll see the current id of the track at 0. then go to ableton and drag the first track to the right, making a different track move to being position 1, or 0. the output from the middle outlet of live.path will have changed to show the id of the track that has been dragged to position track 0. so you can effectively observe the id of a path.

live.observers are of course still very useful. you can't use live.path to get the value of a property, i.e observe the tempo of a live set. live.observers can also be used to observe the children of parts of the live set. so if you get the id for the live_set you can then send that id to the right inlet of live.observer and send it a message "property tracks". this will observe the ids of all tracks within the live set and output them as a list. to do this with a live.path you'd need to create loads of them and hope you never made more tracks than you had live.paths. with live.observers you just observe the child and get a list of varying length depending how many tracks there are.
Last edited by Myralfur on Mon Nov 04, 2013 8:48 pm, edited 3 times in total.

Myralfur
Posts: 114
Joined: Wed Feb 18, 2009 4:53 am
Location: London, England
Contact:

Re: live.path and relative paths

Post by Myralfur » Mon Nov 04, 2013 7:03 pm

also the highlighted clip slot only changes when the selected track and selected scene change... so i just observe the selected track and selected scene, as children of live_set view using a live.observer rather than live.path, and then send "get highlighted_clip_slot" to a live.object whenever either the selected_track or selected_scene change.

Myralfur
Posts: 114
Joined: Wed Feb 18, 2009 4:53 am
Location: London, England
Contact:

Re: live.path and relative paths

Post by Myralfur » Mon Nov 04, 2013 7:06 pm

also i still tend to shy away from using live.path objects where i can. probably not an issue any more but they used to be pretty damn slow to get an id, it was much quicker to use live.objects and live.observers and get all the ids as children of live_set.

so even in a lot of current patches, i get the id of the live_set or live_app from a live.path. every id after that i get from going through the live object model hierarchy getting the children of each object in the api.

Because789
Posts: 440
Joined: Thu Apr 28, 2011 1:26 pm

Re: live.path and relative paths

Post by Because789 » Mon Nov 04, 2013 7:39 pm

Thanks for all this usefull informations Myralfur!
Myralfur wrote:also the highlighted clip slot only changes when the selected track and selected scene change... .
I can't follow you here, "path live_set view highlighted_clip_slot" works just as the name suggests?!?

I never had the impression that live.path is slow, but I'm a noob and also never built a device which makes use of tons of live.path objects...
Live 9.5 (64bit), Max 7.0.6, Windows 10, Push 2, Korg electribe2, Bass Station II, Launch Control XL, Faderfox DJ3

M4L

Myralfur
Posts: 114
Joined: Wed Feb 18, 2009 4:53 am
Location: London, England
Contact:

Re: live.path and relative paths

Post by Myralfur » Mon Nov 04, 2013 9:05 pm

have a look at this, will hopefully show what i mean. a way of "observing" the highlighted_clip_slot, without being able to observe it, heh.

<pre><code>
----------begin_max5_patcher----------
999.3oc6YssahCCD84vWQTdlEEeI2121uiUqPgDuf6FRPwFZ2V0+802Bk1JL
tbwEVUUQSiia7YNyYlwi4oQAQy5dfvhB+d3OCCBdZTPfZH4.Al6ChVV9PUSI
SMsnVx8cytKZr9QbxCb0v8cq4jvEz4KZDe3j5oUMzUSYMc7g4JlQCgy+6Jhd
8hhFK9D9KyiWUxqVPamOsmTw0yHKMdR73PLVcAfKjWfha19OQqUqt.QeKIdX
g9cWKusboZYh9QOsrY3IsqWRaEfPYJvclNi9nZ5.nXI1NWMh0SVN3yiFI+03
yAUsgRt+3YlDXrlKTWRSrQL3hqMhYIgwJmSFV7U8DFokWxocs6XioHjzrPZS
c3Wasv2SZ1HrTj5EfRTWx0Bp78PX4WRBCbwHrDPlRGTbNHLiByMBK6Jmv9Xl
9PZmLSZGfUaO8Zy12SZGd3rvY6kPlU1NWl0Qc0AxwnKPXqYdvePtA7IkRVxM
MGH5JCnzAvTraQWCLpc1DDuSHKBNIwBahtEYyiiWFpu4Du.uQ3kGalzSlGRq
CiO9J+EZECRmQNEYM9CbirkHdXi7G6rhqZFckdrIxZeTS7kTzfNeTSCcCYh3
ARy7.InvlDTmix+C0.0rHHwJYhbXGlUcMc852c7jhbLBfk3KGTjFmqPZRbg3
O.6rDmPcSynrxMhVQzz2zRNumNSr4alwMX7CAQSWQ5YTFmzVoduwpwUNvSbm
Ga8iyIb6sGsOuJRu4dXx4yqZRd.PE11YCJ+FYmMlPDFoeCoOjQZD1qfgYUjV
xIz7oIAhlx.16wBkcsEA.+zh.9XdIdeY0eN8FgMdoDqGQ.J8KuzYoCIyIxXJ
0ljYMMRx+UMGh0kBA5rCIV6KFgtxM8WUcx9IR4PPHPqJRRrxIfaqpJ6twqii
UzGiPp0NkgesCJ+0UoI10dWkv7qstJ2WrqvPWDJUqSYjSSppylkkaK9Ehtkh
ekbyYoqxb3Ko11mjA3if3itOT0qSvJsu866QYzxweMGy5V2WMPUCeAKgufpZ
BiSaUsqryjjGGZHX6jVPqqIpmO.vZJqbVCodaRh24scEOxtNOHddCnuj3A6B
dj6FxS7iS3A6O9A5DdJ7m+B8JWwdvSt+7WPWvSl+vCvE8bge4mCpev9U+bMg
GrK5GfewyA0O4dCOxyn4v9Kj+vSpK3A5O+krT.zE8Cve34f5mT+hmCEeg7W9
42D5XI+rezOfBW3Gj+3GWpeA8G+.ycfef9qdJzI8C35R+.8W8BnK02AGq9Q2
NV4pUajGbh9cpfhn416zsHlNVcKsUeqpyundxF5v7wpQJ6E8rxEMrttW2v4C
4oQijqyyi9GdUBBQ
-----------end_max5_patcher-----------
</code></pre>

Myralfur
Posts: 114
Joined: Wed Feb 18, 2009 4:53 am
Location: London, England
Contact:

Re: live.path and relative paths

Post by Myralfur » Mon Nov 04, 2013 9:10 pm

if you look in ableton's session view the highlighted_clip_slot is the clip slot between the selected_track and selected_scene. the only way to change the highlighted_clip_slot is effectively by moving the selected_track or selected_scene (if you change the highlighted_clip_slot it also changes the selected_track and selected_scene.

so, to "observe" the highlighted_clip_slot you can observe the selected_track and selected_scene and whenever either of them changes get the highlighted_clip_slot.

Because789
Posts: 440
Joined: Thu Apr 28, 2011 1:26 pm

Re: live.path and relative paths

Post by Because789 » Mon Nov 04, 2013 9:34 pm

Ah, now I understand. It seems to me that the first live.object isn't necessary, "path live_set view" to a live.path should give you the same result, but otherwise this might be very useful under certain circumstances. Although I think I would avoid it as long as possible and just send a bang to the "get highlighted_clip_slot" message if possible...
Live 9.5 (64bit), Max 7.0.6, Windows 10, Push 2, Korg electribe2, Bass Station II, Launch Control XL, Faderfox DJ3

M4L

Myralfur
Posts: 114
Joined: Wed Feb 18, 2009 4:53 am
Location: London, England
Contact:

Re: live.path and relative paths

Post by Myralfur » Mon Nov 04, 2013 9:50 pm

i wrote it out in a slightly long, or verbose, way to show how you can get numerous ids using [live.object] and [live.observer] with only 1 [live.path] getting the parent id.

here's an example only using [live.path] objects:

<pre><code>
----------begin_max5_patcher----------
770.3oc2X90jaBBD.+YymBGeNMCfHp8s94nSmL9GZBWMXFgjKs2be2q.p0dM
wv0yvcSdHRDWVW9sKKK9zBuf75STQf+m8+pum2SK77zco5vq6dufcYmJpxDZ
wB1QEhrMzfklmIomj592mI25WwNRWKnR+iL5i9aYa1V09SRKWWTw1uVTUK6G
H+vNFuhJ0ZE0042q4RA6WTUePzJvejs9frWXXWu6anBJWlIY070MzBoYZ.Si
wsizOljnZ.cW7+V2vLZR9y8Ti7AACOpcNTrkw2LRaHTjVCQo5FDLV0.SFoPV
oF.04O7IXHJXzTgmsS+RB9RCKqJP8fmWrPcYokzlSerUu+CrUbdkh3mklvWC
MCsilI.fkzbY2uAQJpqpaLOErJMAGBwJcj.SIfDs1h.os+ANRsS3IHHj1gDo
8GfK4HBmWGwkB6Yk9v4Kj90Eap.nFEllDvjglPhyHB58hHHP5qgHwNiH32Mh
zupwz.wvoQRpSxeI8ye6YttHPxy3arKotILAgmLUBB3Jl3W81oBZ574HDPOa
woD6xmqg4xqFkY1dHxzDhVEMEPw2Q.sMI7M.nCo1sCnQyKPyOHk07IQ2bsTr
ehFZxUi.SuTjLywG4yW7wEczVy.LrKczUffi115LUzKnUsVca47hBJmdyKke
HYUHYVJk2rXBa3KLEM4Vgnj6rR4Gno0GL51UJemmH1lR4Qou+w6xlrhe3fit
Rlw38gzJcw6IjoO5J3t6nqjOHw6CdBqh2Cg14HzCtkm7W9AbzVfp++16HpOz
TzOWGNjrObvHJoBIiqw3XoTmIXjTaYkkTs.8dkRlHKuhpmBfyFoXsEop01Gb
MKR8UVFI0s0hH1XQp8jclEEaEi.N1htZbjZCUmYQXq7ZtjQQezrnWrJ5RwQg
Nzhra0OzgdsDq7ZoNjQPqVqE4PFkZkEgc7ZsquuFwg6qgsxhh+OsHSo.Y62e
j1H5Tp1XZKI6ASELjk5aYbys5BsBZnGY8xi08j0zV7hrsxkCMlxNNknNyc66
44E+Fj5T+qF
-----------end_max5_patcher-----------
</code></pre>

Myralfur
Posts: 114
Joined: Wed Feb 18, 2009 4:53 am
Location: London, England
Contact:

Re: live.path and relative paths

Post by Myralfur » Mon Nov 04, 2013 9:53 pm

here's 4 ways of "observing" the highlighted_clip_slot id. they all do the same thing, but with varying amounts of [live.path] objects.

the one you'd choose to use would depend on the rest of the programming.

<pre><code>
----------begin_max5_patcher----------
2218.3oc6b0sbZaDE9Z7SACW65Y+W6165E8onSGOBXKVoffAI63lL4cuRZWQ
DIgUGgEGAxdxXqXgPb1uy+emE806lLa91WsYyl96S+qoSl706lLo5TkmXh+u
mLaS7qKVGmUcYy1XyxhWYmcu60xsulWc9cw4OMccxK1Gyr4SeIw94oOkr5o0
E+jaW93h0I6dLa81752X5yaRRWayqtqL+I+mso4YIewVdNJ6Ax2u1sOmWewT
+Y2s2lYSyiyS1l93d6hb2xfZhDEuyoQJc4Ah+WS+a+aycmx+ucV20Oa1gWpX
Mr3ojzUMtaLlr5NHMUGXznxCTciaXxxJ.X67O8aTNaVikRZ7lpOjY+w9j30y
Jeguc2ck+5dfncp8yE22eBrKw4GJQ7eIZR6BZxgglZBAHZdu+mCWxhsq2t28
pjGLZAmJJuGZpQQzU2MIwT7enMtsAzDJFqRgHqzGjSoH38qh3Tl8IKmR6OS5
tYaVBfUPg6flDzzjpPCQXCEhvHltfHQngHhACQp8ZbGnBZXHwfR7q7oye6Qt
NIfLONcErf5NyDlHXnDFAKLY552NpvBGOmwHUqVgQAKddEXdeqVYtzCR2AN6
AYH.ULh.zhfvW..8PncX.preAz4OmmuMM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TUg5XP
72QTdZy9gGgq7zp9Bu7WbP8mhW9KtFp8LRxCj9SE3U+LGR+WB75emCI9Ch6z
DPaFGFd5KFn5CwCe.s0fPbuJwfv2KCu7WLPysDwcNEjsoDGO9vAIOm8dlzs4
fi2s6kxcwu6dVIJy1D+I2FZVce0elj59ypMP8r81WRpudQ0Yh2u3ojb6h7m2
61HxupUytq7y4a28+Pjx4yB
-----------end_max5_patcher-----------
</code></pre>

Because789
Posts: 440
Joined: Thu Apr 28, 2011 1:26 pm

Re: live.path and relative paths

Post by Because789 » Mon Nov 04, 2013 10:08 pm

Awesome, thanks Myralfur!
Live 9.5 (64bit), Max 7.0.6, Windows 10, Push 2, Korg electribe2, Bass Station II, Launch Control XL, Faderfox DJ3

M4L

Post Reply