On 2023-11-11 05:57, Michael Werner wrote:
Hi Stu,

On Fri, Nov 10, 2023 at 11:18 AM Stu McKenzie <[email protected]> wrote:

    Thank you, Michael, for the working example.

You're quite welcome.

    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?


Yup. Try these:

  \defineBarLine "[[|:" #'( #f #t #f )
  \defineBarLine ":|]]" #'( #t #f #f )
  \defineBarLine ":|][[|:" #'( ":|]" "[[|:" #f)
  \defineBarLine ":|]][[|:" #'( ":|]]" "[[|:" #f)

As we want the end repeat to show up at the end of a line but not the beginning, and the start repeat to show at the beginning of a line but not the end, the eol and bol booleans need changed. Basically the two are the reverse of each other. So eol true for the end repeat, and bol true for the begin repeat. I've left the span-bar set false for both - the built-in single winged repeat appears to have it set to false, so I'm following along with that here. And yes, I goofed in my first message - I said it was beginning, mid and end of line. I skimmed the docs a bit too quickly there.  It is end of line, beginning, and span-bar (as in the bar spanning between staves when grouped, such as a StaffGroup).

 The next two are for use in \set Score.doubleRepeatBarType  They're the repeat sign that shows when two repeated sections are back to back. The first ( ":|][[|:" ) is going from a single winged repeat to a double winged, while the second is going from double to double. And with those, both the beginning of line and the end of line behavior are specified as separate entries. That way if there's a line break with either of them it should get the correct repeat sign either side of the line break.

So now we have:

\new Staff {
  \defineBarLine "[[|:" #'( #f #t #f )
  \defineBarLine ":|]]" #'( #t #f #f )
  \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
      \break
      \set Score.startRepeatBarType = #"[[|:"
      \set Score.endRepeatBarType = #":|]]"
      \repeat volta 2 {
        c d e f
      }
      \fine
    }
  }
}

producing:

image.png

and:

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

producing:

image.png

Hopefully this'll help get you a bit closer to what you're after.
--
Michael


Thanks again Michael.  I know how much time and effort you've taken to help me.  Much appreciated!

I noticed in your last example that bar 5 starts a spurious single bracket repeat that doesn't end.

I've revamped your last score as follows:
(1)
added an example of the use of both square bracket and "normal" repeat at bar 2;
(2)
added the "once" option in the first repeat section (bar 2) so that a "normal" repeat may be used within that section;
(3)
deleted the single bracket repeat (previously at bar 5);
(4)
added some comments and markup to assist anyone else who may want to do similar things.

\version "2.25.9"
\language "english"

\new Staff {
 % ****************************************************
 % Additional Bar Line Types for double square brackets
 % ****************************************************
 % Start of double
 \defineBarLine "[[|:" #'( #f #t #f )
 % End of double
 \defineBarLine ":|]]" #'( #t #f #f )
 % End of single and start of double
 \defineBarLine ":|][[|:" #'( ":|]" "[[|:" #f)
 % End of double and start of another double
 \defineBarLine ":|]][[|:" #'( ":|]]" "[[|:" #f)

 \new Voice {
  \relative c' {
   c' d e f

   % Use "once" so that the "normal" repeat bar type may be used within this "repeat volta"
   \once \set Score.startRepeatBarType = #"[|:"
   \repeat volta 2 {
    c^"Start single repeat" d e f
    \break
    % "normal" repeat bar lines
    \repeat volta 2 {
     c^"Start \"normal\" repeat" d e f
     c d^"End \"normal\" repeat" e f
    }
    c d^"End single repeat" e f
    % End the single repeat"
    \set Score.endRepeatBarType = #":|]"
   }
   \break

   c d e f

   % Single repeat bar type
   \set Score.startRepeatBarType = #"[|:"
   % End of single and start of double
   % Use doubleRepeatBarType instead of endRepeatBarType
   \set Score.doubleRepeatBarType = #":|][[|:"
   \repeat volta 2 {
    c^"Start single repeat" d e f
    c^"End single repeat, start double" d e f
   }
   \break

   % No startRepeatBarType required due to the use of doubleRepeatBarType above
   \set Score.endRepeatBarType = #":|]]"
   \repeat volta 2 {
     c d e f
     c^"End double repeat, start double" d e f
   }
   \set Score.endRepeatBarType = #":|]]"
   \repeat volta 2 {
    c d e f
    c^"End second double" d e f
   }
   c d e f
   \fine
  }
 }
}

I hope this helps others, Stu.

Reply via email to