[PD-dev] PD patches in XML

Martin Peach martinrp at vax2.concordia.ca
Fri Dec 10 18:12:57 CET 2004


Mathieu Bouchard wrote:

> On Thu, 9 Dec 2004, Martin Peach wrote:
> 
>>Mathieu Bouchard wrote:
>>
>>>problem is that object ID's change too often, because if an object is
>>>deleted, its ID is not skipped, and a bunch of objects are renumbered just
>>>so that the ID is not skipped, because there is no way in the format to
>>>skip one. I think this has to be solved in the pd internals first, in the
>>>runtime storage of a patch, because it's where the renumbering (or the
>>>ignoring of numbering) normally happens.

When an object is deleted, maybe it could be replaced with a null 
object? At the moment if I insert a line like:
#X obj;
pd crashes (on Windows at least). I think pd could be made more robust 
at the same time by using null objects as placeholders.

>>
>>This might be a good time to introduce the Globally Unique Identifer, 
>>perhaps in the form of a 32-bit random number that is generated for each 
>>object in a patch and never reused -- the running pd program would 
>>maintain a list of all GUIDs in use in the current session.
> 
> 
> Well, I was thinking of something along the lines of a locally unique
> identifier, whose scope is exactly one patcher, because the problem with
> changing indices happens exactly at the patcher level. I don't know what
> GUID's would bring at this point. I can't think of any nice way of
> introducing GUID's easily in the .pd format except by making each object
> two lines of code instead of one. What do you have in mind?

Well actually three levels of ID:
Lowest level are LUIDs, but in the sense of a GUID: a locally unique 
identifier for each object in a patcher, e.g. 0x00000001 (sequential) or 
0x132FA32B (pseudorandom).
LUIDs would need an extra field in the .pd format line, (maybe use 
#X12345678 instead of #X) so it's not backwards compatible (maybe after 
the semicolon(?)).
The proposed XML format is easily extensible because parsers would just 
ignore tags they don't recognize.
Another LUID could identify each patcher, so objects in one patcher 
could target objects in another. (#N9ABCDEF0 instead of #N ?)
Finally a GUID would be reserved for 'published' objects that were 
registered,  say at the pd-iem site or sourceforge, so that a patcher 
would always use the correct objects even (the nightmare scenario ;() if 
every pd object had the same name.

Martin





> 
> _____________________________________________________________________
> Mathieu Bouchard -=- Montréal QC Canada -=- http://artengine.ca/matju
> 
> 
> 





More information about the Pd-dev mailing list