[Cache from http://grigaitis.net/xscore; please use this canonical/official version if possible.]

eXtensible Score Language (XScore) 0.01

Draft: 1998-12-15

Author: R. J. Grigaitis (rj@grigaitis.net)

Abstract

The eXtensible Score Language (XScore) is an application of the eXtensible Markup Language (XML) for describing musical scores and capturing both their structure and content. Its goal is to provide a standard and generic way to store and transfer musical scores.

This document is a complete description of XScore and its document type definition (DTD) with the exception of information that is found in other documents. An attempt was made to direct the reader to all necessary information found outside this document.

XScore is an application of a standard recommended by the World Wide Web Consortium [www.w3c.org], the eXtensible Markup Language (XML) 1.0 REC-xml-19980210, and can be found at: www.w3c.org/TR/REC-xml.

Status of this document

This is a working draft and may change at any time. R. J. Grigaitis may eventually write a simple Java applet to display scores in web pages. Then again, maybe he won't. It would be nice if all musical software companies were to use the same format, and this could be the beginning of that format.

A style sheet language must also be developed to fully make use of the extensibility of XScore. At least two style sheet languages must be created. One to describe how to print a score, and the other to convert the score in to MIDI. The MIDI style sheet language would actually be the easier of the two.

Copyright

The original idea, and therefor the copyright, of the eXtensible Score Language (XScore) belongs to R. J. Grigaitis. Any person or company is here by given permission to use it with the condition that a copy of all software using this technology is given to R. J. Grigaitis for his personal use.

Introduction

The eXtensible Score Language, abbreviated XScore, describes Musical Scores. XScore is an application of the eXtensible Markup Language (XML) [www.w3c.org/TR/REC-xml]. An XScore document is a valid XML document [www.w3.org/TR/REC-xml#dt-valid] that has the XScore document type definition (DTD) declared in its document type declaration.

<!DOCTYPE xscore SYSTEM "xscore.dtd">

Opening Comments

<!--****************************************************************************

Status:         Draft
Version:        0.01
Description:    This is the DTD for the eXtensible Score Language (XScore).
                This DTD conforms with XML 1.0
                This is a work in progress, subject to change at any time.
Creation Date:  1998-12-04
Author:         R. J. Grigaitis (rj@grigaitis.net)

Revisions:
    Date:       1998-12-15
    Version:    0.01
    Author:     R. J. Grigaitis
    Changes:    - made file public

*****************************************************************************-->

The comments at the beginning of the DTD are a simple way to identify the propose, origin, and version of this file.

<!ENTITY    lt              "&#38;#60;">
<!ENTITY    gt              "&#62;">
<!ENTITY    amp             "&#38;#38;">
<!ENTITY    apos            "&#39;">
<!ENTITY    quot            "&#34;">

For interoperability [www.w3.org/TR/REC-xml#dt-interop], the XList DTD declares these internal entities [www.w3.org/TR/REC-xml#sec-predefined-ent].

<!ELEMENT    xscore         (title*,composer*,reference*,staff*)>
<!ATTLIST    xscore         score       (pianoforte|open|short)  "short"
                            copyright   CDATA       #IMPLIED>

The xscore element is the root element and may contain any number of titles, composers, references, and staffs, in this order. The only attributes this element has are the type of score and text for the copyright. The copyright can be omitted.

The score attribute can have a value of pianoforte, open, or short. An organ, and orchestral score can be represented by an open score; however, the pianoforte is specific to indicate a brace connecting the staffs.

<!ELEMENT    title          (#PCDATA)*>
<!ELEMENT    composer       (#PCDATA)*>
<!ELEMENT    reference      (#PCDATA)*>

The title, composer, and reference elements simply contain text data.

<!ELEMENT    staff          (bar*)>
<!ATTLIST    staff          instrument  CDATA       #IMPLIED>

One staff element will be created for each staff needed in the score. The instrument can be named for orchestral scores or any other reason.

<!ELEMENT    bar            (clef|key|time|tempo|voice)*>

At any time in a bar you can change the clef, key, time signature, tempo, and voice. The voice does not have to be continuous for the whole bar. If a clef, key, time, or tempo changes the voices are reordered starting at the first one found. Voices that share a staff must always be in order. Simple software may only use the first voice.

<!ATTLIST    bar            id          ID          #IMPLIED

This is used by the repeat-ref attributes.

                            text        CDATA       #IMPLIED

This is any text needed for the repeats, such as ending numbers.

                            repeat      (repeat|fine|dal-segno|da-capo|coda|bis|bar|ending)   #IMPLIED
                            repeat-ref  IDREF       #IMPLIED>

These tell us what type of repeat it is, and where it repeats to.

<!ELEMENT    clef           EMPTY>
<!ATTLIST    clef           clef        (treble|alto|tenor|bass)    "treble">

This lets us know what cleft to use.

<!ELEMENT    key            EMPTY>
<!ATTLIST    key            flat-sharp  (-7|-6|-5|-4|-3|-2|-1|0|1|2|3|4|5|6|7)  #IMPLIED
                            key         (Cf|Gf|Df|Af|Ef|Bf|F|C|G|D|A|E|B|Fs|Cs|
                                        Afm|Efm|Bfm|Fm|Cm|Gm|Dm|Am|Em|Bm|Fsm|Csm|Gsm|Dsm|Asm)   #IMPLIED>

The key signature can be given in two ways, the number of sharps or flats and the name of the key. For 0 in the number of sharps and flats the key would be C, -1 would be F, and 1 would be G. For the name of the key, the minor can also be given: Bfm would be B flat minor.

<!ELEMENT    time           EMPTY>
<!ATTLIST    time           beats       (1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|
                                        17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)   #IMPLIED
                            note        (1|2|4|8|16|32|64|128)  #IMPLIED>

The beats tells you how many beats are in the bar and the note tells you what kind of note gets one beat. The maximum time signature is 31/128 time. I don't think there will be any need to go beyond this. If no beats and note are given common time is assumed. If beats is set to 2 and no note is given cut time is assumed.

<!ELEMENT    tempo          (#PCDATA)*>
<!ATTLIST    tempo          note        (1|2|4|8|16|32|64|128)  #IMPLIED
                            bpm         CDATA       #IMPLIED>

Tempo can be given in two ways, a word or beats per minutes. Note is the type of note that gets one beat, and bpm is the beats per minute.

<!ELEMENT    voice          (c|n|r)*>

The voice element is used to allow more then one voice on a staff. It can contain chords, notes, or a rests.

<!ENTITY   % attr-notation  "id         ID          #IMPLIED

Common attributes used with chords, notes, and rests are grouped together in this entity. The id attribute is used for any of the IDREF attributes.

                            text        CDATA       #IMPLIED

This is for any text that should appear above the note.

                            d           (1|2|4|8|16|32|64|128)  #IMPLIED
                            dots        (1|2|3)     #IMPLIED

Duration is used so much only d will be used. The dots attribute in combination with the d attribute will give the duration of the note.

                            accent      (accent|attack|staccato|staccatissimo|mezzo-staccato|
                                        tenuto|grace|fermata|lunga-pausa)   #IMPLIED

This is for any accent markings on the note.

                            dynamics    (ppppp|pppp|ppp|pp|p|mp|mf|f|ff|fff|ffff|fffff|sfz) #IMPLIED

This is for any dynamic markings

                            hairpin     (crescendo|diminuendo)  #IMPLIED
                            hairpin-ref IDREF       #IMPLIED

These are for any crescendos or diminuendos. The hairpin-ref will show the end of the hairpin.

                            muliplet    IDREF       #IMPLIED

This simply points to the last note and signifies the first note of any muliplet. The software will calculate what type of muliplet it is.

                            octave-up   IDREF       #IMPLIED
                            octave-down IDREF       #IMPLIED
                            con-octave  IDREF       #IMPLIED

This simply points to the last note and signifies the first note of playing above or below an octave, or playing in octaves.

                            phrase      IDREF       #IMPLIED

This points to the last note and signifies the first note of a phrase.

                            tie-slur    IDREF       #IMPLIED

This points to the last note and signifies the first note of a tie or a slur.

                            bow         (up|down)   #IMPLIED
                            pedal       IDREF       #IMPLIED
                            ped-text    CDATA       #IMPLIED">

These are markings for specific instruments.

<!ELEMENT    c              (note*)>
<!ATTLIST    c              %attr-notation;
                            arpeggio    (true)      #IMPLIED>

A chord is common so only one letter is used, c. It is a collection of notes that one voice will play. The only attribute is arpeggio which will always be true if defined, else it is assumed false.

<!ELEMENT    n              (guitar?,word*)>
<!ATTLIST    n              %attr-notation;

The note element will be so common only an n will be used. A note can also contain a guitar chord a number of words, one for each verse.

                            p           CDATA       #IMPLIED

For most notes a pitch will be given, so only p is used for an element name. To facilitate easy transposition the notation for this element will be based on the last key signature. First will be the number 1, 2, 3, 4, 5, 6, or 7 to signify which note in the key is used. Optionally a + or - sign will follow to signify sharp or flat. By default the octave will be the middle one, such as middle C. To change this the letter O or o followed by a positive or negative number will signify the octave.

                            repeated    (8|16|32)   #IMPLIED

A repeated note is one with one, two, or three hash marks through the stem, and signifies 8th, 16th, or 32nd notes are played in the duration of the note. This is mainly used in percussion music.

                            glissando   IDREF       #IMPLIED

This points to the last note and signifies the first of a glissando.

                            trill       (true)      #IMPLIED

This signifies a trill. No not define if a trill is not desired.

                            repeat      (bar|figure)    #IMPLIED>

This signifies a repetition of a bar or a figure within a bar.

<!ELEMENT    word           (#PCDATA)*>
<!ATTLIST    word           broken      (true)      #IMPLIED>

This is simply a word that is sung with a particular note. If the word is broken between more then one note, place the parts of the word in different word elements and set the broken on all but the last one. This so a dash can be placed between the syllables.

<!ELEMENT    r              (guitar?)>
<!ATTLIST    r              %attr-notation;
                            bars        CDATA       #IMPLIED>

The rest element will be so common only an r will be used. A rest can also contain a guitar chord as these may change while the melody is quiet. The bars attribute is for bar rests, and simply gives the number of bars to rest for. For example, a 12 bar rest.

<!ELEMENT guitar            (#PCDATA)*>
<!ATTLIST guitar            E           (0|1|2|3|4|5|6|7|8|9|10|11|12)  #IMPLIED
                            A           (0|1|2|3|4|5|6|7|8|9|10|11|12)  #IMPLIED
                            D           (0|1|2|3|4|5|6|7|8|9|10|11|12)  #IMPLIED
                            G           (0|1|2|3|4|5|6|7|8|9|10|11|12)  #IMPLIED
                            B           (0|1|2|3|4|5|6|7|8|9|10|11|12)  #IMPLIED
                            H           (0|1|2|3|4|5|6|7|8|9|10|11|12)  #IMPLIED>

Much music has guitar chords written in; therefore we have the guitar element. The element should contain some text to describe the chord and may also contain attributes describing how to play the chord. If any attributes are used a chord diagram will be created. Any attributes not used will signify an unplayed string.

H stands for high E.

An example of an E chord: E chord

<guitar E="0" A="2" D="2" G="1" B="0" H="0">E<guitar>

A short example of the language:

Music

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xscore SYSTEM "xscore.dtd">

<xscore>
    <title>"C" Arpeggio</title>
    <composer>R. J. Grigaitis</composer>
    <staff>
        <bar>
            <clef clef="treble"/>
            <key key="C"/>
            <time beats="4" note="4"/>
            <voice>
                <n p="1" d="4"/>
                <n p="3" d="4"/>
                <n p="5" d="4"/>
                <n p="1o1" d="4"/>
            </voice>
        </bar>
    </staff>
</xscore>
        

Document Type Definition

Download: xscore.dtd

<!--****************************************************************************

Status:         Draft
Version:        0.01
Description:    This is the DTD for the eXtensible Score Language (XScore).
                This DTD conforms with XML 1.0
                This is a work in progress, subject to change at any time.
Creation Date:  1998-12-04
Author:         R. J. Grigaitis (rj@grigaitis.net)

Revisions:
    Date:       1998-12-15
    Version:    0.01
    Author:     R. J. Grigaitis
    Changes:    - made file public

*****************************************************************************-->


<!ENTITY    lt              "&#38;#60;">
<!ENTITY    gt              "&#62;">
<!ENTITY    amp             "&#38;#38;">
<!ENTITY    apos            "&#39;">
<!ENTITY    quot            "&#34;">

<!ELEMENT    xscore         (title*,composer*,reference*,staff*)>
<!ATTLIST    xscore         score       (pianoforte|open|short)  "short"
                            copyright   CDATA       #IMPLIED>

<!ELEMENT    title          (#PCDATA)*>
<!ELEMENT    composer       (#PCDATA)*>
<!ELEMENT    reference      (#PCDATA)*>

<!ELEMENT    staff          (bar*)>
<!ATTLIST    staff          instrument  CDATA       #IMPLIED>

<!ELEMENT    bar            (clef|key|time|tempo|voice)*>
<!ATTLIST    bar            id          ID          #IMPLIED
                            text        CDATA       #IMPLIED
                            repeat      (repeat|fine|dal-segno|da-capo|coda|bis|bar|ending)   #IMPLIED
                            repeat-ref  IDREF       #IMPLIED>

<!ELEMENT    clef           EMPTY>
<!ATTLIST    clef           clef        (treble|alto|tenor|bass)    "treble">

<!ELEMENT    key            EMPTY>
<!ATTLIST    key            flat-sharp  (-7|-6|-5|-4|-3|-2|-1|0|1|2|3|4|5|6|7)  #IMPLIED
                            key         (Cf|Gf|Df|Af|Ef|Bf|F|C|G|D|A|E|B|Fs|Cs|
                                        Afm|Efm|Bfm|Fm|Cm|Gm|Dm|Am|Em|Bm|Fsm|Csm|Gsm|Dsm|Asm)   #IMPLIED>

<!ELEMENT    time           EMPTY>
<!ATTLIST    time           beats       (1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|
                                        17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)   #IMPLIED
                            note        (1|2|4|8|16|32|64|128)  #IMPLIED>

<!ELEMENT    tempo          (#PCDATA)*>
<!ATTLIST    tempo          note        (1|2|4|8|16|32|64|128)  #IMPLIED
                            bpm         CDATA       #IMPLIED>

<!ELEMENT    voice          (c|n|r)*>

<!ENTITY   % attr-notation  "id         ID          #IMPLIED
                            text        CDATA       #IMPLIED
                            d           (1|2|4|8|16|32|64|128)  #IMPLIED
                            dots        (1|2|3)     #IMPLIED
                            accent      (accent|attack|staccato|staccatissimo|mezzo-staccato|
                                        tenuto|grace|fermata|lunga-pausa)   #IMPLIED
                            dynamics    (ppppp|pppp|ppp|pp|p|mp|mf|f|ff|fff|ffff|fffff|sfz) #IMPLIED
                            hairpin     (crescendo|diminuendo)  #IMPLIED
                            hairpin-ref IDREF       #IMPLIED
                            muliplet    IDREF       #IMPLIED
                            octave-up   IDREF       #IMPLIED
                            octave-down IDREF       #IMPLIED
                            con-octave  IDREF       #IMPLIED
                            phrase      IDREF       #IMPLIED
                            tie-slur    IDREF       #IMPLIED
                            bow         (up|down)   #IMPLIED
                            pedal       IDREF       #IMPLIED
                            ped-text    CDATA       #IMPLIED">

<!ELEMENT    c              (note*)>
<!ATTLIST    c              %attr-notation;
                            arpeggio    (true)      #IMPLIED>

<!ELEMENT    n              (guitar?,word*)>
<!ATTLIST    n              %attr-notation;
                            p           CDATA       #IMPLIED
                            repeated    (8|16|32)   #IMPLIED
                            glissando   IDREF       #IMPLIED
                            trill       (true)      #IMPLIED
                            repeat      (bar|figure)    #IMPLIED>

<!ELEMENT    word           (#PCDATA)*>
<!ATTLIST    word           broken      (true)      #IMPLIED>

<!ELEMENT    r              (guitar?)>
<!ATTLIST    r              %attr-notation;
                            bars        CDATA       #IMPLIED>

<!ELEMENT guitar            (#PCDATA)*>
<!ATTLIST guitar            E           (0|1|2|3|4|5|6|7|8|9|10|11|12)  #IMPLIED
                            A           (0|1|2|3|4|5|6|7|8|9|10|11|12)  #IMPLIED
                            D           (0|1|2|3|4|5|6|7|8|9|10|11|12)  #IMPLIED
                            G           (0|1|2|3|4|5|6|7|8|9|10|11|12)  #IMPLIED
                            B           (0|1|2|3|4|5|6|7|8|9|10|11|12)  #IMPLIED
                            H           (0|1|2|3|4|5|6|7|8|9|10|11|12)  #IMPLIED>
        

Addendum to XScore 0.01 (2000-06-19)

The next version of XScore will correct the following shortcomings:


Valid HTML 4.0! Valid CSS!

R. J. Grigaitis
www.grigaitis.net