From 1aeb5031376f96ee3407989e7696e5c106d27ee0 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 5 Feb 2004 12:07:35 +0000 Subject: [PATCH] * 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/engraver-init.ly: remove Thread * scripts/convert-ly.py (conv): \harmonic rule * ly/engraver-init.ly: add DrumStaff and DrumVoice contexts --- ChangeLog | 4 ++ input/ascii-art/r-as.ly | 4 +- input/ascii-art/twinkle-as5.ly | 6 +-- input/mutopia/F.Schubert/morgenlied.ly | 4 +- input/mutopia/F.Schubert/standchen.ly | 2 +- input/no-notation/denneboom.ly | 8 ++-- input/puer-fragment.ly | 4 +- input/regression/+.ly | 4 +- input/regression/lyric-combine-new.ly | 5 +-- input/regression/lyric-combine.ly | 16 ++++---- input/regression/lyric-extender.ly | 4 +- input/regression/lyric-hyphen.ly | 4 +- input/regression/lyric-phrasing.ly | 4 +- input/regression/lyrics-bar.ly | 9 ++--- input/regression/span-bar.ly | 4 +- input/template/melody-lyrics.ly | 4 +- input/template/piano-lyrics.ly | 8 ++-- input/test/+.ly | 4 +- input/test/bar-lines-lyric-only.ly | 6 +-- input/test/caps.ly | 8 ++-- input/test/preset-extent.ly | 8 ++-- input/test/repeat-shorter-bracket.ly | 50 ++++++++++++------------ input/test/repeat.ly | 8 ++-- input/test/script-chart.ly | 4 +- input/test/trills.ly | 6 +-- input/test/vaticana.ly | 4 +- input/test/version-output.ly | 19 ++++++--- input/twinkle-pop.ly | 8 ++-- lily/new-lyric-combine-music-iterator.cc | 39 +++++++++++------- lily/new-part-combine-iterator.cc | 7 ++-- ly/engraver-init.ly | 8 ++-- ly/performer-init.ly | 18 +++------ scripts/convert-ly.py | 5 ++- 33 files changed, 156 insertions(+), 140 deletions(-) diff --git a/ChangeLog b/ChangeLog index b54a708a34..9320bdcd61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2004-02-05 Han-Wen Nienhuys + * 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 diff --git a/input/ascii-art/r-as.ly b/input/ascii-art/r-as.ly index d5ac0c9ad1..9d6a122ec0 100644 --- a/input/ascii-art/r-as.ly +++ b/input/ascii-art/r-as.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.1.11" +\version "2.1.19" % ASCII Art output % % Process as: @@ -16,7 +16,7 @@ \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 { diff --git a/input/ascii-art/twinkle-as5.ly b/input/ascii-art/twinkle-as5.ly index 75e962f04b..346796b403 100644 --- a/input/ascii-art/twinkle-as5.ly +++ b/input/ascii-art/twinkle-as5.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.1.11" +\version "2.1.19" % ASCII Art output % % Process as: @@ -65,11 +65,11 @@ text = \lyrics{ \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 } diff --git a/input/mutopia/F.Schubert/morgenlied.ly b/input/mutopia/F.Schubert/morgenlied.ly index 85d4e05323..91cafca72d 100644 --- a/input/mutopia/F.Schubert/morgenlied.ly +++ b/input/mutopia/F.Schubert/morgenlied.ly @@ -26,7 +26,7 @@ } -\version "2.1.13" +\version "2.1.19" manuscriptBreak = { \break } @@ -152,7 +152,7 @@ pianoLH = \notes \relative c'' \repeat volta 2 { \new Staff << \context Staff \modernAccidentals \melody >> - \new Lyrics << + \new LyricsVoice << \lyricsto "singer" \new LyricsVoice \firstVerse \lyricsto "singer" \new LyricsVoice \secondVerse >> diff --git a/input/mutopia/F.Schubert/standchen.ly b/input/mutopia/F.Schubert/standchen.ly index be046e9593..b61b62ffae 100644 --- a/input/mutopia/F.Schubert/standchen.ly +++ b/input/mutopia/F.Schubert/standchen.ly @@ -42,7 +42,7 @@ instrument = "Piano" 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 diff --git a/input/no-notation/denneboom.ly b/input/no-notation/denneboom.ly index 9e882944bb..41c8a79c51 100644 --- a/input/no-notation/denneboom.ly +++ b/input/no-notation/denneboom.ly @@ -1,4 +1,4 @@ -\version "2.1.13" +\version "2.1.19" \header{ filename = "denneboom.ly" enteredby = "jcn" @@ -66,7 +66,7 @@ verseOne = \notes{ \oden } -verseOneStaff = \context Lyrics = one +verseOneStaff = \context LyricsVoice = one \verseOne @@ -77,7 +77,7 @@ verseTwo = \notes{ \oden } -verseTwoStaff = \context Lyrics = two +verseTwoStaff = \context LyricsVoice = two \verseTwo @@ -108,7 +108,7 @@ denneboomShape = \paper{ \score{ \addlyrics \context Staff { \time 3/4 \melody } - \context Lyrics \verseOne + \context LyricsVoice \verseOne \paper{ \denneboomShape } diff --git a/input/puer-fragment.ly b/input/puer-fragment.ly index 66ac122c75..8e1d68c777 100644 --- a/input/puer-fragment.ly +++ b/input/puer-fragment.ly @@ -1,4 +1,4 @@ -\version "2.1.14" +\version "2.1.19" \header { title = "Puer natus est nobis (excerptum)" subtitle = "Antiphona ad introitum VII" @@ -75,7 +75,7 @@ cantus = \context VaticanaVoice = "cantus" \notes { \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: } diff --git a/input/regression/+.ly b/input/regression/+.ly index 7751617108..76ec951968 100644 --- a/input/regression/+.ly +++ b/input/regression/+.ly @@ -1,4 +1,4 @@ -\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? @@ -21,5 +21,5 @@ Smaller and neater tests. } -\score { \context Lyrics \lyrics { " " }} +\score { \context LyricsVoice \lyrics { " " }} diff --git a/input/regression/lyric-combine-new.ly b/input/regression/lyric-combine-new.ly index 41a9ccfe6e..b2edba2b51 100644 --- a/input/regression/lyric-combine-new.ly +++ b/input/regression/lyric-combine-new.ly @@ -1,4 +1,4 @@ -\version "2.1.10" +\version "2.1.19" \header { texidoc = "With the @code{\\lyricsto} mechanism, individual lyric @@ -28,7 +28,6 @@ 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 } >> } diff --git a/input/regression/lyric-combine.ly b/input/regression/lyric-combine.ly index 902814303b..5d794793b8 100644 --- a/input/regression/lyric-combine.ly +++ b/input/regression/lyric-combine.ly @@ -1,12 +1,12 @@ -\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 @@ -32,15 +32,15 @@ textII = \context LyricsVoice = "middle-1" \lyrics { da -- da __ da -- da da da \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 >> >> diff --git a/input/regression/lyric-extender.ly b/input/regression/lyric-extender.ly index 78b576802e..40413310ca 100644 --- a/input/regression/lyric-extender.ly +++ b/input/regression/lyric-extender.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.19" \header { texidoc= "Tests lyric extenders. "} @@ -8,7 +8,7 @@ \context Staff { c8[ ( d] ) r4 f4 } - \context Lyrics \lyrics { xxx __ \skip 4 x } + \context LyricsVoice \lyrics { xxx __ \skip 4 x } >> } diff --git a/input/regression/lyric-hyphen.ly b/input/regression/lyric-hyphen.ly index c14ebdc9a8..67b3c01e39 100644 --- a/input/regression/lyric-hyphen.ly +++ b/input/regression/lyric-hyphen.ly @@ -1,9 +1,9 @@ -\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 } >> } diff --git a/input/regression/lyric-phrasing.ly b/input/regression/lyric-phrasing.ly index 321f57b1a8..649387c46d 100644 --- a/input/regression/lyric-phrasing.ly +++ b/input/regression/lyric-phrasing.ly @@ -1,5 +1,5 @@ -\version "2.1.10" +\version "2.1.19" \header{ texidoc="Lyric phrasing @@ -29,7 +29,7 @@ \autoBeamOff a a a8 ( a) a4 } - \context Lyrics << + << \new LyricsVoice \lyricsto "v" \lyrics { \property LyricsVoice . stanza = "1:" Start sentence melisma end. diff --git a/input/regression/lyrics-bar.ly b/input/regression/lyrics-bar.ly index 2316d0fa6a..e530c0f790 100644 --- a/input/regression/lyrics-bar.ly +++ b/input/regression/lyrics-bar.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.19" \header{ texidoc=" @@ -12,7 +12,7 @@ lyrics don't collide with barlines. \notes \context Staff { b1 \bar "|:" b1 \bar ":|" } - \lyrics\context Lyrics << + \lyrics << \context LyricsVoiceWithBars { % thisContextHasBarEngraver1 added ThisContextCertainlyHasBarEngraverAddedButThereHasBeenSomethingFunnyBefore1. Here. @@ -26,7 +26,7 @@ lyrics don't collide with barlines. \paper { raggedright = ##t \translator { - \LyricsContext + \ScoreContext \accepts "LyricsVoiceWithBars" } \translator { @@ -34,9 +34,6 @@ lyrics don't collide with barlines. \consists "Bar_engraver" \name "LyricsVoiceWithBars" } - \translator { - \LyricsVoiceContext - } } } diff --git a/input/regression/span-bar.ly b/input/regression/span-bar.ly index 42ded52218..ddb484f526 100644 --- a/input/regression/span-bar.ly +++ b/input/regression/span-bar.ly @@ -1,4 +1,4 @@ -\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. " @@ -7,7 +7,7 @@ texidoc = "Span bars draw only in between staff bar lines, so setting those to t \score { \notes \relative c' \new StaffGroup << \new Staff { a1 a1 a1} - \new Lyrics \lyrics << + \new LyricsVoice \lyrics << { bla1 die bla } { foo bar foo } >> diff --git a/input/template/melody-lyrics.ly b/input/template/melody-lyrics.ly index 12f5363e07..065f62986b 100644 --- a/input/template/melody-lyrics.ly +++ b/input/template/melody-lyrics.ly @@ -1,4 +1,4 @@ -\version "2.1.10" +\version "2.1.19" \header { texidoc = "Melody and lyrics." @@ -18,7 +18,7 @@ text = \lyrics { \property Staff.autoBeaming = ##f \melody } - \lyricsto "one" \new Lyrics \text + \lyricsto "one" \new LyricsVoice \text >> \paper { } \midi { } diff --git a/input/template/piano-lyrics.ly b/input/template/piano-lyrics.ly index f84b9d4ad7..48c105b2f5 100644 --- a/input/template/piano-lyrics.ly +++ b/input/template/piano-lyrics.ly @@ -1,7 +1,7 @@ -\version "2.1.10" +\version "2.1.19" \header { - texidoc ="Lyrics between two staffs." + texidoc ="LyricsVoice between two staffs." } upper = \notes\relative c'' { @@ -30,11 +30,11 @@ text = \lyrics { \paper { \translator { \GrandStaffContext - \accepts "Lyrics" + \accepts "LyricsVoice" } \translator { %\LyricsVoiceContext - \LyricsContext + \LyricsVoiceContext \consists "Bar_engraver" } } diff --git a/input/test/+.ly b/input/test/+.ly index 6443c873e2..bc0109c65f 100644 --- a/input/test/+.ly +++ b/input/test/+.ly @@ -1,4 +1,4 @@ -\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? @@ -16,4 +16,4 @@ This document is for LilyPond version } -\score { \context Lyrics \lyrics { " " } } +\score { \context LyricsVoice \lyrics { " " } } diff --git a/input/test/bar-lines-lyric-only.ly b/input/test/bar-lines-lyric-only.ly index e67f69d08b..dd5c409760 100644 --- a/input/test/bar-lines-lyric-only.ly +++ b/input/test/bar-lines-lyric-only.ly @@ -1,4 +1,4 @@ -\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. " @@ -7,7 +7,7 @@ You can move around @code{Bar_engraver} and \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 } @@ -25,7 +25,7 @@ You can move around @code{Bar_engraver} and BarLine \override #'bar-size-procedure = #(lambda (x) 3.0) } \translator { - \LyricsContext + \LyricsVoiceContext \consists "Span_bar_engraver" } \translator{ diff --git a/input/test/caps.ly b/input/test/caps.ly index db9665e917..261be428b9 100644 --- a/input/test/caps.ly +++ b/input/test/caps.ly @@ -1,16 +1,16 @@ -\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} diff --git a/input/test/preset-extent.ly b/input/test/preset-extent.ly index 3592f576e1..fa38b386fd 100644 --- a/input/test/preset-extent.ly +++ b/input/test/preset-extent.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.19" \header { texidoc = " @cindex Preset Extent @@ -15,10 +15,10 @@ spaced so widely. } \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} diff --git a/input/test/repeat-shorter-bracket.ly b/input/test/repeat-shorter-bracket.ly index e27648a004..ec21ecda57 100644 --- a/input/test/repeat-shorter-bracket.ly +++ b/input/test/repeat-shorter-bracket.ly @@ -1,6 +1,6 @@ -\version "2.1.7" +\version "2.1.19" \header{ - texidoc=" + texidoc=" @cindex shorter volta bracket @@ -13,30 +13,30 @@ can be shortened. \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 } } -% + % diff --git a/input/test/repeat.ly b/input/test/repeat.ly index de9c8840cc..227e6d92ff 100644 --- a/input/test/repeat.ly +++ b/input/test/repeat.ly @@ -1,6 +1,8 @@ -\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. " } @@ -11,7 +13,7 @@ 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 { diff --git a/input/test/script-chart.ly b/input/test/script-chart.ly index a63e4bdb28..c5ff34fdea 100644 --- a/input/test/script-chart.ly +++ b/input/test/script-chart.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.19" % this chart is used in the manual too. @@ -32,7 +32,7 @@ A chart showing all feta scripts. 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__ diff --git a/input/test/trills.ly b/input/test/trills.ly index 9dbc7fecfa..fe0656c49f 100644 --- a/input/test/trills.ly +++ b/input/test/trills.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.19" \header { texidoc="@cindex Trills @@ -59,7 +59,7 @@ visible = \property Voice.NoteHead \revert #'transparent \time 3/4 d2^\prallup e4 } - \new Lyrics \lyrics { + \new LyricsVoice \lyrics { "Tremblement"4 "Tremblement"4. "Cadence" @@ -80,7 +80,7 @@ visible = \property Voice.NoteHead \revert #'transparent %} } - \new Lyrics \lyrics { + \new LyricsVoice \lyrics { "simple"4 "appuy\\'e"4. %{ \skip 1*3 diff --git a/input/test/vaticana.ly b/input/test/vaticana.ly index c395bfdb73..79c78a0f4f 100644 --- a/input/test/vaticana.ly +++ b/input/test/vaticana.ly @@ -1,4 +1,4 @@ -\version "2.1.14" +\version "2.1.19" % possible rename to ancient-something. \header { texidoc = "Ancient Vaticana @@ -17,7 +17,7 @@ cantus = \context VaticanaVoice = "cantus" \notes { \[ e\melisma \flexa d\melismaEnd \] } -verba = \context Lyrics = "verba" \lyrics { +verba = \context LyricsVoice = "verba" \lyrics { Al- le- lu- ia. } diff --git a/input/test/version-output.ly b/input/test/version-output.ly index 5afcc35da8..18f5a2f3a0 100644 --- a/input/test/version-output.ly +++ b/input/test/version-output.ly @@ -1,12 +1,19 @@ -\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 diff --git a/input/twinkle-pop.ly b/input/twinkle-pop.ly index 15ee2be301..a7f32ece26 100644 --- a/input/twinkle-pop.ly +++ b/input/twinkle-pop.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.1.7" +\version "2.1.19" \header{ filename = "twinkle-pop.ly" xtitle = "Ah, vous dirais-je, maman " @@ -34,7 +34,7 @@ acc = \chords { } 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 @@ -49,7 +49,7 @@ text = \lyrics{ << \context ChordNames \acc \context Staff=melody \melodie - \context Lyrics \text + \context LyricsVoice \text >> \header{ title = "Ah, vous dirais-je, maman " @@ -61,7 +61,7 @@ text = \lyrics{ << \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$" diff --git a/lily/new-lyric-combine-music-iterator.cc b/lily/new-lyric-combine-music-iterator.cc index 1b3a14a84a..1bf41b8710 100644 --- a/lily/new-lyric-combine-music-iterator.cc +++ b/lily/new-lyric-combine-music-iterator.cc @@ -32,8 +32,9 @@ protected: 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_; @@ -48,9 +49,14 @@ static Music *melisma_playing_ev; 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 @@ -160,7 +166,7 @@ New_lyric_combine_music_iterator::construct_children () 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 (), @@ -174,7 +180,7 @@ New_lyric_combine_music_iterator::construct_children () } void -New_lyric_combine_music_iterator::find_thread () +New_lyric_combine_music_iterator::find_voice () { if (!music_context_) { @@ -188,19 +194,22 @@ New_lyric_combine_music_iterator::find_thread () 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 ()); } } } @@ -208,7 +217,7 @@ New_lyric_combine_music_iterator::find_thread () void New_lyric_combine_music_iterator::process (Moment ) { - find_thread (); + find_voice (); if (!music_context_) return ; diff --git a/lily/new-part-combine-iterator.cc b/lily/new-part-combine-iterator.cc index e72acf4b24..ee4ede13ad 100644 --- a/lily/new-part-combine-iterator.cc +++ b/lily/new-part-combine-iterator.cc @@ -267,9 +267,10 @@ New_pc_iterator::construct_children () 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 diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index a1de8962d3..4b9421e647 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.19" % @@ -105,7 +105,7 @@ \accepts "RhythmicStaff" \accepts "GrandStaff" \accepts "PianoStaff" - \accepts "Lyrics" + \accepts "LyricsVoice" \accepts "ChordNames" } @@ -304,7 +304,7 @@ \accepts "GrandStaff" \accepts "PianoStaff" \accepts "TabStaff" - \accepts "Lyrics" + \accepts "LyricsVoice" \accepts "ChordNames" } @@ -445,7 +445,7 @@ AncientRemoveEmptyStaffContext = \translator { \accepts "StaffGroup" \accepts "RhythmicStaff" \accepts "DrumStaff" - \accepts "Lyrics" + \accepts "LyricsVoice" \accepts "ChordNames" \accepts "GrandStaff" \accepts "ChoirStaff" diff --git a/ly/performer-init.ly b/ly/performer-init.ly index 25d9d362cd..b3e27bb34b 100644 --- a/ly/performer-init.ly +++ b/ly/performer-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.19" % % setup for Request->Element conversion. Guru-only @@ -21,12 +21,12 @@ \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" } @@ -76,7 +76,6 @@ \accepts GrandStaff \accepts PianoStaff \accepts TabStaff - \accepts Lyrics \accepts StaffGroup \accepts Devnull \accepts ChoirStaff @@ -94,9 +93,11 @@ \translator { - \type "Performer_group_performer" + \type "Staff_performer" % Performer_group_performer ? \consists "Lyric_performer" \name LyricsVoice + \consists "Time_signature_performer" + \consists "Tempo_performer" } \translator{ @@ -105,13 +106,6 @@ \accepts Staff } -\translator { - \type "Staff_performer" - \accepts LyricsVoice - \name Lyrics - \consists "Time_signature_performer" - \consists "Tempo_performer" -} \translator { \type "Staff_performer" diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 3691da1395..318198c5fe 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -1798,8 +1798,11 @@ def conv (str): 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) -- 2.39.2