From f5053e6c3e87ff57a4781a7e69fb1ca514c553f1 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 23 Feb 2008 21:07:14 -0300 Subject: [PATCH] Fix #532. In case that the lyrics name is "", don't go looking for an associated voice. --- .../regression/lyric-no-association-rhythm.ly | 26 +++++++++++++++++++ lily/lyric-engraver.cc | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 input/regression/lyric-no-association-rhythm.ly diff --git a/input/regression/lyric-no-association-rhythm.ly b/input/regression/lyric-no-association-rhythm.ly new file mode 100644 index 0000000000..782d48614b --- /dev/null +++ b/input/regression/lyric-no-association-rhythm.ly @@ -0,0 +1,26 @@ + +\header { + + texidoc = "When lyrics are not associated with specific voices, the + lyric placement should follow lyric rhythms. In particular, the + second syllable here should not be attached to the first note of the first staff." + +} + + +\version "2.11.40" +\layout { ragged-right = ##t } + +\score { + \context ChoirStaff << + \context Staff = soprano << + \context Voice = sop \relative c' { e2 e4 } + >> + \context Staff = alto << + \context Voice = alt \relative c' { e4 e4 e4 } + \new Lyrics \lyricmode { + do4 re4 me4 + } + >> + >> +} diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index 88b954f4fa..ce13839089 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -83,6 +83,10 @@ get_voice_to_lyrics (Context *lyrics) if (scm_is_string (voice_name)) nm = ly_scm2string (voice_name); + else if (nm == "") + { + return 0; + } else { ssize idx = nm.rfind ('-'); @@ -142,7 +146,7 @@ Lyric_engraver::stop_translation_timestep () if (text_) { Context *voice = get_voice_to_lyrics (context ()); - + if (voice) { Grob *head = get_current_note_head (voice); -- 2.39.5