% title: Cohasset
% composer: William Billings
% editor: Michael Lauer

\version "2.11.62"

\include "english.ly"
\include "../mrlUtil.ly"
\include "../mrlbillingsdefs.ly"

#(define GlobalStaffSize 17.5)
#(set-global-staff-size GlobalStaffSize)

#(ly:set-option 'point-and-click #f)

\paper{
  
    myStaffSize = #GlobalStaffSize
  #(define fonts
    (make-pango-font-tree "Baskerville1757"
                          "Sans"
                          "Mono"
                           (/ myStaffSize 20)))
}


global = {
  % main
  
  \override Staff.VerticalAxisGroup #'minimum-Y-extent = #'(-2 . 2)
  
  \set Staff.midiInstrument = "acoustic grand"

  \key a \minor

  \tsThreeTwo
  s1.*17
  \tsAllegro
  \repeat volta 2
  {
      s1*10 |
  } 
  
    
}

commonLyrics = \lyricmode {
    Life \tagST { is __ } \tagAB is the time __ to serve __ the Lord,
    The \tagST { time __ } \tagAB time t’in -- sure __ the great __ re -- ward,
    And while __  the \tagSB { lamp __ } \tagAT lamp holds out __ to burn,
    The vi -- lest sin -- ner may __ re -- turn.
    
    \tagS {
        And while the lamp holds out to burn, __
        The vi -- lest sin -- ner may __ re -- turn.
    }
    
    \tagA {
        And while the lamp holds out __ to burn,
        The vi -- lest sin -- ner may __ re -- turn.
    }
    
    \tagT {
        And while the lamp holds out to burn,
        The vi -- lest sin -- ner may re -- turn.
        The vi -- lest sin -- ner may __ re -- turn.
    }
    
    \tagB {
        And while the lamp holds out to burn,
        The vi -- lest sin -- ner may re -- turn. __
        The vi -- lest sin -- ner may re -- turn.
    }
}

sopranoNotes = {
    \relative a' {
        \set Staff.instrumentName = "Treble"
        \clef "treble"
            r2 r2 a2 |
            a4.( b8 c2) b2 |
            a2( b4. c8) d2 |
            e2( d4 c) b2 |
        %5
            a1 a2 |
            c4.( b8 a4. c8) b2 |
            g4.( a8 b2) b |
            c4.( e8 d4 c) b2 |
            c1 c2 |
        %10
            b2( a) b |
            b2( c) d |
            e4( d8 c b2) a |
            e'1 e2 |
            c4.( d8 e2) e |
        %15
            c4.( b8 a2) gs |
            a4( c b a) gs2 |
            a1 r2 |
            
            \repeat volta 2
            {
                R1 * 2 |
        %20
                R1 |
                e'2 e8( d) c4 |
                b4 b b b |
                a4.( gs8 a4) a |
                c4.( b8 c4) b |
        %25
                a4.( b8 a4) b |
                c4.( b8 a4) gs |
                a1 |
            }
        }
}

sopranoLyrics = \lyricmode {
    \keepWithTag #'soprano \commonLyrics
}

altoNotes = {
    \relative e' {
        \set Staff.instrumentName = \markup "Counter"
        \clef "treble"
        % Original clef:
        %\clef "neomensural-c3"
            r2 r2 e2 |
            e1 e2 |
            e4.( f8 g2) f |
            e2( f) e |
        %5
            e1 e2 |
            e1 f2 |
            e2( f) g |
            e2( a) gs |
            a1 a2 |
        %10
            g4.( f8 e2) g |
            g1 f2 |
            e4.( f8 g2) e |
            g1 g2 |
            a1 g2 |
        %15
            e1 e2 |
            e2( f) e |
            e1 r2 |
        
            \repeat volta 2
            {
                R1 |
                R1 |
        %20
                r2 e2 |
                c8([ d]) e( f) g4 g |
                g4.( f8 e4) d |
                e2. e4 |
                e2. e4 |
        %25
                e2. g4 |
                g4.( f8 e4) e |
                e1 |
            }
    }
}

altoLyrics = \lyricmode {
    \keepWithTag #'alto \commonLyrics
}

%noacc = { \once \override Accidental #'transparent = ##t }
%ficnat = \markup { \tiny \natural }

tenorNotes = {
    \relative a {
        \set Staff.instrumentName = "Tenor"
        \clef "treble_8"
            r2 r2 a2 |
            c4.( b8 a2) b |
            c4.( d8 e2) a, |
            c2( b4 a) gs2 |
        %5
            a1 e2 |
            a4.( b8 c2) d |
            e2( d) e |
            g2( f) e |
            e1 e2 |
        %10
            e4.( d8 c2) d |
            e1 a,2 |
            c4.( e8 d2) c |
            b1 c2 |
            e4.( d8 c2) b |
        %15
            a4.( b8 c2) b |
            c4.( e8 d4 c) b2 |
            a1 r2 |
            
            \repeat volta 2
            {
                R1 |
                e'2 c4 d |
        %20
                e8([ d]) c( b) a4 a |
                a4 a b c |
                d8([ c]) b([ a]) g8.([ a16]) g8.( f16) |
                e2. e4 |
                a4.( gs8 a4) b |
        %25
                c4.( b8 c4) d |
                e4.( d8 c4) b4 |
                a1 |
                
            }
    }
}

tenorLyrics = \lyricmode {
    \keepWithTag #'tenor \commonLyrics
}

bassNotes = {
    \relative a, {
        \set Staff.instrumentName = "Bass"
        \clef "bass"
            r2 r2 a2 |
            a1 e'2 |
            a2( e) d |
            c2( d) e |
        %5
            a,1 a2 |
            a1 b2 |
            c2( b) e |
            c2( d) e |
            a1 a2 |
        %10
            e2( a) g |
            e4.( d8 c2) d |
            c2( g') a |
            e1 e2 |
            a1 e2 |
        %15
            a,1 e'2 |
            c2( d) e |
            a,1 r2 |
            
            \repeat volta 2
            {
                e'2 c4 d |
                e8([ d]) c( b) a4 a |
        %20
                a2. a4 |
                a4 a e' e8( f) |
                g2 g, |
                c4.( b8 a4) a |
                a2. e'4 |
        %25
                a2. g4 |
                c,2 e |
                a,1 |
            }
    }
}

bassLyrics = \lyricmode {
    \keepWithTag #'bass \commonLyrics
}

#(define engravedLine (string-append 
    "Engraved by LilyPond (version "
    (lilypond-version)
    ")" ))
 
\header {
	composer = \markup { \larger { \basCaps "William Billings" (1746-1800) }}
    opus = \markup { \larger {\italic 
        { The Continental Harmony } (1794) }}
    title = \markup { \larger \medium \italic "Cohasset" }
    poet = \markup { \larger "“Words by Dr. Watts”" }
    piece = \markup { \larger { Hymn i:88 } }
    copyright = \markup { \center-column {
        "Edition copyright © 2008 by Michael Lauer."
        "This edition may be freely distributed, duplicated, performed, or recorded." } }
    
    headerMarkup = \markup { "Billings:" \italic "Cohasset" } 

}

theMusic = 
  \context ChoirStaff = choir <<
      \new Staff {
        \context Voice =
          sopranoNotes << \global \sopranoNotes >>
      }
      \lyricsto sopranoNotes \new Lyrics { \sopranoLyrics }
      \new Staff {
        \context Voice =
          altoNotes << \global \altoNotes >>
      }
      \lyricsto altoNotes \new Lyrics { \altoLyrics }
      \new Staff {
        \context Voice =
          tenorNotes << \global \tenorNotes >>
      }
      \lyricsto tenorNotes \new Lyrics { \tenorLyrics }
      \new Staff {
        \context Voice =
          bassNotes << \global \bassNotes >>
      }
      \lyricsto bassNotes \new Lyrics { \bassLyrics }
  >>
  
  
\score {
    \theMusic
}

\score {
    
    \unfoldRepeats \theMusic
  
    \midi {    }


}
