Lilypond: repeat bar line do not show in polymeter music

805 views Asked by At

I am working with some polymetric music (i.e., different time signatures for individual instruments), and obviously the bar lines will not always coincide. To do this, I substitute the layout { } for the following code:

\layout { 
  \context { \Score 
    \remove "Timing_translator" 
    \remove "Time_signature_engraver" 
    \remove "Default_bar_line_engraver" 
  } 
  \context { \Staff
    \consists "Timing_translator" 
    \consists "Time_signature_engraver" 
    \consists "Default_bar_line_engraver" 
} 

Everything now works fine, except for the bar line engraver... if I try to add repeat bar lines, they will not appear in the final score! Not only that, but actually there will be NO bar lines at all on those points! Here is a complete example:

\version "2.17.24"
A =  { 
  \time 2/4 
  c'4 e' \bar "|:" g' c'' \bar ":|" e'' g'' \bar "|."
}
B = {
  \time 3/4              
  c''4 g' e' \bar "||" c' g c' \bar "|."
}
\score {
  <<
    \new Staff \A
    \new Staff \B
  >>
  \layout { 
    \context { \Score 
        \remove "Timing_translator" 
        \remove "Time_signature_engraver" 
        \remove "Default_bar_line_engraver" 
    } 
    \context { \Staff
        \consists "Timing_translator" 
        \consists "Time_signature_engraver" 
        \consists "Default_bar_line_engraver" 
    } 
  }  
} 

This code produces: enter image description here

Note how NO bar lines are shown on staff A. If we remove the /bar "|:" and /bar ":|", thus having A as simple as...

A =  { 
  \time 2/4 
  c'4 e' g' c'' e'' g'' \bar "|."
}

... the bar lines will show normally:

enter image description here

What can I possible do to solve this problem?

2

There are 2 answers

1
gilbertohasnofb On BEST ANSWER

The bar line engraver on the version 2.17 went through a lot of modifications when compared to older versions. The bar lines are not appearing due to wrong code. Here is the list with all correct bar lines commands for Lilypond 2.17:

http://www.lilypond.org/doc/v2.17/Documentation/notation/bars

0
gilbertohasnofb On

As for the automatic repeat bar lines, they will be shown if one moves the "Repeat_acknowledge_engraver" from the Score to the Staff context inside layout:

\version "2.17.24"
A =  { 
  \time 2/4 
  c'4 e' \repeat volta 2 { g' c'' } e'' g'' \bar "|."
}

\score {
    \new Staff \A
  \layout { 
    \context { \Score 
        \remove "Timing_translator" 
        \remove "Default_bar_line_engraver" 
        \remove "Repeat_acknowledge_engraver"
    } 
    \context { \Staff
        \consists "Timing_translator" 
        \consists "Default_bar_line_engraver" 
        \consists "Repeat_acknowledge_engraver"
    } 
  }  
} 

More on this issue: https://code.google.com/p/lilypond/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Stars%20Owner%20Patch%20Needs%20Summary&groupby=&sort=&id=3520