]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/music-functions.scm (determine-split-list): bugfix: only use
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 28 Jan 2004 00:01:48 +0000 (00:01 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 28 Jan 2004 00:01:48 +0000 (00:01 +0000)
new-active for both voices if both indexes advance. This fixes the
biggest outstanding problem with new-pc.

* lily/new-part-combine-iterator.cc (construct_children): set more
directions.

ChangeLog
input/regression/new-part-combine.ly
input/test/trills.ly
lily/grob-pq-engraver.cc
lily/instrument-name-engraver.cc
lily/new-part-combine-iterator.cc
scm/define-grob-interfaces.scm
scm/define-grobs.scm
scm/music-functions.scm

index c1e3a041f66003440d048cea5860e11a77ebcf03..ea6c0459c62d2e069e61804a895cdc8a7a0d95c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-01-28  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * scm/music-functions.scm (determine-split-list): bugfix: only use
+       new-active for both voices if both indexes advance. This fixes the
+       biggest outstanding problem with new-pc. 
+
+       * lily/new-part-combine-iterator.cc (construct_children): set more
+       directions.
+
 2004-01-27  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
        * scripts/convert-ly.py (conv): add instrument rule.
index 1e315e6e36ad736be15e3d4c85bc8834448f9fc1..e83d6bdde30ff59ccd7b10231bd6f957ab48d41f 100644 (file)
@@ -14,8 +14,13 @@ theMusic = \context Staff \notes { c4 d8-. }
 
 
 
-vone = \notes \relative a' { g2 g    g  g4 g f' c c( c) c c  c ~ c }
-vtwo = \notes \relative a' { f2 f4 f f2 g4 g c, f f  f  f f~ f ~ f }
+vone = \notes \relative a' { g2 g    g  g4 g f' c c( c) c c  c ~ c
+                            c2. c4   c
+                        }
+vtwo = \notes \relative a' { f2 f4 f f2 g4 g c, f f  f  f f~ f ~ f
+                            f4 f2. ~ f4
+
+                        }
 
 \score {
    \newpartcombine \vone \vtwo
index f44aa933165b7a9dd0bfb731d3fbac1dd5800821..f74c9ea466c51889a7fb4f8b3b56ed0558484af2 100644 (file)
@@ -19,20 +19,6 @@ title="Marques des agr\\'ements et leur signification"
 invisible = \property Voice.NoteHead \override #'transparent = ##t
 visible = \property Voice.NoteHead \revert #'transparent
 
-% Ugly hack to get reasonable position of the pincĂ© and Cheute
-startHorizScript = {
-  \property Voice.scriptHorizontal = ##t
-  \property Voice.Script \override #'padding = #0.3
-  \property Voice.Script \override #'extra-offset = #'(-.6 . 0)
-  % Avoid collision with the dots of dotted notes
-  \property Voice.Dots \override #'extra-X-extent = #'(-0.7 . 0)
-}
-endHorizScript = {
-  \property Voice.scriptHorizontal \unset
-  \property Voice.Dots \revert #'padding
-  \property Voice.Script \revert #'padding
-  \property Voice.Script \revert #'extra-offset
-}
 
 
 \score {
@@ -55,8 +41,8 @@ endHorizScript = {
        { 
           \property Voice.Script \override #'extra-offset = #'(-0.8 . 2.0)
           b_\turn}>>
-       \startHorizScript
 %{ FIXME  \comma does not exist
+       \startHorizScript
  
        c^\comma
        \time 3/8
@@ -64,8 +50,8 @@ endHorizScript = {
        b8 c4_\comma 
        c8 b4_\comma
        b8 c4^\comma _\comma
-%}
        \endHorizScript
+%}
         \time  2/2 \slurDown
        <<{c2}{s4 \invisible d1*1/4 ( \visible }>>  e2)
        <<{a,2}{s4 \invisible b1*1/4 ( \visible }>>  d2)
index bf46d20166ad0edbb81e27fef6499bf37b8b0fe2..5324d5362353d8a0d1da026cdc9da6ad3c80249e 100644 (file)
 #include "grob.hh"
 #include "warn.hh"
 
+/*
+  TODO: should junk this engraver.
+ */
+
 struct Grob_mom
 {
   Grob * grob_ ;
@@ -28,6 +32,7 @@ int compare  (Grob_mom const &a, Grob_mom const &b)
   return Moment::compare (a.end_, b.end_);
 }
 
+/****************/
 
 class Grob_pq_engraver: public Engraver
 {
@@ -59,7 +64,8 @@ Grob_pq_engraver::acknowledge_grob (Grob_info gi)
 {
   Music  * m = gi.music_cause ();
 
-  if (m)
+  if (m
+      && !gi.grob_->internal_has_interface (ly_symbol2scm ("multi-measure-interface")))
     {
       Moment n = now_mom ();
       Moment l = m->get_length ();
index c38022300915a6de40035e34ca18cc794d90131b..74f0754cd1d2e693de85506e13e680f2cb5673c4 100644 (file)
@@ -79,7 +79,8 @@ Instrument_name_engraver::create_text ()
       
   if (text_->get_grob_property ("text") != txt)
     text_->set_grob_property ("text", txt);
-}
+  announce_grob (text_, SCM_EOL);
+  }
 
 void
 Instrument_name_engraver::acknowledge_grob (Grob_info i)
@@ -172,6 +173,7 @@ Vocal_name_engraver::create_text ()
       
   if (text_->get_grob_property ("text") != txt)
     text_->set_grob_property ("text", txt);
+  announce_grob (text_, SCM_EOL);
 }
 
 
index 48a8039e35cc03faf4f1d353b87a4280cc60fbcb..ecb4534c17445cdd1306391171c195e9707f7c9b 100644 (file)
@@ -216,8 +216,6 @@ New_pc_iterator::construct_children ()
                                                      "one", props);
 
   one_.set_translator (one);
-  one->execute_pushpop_property (ly_symbol2scm ("Stem"),
-                                ly_symbol2scm ("direction"), gh_int2scm (1));
 
   set_translator (one);
   first_iter_ = unsmob_iterator (get_iterator (unsmob_music (gh_car (lst))));
@@ -226,13 +224,34 @@ New_pc_iterator::construct_children ()
   Translator_group *two = tr->find_create_translator (ly_symbol2scm ("Voice"),
                                                      "two", props);
   two_.set_translator (two);
-  two_.report_to ()->execute_pushpop_property (ly_symbol2scm ("Stem"),
-                                 ly_symbol2scm ("direction"), gh_int2scm (-1));
   set_translator (two);
   second_iter_ = unsmob_iterator (get_iterator (unsmob_music (gh_cadr (lst))));
 
 
   set_translator (tr);
+
+
+  char const * syms[] = {
+    "Stem",
+    "DynamicLineSpanner",
+    "Tie",
+    "Dots",
+    "Slur",
+    "TextScript",
+    "Script",
+    0
+  };
+  
+  for (char const**p = syms; *p; p++)
+    {
+      SCM sym = ly_symbol2scm (*p);
+      one->execute_pushpop_property (sym,
+                                    ly_symbol2scm ("direction"), gh_int2scm (1));
+
+      two->execute_pushpop_property (sym,
+                                    ly_symbol2scm ("direction"), gh_int2scm (-1));
+    }
+
 }
 
 void
index 9012a85e4534bca78d8fa6537500c511d7d5b6aa..fbf6f2a2eb008ccff892e2bafcedfc57170d2a08 100644 (file)
@@ -58,6 +58,13 @@ extents of a cluster spanner at this X position.
  '(
    ))
 
+
+(ly:add-interface
+ 'multi-measure-interface
+ "Multi measure rest, and friends (mmrest number, mmrest text)."
+ '())
+
+
 (ly:add-interface
 'note-name-interface
  "Note name"
index 93f0974f64bcc807bcc812d8ecfaa754c8d60724..6d83c4278f02f338db9a1bb9357082113dec9a08 100644 (file)
        (meta . ((interfaces . (font-interface self-alignment-interface side-position-interface text-interface break-aligned-interface item-interface ))))
        ))
     
-    (InstrumentName
+    (VocalName
      . (
        (breakable . #t)
        (Y-offset-callbacks . (,Side_position_interface::aligned_on_support_refpoints))
        (space-alist . ((left-edge . (extra-space . 1.0))
                        ))
        (molecule-callback . ,Text_item::brew_molecule)         
-       (break-align-symbol . instrument-name)
+       (break-align-symbol . clef)
        (break-visibility . ,begin-of-line-visible)
        (baseline-skip . 2)
        (font-family . roman)
        (thick-thickness . 6.6)
        (hair-thickness . 2.0)
        (padding . 1)
-       (meta . ((interfaces . (multi-measure-rest-interface rest-interface font-interface staff-symbol-referencer-interface))))
+       (meta . ((interfaces . (multi-measure-rest-interface multi-measure-interface rest-interface font-interface staff-symbol-referencer-interface))))
        ))
     
     (MultiMeasureRestNumber
        (padding . 1.3)
        (staff-padding . 1.3)
        (font-family . number)
-       (meta . ((interfaces . (side-position-interface self-alignment-interface font-interface spanner-interface text-interface))))
+       (meta . ((interfaces . (side-position-interface multi-measure-interface self-alignment-interface font-interface spanner-interface text-interface))))
        ))
     (MultiMeasureRestText
      . (
        (padding . 1.5)
        (staff-padding . 1.5)
        (font-family . roman)
-       (meta . ((interfaces . (side-position-interface self-alignment-interface font-interface spanner-interface text-interface))))
+       (meta . ((interfaces . (side-position-interface multi-measure-interface self-alignment-interface font-interface spanner-interface text-interface))))
        ))
  (NoteCollision
      . (
index d0ca581467e308a4a6d7fdf79e5b2e34a23ff2bf..081163c8af0ec0a6088c8512e3c872b32f359b67 100644 (file)
@@ -866,6 +866,7 @@ Rest can contain a list of beat groupings
       (if (equal? (ly:get-mus-property ev 'name) 'NoteEvent)
          (assoc-remove!  active 'tie)
          active) )
+    
     (define (active<? a b)
       (cond
        ((symbol<? (car a) (car b)) #t)
@@ -924,7 +925,6 @@ Rest can contain a list of beat groupings
        ))
        
 
-;    (display (list i1 i2 ri active1 active2 (vector-length ev1) (vector-length ev2) (vector-length result)  "\n"))
     (cond
      ((= ri (vector-length result)) '())
      ((= i1 (vector-length ev1)) (put 'apart))
@@ -938,10 +938,16 @@ Rest can contain a list of beat groupings
 ;         (x (display "oked"))
           (evs1 (map car (what ev1 i1)))
           (evs2 (map car (what ev2 i2)))
-          
           (new-active1 (analyse-events active1 evs1))
           (new-active2 (analyse-events active2 evs2))
           )
+
+       
+       (or #t (display (list (when result ri) i1 i2 ri
+                      active1 "->" new-active1
+                      active2 "->" new-active2
+                      (vector-length ev1) (vector-length ev2) (vector-length result)  "\n")))
+    
        
        (if (not (or (equal? m1 (when result ri))
                     (equal? m2 (when result ri))))
@@ -955,24 +961,32 @@ Rest can contain a list of beat groupings
         ((ly:moment<? m1 m2)
          (put 'apart)
          (if (> ri 0) (put 'apart (1- ri)))
-         (analyse-time-step (1+ i1) i2 (1+ ri) new-active1 new-active2))
+         (analyse-time-step (1+ i1) i2 (1+ ri) new-active1 active2))
         ((ly:moment<? m2 m1)
          (put 'apart)
          (if (> ri 0) (put 'apart (1- ri)))
-         (analyse-time-step i1 (1+ i2) (1+ ri) new-active1 new-active2))
+         (analyse-time-step i1 (1+ i2) (1+ ri) active1 new-active2))
         (else
          (if (and (equal? active1 active2) (equal? new-active2 new-active1))
              (let*
                  ((notes1 (get-note-evs ev1 i1))
+                  (durs1     (sort (map (lambda (x) (ly:get-mus-property x 'duration)) notes1) ly:duration<?))
                   (pitches1 (sort
                              (map (lambda (x) (ly:get-mus-property x 'pitch)) notes1) ly:pitch<?))
                   (notes2 (get-note-evs ev2 i2))
+                  (durs2     (sort (map (lambda (x) (ly:get-mus-property x 'duration)) notes2) ly:duration<?))
                   (pitches2 (sort
                              (map (lambda (x) (ly:get-mus-property x 'pitch)) notes2) ly:pitch<?))
                   )
                (cond
                 ((> (length notes1) 1) (put 'apart))
                 ((> (length notes2) 1) (put 'apart))
+                ((and
+                  (= (length durs1) 1)
+                  (= (length durs2) 1)
+                  (not (equal? (car durs1) (car durs2))))
+
+                 (put 'apart))
                 (else
                  (if
                   (and (= (length pitches1) 1) (= (length pitches2) 1)