+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.
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
\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]
\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 {
\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
}
+\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:
%
* 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);
}
/*
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>);
};
* 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.
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);
+ }
+ }
}
}
{
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);
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");
default:
programming_error (_f ("Mensural_ligature: "
"unexpected case fall-through"));
- return Stencil ();
+ return Lookup::blank (Box (Interval (0, 0), Interval (0, 0)));
}
Real blotdiameter
/*
* 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;
{
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)
{
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);
\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
}