<!-- ************************************************************** -->
<!--
NAME:     Music Encoding Initiative (MEI) DTD
          File      = mei17b.dtd (version 1.7b)
          Vers Date = 2006/09/01

NOTICE:   Copyright (c) 2001-2006 Perry Roland and the Rector and
          Visitors of the University of Virginia.

          Licensed under the Educational Community License version 1.0.

          This Original Work, including software, source code,
          documents, or other related items, is being provided by the
          copyright holder(s) subject to the terms of the Educational
          Community License. By obtaining, using and/or copying this
          Original Work, you agree that you have read, understand, and
          will comply with the following terms and conditions of the
          Educational Community License:

          Permission to use, copy, modify, merge, publish, distribute,
          and sublicense this Original Work and its documentation, with
          or without modification, for any purpose, and without fee or
          royalty to the copyright holder(s) is hereby granted, provided
          that you include the following on ALL copies of the Original
          Work or portions thereof, including modifications or
          derivatives, that you make:

          The full text of the Educational Community License in a
          location viewable to users of the redistributed or derivative
          work. 

          Any pre-existing intellectual property disclaimers, notices,
          or terms and conditions. 

          Notice of any changes or modifications to the Original Work,
          including the date the changes were made. 

          Any modifications of the Original Work must be distributed in
          such a manner as to avoid any confusion with the Original Work
          of the copyright holders.

          THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
          KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
          WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
          PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
          COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
          LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
          OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
          SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

          The name and trademarks of copyright holder(s) may NOT be used
          in advertising or publicity pertaining to the Original or
          Derivative Works without specific, written prior permission.
          Title to copyright in the Original Work and any associated
          documentation will at all times remain with the copyright
          holders.

PURPOSE:  This XML DTD is intended for document representation
          and exchange of western common music notation (CMN)
          as used between ca. 1700 - ca. 1935 although it may be
          extended to include music from both before and after
          this period. To paraphrase Gardner Read, the DTD should
          be used to record "modern notational practices, not
          visual representation of archaic or incorrect practices".
          If exact visual representation of non-standard music
          notation is required, digital images may be employed
          and related to the semantic information captured in the
          MEI file. Similarly, if a human performance is required,
          an external digital file should be related to, and
          perhaps synchronized with (via the timestamp attributes),
          the semantic information.

          In addition to music notation, this DTD provides the
          means to transcribe the additional text typically
          found in a critical or historical music edition. The DTD
          also facilitates the encoding of multiple versions of the
          musical work in a single file.        
          
AUTHOR:   Perry Roland
          pdr4h@virginia.edu
          University of Virginia
          Charlottesville, VA 22903

NOTE:     This is a beta version XML DTD. Comments and suggestions
          are welcome.

          This DTD was originally called the Music Description
          Language (MDL) DTD. However, since there is already
          an MDL music file format, calling this DTD the MEI
          will (hopefully) avoid confusion.

TO DO:    1. add generic ornament element?
          2. what is the relationship between meiChars.ent and
             chordtable and symboltable elements?
          3. incipits in head?  via annotation element?
          4. is there an editorial domain separate from the analytical?
          5. chironomic notation (neumes)?
          6. move scoredef attributes to score?  similarly, other *def
             elements?
          7. examine utility of scoredef element's attributes since they
             encode data that might be more appropriately recorded on
             individual staves.
          8. create fermata and/or lv control elements?
          9. create specialized dir element "spin-offs", such as fingering,
             segno, coda, fermata, caesura, etc.?
         10. allow midi element(s) within chord, note, or other events?
         11. allow accid within trill and turn in order to capture exact
             placement of accidentals?
         12. add beam.with and stem.with attributes in a.vis.chord and
             a.vis.note?

CHANGES:  1. relaxed the content model of score
          2. removed partdef and sectiondef elements; use scoredef instead
          3. re-worked the meiMensural and added meiScoreByStaff and
             meiMeasureByLayer entities; meiScoreByStaff allows score to
             directly contain staff elements while meiMeasureByLayer allows
             measure to contain only layer elements; these alternative
             content models allow greater encoding flexibility
          4. added instrdef sub-elements in staffgrp, staffdef and layerdef
             in order to account handle recording MIDI parameters in situations
             where a staffgrp, staff or layer employs multiple MIDI instruments
             or when a staffgrp contains multiple staves having the same
             MIDI parameters
          5. added midi.instrname to scoredef, staffdef, and layerdef elements'
             gestural domain attributes
          6. added 'long' to DURATION entity
          7. added circlex and cross to HEADSHAPE entity
          8. added beam.with and stem.with attributes to chord and note
             elements
          9. added beam.with to rest element
         10. added num and numbase to a.log.tuplet and a.log.tuplet2; also
             added num.format attribute to a.vis.tuplet and a.vis.tuplet2
         11. added dur.ges attribute to msrest and multirest elements
         12. made tstamp IMPLIED on all events and controlevents
         13. added def and num attributes to instr element
         14. added instr attribute to note, rest, msrest, and multirest
             elements to allow explicit assignment to an instrdef;
         15. added %a.xy attribute class, in which many elements now
             participate, and provided ho and vo attributes most anywhere
             a.xy is used; also the inverse (a.xy everywhere ho and vo are
             allowed)
         16. added dot.x, dot.y, dot.ho, and dot.vo attributes to events that
             can be dotted
         17. beam and slur attributes may now use 6 levels, up from 4
         18. added tuplet attribute with 6 levels
         19. added TAB to % CLEFSHAPE
         20. added % PITCHNAME.GES, with same values as % PITCHNAME plus
             'none', so that pname.ges attributes may explicitly indicate
             'no value'; this can be interpreted to mean that the note is not
             to be played more precisely than the lack of a gestural pitch name
         21. removed font style indications (bold and ital) from
             % TEXTRENDITION and created % FONTSTYLE and % FONTWEIGHT
         22. added music.name and music.size font attributes to visual domain
             attributes for scoredef
         23. added midi.div attribute everywhere other midi gestural attributes
             are allowed
         24. added start and end attributes to many controlevents
         25. added left x, y, ho, and vo and right x, y, ho, and vo attributes
             to a.vis.hairpin
         26. replaced acci.anl with acci.cautionary and acci.editorial in
             % a.anl.*
         27. added wordpos attribute to a.log.syl
         28. added rend attribute to % a.vis.syl
         29. added dbkey and reg attributes to corpname, geogname, and
             persname elements (via a.name entity)
         30. expanded content model of agent
         31. made tstamp attribute IMPLIED in % a.midi
         32. added def and num attributes to instr element
         33. applied Educational Community License
         34. created a.date, a.name, a.startendid, a.typography, and
             a.visualoffset attribute classes
         35. added bracket and brace attributes on staffdef
         36. added bracket and brace elements in staffgrp
         37. added harppedal element
         38. added %a.xy attributes to fwr
         39. added halign and valign attributes to rend
         40. added bezier attribute to bend, phrase, slur and
             tie elements
         41. made x1, y1, x2, y2 and bulge attributes on curve element
             #IMPLIED
         42. added lv, syl, and tuplet attributes to chord via
             % a.log.chord
         43. added instr to chord via % a.ges.chord
         44. removed altrender from % TEXTRENDITION
         45. modified beam element content model to allow nested
             beams                                                  -->
<!-- ************************************************************** -->


<!-- ************************************************************** -->
<!-- I. Preliminaries.                                              -->
<!-- ************************************************************** -->

<!-- ************************************************************** -->
<!-- A. Declare the document elements. The name of the document
elements, as well as the names of the header and music elements,
*cannot* be changed in order to assure an absolute minimum level of MEI
compliance. The version attribute contains the version of the DTD used
by the instance. Since either the mei or meicorpus elements can serve as
the document element, it is declared in both elements. -->

<!-- The document element for a single document contains a header
and data. -->
<!ELEMENT mei  (meihead, work)>
<!ATTLIST mei
          id                 ID                    #IMPLIED
          version            CDATA                 #FIXED '1.7b'>

<!-- The document element for a group of documents, each with its own
complete header, contains a header for the group, and one or more mei
elements. -->
<!ELEMENT meicorpus  (meihead, mei+)>
<!ATTLIST meicorpus
          id                 ID                    #IMPLIED
          version            CDATA                 #FIXED '1.7b'>


<!-- ************************************************************** -->
<!-- B. Declare and invoke local modifications; i.e., extensions or
restrictions, to MEI parameter entities. The entity is declared as an
empty string first, in case the user has no modifications and has not
declared it. In order to embed user modications, this entity must be
declared in the DTD internal subset with a path relative to the DTD,
e.g. <!ENTITY % meiModifications.ent SYSTEM '../myModifications/
ModificationsFile.ent'>.                                            -->
<!-- ************************************************************** -->
<!ENTITY % meiModifications.ent ''> %meiModifications.ent;

<!-- ************************************************************** -->
<!-- C. Declare and invoke entities for MEI generic identifiers.    -->
<!-- ************************************************************** -->
<!ENTITY % meiElementNames SYSTEM 'meiGIs.ent'> %meiElementNames;

<!-- ************************************************************** -->
<!-- D. Declare and invoke the MEI keywords file.                   -->
<!-- ************************************************************** -->
<!ENTITY % meiKeywords SYSTEM 'meiKey.ent'> %meiKeywords;

<!-- ************************************************************** -->
<!-- E. Declare and invoke the character entity declarations file.  -->
<!-- ************************************************************** -->
<!ENTITY % meiCharacters SYSTEM 'meiChars.ent'> %meiCharacters;

<!-- ************************************************************** -->
<!-- F. Declare and invoke the notation declarations file.          -->
<!-- ************************************************************** -->
<!ENTITY % meiNotations SYSTEM 'meiNotats.ent'> %meiNotations;

<!-- ************************************************************** -->
<!-- II. Declare shared attributes and content models.              -->
<!-- ************************************************************** -->
<!ENTITY % meiClasses SYSTEM 'meiClass.ent'> %meiClasses;

<!-- ************************************************************** -->
<!-- III. Embed the tag sets.                                       -->
<!-- ************************************************************** -->
<!-- A. Declare and invoke local element declarations. Doing this here
allows user modifications to use all the standard MEI element classes
and parameter entities. The entity is declared as an empty string first,
in case user has no mods and has not declared it. In order to embed user
modifications, this entity must be declared in the DTD internal subset
with a path relative to the DTD, i.e., <!ENTITY %
meiModifcations.dtd '../myModifications/ModificationsFile.dtd'>     -->
<!-- ************************************************************** -->
<!ENTITY % meiModifications.dtd ''> %meiModifications.dtd;

<!-- ************************************************************** -->
<!-- B. Include the individual tag sets                             -->
<!-- ************************************************************** -->

<!-- The stafforg content model allows pagebreak and/or systembreak
elements to precede or follow the other sub-elements. -->
<!ENTITY % meiMensural 'IGNORE'>
<![%meiMensural;[
   <!ENTITY % scoreorg '|(%n.staff;)*'>
   <!ENTITY % stafforg '((%m.events;|%n.layer;|%n.ligature;|%n.barline;|
                       %m.controlevents;|%m.primitives;)?, (%n.pb;|%n.sb;)?)*'>
   <!ENTITY % m.layerevents '(%m.events;|%n.ligature;)*'>
   <!ENTITY % measure    'IGNORE'>
   <!ENTITY % ossia      'IGNORE'>
   <!ENTITY % mrdg       'IGNORE'>
   <!ENTITY % msrest     'IGNORE'>
   <!ENTITY % msrpt      'IGNORE'>
   <!ENTITY % multirest  'IGNORE'>
   <!ENTITY % multirpt   'IGNORE'>
   <!ENTITY % barline    'INCLUDE'>
   <!ENTITY % ligature   'INCLUDE'>
]]>

<!ENTITY % meiMeasureByLayer 'IGNORE'>
<![%meiMeasureByLayer;[
   <!ENTITY % measureorg '(%n.layer;)*'>
]]>

<!ENTITY % meiMeasureByEvent 'IGNORE'>
<![%meiMeasureByEvent;[
  <!ENTITY % measureorg '(%m.events;|%n.msrest;|%n.msrpt;|%n.multirest;|%n.multirpt;)*'>
  <!-- original declaration
  <!ENTITY % measureorg '(%m.events;|%n.layer;|%n.msrest;|%n.msrpt;|%n.multirest;|%n.multirpt;)*'>
  -->
]]>

<!-- The stafforg content model allows pagebreak and/or systembreak
elements to precede or follow the other sub-elements. -->
<!ENTITY % meiScoreByStaff 'IGNORE'>
<![%meiScoreByStaff;[
   <!ENTITY % scoreorg '|(%n.staff;)*'>
   <!ENTITY % stafforg '((%n.measure;)?, (%n.pb;|%n.sb;)?)*'>
   <!ENTITY % measureorg '(%m.events;)*|(%n.layer;)*|(%n.msrest;|%n.msrpt;|%n.multirest;|%n.multirpt;)?'>
]]>

<!-- If neither meiMensural, meiMeasureByLayer, meiMeasureByEvent nor
meiScoreByStaff entities are INCLUDEd, then the following declarations
are used. The scoreorg content model allows pagebreak and/or systembreak
elements to precede or follow the other sub-elements. -->
<!ENTITY % scoreorg   '|((%n.measure;)?, (%n.pb;|%n.sb;)?)*'>
<!ENTITY % measureorg '(%n.staff;)*'>
<!ENTITY % stafforg   '(%m.events;)*|(%n.layer;)*|(%n.msrest;|%n.msrpt;|%n.multirest;|%n.multirpt;)?'>

<!-- The following declarations are used in all cases except when meiMensural is INCLUDEd. -->
<!ENTITY % m.layerevents '(%m.events;)*|(%n.msrest;|%n.msrpt;|%n.multirest;|%n.multirpt;)?'>
<!ENTITY % barline  'IGNORE'>
<!ENTITY % ligature 'IGNORE'>

<!-- The app tag, its rdg sub-elements, and the mrdg element are turned
off by default. To activate them, the meiCrit entity must be set to
INCLUDE in the internal DTD subset or in the meiModifications.ent file.
The mrdg element is IGNORED when meiMensural is set to INCLUDE. -->
<!ENTITY % meiCrit 'IGNORE'>
<![%meiCrit;[
   <!ENTITY % apparatus    '|(%n.app;)*'>
   <!ENTITY % apparatusm   '|(%n.mrdg;, (%n.mrdg;)+)'>
   <!ENTITY % app  'INCLUDE'>
   <!ENTITY % mrdg 'INCLUDE'>
   <!ENTITY % rdg  'INCLUDE'>
]]>
<!-- Unless meiCrit is INCLUDEd, the following declarations are used. -->
<!ENTITY % apparatus  ''>
<!ENTITY % apparatusm ''>
<!ENTITY % app  'IGNORE'>
<!ENTITY % mrdg 'IGNORE'>
<!ENTITY % rdg  'IGNORE'>

<!-- ************************************************************** -->
<!-- B1. Include meiShared tagset.                                  -->
<!-- ************************************************************** -->
<!ENTITY % meiShared SYSTEM 'meiShared.dtd'> %meiShared;

<!-- ************************************************************** -->
<!-- B2. Include meiHead tagset.                                    -->
<!-- ************************************************************** -->
<!ENTITY % meiHead SYSTEM 'meiHead.dtd'> %meiHead;

<!-- ************************************************************** -->
<!-- B3. Include meiBase tagset.                                    -->
<!-- ************************************************************** -->
<!ENTITY % meiBase SYSTEM 'meiBase.dtd'> %meiBase;

<!-- ************************************************************** -->
<!-- B4. Include the meiMeas tagset.                                -->
<!-- ************************************************************** -->
<!ENTITY % meiMeas SYSTEM 'meiMeas.dtd'> %meiMeas;

<!-- ************************************************************** -->
<!-- B5. Include the meiMIDI tagset.                                -->
<!-- ************************************************************** -->
<!ENTITY % meiMIDI SYSTEM 'meiMIDI.dtd'> %meiMIDI;

<!-- ************************************************************** -->
<!-- B6. Include the meiText tagset.                                -->
<!-- ************************************************************** -->
<!ENTITY % meiText SYSTEM 'meiText.dtd'> %meiText;

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