2

I'm absolutely new to lilypond and I find it extremely powerful. However, since it's my first time I'm using it I have a simple question.

Suppose I'm writing something for two group of instruments (here heckelphones and bassoons) I want to put the name of the groups, and also the name of each part (1,2,3 for heckelphones and 1,2,C for the bassoons). I wrote the following code:

\version "2.18.2"


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

scoreAOboeI = \relative c'' {
  \scoreAGlobal
  % Music follows here.

}

scoreAOboeII = \relative c'' {
  \scoreAGlobal
  % Music follows here.

}

scoreAOboeIII = \relative c'' {
  \scoreAGlobal
  % Music follows here.

}

scoreABassoonI = \relative c {
  \scoreAGlobal
  % Music follows here.

}

scoreABassoonII = \relative c {
  \scoreAGlobal
  % Music follows here.

}

scoreAContraBassoon = \relative c {
  \scoreAGlobal
  \transposition c
  % Music follows here.

}

scoreAOboeIPart = \new Staff \with {
  instrumentName = "1"
  shortInstrumentName = "1"
  midiInstrument = "oboe"
} \scoreAOboeI

scoreAOboeIIPart = \new Staff \with {
  instrumentName = "2"
  shortInstrumentName = "2"
  midiInstrument = "oboe"
} \scoreAOboeII

scoreAOboeIIIPart = \new Staff \with {
  instrumentName = "3"
  shortInstrumentName = "3"
  midiInstrument = "oboe"
} \scoreAOboeIII

scoreABassoonIPart = \new Staff \with {
  instrumentName = "1"
  shortInstrumentName = "1"
  midiInstrument = "bassoon"
} { \clef bass \scoreABassoonI }

scoreABassoonIIPart = \new Staff \with {
  instrumentName = "2"
  shortInstrumentName = "2"
  midiInstrument = "bassoon"
} { \clef bass \scoreABassoonII }

scoreAContraBassoonPart = \new Staff \with {
  instrumentName = "C."
  shortInstrumentName = "C."
  midiInstrument = "bassoon"
} { \clef bass \scoreAContraBassoon }

\score {
  <<
    \new StaffGroup <<
      \set StaffGroup.instrumentName = "Heckelphones"
      \scoreAOboeIPart
      \scoreAOboeIIPart
      \scoreAOboeIIIPart
    >>
    \new StaffGroup <<
      \set StaffGroup.instrumentName = "Bassoons"
      \scoreABassoonIPart
      \scoreABassoonIIPart
      \scoreAContraBassoonPart
    >>
  >>
  \header {
    piece = "1."
  }
  \layout { }
  \midi {
    \tempo 4=100
  }
}

It is almost perfect but the name of the group miserably clashes with the name of the part. How to avoid this?

1

One method is to use \vspace to scoot one or the other instrumentName out of the way e.g. instead of

instrumentName = "2"

say

instrumentName = \markup { \vspace #2 "2" }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.