<clef>

Indication of the exact location of a particular note on the staff and, therefore, the other notes as well.
Module
Attributes
@cautionary, @color, @dis, @dis.place, @enclose, @fontfam, @fontname, @fontsize, @fontstyle, @fontweight, @glyph.auth, @glyph.name, @glyph.num, @glyph.uri, @ho, @label, @layer, @letterspacing, @line, @lineheight, @oct, @shape, @staff, @type, @vo, @xml:id
@cautionary(optional)Records the function of the clef. A "cautionary" clef does not change the following pitches. Value conforms to data.BOOLEAN.
@color(optional)Used to indicate visual appearance. Do not confuse this with the musical term 'color' as used in pre-CMN notation. Value conforms to data.COLOR.
@dis(optional)Records the amount of octave displacement. Value conforms to data.OCTAVE.DIS.
@dis.place(optional)Records the direction of octave displacement. Value conforms to data.STAFFREL.basic.
@enclose(optional)Records the characters often used to mark accidentals, articulations, and sometimes notes as having a cautionary or editorial function. For an example of cautionary accidentals enclosed in parentheses, see Read, p. 131, ex. 9-14. Value conforms to data.ENCLOSURE.
@fontfam(optional)Contains the name of a font-family. Value conforms to data.FONTFAMILY.
@fontname(optional)Holds the name of a font. Value conforms to data.FONTNAME.
@fontsize(optional)Indicates the size of a font expressed in printers' points, i.e., 1/72nd of an inch, relative terms, e.g., small, larger, etc., or percentage values relative to normal size, e.g., 125%. Value conforms to data.FONTSIZE.
@fontstyle(optional)Records the style of a font, i.e., italic, oblique, or normal. Value conforms to data.FONTSTYLE.
@fontweight(optional)Used to indicate bold type. Value conforms to data.FONTWEIGHT.
@glyph.auth(optional)A name or label associated with the controlled vocabulary from which the value of @glyph.name or @glyph.num is taken, or the textual content of the element. Suggested values are: "smufl" (Standard Music Font Layout.). Other values conform to XML Schema NMTOKEN datatype.
@glyph.name(optional)Glyph name. Value conforms to XML Schema string datatype.
@glyph.num(optional)Numeric glyph reference in hexadecimal notation, e.g., "#xE000" or "U+E000". N.B. SMuFL version 1.18 uses the range U+E000 - U+ECBF. Value conforms to data.HEXNUM.
@glyph.uri(optional)The web-accessible location of the controlled vocabulary from which the value of @glyph.name or @glyph.num is taken, or the textual content of the element. Value conforms to data.URI.
@ho(optional)Records a horizontal adjustment to a feature’s programmatically-determined location in terms of staff interline distance; that is, in units of 1/2 the distance between adjacent staff lines. Value conforms to data.MEASUREMENTSIGNED.
@label(optional)Captures text to be used to generate a label for the element to which it’s attached, a "tool tip" or prefatory text, for example. Should not be used to record document content. Value conforms to XML Schema string datatype.
@layer(optional)Identifies the layer to which a feature applies. Value conforms to 1 or more space-separated values of XML Schema positiveInteger datatype.
@letterspacing(optional)Indicates letter spacing (aka tracking) in analogy to the CSS letter-spacing property. Value conforms to data.MEASUREMENTTYPOGRAPHYSIGNED.
@line(optional)Indicates the line upon which a feature stands. The value must be in the range between 1 and the number of lines on the staff. The numbering of lines starts with the lowest line of the staff. Value conforms to data.CLEFLINE.
@lineheight(optional)Indicates line height in analogy to the CSS line-height property. Value conforms to data.LINEHEIGHT.
@oct(optional)Captures written octave information. Value conforms to data.OCTAVE.
@shape(optional)Describes a clef’s shape. Value conforms to data.CLEFSHAPE.
@staff(optional)Signifies the staff on which a notated event occurs or to which a control event applies. Mandatory when applicable. Value conforms to 1 or more space-separated values of XML Schema positiveInteger datatype.
@type(optional)Designation which characterizes the element in some sense, using any convenient classification scheme or typology that employs single-token labels. Value conforms to 1 or more space-separated values of XML Schema NMTOKEN datatype.
@vo(optional)Records the vertical adjustment of a feature’s programmatically-determined location in terms of staff interline distance; that is, in units of 1/2 the distance between adjacent staff lines. Value conforms to data.MEASUREMENTSIGNED.
@xml:id(optional)Regularizes the naming of an element and thus facilitates building links between it and other resources. Each id attribute within a document must have a unique value. Value conforms to XML Schema ID datatype.
(MEI.shared) Attributes common to many elements.
(MEI.shared) Attributes that uniquely identify an element.
@xml:id(optional)Regularizes the naming of an element and thus facilitates building links between it and other resources. Each id attribute within a document must have a unique value. Value conforms to XML Schema ID datatype.
(MEI.shared)
@label(optional)Captures text to be used to generate a label for the element to which it’s attached, a "tool tip" or prefatory text, for example. Should not be used to record document content. Value conforms to XML Schema string datatype.
(MEI.shared) Attributes which can be used to classify features.
@type(optional)Designation which characterizes the element in some sense, using any convenient classification scheme or typology that employs single-token labels. Value conforms to 1 or more space-separated values of XML Schema NMTOKEN datatype.
(MEI.shared) Attributes that apply to all written events, e.g., note, chord, rest, etc.
(MEI.shared) Attributes that identify the layer to which a feature applies.
@layer(optional)Identifies the layer to which a feature applies. Value conforms to 1 or more space-separated values of XML Schema positiveInteger datatype.
(MEI.shared) Attributes for identifying the staff or staff group associated with the current feature.
@staff(optional)Signifies the staff on which a notated event occurs or to which a control event applies. Mandatory when applicable. Value conforms to 1 or more space-separated values of XML Schema positiveInteger datatype.
(MEI.shared) Logical domain attributes.
@cautionary(optional)Records the function of the clef. A "cautionary" clef does not change the following pitches. Value conforms to data.BOOLEAN.
(MEI.shared) Attributes that record the shape of a clef.
@shape(optional)Describes a clef’s shape. Value conforms to data.CLEFSHAPE.
(MEI.shared) Attributes for identifying the staff line with which a feature is associated.
@line(optional)Indicates the line upon which a feature stands. The value must be in the range between 1 and the number of lines on the staff. The numbering of lines starts with the lowest line of the staff. Value conforms to data.CLEFLINE.
(MEI.shared) Attributes that record written octave.
@oct(optional)Captures written octave information. Value conforms to data.OCTAVE.
(MEI.shared) Attributes describing the amount and direction of octave displacement.
@dis(optional)Records the amount of octave displacement. Value conforms to data.OCTAVE.DIS.
@dis.place(optional)Records the direction of octave displacement. Value conforms to data.STAFFREL.basic.
(MEI.visual) Visual domain attributes.
(MEI.shared) Visual color attributes.
@color(optional)Used to indicate visual appearance. Do not confuse this with the musical term 'color' as used in pre-CMN notation. Value conforms to data.COLOR.
(MEI.shared) Attributes that capture characters used to enclose symbols having a cautionary or editorial function.
@enclose(optional)Records the characters often used to mark accidentals, articulations, and sometimes notes as having a cautionary or editorial function. For an example of cautionary accidentals enclosed in parentheses, see Read, p. 131, ex. 9-14. Value conforms to data.ENCLOSURE.
(MEI.externalsymbols) Attributes used to associate MEI features with corresponding glyphs in an externally-defined standard such as SMuFL.
(MEI.externalsymbols) Attributes that point to an external symbol authority.
@glyph.auth(optional)A name or label associated with the controlled vocabulary from which the value of @glyph.name or @glyph.num is taken, or the textual content of the element. Suggested values are: "smufl" (Standard Music Font Layout.). Other values conform to XML Schema NMTOKEN datatype.
@glyph.uri(optional)The web-accessible location of the controlled vocabulary from which the value of @glyph.name or @glyph.num is taken, or the textual content of the element. Value conforms to data.URI.
(MEI.externalsymbols) Attributes that specify names or values taken from an external symbol authority.
@glyph.name(optional)Glyph name. Value conforms to XML Schema string datatype.
@glyph.num(optional)Numeric glyph reference in hexadecimal notation, e.g., "#xE000" or "U+E000". N.B. SMuFL version 1.18 uses the range U+E000 - U+ECBF. Value conforms to data.HEXNUM.
(MEI.shared) Typographical attributes.
@fontfam(optional)Contains the name of a font-family. Value conforms to data.FONTFAMILY.
@fontname(optional)Holds the name of a font. Value conforms to data.FONTNAME.
@fontsize(optional)Indicates the size of a font expressed in printers' points, i.e., 1/72nd of an inch, relative terms, e.g., small, larger, etc., or percentage values relative to normal size, e.g., 125%. Value conforms to data.FONTSIZE.
@fontstyle(optional)Records the style of a font, i.e., italic, oblique, or normal. Value conforms to data.FONTSTYLE.
@fontweight(optional)Used to indicate bold type. Value conforms to data.FONTWEIGHT.
@letterspacing(optional)Indicates letter spacing (aka tracking) in analogy to the CSS letter-spacing property. Value conforms to data.MEASUREMENTTYPOGRAPHYSIGNED.
@lineheight(optional)Indicates line height in analogy to the CSS line-height property. Value conforms to data.LINEHEIGHT.
(MEI.shared) Visual offset attributes. Some items may have their location recorded in terms of offsets from their programmatically-determined location. The ho attribute records the horizontal offset while vo records the vertical. The to attribute holds a timestamp offset, the most common use of which is as an alternative to the ho attribute.
(MEI.shared) Horizontal offset attributes.
@ho(optional)Records a horizontal adjustment to a feature’s programmatically-determined location in terms of staff interline distance; that is, in units of 1/2 the distance between adjacent staff lines. Value conforms to data.MEASUREMENTSIGNED.
(MEI.shared) Vertical offset attributes.
@vo(optional)Records the vertical adjustment of a feature’s programmatically-determined location in terms of staff interline distance; that is, in units of 1/2 the distance between adjacent staff lines. Value conforms to data.MEASUREMENTSIGNED.
@glyph.auth(optional)A name or label associated with the controlled vocabulary from which the value of @glyph.name or @glyph.num is taken, or the textual content of the element. Suggested values are: "smufl" (Standard Music Font Layout.). Other values conform to XML Schema NMTOKEN datatype.
@glyph.name(optional)Glyph name. Value conforms to XML Schema string datatype.
@glyph.num(optional)Numeric glyph reference in hexadecimal notation, e.g., "#xE000" or "U+E000". N.B. SMuFL version 1.18 uses the range U+E000 - U+ECBF. Value conforms to data.HEXNUM.
@glyph.uri(optional)The web-accessible location of the controlled vocabulary from which the value of @glyph.name or @glyph.num is taken, or the textual content of the element. Value conforms to data.URI.
@cautionary(optional)Records the function of the clef. A "cautionary" clef does not change the following pitches. Value conforms to data.BOOLEAN.
@color(optional)Used to indicate visual appearance. Do not confuse this with the musical term 'color' as used in pre-CMN notation. Value conforms to data.COLOR.
@dis(optional)Records the amount of octave displacement. Value conforms to data.OCTAVE.DIS.
@dis.place(optional)Records the direction of octave displacement. Value conforms to data.STAFFREL.basic.
@enclose(optional)Records the characters often used to mark accidentals, articulations, and sometimes notes as having a cautionary or editorial function. For an example of cautionary accidentals enclosed in parentheses, see Read, p. 131, ex. 9-14. Value conforms to data.ENCLOSURE.
@fontfam(optional)Contains the name of a font-family. Value conforms to data.FONTFAMILY.
@fontname(optional)Holds the name of a font. Value conforms to data.FONTNAME.
@fontsize(optional)Indicates the size of a font expressed in printers' points, i.e., 1/72nd of an inch, relative terms, e.g., small, larger, etc., or percentage values relative to normal size, e.g., 125%. Value conforms to data.FONTSIZE.
@fontstyle(optional)Records the style of a font, i.e., italic, oblique, or normal. Value conforms to data.FONTSTYLE.
@fontweight(optional)Used to indicate bold type. Value conforms to data.FONTWEIGHT.
@ho(optional)Records a horizontal adjustment to a feature’s programmatically-determined location in terms of staff interline distance; that is, in units of 1/2 the distance between adjacent staff lines. Value conforms to data.MEASUREMENTSIGNED.
@label(optional)Captures text to be used to generate a label for the element to which it’s attached, a "tool tip" or prefatory text, for example. Should not be used to record document content. Value conforms to XML Schema string datatype.
@layer(optional)Identifies the layer to which a feature applies. Value conforms to 1 or more space-separated values of XML Schema positiveInteger datatype.
@letterspacing(optional)Indicates letter spacing (aka tracking) in analogy to the CSS letter-spacing property. Value conforms to data.MEASUREMENTTYPOGRAPHYSIGNED.
@line(optional)Indicates the line upon which a feature stands. The value must be in the range between 1 and the number of lines on the staff. The numbering of lines starts with the lowest line of the staff. Value conforms to data.CLEFLINE.
@lineheight(optional)Indicates line height in analogy to the CSS line-height property. Value conforms to data.LINEHEIGHT.
@oct(optional)Captures written octave information. Value conforms to data.OCTAVE.
@shape(optional)Describes a clef’s shape. Value conforms to data.CLEFSHAPE.
@staff(optional)Signifies the staff on which a notated event occurs or to which a control event applies. Mandatory when applicable. Value conforms to 1 or more space-separated values of XML Schema positiveInteger datatype.
@type(optional)Designation which characterizes the element in some sense, using any convenient classification scheme or typology that employs single-token labels. Value conforms to 1 or more space-separated values of XML Schema NMTOKEN datatype.
@vo(optional)Records the vertical adjustment of a feature’s programmatically-determined location in terms of staff interline distance; that is, in units of 1/2 the distance between adjacent staff lines. Value conforms to data.MEASUREMENTSIGNED.
@xml:id(optional)Regularizes the naming of an element and thus facilitates building links between it and other resources. Each id attribute within a document must have a unique value. Value conforms to XML Schema ID datatype.
Member of
model.eventLikeGroups event elements that occur in all notational repertoires.
model.staffDefPartGroups elements that may appear in the declaration of staff features.
Contained By
<clefGrp>A set of simultaneously-occurring clefs.
<fTrem>A rapid alternation between a pair of notes (or chords or perhaps between a note and a chord) that are (usually) farther apart than a major second.
(MEI.shared) Groups event elements that occur in all notational repertoires.
<beam>A container for a series of explicitly beamed events that begins and ends entirely within a measure.
<graceGrp>A container for a sequence of grace notes.
<tuplet>A group of notes with "irregular" (sometimes called "irrational") rhythmic values, for example, three notes in the time normally occupied by two or nine in the time of five.
(MEI.shared) Groups notated events that may appear at the layer level in all repertoires.
<layer>An independent stream of events on a staff.
(MEI.shared) Groups elements that may appear in the declaration of staff features.
<staffDef>Container for staff meta-information.
<beam>A container for a series of explicitly beamed events that begins and ends entirely within a measure.
<fTrem>A rapid alternation between a pair of notes (or chords or perhaps between a note and a chord) that are (usually) farther apart than a major second.
<graceGrp>A container for a sequence of grace notes.
<tuplet>A group of notes with "irregular" (sometimes called "irrational") rhythmic values, for example, three notes in the time normally occupied by two or nine in the time of five.
<clefGrp>A set of simultaneously-occurring clefs.
<layer>An independent stream of events on a staff.
<staffDef>Container for staff meta-information.
May Contain
– (<clef> may not have child elements)
Remarks

This element can be used as an alternative to the <staff> element's clef.* attributes. It should be used when specific display info, such as size or color, needs to be recorded for the clef or when multiple, simultaneous clefs occur on a single staff. This element may also be used within the staff context to indicate changes of clef.

The position of a clef may be specified using either @line or @loc, but not both. The @line attribute numbers staff lines starting with 1 for the bottom line. The @loc attribute uses data.STAFFLOC: integer MEI virtual units (half the distance between adjacent staff lines), with 0 at the bottom line, positive values above it, and negative values below it. For a position on a staff line, loc = 2 * (line - 1). Thus, line="1" and loc="0" are alternative ways to specify the bottom line, while loc="5" specifies the space between the third and fourth lines. The @loc attribute allows clefs to be placed on spaces as well as lines.

Constraints

The @line and @loc attributes must not be used together on the same clef.
The clef position must be less than or equal to the number of lines of an ancestor staff.
The clef position must be less than or equal to the number of lines of a preceding staff.

Declaration
<elementSpec xmlns="http://www.tei-c.org/ns/1.0" rend="add" ident="clef" module="MEI.shared">
<desc xml:lang="en">Indication of the exact location of a particular note on the staff and, therefore, the other notes as well.</desc>
<classes>
<memberOf key="att.common"/>
<memberOf key="att.event"/>
<memberOf key="att.clef.log"/>
<memberOf key="att.clef.vis"/>
<memberOf key="model.eventLike"/>
<memberOf key="model.staffDefPart"/>
</classes>
<content>
<empty/>
</content>
<constraintSpec ident="clef_line_loc_exclusive" scheme="schematron">
<constraint>
<sch:rule context="mei:clef">
<sch:assert test="not(@line and @loc)">The @line and @loc attributes must not be used together on the same clef.</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
<constraintSpec ident="Clef_position_lines" scheme="schematron">
<constraint>
<sch:rule context="mei:clef[@line][matches(@shape, '[FCG]')][ancestor::mei:staffDef[@lines]]">
<sch:let name="thisstaff" value="ancestor::mei:staffDef/@n"/>
<sch:assert test="number(@line) <= number(ancestor::mei:staffDef[@n=$thisstaff and @lines][1]/@lines)">The clef position must be less than or equal to the number of lines of an ancestor staff.</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
<constraintSpec ident="Clef_position_nolines" scheme="schematron">
<constraint>
<sch:rule context="mei:clef[@line][ancestor::mei:staffDef[not(@lines)]]">
<sch:let name="thisstaff" value="ancestor::mei:staffDef/@n"/>
<sch:assert test="number(@line) <= number(preceding::mei:staffDef[@n=$thisstaff and @lines][1]/@lines)">The clef position must be less than or equal to the number of lines of a preceding staff.</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
<remarks xml:lang="en">
<p>This element can be used as an alternative to the <gi scheme="MEI">staff</gi> element's clef.* attributes. It should be used when specific display info, such as size or color, needs to be recorded for the clef or when multiple, simultaneous clefs occur on a single staff. This element may also be used within the staff context to indicate changes of clef.</p>
<p>The position of a clef may be specified using either <att>line</att> or <att>loc</att>, but not both. The <att>line</att> attribute numbers staff lines starting with
<val>1</val>
for the bottom line. The <att>loc</att> attribute uses
<ident type="datatype">data.STAFFLOC</ident>
: integer MEI virtual units (half the distance between adjacent staff lines), with
<val>0</val>
at the bottom line, positive values above it, and negative values below it. For a position on a staff line, loc = 2 * (line - 1). Thus, line="1" and loc="0" are alternative ways to specify the bottom line, while loc="5" specifies the space between the third and fourth lines. The <att>loc</att> attribute allows clefs to be placed on spaces as well as lines. </p>
</remarks>
</elementSpec>