The clef object | MNX specification

# The clef object

Type: Dictionary

## Attributes

Name | Type | Required? | Description
--- | --- | --- | ---
color | simple color | No | An optional color to be used when rendering this element and all child elements.
glyph | smufl glyph | No | A specific SMuFL glyph name to be used when rendering this clef, e.g. `gClefArrowUp`. See SMuFL clef glyphs. We encourage you to use this sparingly. In the case of octave-transposing clefs, it's better to use `octave` and `showOctave` rather than just using `glyph`.
octave | ottava amount or zero | No | The number of octaves by which the sounded pitches normally indicated by the given clef sign should be transposed. Default is zero.
showOctave | boolean | No | Whether the clef's glyph should display an octave offset visually (such as an "8" at the top or bottom of a G clef). This is used together with `octave`. If `octave` is set to a non-zero value, `showOctave` encodes whether the octave offset should be displayed as part of the clef's glyph. If `octave` is non-zero and `showOctave` is not provided, `showOctave` is to be interpreted as true. We encourage you to use `showOctave` instead of the lower-level `glyph`, because the former encodes intent.
sign | clef sign | Yes | The clef sign.
staffPosition | staff position | Yes | The staff position at which the clef is drawn. For example, a standard G glef is drawn at position -2.

Plus globally available attributes: _c, _x, id

## Parent objects

This object is used by the following parent objects:

- positioned clef: "clef"

## Examples

This object is used in the following examples:

Accidentals, Articulations, Beams, Beams (across barlines), Beams (hooks), Beams (secondary beam breaks implied), Beams (secondary beam breaks), Beams (with inner grace notes), Clef changes, Dotted notes (augmentation dots), Dynamics, Full-measure rests, Grace note, Grace notes (beamed), Grand staff piano music, Jumps (D.S. al Fine), Jumps (Dal Segno), Key signatures, Lyric line metadata, Lyrics (basic), Lyrics (multi-line), Multimeasure rests, Multiple layouts, Multiple voices, Organ layout, Ottavas (8va), Parts, Repeats, Repeats (more than once repeated), Repeats (with alternate endings, advanced), Repeats (with alternate endings, simple), Repeats (with implied start repeat), Rest positions, Slurs, Slurs (for chords), Slurs (targeting specific notes), Tempo markings, Three-note chord and half rest, Tie targets, Ties, Time signature glyphs, Time signatures, Tremolos (multi-note), Tremolos (single-note), Tuplets, Two-bar C major scale, “Hello world”