I want to have two staff groups, for purposes of illustration I have two staves per staff group. And for purposes of illustration the whole thing is in 4/4.

The first staff group has a figure that is 3 bars long, and the second has one 4 bars long. I'm showing double bars at each repetition -- every 3 bars in the first staff group and every 4 bars in the second. This is what I wanted to accomplish. To do this I had to use:

    \context {
      \Score
      \remove "Timing_translator"
      \remove "Default_bar_line_engraver"
    }

In fact, the example does everything I want, except I can't figure out how to get bar numbers to show up! Ideally one per bar at the top, but a bar number at the beginning of each system would be almost as good!

Attached is the complete barnumbers.ly

So many thanks,

William Zeitler


\version "2.18.2"

\header {
  title = "How to add Bar Numbers?"
  composer = "[email protected]"
}

global = {
  \key c \major
  \time 4/4
}

%%%%%%%%%%%%%%%%%
scoreAViolinI = \relative c'  {
  \global
  c4 d e f
  g a b a
  g f e d
  \bar "||"
  c d e f
  g a b a
  g f e d
  \bar "||"
  c d e f
  g a b a
  g f e d
  \bar "||"
  c d e f
  g a b a
  g f e d
  \bar "||"
}

scoreAViolinII = \relative c'  {
  \global
  c4 d e f
  g a b a
  g f e d
  \bar "||"
  c d e f
  g a b a
  g f e d
  \bar "||"
  c d e f
  g a b a
  g f e d
  \bar "||"
  c d e f
  g a b a
  g f e d
  \bar "||"
}


%%%%%%%%%%%%%%%%%
scoreACelloI = \relative c' {
  \global
  c4 b a g
  f e d c
  b c d e 
  f g a  b
  \bar "||"
  c4 b a g
  f e d c
  b c d e 
  f g a  b
  \bar "||"
  c4 b a g
  f e d c
  b c d e 
  f g a  b
  \bar "||"
}

scoreACelloII = \relative c' {
  \global
  c4 b a g
  f e d c
  b c d e 
  f g a  b
  \bar "||"
  c4 b a g
  f e d c
  b c d e 
  f g a  b
  \bar "||"
  c4 b a g
  f e d c
  b c d e 
  f g a  b
  \bar "||"
}


scoreAViolinIPart = \new Staff \with {
  instrumentName = "Violin I"
  midiInstrument = "violin"
} \scoreAViolinI

scoreAViolinIIPart = \new Staff \with {
  instrumentName = "Violin II"
  midiInstrument = "violin"
} \scoreAViolinII


scoreACelloIPart = \new Staff \with {
  instrumentName = "Cello I"
  midiInstrument = "Cello"
} { \clef bass \scoreACelloI }

scoreACelloIIPart = \new Staff \with {
  instrumentName = "Cello II"
  midiInstrument = "Cello"
} { \clef bass \scoreACelloII }


\score {
  <<
    \new StaffGroup <<
    \scoreAViolinIPart
    \scoreAViolinIIPart
    >>
    \new StaffGroup <<
    \scoreACelloIPart
    \scoreACelloIIPart
    >>
  >>
  \layout { 
    \context {
      \Score
      \remove "Timing_translator"
      \remove "Default_bar_line_engraver"
    }
    \context {
      \Staff
      \consists "Timing_translator"
      \consists "Default_bar_line_engraver"
    }
  }
  \midi {
    \tempo 4=100
  }
}
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to