How to get track number from inside the track.

May 10, 2011 at 3:23pm

How to get track number from inside the track.

I have many tracks with the same max4live device in them. I need to know for each device the id of the proper track. Each device must send the number of his track to a message “path live_set tracks $1″. Does exist a message witch give the number of the track where it belong? For example: can I ask to live.path something like “this track?” and receive back the track number?
I need it to build a device that can be placed in every tracks but it must knows the number of its track.
Could anybody help me?
thx in advance..

#57039
May 10, 2011 at 5:16pm

You can use ‘path this_device’ to figure out the track that the device is on. Here is one way to do it:

– Pasted Max Patch, click to expand. –
#204409
May 10, 2011 at 6:11pm

Thanks a lot ! I was looking for the same thing…

Is there a place where we can find all the attributes, messages and other needed informations for the API objects ?
A sort of thesaurus or are the LOM reference page and M4L tutorials the only ones ?
For example, in another thread, I was asking something related to midi channel of a live track. The secret (thanks to broc for the answer) was the “Ch.” to put in the message box. I can’t find it in the two pages mentioned above.

#204410
May 10, 2011 at 6:33pm

Everything should be in either the LOM ref or the individual object ref entries. In Max, just go to Help->Max For Live. You can get to all the objects under Reference->Objects A-Z.

Let us know if you aren’t finding what you are looking for.

-Ben

#204411
May 10, 2011 at 7:38pm

Thanks for your answer.

Here is what I can not find : the upper part of the patch. How is it possible to know that “prepend Ch.” was needed. (particularly Ch.)

[attachment=161939,2233]

Attachments:
  1. Screenshot20110510at21.35.33.png
#204412
May 10, 2011 at 8:18pm

This will just depend on what the available routings are. I believe that “Ch.” convention is used for midi channel input/output, as it appears in the channel strip.

-Ben

#204413
May 11, 2011 at 12:30am

Thanks you very much. I’m not lucky today: live.object: get path: error calculating the path. This is the error that the live.object in your patch gives to me and I can’t understand the why.

#204414
May 11, 2011 at 12:38am

The problem was that my device was inside a drum rack. If I put it outside it works.

#204415
May 11, 2011 at 3:11pm

The easiest solution for your problem is the “this_device” root object (as mentioned above) but in comparison with the “canonical_parent” path. This child will always point to the previous (parent) class in the hierarchy.

So when looking at the LOM you’ll notice that the parent of a device is a track.

As such simply use: “path this_device canonical_parent” which will point at the track the device is on.

As you noticed yourself things change when you’re inside a rack; that’s because the physical location of the device is now no longer the track, but instead a Chain within the rack.

To get out of a chain you could use: “path this_device canonical_parent canonical_parent canonical_parent”. You actually need 3 “hops”: one to go to the Chain class, one to go to the Device class (the Rack device itself) and finally one to go to the Track class.

To answer your other question… Stuff like “canonical_parent” is explained in the Live API overview.

#204416
Dec 21, 2012 at 12:43pm

Great thanks for this – I am working on a similar problem.

#204417
Mar 15, 2014 at 11:11pm

Is it possible to do this with live.observer?

#283989

You must be logged in to reply to this topic.