]> git.donarmstrong.com Git - lilypond.git/commitdiff
* Documentation/user/instrument-notation.itely: Cleanup: Remove
authorJürgen Reuter <j@web.de>
Sat, 14 Oct 2006 19:13:34 +0000 (19:13 +0000)
committerJürgen Reuter <j@web.de>
Sat, 14 Oct 2006 19:13:34 +0000 (19:13 +0000)
annoying skip notes from mensural ligature example.  Update
@refbugs for ligatures and mensural ligatures.

* lily/coherent-ligature-engraver.cc,
lily/include/coherent-ligature-engraver.hh,
lily/mensural-ligature-engraver.cc,
lily/vaticana-ligature-engraver.cc: Revise code for item
reparentizing.  There should now be less programming_error
messages.

* lily/mensural-ligature-engraver.cc: Improve placement of dots.

* lily/mensural-ligature.cc, lily/vaticana-ligature.cc:
Maintenance bugfix: Don't create empty Stencil (), but empty box
instead.  This fix should eliminate some programming_error
messages.

* ly/engraver-init.ly (MensuralStaff): Set default accidental
style.

* input/regression/mensural-ligatures.ly: Maintenance bugfix: Move
\layout block _before_ score.

ChangeLog
Documentation/user/instrument-notation.itely
input/regression/mensural-ligatures.ly
lily/coherent-ligature-engraver.cc
lily/include/coherent-ligature-engraver.hh
lily/mensural-ligature-engraver.cc
lily/mensural-ligature.cc
lily/vaticana-ligature-engraver.cc
lily/vaticana-ligature.cc
ly/engraver-init.ly

index 4459c006c57aed83ba3d2ff58d555f9ca5c37aa8..86c06fc2c60d1ef994921896260231bc1b0f85a5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2006-10-14  Jürgen Reuter  <reuter@ipd.uka.de>
+
+       * Documentation/user/instrument-notation.itely: Cleanup: Remove
+       annoying skip notes from mensural ligature example.  Update
+       @refbugs for ligatures and mensural ligatures.
+
+       * lily/coherent-ligature-engraver.cc,
+       lily/include/coherent-ligature-engraver.hh,
+       lily/mensural-ligature-engraver.cc,
+       lily/vaticana-ligature-engraver.cc: Revise code for item
+       reparentizing.  There should now be less programming_error
+       messages.
+
+       * lily/mensural-ligature-engraver.cc: Improve placement of dots.
+
+       * lily/mensural-ligature.cc, lily/vaticana-ligature.cc:
+       Maintenance bugfix: Don't create empty Stencil (), but empty box
+       instead.  This fix should eliminate some programming_error
+       messages.
+
+       * ly/engraver-init.ly (MensuralStaff): Set default accidental
+       style.
+
+       * input/regression/mensural-ligatures.ly: Maintenance bugfix: Move
+       \layout block _before_ score.
+
 2006-10-14  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
        * GNUmakefile.in (PATCH_FILES): remove darwin.patch.
index 880d26909eb0e07864f15eb72c5f121e73863c94..488485ccd59e53e9467795930a156d3c90eef023 100644 (file)
@@ -3101,8 +3101,6 @@ correctly align with ligatures.
 Accidentals must not be printed within a ligature, but instead need to
 be collected and printed in front of it.
 
-Augmentum dots within ligatures are not handled correctly.
-
 The syntax still uses the deprecated infix style @code{\[ music expr
 \]}.  For consistency reasons, it will eventually be changed to
 postfix style @code{note\[ ... note\]}.  Alternatively, the file
@@ -3158,11 +3156,8 @@ For example,
 \override Staff.TimeSignature #'style = #'neomensural
 \clef "petrucci-g"
 \[ c'\maxima g \]
-s4
 \[ d\longa c\breve f e d \]
-s4
 \[ c'\maxima d'\longa \]
-s4
 \[ e'1 a g\breve \]
 @end example
 @lilypond[quote,ragged-right]
@@ -3174,11 +3169,8 @@ s4
     \override Staff.TimeSignature #'style = #'neomensural
     \clef "petrucci-g"
     \[ c'\maxima g \]
-    s4
     \[ d\longa c\breve f e d \]
-    s4
     \[ c'\maxima d'\longa \]
-    s4
     \[ e'1 a g\breve \]
   }
   \layout {
@@ -3203,19 +3195,15 @@ to the following
   \override Staff.TimeSignature #'style = #'neomensural
   \clef "petrucci-g"
   \[ c'\maxima g \]
-  s4
   \[ d\longa c\breve f e d \]
-  s4
   \[ c'\maxima d'\longa \]
-  s4
   \[ e'1 a g\breve \]
 }
 @end lilypond
 
 @refbugs
 
-The invisible rests (@code{s4}) in the example are used to compensate
-for the poor horizontal spacing.
+Horizontal spacing is poor.
 
 @node Gregorian square neumes ligatures
 @subsubsection Gregorian square neumes ligatures
index ef95c1d262ac4b1da246162ad2b2cdb11e8d1021..23092e533266feeaa2dbdad2a5e17900107a3452 100644 (file)
@@ -6,6 +6,17 @@
 }
 
 
+\layout {
+  ragged-right = ##t
+  packed = ##t
+  indent = 0.0
+  \context {
+    \Voice
+    \remove Ligature_bracket_engraver
+    \consists Mensural_ligature_engraver
+  }
+}
+
 \context Voice{
   \clef "petrucci-c4"
   \set Staff.printKeyCancellation = ##f
                                %  \]
 }
 
-\layout {
-  ragged-right = ##t
-  packed = ##t
-  indent = 0.0
-  \context {
-    \Voice
-    \remove Ligature_bracket_engraver
-    \consists Mensural_ligature_engraver
-  }
-}
-
 
 % Litterae:
 %
index 96ff842d0c57a44ffe2ff7a9555ce0b40cddd28a..198b954b98f3ce3426378af513d5f1ca1eafbb62 100644 (file)
  * TODO: move this function to class Item?
  */
 void
-Coherent_ligature_engraver::get_set_column (Item *item, Paper_column *column)
+Coherent_ligature_engraver::move_related_items_to_column
+(Item *item, Paper_column *target_column, Real offset)
 {
-  Item *parent = dynamic_cast<Item *> (item->get_parent (X_AXIS));
-  if (!parent)
+  Paper_column *source_column = item->get_column ();
+  Grob *staff_symbol = Staff_symbol_referencer::get_staff_symbol (item);
+  extract_item_set (source_column, "elements", elements);
+  for (vsize i = elements.size (); i--;)
     {
-      programming_error ("failed tweaking paper column in ligature");
-      return;
-    }
-
-  string name = parent->name ();
-  if (name != "PaperColumn")
-    {
-      // Change column not only for targeted item (NoteColumn), but
-      // also for all associated grobs (NoteSpacing, SeparationItem).
-      Grob *sl = Staff_symbol_referencer::get_staff_symbol (item);
+      Item *sibling = elements[i];
+      if (!sibling)
+       // should not occur, but who knows... -jr
+       continue;
 
-      extract_item_set (parent, "elements", elements);
+      if (Staff_symbol_referencer::get_staff_symbol (sibling) != staff_symbol)
+       // sibling is from a staff different than that of the item of
+       // interest
+       continue;
 
-      for (vsize i = elements.size (); i--;)
-       {
-         Item *sibling = elements[i];
-         if ((sibling)
-             && (Staff_symbol_referencer::get_staff_symbol (sibling) == sl))
-           {
 #if 0 /* experimental code to collapse spacing after ligature */
-             Grob *sibling_parent = sibling->get_parent (X_AXIS);
-             sibling_parent->warning (_f ("Coherent_ligature_engraver: "
-                                          "setting `spacing-increment="
-                                          "0.01': ptr=%ul", parent));
-             sibling_parent->set_property ("forced-spacing",
-                                           scm_from_double (0.01));
+      Grob *sibling_parent = sibling->get_parent (X_AXIS);
+      sibling_parent->warning (_f ("Coherent_ligature_engraver: "
+                                  "setting `spacing-increment="
+                                  "0.01': ptr=%ul", parent));
+      sibling_parent->set_property ("forced-spacing",
+                                   scm_from_double (0.01));
 #endif
-             sibling->set_parent (column, X_AXIS);
-           }
-       }
+
+      sibling->set_parent (target_column, X_AXIS);
+      sibling->translate_axis (offset, X_AXIS);
     }
-  else
-    get_set_column (parent, column);
 }
 
 /*
index e8422d9eb182293d15c0f2883d4373f2fce3f181..89eb6b9e32fe78f56bf8cd073bd21208fdceef2e 100644 (file)
@@ -21,7 +21,7 @@ protected:
                               vector<Grob_info> primitives) = 0;
   virtual void typeset_ligature (Spanner *ligature,
                                 vector<Grob_info> primitives);
-  virtual void get_set_column (Item *, Paper_column *);
+  virtual void move_related_items_to_column (Item *, Paper_column *, Real);
 private:
   void collect_accidentals (Spanner *, vector<Grob_info>);
 };
index f40ce004b056b6bbc2df480a3b5bf20d5f9f213d..af2d5b0e6be20a971c557544064a299d53177eb7 100644 (file)
@@ -31,9 +31,6 @@
  * TODO: prohibit ligatures having notes differing only in accidentals
  * (like \[ a\breve g as \])
  *
- * TODO: dotted heads: avoid next note colliding with the dot, e.g. by
- * putting it *above* (rather than after) the affected ligature head.
- *
  * TODO: do something with multiple voices within a ligature.  See
  * for example:
  * Ockeghem: Missa Ecce ancilla domini, bassus part, end of Christe.
@@ -366,21 +363,45 @@ void
 Mensural_ligature_engraver::fold_up_primitives (vector<Grob_info> primitives)
 {
   Item *first = 0;
-  Real distance = 0;
+  Real distance = 0.0;
+  Real dot_shift = 0.0;
   for (vsize i = 0; i < primitives.size (); i++)
     {
       Item *current = dynamic_cast<Item *> (primitives[i].grob ());
       if (i == 0)
-       first = current;
-
-      get_set_column (current, first->get_column ());
+       {
+         first = current;
+         dot_shift = 1.5 * Staff_symbol_referencer::staff_space (first);
+       }
 
-      if (i > 0)
-       current->translate_axis (distance, X_AXIS);
+      move_related_items_to_column (current, first->get_column (),
+                                   distance);
 
       distance
        += scm_to_double (current->get_property ("head-width"))
        - scm_to_double (current->get_property ("thickness"));
+
+      if (Rhythmic_head::dot_count (current) > 0)
+       // Move dots above/behind the ligature.
+       {
+         if (i < primitives.size () - 1)
+           // dot in the midst => move above head
+           {
+             // FIXME: Amount of vertical dot-shift should depend on
+             // pitch.
+             //
+             // FIXME: dot placement is horizontally slightly off.
+             Rhythmic_head::get_dots (current)->translate_axis (dot_shift, Y_AXIS);
+           }
+         else
+           // trailing dot => move behind head
+           {
+             double head_width =
+               scm_to_double (current->get_property ("head-width"));
+             Rhythmic_head::get_dots (current)->
+               translate_axis (head_width, X_AXIS);
+           }
+       }
     }
 }
 
index 5f1d0e6df1361ab8c8fb8e957ddfe0cff4361197..a3514943257ddc08f840ee4fa150ed9a8dd08bb0 100644 (file)
@@ -96,7 +96,7 @@ internal_brew_primitive (Grob *me)
     {
       programming_error ("Mensural_ligature: "
                         "undefined primitive -> ignoring grob");
-      return Stencil ();
+      return Lookup::blank (Box (Interval (0, 0), Interval (0, 0)));
     }
   int primitive = scm_to_int (primitive_scm);
 
@@ -121,7 +121,7 @@ internal_brew_primitive (Grob *me)
   switch (primitive & MLP_ANY)
     {
     case MLP_NONE:
-      return Stencil ();
+      return Lookup::blank (Box (Interval (0, 0), Interval (0, 0)));
     case MLP_LONGA: // mensural brevis head with right cauda
       out = Font_interface::get_default_font (me)->find_by_name
        ("noteheads.s-2mensural");
@@ -140,7 +140,7 @@ internal_brew_primitive (Grob *me)
     default:
       programming_error (_f ("Mensural_ligature: "
                             "unexpected case fall-through"));
-      return Stencil ();
+      return Lookup::blank (Box (Interval (0, 0), Interval (0, 0)));
     }
 
   Real blotdiameter
index 8660ed6e016307049d886f2955f3a5f5d16957ed..94fe3f293ded215d09f7ed2eb96a8b96c820e669 100644 (file)
@@ -344,8 +344,7 @@ Vaticana_ligature_engraver::align_heads (vector<Grob_info> primitives,
       /*
        * Horizontally line-up this head to form a ligature.
        */
-      get_set_column (primitive, column);
-      primitive->translate_axis (ligature_width, X_AXIS);
+      move_related_items_to_column (primitive, column, ligature_width);
       ligature_width += head_width;
 
       prev_primitive = primitive;
index 6c0beaf38722dbfa1f7579e8661403f63b311af3..411953ea878eb2211f31ca08c6e7e851d67558a4 100644 (file)
@@ -176,7 +176,7 @@ vaticana_brew_join (Grob *me, int delta_pitch,
     {
       me->programming_error (_f ("Vaticana_ligature: "
                                 "zero join (delta_pitch == 0)"));
-      return Stencil ();
+      return Lookup::blank (Box (Interval (0, 0), Interval (0, 0)));
     }
   Interval x_extent = Interval (0, join_thickness);
   Interval y_extent = (delta_pitch > 0)
@@ -194,7 +194,7 @@ vaticana_brew_primitive (Grob *me)
     {
       me->programming_error ("Vaticana_ligature: "
                             "undefined glyph-name -> ignoring grob");
-      return Stencil ();
+      return Lookup::blank (Box (Interval (0, 0), Interval (0, 0)));
     }
 
   string glyph_name = ly_scm2string (glyph_name_scm);
index 2687de00ff09c6826a3cca7012ac347d4a5b7ee7..4e04bfe847cb2b12f140040c964997fabdbf4d39 100644 (file)
@@ -866,6 +866,13 @@ AncientRemoveEmptyStaffContext = \context {
   \override Custos #'style = #'mensural
   \override Custos #'neutral-position = #3
   \override Custos #'neutral-direction = #DOWN
+
+  %% Accidentals are valid only once (same as
+  %% #(set-accidental-style 'forget))
+  extraNatural = ##f
+  autoAccidentals = #'(Staff (same-octave . -1))
+  autoCautionaries = #'()  
+  printKeyCancellation = ##f
 }