@cindex variables
-Another great shorthand is the ability to define variables (see
-@ref{Organizing pieces with variables}. All the templates use this
+Another great shorthand is the ability to define variables, as
+shown in @ref{Organizing pieces with variables}. All the
+templates use this:
@example
melody = \relative c' @{
\clef "treble"
\key g \major
\time 3/4
- g g g b b b
+ g g g | b b b |
}
versewords = \lyricmode {
One two three four five six
\clef "treble"
\key g \major
\time 3/4
- g g g b b b
+ g g g | b b b |
}
refrainnotesA = \relative c'' {
\time 2/4
- c c g g \bar "|."
+ c c | g g \bar "|."
}
refrainnotesB = \relative c {
\clef "bass"
\key g \major
- c e d d
+ c e | d d |
}
versewords = \lyricmode {
One two three four five six
\clef "treble"
\key g \major
\time 3/4
- g g g b b b
+ g g g | b b b |
}
refrainnotesA = \relative c'' {
\time 2/4
- c c g g \bar "|."
+ c c | g g \bar "|."
}
refrainnotesB = \relative c {
\clef "bass"
\key g \major
- c e d d
+ c e | d d |
}
versewords = \lyricmode {
One two three four five six
}
\layout {
\context {
- \Staff extraNatural = ##t
+ \Staff
+ extraNatural = ##t
}
}
}
<<
\new Staff <<
\relative c'' {
- c a b g
- }
- >>
+ c a b g
+ }
+ >>
\new Staff <<
\relative c' {
- c a b g
- }
- >>
+ c a b g
+ }
+ >>
\new Staff <<
\clef "G_8"
\relative c' {
- c a b g
- }
- >>
+ c a b g
+ }
+ >>
\new Staff <<
\clef "bass"
\relative c {
- c a b g
- }
+ c a b g
+ }
+ >>
>>
->>
\layout {
\context {
\Staff
@cindex template, modifying
@cindex modifying templates
-Start off with the template that seems closest to what you want to end
-up with. Let's say that you want to write something for soprano and
-cello. In this case, we would start with the @q{Notes and lyrics} template (for the
-soprano part).
+Start off with the template that seems closest to what you want to
+end up with. Let's say that you want to write something for
+soprano and cello. In this case, we would start with the
+@q{Notes and lyrics} template (for the soprano part).
@example
\version @w{"@version{}"}
@}
\new Lyrics \lyricsto "one" \sopranoLyrics
>>
- \new Staff
- \celloMusic
+ \new Staff \celloMusic
>>
\layout @{ @}
\midi @{ @}
}
\new Lyrics \lyricsto "one" \sopranoLyrics
>>
- \new Staff
- \celloMusic
+ \new Staff \celloMusic
>>
\layout { }
\midi { }
}
>>
\new Lyrics \lyricsto "basses" {
- \bassWords
- }
- >> % end ChoirStaff
+ \bassWords
+ }
+ >> % end ChoirStaff
\new PianoStaff <<
\set PianoStaff.instrumentName = #"Piano"
\new Staff = "upper" \upper
@}
>>
\new Lyrics \lyricsto "altos" @{
- \altoWords
+ \altoWords
@}
\new Staff = "tenors" <<
\set Staff.instrumentName = #"Tenor"
}
sopranoMusic = \relative c'' {
\clef "treble"
- r4 d2 a4 | d4. d8 a2 | cis4 d cis2
+ r4 d2 a4 | d4. d8 a2 | cis4 d cis2 |
}
sopranoWords = \lyricmode {
Wor -- thy is the lamb that was slain
\new Staff = "tenors" <<
\set Staff.instrumentName = #"Tenor"
\new Voice = "tenors" {
- \global
- \tenorMusic
- }
- >>
+ \global
+ \tenorMusic
+ }
+ >>
\new Lyrics \lyricsto "tenors" {
\tenorWords
}
\clef "bass"
\new Voice @{
\PedalOrganMusic
- @}
+ @}
>> % end PedalOrgan Staff
>>
@} % end Score context
c4._\markup @{ \italic \bold dolce @} b8 a8 g a b
\once \override TextScript #'padding = #5.0
c4.^"hi there!" d8 e' f g d
- c,4.\markup @{ \dynamic f \italic \small @{ 2nd @} \hspace #0.1 \dynamic p @}
+ c,4.\markup @{ \dynamic f \italic \small @{ 2nd @}
+ \hspace #0.1 \dynamic p @}
b8 c4 c-.
@}
@}