Jump to content

Hymn template: Difference between revisions

From LilyPond wiki
No edit summary
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
This code shows one way of setting out a hymn tune when each line starts and ends with a partial measure. It also shows how to add the verses as stand-alone text under the music.
This code shows one way of setting out a hymn tune where each line starts and ends with a partial measure. It also shows how to add the verses as stand-alone text under the music.


<lilypond version="2.24" full>
<lilypond version="2.24">
Timeline = {
Timeline = {
   \time 4/4
   \time 4/4
Line 25: Line 25:
}
}


BassMusic = \relative g {
BassMusic = \relative g {
   g4 g | g g g g | g g g g | g g g g | g2
   g4 g | g g g g | g g g g | g g g g | g2
   g4 g | g g g g | g g g g | g g g g | g2
   g4 g | g g g g | g g g g | g g g g | g2
Line 35: Line 35:


\score {  % Start score
\score {  % Start score
   <<
   \new PianoStaff <<  % Start pianostaff
    \new PianoStaff <<  % Start pianostaff
    \new Staff <<  % Start Staff = RH
      \new Staff <<  % Start Staff = RH
      \global
        \global
      \clef "treble"
        \clef "treble"
      \new Voice = "Soprano" <<  % Start Voice = "Soprano"
        \new Voice = "Soprano" <<  % Start Voice = "Soprano"
        \Timeline
          \Timeline
        \voiceOne
          \voiceOne
        \SopranoMusic
          \SopranoMusic
      >>  % End Voice = "Soprano"
        >>  % End Voice = "Soprano"
      \new Voice = "Alto" <<  % Start Voice = "Alto"
        \new Voice = "Alto" <<  % Start Voice = "Alto"
        \Timeline
          \Timeline
        \voiceTwo
          \voiceTwo
        \AltoMusic
          \AltoMusic
      >>  % End Voice = "Alto"
        >>  % End Voice = "Alto"
    >>  % End Staff = RH
      >>  % End Staff = RH
 
      \new Staff <<  % Start Staff = LH
    \new Staff <<  % Start Staff = LH
        \global
      \global
        \clef "bass"
      \clef "bass"
        \new Voice = "Tenor" <<  % Start Voice = "Tenor"
      \new Voice = "Tenor" <<  % Start Voice = "Tenor"
          \Timeline
        \Timeline
          \voiceOne
        \voiceOne
          \TenorMusic
        \TenorMusic
        >>  % End Voice = "Tenor"
      >>  % End Voice = "Tenor"
        \new Voice = "Bass" <<  % Start Voice = "Bass"
      \new Voice = "Bass" <<  % Start Voice = "Bass"
          \Timeline
        \Timeline
          \voiceTwo
        \voiceTwo
          \BassMusic
        \BassMusic
        >>  % End Voice = "Bass"
      >>  % End Voice = "Bass"
      >>  % End Staff = LH
    >>  % End Staff = LH
    >>  % End pianostaff
  >>  % End pianostaff
  >>
}  % End score
}  % End score


\markup {
\markup \fill-line {
  \fill-line {
  \left-column {
    ""
    "This is line one of the first verse"
    {
    "This is line two of the same"
      \column {
    \null
        \left-align {
    "And here's line one of the second verse"
          "This is line one of the first verse"
    "And the next line of the same"
          "This is line two of the same"
          "And here's line three of the first verse"
          "And the last line of the same"
        }
      }
    }
    ""
   }
   }
}
}
Line 95: Line 87:


\paper {  % Start paper block
\paper {  % Start paper block
   indent = 0     % don't indent first system
   indent = 0         % don't indent first system
   line-width = 130  % shorten line length to suit music
   line-width = 130  % shorten line length to suit music
   tagline = ##f % Don't print tag line, can be removed
   tagline = ##f     % Don't print tag line, can be removed
}  % End paper block
}  % End paper block
</lilypond>
</lilypond>


[[Category:Template]]
[[Category:Vocal music]]
[[Category:Vocal music]]
[[Category:Template]]
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]][[Category:Snippet]]
[[Category:Snippet]]

Latest revision as of 05:23, 13 December 2025

This code shows one way of setting out a hymn tune where each line starts and ends with a partial measure. It also shows how to add the verses as stand-alone text under the music.

\version "2.24"

Timeline = {
  \time 4/4
  \tempo 4=96
  \partial 2
  s2 | s1 | s2 \breathe s2 | s1 | s2 \caesura \break
  s2 | s1 | s2 \breathe s2 | s1 | s2 \fine
}

SopranoMusic = \relative g' {
  g4 g | g g g g | g g g g | g g g g | g2
  g4 g | g g g g | g g g g | g g g g | g2
}

AltoMusic = \relative c' {
  d4 d | d d d d | d d d d | d d d d | d2
  d4 d | d d d d | d d d d | d d d d | d2
}

TenorMusic = \relative a {
  b4 b | b b b b | b b b b | b b b b | b2
  b4 b | b b b b | b b b b | b b b b | b2
}

BassMusic = \relative g {
  g4 g | g g g g | g g g g | g g g g | g2
  g4 g | g g g g | g g g g | g g g g | g2
}

global = {
 \key g \major
}

\score {  % Start score
  \new PianoStaff <<  % Start pianostaff
    \new Staff <<  % Start Staff = RH
      \global
      \clef "treble"
      \new Voice = "Soprano" <<  % Start Voice = "Soprano"
        \Timeline
        \voiceOne
        \SopranoMusic
      >>  % End Voice = "Soprano"
      \new Voice = "Alto" <<  % Start Voice = "Alto"
        \Timeline
        \voiceTwo
        \AltoMusic
      >>  % End Voice = "Alto"
    >>  % End Staff = RH

    \new Staff <<  % Start Staff = LH
      \global
      \clef "bass"
      \new Voice = "Tenor" <<  % Start Voice = "Tenor"
        \Timeline
        \voiceOne
        \TenorMusic
      >>  % End Voice = "Tenor"
      \new Voice = "Bass" <<  % Start Voice = "Bass"
        \Timeline
        \voiceTwo
        \BassMusic
      >>  % End Voice = "Bass"
    >>  % End Staff = LH
  >>  % End pianostaff
}  % End score

\markup \fill-line {
  \left-column {
    "This is line one of the first verse"
    "This is line two of the same"
    \null
    "And here's line one of the second verse"
    "And the next line of the same"
  }
}

\layout {
  \context {
    \Score
    caesuraType = #'((bar-line . "||"))
    fineBarType = "||"
  }
}

\paper {  % Start paper block
  indent = 0         % don't indent first system
  line-width = 130   % shorten line length to suit music
  tagline = ##f      % Don't print tag line, can be removed
}  % End paper block