change of melody by setting associatedVoice.
* lily/parser.yy (re_rhythmed_music): \lyricsto implies lyrics mode.
2004-07-25 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/new-lyric-combine-music-iterator.cc (find_voice): allow
+ change of melody by setting associatedVoice.
+
+ * lily/parser.yy (re_rhythmed_music): \lyricsto implies lyrics mode.
+
* scripts/lilypond-book.py (Lilypond_file_snippet.ly): don't copy
file contents, rather \include them, so default linewidth is set.
(ly_options): make BOOKPAPER set of options. Move linewidth
@unnumbered New features in 2.3 since 2.2
@itemize @bullet
+@item The melody for a @code{\lyricsto} text can be changed during a melody.
+
+@item The @code{\lyricsto} keyword now automatically sets @code{\lyrics}.
@item The LilyPond binary now supports output options
@code{--dvi} @code{--png} @code{--ps} @code{--pdf} and
Contexts: @internalsref{Lyrics}, @internalsref{Melisma_translator}.
Examples: @inputfileref{input/template,satb.ly},
-@inputfileref{input/regression,lyric-combine-new.ly}.
+@inputfileref{input/regression,lyric-combine-new.ly},
+@c TODO: make separate section for melismata
+@inputfileref{input/test,lyrics-melisma-variants.ly}.
+@inputfileref{input/test,lyrics-melisma-faster.ly}.
@refbugs
--- /dev/null
+\header
+{
+ texidoc = "A faster lyrics line may be set to a melismatic melody by
+setting @code{ignoreMelismata}. A tricky aspect is that ignoreMelismata
+must be set a syllable too soon."
+
+}
+
+
+\paper {
+ raggedright = ##t
+}
+
+\version "2.3.8"
+
+<<
+ \relative \context Voice = "lahlah" {
+ \set Staff.autoBeaming = ##f
+ c4
+ \slurDotted
+ f8.[( g16])
+ }
+ \new Lyrics \lyricsto "lahlah" {
+ slo -- ow
+ }
+ \new Lyrics \lyricsto "lahlah" {
+ \set ignoreMelismata = ##t % applies to "fas"
+ go fas -- ter
+ \unset ignoreMelismata
+ }
+>>
--- /dev/null
+\header {
+
+texidoc = "You can switch the Voice context for a lyrics melody
+ during a lyrics line using @code{associatedVoice}. Here, the
+ syllables \"rannosau\" are set to triplets.
+
+A tricky aspect is that @code{associatedVoice} needs to be changed one
+syllable too soon.
+
+"
+}
+
+\paper {
+ raggedright = ##t
+}
+
+\version "2.3.8"
+
+<<
+ \relative \context Voice = "lahlah" {
+ \set Staff.autoBeaming = ##f
+ c4
+ <<
+ \context Voice = alternative {
+ \voiceOne
+ \times 2/3 {
+
+ % show associations clearly.
+ \override NoteColumn #'force-hshift = #-3
+ f8 f g
+ }
+ }
+ {
+ \voiceTwo
+ f8.[ g16]
+ \oneVoice
+ } >>
+ a8( b) c
+
+ }
+ \new Lyrics \lyricsto "lahlah" \lyrics {
+ Ju -- ras -- sic Park
+ }
+ \new Lyrics \lyricsto "lahlah" \lyrics {
+
+ % Tricky: need to set associatedVoice
+ % one syllable too soon!
+ \set associatedVoice = alternative % applies to "ran"
+ Ty --
+ ran --
+ no --
+ \set associatedVoice = lahlah % applies to "rus"
+ sau -- rus Rex
+ } >>
+
+
+
/*
-new-lyric-combine-iterator.cc -- implement New_lyric_combine_music_iterator
+ new-lyric-combine-iterator.cc -- implement New_lyric_combine_music_iterator
-source file of the GNU LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
-(c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
- */
+*/
#include "context.hh"
#include "lyric-combine-music.hh"
bool made_association_;
Context * lyrics_context_;
Context * music_context_;
+ SCM lyricsto_voice_name_;
+
Music_iterator * lyric_iter_;
};
Music *m = unsmob_music (get_music ()->get_property ("element"));
lyric_iter_ = unsmob_iterator (get_iterator (m));
+ lyricsto_voice_name_ = get_music ()->get_property ("associated-context");
+
+
find_voice ();
if (lyric_iter_)
void
New_lyric_combine_music_iterator::find_voice ()
{
- if (!music_context_)
+ SCM voice_name = lyricsto_voice_name_;
+ SCM running = lyrics_context_ ? lyrics_context_->get_property ("associatedVoice") : SCM_EOL;
+
+ if (ly_c_string_p (running))
+ voice_name = running;
+
+ if (ly_c_string_p (voice_name)
+ && (!music_context_ || ly_scm2string (voice_name) != music_context_->id_string ()))
{
- SCM voice_name = get_music ()->get_property ("associated-context");
-
- if (ly_c_string_p (voice_name))
- {
- Context *t = get_outlet ();
- while (t && t->get_parent_context ())
- t = t->get_parent_context ();
-
- String name = ly_scm2string (voice_name);
- Context *voice = find_context_below (t, ly_symbol2scm ("Voice"), name);
- if (voice)
- music_context_ = voice;
-
- }
+ /*
+ (spaghettini).
+
+ Need to set associatedVoiceContext again
+ */
+ if (music_context_)
+ made_association_ = false;
+
+ Context *t = get_outlet ();
+ while (t && t->get_parent_context ())
+ t = t->get_parent_context ();
+
+ String name = ly_scm2string (voice_name);
+ Context *voice = find_context_below (t, ly_symbol2scm ("Voice"), name);
+
+
+ if (voice)
+ music_context_ = voice;
}
if (lyrics_context_ && music_context_)
$$ = all;
scm_gc_unprotect_object ($1->self_scm ());
}
- | LYRICSTO string Music {
- Music *music = $3;
- SCM name = $2;
+ | LYRICSTO {
+ THIS->lexer_->push_lyric_state ();
+ } simple_string Music {
+ THIS->lexer_->pop_state ();
+ Music *music = $4;
+ SCM name = $3;
$$ = make_lyric_combine_music (name, music);
scm_gc_unprotect_object (music->self_scm ());
}