2004-02-05 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/new-lyric-combine-music-iterator.cc (find_voice): make sure
+ that associatedVoiceContext is always assigned when music & lyrics
+ are found.
+
* ly/engraver-init.ly: remove Lyrics context.
(TabVoice): add noteheads engraver
#(ly:set-option 'old-relative)
-\version "2.1.11"
+\version "2.1.19"
% ASCII Art output
%
% Process as:
\repeat "volta" 2 { g a b c }
\alternative { { c b a g } { f e d c } }
}
- \context Lyrics \lyrics {
+ \context LyricsVoice \lyrics {
De eer- ste << { maat } { moet } >>
\repeat fold 2 { }
\alternative {
#(ly:set-option 'old-relative)
-\version "2.1.11"
+\version "2.1.19"
% ASCII Art output
%
% Process as:
\context GrandStaff <<
\addlyrics
\context Staff=upper \melody
- \context Lyrics=between \text
+ \context LyricsVoice=between \text
\context Staff=lower \accompany
>>
\paper{
- \translator { \GrandStaffContext \accepts "Lyrics" }
+ \translator { \GrandStaffContext \accepts "LyricsVoice" }
indent=4.0\char
linewidth=78.0\char
}
}
-\version "2.1.13"
+\version "2.1.19"
manuscriptBreak = { \break }
\new Staff <<
\context Staff \modernAccidentals
\melody >>
- \new Lyrics <<
+ \new LyricsVoice <<
\lyricsto "singer" \new LyricsVoice \firstVerse
\lyricsto "singer" \new LyricsVoice \secondVerse
>>
footer = "Mutopia-2001/04/27-xx"
}
-\version "2.1.13"
+\version "2.1.19"
dynamicUp = \property Voice.DynamicLineSpanner \override #'direction = #1
dynamicRevert = \property Voice.DynamicLineSpanner \revert #'direction
-\version "2.1.13"
+\version "2.1.19"
\header{
filename = "denneboom.ly"
enteredby = "jcn"
\oden
}
-verseOneStaff = \context Lyrics = one
+verseOneStaff = \context LyricsVoice = one
\verseOne
\oden
}
-verseTwoStaff = \context Lyrics = two
+verseTwoStaff = \context LyricsVoice = two
\verseTwo
\score{
\addlyrics
\context Staff { \time 3/4 \melody }
- \context Lyrics \verseOne
+ \context LyricsVoice \verseOne
\paper{
\denneboomShape
}
-\version "2.1.14"
+\version "2.1.19"
\header {
title = "Puer natus est nobis (excerptum)"
subtitle = "Antiphona ad introitum VII"
\divisioMaxima
}
-verba = \context Lyrics = "verba" \lyrics {
+verba = \context LyricsVoice = "verba" \lyrics {
Pu- er na- tus est no- bis,
et fi- li- us da- tus est no- bis:
}
-\version "2.1.7"
+\version "2.1.19"
%% +.ly: Be the first .ly file for lys-to-tely.py.
%% Better to make lys-to-tely.py include "introduction.texi" or
%% other .texi documents too?
}
-\score { \context Lyrics \lyrics { " " }}
+\score { \context LyricsVoice \lyrics { " " }}
-\version "2.1.10"
+\version "2.1.19"
\header {
texidoc = "With the @code{\\lyricsto} mechanism, individual lyric
blob
}
- \new Lyrics << \lyricsto "bla" \lyrics \new LyricsVoice { nes ted lyrics voice with more words than no tes } >>
- >>
+ \lyricsto "bla" \lyrics \new LyricsVoice { nes ted lyrics voice with more words than no tes } >>
}
-\version "2.1.7"
+\version "2.1.19"
\header{
-texidoc= "Lyrics can be set to a melody automatically. Excess lyrics will be
-discarded. Lyrics will not be set over rests. You can have melismata
+texidoc= "LyricsVoice can be set to a melody automatically. Excess lyrics will be
+discarded. LyricsVoice will not be set over rests. You can have melismata
either by setting a property melismaBusy, or by setting
automaticMelismas (which will set melismas during slurs and ties). If
-you want a different order than first Music, then Lyrics, you must
+you want a different order than first Music, then LyricsVoice, you must
precook a chord of staves/lyrics and label those. Of course
@code{\rhythm} ignores any other rhythms in the piece. Hyphens and
extenders do not assume anything about lyric lengths, so they continue
\score {
\notes << \context Staff = SA \noise
- \context Lyrics = LA { s1 }
+ \context LyricsVoice = LA { s1 }
\context Staff = SB { s1 }
- \context Lyrics = LB { s1 }
+ \context LyricsVoice = LB { s1 }
\context Staff = SC \noise
\addlyrics
\context Staff = SB \context Voice="middle" \m
- << \context Lyrics = LA \textI
- \context Lyrics = LB \textII
+ << \context LyricsVoice = LA \textI
+ \context LyricsVoice = LB \textII
>>
>>
-\version "2.1.7"
+\version "2.1.19"
\header { texidoc= "Tests lyric extenders. "}
\context Staff {
c8[ ( d] )
r4 f4 }
- \context Lyrics \lyrics { xxx __ \skip 4 x }
+ \context LyricsVoice \lyrics { xxx __ \skip 4 x }
>>
}
-\version "2.1.7"
+\version "2.1.19"
\header {texidoc="Tests lyric hyphens. "}
\score{
<<
\context Staff \notes { c' (c') (c') c' }
- \context Lyrics \context LyricsVoice \lyrics { bla -- alb xxx -- yyy }
+ \context LyricsVoice \lyrics { bla -- alb xxx -- yyy }
>>
}
-\version "2.1.10"
+\version "2.1.19"
\header{
texidoc="Lyric phrasing
\autoBeamOff
a a a8 ( a) a4
}
- \context Lyrics <<
+ <<
\new LyricsVoice \lyricsto "v" \lyrics {
\property LyricsVoice . stanza = "1:"
Start sentence melisma end.
-\version "2.1.7"
+\version "2.1.19"
\header{
texidoc="
\notes \context Staff {
b1 \bar "|:" b1 \bar ":|"
}
- \lyrics\context Lyrics <<
+ \lyrics <<
\context LyricsVoiceWithBars {
% thisContextHasBarEngraver1 added
ThisContextCertainlyHasBarEngraverAddedButThereHasBeenSomethingFunnyBefore1. Here.
\paper {
raggedright = ##t
\translator {
- \LyricsContext
+ \ScoreContext
\accepts "LyricsVoiceWithBars"
}
\translator {
\consists "Bar_engraver"
\name "LyricsVoiceWithBars"
}
- \translator {
- \LyricsVoiceContext
- }
}
}
-\version "2.1.7"
+\version "2.1.19"
\header {
texidoc = "Span bars draw only in between staff bar lines, so setting those to transparent shows bar lines between systems only.
"
\score {
\notes \relative c' \new StaffGroup <<
\new Staff { a1 a1 a1}
- \new Lyrics \lyrics <<
+ \new LyricsVoice \lyrics <<
{ bla1 die bla }
{ foo bar foo }
>>
-\version "2.1.10"
+\version "2.1.19"
\header {
texidoc = "Melody and lyrics."
\property Staff.autoBeaming = ##f
\melody
}
- \lyricsto "one" \new Lyrics \text
+ \lyricsto "one" \new LyricsVoice \text
>>
\paper { }
\midi { }
-\version "2.1.10"
+\version "2.1.19"
\header {
- texidoc ="Lyrics between two staffs."
+ texidoc ="LyricsVoice between two staffs."
}
upper = \notes\relative c'' {
\paper {
\translator {
\GrandStaffContext
- \accepts "Lyrics"
+ \accepts "LyricsVoice"
}
\translator {
%\LyricsVoiceContext
- \LyricsContext
+ \LyricsVoiceContext
\consists "Bar_engraver"
}
}
-\version "2.1.7"
+\version "2.1.19"
%% +.ly: Be the first .ly file for lys-to-tely.py.
%% Better to make lys-to-tely.py include "introduction.texi" or
%% other .texi documents too?
}
-\score { \context Lyrics \lyrics { " " } }
+\score { \context LyricsVoice \lyrics { " " } }
-\version "2.1.7"
+\version "2.1.19"
\header { texidoc = "@cindex Bar line lyric only
You can move around @code{Bar_engraver} and
@code{Span_bar_engraver} if you want bar lines on lyrics. "
\score {
\notes \relative c' \context ChoirStaff <<
\new Staff { c1 c1 c1}
- \context Lyrics \lyrics <<
+ \context LyricsVoice \lyrics <<
{ bla1 die bla }
{ foo bar foo }
{ foo bar foo }
BarLine \override #'bar-size-procedure = #(lambda (x) 3.0)
}
\translator {
- \LyricsContext
+ \LyricsVoiceContext
\consists "Span_bar_engraver"
}
\translator{
-\version "2.1.7"
+\version "2.1.19"
\header {
texidoc = "@cindex Capital Letters
You can set the font to use small caps.
" }
-shapeSC = \property Lyrics.LyricText \override #'font-shape = #'caps
-shapeNorm = \property Lyrics.LyricText \revert #'font-shape
+shapeSC = \property LyricsVoice.LyricText \override #'font-shape = #'caps
+shapeNorm = \property LyricsVoice.LyricText \revert #'font-shape
\score { <<
\notes \relative c'' { c4 c4 c8 c8 c8 }
- \lyrics \context Lyrics {
+ \lyrics \context LyricsVoice {
what4 is4 \shapeSC The8 Ma -- trix? }
>>
\paper { raggedright = ##t}
-\version "2.1.7"
+\version "2.1.19"
\header { texidoc = "
@cindex Preset Extent
}
\score {
- \context Lyrics \lyrics {
+ \context LyricsVoice \lyrics {
foo --
- \property Lyrics . LyricText \set #'X-extent-callback = #Grob::preset_extent
- \property Lyrics . LyricText \set #'X-extent = #'(-10.0 . 10.0)
+ \property LyricsVoice . LyricText \set #'X-extent-callback = #Grob::preset_extent
+ \property LyricsVoice . LyricText \set #'X-extent = #'(-10.0 . 10.0)
bar baz
}
\paper { raggedright = ##t}
-\version "2.1.7"
+\version "2.1.19"
\header{
- texidoc="
+ texidoc="
@cindex shorter volta bracket
\score {
- <<
- \context Staff \notes\relative c''{
- c c c c
- % coda-klugde: let volta span only one bar
- \property Staff.voltaSpannerDuration = #(ly:make-moment 1 1)
- \repeat "volta" 5 { d d d d }
- \alternative { { e e e e f f f f }
- { g g g g } }
- }
- \context Lyrics \lyrics{
- intro1
- \repeat fold 5 { }
- \alternative {
- { chorus1 one verse1 }
- { chorus1 two verse1 }
- { chorus1 three verse }
- { chorus1 four verse }
- }
- five1
- }
- >>
-\paper{raggedright = ##t}
+ <<
+ \context Staff \notes\relative c''{
+ c c c c
+ % coda-klugde: let volta span only one bar
+ \property Staff.voltaSpannerDuration = #(ly:make-moment 1 1)
+ \repeat "volta" 5 { d d d d }
+ \alternative { { e e e e f f f f }
+ { g g g g } }
+ }
+ \context LyricsVoice \lyrics{
+ intro1
+ \repeat fold 5 { }
+ \alternative {
+ { chorus1 one verse1 }
+ { chorus1 two verse1 }
+ { chorus1 three verse }
+ { chorus1 four verse }
+ }
+ five1
+ }
+ >>
+ \paper{ raggedright = ##t }
}
-%
+ %
-\version "2.1.7"
+\version "2.1.19"
+
% possible rename to lyric-repeat or repeat-lyric.
-\header{ texidoc = "@cindex Repeat Lyrics
+
+\header{ texidoc = "@cindex Repeat LyricsVoice
You can use alternate lyrics as well as alternate notes for repeats. "
}
\repeat "volta" 2 { g a b c }
\alternative { { c b a g } { f e d c } }
}
- \context Lyrics \lyrics {
+ \context LyricsVoice \lyrics {
De eer- ste << { maat } { moet } >>
\repeat fold 2 { }
\alternative {
-\version "2.1.7"
+\version "2.1.19"
% this chart is used in the manual too.
c''\longfermata c''\verylongfermata c''\segno
c''\coda c''\varcoda
}
- \context Lyrics \lyrics {
+ \context LyricsVoice \lyrics {
accent__ marcato__ staccatissimo__
staccato__ tenuto__ portato__
upbow__ downbow__ flageolet__
-\version "2.1.7"
+\version "2.1.19"
\header {
texidoc="@cindex Trills
\time 3/4
d2^\prallup e4
}
- \new Lyrics \lyrics {
+ \new LyricsVoice \lyrics {
"Tremblement"4
"Tremblement"4.
"Cadence"
%}
}
- \new Lyrics \lyrics {
+ \new LyricsVoice \lyrics {
"simple"4
"appuy\\'e"4.
%{ \skip 1*3
-\version "2.1.14"
+\version "2.1.19"
% possible rename to ancient-something.
\header { texidoc = "Ancient Vaticana
\[ e\melisma \flexa d\melismaEnd \]
}
-verba = \context Lyrics = "verba" \lyrics {
+verba = \context LyricsVoice = "verba" \lyrics {
Al- le- lu- ia.
}
-\version "2.1.7"
+\version "2.1.19"
\header {
- texidoc = "By putting the output of @code{lilypond-version}
- into a lyric, we can print the version number in a score,
-or a lilypond-book document."
- }
-\score { \context Lyrics \notes {
+
+ texidoc = #(string-append "By putting the output of
+ @code{lilypond-version} into a lyric, we can print the version
+ number in a score, or a lilypond-book document. Another option is
+ to append the version to the doc-string, like this: "
+
+ (lilypond-version)
+ )
+
+}
+
+\score { \context LyricsVoice \notes {
\property Score.RehearsalMark \set #'self-alignment-X = #LEFT
\mark #(ly:export (string-append "Processed with LilyPond version " (lilypond-version)))
s2
#(ly:set-option 'old-relative)
-\version "2.1.7"
+\version "2.1.19"
\header{
filename = "twinkle-pop.ly"
xtitle = "Ah, vous dirais-je, maman "
}
text = \lyrics{
- \property Lyrics . LyricText \set #'font-shape = #'italic
+ \property LyricsVoice . LyricText \set #'font-shape = #'italic
Ah!4 vous dir -- ai -- je ma man2
Ce4 qui cau -- se mon tour -- ment2
<<
\context ChordNames \acc
\context Staff=melody \melodie
- \context Lyrics \text
+ \context LyricsVoice \text
>>
\header{
title = "Ah, vous dirais-je, maman "
<<
\chords \context ChordNames \transpose c d\acc
\notes \context Staff=melody \transpose c d\melodie
- \lyrics \context Lyrics \text
+ \lyrics \context LyricsVoice \text
>>
\header{
piece = "clarinet in B$\flat$"
virtual void derived_substitute (Translator_group*,Translator_group*);
private:
bool start_new_syllable () ;
- void find_thread ();
-
+ void find_voice ();
+
+ bool made_association_;
Translator_group * lyrics_context_;
Translator_group* music_context_;
Music_iterator * lyric_iter_;
New_lyric_combine_music_iterator::New_lyric_combine_music_iterator ()
{
+ made_association_ = false;
lyric_iter_ =0;
music_context_ =0;
lyrics_context_ = 0;
+
+ /*
+ Ugh. out of place here.
+ */
if (!busy_ev)
{
busy_ev
Music *m = unsmob_music (get_music ()->get_mus_property ("element"));
lyric_iter_ = unsmob_iterator (get_iterator (m));
- find_thread ();
+ find_voice ();
if (lyric_iter_)
lyrics_context_ = find_context_below (lyric_iter_->get_outlet (),
}
void
-New_lyric_combine_music_iterator::find_thread ()
+New_lyric_combine_music_iterator::find_voice ()
{
if (!music_context_)
{
String name = ly_scm2string (voice_name);
Translator_group *voice = find_context_below (t, "Voice", name);
- Translator_group *thread = 0;
- if (voice)
- thread = find_context_below (voice, "Thread", "");
- else
+ if (!voice)
get_music ()->origin ()->warning (_f ("Cannot find Voice: %s\n",
name.to_str0 ()));
-
- if (thread)
- music_context_ = thread;
+ else
+ music_context_ = voice;
- if (lyrics_context_ && voice)
- lyrics_context_->set_property ("associatedVoiceContext",
- voice->self_scm ());
+ }
+ }
+
+ if (lyrics_context_ && music_context_)
+ {
+ if (!made_association_)
+ {
+ made_association_ = true;
+ lyrics_context_->set_property ("associatedVoiceContext",
+ music_context_->self_scm ());
}
}
}
void
New_lyric_combine_music_iterator::process (Moment )
{
- find_thread ();
+ find_voice ();
if (!music_context_)
return ;
split_list_ = get_music ()->get_mus_property ("split-list");
SCM lst = get_music ()->get_mus_property ("elements");
- SCM props = scm_list_n (scm_list_n (ly_symbol2scm ("denies"), ly_symbol2scm ("Thread"), SCM_UNDEFINED),
- scm_list_n (ly_symbol2scm ("consists"), ly_symbol2scm ("Rest_engraver"), SCM_UNDEFINED),
- scm_list_n (ly_symbol2scm ("consists"), ly_symbol2scm ("Note_heads_engraver"), SCM_UNDEFINED),
+ SCM props = scm_list_n (/*
+ used to have tweaks here.
+ */
+
SCM_UNDEFINED);
Translator_group *tr
-\version "1.9.8"
+\version "2.1.19"
%
\accepts "RhythmicStaff"
\accepts "GrandStaff"
\accepts "PianoStaff"
- \accepts "Lyrics"
+ \accepts "LyricsVoice"
\accepts "ChordNames"
}
\accepts "GrandStaff"
\accepts "PianoStaff"
\accepts "TabStaff"
- \accepts "Lyrics"
+ \accepts "LyricsVoice"
\accepts "ChordNames"
}
\accepts "StaffGroup"
\accepts "RhythmicStaff"
\accepts "DrumStaff"
- \accepts "Lyrics"
+ \accepts "LyricsVoice"
\accepts "ChordNames"
\accepts "GrandStaff"
\accepts "ChoirStaff"
-\version "1.9.8"
+\version "2.1.19"
%
% setup for Request->Element conversion. Guru-only
\consists "Span_dynamic_performer"
\consists "Tie_performer"
\consists "Piano_pedal_performer"
- \accepts "Thread"
+ \accepts "Voice"
}
\translator {
\type "Performer_group_performer"
- \name Thread
+ \name Voice
\consists "Note_performer"
}
\accepts GrandStaff
\accepts PianoStaff
\accepts TabStaff
- \accepts Lyrics
\accepts StaffGroup
\accepts Devnull
\accepts ChoirStaff
\translator {
- \type "Performer_group_performer"
+ \type "Staff_performer" % Performer_group_performer ?
\consists "Lyric_performer"
\name LyricsVoice
+ \consists "Time_signature_performer"
+ \consists "Tempo_performer"
}
\translator{
\accepts Staff
}
-\translator {
- \type "Staff_performer"
- \accepts LyricsVoice
- \name Lyrics
- \consists "Time_signature_performer"
- \consists "Tempo_performer"
-}
\translator {
\type "Staff_performer"
str = re.sub (r"""\\new Thread""", """\context Voice""", str)
str = re.sub (r"""Thread""", """Voice""", str)
+ if re.search ('\bLyrics\b', str):
+ sys.stderr.write ("\nLyrics found. Check file manually!\n");
+
str = re.sub (r"""LyricsVoice""", r"""L@ricsVoice""", str)
- str = re.sub (r"""\bLyrics\b""", r"""\1 LyricsVoice""", str)
+ str = re.sub (r"""\bLyrics\b""", r"""LyricsVoice""", str)
str = re.sub (r"""LyricsContext""", r"""LyricsVoiceContext""", str)
str = re.sub (r"""L@ricsVoice""", r"""LyricsVoice""",str)