From a370b95bd75ae2bbddccba80eaf9484aa3937a21 Mon Sep 17 00:00:00 2001 From: hanwen Date: Mon, 2 Aug 2004 17:40:46 +0000 Subject: [PATCH] (new_lyrics): \addlyrics -> \oldaddlyrics, \newlyrics -> \addlyrics --- ChangeLog | 3 +++ Documentation/user/notation.itely | 26 +++++++++++++------------- Documentation/user/tutorial.itely | 13 ++++++------- lily/lily-lexer.cc | 2 +- lily/parser.yy | 8 ++++---- scripts/convert-ly.py | 11 +++++++++++ 6 files changed, 38 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 455ccb2102..2bf659a3bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-08-02 Han-Wen Nienhuys + * lily/parser.yy (new_lyrics): \addlyrics -> \oldaddlyrics, + \newlyrics -> \addlyrics + * lily/text-spanner.cc (print): use it. * lily/dynamic-text-spanner.cc (print): use it. diff --git a/Documentation/user/notation.itely b/Documentation/user/notation.itely index 9bf63f9738..a113e720fa 100644 --- a/Documentation/user/notation.itely +++ b/Documentation/user/notation.itely @@ -3550,29 +3550,29 @@ noFlag = \once \override Stem #'flag-style = #'no-flag 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. @@ -3878,7 +3878,7 @@ For example, @lilypond[verbatim,raggedright] \relative { c c g' } -\newlyrics { +\addlyrics { twin -- \skip 4 kle } @@ -3984,10 +3984,10 @@ Stanza numbers can be added by setting @code{stanza}, e.g. @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 } @@ -4003,10 +4003,10 @@ the line, just like instrument names. They are created by setting @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 } diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index 7fdb20242e..49765a2528 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -979,9 +979,8 @@ Consider the melody } @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] << @@ -989,7 +988,7 @@ The lyrics can be set to these notes, combining both with the 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 @@ -1010,7 +1009,7 @@ line}. It is entered as two underscores, i.e., 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 @@ -1027,7 +1026,7 @@ Twin -- kle twin -- kle \time 2/4 f4 f c' c } - \newlyrics { Twin -- kle twin -- kle } + \addlyrics { Twin -- kle twin -- kle } >> @end lilypond @@ -1116,7 +1115,7 @@ a lead sheet, for example, << \new ChordNames \chords @{ @emph{chords} @} @emph{the melody} - \newlyrics @{ @emph{the text} @} + \addlyrics @{ @emph{the text} @} >> @} @end example @@ -1128,7 +1127,7 @@ a lead sheet, for 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 diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index 49e680a122..2f926ea674 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -27,6 +27,7 @@ static Keyword_ent the_key_tab[] = { {"accepts", ACCEPTS}, {"addquote", ADDQUOTE}, + {"addlyrics", ADDLYRICS}, {"alias", ALIAS}, {"alternative", ALTERNATIVE}, {"bar", BAR}, @@ -52,7 +53,6 @@ static Keyword_ent the_key_tab[] = { {"midi", MIDI}, {"name", NAME}, {"new", NEWCONTEXT}, - {"newlyrics", NEWLYRICS}, {"notes", NOTES}, {"octave", OCTAVE}, {"once", ONCE}, diff --git a/lily/parser.yy b/lily/parser.yy index 6326421b81..0c9f9e5440 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -189,7 +189,7 @@ make_lyric_combine_music (SCM name, Music *music) 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; @@ -294,7 +294,7 @@ or %token SCM_T %token SCORE %token SEQUENTIAL -%token NEWLYRICS +%token ADDLYRICS %token SIMULTANEOUS %token SKIP %token SPANREQUEST @@ -1180,7 +1180,7 @@ relative_music: ; 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 @@ -1194,7 +1194,7 @@ new_lyrics: $$ = 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); diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 12aeb22c94..39c20aabd1 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -2135,6 +2135,17 @@ conversions.append (((2, 3, 9), conv, '''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) -- 2.39.5