Hi,

according to
  http://www.opensubscriber.com/message/bug-lilyp...@gnu.org/3567106.html
lyrics syllables associated with grace notes have been disabled some
time ago. However, I would like to put syllables to grace notes but
could not find out how to do this with current versions of lilypond. As
of
  http://lists.gnu.org/archive/html/lilypond-user/2010-03/msg00362.html
there seem to be also other people with the same concern. Hence the
proposed patch attached.

It worked for me with \grace and \appoggiatura notes but lilypond
showed warnings nevertheless (as noted in the patched
`Documentation/notation/vocal.itely'). I tried to fix these spurious
warnings but failed. The patch applies to current git
(d2f1fdc35a9764f749a99a54db7bb988f455c3ed).

Please let me know whether you like the patch or whether lyrics for
grace notes are already possible another way.

Thanks,
Richard Gay
>From 7a18b8451f94efe722e6b446b9702f80eb391793 Mon Sep 17 00:00:00 2001
From: Richard Gay <richard....@t-online.de>
Date: Tue, 30 Mar 2010 16:56:00 +0200
Subject: [PATCH] includeGraceNotes: lyrics syllables of grace notes

---
 Documentation/notation/vocal.itely   |   27 +++++++++++++++++++++++++++
 lily/lyric-combine-music-iterator.cc |    3 +--
 scm/define-context-properties.scm    |    1 +
 3 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/Documentation/notation/vocal.itely b/Documentation/notation/vocal.itely
index 34f6cc4..0182c7b 100644
--- a/Documentation/notation/vocal.itely
+++ b/Documentation/notation/vocal.itely
@@ -1152,6 +1152,33 @@ not work if prefixed with @code{\once}.  It is necessary to use
 @code{\set} and @code{\unset} to bracket the lyrics where melismata
 are to be ignored.
 
+...@subsubheading Adding syllables to grace notes
+
+By default, grace notes (e.g. via @code{\grace}) do not get assigned
+syllables when using @code{\lyricsto}. This behavior can be changed by
+setting @code{includeGraceNotes} in the Lyrics context.
+
+...@lilypond[verbatim,ragged-right,quote]
+<<
+  {
+	f'4 \appoggiatura b'32 c''4
+	\grace { f'16 [a'16] } c''2
+  }
+  \addlyrics {
+	foo
+    \set includeGraceNotes = ##t
+	bar,
+	foo -- hoo bar
+  }
+>>
+...@end lilypond
+
+...@knownissues
+Even in cases when syllables are placed correctly,
+...@code{includegracenotes} causes warnings (@code{warning: Lyric
+syllable does not have note.}) to be printed for syllables under grace
+notes.
+
 @subsubheading Switching to an alternative melody
 
 More complex variations in text underlay are possible.  It is possible
diff --git a/lily/lyric-combine-music-iterator.cc b/lily/lyric-combine-music-iterator.cc
index 7b304cf..ddf7fd1 100644
--- a/lily/lyric-combine-music-iterator.cc
+++ b/lily/lyric-combine-music-iterator.cc
@@ -293,14 +293,13 @@ Lyric_combine_music_iterator::process (Moment /* when */)
       set_music_context (0);
     }
 
-
   if (music_context_
       && (start_new_syllable () ||
 	  (busy_moment_ >= pending_grace_moment_))
       && lyric_iter_->ok ())
     {
       Moment now = music_context_->now_mom ();
-      if (now.grace_part_)
+      if (!to_boolean (lyrics_context_->get_property ("includeGraceNotes")) && now.grace_part_)
 	{
 	  pending_grace_moment_ = now;
 	  pending_grace_moment_.grace_part_ = Rational (0);
diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm
index 16b2538..e413aa8 100644
--- a/scm/define-context-properties.scm
+++ b/scm/define-context-properties.scm
@@ -267,6 +267,7 @@ string selector for tablature notation.")
 printed as numbers, but only as extender lines.")
      (implicitTimeSignatureVisibility ,vector? "break visibility for
 the default time signature.")
+     (includeGraceNotes ,boolean? "Do not ignore graces for @rinternals{Lyrics}.")
      (instrumentCueName ,markup? "The name to print if another
 instrument is to be taken.")
      (instrumentEqualizer ,procedure? "A function taking a string
-- 
1.6.4.4

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to