On 2023-11-09 08:42, Michael Werner wrote:
On Wed, Nov 8, 2023 at 7:21 PM Stu McKenzie <swws...@handsmck.com> wrote:


    I'd like to differentiate between two repeat voltas in a score by
    using
    2 different start and end bar types.

    The following bar types are already defined in LilyPond:
      Score.startRepeatBarType = #"[|:"
      Score.endRepeatBarType = #":|]"

    I'd like to define a second bar type with double opening and closing
    parentheses, e.g.:
      Score.startRepeatBarType = #"[[|:"
      Score.endRepeatBarType = #":|]]"

    How would that be acheived?


Hi there,

Maybe something like this:

\version "2.25.9"
\language "english"

\new Staff {
  \defineBarLine "[[|:" #'( #t #t #t )
  \defineBarLine ":|]]" #'( #t #t #t )
  \new Voice {
    \relative c' {
      \set Score.startRepeatBarType = #"[|:"
      \set Score.endRepeatBarType = #":|]"
      c' d e f
      \repeat volta 2 {
        c d e f
      }
      c d e f
      \set Score.startRepeatBarType = #"[[|:"
      \set Score.endRepeatBarType = #":|]]"
      \repeat volta 2 {
        c d e f
      }
    }
  }
}

which produces:

image.png

For details on how to define the new bar lines, see http://lilypond.org/doc/v2.25/Documentation/notation/bar-lines But basically the two \defineBarLine lines are what actually define the bars lines to use, then later on you use them as desired. The three bool values after define the behavior a beginning of line, mid line, end end of line. Those will need adjusted to your needs.
--
Michael

Thank you, Michael, for the working example.

It seems that additional combinations of defineBarLine were added in version 2.25. I downloaded version 2.25.9 and found that adding break resulted in inconsistent results using the defineBarLine with the Score.startRepeatBarType and Score.endRepeatBarType.

For example simply adding a \break before changing the Score.startRepeatBarType, i.e.:

      c d e f
      \break
      \set Score.startRepeatBarType = #"[[|:"

results in the bar line at the end of the first line to include the new start repeat bar type.

I've tried defining various combinatons of bar lines, as defined on the documentation for 2.25.9, e.g.:
  \defineBarLine "[[|:-StartDouble_fff" #'( #f #f #f )
  \defineBarLine "[[|:-EndDouble_fff" #'( #f #f #f )
  \defineBarLine "[[|:-StartDouble_ttf" #'( #t #t #f )
  \defineBarLine "[[|:-EndDouble_ttf" #'( #t #t #f )
  \defineBarLine "[[|:-StartDouble_ttt" #'( #t #t #t )
  \defineBarLine "[[|:-EndDouble_ttt" #'( #t #t #t )
but cannot get the results that I'd like, especially when alternatives are added to the repeat volta.

Any further suggestions?

Reply via email to