A template for typesetting choir scores in Lilypond

LilyPond is LaTeX for music. You write down the music in a text file, typeset it with LilyPond and the output is a pdf containing sheet music in a beautiful layout. They have very good tutorials at the web page, so head over there to learn more. I just wanted to put my template for choir scores here for future reference.

\version "2.16.0" 


\header {
   title = "Titel"
   composer = "Composer"
}

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


sopran = \relative c' {
   c4 d e f
   g1   
   \bar "|." 
} 

alt = \relative c' {
   c4 c c c
   c1
} 

tenor = \relative c {
   c4 d e f
   g1
}

bass = \relative c {
   c4 c c c
   c1
}


strophe = \lyricmode {
   Sing -- ing as a test!
} 


% == Part for pdf ==
\score {
<<
   \new ChoirStaff <<
      
      \new Staff  = "Frauen"<<
         \new Voice = "Sopran" { \voiceOne \global  \sopran }
         \new Voice = "Alt" { \voiceTwo \global  \alt }
         \new Lyrics \lyricsto "Sopran" \strophe 
      >>
      
      \new Staff = "Maenner"<<
         \clef bass
         \new Voice = "Tenor" {\voiceOne \global \tenor }
         \new Voice = "Bass" { \voiceTwo \global  \bass }
         \new Lyrics \lyricsto "Tenor" \strophe 
      >>

   >>
>>

\layout {
   indent = 0.0\cm
   \context {\Score 
   }
}

}


% == Part for midi ==
\score { \unfoldRepeats
<<
   \new ChoirStaff <<      
      \new Staff <<
         \new Voice = "Sopran" { \global  \sopran }
      >>
      \new Staff <<
         \new Voice = "Alt" { \global  \alt }
      >>
      \new Staff <<
         \new Voice = "Tenor" { \global  \tenor }
      >>
      \new Staff <<
         \new Voice = "Bass" { \global  \bass }
      >>
   >>
>>
\midi {
   \tempo 4=112
   \set Staff.midiInstrument = "voice oohs" 
}

}

The parts sopran, alt, tenor, bass contain the music for the respective voices. strophe contains the text.

The first score element is for creating the pdf – that’s what the layout part is for. We will have two parallel staves (lines) of music, one for the women voices with a treble clef, one for the men voices with a bass clef. The text will be typeset below each staff, distributed to the notes according to the voices of soprano and tenor.

The second score element is for creating the midi – hence the midi part. Here we separate the four voices into four staves, so that we can turn them on and off separately in a midi player. The unfoldRepeats command is necessary if your piece has voltas (repetitions). You need the command to get the midid to include the repetitions at the places you specify them. Otherwise it will just skip ahead to the next part which is usually not what you want.

That’s it, have fun!

This entry was posted in LilyPond and tagged , , by swk. Bookmark the permalink.

About swk

I am a computational linguist, teacher of computer science and above all a huge fan of LaTeX. I use LaTeX for everything, including things you never wanted to do with LaTeX. My latest love is lilypond, aka LaTeX for music. I'll post at irregular intervals about cool stuff, stupid hacks and annoying settings I want to remember for the future.