2004-08-02 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/parser.yy (new_lyrics): \addlyrics -> \oldaddlyrics,
+ \newlyrics -> \addlyrics
+
* lily/text-spanner.cc (print): use it.
* lily/dynamic-text-spanner.cc (print): use it.
The easiest way to add lyrics to a melody, is by appending
-@cindex \newlyrics
+@cindex \addlyrics
@example
- \newlyrics @{ @var{the lyrics} @}
+ \addlyrics @{ @var{the lyrics} @}
@end example
to a melody. Here is an example,
@lilypond[raggedright,verbatim]
\relative { \time 3/4 c2 e4 g2. }
- \newlyrics { play the game }
+ \addlyrics { play the game }
@end lilypond
More stanzas can be added by adding more
-@code{\newlyrics} sections
+@code{\addlyrics} sections
@lilypond[raggedright,verbatim]
\relative { \time 3/4 c2 e4 g2. }
- \newlyrics { play the game }
- \newlyrics { speel het spel }
- \newlyrics { joue le jeu }
+ \addlyrics { play the game }
+ \addlyrics { speel het spel }
+ \addlyrics { joue le jeu }
@end lilypond
-The @code{\newlyrics} keyword has three functions: it interprets the
+The @code{\addlyrics} keyword has three functions: it interprets the
following words as texts instead of notes, it sets up a context for
printing texts (the @code{Lyrics} context), and it couples the melody
with the lyrics, so the durations of both are aligned.
@lilypond[verbatim,raggedright]
\relative { c c g' }
-\newlyrics {
+\addlyrics {
twin -- \skip 4
kle
}
@lilypond[quote,verbatim,relative=2]
\context Voice {
\time 3/4 g2 e4 a2 f4 g2.
-} \newlyrics {
+} \addlyrics {
\set stanza = "1. "
Hi, my name is Bert.
-} \newlyrics {
+} \addlyrics {
\set stanza = "2. "
Oh, che -- ri, je t'aime
}
@lilypond[quote,verbatim,relative=2]
\context Voice {
\time 3/4 g2 e4 a2 f4 g2.
-} \newlyrics {
+} \addlyrics {
\set vocalName = "Bert "
Hi, my name is Bert.
-} \newlyrics {
+} \addlyrics {
\set vocalName = "Ernie "
Oh, che -- ri, je t'aime
}
}
@end lilypond
-@c FIXME: when/how/to what rename newlyrics?
The lyrics can be set to these notes, combining both with the
-@code{\newlyrics} keyword
+@code{\addlyrics} keyword
@lilypond[quote,verbatim,fragment,raggedright]
<<
r4 c \times 2/3 { f g g }
\times 2/3 { g4( a2) }
}
- \newlyrics { I want to break free }
+ \addlyrics { I want to break free }
>>
@end lilypond
r4 c \times 2/3 { f g g }
\times 2/3 { g4( a2) }
}
- \newlyrics { I want to break free __ }
+ \addlyrics { I want to break free __ }
>>
@end lilypond
\time 2/4
f4 f c' c
}
- \newlyrics { Twin -- kle twin -- kle }
+ \addlyrics { Twin -- kle twin -- kle }
>>
@end lilypond
<<
\new ChordNames \chords @{ @emph{chords} @}
@emph{the melody}
- \newlyrics @{ @emph{the text} @}
+ \addlyrics @{ @emph{the text} @}
>>
@}
@end example
r4 c' \times 2/3 { f g g }
\times 2/3 { g4( a2) }
}
- \newlyrics { I want to break free __ }
+ \addlyrics { I want to break free __ }
>>
@end lilypond
static Keyword_ent the_key_tab[] = {
{"accepts", ACCEPTS},
{"addquote", ADDQUOTE},
+ {"addlyrics", ADDLYRICS},
{"alias", ALIAS},
{"alternative", ALTERNATIVE},
{"bar", BAR},
{"midi", MIDI},
{"name", NAME},
{"new", NEWCONTEXT},
- {"newlyrics", NEWLYRICS},
{"notes", NOTES},
{"octave", OCTAVE},
{"once", ONCE},
deleting them. Let's hope that a stack overflow doesnt trigger a move
of the parse stack onto the heap. */
-%left NEWLYRICS
+%left ADDLYRICS
%union {
Book *book;
%token SCM_T
%token SCORE
%token SEQUENTIAL
-%token NEWLYRICS
+%token ADDLYRICS
%token SIMULTANEOUS
%token SKIP
%token SPANREQUEST
;
new_lyrics:
- NEWLYRICS { THIS->lexer_->push_lyric_state (); }
+ ADDLYRICS { THIS->lexer_->push_lyric_state (); }
/*cont */
Grouped_music_list {
/* Can also use Music at the expensive of two S/Rs similar to
$$ = scm_cons ($3->self_scm (), SCM_EOL);
#endif
}
- | new_lyrics NEWLYRICS { THIS->lexer_->push_lyric_state (); }
+ | new_lyrics ADDLYRICS { THIS->lexer_->push_lyric_state (); }
Grouped_music_list {
THIS->lexer_->pop_state ();
$$ = scm_cons ($4->self_scm (), $1);
'''neo_mensural -> neomensural, if-text-padding -> bound-padding'''))
+
+def conv (str):
+ str = re.sub (r'\\addlyrics', '\\oldaddlyrics', str)
+ str = re.sub (r'\\newlyrics', '\\addlyrics', str)
+ return str
+
+conversions.append (((2, 3, 10), conv,
+ '''\\addlyrics -> \\oldaddlyrics, \\newlyrics -> \\addlyrics'''))
+
+
+
def conv_mode_experiment (str):
str = re.sub (r'\\chords\b', r'\\chordmode', str)
str = re.sub (r'\\lyrics\b', r'\\lyricmode', str)