Topic: Proposal Standardized Choreography File Language

Building choreographies is a pain in the butt, and it seems to me there would be value in being able to take other choreographies that you have developed yourself or from shared ones, and either edit them or use them as building blocks for a longer, more complex choreography. 

Folks writing applications code could each have their own syntax (including just the stings that the Violet API uses), but if different apps use different syntax, than people using different apps can't share. 

So, is there interest in a standard, structured choreography file syntax?  If so, I propose the following as a starting point for discussion:
Guidelines:

1) each file has all the information needed for a full choreography
2) it's easy to strip off the "header" type info like chortitle and tempo, leaving chunks to easily cut and past into other choreographies
3) It's easy to understand
4) It's flexible, will be able to adopt relatively easily to future changes, and is well-structured

Draft recommendation:
XML-based file structure, along these lines (sort of an XML pseudo-code follows):

<?xml version="1.0"?>
< !-- Root element is always

Last edited by ViennaMike (2007-10-11 20:14:15)

Re: Proposal Standardized Choreography File Language

Looks nice at first glance.
A few comments:
<action>s shouldn't they be numbered with serials? Or better with names that could be referenced later?
For <ear> and <rotation> it would IMHO be better to have keywords like left, right, front, back to make it easier to build choreographies without having to remember which value represents which direction.

By giving names to <actions> one could define "positions" and reference them by name without having to write down the whole action again. So one could have a <play> section like
<play>
  <step action="name1">
  <step action="name2">
  <step action="name1">
  <step action="name3">
</play>
that would actually do the dancing smile

Last edited by Maex (2007-12-31 03:07:58)

Re: Proposal Standardized Choreography File Language

O.K., a couple of months later and I'm thinking about improving the "build choreography" functionality I have in my NCP (Nabaztag Control Panel) application, and also having the new version available as a stand-alone application to make it easy to build, save, and resend choreographies.  I figure I'll save files as easily human-readable and editable xml files, a "Choreography Markup Language", similar to what I first laid out.  Others could write their own API code that could read, write, and edit the same types of files. 

I like Maex's idea of going with tag names like "ear," "left," "right," "front," and "back," rather than tag names like "motor" and "0" or "1" for ear and direction, as this will make it easier for people to understand and use, and it's easy for the software to translate it back to the codes that the API uses. 

I'm not sure about naming each action, especially since as defined, each action includes the time at which it executes.

I'd like feedback on another idea for simplification.  Rather than specifying the RGB values, just supporting a small set of colors.  I"m not sure anyone gets into specifying specific shades or red or green, for example, when using the Nabaztag.  So, rather than:

        <led>
            <light>whichLight</light>
            <red>value</red>
            <green>value</green>
            <blue>value</blue>
        </led>

where the value for red, green, and blue can range from 0-256, I'd have:

     <led>
          <light>whichLight></light>
          <color>colorName</color>
     </led>

The Choreography Markup Language would support the following colors: White, Red, Green, Blue, Yellow, Purple, Orange, and OFF (RGB value of 0,0,0). 
This trades off the flexibility of having theoretically millions of color values with the ease and simplicity for generating and editing choreographies.  What do people think?

Re: Proposal Standardized Choreography File Language

ViennaMike wrote:

I'd like feedback on another idea for simplification.  Rather than specifying the RGB values, just supporting a small set of colors.  I"m not sure anyone gets into specifying specific shades or red or green, for example, when using the Nabaztag.

The X Window System (the window system used on Unix based systems) has a file that's called "rgb.txt". It is kinda alias database for naming colors. The format of the file ist like that:
255 250 250             snow
248 248 255             ghost white
248 248 255             GhostWhite
245 245 245             white smoke
245 245 245             WhiteSmoke
220 220 220             gainsboro
[ ... ]
173 216 230             LightBlue
176 224 230             powder blue
176 224 230             PowderBlue
175 238 238             pale turquoise
[ ... ]
255  20 147             DeepPink
255 192 203             pink
255 182 193             light pink

You get the idea.

How about a
<colordef name="orange" red="255" green="165" blue="0" />
that would allow people to define their own color names that could be used in <color>orange</color> tags and have the ones you mentioned in your posting as predefined names?
The names should be case insenstitive of course. Should one make the assertion they're not allowed to contain whitespace? Or silently strip all whitespace in the def and references (IMHO not tooo good an idea - it will lead to "strange" problems by other software smile
This would have the advantage that one could provide a definitions file (like the above mentioned rgb.txt) and define the color names in other languages. Maybe one could even make that part of the colordef tag like in
<colordef name="red" red="255" green="0" blue="0" language="en" />
<colordef name="rouge" red="255" green="0" blue="0" language="fr" />
<colordef name="rot" red="255" green="0" blue="0" language="de" />
This could even make it easier to translate software depending on it, as one would only have to provide a colordef file in the appropriate language (or even multilingual and the software would only pick the ones with e.g. language="fr").

One could even make the tags shorter by using HTML/CSS values like
<colordef name="red" value="ff0000" language="en" />
IMHO most people are used to using the hex values for the colors ...

\Maex