@}
@end example
-@noindent
-but most examples also make use of the @code{\relative c'}
+Most examples also make use of the @code{\relative c'}
(or @code{c''}) command. This is not necessary to merely
compile the examples, but in most cases the output will
look very odd if you omit the @code{\relative c'}.
\score @{
\relative c'' @{
c4 a b c
- @}
+ @}
@}
@end example
@example
@{
\new GrandStaff <<
- insert the whole score of a Wagner opera in here
- >>
+ insert the whole score of a Wagner opera in here
+ >>
@}
@end example
@example
\score @{
@{ c'4 a b c' @}
- \layout @{ @}
- \paper @{ @}
- \midi @{ @}
- \header @{ @}
+ \layout @{ @}
+ \paper @{ @}
+ \midi @{ @}
+ \header @{ @}
@}
@end example
@end example
When LilyPond looks at this file, it takes the value of
-@code{melody} (ie everything to the right of the
-@code{melody = }) and inserts it whenever it sees
+@code{melody} and inserts it whenever it sees
@code{\melody}. There's nothing special about the
-name @code{melody}, @code{global}, @code{pianorighthand},
-or @code{foofoobarbaz}. You can use whatever variable
-names you want.
+names -- it could be @code{melody}, @code{global},
+@code{pianorighthand}, or @code{foofoobarbaz}. You
+can use whatever variable names you want.
For a complete definition
of the input format, see @ref{File structure}.
insert the whole score of a Wagner opera in here
>>
@} % this brace ends the overall music expression
- \layout @{ @}
+ \layout @{ @}
@}
@end example
\score @{
@{
<<
- \context Staff = singer @{
- @}
- \context PianoStaff = piano @{
- @}
+ \context Staff = singer @{
+ @}
+ \context PianoStaff = piano @{
+ @}
>>
@}
\layout @{ @}
\score @{
@{
<<
- \context Staff = singer @{
- \context Voice = vocal @{ @}
- \lyricsto vocal \new Lyrics @{ @}
- @}
- \context PianoStaff = piano @{
- \context Staff = upper @{ @}
- \context Staff = lower @{ @}
- @}
+ \context Staff = singer @{
+ \context Voice = vocal @{ @}
+ \lyricsto vocal \new Lyrics @{ @}
+ @}
+ \context PianoStaff = piano @{
+ \context Staff = upper @{ @}
+ \context Staff = lower @{ @}
+ @}
>>
@}
\layout @{ @}
@end example
Now we have a lot more details. We have the singer's
-staff. It contains a @code{Voice} (in LilyPond, this
+staff: it contains a @code{Voice} (in LilyPond, this
term refers to a set of notes, not necessarily vocal
notes -- for example, a violin generally plays one
-voice) and some lyrics. The piano contains an upper
-staff (right hand) and a lower staff (left hand).
+voice) and some lyrics. We also have a piano staff:
+it contains an upper staff (right hand) and a lower
+staff (left hand).
At this stage, we could start filling in notes. Inside
the curly braces next to @code{\context Voice = vocal},
\score @{
@{
<<
- \context Staff = singer @{
- \context Voice = vocal @{ \melody @}
- \lyricsto vocal \new Lyrics @{ \text @}
- @}
- \context PianoStaff = piano @{
- \context Staff = upper @{ \upper @}
- \context Staff = lower @{ \lower @}
- @}
+ \context Staff = singer @{
+ \context Voice = vocal @{ \melody @}
+ \lyricsto vocal \new Lyrics @{ \text @}
+ @}
+ \context PianoStaff = piano @{
+ \context Staff = upper @{ \upper @}
+ \context Staff = lower @{ \lower @}
+ @}
>>
@}
\layout @{ @}
In an extreme case, you might end up with only
@example
-\score @{ <<
- % \melody
- % \harmony
- % \bass
->>
+\score @{
+ <<
+ % \melody
+ % \harmony
+ % \bass
+ >>
\layout@{@}
@}
@end example
@noindent
-(in other words, an empty file)
+(in other words, a file without any music)
If that happens, don't give up. Uncomment a bit -- say,
-the bass part -- and see if it works. If it doesn't,
+the bass part -- and see if it works. If it doesn't work,
then comment out all of the bass music (but leave
@code{\bass} in the @code{\score} uncommented.