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.6.0" melody = \relative c' { \clef treble \key c \major \time 4/4 a4 b c d } \score { \new Staff \melody \layout { } \midi { \tempo 4=60 } }
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.6.0" melody = \relative c' { \clef treble \key c \major \time 4/4 a4 b c d } text = \lyricmode { Aaa Bee Cee Dee } \score{ << \context Voice = one { \autoBeamOff \melody } \lyricsto "one" \new Lyrics \text >> \layout { } \midi { \tempo 4=60 } }
Want to prepare a lead sheet with a melody and chords? Look no further!
\version "2.6.0" 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 { << \context ChordNames { \set chordChanges = ##t \harmonies } \context Staff = one \melody >> \layout{ } \midi { \tempo 4=60} }
This template allows you to prepare a song with melody, words, and chords.
\version "2.6.0" 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 { << \context ChordNames { \set chordChanges = ##t \harmonies } \context Voice = one { \autoBeamOff \melody } \lyricsto "one" \new Lyrics \text >> \layout { } \midi { \tempo 4=60 } }
This page is for LilyPond-2.6.3 (stable-branch).