lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Barline glyph in markup


From: Xavier Scheuer
Subject: Re: Barline glyph in markup
Date: Fri, 3 Feb 2023 15:28:49 +0100

On Fri, 3 Feb 2023 at 15:03, Valentin Petzel <valentin@petzel.at> wrote:
>
> Hi Rip_mus,
>
> Bar Lines are not in fact glyphs, but drawn directly. We could recreate a
> drawing procedure for markups, but the easiest thing to do would probably be
> to use the \score markup command for this as seen in the appended file.

Hello,

Or we could add the "Bar_engraver" to the Dynamics context, with some tweaks as the following example shows.

\score {
  <<
    \new Staff {
      \new Voice = "melody" {
        \relative {
          a'4 a a a
          a a a a
          \repeat volta 2 { b4 b b b }
        }
      }
    }
    \new Dynamics \with {
      \consists "Bar_engraver"
      \override BarLine.bar-extent = #'(-2 . 2)
      \override BarLine.stencil =
      #(lambda (grob)
        (if (string=? (ly:grob-property grob 'glyph-name) "|")
            (set! (ly:grob-property grob 'glyph-name) ""))
        (ly:bar-line::print grob))
    } {
      s1\mf
      s1
      \repeat volta 2 { s1\p }
    }
  >>
}

Cheers,
Xavier

--
Xavier Scheuer <x.scheuer@gmail.com>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]