From edaa86202a05fe55f974037c6c59556ee94076bc Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 30 Oct 2004 17:23:48 +0000 Subject: [PATCH] * lily/quote-iterator.cc (process): use <= for comparisons. Fixes quote problem if for last note of quoted sequence. * input/regression/part-combine-text.ly (comm): add expect strings. --- ChangeLog | 18 +++++++ input/regression/accidentals.ly | 22 -------- input/regression/beam-dir-functions.ly | 50 ------------------ input/regression/grace-volta-repeat-2.ly | 4 +- input/regression/grace.ly | 16 ++---- .../regression/key-signature-cancellation.ly | 3 +- input/regression/keys.ly | 18 ++++--- input/regression/lyric-combine.ly | 32 ++++++------ input/regression/lyrics-bar.ly | 51 +++++++++---------- input/regression/music-function.ly | 15 +++--- input/regression/new-slur.ly | 11 +++- input/regression/no-staff.ly | 19 ++++--- input/regression/part-combine-a2.ly | 14 ++--- input/regression/part-combine-solo-end.ly | 4 +- input/regression/part-combine-text.ly | 11 ++-- input/regression/quote.ly | 35 ++++++++----- lily/part-combine-iterator.cc | 4 +- lily/quote-iterator.cc | 24 +++++---- scm/part-combiner.scm | 1 + 19 files changed, 162 insertions(+), 190 deletions(-) delete mode 100644 input/regression/accidentals.ly delete mode 100644 input/regression/beam-dir-functions.ly diff --git a/ChangeLog b/ChangeLog index 3e307c4a85..49ad00c3fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-10-30 Han-Wen Nienhuys + + * lily/quote-iterator.cc (process): use <= for comparisons. Fixes + quote problem if for last note of quoted sequence. + + * input/regression/part-combine-text.ly (comm): add expect strings. + 2004-10-30 Werner Lemberg * Documentation/user/examples.itely: Improved layout. @@ -11,6 +18,17 @@ 2004-10-30 Han-Wen Nienhuys + * lily/part-combine-iterator.cc (unisono): examine last_playing_ + (not state_), this fixes a2 printing after chord. + + * input/regression/no-staff.ly: fix octave, revise syntax. + + * input/regression/lyrics-bar.ly (texidoc): fixes. + + * input/regression/beam-dir-functions.ly (Module): remove from regtest + + * input/regression/accidentals.ly (Module): remove from regtest. + * lily/parser.yy (Prefix_composite_music): oops. Chords should be unrelativable, not bass figures untransposable. diff --git a/input/regression/accidentals.ly b/input/regression/accidentals.ly deleted file mode 100644 index 016f2ca874..0000000000 --- a/input/regression/accidentals.ly +++ /dev/null @@ -1,22 +0,0 @@ -\version "2.3.22" - -\header{ -texidoc=" -This shows how accidentals are handled. -" -} -mel = { \key d \major \time 4/4 - d4 dis dis8 dis, d4 | d dis disis8 d, dis4 | d des disis8 dis, d4 | dis deses d dis ~ | dis dis ~ dis8 d, dis4 ~ | \break - dis dis cis c | c cis cisis cis | c ces cisis c | cis ceses c cis ~ | cis cis ~ cis cis \bar "|." | \break -} - -\score { - << - \context Staff \transpose c c'' \mel - \context NoteNames{ - \set printOctaveNames = ##f - \mel - } - >> -} - diff --git a/input/regression/beam-dir-functions.ly b/input/regression/beam-dir-functions.ly deleted file mode 100644 index 3a1f38cfa2..0000000000 --- a/input/regression/beam-dir-functions.ly +++ /dev/null @@ -1,50 +0,0 @@ -% junkme? -\version "2.3.22" -\header { - texidoc = "@cindex Beam Dir Functions - -The direction of a beam may be calculated in several ways. As shown in -the example, the beam are be below the notes if: -@table @code -@item majority -of (individual) notes would have down stems, -@item mean -of note pitches is on the center line or below it, or -@item median -of note pithes (i.e. the centermost element of ordered pitches) is -on the center line or below it. -@end table - -If your favourite algorithm is not one of these, you can hook up your -own one. -(These beam direction functions are defined in @file{scm/beam.scm}.) -" -} - -\layout { raggedright = ##t} -\score { - \relative c'' {\time 3/4 - \override Beam #'dir-function = #beam-dir-majority - c8[ g] - \override Beam #'dir-function = #beam-dir-mean - c[ g] - \override Beam #'dir-function = #beam-dir-median - c[ g] - - \time 3/8 - \override Beam #'dir-function = #beam-dir-majority - c8[ c g] - \override Beam #'dir-function = #beam-dir-mean - c[ c g] - \override Beam #'dir-function = #beam-dir-median - c[ c g] - } -\layout{raggedright = ##t} -} - -%% Local variables: -%% LilyPond-indent-level:2 -%% End: - - - diff --git a/input/regression/grace-volta-repeat-2.ly b/input/regression/grace-volta-repeat-2.ly index eb28300b8e..ac37f00a85 100644 --- a/input/regression/grace-volta-repeat-2.ly +++ b/input/regression/grace-volta-repeat-2.ly @@ -2,8 +2,8 @@ \header { - texidoc = "A volta repeat may begin with a grace. Consecutive ending and - starting repeat bars are into one @code{:||:}." + texidoc = "A volta repeat may begin with a grace. Consecutive + ending and starting repeat bars are merged into one @code{:||:}." } diff --git a/input/regression/grace.ly b/input/regression/grace.ly index 5a00f76b5a..a2c049abf7 100644 --- a/input/regression/grace.ly +++ b/input/regression/grace.ly @@ -2,18 +2,12 @@ \version "2.3.22" \header{ -texidoc=" -Grace notes are typeset as an encapsulated piece of music. You can -have beams, notes, chords, stems etc. within a @code{\grace} section. -Slurs that start within a grace section, but are not ended are attached -to the next normal note. Grace notes have zero duration. If there -are tuplets, the grace notes will not be under the brace. Grace notes -can have accidentals, but they are (currently) spaced at a fixed -distance. Grace notes (of course) come before the accidentals of the -main note. Grace notes can also be positioned after the main note. -Grace notes without beams should have a slash, if @code{flagStyle} is -not set. Main note scripts do not end up on the grace note. + texidoc=" You can have beams, notes, chords, stems etc. within a +@code{\grace} section. If there are tuplets, the grace notes will not +be under the brace. + +Main note scripts do not end up on the grace note. " } diff --git a/input/regression/key-signature-cancellation.ly b/input/regression/key-signature-cancellation.ly index 5fc3fa7f17..fa2734fe38 100644 --- a/input/regression/key-signature-cancellation.ly +++ b/input/regression/key-signature-cancellation.ly @@ -1,8 +1,7 @@ -\header { texidoc = "Cancellation are printed before the barline. The +\header { texidoc = "Cancellation signs are printed by default. The spacing of the natural signs depends on their vertical positions. The stems should not clash graphically." - } \version "2.3.22" diff --git a/input/regression/keys.ly b/input/regression/keys.ly index 94cffd9e28..c089d90a8f 100644 --- a/input/regression/keys.ly +++ b/input/regression/keys.ly @@ -11,19 +11,21 @@ are created also on a clef change. -\score { - \relative c'' - { - \set Staff.createKeyOnClefChange = ##t +\paper { + raggedright = ##T +} + +\relative +{ + \set Staff.createKeyOnClefChange = ##t \key bes \major c2 -% \key c \major % \minor + % \key c \major % \minor \key es \major % \minor c2 \break \key bes \major % \major c2 \clef alto c2 \key d \major \clef treble c2 - \set Staff.keySignature = #'((2 . -1) (6 . 3) (4 . -2)) - e2 - } + \set Staff.keySignature = #'((2 . -1) (6 . 3) (4 . -2)) + e2 } diff --git a/input/regression/lyric-combine.ly b/input/regression/lyric-combine.ly index da93d9dc51..dfe509d209 100644 --- a/input/regression/lyric-combine.ly +++ b/input/regression/lyric-combine.ly @@ -2,15 +2,15 @@ \version "2.3.22" \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 -either by setting a property melismaBusy, or by setting + + 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 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 -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 -to work." +precook a chord of staves/lyrics and label those. Of course, the +lyrics ignores any other rhythms in the piece." + } \layout { raggedright= ##t } @@ -28,8 +28,13 @@ m = \relative c'' { noise = \repeat unfold 6 \relative c'' { g16 g g g } -textI = \context Lyrics = "middle-1" \lyricmode { la2 __ la -- la __ la la la la la } -textII = \context Lyrics = "middle-1" \lyricmode { da -- da __ da -- da da da da da } +textI = \lyricmode { + la2 __ la -- la __ la la la la la +} + +textII = \lyricmode { + da -- da __ da -- da da da da da +} << \context Staff = SA \noise @@ -38,12 +43,9 @@ textII = \context Lyrics = "middle-1" \lyricmode { da -- da __ da -- da da da da \context Lyrics = LB { s1 } \context Staff = SC \noise - \oldaddlyrics - \context Staff = SB \context Voice="middle" \m - << \context Lyrics = LA \textI - \context Lyrics = LB \textII - >> - + \context Staff = SB \context Voice = middle \m + \context Lyrics = LA \lyricsto "middle" \textI + \context Lyrics = LB \lyricsto "middle" \textII >> diff --git a/input/regression/lyrics-bar.ly b/input/regression/lyrics-bar.ly index 28601d76ae..ecff5f539a 100644 --- a/input/regression/lyrics-bar.ly +++ b/input/regression/lyrics-bar.ly @@ -7,31 +7,30 @@ lyrics do not collide with barlines. " } -\score { - \context StaffGroup << - \context Staff=foo { - b1 \bar "|:" b1 \bar ":|" - } - \context LyricsWithBars \lyricmode { -% thisContextHasBarEngraver1 added - ThisContextCertainlyHasBarEngraverAddedButThereHasBeenSomethingFunnyBefore1. HereThereWhere. - } - \context Lyrics \lyricmode { - this4 one has no BarEngraverAddedToContext1 - } - \context Staff=bar { b1 b1 } - >> - \layout { - raggedright = ##t - \context { - \StaffGroup - \accepts "LyricsWithBars" - } - \context { - \Lyrics - \consists "Bar_engraver" - \name "LyricsWithBars" - } - } +\layout { + raggedright = ##t } +<< + \context Staff=foo \with + { +% \remove "Bar_engraver" + } + { + b1 \bar "|:" b1 \bar ":|" + } + \context Lyrics \with { + \consists "Bar_engraver" + \override BarLine #'bar-size = #4 + } \lyricmode { + looooooooooooooooooooooooooooooooooong1 syllable + } + \lyrics { + no Bar_Engraver_Bar_Engraver_Bar_Engraver + } + \context Staff=bar \with { +% \remove "Bar_engraver" + } { b1 b1 } +>> + + diff --git a/input/regression/music-function.ly b/input/regression/music-function.ly index 99255c3710..19cb5a887c 100644 --- a/input/regression/music-function.ly +++ b/input/regression/music-function.ly @@ -1,7 +1,10 @@ \header { + texidoc = "Music function are generic music transformation functions, -which can be used to extend music syntax seamlessly." +which can be used to extend music syntax seamlessly. Here we +demonstrate a @code{\myBar} function, which works similar to +@code{\bar}, but is implemented completely in Scheme." } \version "2.3.22" @@ -13,13 +16,11 @@ which can be used to extend music syntax seamlessly." (context-spec-music (context-spec-music (make-property-set 'whichBar type) 'Timing) 'Score)) - )) -\score{ - { - d4 \myBar #"|:" d4 - - } +\layout { raggedright = ##t } + +{ + d4 \myBar #"|:" d4 } diff --git a/input/regression/new-slur.ly b/input/regression/new-slur.ly index 9cb636b15e..8d26f5458d 100644 --- a/input/regression/new-slur.ly +++ b/input/regression/new-slur.ly @@ -1,6 +1,15 @@ \header { - texidoc = "Scoring based slur formatting." + + texidoc = "Slur formatting is based on scoring. A large number of + slurs are generated. Each esthetic aspect gets demerits, the best + configuration (with least demerits) wins. This must be tested in + one big file, since changing one score parameter for one situation + may affect several other situations. + + Tunable parameters are in @file{scm/slur.scm}. +" + } \version "2.3.22" diff --git a/input/regression/no-staff.ly b/input/regression/no-staff.ly index 524ade91b7..65e43032bc 100644 --- a/input/regression/no-staff.ly +++ b/input/regression/no-staff.ly @@ -7,17 +7,16 @@ corresponding engraver. " } -\score { - { c4 d4 e8 d8 } - \layout { +\layout { raggedright = ##t - \context { - \Staff - \remove Staff_symbol_engraver - \consists Pitch_squash_engraver - \remove Clef_engraver - } - } } +\relative \new Staff \with { + \remove Staff_symbol_engraver + \consists Pitch_squash_engraver + \remove Clef_engraver + } { + c4 d4 e8 d8 + } + diff --git a/input/regression/part-combine-a2.ly b/input/regression/part-combine-a2.ly index b22e7224b1..c49529441b 100644 --- a/input/regression/part-combine-a2.ly +++ b/input/regression/part-combine-a2.ly @@ -5,13 +5,15 @@ and only after chords, solo or polyphony." } -vone = \relative a' { R1*2 g2 r2 g2 r2 a4 r4 g - } +vone = \relative a' { R1*2 g2 r2 g2 r2 a4 r4 g } vtwo = \relative a' { R1*2 g2 r2 g2 r2 f4 r4 g } -\score { - << \set Score.skipBars = ##t +comment = \relative { s1*2 s2_"a2" s2 s2_"no a2" s2 s4 s4 s4_"a2" } + +\layout { raggedright = ##T } + +\new Staff << \set Score.skipBars = ##t \partcombine \vone \vtwo - >> -} + \comment +>> diff --git a/input/regression/part-combine-solo-end.ly b/input/regression/part-combine-solo-end.ly index 14c35fe5a5..a3c049d458 100644 --- a/input/regression/part-combine-solo-end.ly +++ b/input/regression/part-combine-solo-end.ly @@ -1,7 +1,9 @@ \header { texidoc = "SOLO is printed even if the solo voice ends before the - other one. Unfortunately, the multi-rest does not get printed." + other one. Unfortunately, the multi-rest of the 1st voice (which + is 2 bars longer than the 2nd voice) does not get printed." + } \version "2.3.22" diff --git a/input/regression/part-combine-text.ly b/input/regression/part-combine-text.ly index ef753bd435..73e46ac84c 100644 --- a/input/regression/part-combine-text.ly +++ b/input/regression/part-combine-text.ly @@ -11,10 +11,13 @@ texts accordingly. \version "2.3.22" +\layout { raggedright= ##t } + vone = \relative a' { R1 a2 r4 r a a a a } vtwo = \relative a' { R1 f4 f4 f4 f f f a a } - -\score { - \partcombine \vone \vtwo -} +comm = { s1 s2 s4_"expect: solo 2" s4 s2 s4_"expect: a2" s4 } +\new Staff << + \partcombine \vone \vtwo + \comm +>> diff --git a/input/regression/quote.ly b/input/regression/quote.ly index b98d960fc0..f633c5db3c 100644 --- a/input/regression/quote.ly +++ b/input/regression/quote.ly @@ -12,20 +12,29 @@ things are quoted. In this example, a 16th rests is not quoted, since raggedright = ##t } -\addquote bla \relative c' { - fis4 r16 a8.-> b-\ff } -\relative c'' { +quoteMe = \relative c' { fis4 r16 a8.-> b4-\ff } - \set Staff.quotedEventTypes = #'(note-event articulation-event) - c8 d8 << - s2 - \new Voice { - \set fontSize = #-2 - \quote bla 2 +\addquote quoteMe \quoteMe +original = \relative c'' { c8 d s2 es8 gis8 } - } >> - es8 gis - +<< + \new Staff { + \set Staff.instrument = "quoteMe" + \quoteMe } - + \new Staff { + \set Staff.instrument = "orig" + \original + } + \new Staff \relative c'' << + \set Staff.quotedEventTypes = #'(note-event articulation-event) + \original + \new Voice { + s4 + \set fontSize = #-4 + \override Stem #'lengths = #'(2.5 2.5 3.0 3.0) + \quote quoteMe 2. + } + >> +>> diff --git a/lily/part-combine-iterator.cc b/lily/part-combine-iterator.cc index 3e70e5b55c..c75bf3187d 100644 --- a/lily/part-combine-iterator.cc +++ b/lily/part-combine-iterator.cc @@ -259,7 +259,7 @@ Part_combine_iterator::unisono (bool silent) if (!event) event = make_music_by_name (ly_symbol2scm ("UnisonoEvent")); - (state_ == SOLO2 ? second_iter_ : first_iter_) + (last_playing_ == SOLO2 ? second_iter_ : first_iter_) ->try_music_in_children (event); playing_state_ = UNISONO; } @@ -423,7 +423,7 @@ Part_combine_iterator::process (Moment m) programming_error (s); } } - + if (first_iter_->ok ()) { first_iter_->process (m); diff --git a/lily/quote-iterator.cc b/lily/quote-iterator.cc index 62971a9c47..3b676a4cd5 100644 --- a/lily/quote-iterator.cc +++ b/lily/quote-iterator.cc @@ -21,6 +21,7 @@ class Quote_iterator : public Music_iterator { public: Quote_iterator (); + Moment vector_moment (int idx) const; Moment start_moment_; SCM event_vector_; @@ -136,22 +137,24 @@ Quote_iterator::ok () const Moment Quote_iterator::pending_moment () const { - SCM entry = SCM_VECTOR_REF (event_vector_, event_idx_); - return *unsmob_moment (scm_caar (entry)) - start_moment_; + return vector_moment (event_idx_) - start_moment_; } +Moment +Quote_iterator::vector_moment (int idx) const +{ + SCM entry = SCM_VECTOR_REF (event_vector_, idx); + return *unsmob_moment (scm_caar (entry)); +} + + void Quote_iterator::process (Moment m) { - SCM entry = SCM_EOL; - m += start_moment_; - while (event_idx_ < end_idx_) + while (event_idx_ <= end_idx_) { - entry = SCM_VECTOR_REF (event_vector_, event_idx_); - - Moment em = *unsmob_moment (scm_caar (entry)); - + Moment em = vector_moment (event_idx_); if (em > m) return ; @@ -161,8 +164,9 @@ Quote_iterator::process (Moment m) event_idx_++; } - if (scm_is_pair (entry)) + if (event_idx_ <= end_idx_) { + SCM entry = SCM_VECTOR_REF (event_vector_, event_idx_); Pitch * quote_pitch = unsmob_pitch (scm_cdar (entry)); /* diff --git a/scm/part-combiner.scm b/scm/part-combiner.scm index dff2bb87cf..7a96393f1b 100644 --- a/scm/part-combiner.scm +++ b/scm/part-combiner.scm @@ -505,6 +505,7 @@ the mark when there are no spanners active." part-combine-listener)) (first-voice-handle (last-pair noticed))) + ; (display (last-pair noticed)) (if (pair? first-voice-handle) (hash-set! tab name ;; cdr : skip name string -- 2.39.5