mr_georg
mr_georg

Reputation: 3713

Lilypond: how to add a balloon-text for clefs?

With `balloonGrobText' one can add a balloon for grob. But this does appearently not work for clefs.

Example:

\version "2.20.0"

\new Voice \with { \consists Balloon_engraver }{
  \override Voice.BalloonTextItem.annotation-balloon = ##f
  g'4
  \balloonGrobText #'Flag #'(1 . -2) \markup{"Flag"}
  \balloonGrobText #'Clef #'(1 . 2) \markup{"Clef"}
  \clef F
  b8
}

gives: Balloon text missing for clef

How to add the balloon-text for the F-clef?

Upvotes: 0

Views: 121

Answers (1)

fedelibre
fedelibre

Reputation: 418

You've put the balloon engraver in the Voice context, but Clef is part of the Staff context. Simply put it in the Staff context and it will work as expected.

Here's how I would rewrite your example:

\version "2.20.0"

\new Staff \with {
  \consists Balloon_engraver
  \override BalloonTextItem.annotation-balloon = ##f
}
{
  g'4
  \balloonGrobText #'Flag #'(1 . -2) \markup{"Flag"}
  \balloonGrobText #'Clef #'(1 . 2) \markup{"Clef"}
  \clef F
  b8
}

Upvotes: 2

Related Questions