Next: , Up: Templates


D.1 Single staff

D.1.1 Notes only

The first example gives you a staff with notes, suitable for a solo instrument or a melodic fragment. Cut and paste this into a file, add notes, and you're finished!

     
     \version "2.10.10"
     melody = \relative c' {
        \clef treble
        \key c \major
        \time 4/4
     
        a4 b c d
     }
     
     \score {
        \new Staff \melody
        \layout { }
        \midi {}
     }

[image of music]

D.1.2 Notes and lyrics

The next example demonstrates a simple melody with lyrics. Cut and paste, add notes, then words for the lyrics. This example turns off automatic beaming, which is common for vocal parts. If you want to use automatic beaming, you'll have to change or comment out the relevant line.

     
     \version "2.10.10"
     melody = \relative c' {
        \clef treble
        \key c \major
        \time 4/4
     
        a4 b c d
     }
     
     text = \lyricmode {
        Aaa Bee Cee Dee
     }
     
     \score{
        <<
           \new Voice = "one" {
              \autoBeamOff
              \melody
           }
           \new Lyrics \lyricsto "one" \text
        >>
        \layout { }
        \midi { }
     }

[image of music]

D.1.3 Notes and chords

Want to prepare a lead sheet with a melody and chords? Look no further!

     
     \version "2.10.10"
     melody = \relative c' {
        \clef treble
        \key c \major
        \time 4/4
     
        f4 e8[ c] d4 g |
        a2 ~ a2 |
     }
     
     harmonies = \chordmode {
        c4:m f:min7 g:maj c:aug d2:dim b:sus
     }
     
     \score {
        <<
           \new ChordNames {
              \set chordChanges = ##t
              \harmonies
           }
        \new Staff \melody
        >>
     
        \layout{ }
        \midi { }
     }

[image of music]

D.1.4 Notes, lyrics, and chords.

This template allows you to prepare a song with melody, words, and chords.

     
     \version "2.10.10"
     melody = \relative c' {
        \clef treble
        \key c \major
        \time 4/4
     
        a b c d
     }
     
     text = \lyricmode {
        Aaa Bee Cee Dee
     }
     
     harmonies = \chordmode {
        a2 c2
     }
     
     \score {
        <<
           \new ChordNames {
              \set chordChanges = ##t
              \harmonies
           }
        \new Voice = "one" {
           \autoBeamOff
           \melody
        }
        \new Lyrics \lyricsto "one" \text
        >>
        \layout { }
        \midi { }
     }

[image of music]



Next: , Up: Templates

This page is for LilyPond-2.10.33 (stable-branch).

Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.