>
>
> ---------- Forwarded message ----------
> From: Andrew Zah <[email protected]>
> To: [email protected]
> Cc:
> Bcc:
> Date: Thu, 17 Mar 2022 10:43:49 -0400
> Subject: Repeat bar :|] doesn't appear if next line has [|: bar
> Hi, is there a way to make lilypond render the closing \bar ":|]"?
>
> On measure 8 there should be a bar, but due to the bar on measure 9 it
> doesn't get rendered.
>
> Thanks,
> Andrew_______________________________________________
> lilypond-user mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/lilypond-user
Two things.
One is that you only ever specify one barline at a time.
In your code, you have two at the same point.
You have:
g'2 r2 | \voltaEndBar \endLine
\boxMark "B"
\voltaStartBar
But this just means that the first barline (voltaEndBar)
is being ignored, and only the second barline (voltaStartBar)
will be printed.
The fact that there is a break and a mark in between is irrelevant,
since they are both addressing the current barline.
What you need is to define a barline that has both.
The barline definitions are strange to explain,
but here is what you need
Basically, there is a definition for what should appear
when the barline is in the middle of the line (the definition, ":|][|:" )
what to show at the end of the line ( ":|]" )
what to show at the beginning of the line ( "[|:" )
and what to show between staves in the same system ( ".|." )
\defineBarLine ":|][|:" #'(":|]" "[|:" " .|.")
endLine = \break
voltaStartBar = \bar "[|:"
voltaBothBar = \bar ":|][|:"
voltaEndBar = \bar ":|]"
boxMark =
#(define-music-function
(parser location mark)
(markup?)
#{
\mark \markup { \box #mark }
#})
\header {
title = "Demo"
}
\paper {
indent = 0\mm
}
\score {
<<
\new Voice="Voice" {
\key c \major
\time 4/4
\numericTimeSignature
\boxMark "A"
\voltaStartBar
f'4 r4 g'4 r4 |
a'4 r8 g'8 r2 |
f'4 r4 g'4 r4 |
a'4 r8 g'8 r2 | \endLine
f'4 r4 g'4 r4 |
a'4 r8 g'8 r4 r8 g'8~ |
g'1~ |
g'2 r2 | \voltaBothBar \endLine
\boxMark "B"
b'2 c''2 |
d''2 c''2 |
b'2 c''2 |
d''2 c''2 | \endLine
b'2 c''2 |
e''2 b'2 |
c''1~ |
c''2 r2 |
\voltaEndBar \endLine
\boxMark "A"
f'4 r4 g'4 r4 |
a'4 r8 g'8 r2 |
f'4 r4 g'4 r4 |
a'4 r8 g'8 r2 | \endLine
f'4 r4 g'4 r4 |
a'4 r8 g'8 r4 r8 g'8~ |
g'1~ |
g'2 r2 | \endLine
}
>>
}
HTH,
Elaine Alt
415 . 341 .4954 "*Confusion is
highly underrated*"
[email protected]
Producer ~ Composer ~ Instrumentalist ~ Educator
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-