+2003-04-22 Juergen Reuter <reuter@ipd.uka.de>
+
+ * Documentation/user/music-glossary.tely: bugfix: #'flag-style =
+ #"" -> #'flag-style = #'()
+
+ * lily/cluster-engraver.cc, lily/ligature-bracket-engraver.cc:
+ cleanup: removed dead #includes
+
+ * lily/gregorian-ligature-engraver.cc,
+ lily/include/gregorian-ligature.hh,
+ scm/grob-property-description.scm: small cleanups, small spacing
+ fixes
+
+ * lily/gregorian-ligature-engraver.cc, lily/parser.yy,
+ lily/vaticana-ligature.cc,
+ lily/include/gregorian-ligature-engraver.hh,
+ scm/grob-property-description.scm, scm/music-types.scm:
+ "porrectus" -> "pes or flexa"
+
+ * ly/engraver-init.ly, scm/grob-description.scm,
+ scm/grob-property-description.scm: junked porrectus, now handled
+ by ligature code
+
+ * scm/grob-description.scm: bugfix: added space-alist entry for
+ breathing sign/custos
+
2003-04-24 Jan Nieuwenhuizen <janneke@gnu.org>
* Another grand 2003 update.
\property Score.TextScript \set #'font-style = #'large
<<d a fis>>4_"notation" r
-{ \property Voice.Stem \override #'flag-style = #""
+{ \property Voice.Stem \override #'flag-style = #'()
\grace g16
\property Voice.Stem \revert #'flag-style
}
fis8 e16 fis
-{ \property Voice.Stem \override #'flag-style = #""
+{ \property Voice.Stem \override #'flag-style = #'()
\grace a16
\property Voice.Stem \revert #'flag-style
}
#include "item.hh"
#include "spanner.hh"
#include "note-head.hh"
-#include "protected-scm.hh"
-#include "warn.hh"
#include "note-column.hh"
#include "group-interface.hh"
Gregorian_ligature_engraver::Gregorian_ligature_engraver ()
{
- porrectus_req_ = 0;
+ pes_or_flexa_req_ = 0;
}
void
bool
Gregorian_ligature_engraver::try_music (Music *m)
{
- if (m->is_mus_type ("porrectus-event"))
+ if (m->is_mus_type ("pes-or-flexa-event"))
{
- porrectus_req_ = m;
+ pes_or_flexa_req_ = m;
return true;
}
else
provide_context_info (Array<Grob_info> primitives)
{
Grob *prev_primitive = 0;
+ int prev_prefix_set = 0;
int prev_context_info = 0;
int prev_pitch = 0;
for (int i = 0; i < primitives.size(); i++) {
primitive->warning ("may not apply `\\~' on heads with "
"identical pitch; ignoring `\\~'");
}
+ if (prev_prefix_set & VIRGA)
+ {
+ context_info |= AFTER_VIRGA;
+ }
+
if (prev_primitive)
prev_primitive->set_grob_property ("context-info",
gh_int2scm (prev_context_info));
prev_primitive = primitive;
+ prev_prefix_set = prefix_set;
prev_context_info = context_info;
prev_pitch = pitch;
}
Gregorian_ligature_engraver::start_translation_timestep ()
{
Ligature_engraver::start_translation_timestep ();
- porrectus_req_ = 0;
+ pes_or_flexa_req_ = 0;
}
ENTER_DESCRIPTION (Gregorian_ligature_engraver,
class Gregorian_ligature_engraver : public Ligature_engraver
{
- Music *porrectus_req_;
+ Music *pes_or_flexa_req_;
public:
TRANSLATOR_DECLARATIONS(Gregorian_ligature_engraver);
#define PES_UPPER 0x0002 // this is a head after "\~" in an ascending melody
#define FLEXA_LEFT 0x0004 // this is a head before "\~" in a descending melody
#define FLEXA_RIGHT 0x0008 // this is a head after "\~" in a descending melody
+#define AFTER_VIRGA 0x0010 // previous head was a virga
#endif /* GREGORIAN_LIGATURE_HH */
+++ /dev/null
-/*
- porrectus.hh
-
- Copyright (c) 2001--2003 Juergen Reuter
-
- written for the GNU LilyPond music typesetter
-*/
-
-#ifndef PORRECTUS_HH
-#define PORRECTUS_HH
-
-#include "lily-guile.hh"
-
-/*
- porrectus ligature
-*/
-class Porrectus
-{
-public:
- static void set_left_head (Grob *, Item *);
- static Item *get_left_head (Grob *);
- static void set_right_head (Grob *, Item *);
- static Item *get_right_head (Grob *);
- DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
- static bool has_interface (Grob*);
-
-private:
- static Molecule brew_vaticana_molecule (Item *, Real,
- bool, Real, Real,
- bool, Direction);
- static Molecule brew_mensural_molecule (Item *, Real,
- bool, Real, Real,
- bool, Direction);
- static Molecule create_ledger_line (Interval, Grob *);
- static Molecule create_streepjes (Grob *, int, int, Interval);
-};
-
-#endif // PORRECTUS_HH
#include "note-column.hh"
#include "tuplet-bracket.hh"
#include "spanner.hh"
-#include "warn.hh"
class Ligature_bracket_engraver : public Ligature_engraver
{
$$ = MY_MAKE_MUSIC("BreathingSignEvent");
}
| E_TILDE {
- $$ = MY_MAKE_MUSIC("PorrectusEvent");
+ $$ = MY_MAKE_MUSIC("PesOrFlexaEvent");
}
;
+++ /dev/null
-/*
- porrectus-engraver.cc -- implement Porrectus_engraver
-
- Copyright (c) 2001--2003 Juergen Reuter
-
- written for the GNU LilyPond music typesetter
-*/
-
-/*
- * FIXME: Currently, when creating a porrectus item, it takes the
- * moment of the second note. Actually, it should take the moment of
- * the first note.
- *
- * FIXME: Turn off typesetting of stems, flags, dots, etc.
- *
- * TODO: Hufnagel support.
- *
- * TODO: The following issues are currently not handled by this
- * engraver: (1) accidentals placement, (2) spacing. For example,
- * currently only the accidental for the second note (cp. the above
- * FIXME) is printed. These issues should be resolved by some sort of
- * ligature context that encloses use of this engraver, using syntax
- * like: \ligature { e \~ c }.
- *
- * TODO: Do not allow a series of adjacent porrectus events, as in:
- * e \~ d \~ c.
- *
- * TODO: Junk duplicate (or rather triple) implementation of
- * create_ledger_line in porrectus.cc, custos.cc and note-head.cc.
- */
-
-#include "staff-symbol-referencer.hh"
-#include "porrectus.hh"
-#include "event.hh"
-
-#include "rhythmic-head.hh"
-#include "item.hh"
-#include "engraver.hh"
-#include "score-engraver.hh"
-#include "pqueue.hh"
-#include "warn.hh"
-#include "grob-pitch-tuple.hh"
-
-class Porrectus_engraver : public Engraver {
-public:
- TRANSLATOR_DECLARATIONS(Porrectus_engraver);
-
-protected:
- virtual bool try_music (Music *req);
- virtual void process_music ();
- virtual void process_acknowledged_grobs ();
- virtual void stop_translation_timestep ();
- virtual void start_translation_timestep ();
- virtual void acknowledge_grob (Grob_info);
-
-private:
- PQueue<Grob_pitch_tuple> past_notes_pq_;
- Music *porrectus_req_;
- Array<Grob_pitch_tuple> left_heads_;
- Array<Grob_pitch_tuple> right_heads_;
- Link_array<Grob> porrectuses_;
-};
-
-Porrectus_engraver::Porrectus_engraver ()
-{
- porrectus_req_ = 0;
-}
-
-bool
-Porrectus_engraver::try_music (Music *m)
-{
- if (m->is_mus_type ("porrectus-event"))
- {
- porrectus_req_ = m;
- return true;
- }
- else
- return false;
-}
-
-void
-Porrectus_engraver::process_music ()
-{
- if (porrectus_req_)
- {
- top_engraver ()->forbid_breaks ();
- }
-}
-
-void
-Porrectus_engraver::acknowledge_grob (Grob_info info_)
-{
- if (Rhythmic_head::has_interface (info_.grob_))
- {
- Music * m = info_.music_cause ();
- if (m->is_mus_type ("note-event"))
- right_heads_.push (Grob_pitch_tuple (info_.grob_, m,
- now_mom () +
- m->get_length ()));
- }
-}
-
-void
-Porrectus_engraver::process_acknowledged_grobs ()
-{
- if (porrectus_req_)
- {
- left_heads_.sort (Grob_pitch_tuple::pitch_compare);
- right_heads_.sort (Grob_pitch_tuple::pitch_compare);
- int i = left_heads_.size () - 1;
- int j = right_heads_.size () - 1;
-
- while ((i >= 0) && (j >= 0))
- {
- Item *left_head = dynamic_cast<Item*> (left_heads_[i].head_);
- Item *right_head = dynamic_cast<Item*> (right_heads_[j].head_);
- left_head->set_grob_property("transparent", gh_bool2scm(true));
- right_head->set_grob_property("transparent", gh_bool2scm(true));
-
- Grob *porrectus_ = new Item (get_property ("Porrectus"));
- Porrectus::set_left_head(porrectus_, left_head);
- Porrectus::set_right_head(porrectus_, right_head);
- porrectuses_.push (porrectus_);
- announce_grob(porrectus_, porrectus_req_->self_scm());
-
- past_notes_pq_. insert (right_heads_[i]);
- left_heads_.del (i);
- right_heads_.del (j);
- i--;
- j--;
- }
- }
-}
-
-void
-Porrectus_engraver::stop_translation_timestep ()
-{
- for (int i = 0; i < right_heads_.size (); i++)
- {
- past_notes_pq_.insert (right_heads_[i]);
- }
- right_heads_.clear ();
-
- for (int i = 0; i < porrectuses_.size (); i++)
- {
- typeset_grob (porrectuses_[i]);
- }
- porrectuses_.clear ();
-}
-
-void
-Porrectus_engraver::start_translation_timestep ()
-{
- porrectus_req_ = 0;
- Moment now = now_mom ();
- while (past_notes_pq_.size () && past_notes_pq_.front ().end_ < now)
- past_notes_pq_.delmin ();
-
- left_heads_.clear ();
- while (past_notes_pq_.size () &&
- (past_notes_pq_.front ().end_ == now))
- left_heads_.push (past_notes_pq_.get ());
-}
-
-
-
-ENTER_DESCRIPTION(Porrectus_engraver,
-/* descr */ "Join adjacent notes to a porrectus ligature.",
-/* creats*/ "Porrectus",
-/* accepts */ "porrectus-event",
-/* acks */ "rhythmic-head-interface",
-/* reads */ "",
-/* write */ "");
+++ /dev/null
-/*
- porrectus.cc -- implement Porrectus
-
- Copyright (c) 2001--2003 Juergen Reuter
-
- written for the GNU LilyPond music typesetter
-
- TODO: --> see porrectus-engraver.cc
-*/
-
-#include "staff-symbol-referencer.hh"
-#include "porrectus.hh"
-#include "item.hh"
-#include "molecule.hh"
-#include "pitch.hh"
-#include "lookup.hh"
-#include "warn.hh"
-#include "dimensions.hh"
-#include "direction.hh"
-#include "bezier.hh"
-#include "font-interface.hh"
-#include "paper-def.hh"
-#include "note-head.hh"
-#include "math.h" // rint
-
-void
-Porrectus::set_left_head (Grob *me, Item *left_head)
-{
- if (left_head != 0)
- {
- me->set_grob_property ("left-head", left_head->self_scm());
- }
- else
- {
- programming_error (_ ("(left_head == 0)"));
- me->set_grob_property ("left-head", SCM_EOL);
- }
-}
-
-Item *
-Porrectus::get_left_head (Grob *me)
-{
- SCM left_head_scm = me->get_grob_property ("left-head");
- if (left_head_scm == SCM_EOL)
- {
- programming_error (_ ("undefined left_head"));
- return 0;
- }
- else
- {
- Item *left_head = unsmob_item (left_head_scm);
- return left_head;
- }
-}
-
-void
-Porrectus::set_right_head (Grob *me, Item *right_head)
-{
- if (right_head != 0)
- {
- me->set_grob_property ("right-head", right_head->self_scm());
- }
- else
- {
- programming_error (_ ("(right_head == 0)"));
- me->set_grob_property ("right-head", SCM_EOL);
- }
-}
-
-Item *
-Porrectus::get_right_head (Grob *me)
-{
- SCM right_head_scm = me->get_grob_property ("right-head");
- if (right_head_scm == SCM_EOL)
- {
- programming_error (_ ("undefined right_head"));
- return 0;
- }
- else
- {
- Item *right_head = unsmob_item (right_head_scm);
- return right_head;
- }
-}
-
-MAKE_SCHEME_CALLBACK (Porrectus,brew_molecule,1);
-SCM
-Porrectus::brew_molecule (SCM smob)
-{
- Item *me = (Item *)unsmob_grob (smob);
-
- Item *left_head = get_left_head (me);
- Item *right_head = get_right_head (me);
- if (!left_head || !right_head)
- {
- me->warning (_ ("junking lonely porrectus"));
- me->suicide ();
- return SCM_EOL;
- }
-
- SCM scm_style = me->get_grob_property ("style");
- String style;
- if ((gh_symbol_p (scm_style)) && (scm_style != SCM_EOL))
- style = ly_symbol2string (scm_style);
- else {
- me->warning (_ ("porrectus style undefined; using mensural"));
- style = "mensural";
- }
-
- bool solid = to_boolean (me->get_grob_property ("solid"));
- bool add_stem = to_boolean (me->get_grob_property ("add-stem"));
-
- /*
- * This property is called stem-direction (rather than direction)
- * since it only refers to this grob's stem (or, more precisely, its
- * "cauda"), but not the grob as a whole.
- */
- SCM stem_direction_scm = me->get_grob_property ("direction");
- Direction stem_direction =
- gh_number_p (stem_direction_scm) ? to_dir (stem_direction_scm) : DOWN;
- if (!stem_direction)
- stem_direction = DOWN;
-
- /*
- TODO: revise name.
- */
- bool auto_properties = to_boolean (me->get_grob_property ("auto-properties"));
- if (auto_properties)
- // determine add_stem and stem_direction automatically from durations
- {
- if (String::compare (style, "mensural") != 0)
- me->warning (String("auto-property should be used for\r\n") +
- String("mensural style porrectus only; trying anyway"));
-
- int left_duration =
- gh_scm2int (left_head->get_grob_property ("duration-log"));
- int right_duration =
- gh_scm2int (right_head->get_grob_property ("duration-log"));
-
- if ((left_duration == -1) && (right_duration == -1))
- {
- // brevis -- brevis:
- // cum proprietate et sine perfectione (c.s.)
- add_stem = true;
- stem_direction = DOWN;
- }
- else if ((left_duration == -2) && (right_duration == -1))
- {
- // longa -- brevis:
- // sine proprietate et sine perfectione (s.s.)
- add_stem = false;
- }
- else if ((left_duration == 0) && (right_duration == 0))
- {
- // semibrevis -- semibrevis:
- // cum opposita proprietate (c.o.p.)
- add_stem = true;
- stem_direction = UP;
- }
- else
- {
- me->warning (String("auto-property: failed determining porrectus\r\n") +
- String("properties due to improper durations; ") +
- String("using user-supplied properties"));
- }
- }
-
- Real left_position_f = Staff_symbol_referencer::get_position (left_head);
- Real right_position_f = Staff_symbol_referencer::get_position (right_head);
- Real interval = right_position_f - left_position_f;
-
- Molecule molecule;
-
- SCM line_thickness_scm = me->get_grob_property ("thickness");
- Real line_thickness;
- if (gh_number_p (line_thickness_scm))
- {
- line_thickness = gh_scm2double (line_thickness_scm);
- }
- else
- {
- line_thickness = 1.0;
- }
- Real thickness =
- line_thickness * me->get_paper ()->get_var ("linethickness");
-
- SCM porrectus_width_scm = me->get_grob_property ("width");
- Real porrectus_width;
- if (gh_number_p (porrectus_width_scm))
- {
- porrectus_width = gh_scm2double (porrectus_width_scm);
- }
- else
- {
- porrectus_width = 2.4;
- }
- Real width = porrectus_width * Staff_symbol_referencer::staff_space (me);
-
- if (String::compare (style, "vaticana") == 0)
- molecule = brew_vaticana_molecule (me, interval,
- solid, width, thickness,
- add_stem, stem_direction);
- else if (String::compare (style, "mensural") == 0)
- molecule = brew_mensural_molecule (me, interval,
- solid, width, thickness,
- add_stem, stem_direction);
- else
- return SCM_EOL;
-
- Real space = Staff_symbol_referencer::staff_space (me);
- Real head_extent = molecule.extent (X_AXIS).length ();
- Interval extent (-0.2 * head_extent, 1.2 * head_extent);
- int interspaces = Staff_symbol_referencer::line_count (me)-1;
-
- molecule.translate_axis (left_position_f * space/2, Y_AXIS);
-
- int left_pos = (int)rint (left_position_f);
- if (abs (left_pos) - interspaces > 1)
- {
- Molecule left_head_ledger_lines =
- Note_head::brew_ledger_lines (me, left_pos, interspaces, extent, true);
- left_head_ledger_lines.translate_axis (left_position_f * space/2,
- Y_AXIS);
- molecule.add_molecule (left_head_ledger_lines);
- }
-
- int right_pos = (int)rint (right_position_f);
- if (abs (right_pos) - interspaces > 1)
- {
- Molecule right_head_ledger_lines =
- Note_head::brew_ledger_lines (me, right_pos, interspaces, extent, true);
- right_head_ledger_lines.translate_axis (right_position_f * space/2,
- Y_AXIS);
- molecule.add_molecule (right_head_ledger_lines);
- }
-
- return molecule.smobbed_copy();
-}
-
-Molecule
-Porrectus::brew_vaticana_molecule (Item *me,
- Real interval,
- bool solid,
- Real width,
- Real thickness,
- bool add_stem,
- Direction stem_direction)
-{
- if (interval >= 0.0)
- {
- me->warning (_ ("ascending vaticana style porrectus"));
- }
-
- Real space = Staff_symbol_referencer::staff_space (me);
- Molecule molecule = Molecule ();
- Real right_height = 0.6 * space;
-
- // Compensate thickness that appears to be smaller in steep section
- // of bend.
- Real left_height = right_height + min (0.12 * abs(interval), 0.3) * space;
-
- if (add_stem)
- {
- bool consider_interval =
- stem_direction * interval > 0.0;
-
- Interval stem_box_x (0, thickness);
- Interval stem_box_y;
-
- if (consider_interval)
- {
- Real y_length = max (abs(interval)/2.0*space +
- (right_height-left_height),
- 1.2*space);
- stem_box_y = Interval (0, y_length);
- }
- else
- stem_box_y = Interval (0, space);
-
- Real y_correction =
- (stem_direction == UP) ?
- +0.5*left_height :
- -0.5*left_height - stem_box_y.length();
-
- Box stem_box (stem_box_x, stem_box_y);
- Molecule stem = Lookup::filledbox (stem_box);
- stem.translate_axis (y_correction, Y_AXIS);
- molecule.add_molecule(stem);
- }
-
- // Compensate optical illusion regarding vertical position of left
- // and right endings due to curved shape.
- Real ypos_correction = -0.1*space * sign(interval);
- Real interval_correction = 0.2*space * sign(interval);
- Real corrected_interval = interval*space + interval_correction;
-
- // middle curve of vaticana style porrectus
- Bezier curve;
- curve.control_[0] = Offset (0.00 * width, 0.0);
- curve.control_[1] = Offset (0.33 * width, corrected_interval / 2.0);
- curve.control_[2] = Offset (0.66 * width, corrected_interval / 2.0);
- curve.control_[3] = Offset (1.00 * width, corrected_interval / 2.0);
-
- Bezier top_curve = curve, bottom_curve = curve;
- for (int i = 0; i < 4; i++)
- {
- Real thickness = 0.33 * ((3 - i)*left_height + i*right_height);
- top_curve.control_[i] += Offset (0, +0.5*thickness);
- bottom_curve.control_[i] += Offset (0, -0.5*thickness);
- }
-
- if (solid)
- {
- Molecule solid_head =
- Lookup::bezier_sandwich (top_curve, bottom_curve);
- molecule.add_molecule (solid_head);
- }
- else // outline
- {
- Bezier inner_top_curve = top_curve;
- inner_top_curve.translate (Offset (0.0, -thickness));
- Molecule top_edge =
- Lookup::bezier_sandwich (top_curve, inner_top_curve);
- molecule.add_molecule(top_edge);
-
- Bezier inner_bottom_curve = bottom_curve;
- inner_bottom_curve.translate (Offset (0.0, +thickness));
- Molecule bottom_edge =
- Lookup::bezier_sandwich (bottom_curve, inner_bottom_curve);
- molecule.add_molecule(bottom_edge);
-
- // TODO: Use horizontal slope with proper slope value rather
- // than filled box for left edge, since the filled box stands
- // out from the porrectus shape if the interval is big and the
- // line thickness small. The difficulty here is to compute a
- // proper slope value, as it should roughly be equal with the
- // slope of the left end of the bezier curve.
- Box left_edge_box (Interval (0, thickness),
- Interval (-0.5*left_height, +0.5*left_height));
- Molecule left_edge = Lookup::filledbox (left_edge_box);
- molecule.add_molecule(left_edge);
-
- Box right_edge_box (Interval (-thickness, 0),
- Interval (-0.5*right_height, +0.5*right_height));
- Molecule right_edge = Lookup::filledbox (right_edge_box);
- right_edge.translate_axis (width, X_AXIS);
- right_edge.translate_axis (corrected_interval / 2.0, Y_AXIS);
- molecule.add_molecule(right_edge);
- }
- molecule.translate_axis (ypos_correction, Y_AXIS);
- return molecule;
-}
-
-Molecule
-Porrectus::brew_mensural_molecule (Item *me,
- Real interval,
- bool solid,
- Real width,
- Real thickness,
- bool add_stem,
- Direction stem_direction)
-{
- Real space = Staff_symbol_referencer::staff_space (me);
- Real height = 0.6 * space;
- Molecule molecule = Molecule ();
-
- if (add_stem)
- {
- bool consider_interval =
- stem_direction * interval > 0.0;
-
- Interval stem_box_x (0, thickness);
- Interval stem_box_y;
-
- if (consider_interval)
- {
- Real y_length = max (interval/2.0*space, 1.2*space);
- stem_box_y = Interval (0, y_length);
- }
- else
- stem_box_y = Interval (0, space);
-
- Real y_correction =
- (stem_direction == UP) ?
- +0.5*height :
- -0.5*height - stem_box_y.length();
-
- Box stem_box (stem_box_x, stem_box_y);
- Molecule stem = Lookup::filledbox (stem_box);
- stem.translate_axis (y_correction, Y_AXIS);
- molecule.add_molecule(stem);
- }
-
- Real slope = (interval / 2.0 * space) / width;
-
- // Compensate optical illusion regarding vertical position of left
- // and right endings due to slope.
- Real ypos_correction = -0.1*space * sign(slope);
- Real slope_correction = 0.2*space * sign(slope);
- Real corrected_slope = slope + slope_correction/width;
-
- if (solid)
- {
- Molecule solid_head =
- Lookup::horizontal_slope (width, corrected_slope, height);
- molecule.add_molecule (solid_head);
- }
- else // outline
- {
- Molecule left_edge =
- Lookup::horizontal_slope (thickness, corrected_slope, height);
- molecule.add_molecule(left_edge);
-
- Molecule right_edge =
- Lookup::horizontal_slope (thickness, corrected_slope, height);
- right_edge.translate_axis (width-thickness, X_AXIS);
- right_edge.translate_axis (corrected_slope * (width-thickness), Y_AXIS);
- molecule.add_molecule(right_edge);
-
- Molecule bottom_edge =
- Lookup::horizontal_slope (width, corrected_slope, thickness);
- bottom_edge.translate_axis (-0.5*height, Y_AXIS);
- molecule.add_molecule (bottom_edge);
-
- Molecule top_edge =
- Lookup::horizontal_slope (width, corrected_slope, thickness);
- top_edge.translate_axis (+0.5*height, Y_AXIS);
- molecule.add_molecule (top_edge);
- }
- molecule.translate_axis (ypos_correction, Y_AXIS);
- return molecule;
-}
-
-
-ADD_INTERFACE (Porrectus,"porrectus-interface",
- "A porrectus ligature, joining two note heads into a single grob.",
- "left-head right-head width add-stem auto-properties solid direction");
Font_interface::get_default_font (primitive)->
find_by_name ("noteheads-" + glyph_name).extent (X_AXIS).length ();
}
- else if (!String::compare (glyph_name, "porrectus") ||
+ else if (!String::compare (glyph_name, "flexa") ||
!String::compare (glyph_name, ""))
{
/*
- * This head represents either half of a porrectus shape.
+ * This head represents either half of a flexa shape.
* Hence, it is assigned half the width of this shape.
*/
head_width = 0.5 * flexa_width;
/*
* If the head is the 2nd head of a pes or flexa (but not a
- * porrectus), mark this head to be joined with the left-side
+ * flexa shape), mark this head to be joined with the left-side
* neighbour head (i.e. the previous head) by a vertical beam.
*/
if ((context_info & PES_UPPER) ||
*/
distance -= join_thickness;
}
- else
+ else if (!String::compare (glyph_name, ""))
+ {
+ /*
+ * 2nd (virtual) head of flexa shape: join tightly with 1st
+ * head, i.e. do *not* add additional space, such that next
+ * head will not be off from the flexa shape.
+ */
+ }
+ else if (context_info & AFTER_VIRGA)
{
/*
- * Make a small space between adjacent notes of a ligature
- * that are not directly joined.
+ * Make a small space after a virga.
*/
distance += 2 * join_thickness;
}
else if ((prefix_set & PES_OR_FLEXA) &&
(context_info & PES_LOWER) &&
(context_info & FLEXA_RIGHT))
- glyph_name = ""; // second head of porrectus
+ glyph_name = ""; // second head of flexa shape
else if (context_info & PES_UPPER)
if (pitch - prev_pitch > 1)
glyph_name = "vaticana_upes";
*/
if (prefix_set & PES_OR_FLEXA)
if ((context_info & PES_LOWER) &&
- (context_info & FLEXA_RIGHT)) // porrectus
+ (context_info & FLEXA_RIGHT)) // flexa shape
{
- prev_glyph_name = "porrectus";
- prev_primitive->set_grob_property ("porrectus-height",
+ prev_glyph_name = "flexa";
+ prev_primitive->set_grob_property ("flexa-height",
gh_int2scm (pitch - prev_pitch));
- prev_primitive->set_grob_property ("porrectus-width",
+ prev_primitive->set_grob_property ("flexa-width",
gh_double2scm (flexa_width));
bool add_stem =
!(prev_context_info & PES_UPPER) &&
}
/*
- * In the backend, porrectus and joins need to know about
+ * In the backend, flexa shapes and joins need to know about
* thickness. Hence, for simplicity, let's distribute the
* ligature grob's value for thickness to each ligature head (even
* if not all of them need to know).
Real interval_correction = 0.2*space * sign(interval);
Real corrected_interval = interval*space + interval_correction;
- // middle curve of flexa
+ // middle curve of flexa shape
Bezier curve;
curve.control_[0] = Offset (0.00 * width, 0.0);
curve.control_[1] = Offset (0.33 * width, corrected_interval / 2.0);
String glyph_name = ly_scm2string (glyph_name_scm);
if (!String::compare (glyph_name, ""))
{
- // empty head (typically, this is the right side of porrectus
- // shape, which is already typeset by the associated left side
- // head); nothing left to do
+ // empty head (typically, this is the right side of flexa shape,
+ // which is already typeset by the associated left side head);
+ // nothing left to do
return Molecule ();
}
Molecule out;
- int porrectus_height = 0;
+ int flexa_height = 0;
Real thickness = 0.0;
- Real porrectus_width = 0.0;
Real staff_space = Staff_symbol_referencer::staff_space (me);
SCM thickness_scm = me->get_grob_property ("thickness");
me));
}
- if (!String::compare (glyph_name, "porrectus"))
+ if (!String::compare (glyph_name, "flexa"))
{
- SCM porrectus_height_scm = me->get_grob_property ("porrectus-height");
- if (porrectus_height_scm != SCM_EOL)
+ SCM flexa_height_scm = me->get_grob_property ("flexa-height");
+ if (flexa_height_scm != SCM_EOL)
{
- porrectus_height = gh_scm2int (porrectus_height_scm);
+ flexa_height = gh_scm2int (flexa_height_scm);
}
else
{
me->warning ("Vaticana_ligature: "
- "porrectus-height undefined; assuming 0");
+ "flexa-height undefined; assuming 0");
}
- SCM porrectus_width_scm = me->get_grob_property ("porrectus-width");
- if (porrectus_width_scm != SCM_EOL)
+ Real flexa_width;
+ SCM flexa_width_scm = me->get_grob_property ("flexa-width");
+ if (flexa_width_scm != SCM_EOL)
{
- porrectus_width = gh_scm2double (porrectus_width_scm);
+ flexa_width = gh_scm2double (flexa_width_scm);
}
else
{
me->warning ("Vaticana_ligature:"
- "porrectus-width undefined; assuming 2.0");
- porrectus_width = 2.0 * staff_space;
+ "flexa-width undefined; assuming 2.0");
+ flexa_width = 2.0 * staff_space;
}
bool add_stem = to_boolean (me->get_grob_property ("add-stem"));
- out = vaticana_brew_flexa (me, porrectus_height, true,
- porrectus_width, thickness, add_stem, DOWN);
+ out = vaticana_brew_flexa (me, flexa_height, true,
+ flexa_width, thickness, add_stem, DOWN);
}
else
{
int pos = (int)rint (Staff_symbol_referencer::get_position (me));
vaticana_add_ledger_lines(me, &out, pos, 0, ledger_take_space);
- if (!String::compare (glyph_name, "porrectus"))
+ if (!String::compare (glyph_name, "flexa"))
{
- pos += porrectus_height;
- vaticana_add_ledger_lines(me, &out, pos, 0.5*porrectus_height, ledger_take_space);
+ pos += flexa_height;
+ vaticana_add_ledger_lines(me, &out, pos, 0.5*flexa_height, ledger_take_space);
}
return out;
ADD_INTERFACE (Vaticana_ligature, "vaticana-ligature-interface",
"A vaticana style gregorian ligature",
- "glyph-name porrectus-height porrectus-width thickness join-left "
+ "glyph-name flexa-height flexa-width thickness join-left "
"add-stem x-offset ligature-primitive-callback");
\consists "Slur_engraver"
\consists "Tie_engraver"
\consists "New_tie_engraver"
- \consists "Porrectus_engraver"
\consists "Tuplet_engraver"
\consists "A2_engraver"
(breakable . #t)
(space-alist . (
(ambitus . (extra-space . 2.0))
+ (custos . (minimum-space . 1.0))
(key-signature . (minimum-space . 1.5))
(staff-bar . (minimum-space . 1.5))
(clef . (minimum-space . 2.0))
(meta . ((interfaces . (mensural-ligature-interface font-interface))))
))
- (Porrectus
- . (
- (style . mensural)
- (auto-properties . #f)
- (solid . #f)
- (width . 2.4)
- (thickness . 1.0)
- (add-stem . #t)
- (direction . 1)
- (molecule-callback . ,Porrectus::brew_molecule)
- (meta . ((interfaces . (porrectus-interface))))
- ))
-
(RehearsalMark
. (
(molecule-callback . ,Text_item::brew_molecule)
(grob-property-description 'accidental-grobs list? "Alis with (NOTENAME . GROBLIST) entries")
(grob-property-description 'accidentals list? "List of alteration numbers.")
-(grob-property-description 'add-stem boolean? "Add stem to porrectus?.")
+(grob-property-description 'add-stem boolean? "does this flexa shape require an additional stem on the left side?.")
(grob-property-description 'adjust-if-on-staffline boolean? "If this grob is on a staff line, adjust its appearance, so that it better fits into the staff. E.g., if set true on stem grobs, flares of mensural flags will always be aligned with the staff lines, regardless if the associated note head is printed on a staff line or inbetween.")
(grob-property-description 'after-line-breaking-callback procedure? "Procedure taking a grob as argument.
This procedure is called (using dependency resolution) after line breaking. Return value is ignored.")
attachments to prevent ugly slurs. [fixme: we need more documentation here].
.")
(grob-property-description 'auctum boolean? "is this neume augmented?.")
-(grob-property-description 'auto-properties boolean? "if true, as many properties of this grob as possible will be determined automatically from the musical context.")
(grob-property-description 'auto-knee-gap ly:dimension? "If a gap is found between noteheads
where a horizontal beam fits that is larger than this number, make a kneed beam.")
(grob-property-description 'axes list? "list of axis numbers.
Additionally, @code{no-flag} switches off the flag.")
(grob-property-description 'stroke-style string? "set to \"grace\" to turn stroke through flag on.")
(grob-property-description 'flag-width-function procedure? "Procedure that computes the width of a half-beam (a non-connecting beam.).")
-(grob-property-description 'flexa-width ly:dimension? "width of a flexa shape in a ligature grob.")
+(grob-property-description 'flexa-height ly:dimension? "height of a flexa shape in a ligature grob in staff_space.")
+(grob-property-description 'flexa-width ly:dimension? "width of a flexa shape in a ligature grob in staff_space.")
(grob-property-description 'font-family symbol? "partial font
definition: music roman braces dynamic math ...")
(grob-property-description 'font-name string? "file name for the font to load.
(grob-property-description 'left-position number? "position of left part of spanner.")
(grob-property-description 'right-position number? "position of right part of spanner.")
(grob-property-description 'left-padding ly:dimension? "space left of accs.")
-(grob-property-description 'right-head ly:grob? "")
-(grob-property-description 'left-head ly:grob? "")
(grob-property-description 'left-widen boolean? "Whether the left edge of a piano pedal bracket should be widened by the first element of edge-widen.")
(grob-property-description 'pitches list? "list of musical-pitch.")
(grob-property-description 'quilisma boolean? "is this neume a quilisma?.")
(grob-property-description 'positions pair? "cons of staff positions (LEFT . RIGHT")
-(grob-property-description 'porrectus-height ly:dimension? "in staffspace.")
-(grob-property-description 'porrectus-width ly:dimension? "in staffspace.")
(grob-property-description 'prefix-set number? "DOCME")
(grob-property-description 'raise ly:dimension? "height for text to be raised (a negative value lowers the text.")
(grob-property-description 'side-support-elements grob-list? "the support, a list of grobs.")
(grob-property-description 'slope number? "some kind of slope")
(grob-property-description 'slope-limit number? "set slope to zero if slope is running away steeper than this.")
-(grob-property-description 'solid boolean? "should porrectus be solidly filled?.")
(grob-property-description 'space-alist list? "Alist of break align
spacing tuples: format = (SYMBOL . (TYPE . DISTANCE)), where TYPE can be
)
)
- (PorrectusEvent
+ (PesOrFlexaEvent
. (
- (description . "(docme)")
+ (description . "Within a ligature, mark the previous and the
+following note to form a pes (if melody goes up) or a flexa (if melody
+goes down).")
(internal-class-name . "Event")
- (types . (general-music porrectus-event event))
+ (types . (general-music pes-or-flexa-event event))
))
(RepeatedMusic