<staffDef>

Module
Attributes
@clef.dis, @clef.dis.place, @clef.line, @clef.shape, @instr, @keysig, @label, @lines, @lines.color, @lines.visible, @meter.count, @meter.sym, @meter.unit, @n, @num, @numbase, @ppq, @scale, @trans.diat, @trans.semi, @tune.Hz, @tune.pname, @tune.temper, @type, @xml:id
@clef.dis(optional)Records the amount of octave displacement to be applied to the clef.
@clef.dis.place(optional)Records the direction of octave displacement to be applied to the clef.
@clef.line(optional)Contains a default value for the position of the clef. 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.
@clef.shape(optional)Encodes a value for the clef symbol.
@instr(optional)Provides a way of pointing to a MIDI instrument definition. It must contain the ID of an <instrDef> element elsewhere in the document.
@keysig(optional)Written key signature.
@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.
@lines(optional)Indicates the number of staff lines.
@lines.color(optional)Captures the colors of the staff lines. One or more values from data.COLOR, separated by spaces.
@lines.visible(optional)Records whether all staff lines are visible. Value conforms to data.BOOLEAN.
@meter.count(optional)Captures the number of beats in a measure, that is, the top number of the meter signature. It must contain a decimal number or an expression that evaluates to a decimal number, such as 2+3 or 3*2.
@meter.sym(optional)Indicates the use of a meter symbol instead of a numeric meter signature, that is, 'C' for common time or 'C' with a slash for cut time.
@meter.unit(optional)Contains the number indicating the beat unit, that is, the bottom number of the meter signature.
@n(optional)Provides a numeric designation that indicates an element’s position in a sequence of similar elements. Its value must be a non-negative integer.
@num(optional)Along with numbase, describes duration as a ratio. num is the first value in the ratio, while numbase is the second.
@numbase(optional)Along with num, describes duration as a ratio. num is the first value in the ratio, while numbase is the second.
@ppq(optional)Indicates the number of pulses (sometimes referred to as ticks or divisions) per quarter note. Unlike MIDI, MEI permits different values for a score and individual staves.
@scale(optional)Scale factor to be applied to the feature to make it the desired display size.
@trans.diat(optional)Records the amount of diatonic pitch shift, e.g., C to C♯ = 0, C to D♭ = 1, necessary to calculate the sounded pitch from the written one.
@trans.semi(optional)Records the amount of pitch shift in semitones, e.g., C to C♯ = 1, C to D♭ = 1, necessary to calculate the sounded pitch from the written one.
@tune.Hz(optional)Holds a value for cycles per second, i.e., Hertz, for a tuning reference pitch.
@tune.pname(optional)Holds the pitch name of a tuning reference pitch, i.e., the central tone of a tuning system.
@tune.temper(optional)Provides an indication of the tuning system, just, for example.
@type(optional)Designation which characterizes the element in some sense, using any convenient classification scheme or typology that employs single-token labels.
@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.
(MEI.shared) Attributes that form the basis of the att.common class.
(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.
(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.
(MEI.shared) Attributes used to supply an integer number designation for an element.
@n(optional)Provides a numeric designation that indicates an element’s position in a sequence of similar elements. Its value must be a non-negative integer.
(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.
(MEI.gestural) Gestural domain attributes for staffDef in the CMN repertoire.
(MEI.midi) Attributes which identify a MIDI instrument.
@instr(optional)Provides a way of pointing to a MIDI instrument definition. It must contain the ID of an <instrDef> element elsewhere in the document.
(MEI.midi) Attributes that record time-base information.
@ppq(optional)Indicates the number of pulses (sometimes referred to as ticks or divisions) per quarter note. Unlike MIDI, MEI permits different values for a score and individual staves.
(MEI.shared) Attributes that describe tuning.
@tune.Hz(optional)Holds a value for cycles per second, i.e., Hertz, for a tuning reference pitch.
@tune.pname(optional)Holds the pitch name of a tuning reference pitch, i.e., the central tone of a tuning system.
@tune.temper(optional)Provides an indication of the tuning system, just, for example.
(MEI.shared) Logical domain attributes for staffDef.
@lines(optional)Indicates the number of staff lines.
(MEI.shared) Used by staffDef and scoreDef to provide default values for attributes in the logical domain related to clefs.
@clef.shape(optional)Encodes a value for the clef symbol.
@clef.line(optional)Contains a default value for the position of the clef. 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.
@clef.dis(optional)Records the amount of octave displacement to be applied to the clef.
@clef.dis.place(optional)Records the direction of octave displacement to be applied to the clef.
(MEI.shared) Attributes that describe duration as a ratio.
@num(optional)Along with numbase, describes duration as a ratio. num is the first value in the ratio, while numbase is the second.
@numbase(optional)Along with num, describes duration as a ratio. num is the first value in the ratio, while numbase is the second.
(MEI.shared) Used by staffDef and scoreDef to provide default values for attributes in the logical domain that are related to key signatures.
@keysig(optional)Written key signature.
(MEI.shared) Used by staffDef and scoreDef to provide default values for attributes in the logical domain related to meter signature.
@meter.count(optional)Captures the number of beats in a measure, that is, the top number of the meter signature. It must contain a decimal number or an expression that evaluates to a decimal number, such as 2+3 or 3*2.
@meter.unit(optional)Contains the number indicating the beat unit, that is, the bottom number of the meter signature.
@meter.sym(optional)Indicates the use of a meter symbol instead of a numeric meter signature, that is, 'C' for common time or 'C' with a slash for cut time.
(MEI.shared) Attributes that describe transposition.
@trans.diat(optional)Records the amount of diatonic pitch shift, e.g., C to C♯ = 0, C to D♭ = 1, necessary to calculate the sounded pitch from the written one.
@trans.semi(optional)Records the amount of pitch shift in semitones, e.g., C to C♯ = 1, C to D♭ = 1, necessary to calculate the sounded pitch from the written one.
(MEI.cmn) Logical domain attributes for staffDef in the CMN repertoire.
(MEI.visual) Visual domain attributes for staffDef.
@lines.color(optional)Captures the colors of the staff lines. One or more values from data.COLOR, separated by spaces.
@lines.visible(optional)Records whether all staff lines are visible. Value conforms to data.BOOLEAN.
(MEI.shared) Attributes that describe relative size.
@scale(optional)Scale factor to be applied to the feature to make it the desired display size.
@instr(optional)Provides a way of pointing to a MIDI instrument definition. It must contain the ID of an <instrDef> element elsewhere in the document.
@ppq(optional)Indicates the number of pulses (sometimes referred to as ticks or divisions) per quarter note. Unlike MIDI, MEI permits different values for a score and individual staves.
@clef.dis(optional)Records the amount of octave displacement to be applied to the clef.
@clef.dis.place(optional)Records the direction of octave displacement to be applied to the clef.
@clef.line(optional)Contains a default value for the position of the clef. 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.
@clef.shape(optional)Encodes a value for the clef symbol.
@keysig(optional)Written key signature.
@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.
@lines(optional)Indicates the number of staff lines.
@meter.count(optional)Captures the number of beats in a measure, that is, the top number of the meter signature. It must contain a decimal number or an expression that evaluates to a decimal number, such as 2+3 or 3*2.
@meter.sym(optional)Indicates the use of a meter symbol instead of a numeric meter signature, that is, 'C' for common time or 'C' with a slash for cut time.
@meter.unit(optional)Contains the number indicating the beat unit, that is, the bottom number of the meter signature.
@n(optional)Provides a numeric designation that indicates an element’s position in a sequence of similar elements. Its value must be a non-negative integer.
@num(optional)Along with numbase, describes duration as a ratio. num is the first value in the ratio, while numbase is the second.
@numbase(optional)Along with num, describes duration as a ratio. num is the first value in the ratio, while numbase is the second.
@scale(optional)Scale factor to be applied to the feature to make it the desired display size.
@trans.diat(optional)Records the amount of diatonic pitch shift, e.g., C to C♯ = 0, C to D♭ = 1, necessary to calculate the sounded pitch from the written one.
@trans.semi(optional)Records the amount of pitch shift in semitones, e.g., C to C♯ = 1, C to D♭ = 1, necessary to calculate the sounded pitch from the written one.
@tune.Hz(optional)Holds a value for cycles per second, i.e., Hertz, for a tuning reference pitch.
@tune.pname(optional)Holds the pitch name of a tuning reference pitch, i.e., the central tone of a tuning system.
@tune.temper(optional)Provides an indication of the tuning system, just, for example.
@type(optional)Designation which characterizes the element in some sense, using any convenient classification scheme or typology that employs single-token labels.
@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.
@lines.color(optional)Captures the colors of the staff lines. One or more values from data.COLOR, separated by spaces.
@lines.visible(optional)Records whether all staff lines are visible. Value conforms to data.BOOLEAN.
Member of
model.staffDefLikeGroups elements that permit declaration of staff properties.
Contained By
(MEI.shared) Groups elements that permit declaration of staff properties.
<ending>Alternative ending for a repeated passage of music; i.e., prima volta, seconda volta, etc.
<score>Full score view of the musical content.
<staff>A group of equidistant horizontal lines on which notes are placed in order to represent pitch or a grouping element for individual 'strands' of notes, rests, etc. that may or may not actually be rendered on staff lines; that is, both diastematic and non-diastematic signs.
(MEI.shared) Groups elements that may appear as part of a section.
<section>Segment of music data.
<ending>Alternative ending for a repeated passage of music; i.e., prima volta, seconda volta, etc.
<score>Full score view of the musical content.
<section>Segment of music data.
<staff>A group of equidistant horizontal lines on which notes are placed in order to represent pitch or a grouping element for individual 'strands' of notes, rests, etc. that may or may not actually be rendered on staff lines; that is, both diastematic and non-diastematic signs.
May Contain
(MEI.shared) Groups elements used to declare a MIDI instrument.
<instrDef>MIDI instrument declaration.
(MEI.shared) Groups elements used to assign a label to other parts of a document.
<label>A container for document text that identifies the feature to which it is attached. For a "tool tip" or other generated label, use the @label attribute.
<labelAbbr>A label on the pages following the first.
(MEI.shared) Groups elements that permit declaration of layer properties.
(MEI.shared) Groups elements that may appear in the declaration of staff features.
<clef>Indication of the exact location of a particular note on the staff and, therefore, the other notes as well.
<clefGrp>A set of simultaneously-occurring clefs.
(MEI.shared) Groups elements that have the same function as a key signature.
(MEI.shared) Groups elements that represent a meter signature.
<instrDef>MIDI instrument declaration.
<clef>Indication of the exact location of a particular note on the staff and, therefore, the other notes as well.
<clefGrp>A set of simultaneously-occurring clefs.
<label>A container for document text that identifies the feature to which it is attached. For a "tool tip" or other generated label, use the @label attribute.
<labelAbbr>A label on the pages following the first.
Constraints

StaffDef must have an n attribute.
Either @lines must be present or a preceding staffDef with the same value for @n and @lines must exist.
Only one clef or clefGrp is permitted.
@n must have the same value as the current staff.
Either @lines must be present or a preceding staffDef with matching @n value and @lines must exist.
The clef position must be less than or equal to the number of lines on the staff.
The clef position must be less than or equal to the number of lines on the staff.
The lines.color attribute must have either 1) a single value or 2) the same number of values as there are staff lines.
The lines.color attribute must have either 1) a single value or 2) the same number of values as there are staff lines.
The value of ppq must be a factor of the value of ppq on an ancestor scoreDef.
The value of ppq must be a factor of the value of ppq on a preceding scoreDef.

Declaration
<elementSpec xmlns="http://www.tei-c.org/ns/1.0" rend="add" ident="staffDef" module="MEI.shared">
<gloss xml:lang="en">staff definition</gloss>
<desc xml:lang="en">Container for staff meta-information.</desc>
<classes>
<memberOf key="att.basic"/>
<memberOf key="att.labelled"/>
<memberOf key="att.nInteger"/>
<memberOf key="att.typed"/>
<memberOf key="att.staffDef.ges"/>
<memberOf key="att.staffDef.log"/>
<memberOf key="att.staffDef.vis"/>
<memberOf key="model.staffDefLike"/>
</classes>
<content>
<sequence minOccurs="1" maxOccurs="1">
<classRef key="model.labelLike" minOccurs="0" maxOccurs="unbounded"/>
<alternate minOccurs="0" maxOccurs="unbounded">
<classRef key="model.instrDefLike"/>
<classRef key="model.layerDefLike"/>
<classRef key="model.staffDefPart"/>
</alternate>
<elementRef key="ambitus" minOccurs="0"/>
</sequence>
</content>
<constraintSpec ident="Check_staffDefn" scheme="schematron">
<constraint>
<sch:rule context="mei:staffDef[not(ancestor::mei:staff)]">
<sch:let name="thisstaff" value="@n"/>
<sch:assert test="@n">StaffDef must have an n attribute.</sch:assert>
<sch:assert test="@lines or preceding::mei:staffDef[@n=$thisstaff and @lines]"> Either @lines must be present or a preceding staffDef with the same value for @n and @lines must exist.</sch:assert>
<sch:assert test="count(mei:clef) + count(mei:clefGrp) < 2">Only one clef or clefGrp is permitted.</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
<constraintSpec ident="Check_ancestor_staff" scheme="schematron">
<constraint>
<sch:rule context="mei:staffDef[ancestor::mei:staff and @n]">
<sch:let name="thisstaff" value="@n"/>
<sch:assert test="ancestor::mei:staff/@n eq $thisstaff">@n must have the same value as the current staff.</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
<constraintSpec ident="Check_ancestor_staff_lines" scheme="schematron">
<constraint>
<sch:rule context="mei:staffDef[ancestor::mei:staff and not(@n)]">
<sch:let name="thisstaff" value="ancestor::mei:staff/@n"/>
<sch:assert test="@lines or preceding::mei:staffDef[@n=$thisstaff and @lines]"> Either @lines must be present or a preceding staffDef with matching @n value and @lines must exist.</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
<constraintSpec ident="Check_clef_position_staffDef" scheme="schematron">
<constraint>
<sch:rule context="mei:staffDef[@clef.line and @lines]">
<sch:assert test="number(@clef.line) <= number(@lines)">The clef position must be less than or equal to the number of lines on the staff.</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
<constraintSpec ident="Check_clef_position_staffDef_nolines" scheme="schematron">
<constraint>
<sch:rule context="mei:staffDef[@clef.line and not(@lines)]">
<sch:let name="thisstaff" value="@n"/>
<sch:let name="stafflines" value="preceding::mei:staffDef[@n=$thisstaff and @lines][1]/@lines"/>
<sch:assert test="number(@clef.line) <= number($stafflines)">The clef position must be less than or equal to the number of lines on the staff.</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
<constraintSpec ident="Check_lines_color" scheme="schematron">
<constraint>
<sch:pattern>
<sch:rule context="mei:staffDef[@lines.color and @lines]">
<sch:let name="countTokens" value="count(tokenize(normalize-space(@lines.color), '\s'))"/>
<sch:assert test="$countTokens = 1 or $countTokens = @lines">The lines.color attribute must have either 1) a single value or 2) the same number of values as there are staff lines.</sch:assert>
</sch:rule>
<sch:rule context="mei:staffDef[@lines.color and not(@lines)]">
<sch:let name="countTokens" value="count(tokenize(normalize-space(@lines.color), '\s'))"/>
<sch:let name="thisstaff" value="@n"/>
<sch:assert test="$countTokens = 1 or $countTokens = preceding::mei:staffDef[@n=$thisstaff and @lines][1]/@lines">The lines.color attribute must have either 1) a single value or 2) the same number of values as there are staff lines.</sch:assert>
</sch:rule>
</sch:pattern>
</constraint>
</constraintSpec>
<constraintSpec ident="Check_staff_ppq_ancestor" scheme="schematron">
<constraint>
<sch:pattern>
<sch:rule context="mei:staffDef[@ppq][ancestor::mei:scoreDef[@ppq]]">
<sch:let name="staffPPQ" value="@ppq"/>
<sch:let name="scorePPQ" value="ancestor::mei:scoreDef[@ppq][1]/@ppq"/>
<sch:assert test="($scorePPQ mod $staffPPQ) = 0">The value of ppq must be a factor of the value of ppq on an ancestor scoreDef.</sch:assert>
</sch:rule>
</sch:pattern>
</constraint>
</constraintSpec>
<constraintSpec ident="Check_staff_ppq_preceding" scheme="schematron">
<constraint>
<sch:pattern>
<sch:rule context="mei:staffDef[@ppq][preceding::mei:scoreDef[@ppq]]">
<sch:let name="staffPPQ" value="@ppq"/>
<sch:let name="scorePPQ" value="preceding::mei:scoreDef[@ppq][1]/@ppq"/>
<sch:assert test="($scorePPQ mod $staffPPQ) = 0">The value of ppq must be a factor of the value of ppq on a preceding scoreDef.</sch:assert>
</sch:rule>
</sch:pattern>
</constraint>
</constraintSpec>
</elementSpec>