Skip to content

Commit

Permalink
Merge pull request #177 from w3c/68-grace-cue
Browse files Browse the repository at this point in the history
68: Add grace cue notes
  • Loading branch information
Michael Good committed Feb 23, 2017
2 parents 4155067 + ae06a0f commit 925a70b
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 21 deletions.
7 changes: 3 additions & 4 deletions schema/common.mod
Expand Up @@ -101,11 +101,10 @@
<!ENTITY % yes-no-number "NMTOKEN">

<!--
The symbol-size entity is used to indicate full vs.
cue-sized vs. oversized symbols. The large value
for oversized symbols was added in version 1.1.
The symbol-size entity is used to distinguish between
full, cue sized, grace cue sized, and oversized symbols.
-->
<!ENTITY % symbol-size "(full | cue | large)">
<!ENTITY % symbol-size "(full | cue | grace-cue | large)">

<!--
The above-below type is used to indicate whether one
Expand Down
19 changes: 10 additions & 9 deletions schema/layout.mod
Expand Up @@ -184,14 +184,15 @@

The note-size element indicates the percentage of the
regular note size to use for notes with a cue and large
size as defined in the type element. The grace type is
used for notes of cue size that that include a grace
element. The cue type is used for all other notes with
cue size, whether defined explicitly or implicitly via a
cue element. The large type is used for notes of large
size. The text content represent the numeric percentage.
A value of 100 would be identical to the size of a regular
note as defined by the music font.
size as defined in the type element. The grace-cue type
is used for notes of grace-cue size. The grace type is
used for notes of cue size that include a grace element.
The cue type is used for all other notes with cue size,
whether defined explicitly or implicitly via a cue element.
The large type is used for notes of large size. The text
content represent the numeric percentage. A value of 100
would be identical to the size of a regular note as defined
by the music font.

The distance element represents standard distances between
notation elements in tenths. The type attribute defines what
Expand Down Expand Up @@ -243,7 +244,7 @@
>
<!ELEMENT note-size (#PCDATA)>
<!ATTLIST note-size
type (cue | grace | large) #REQUIRED
type (cue | grace | grace-cue | large) #REQUIRED
>
<!ELEMENT distance %layout-tenths;>
<!ATTLIST distance
Expand Down
20 changes: 15 additions & 5 deletions schema/musicxml.xsd
Expand Up @@ -433,11 +433,12 @@ The values of start, stop, and continue refer to how an element appears in music

<xs:simpleType name="symbol-size">
<xs:annotation>
<xs:documentation>The symbol-size type is used to indicate full vs. cue-sized vs. oversized symbols. The large value for oversized symbols was added in version 1.1.</xs:documentation>
<xs:documentation>The symbol-size type is used to distinguish between full, cue sized, grace cue sized, and oversized symbols.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:enumeration value="full"/>
<xs:enumeration value="cue"/>
<xs:enumeration value="grace-cue"/>
<xs:enumeration value="large"/>
</xs:restriction>
</xs:simpleType>
Expand Down Expand Up @@ -1291,11 +1292,12 @@ A quarter-rest type specifies the glyph to use when a note has a rest element an

<xs:simpleType name="note-size-type">
<xs:annotation>
<xs:documentation>The note-size-type type indicates the type of note being defined by a note-size element. The grace type is used for notes of cue size that that include a grace element. The cue type is used for all other notes with cue size, whether defined explicitly or implicitly via a cue element. The large type is used for notes of large size.</xs:documentation>
<xs:documentation>The note-size-type type indicates the type of note being defined by a note-size element. The grace-cue type is used for notes of grace-cue size. The grace type is used for notes of cue size that include a grace element. The cue type is used for all other notes with cue size, whether defined explicitly or implicitly via a cue element. The large type is used for notes of large size.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:enumeration value="cue"/>
<xs:enumeration value="grace"/>
<xs:enumeration value="grace-cue"/>
<xs:enumeration value="large"/>
</xs:restriction>
</xs:simpleType>
Expand Down Expand Up @@ -4516,8 +4518,16 @@ The pizzicato attribute is used when just this note is sounded pizzicato, vs. th
<xs:choice>
<xs:sequence>
<xs:element name="grace" type="grace"/>
<xs:group ref="full-note"/>
<xs:element name="tie" type="tie" minOccurs="0" maxOccurs="2"/>
<xs:choice>
<xs:sequence>
<xs:group ref="full-note"/>
<xs:element name="tie" type="tie" minOccurs="0" maxOccurs="2"/>
</xs:sequence>
<xs:sequence>
<xs:element name="cue" type="empty"/>
<xs:group ref="full-note"/>
</xs:sequence>
</xs:choice>
</xs:sequence>
<xs:sequence>
<xs:element name="cue" type="empty">
Expand Down Expand Up @@ -4568,7 +4578,7 @@ The pizzicato attribute is used when just this note is sounded pizzicato, vs. th

<xs:complexType name="note-type">
<xs:annotation>
<xs:documentation>The note-type type indicates the graphic note type. Values range from 1024th to maxima. The size attribute indicates full, cue, or large size, with full the default for regular notes and cue the default for cue and grace notes.</xs:documentation>
<xs:documentation>The note-type type indicates the graphic note type. Values range from 1024th to maxima. The size attribute indicates full, cue, grace-cue, or large size. The default is full for regular notes, grace-cue for notes that contain both grace and cue elements, and cue for notes that contain either a cue or a grace element, but not both.</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="note-type-value">
Expand Down
8 changes: 5 additions & 3 deletions schema/note.mod
Expand Up @@ -50,7 +50,7 @@
readily than the other.
-->
<!ELEMENT note
(((grace, %full-note;, (tie, tie?)?) |
(((grace, ((%full-note;, (tie, tie?)?) | (cue, %full-note;))) |
(cue, %full-note;, duration) |
(%full-note;, duration, (tie, tie?)?)),
instrument?, %editorial-voice;, type?, dot*,
Expand Down Expand Up @@ -209,8 +209,10 @@
shortest to longest) are 1024th, 512th, 256th, 128th,
64th, 32nd, 16th, eighth, quarter, half, whole, breve,
long, and maxima. The size attribute indicates full, cue,
or large size, with full the default for regular notes and
cue the default for cue and grace notes.
grace-cue, or large size. The default is full for regular
notes, grace-cue for notes that contain both grace and cue
elements, and cue for notes that contain either a cue or a
grace element, but not both.
-->
<!ELEMENT type (#PCDATA)>
<!ATTLIST type
Expand Down
25 changes: 25 additions & 0 deletions schema/to30.xsl
Expand Up @@ -51,6 +51,15 @@

<!-- Additions in note.mod -->

<!--
Earlier versions of MusicXML allow notes to have a
grace or cue element, but not both. Remove any cue
element that is not the first child element of a
note element.
-->
<xsl:template
match="note/cue[position() > 1]"/>

<!-- Remove new MusicXML 3.1 elements -->
<xsl:template
match="inverted-vertical-turn | haydn | soft-accent"/>
Expand Down Expand Up @@ -113,6 +122,16 @@
/></xsl:copy>
</xsl:template>

<!--
Convert grace-cue sizes to grace size. This is consistent
with our removal of the cue element from notes that
contain both grace and cue elements.
-->
<xsl:template
match="@size[. = 'grace-cue']">
<xsl:attribute name="size">grace</xsl:attribute>
</xsl:template>

<!-- Additions in attributes.mod -->

<!-- Remove new id attributes -->
Expand Down Expand Up @@ -296,6 +315,12 @@
<xsl:template
match="glyph"/>

<!--
Remove note-size element with a grace-cue type.
-->
<xsl:template
match="note-size[@type = 'grace-cue']"/>

<!-- Additions in score.mod -->

<!-- Remove credit-symbol elements -->
Expand Down

0 comments on commit 925a70b

Please sign in to comment.