lilypond-user
[Top][All Lists]
Advanced

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

Re: bar lines followed by barlines on a new line


From: Robin Bannister
Subject: Re: bar lines followed by barlines on a new line
Date: Fri, 1 Oct 2010 16:45:10 +0200

Sam Domonkos wrote:
I would like to explicitly separate parts of music by having these bar lines always at the beginning and end of parts ... \bar ".|" a4 b c d \bar "|." \break
\bar ".|" a b c d \bar "|."

I'm not sure what you mean by a "part".

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#(define (my-calc-glyph-name grob)
 (let* ((glyph (ly:grob-property grob 'glyph))
   (dir (ly:item-break-dir grob)))
(if (and (string? glyph) (string=? glyph ".|") (= dir LEFT)) "|." ; as if bar-glyph-alist had (".|" . ("|." . ".|"))
     (bar-line::calc-glyph-name grob))))

\new Staff \with { \override BarLine #'glyph-name = #my-calc-glyph-name }
{
\bar ".|" b1 b1 b1 b1 b1 b1 b1 b1^"\bar \".|\"" \bar ".|" \break
 b1 b1 b1 b1 b1 b1 b1 b1^"\bar \"|.\"" \bar "|." \break
 b1 b1 b1 b1^"\bar \".|\"" \bar ".|" b1 b1 \repeat volta 2 { b1 b1 } \break
 b1 b1 b1 b1 b1 b1 b1 b1 \bar ".|" \break
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


With this override, if you ask at a \break for a start bar you are given an end bar on the old line and a start bar on the new line. This happens at bar 8/9. But you would have to guarantee that your parts don't ever end like bar 24. If your parts could both end and not end at right repeats, then you would need to put a (similar but more complicated) local override at each part end.

Cheers, Robin


P.S. I easily forget how to specify an end bar. It looks more like ".|", but it is actually "|."; Internals Reference 3.2.9 gets start bar and end bar mixed up too.

Attachment: start_global.png
Description: PNG image


reply via email to

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