Skip to content

Commit

Permalink
Merge pull request #198 from w3c/69-measure-number-text
Browse files Browse the repository at this point in the history
169: Add text attribute to measure element
  • Loading branch information
Michael Good committed Mar 31, 2017
2 parents 4181b83 + fffacca commit 3e668c0
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 7 deletions.
14 changes: 13 additions & 1 deletion schema/musicxml.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1766,6 +1766,15 @@ The other notehead covers noteheads other than those listed here. It is usually
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="measure-text">
<xs:annotation>
<xs:documentation>The measure-text type is used for the text attribute of measure elements. It has at least one character. The implicit attribute of the measure element should be set to "yes" rather than setting the text attribute to an empty string.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>

<!-- Attribute groups derived from common.mod elements -->

<xs:attributeGroup name="bend-sound">
Expand Down Expand Up @@ -2209,11 +2218,14 @@ The implicit attribute is set to "yes" for measures where the measure number sho

The non-controlling attribute is intended for use in multimetric music like the Don Giovanni minuet. If set to "yes", the left barline in this measure does not coincide with the left barline of measures in other parts. The value is "no" if not specified.

In partwise files, the number attribute should be the same for measures in different parts that share the same left barline. While the number attribute is often numeric, it does not have to be. Non-numeric values are typically used together with the implicit or non-controlling attributes being set to "yes". For a pickup measure, the number attribute is typically set to "0" and the implicit attribute is typically set to "yes". Further details about measure numbering can be defined using the measure-numbering element.
In partwise files, the number attribute should be the same for measures in different parts that share the same left barline. While the number attribute is often numeric, it does not have to be. Non-numeric values are typically used together with the implicit or non-controlling attributes being set to "yes". For a pickup measure, the number attribute is typically set to "0" and the implicit attribute is typically set to "yes".

If measure numbers are not unique within a part, this can cause problems for conversions between partwise and timewise formats. The text attribute allows specification of displayed measure numbers that are different than what is used in the number attribute. This attribute is ignored for measures where the implicit attribute is set to "yes". Further details about measure numbering can be specified using the measure-numbering element.

Measure width is specified in tenths. These are the global tenths specified in the scaling element, not local tenths as modified by the staff-size element. The width covers the entire measure from barline or system start to barline or system end.</xs:documentation>
</xs:annotation>
<xs:attribute name="number" type="xs:token" use="required"/>
<xs:attribute name="text" type="measure-text" use="required"/>
<xs:attribute name="implicit" type="yes-no"/>
<xs:attribute name="non-controlling" type="yes-no"/>
<xs:attribute name="width" type="tenths"/>
Expand Down
5 changes: 5 additions & 0 deletions schema/parttime.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@
<xsl:attribute name="number">
<xsl:value-of select="$measure-number"/>
</xsl:attribute>
<xsl:if test="@text">
<xsl:attribute name="text">
<xsl:value-of select="@text"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@implicit[. = 'yes']">
<xsl:attribute name="implicit">
<xsl:value-of select="@implicit"/>
Expand Down
16 changes: 13 additions & 3 deletions schema/score.mod
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,18 @@
together with the implicit or non-controlling attributes
being set to "yes". For a pickup measure, the number
attribute is typically set to "0" and the implicit attribute
is typically set to "yes". Further details about measure
numbering can be defined using the measure-numbering
element defined in the direction.mod file
is typically set to "yes".
If measure numbers are not unique within a part, this can
cause problems for conversions between partwise and timewise
formats. The text attribute allows specification of displayed
measure numbers that are different than what is used in the
number attribute. This attribute is ignored for measures
where the implicit attribute is set to "yes". The text
attribute for a measure element has at least one character.
Further details about measure numbering can be specified
using the measure-numbering element defined in the
direction.mod file.
Measure width is specified in tenths. These are the
global tenths specified in the scaling element, not
Expand All @@ -428,6 +437,7 @@
-->
<!ATTLIST measure
number CDATA #REQUIRED
text CDATA #IMPLIED
implicit %yes-no; #IMPLIED
non-controlling %yes-no; #IMPLIED
width %tenths; #IMPLIED
Expand Down
8 changes: 6 additions & 2 deletions schema/timepart.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@
<xsl:attribute name="number">
<xsl:value-of select="parent::measure/@number"/>
</xsl:attribute>
<xsl:if test="parent::measure/@text">
<xsl:attribute name="text">
<xsl:value-of select="parent::measure/@text"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="parent::measure/@implicit[. = 'yes']">
<xsl:attribute name="implicit">
<xsl:value-of select="parent::measure/@implicit"/>
Expand All @@ -157,8 +162,7 @@
</xsl:if>
<xsl:if test="parent::measure/@width">
<xsl:attribute name="width">
<xsl:value-of
select="parent::measure/@width"/>
<xsl:value-of select="parent::measure/@width"/>
</xsl:attribute>
</xsl:if>

Expand Down
6 changes: 5 additions & 1 deletion schema/to30.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
Remove time-only attribute from lyric element.
-->
<xsl:template
match="lyrics/@time-only"/>
match="lyric/@time-only"/>

<!--
Remove print-leger attribute from note element.
Expand Down Expand Up @@ -369,6 +369,10 @@
<xsl:template
match="credit-image/@height | credit-image/@width"/>

<!-- Remove new measure attributes -->
<xsl:template
match="measure/@text"/>

<!--
Convert score version attribute to 3.0
-->
Expand Down

0 comments on commit 3e668c0

Please sign in to comment.