The staff position object

Type: Number

Represents a vertical position in a staff, where 0 is the middle of the staff. This number is positive for positions above the middle of the staff, and it's negative for positions below the middle of the staff.

This value is expressed in "half staff spaces." In other words, the staff position values of two consecutive staff lines are always 2 apart. This allows both lines and spaces to be encoded with simple integer values.

For example: in a standard five-line staff, the middle line is position 0. The space directly above the middle line is position 1. The line directly above the middle line is position 2. The space directly below the middle line is position -1. The line directly below the middle line is position -2.

In a single-line staff, position 0 represents the line itself, position 1 represents the space directly above the line, and position -1 represents the space directly below the line.

In a two-line staff, position 0 represents the space between the two lines, position 1 represents the top line, and position -1 represents the bottom line.

Examples

This object is used in the following examples:

Accidentals, Articulations, Beams, Beams (across barlines), Beams (hooks), Beams (secondary beam breaks), Beams (with inner grace notes), Clef changes, Dotted notes (augmentation dots), Grace note, Grace notes (beamed), Jumps (D.S. al Fine), Jumps (Dal Segno), Key signatures, Multimeasure rests, Multiple layouts, Multiple voices, Octave shifts (8va), Organ layout, 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 (incomplete slurs), Slurs (targeting specific notes), Styling elements (basic), Styling via a class (basic), Tempo markings, Three-note chord and half rest, Ties, Time signatures, Tremolos (single-note), Tuplets, Two-bar C major scale, “Hello world”