« Return to Thread: runover staff lines with hidden time signature

Re: runover staff lines with hidden time signature

by Alan Shaw :: Rate this Message:

Reply to Author | View in Thread

No one offered a workaround, so here is what I came up with myself. Maybe some more savvy people on the forum can have a look and tell me how it could be improved upon.

I simply put a white filled box in place of the time signature stencil. But it took a lot of fiddling to get something satisfactory. The only remaining flaw I see is that there is a slight leftward shift in the overall spacing around the time signature (not affecting the distance from the bar to the TS in the other staff, however). This is probably a result of initially reducing the X-extent of the TS, which, unfortunately, seems to be the crucial step for this approach to work. Otherwise the extra staff lines just get pushed out to the right of the box.

I know this probably seems like a low priority bug, but it was holding up work on my score. Others may possibly have a use for the workaround, so I've put it into a variable, as follows:

TSwo =  {
\once \override Staff.TimeSignature #'X-extent =  #'(0 . 2)
\once \override Staff.TimeSignature #'stencil = #ly:text-interface::print
\once \override Staff.TimeSignature #'text = \markup  {
\with-color #white \filled-box #'(-0.7 . 3) #'(-2.5 . 2.5)  #1 }
}

This can be put in place of the command to delete the TS stencil in the original snippet.

best,

Alan

Alan Shaw wrote:
I've seen discussion of a similar situation at the end of a line, where it can be fixed by adjusting break-visibility, but this is a little different. What I am trying to do is set certain passages where a choir and instruments play together, and the instruments then repeat without the choir. In the simplified snippet here, the first line shows basically what I want. The second line differs only in that the time signature changes right at the volta, and though I am able to hide the new time signature in the choir part, the staff lines around it still get drawn before \stopStaff takes effect. How can I fix this?

\version "2.12.2"

\layout  {
\context  { \Score
\remove "Volta_engraver"  
         } }
       
\score {
\relative
<<
%% no left repeat sign and chorus staff stops cleanly before volta bracket
\new Staff <<
{  \time 4/4 c'4 d e f \once \set Staff.whichBar = "|"
\repeat volta 2 {  a, b c d \stopStaff }
            \alternative  {
                 { s1 | }
                 { s1 | }
             }    
\break
\startStaff
 c4 d e f \once \set Staff.whichBar = "|"
\repeat volta 2 { a, b c d \stopStaff  \once \override Staff.TimeSignature #'stencil = ##f  \time 3/4 }
            \alternative  {
                   { s2. |   } % new time signature suppressed, but staff lines still run over
                   { s2. |  }
             }        
\startStaff          
        }
      >>      
\new Staff \with {
        \consists "Volta_engraver" }
<<
{ \time 4/4 c,4 d e f
\repeat volta 2 { a, b c d }
        \alternative  {
             { c2 d }       % instruments repeat
             { r2 r4 e8 e }
          }
\break
c4 d e f                
\repeat volta 2 { a b c d \time 3/4 }
            \alternative  {
                   { r4 r8 e8 e4 }
                   { fis8 g8 fis8 g8 fis8 g8 }
                 }
             }  
        >>
>>

\layout {   }
}

 « Return to Thread: runover staff lines with hidden time signature