9.3. Spacers

The spacer element is a special staff object that is rendered as blank space:

spacer ::=  (spacer width staffobjOptions* soAttachment* )
width  ::=  space width, in tenths

The amount of blank space to insert is controlled by the width parameter. It can be 0 and thus, this element is also useful as an ‘anchor’ element for objects that must go attached to an staff object.

In this example, it can be observed the effect of an spacer with different widths, inserted in measures with the same layout:

(score (vers 2.0)(instrument (musicData
    (clef G)
    (barline)

    //measure 1: default layoput without spacer, for comparison
    (n f4 q)
    (barline)

    //measure 2: insert an space of 10 lines before the note
    (spacer 100)
    (n f4 q)
    (barline)

    //measure 3: a null spacer does nothing
    (spacer 0)
    (n f4 q)
    (barline)
)))
../_images/spacer-01.png