]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/quote-iterator.cc (process): use <= for comparisons. Fixes
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 30 Oct 2004 17:23:48 +0000 (17:23 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 30 Oct 2004 17:23:48 +0000 (17:23 +0000)
quote problem if for last note of quoted sequence.

* input/regression/part-combine-text.ly (comm): add expect strings.

19 files changed:
ChangeLog
input/regression/accidentals.ly [deleted file]
input/regression/beam-dir-functions.ly [deleted file]
input/regression/grace-volta-repeat-2.ly
input/regression/grace.ly
input/regression/key-signature-cancellation.ly
input/regression/keys.ly
input/regression/lyric-combine.ly
input/regression/lyrics-bar.ly
input/regression/music-function.ly
input/regression/new-slur.ly
input/regression/no-staff.ly
input/regression/part-combine-a2.ly
input/regression/part-combine-solo-end.ly
input/regression/part-combine-text.ly
input/regression/quote.ly
lily/part-combine-iterator.cc
lily/quote-iterator.cc
scm/part-combiner.scm

index 3e307c4a85201bb7a88e12bf96801027ff38bded..49ad00c3fc7b41e0551f11fe64bfb00f97a64195 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-10-30  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * 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  <wl@gnu.org>
 
        * Documentation/user/examples.itely: Improved layout.
 
 2004-10-30  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * 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 (file)
index 016f2ca..0000000
+++ /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 (file)
index 3a1f38c..0000000
+++ /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:
-
-
-
index eb28300b8eb0a779ecf62ebd5eaf6336393f2b90..ac37f00a85cec80c5befcbd1b97c8aa8d1de08ee 100644 (file)
@@ -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{:||:}."
 
       }
 
index 5a00f76b5ab394e6abe6308706faf494c9b70703..a2c049abf7f983dbcd9bd125afec618bb9c52b84 100644 (file)
@@ -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. 
 
 "
 }
index 5fc3fa7f17097ee1e1561bac4b257faeeb29380c..fa2734fe38aa5724a7a64dfa29117a2206fea2a6 100644 (file)
@@ -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"
index 94cffd9e289d488d38d55527a669cf93d71f6985..c089d90a8f546547dce34acce00f3292d1e181c9 100644 (file)
@@ -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
 }
 
index da93d9dc518fad5735299fc4416cfc45644a172d..dfe509d2099d607db1711c3b6489d2bed0d61d68 100644 (file)
@@ -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 
 >>
 
 
index 28601d76ae0f2c2b64d46770da86b274a706b083..ecff5f539a0a1e9e3e2ab33138274da95984859a 100644 (file)
@@ -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 }
+>>
+       
+
index 99255c3710c269922844731623bbd48cbb3ac27e..19cb5a887cf267d49ef9d94091e7c04e0bb2c9e2 100644 (file)
@@ -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
 }
 
index 9cb636b15ef9541486e34326c8345f198f04cf38..8d26f5458dad931c855fc0a5dc57dafac09ba637 100644 (file)
@@ -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"
index 524ade91b7fdde4161f0f20698daff7bb449b3f6..65e43032bc11b5111bd75436488b29229788611d 100644 (file)
@@ -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
+    }
+
 
index b22e7224b1a4306e027eb64123bb10ae2ee1acca..c49529441b7f24e491a7e898c0375c2b730c0f27 100644 (file)
@@ -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
+>>
  
index 14c35fe5a5c39bb4f082fa9e40746cded60e38c0..a3c049d4589eca0c6c8fa5e7f0528355de578010 100644 (file)
@@ -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"
index ef753bd435c903db1c076e3989ef9b304905938f..73e46ac84cd9d9e68f92d89e02cc340557607e11 100644 (file)
@@ -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
+>>
  
index b98d960fc05b5b1d4c3405d758b903178d386f6b..f633c5db3cbf81c606470b34db338be83e63214d 100644 (file)
@@ -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.
+       }
+    >>
+>>
index 3e70e5b55c010c276c8bd3f5cee4300de42df04d..c75bf3187db61b3da3dd727362673b41406e7dc4 100644 (file)
@@ -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);
index 62971a9c47b2d31c2f86375d3e1f77f1616f8e07..3b676a4cd5155f544f60766c6cc20e571be4b31a 100644 (file)
@@ -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));
 
       /*
index dff2bb87cf20f065e02be937887c326c819e6035..7a96393f1b13dce53960e72a80fb4ba44c8023df 100644 (file)
@@ -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