[PD-dev] PD patches in XML

Johannes M Zmoelnig zmoelnig at iem.at
Tue Dec 14 11:48:56 CET 2004

Georg Holzmann wrote:
> Hallo!
> okay, maybe it's clearer to use a own tag for all the gui properties. So 
> we can also easy expand these GUI-descriptions (e.g. for IEM-GUIs etc.).

yes that was the idea;
and probably we will have more elaborate gui-features for normal objects 
in the future too. (just imaging how good a resizable [matrix~ 24 24] 
would be...)

> in the parsing of the XML-file only outlet tags get connected to inlet 
> tags?
> of course it could also be something like this:
> <connect from="obj1" outlet="0" to="obj2" inlet="1"/>
> But in this case it's more difficult to connect one outlet to multiple 
> inlets.
> e.g.:
> <connect>
>   <outlet ID="obj1">0</outlet>
>   <inlet ID="obj2">1</inlet>
>   <inlet ID="obj5">0</inlet>
> </connect>
> But do we need that ?

actually it is not a bad idea, but... (see below)

>> it is not clear from your example (because it is short), but:
>>  object-identifiers ("ID") should be unique identifiers, at least 
>> within the scope of a (canvas-) tag.
>> ID's should be able to be chosen arbitrarily, so this would be a valid 
>> patch:
> I also thought in that way.

i know, but it seemed to be not that clear

>> <obj ID="foo">print</obj>
>> <msg ID="bar">
>>  bang
>>  <connect n="0">
>>   <inlet ID="foo" n="0">
>>   <gui color="red">comment</gui>
>>  </connect>
>> </msg>
> Maybe this (and also to top down approach) should be possible 
> additionally to the normal connect tag?
> But doesn't it get to complicated ?

now (after thinking and reading your mail) i know what is wrong with the 
top-down approach: it encourages to connect one outlet to multiple 
inlets, which is, in most cases, the big bag of bugs.

1) top-down is bad because it is bug-prone
2) a singular <connect> tag is bad, because a connection cannot exist 
without the object it connects, which would not be reflected by 
standalone <connect> tags. i think that the current implementation of 
standalone #connect-lines is just because of the flat structure of the 
pd-fileformat. if we go for a hierarchic model (like XML) this could be 
handled better.
3) bottom-up is good, because it highlights the multiplexion that is 
going to happen if multiple outlets are connected to one inlets. with 
signal-objects it reinforces the fact, that signals are being added 
within the inlet~.

i do not think that this is too complicated:

<nbx ID="nbx1"/>
<obj ID="obj1">print
   <from ID="nbx1"/>

is the very simplest case where we assume the "default" in/outlet to be 

i don't like the one-liner like
<connect from="obj1" outlet="0" to="obj2" inlet="1"/>
although the naming of arguments is of course far better than my 
"outlet" and "n".
<connect inlet="3">
  <from ID="obj1" outlet="1">
  <from ID="obj2" outlet="0">
looks somewhat ok to me (although i am not sure whether it is bad style 
to have an "ID"-argument that is a reference rather than the id of the 

and this reminds me, that probably connections really should have an id, 
so you could e.g. delete them directly (like "dyn")


More information about the Pd-dev mailing list