And then I realised…. It can even be done in a simpler way: swap out the \bar”||” custom bar for \section and lilypond already knows that it should create both a section-end bar at the end and a repeat-start at the start of the next line
\repeat volta 2 { c1 } \break c1 \section \break \repeat volta 2 { c1 } \break > On 18 Nov 2023, at 14:26, Peter Mayes <pe...@petermayes.org> wrote: > > Many thanks. > > I think there is a typo in what you supplied, but with the documentation > reference, I got what I wanted: > > \defineBarLine "||.|:" #'("||" ".|:" #f) > > I needed "#'" before the definition, and I reversed the order of the > arguments, to get the double bar before the opening repeat bar. > > Your help much appreciated! > > Peter > > On 18/11/2023 12:56, Hans Aikema wrote: >> >> >>> On 18 Nov 2023, at 13:30, Peter Mayes <pe...@petermayes.org> >>> <mailto:pe...@petermayes.org> wrote: >>> >>> The score I am trying to emulate has an initial repeated section, a >>> non-repeated section, and another repeated section. The non-repeated >>> section ends with a double bar line, but when I add this (as in bar 7 >>> below), it suppresses the opening repeat in the following section (in bar >>> 8). I want both the double bar, AND the opening repeat. How to achieve this? >>> >>> Thanks in advance! >>> >> Peter, >> >> You can get what you desire with a dedicated custom-defined barline >> >> I modified your example to get the desired carline behaviour in-between >> measure 2 and 3 >> >> \version "2.25.4" >> >> \paper { ragged-right = ##t } >> % See also >> https://lilypond.org/doc/v2.24/Documentation/notation/bars#bar-lines >> \defineBarLine "||.|:" (".|:" "||" #f) >> >> music = \relative c'' { >> \key c \major >> \time 4/4 >> \repeat volta 2 { >> c1 >> } \break >> c1 \bar "||.|:" >> \break >> \repeat volta 2 { >> c1 >> } \break >> \repeat volta 2 { >> c1 >> } \break >> c1 \bar "||" >> \break >> \repeat volta 2 { >> c1 >> } >> } >> \score { >> \new Staff { >> \music >> } >> \layout {} >> } >>> -- >>> >>> Best wishes -- Peter >>> -- >>> Peter Mayes >> > -- > Best wishes -- Peter > -- > Peter Mayes > 07460 890503