[PD-dev] PD patches in XML
Georg Holzmann
grhPD at gmx.at
Tue Dec 14 12:07:43 CET 2004
Hallo!
> i think this inherits a bit the weaknesses of pd's standard format.
> which is: mixing up functionality (object-name), modifiers (arguments)
> and graphical representation (position).
yep!
> i would rather seperate them as much as possible, something like
>
> <canvas>
> <gui xpos="828" ypos="549" height="450" width="341">
> <obj ID="obj1">
> f
> <args>2</args>
> <gui xpos="49" ypos="134">
> </obj>
> <obj ID="obj2">
> trigger
> <args>float float</args>
> <gui xpos="49" ypos="134" bgcolor="#FF00FF">
> </obj>
> </canvas>
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.).
> as with pd-0.38, objects that pd's not able to create still connect (i
> guess with some wild hack that tracks the highest number of connected
> outlets of an object)
good to know ...
> this could also be done simply by giving meta-information such as
> <obj ID="obj10" inlets="1" outlets="4">foo</obj>
> well i am not at all into XML (so i do not know which restrictions you
> can put into a validator) but i guess this syntax is very prone for
> things like
> <connect>
> <outlet ID="obj1">0</outlet>
> <outlet ID="obj2">1</outlet>
> </connect>
> how could you avoid this ? (connecting 2 outlets)
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 ?
> 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.
> people that are writing patches in a text-editor could choose whatever
> ID they like (but have to make sure, that it is unique)
This way, i think, it's really much easier to write patches in a text
editor.
> <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 ?
LG
Georg
More information about the Pd-dev
mailing list