% Title: Hopkinton
% Composer: William Billings
\version "2.10.10"

\include "english.ly"

#(ly:set-option 'point-and-click #f)

headerMarkup = \markup { "Billings: " " " \italic "Hopkinton" } 

#(set-global-staff-size 17)

\paper {
  #(set-paper-size "letter")
  top-margin = .3\in
  bottom-margin = .3\in
  left-margin = .75\in
  line-width = 7\in
  between-system-padding = 0.08\in
  page-top-space = 0\in
  %ragged-last-bottom = ##t
  
    myStaffSize = #17
  #(define fonts
    (make-pango-font-tree "Baskerville1757"
                          "Sans"
                          "Mono"
                           (/ myStaffSize 20)))
                           
    oddHeaderMarkup = \markup
    \fill-line {
      ""
      \on-the-fly #not-first-page \headerMarkup
      \on-the-fly #print-page-number-check-first \fromproperty #'page:page-number-string
    }

    evenHeaderMarkup = \markup
    \fill-line {
      \on-the-fly #print-page-number-check-first \fromproperty #'page:page-number-string
      \on-the-fly #not-first-page \headerMarkup
      ""
    }
}

tempoLargo =
    { \tag #'midiOnly { \tempo 4=80 } \tag #'scoreOnly { \tempo 4=80 } }
tempoAllegro = 
    { \tag #'midiOnly { \tempo 2=60 } \tag #'scoreOnly { \tempo 2=60 } }
tsLargo = { \time 2/2 }

tsAllegro = { \once \override Staff.TimeSignature #'style = #'() \time 2/2 }

global = {
  % main
  %\set Staff.forceClef = ##t
  %\set Staff.forceTime = ##f
  %\set Timing.defaultBarType = ""

  \override Staff.VerticalAxisGroup #'minimum-Y-extent = #'(-2 . 2)

  \key bf \major
  \time 2/4
  \tempo 4=120
  \skip 2*16
  \repeat volta 2 {
      \skip 2*13
  }
    
}

commonLyrics = \lyricmode {
    \tag #'alto \tag #'tenor \tag #'bass {
        Lo, He com -- eth, count -- less trum -- pets
    }
    blow be -- fore the bloo -- dy sign,
    \tag #'soprano \tag #'alto \tag #'bass {
        midst ten thou -- sand saints and an -- gels
    }
    see the cru -- ci -- fi -- ed  shine.
    
    Hal -- le -- lu -- jah,
    hal -- le -- lu -- jah,
    \tag #'soprano \tag #'alto \tag #'bass { hal -- le -- lu -- jah, }
    \tag #'soprano \tag #'tenor \tag #'bass { wel -- come, }
    wel -- come blee -- ding lamb,
    \tag #'tenor { wel -- come, }
    wel -- come blee -- ding lamb.
}

sopranoNotes = {
  \relative bf' {
    \set Staff.instrumentName = "Treble"
    \clef "treble"
            R 2*4
        %5
            bf8( c16 d) ef4 |
            f8( d) bf4 |
            f'8( ef) d( c)
            d2 |
            bf4 f |
        %10
            bf8( d) d( bf) |
            c8( a) c( a) |
            c8( ef) ef( c) |
            d8( bf) ef( c) |
            d8( f) f( ef) |
        %15
            d8( c) bf( c) |
            d2 |
        \repeat volta 2 {
            d4 c |
            bf4 bf |
            bf4 d |
        %20
            bf4 bf |
            g4 g |
            a4 a |
            bf4 d |
            ef4 c |
        %25
            d8( bf) bf4 |
            c2 |
            bf4 f' |
            ef4 c |
            d2 |
        }
  }
}

sopranoLyrics = \lyricmode {
    \keepWithTag #'soprano \commonLyrics
}

altoNotes = {
  \relative d' {
      \set Staff.instrumentName = "Counter"
      \clef "treble"
            d4 d |
            d8( f) f( d) |
            f4 f |
            g4 g |
        %5
            f4 g8.( a16) |
            bf4 a8( g) |
            f4 f |
            f2 |
            d4 d |
        %10
            d8( f) f( d) |
            f4 f |
            ef8( g) g( ef) |
            f4 g8.( a16) |
            bf4 a8( g) |
        %15
            f4 f |
            f2 |
        \repeat volta 2 {
            R2 |
            f4 f |
            bf4 a |
        %20
            g4 g |
            e4 e |
            f4 f |
            d4 d |
            g4 g |
        %25
            f4 bf |
            a2 |
            bf4 a |
            g4 f |
            f2 |
        }
  }
}

altoLyrics = \lyricmode {
    \keepWithTag #'alto \commonLyrics
}

%\noacc = { \once \override Accidental #'transparent = ##t }
%\ficnat = \markup { \tiny \natural }

tenorNotes = {
  \relative bf {
    \set Staff.instrumentName = "Tenor"
    \clef "treble_8"
            bf4 f |
            bf8( d) d( bf) |
            c8( a) c( a) |
            c8( ef) ef( c) |
        %5
            d8( bf) ef( c) |
            d8( f) f( ef) |
            d8( c) bf( a) |
            bf2 |
            R2 |
        %10
            R2*3 |
            bf8( c16 d) ef4 |
            f8( d) bf4 |
        %15
            f'8( ef) d( c) |
            bf2 |
        \repeat volta 2 {
            R2 |
            d4 d |
            f4 f |
        %20
            d4 d |
            c4 c |
            c4 c |
            bf4 bf |
            c4 ef |
        %25
            d2 |
            f4 f |
            d4 d |
            c8.( bf16) a4 |
            bf2 |
        }
  }
}

tenorLyrics = \lyricmode {
    \keepWithTag #'tenor \commonLyrics
}

bassNotes = {
  \relative bf, {
    \set Staff.instrumentName = "Bass"
    \clef "bass"
        \repeat unfold 2 {
            bf4 bf |
            bf4 bf |
            f'4 f |
            ef4 ef |
        %5
            d4 c |
            bf4 d8( ef) |
            f4 f, |
            bf2 |
        }
        %17
        \repeat volta 2 {
            bf'4 f |
            bf,4 bf |
            d4 d |
        %20
            g4 g |
            c,4 c |
            f4 f |
            g4 g |
            c,4 c |
        %25
            bf4 bf |
            f'2 |
            bf4 d,4 |
            ef4 f |
            bf,2 |
        }
            
  }
}

bassLyrics = \lyricmode {
    \keepWithTag #'bass \commonLyrics
}

engravedLine = #(string-append "Engraved by LilyPond " (lilypond-version))

\header {
	composer = \markup { \bigger { \bold \italic "William Billings" (1746-1800) }}
    %subtitle = ""
    poet = \markup { \bigger "John Cennick" }
    opus = \markup { \bigger {\italic "The Continental Harmony" (1794) }}
	title = \markup { \bigger \medium \italic "Hopkinton" }
    tagline = ""
    copyright = \markup { \center-align {
        "Copyright © 2006 by Michael Lauer."
        "This edition may be freely distributed, duplicated, performed, or recorded." 
        \engravedLine } } 
}

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 {
  \removeWithTag #'midiOnly \theMusic
  \layout {
    \context {
      \Score
      \override MetronomeMark #'transparent = ##t
      \override BarNumber #'padding = #2
    }
    \context {
        \Staff
        \override InstrumentName #'padding = #0.75
        \override InstrumentName #'font-size = #1
    }
    \context {
      \Lyrics
      \override LyricText #'font-series = #'medium
      \override LyricText #'font-size = #1
      %\override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1)
    }
  }
}

\score {
  \unfoldRepeats \removeWithTag #'scoreOnly  \theMusic

  
  \midi {
    \context {
      \Score
      tempoWholesPerMinute = #(ly:make-moment 120 4)
      }
    }



}
