Music notation inside markup

Various musical notation elements may be added to a score, inside a markup object.

Notes and accidentals can be entered using markup commands:

a'2 a'^\markup {
  \note {4} #1
  =
  \note-by-number #1 #1 #1.5
}
b'1_\markup {
  \natural \semiflat \flat
  \sesquiflat \doubleflat
}
\glissando
a'1_\markup {
  \natural \semisharp \sharp
  \sesquisharp \doublesharp
}
\glissando b'

[image of music]

Other notation objects may also be printed in markup mode:

\relative {
  g1 bes
  ees\finger \markup \tied-lyric "4~1"
  fis_\markup { \dynamic rf }
  bes^\markup {
    \beam #8 #0.1 #0.5
  }
  cis
  d-\markup {
    \markalphabet #8
    \markletter #8
  }
}

[image of music]

More generally, any available musical symbol may be included separately in a markup object, as demonstrated below; an exhaustive list of these symbols and their names can be found in The Emmentaler font.

\relative {
  c''2
  c'^\markup { \musicglyph "eight" }
  c,4_\markup { \left-brace #40 }
  c,8._\markup { \musicglyph "clefs.G_change" }
  c16
  c2^\markup { \musicglyph "timesig.neomensural94" }
}

[image of music]

The markup mode also supports diagrams for specific instruments:

\relative {
  c''1^\markup {
    \fret-diagram-terse "x;x;o;2;3;2;"
  }
  c^\markup {
    \harp-pedal "^-v|--ov^"
  }
  c
  c^\markup {
    \combine
      \musicglyph "accordion.discant"
      \combine
	\raise #0.5 \musicglyph "accordion.dot"
	\raise #1.5 \musicglyph "accordion.dot"
  }
}

[image of music]

Such diagrams are documented in Instrument-specific markup.

A whole score can even be nested inside a markup object:

\relative {
  c'4 d^\markup {
    \score {
      \relative { c'4 d e f }
    }
  }
  e f |
  c d e f
}

[image of music]

An exhaustive list of music notation related commands can be found in Markup for music and musical symbols.

See also

Notation Reference: Markup for music and musical symbols, The Emmentaler font.

Installed Files: scm/define-markup-commands.scm, scm/fret-diagrams.scm, scm/harp-pedals.scm.

Snippets: Text.

Internals Reference: TextScript.

Known issues and warnings

Vertical spacing of a \score inside a markup object is controlled by baseline-skip. Any \paper settings are ignored.


LilyPond Notation Reference v2.25.21 (development-branch).