<!-- ************************************************************** -->
<!--
NAME:     Music Encoding Initiative (MEI) DTD
          File      = meiMIDI.dtd 
          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.  See
          mei17b.dtd for License details.

PURPOSE:  This file contains declarations for MEI MIDI elements. It
          is invoked by the mei.dtd driver file.                    -->
<!-- ************************************************************** -->

<!-- ************************************************************** -->
<!-- Shared attributes                                              -->
<!-- ************************************************************** -->

<!-- Attributes common to MIDI events. The corresp attribute may point
to logical events, i.e., notes, rests, etc., to which the MIDI event is
analogous. If a single value is supplied for the corresp attribute, then
the tstamp attribute can be implied from the tstamp of the element
pointed to. -->
<!ENTITY % a.midi    'corresp           IDREFS                #IMPLIED
                     tstamp             CDATA                 #IMPLIED'>

<!-- Container for a collection of elements which contain information
useful when generating MIDI output. The type attribute can be used to
differentiate between multiple MIDI data streams, e.g.
quantized/unquantized, straight/swing, ornamented/as notated, etc. -->
<!ENTITY % midi 'INCLUDE'>
<![%midi;[
<!ELEMENT %n.midi;  (%m.midievents;)*>
<!ATTLIST %n.midi;
          meiform            CDATA                 #FIXED 'midi'
          %a.common;
          %a.log.midi;
          %a.vis.midi;
          %a.ges.midi;
          %a.anl.midi;>
]]>

<!-- Parameter/control change. n attribute specifies parameter number,
val contains the parameter value. Each must fall in the range 0-127.
A sampling of controllers and their numbers
(Values fall in the range 0-127 unless otherwise noted):
0   Bank Select MSB
1   Modulation 
2   Breath Control
5   Portamento Time
7   Main Volume
10  Pan
11  Expression
32  Bank Select LSB
64  Sustain Pedal (0=up, 127=down)
65  Portamento Pedal (0=off, 127=on)
91  Reverb
93  Chorus Depth
120 All Sounds Off (0)
121 Reset All Controllers (0)
123 All Notes Off (0) -->
<!ENTITY % cc 'INCLUDE'>
<![%cc;[
<!ELEMENT %n.cc;  EMPTY>
<!ATTLIST %n.cc;
          meiform            CDATA                 #FIXED 'cc'
          %a.midi;
          %a.common;
          n                  %MIDIVALUE;           #REQUIRED
          val                %MIDIVALUE;           #REQUIRED>
]]>

<!-- Channel assignment -->
<!ENTITY % chan 'INCLUDE'>
<![%chan;[
<!ELEMENT %n.chan;  EMPTY>
<!ATTLIST %n.chan;
          meiform            CDATA                 #FIXED 'chan'
          %a.common;
          %a.midi;
          n                  %MIDICHANNEL;         #REQUIRED>
]]>

<!-- Channel pressure/after touch. The n attribute must be in the
range 0-127. -->
<!ENTITY % chanpr 'INCLUDE'>
<![%chanpr;[
<!ELEMENT %n.chanpr;  EMPTY>
<!ATTLIST %n.chanpr;
          meiform            CDATA                 #FIXED 'chanpr'
          %a.common;
          %a.midi;
          n                  %MIDIVALUE;           #REQUIRED>
]]>

<!-- Cue point -->
<!ENTITY % cue 'INCLUDE'>
<![%cue;[
<!ELEMENT %n.cue;  (#PCDATA)>
<!ATTLIST %n.cue;
          meiform            CDATA                 #FIXED 'cue'
          %a.common;
          %a.midi;>
]]>

<!-- Arbitrary MIDI data in hex -->
<!ENTITY % hex 'INCLUDE'>
<![%hex;[
<!ELEMENT %n.hex;  (#PCDATA)>
<!ATTLIST %n.hex;
          meiform            CDATA                 #FIXED 'hex'
          %a.common;
          %a.midi;>
]]>

<!-- MIDI instrument number and name. The instrument number must be
provided in the num attribute, while the instrument name may be given as
the content of the element.  The def attribute is provided for those
circumstances where the MIDI instrument is declared in an instrdef
element and a pointer to that location is needed.  It is a semantic
error if one of these attributes is not present. The instrument name,
however, is completely optional. -->
<!ENTITY % instr 'INCLUDE'>
<![%instr;[
<!ELEMENT %n.instr;  (#PCDATA)>
<!ATTLIST %n.instr;
          meiform            CDATA                 #FIXED 'instr'
          %a.common;
          %a.midi;
          def                IDREF                 #IMPLIED
          num                %MIDIVALUE;           #IMPLIED>
]]>

<!-- Marker meta event-->
<!ENTITY % marker 'INCLUDE'>
<![%marker;[
<!ELEMENT %n.marker;  (#PCDATA)>
<!ATTLIST %n.marker;
          meiform            CDATA                 #FIXED 'marker'
          %a.common;
          %a.midi;>
]]>

<!-- Text meta event -->
<!ENTITY % metatext 'INCLUDE'>
<![%metatext;[
<!ELEMENT %n.metatext;  (#PCDATA)>
<!ATTLIST %n.metatext;
          meiform            CDATA                 #FIXED 'metatext'
          %a.common;
          %a.midi;>
]]>

<!-- Note-off -->
<!ENTITY % noteoff 'INCLUDE'>
<![%noteoff;[
<!ELEMENT %n.noteoff;  EMPTY>
<!ATTLIST %n.noteoff;
          meiform            CDATA                 #FIXED 'noteoff'
          %a.common;
          %a.midi;
          n                  %MIDIVALUE;           #REQUIRED>
]]>

<!-- Note-on -->
<!ENTITY % noteon 'INCLUDE'>
<![%noteon;[
<!ELEMENT %n.noteon;  EMPTY>
<!ATTLIST %n.noteon;
          meiform            CDATA                 #FIXED 'noteon'
          %a.common;
          %a.midi;
          n                  %MIDIVALUE;           #REQUIRED>
]]>

<!-- MIDI port. The n attribute must be in the range 0-127. -->
<!ENTITY % port 'INCLUDE'>
<![%port;[
<!ELEMENT %n.port;  EMPTY>
<!ATTLIST %n.port;
          meiform            CDATA                 #FIXED 'port'
          %a.common;
          %a.midi;
          n                  %MIDIVALUE;           #REQUIRED>
]]>

<!-- Program change/new instrument. The n attribute must be in the
range 0-127. -->
<!ENTITY % prog 'INCLUDE'>
<![%prog;[
<!ELEMENT %n.prog;  EMPTY>
<!ATTLIST %n.prog;
          meiform            CDATA                 #FIXED 'prog'
          %a.common;
          %a.midi;
          n                  %MIDIVALUE;           #REQUIRED>
]]>

<!-- Sequence number. The n attribute must be in the range 0-65535 -->
<!ENTITY % seqnum 'INCLUDE'>
<![%seqnum;[
<!ELEMENT %n.seqnum;  EMPTY>
<!ATTLIST %n.seqnum;
          meiform            CDATA                 #FIXED 'seqnum'
          %a.common;
          %a.midi;
          n                  %INTEGER;             #REQUIRED>
]]>

<!-- Track/sequence name -->
<!ENTITY % trkname 'INCLUDE'>
<![%trkname;[
<!ELEMENT %n.trkname;  (#PCDATA)>
<!ATTLIST %n.trkname;
          meiform            CDATA                 #FIXED 'trkname'
          %a.common;
          %a.midi;>
]]>

<!-- Note-on/off velocity. For on velocity, the attribute must be in
the range 1-127. For off velocity, the n attribute must be in the range
0-127. -->
<!ENTITY % vel 'INCLUDE'>
<![%vel;[
<!ELEMENT %n.vel;  EMPTY>
<!ATTLIST %n.vel;
          meiform            CDATA                 #FIXED 'vel'
          %a.common;
          %a.midi;
          form               (on|off)              #REQUIRED
          n                  CDATA                 #REQUIRED>
]]>

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