On 2025-07-17 07:50, Magnus Svenson wrote:
Music = {
  b'1
  \break % to show colored bar line
  \ColorRepeatBegSpecialBar
  \repeat volta 2 {
   c''1 |
 \alternative {
   \volta 1 {
    d''1 |
    \ColorRepeatEndSpecialBar
   }
  \volta 2 {
    e''1 |
   }
  }
  }
}
Thank you Magnus, for your reply.  Your new structure certainly clears all of the warnings.

I removed the "\break" before the color change and it proved your theory that "lilypond considers them to be the same barline" is correct.

I read somewhere that any repeat should start on a new line if possible, so I would like to ask others if this feature could be changed by specifying that a bar line before a "\break" can somehow be left in the default color.

For anyone interested, the full MWE is now:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\version "2.24.0"

ColorRepeatBegSpecialBar = {
 \once \override Score.BarLine.color = #(x11-color 'orange)
 \once \set Score.startRepeatBarType = #"[|:"
}
ColorRepeatEndSpecialBar = {
 \once \override Score.BarLine.color = #(x11-color 'orange)
 \once \set Score.endRepeatBarType = #":|]"
}

Music = {
 b'1
 \break % to show colored bar line
 \ColorRepeatBegSpecialBar
 \repeat volta 2 {
  c''1 |
  \alternative {
   \volta 1 {
    d''1 |
    \ColorRepeatEndSpecialBar
   } % END volta 1
   \volta 2 {
    e''1 |
   } % END volta 2
  }  % END alternative
 } % END repeat volta 2
} % END Music

\score {
  \new Staff { \Music }
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Reply via email to