[CM] Plotters (was something else)

Tobias Kunze Briseņo t@fictive.com
Thu, 23 Oct 2003 22:39:07 +0200

> I hopefully have some time soon (after I finish the piece...)
> and might get into doing it properly.

Speaking of 'properly': it appears to me as if a truly 'proper'
solution (i.e. not a niche solution) would involve at a minimum
three steps:

  1) Addition of a generic-format export/import facility to cm.
  2) Specification of each particular mapping from cm structure
     to this generic format.
  3) Definition of translators to transform generic-format data
     into whatever client format is desired.

In graphic terms:
                 (2)                     :
               mapping                   +----> client format 1
                  :                      |
                  :                      +----> client format 2
  cm structure <-----> generic format <--+
                 (1)                     |      ...
                                         +----> client format n

That way, instead of just Xfig a virtually countless number of
client formats could be supported with minimal overhead.  e.g.
output to and from Gnuplot data files, R, Xfig, OpenOffice, HTML,
etc. would be equally easy.  Moreover, elaborate mapping
specifications involving object IDs could form the basis of true,
"in-place" editing (i.e. editing cm structure in place as opposed
to replacing structure with the result of a full re-import).

In my mind and this being 2003, i think the clear choice of
technologies on which to base this process on is XML with its
various ancillary formats.  Yes, XML is a wasteful format, but it
is designed to be generic, strict, and universally supported,
both in terms of tools and by applications, all of which by far
outweigh the (after all nicely compressible) mass of data.  Also,
XML has been designed with server pipelining in mind, so with
some attention to well-ordering it can even pass as a wire
format.  Finally, an increasing number of applications support or
flat out use XML file I/O (e.g. OpenOffice).

In XML land, the above process would look like this:
                 DTD                     +----> client format 1
                  :                      |
                  :                      +----> client format 2
  cm structure <-----------> XML <-------+
                                         |      ...
                                         +----> client format n

cm would map structure to and from XML according to specific
DTDs.  E.g. there would be a MIDI DTD, a Csound DTD, and so
forth.  Based on these DTDs, XSL translators would then map to
and from each client format.