%% Generated by lilypond-book
%% Options: [exampleindent=10.16\mm,indent=0\mm,line-width=160\mm,paper-height=845.047\pt,paper-width=597.508\pt,papersize='(cons (* 597.508 pt) (* 845.047 pt))]
\include "lilypond-book-preamble.ly"


% ****************************************************************
% Start cut-&-pastable-section
% ****************************************************************

#(ly:set-option 'eps-box-padding 3.000000)



\paper {
  #(set-paper-size '(cons (* 597.508 pt) (* 845.047 pt)))
  indent = 0\mm
  line-width = 160\mm
  % offset the left padding, also add 1mm as lilypond creates cropped
  % images with a little space on the right
  line-width = #(- line-width (* mm  3.000000) (* mm 1))
}

\layout {
  
}




% ****************************************************************
% ly snippet:
% ****************************************************************
\sourcefilename "/lilypond-2.26.0/input/regression/bar-check-after-cadenza-warn.ly"
\sourcefileline 0
\version "2.25.6"

#(ly:set-option 'warning-as-error #t)

\header {
  texidoc = "Music between @code{\\cadenzaOn} and @code{\\cadenzaOff}
does not count toward the length of a measure; however when a cadenza
begins at a measure boundary, bar checks during or immediately after
the cadenza do produce warnings.  This test should run with expected
warnings only."
}

%% Except where noted, each of the following scores should warn once.
#(ly:expect-warning
  (ly:translate-cpp-warning-scheme "bar check failed at: %s")  0)
#(ly:expect-warning
  (ly:translate-cpp-warning-scheme "bar check failed at: %s")  0)
#(ly:expect-warning
  (ly:translate-cpp-warning-scheme "bar check failed at: %s")  0)
#(ly:expect-warning
  (ly:translate-cpp-warning-scheme "bar check failed at: %s")  0)
#(ly:expect-warning
  (ly:translate-cpp-warning-scheme "bar check failed at: %s")  0)
#(ly:expect-warning
  (ly:translate-cpp-warning-scheme "bar check failed at: %s")  0)

%% no anacrusis, first measure begins with cadenza
\new Score { \cadenzaOn c'4 \cadenzaOff | d'1 }

%% anacrusis, first measure begins with cadenza
\new Score { \partial 4 r4 | \cadenzaOn c'4 \cadenzaOff | d'1 }

%% second measure begins with cadenza
\new Score { e'1 | \cadenzaOn c'4 \cadenzaOff | d'1 }

%% bar check during cadenza
\new Score { e'1 | \cadenzaOn c'4 | c'4 \cadenzaOff }

%% cadenza starting at a measure boundary arising from restoring
%% timing properties after a partial first alternative
\new Score {
  \partial 4
  \repeat volta 2 {
    e'4
    \alternative {
      \volta 1 { e'2. }
      \volta 2 { \cadenzaOn c'4 \cadenzaOff | d'1 }
    }
  }
}

%% cadenza as the body of a volta-style repeat, with the first
%% alternative not ending on a measure boundary
\new Score {
  \partial 4
  \repeat volta 2 {
    e'4
    \cadenzaOn c'4 \cadenzaOff
    \alternative {
      \volta 1 { e'2. }
      \volta 2 { | d'1 }
    }
  }
}

%% cadenza as the body of a volta-style repeat, with the first
%% alternative ending on a measure boundary
\new Score {
  \repeat volta 2 {
    \cadenzaOn c'4 \cadenzaOff
    \alternative {
      \volta 1 { a'1 }
      %% TODO: A warning would be nice but the current implementation
      %% can't distinguish this from a valid bar check at the end of
      %% the previous alternative.  A false negative in this case is
      %% preferable to a false positive in the other.
      \volta 2 { | b'1 }
    }
  }
}



% ****************************************************************
% end ly snippet
% ****************************************************************
