I am writing a score using Lilypond and I want the title of a staff to be "Concert D flat major". How would I replace the word "flat" with the corresponding marking?

Here is an example of what I have right now

\score {
  \new Staff {
    \clef bass
    \key des \major
    \time 4/4
    des4 ees4 f4 ges4
  \header {
    piece = "Concert D flat major"

And instead of the word "flat", I want the symbol for a flat to show on the pdf.

I didn't find anything like this in the Lilypond documentation (though the documentation is pretty hairy. I might have missed it).

3 Answers 3

  piece = \markup { "Concerto in D" \flat "Major" }

Via "Music notation inside markup" in the notation guide. You may also need \markup { \concat { "blah" \flat " blah" } } or something to improve the spacing?

  • 1
    The \markup{\concat{}} worked a charm!
    – usernumber
    Commented Sep 5, 2015 at 17:03

While LilyPond offers a \markup \flat you can employ here, it is from an actual music font and usually needs scaling and shifting and spacing until it works reasonably in the surrounding text. Instead you tend to be better off using an actual text flat, like "Concert D♭ major". If you have some Unicode-capable X Window GUI, chances are that <Compose> # b will generate a Unicode flat and <Compose> # # will generate a Unicode sharp (try your keyboard settings menu to figure out where your <Compose> key is or to define one). If things come to worst, you can use the \char markup command for inserting Unicode characters by code number.


The appropriate page for adding musical-symbols into text can be found in the LilyPond documentation: https://lilypond.org/doc/v2.22/Documentation/notation/music

If you want to add musical-symbols which don't have a pre-configured command like there is for \flat or \fermata or others, you can use the \musicglyph command to select glyphs from the Emmentaler font.

\markup {
  \musicglyph #"f"
  \musicglyph #"rests.2"
  \musicglyph #"clefs.G_change"


A complete listing of the possible glyphs from the Emmentaler font can be found here: https://lilypond.org/doc/v2.22/Documentation/notation/the-emmentaler-font

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.