%% 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.25.35/input/regression/polymetric-time-nested.ly"
\sourcefileline 0
\version "2.25.32"

\header {
  texidoc = "The @code{\\polymetric \\time} command allows setting different
time signatures in nested contexts.

In measure@tie{}2, the staff labeled ``Test'' should change to 5/5 time and the
two staves grouped with it should change to 3/3 time.

In measure@tie{}3, the staff labeled ``Test'' should remain in 5/5 time (no new
time signature printed), but the two staves grouped with it should revert to 1/1
time.

In measure@tie{}4, the staff labeled ``Test'' should revert to 1/1 time and the
two staves grouped with it should remain in 1/1 (no new time signature printed).

The two other staves should indicate 1/1 time from the start with no change at
any point."
}

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

\score {
  \layout {}
  \midi {}
  \fixed c' <<
    \time 1/1
    \new Staff = "A" { R1 R1 R1 R1 }
    \new StaffGroup <<
      {
        \skip 1
        %{ \context StaffGroup %} \polymetric \time 3/3

        \contextPropertyCheck StaffGroup.measureLength \default
        \contextPropertyCheck StaffGroup.meterScalingFactor 1
        \contextPropertyCheck StaffGroup.timeSignature 3/3

        \skip 1
        %{ \context StaffGroup %} \polymetric \default

        \contextPropertyCheck StaffGroup.measureLength \default
        \contextPropertyCheck StaffGroup.meterScalingFactor \default
        \contextPropertyCheck StaffGroup.timeSignature \default
      }
      \new Staff = "B" { R1 R1 R1 R1 }
      \new Staff = "C" \with { instrumentName = "Test" } {
        R1

        \context Staff \polymetric \time 5/5

        \contextPropertyCheck Staff.measureLength \default
        \contextPropertyCheck Staff.meterScalingFactor 1
        \contextPropertyCheck Staff.timeSignature 5/5

        R1
        R1

        \context Staff \polymetric \default
        %% A user would be well-advised to add \time 4/4 here, but omitting it
        %% probably makes a more sensitive test.

        \contextPropertyCheck Staff.measureLength \default
        \contextPropertyCheck Staff.meterScalingFactor \default
        \contextPropertyCheck Staff.timeSignature \default

        R1
      }
      \new Staff = "D" { R1 R1 R1 R1 }
    >>
    \new Staff = "E" { R1 R1 R1 R1 }
  >>
}



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