lilypond-user
[Top][All Lists]
Advanced

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

Re: double dashed barline


From: Thomas Morley
Subject: Re: double dashed barline
Date: Thu, 4 Oct 2012 23:43:30 +0200

2012/10/4 TaoCG <address@hidden>:
> I found two different approaches to print double dashed bar lines here:
> http://lilypond.1069038.n5.nabble.com/Fine-with-dashed-double-barline-occurring-in-middle-of-bar-td17372.html
>
> But I need the barline to span a piano and choir staff which neither method
> currently supports.
> Anyone has an alternative approach or could help implement it into one of
> the existing ones?
>
>
>
> --
> View this message in context: 
> http://lilypond.1069038.n5.nabble.com/double-dashed-barline-tp134112.html
> Sent from the User mailing list archive at Nabble.com.
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user

I extended the function provided by Robin Bannister:

\version "2.15.25"

barDoubled = #(define-music-function (parser location glyph) (string?)
  (define (bar-gap-bar grob)
    (let* (
      (layout (ly:grob-layout grob))
      (weight (ly:output-def-lookup layout 'line-thickness 0.1))
      (raw-gap (ly:grob-property grob 'thin-kern))
      (gap (* raw-gap weight)))
    (ly:stencil-combine-at-edge (ly:bar-line::print grob)
      X RIGHT (ly:bar-line::print grob) gap)))

  (define (span-bar-gap-bar grob)
    (let* (
      (layout (ly:grob-layout grob))
      (weight (ly:output-def-lookup layout 'line-thickness 0.1))
      (raw-gap (ly:grob-property grob 'thin-kern))
      (gap (* raw-gap weight)))
    (ly:stencil-combine-at-edge (ly:span-bar::print grob)
      X RIGHT (ly:span-bar::print grob) gap)))
  #{
    \bar $glyph
    \once \override Score.BarLine #'stencil = $bar-gap-bar
    \once \override Score.SpanBar #'stencil = $span-bar-gap-bar
  #})

\score {
        <<
        \new ChoirStaff <<
        \new Staff \relative c' { c'1 b \barDoubled "dashed" c }
        \new Staff \relative c' { g'1 g g }
        \new Staff \relative c' { \clef "G_8" e1 d e }
        \new Staff \relative c' { \clef bass c g c }
        >>
        \new PianoStaff <<
        \new Staff \relative c' { <e g c>1 <d g b> <e g c> }
        \new Staff \relative c' { \clef bass c g c }
        >>
        >>
}

HTH,
  Harm

P.S.
Once the bar-line-patch is approved you can simple write:
#(define-bar-line "!!" "!!" #f "!")
and use it with \bar "!!"
see http://codereview.appspot.com/6498052



reply via email to

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