device id lost if the set crashes?

Feb 28, 2013 at 1:25pm

device id lost if the set crashes?

Hi,

Im working on a device that requires it to record its own device id and save this into pattr. This works fine when the set is saved, but if the set crashes, upon reloading the crashed set, the device ids change.

I also notice as the device ids are created they normally go up in increments e.g. 98,99,100,101 etc. However, mine seem to be going up by up to 200 or more each e.g. 192, 392, 592 etc.

When the set crashes and is reloaded the 192,392,592, will end up being 98,99,100 etc

I would be really grateful to know why this might happen if anyone has seen this behaviour before?

The following code displays my problem:

– Pasted Max Patch, click to expand. –
#66768
Feb 28, 2013 at 1:58pm

no worries, i think i found the culprit, im using mu for lemur in my set and it seems to be creating a bucketload of device ids :(

#240310
Feb 28, 2013 at 3:03pm

I’m glad you worked this out, but in general, you should either be using the persistent ID feature, or referencing LOM objects by path. The order of ID assignment when a Live set loads is indeterminate and IDs are considered volatile unless you are using the persistent ID feature.

#240311
Feb 28, 2013 at 3:28pm

thanks jeremy its seems correct, if i load the above device in a crashed set, the ids change.

Is there any chance you could explain how to use the persistent ID feature? There seems little information on the forums about this.

Do i have to find the path first and then query live.object to find the persistent id?

#240312
Feb 28, 2013 at 3:37pm

Nope, you just need to flip the “Use Persistent Mapping” switch. In fact, we flip it by default for you.

Here's the info from the refpage:

Persistence
The live.object object has a special entry in its inspector labelled “Use Persistent Mapping”. This setting, when enabled, causes the id associated with the object to persist when the Live document is saved and restored, and when the Max Device is moved between the Live application and the Max editor, or within the Live Set. Beginning in Live 8.2.2, Live API ids remain persistent between launches of Live, which in conjunction with the Persistence feature of live.object , live.observer and live.remote~ , makes it possible to create simpler devices which retain their association with elements in the Live user interface.

[attachment=216108,5082]

Attachments:
  1. Bildschirmfoto20130228um16.23.33.png
#240313
Feb 28, 2013 at 4:59pm

I think there might be a small bug in the persistent id feature, when live crashes, it gives the first device in the set a new id, all the other ids seem to be correct.

Here is the code I used to determine this.

– Pasted Max Patch, click to expand. –
#240314
Feb 28, 2013 at 9:30pm

Thanks, we’ve ticketed this for further investigation.

#240315

You must be logged in to reply to this topic.