]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.5.3
authorfred <fred>
Wed, 27 Mar 2002 01:20:40 +0000 (01:20 +0000)
committerfred <fred>
Wed, 27 Mar 2002 01:20:40 +0000 (01:20 +0000)
14 files changed:
input/test/spacing-regular.ly [new file with mode: 0644]
lily/auto-beam-engraver.cc
lily/beam-engraver.cc
lily/include/spacing-spanner.hh
lily/include/spring.hh
lily/key-item.cc
lily/local-key-item.cc
lily/regular-spacing-engraver.cc [new file with mode: 0644]
lily/spacing-spanner.cc
lily/spring.cc
mf/feta-klef.mf
mf/feta-toevallig.mf
scm/basic-properties.scm
scm/clef.scm

diff --git a/input/test/spacing-regular.ly b/input/test/spacing-regular.ly
new file mode 100644 (file)
index 0000000..903ced2
--- /dev/null
@@ -0,0 +1,21 @@
+\header
+{
+ texidoc = "regularSpacingDelta is an experimental feature that
+ tries to generate regular spacing for regular notes."
+}
+
+\score { \notes \relative c'' {
+< \context Staff {
+
+c4 c4 c4 }
+\context Staff =SB  { c8 c8   c4 c4 }
+>}
+\paper{
+linewidth = -1.
+\translator { \ScoreContext
+\consists "Regular_spacing_engraver"
+
+regularSpacingDelta = #(make-moment 1 4 )
+}
+}
+}
index 58f289b822f0dcb231a1d5cd396acd5f764f9bff..94671aabf05b43b3a9dbc2aa418c16d6e2799704 100644 (file)
@@ -58,7 +58,6 @@ private:
 
   int count_i_;
   Moment last_add_mom_;
-
   /*
     Projected ending of the  beam we're working on.
    */
@@ -251,6 +250,8 @@ Auto_beam_engraver::begin_beam ()
   grouping_p_ = new Beaming_info_list;
   beam_start_moment_ = now_mom ();
   beam_start_location_ = *unsmob_moment (get_property ("measurePosition"));
+
+
 }
 
 
@@ -394,6 +395,14 @@ Auto_beam_engraver::acknowledge_grob (Grob_info info)
          return;
        }
 
+
+      /*
+       ignore grace notes.
+       */
+      if (bool (beam_start_location_.grace_mom_) != bool (now_mom ().grace_mom_))
+       return ;
+       
+      
       Moment dur = unsmob_duration (rhythmic_req->get_mus_property ("duration"))->length_mom ();
       /* FIXME:
 
index 4445b79643e4192f3dd68bc5a82cec6ef988014e..7b506953c8eb1904381b761bbffae8119f0462a5 100644 (file)
@@ -166,8 +166,8 @@ Beam_engraver::create_grobs ()
 
       beam_start_location_ = mp;
       beam_start_mom_ = now_mom ();
-      beam_info_p_ = new Beaming_info_list;
       
+      beam_info_p_ = new Beaming_info_list;
       
       /* urg, must copy to Auto_beam_engraver too */
  
@@ -240,6 +240,11 @@ Beam_engraver::acknowledge_grob (Grob_info info)
        }
       else if (Stem::has_interface (info.elem_l_))
        {
+         Moment now = now_mom();
+
+         if(bool (now.grace_mom_ ) != bool (beam_start_mom_.grace_mom_))
+           return ;
+         
          Item *stem_l = dynamic_cast<Item*> (info.elem_l_);
          if (Stem::beam_l (stem_l))
            return;
@@ -270,7 +275,7 @@ Beam_engraver::acknowledge_grob (Grob_info info)
 
          stem_l->set_grob_property ("duration-log",
                                    gh_int2scm (durlog));
-         Moment stem_location = now_mom () - beam_start_mom_ + beam_start_location_;
+         Moment stem_location = now - beam_start_mom_ + beam_start_location_;
          beam_info_p_->add_stem (stem_location,
  (durlog- 2) >? 1);
          Beam::add_stem (beam_p_, stem_l);
index 019765c883388790b185e7d1057680bb58ff6866..b045401a028d3fac6a21de30d72aefe824a8bbb0 100644 (file)
 #define SPACING_SPANNER_HH
 
 #include "spanner.hh"
+#include "spring.hh"
 
 class Spacing_spanner
 {
 public:
   static void set_interface (Grob*);
-  static void do_measure (Grob*,Link_array<Grob>) ;
-
+  static void do_measure (Grob*,Link_array<Grob> const &) ;
+  static void stretch_to_regularity (Grob*, Array<Spring> *, Link_array<Grob> const &);
   DECLARE_SCHEME_CALLBACK (set_springs, (SCM ));
   static Real stem_dir_correction (Grob*,Grob*,Grob*)  ;
   static Real default_bar_spacing (Grob*,Grob*,Grob*,Moment)  ;
index 9585c874dda65941ab2e1a044e2857778ba17cf9..236841bcb0f7ca081149aeb3c54b5c0f606e32ba 100644 (file)
@@ -34,6 +34,7 @@ struct Spring{
   */
   Real strength_f_;
   void add_to_cols ();
+  void set_to_cols ();
   Spring ();
 };
 
index c87f51ed7f226298f7528d8af356faff8aead0ce..b66cd6b490ce5fbe56b2a0925d36ac3ad2b15c0d 100644 (file)
@@ -82,6 +82,17 @@ Key_item::brew_molecule (SCM smob)
 
   Real inter = Staff_symbol_referencer::staff_space (me)/2.0;
   
+  SCM scm_style = me->get_grob_property ("style");
+  String style;
+  if (gh_symbol_p (scm_style))
+    {
+      style = ly_scm2string (scm_symbol_to_string (scm_style));
+    }
+  else
+    {
+      style = "";
+    }
+
   SCM newas = me->get_grob_property ("new-accidentals");  
   Molecule mol;
   /*
@@ -89,13 +100,15 @@ Key_item::brew_molecule (SCM smob)
     the cancellation signature.
   */
   int c0p = gh_scm2int (me->get_grob_property ("c0-position"));
+
   for (SCM s = newas; gh_pair_p (s); s = gh_cdr (s))
     {
       SCM what = gh_caar (s);
       int alter = gh_scm2int (gh_cdar (s));
       int pos = alteration_pos (what, alter, c0p);
       
-      Molecule m = Font_interface::get_default_font (me)->find_by_name ("accidentals-" + to_str (alter));
+      Molecule m = Font_interface::get_default_font (me)->
+         find_by_name (String ("accidentals-") + style + to_str (alter));
       m.translate_axis (pos * inter, Y_AXIS);
       mol.add_at_edge (X_AXIS, LEFT, m, 0);
     }
@@ -117,7 +130,8 @@ Key_item::brew_molecule (SCM smob)
 
       Molecule natural;
       if (gh_pair_p (old))
-       natural=Font_interface::get_default_font (me)->find_by_name ("accidentals-0");
+       natural=Font_interface::get_default_font (me)->
+           find_by_name (String ("accidentals-") + style + String ("0"));
       
       for (; gh_pair_p (old); old = gh_cdr (old))
         {
index bc49391582238c96b5d4a01379266d0672bdbf04..fe7d9de2abb404ee0b6b0a25db8dad714d987855 100644 (file)
@@ -126,6 +126,20 @@ Local_key_item::brew_molecule (SCM smob)
   bool oct_b = false;
   int lastoct = -100;
 
+  SCM scm_style = me->get_grob_property ("style");
+  String style;
+  if (gh_symbol_p (scm_style))
+    {
+      style = ly_scm2string (scm_symbol_to_string (scm_style));
+    }
+  else
+    {
+      /*
+       preferably no name for the default style.
+       */
+      style = "";
+    }
+
   SCM accs = me->get_grob_property ("accidentals");
   for (SCM s = accs;
        gh_pair_p (s); s = gh_cdr (s))
@@ -154,13 +168,16 @@ Local_key_item::brew_molecule (SCM smob)
       SCM c0 =  me->get_grob_property ("c0-position");
       Real dy = (gh_number_p (c0) ? gh_scm2int (c0) : 0 + p.notename_i_)
        * note_distance;
-      
-      Molecule acc (Font_interface::get_default_font (me)->find_by_name (String ("accidentals-")
-                                              + to_str (p.alteration_i_)));
+
+      Molecule acc (Font_interface::get_default_font (me)->
+                   find_by_name (String ("accidentals-") +
+                                 style +
+                                 to_str (p.alteration_i_)));
       
       if (scm_memq (ly_symbol2scm ("natural"), opts) != SCM_BOOL_F)
        {
-         Molecule prefix = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-0"));
+         Molecule prefix = Font_interface::get_default_font (me)->
+             find_by_name (String ("accidentals-") + style + String ("0"));
          acc.add_at_edge (X_AXIS, LEFT, Molecule (prefix), 0);
        }
 
diff --git a/lily/regular-spacing-engraver.cc b/lily/regular-spacing-engraver.cc
new file mode 100644 (file)
index 0000000..e6cb130
--- /dev/null
@@ -0,0 +1,60 @@
+/*   
+  regular-spacing-engraver.cc --  implement Regular_spacing_engraver
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "engraver.hh"
+#include "grob.hh"
+
+class Regular_spacing_engraver : public Engraver
+{
+public:
+  Regular_spacing_engraver ();
+  VIRTUAL_COPY_CONS(Translator);
+
+  Moment last_moment_;
+  SCM last_col_;
+protected:
+  virtual void process_music ();
+};
+
+Regular_spacing_engraver::Regular_spacing_engraver ()
+{
+  last_col_ = SCM_EOL;
+}
+
+void
+Regular_spacing_engraver::process_music ()
+{
+  SCM delta = get_property ("regularSpacingDelta");
+
+  if (unsmob_moment (delta))
+    {
+      SCM mp = get_property ("measurePosition");
+      if (!unsmob_moment (mp))
+       return;
+
+      Rational d = unsmob_moment (delta)->main_part_;
+      Rational p = unsmob_moment (mp)->main_part_;
+
+      if (p.mod_rat (d) != Rational (0))
+       return;
+
+      Moment now = now_mom ();
+      SCM col = get_property ("currentMusicalColumn");
+      if (p
+         && (now -last_moment_ ).main_part_ == d)
+       {
+         unsmob_grob (col)->set_grob_property ("regular-distance-to", last_col_);
+       }
+      last_col_ = col;
+      last_moment_ = now;
+    }
+}
+
+
+ADD_THIS_TRANSLATOR(Regular_spacing_engraver);
index 1bff342744f9b8205f725f61857074a99d161fe9..497f4c934b65318635b9e4ae9f7fd4e3ca23d753 100644 (file)
@@ -104,7 +104,7 @@ find_runs (Grob*me, Link_array<Grob> cols)
   
  */
 void
-Spacing_spanner::do_measure (Grob*me, Link_array<Grob> cols) 
+Spacing_spanner::do_measure (Grob*me, Link_array<Grob> const & cols) 
 {
   Moment shortest;
   Moment mean_shortest;
@@ -140,6 +140,7 @@ Spacing_spanner::do_measure (Grob*me, Link_array<Grob> cols)
     }
   mean_shortest /= n;
 
+  Array<Spring> springs;
   for (int i= 0; i < cols.size () - 1; i++)
     {
       Item * l = dynamic_cast<Item*> (cols[i]);
@@ -265,10 +266,134 @@ Spacing_spanner::do_measure (Grob*me, Link_array<Grob> cols)
          else
            s.strength_f_ /= stretch_dist;
          
-         s.add_to_cols ();
+         springs.push (s);
        }
     }
+
+  Spacing_spanner::stretch_to_regularity (me, &springs, cols);
+  for (int i=springs.size (); i --;)
+    springs[i].add_to_cols ();
+}
+
+/*
+  Look at COLS, searching for columns that have 'regular-distance-to
+  set. A sequence of columns that have this property set should have
+  an equal distance (an equispaced run). Extract the projected
+  distance from SPRINGS, and scale SPRINGS for the equispaced run, to the
+  widest space necessary.
+
+
+  TODO:
+  
+  -- inefficient code; maybe it is easier to twiddle with the springs
+  after they've become grob properties (ie. have their
+  minimum-distances set)
+
+  -- does not adjust strength field of the springs very well: result
+  awkward spacing at the start of a line. (?)
+
+  -- will be confused when there are multiple equispaced runs in a measure.
+
+  -- dealing with springs for line breaks is a little tricky; in any
+  case, we will only space per measure.
+
+  -- we scale to actual distances, not to optical effects. Eg. if the
+  equispaced run contains optical corrections, then the scaling will
+  cancel those.
+
+  -- Regular_spacing_engraver doesn't mark the first column of the
+  next bar, making the space before a barline too short, in this case
+
+
+       x<- 16ths--> x(8th)
+       x(8th)       x(8th)      <- equispaced run.      
+  
+*/
+
+void
+Spacing_spanner::stretch_to_regularity (Grob *me,
+                                       Array<Spring> * springs,
+                                       Link_array<Grob> const & cols)
+{
+  /*
+    Find the starting column of the run. REGULAR-DISTANCE-TO points
+    back to a previous column, so we look ahead to find a column
+    pointing back to the first one.
+    
+   */
+  Grob    * first_regular_spaced_col = 0;
+  for (int i = 0 ;  i <  cols.size () && !first_regular_spaced_col; i++)
+    {
+      SCM rdt = cols[i]->get_grob_property ("regular-distance-to");
+      if (cols.find_l (unsmob_grob (rdt)))
+       first_regular_spaced_col = unsmob_grob (rdt);
+    }
+  for (int i = springs->size ();  i-- ;)
+    springs->elem (i).set_to_cols ();
+  
+  int i;
+  for (i = 0; i < springs->size ()
+        && springs->elem (i).item_l_drul_[RIGHT] != first_regular_spaced_col;
+       i++)
+    ;
+
+
+  if (i==springs->size ())
+    return ;
+    
+  Real maxdist = 0.0;
+  Real dist  =0.0;
+  Grob *last_col = first_regular_spaced_col;
+  Grob *last_regular_spaced_col = first_regular_spaced_col;
   
+
+  /*
+    find the max distance for this run. 
+   */
+  for (int j = i;  j < springs->size (); j++)
+    {
+      Spring *s = &(springs->elem_ref (j));
+      if (s->item_l_drul_[LEFT] != last_col)
+       continue;
+      
+      dist += s->distance_f_;
+
+      last_col = s->item_l_drul_[RIGHT];
+      SCM rdt = last_col->get_grob_property ("regular-distance-to");
+      if (unsmob_grob (rdt) == last_regular_spaced_col)
+       {
+         maxdist = maxdist >? dist;
+         dist = 0.0;
+         last_regular_spaced_col = last_col;
+       }
+
+    }
+
+  /*
+    Scale the springs
+   */
+  dist =0.0;
+  last_col =  first_regular_spaced_col;
+  last_regular_spaced_col = first_regular_spaced_col;
+  for (int j = i;   j < springs->size (); j++)
+    {
+      Spring *s = &springs->elem_ref (j);
+      if (s->item_l_drul_[LEFT] != last_col)
+       continue;
+      dist += s->distance_f_;
+
+      last_col = s->item_l_drul_[RIGHT];
+      SCM rdt = last_col->get_grob_property ("regular-distance-to");
+      if (unsmob_grob (rdt) == last_regular_spaced_col)
+       {
+         do {
+           springs->elem_ref (i).distance_f_ *= maxdist / dist;
+           springs->elem_ref (i).strength_f_ *= dist / maxdist;            
+         } while (i++ < j);
+         last_regular_spaced_col = last_col;
+         dist =0.0;
+       }
+    }
 }
 
 /**
index 93ef33f59ef0327cfe0a2e687d80b6bd12c6b992..e63fee0891b0d1fab26bc63031b9015dd89b1721 100644 (file)
@@ -20,6 +20,11 @@ Spring::Spring ()
   strength_f_ =1.0;
 }
 
+/*
+
+ ugh : if we go from items to cols, we should adjust distance and strength.
+ */
+
 void
 Spring::add_to_cols ()
 {
@@ -28,6 +33,17 @@ Spring::add_to_cols ()
                                 distance_f_, strength_f_);
 }
 
+void
+Spring::set_to_cols( )
+{
+  Direction d = LEFT;
+  do
+    {
+      item_l_drul_[d] = item_l_drul_[d]->column_l ();
+    }
+  while (flip (&d) != LEFT);
+
+}
 
 Column_spring::Column_spring ()
 {
index 8e46d414278a2c354f3f8c024a2663ccd188b60c..6ad17211d68d77a884645ba3ab4329f65241bbde 100644 (file)
@@ -583,7 +583,7 @@ def draw_brevis(expr exact_center, reduction, small_width, small_height) =
 enddef;
 
 
-def draw_mensural_i_c_clef(expr exact_center, reduction) = 
+def draw_neo_mensural_c_clef(expr exact_center, reduction) = 
        draw_brevis(exact_center, reduction, false, false);
 
        save reduced_il, reduced_slt;
@@ -618,18 +618,20 @@ def draw_mensural_i_c_clef(expr exact_center, reduction) =
 enddef;
 
 
-fet_beginchar("mensural c clef", "mensural1_c", "mens1cclef")
+fet_beginchar("neo-mensural c clef", "neo_mensural_c", "neomenscclef")
        if test = 1:
                draw_staff(-1,3, 0.0);
        fi;
-       draw_mensural_i_c_clef((0,0), 1.0);
+       draw_neo_mensural_c_clef((0,0), 1.0);
 fet_endchar;
-fet_beginchar("mensural c clef", "mensural1_c_change", "cmens1cclef")
-       draw_mensural_i_c_clef((1.3 staff_space#,0), .8);
+fet_beginchar("neo-mensural c clef", "neo_mensural_c_change", "cneomenscclef")
+       draw_neo_mensural_c_clef((1.3 staff_space#,0), .8);
 fet_endchar;
 
 
-def draw_mensural_ii_c_clef(expr exact_center, reduction) = 
+def draw_petrucci_c_clef(expr exact_center, reduction) = 
+       % inspired by Josquin Desprez, "Stabat Mater", Libro tertio,
+       % 1519, printed by Petrucci, in: MGG, volume 7, Table 11.
        draw_brevis(exact_center, reduction, true, true);
 
        save reduced_il, reduced_slt;
@@ -645,39 +647,47 @@ def draw_mensural_ii_c_clef(expr exact_center, reduction) =
        define_pixels(stem_width);
        define_pixels(interline);
 
+       addto currentpicture also currentpicture
+               yscaled -1 shifted (0, 2*(ypart exact_center) - interline);
+
        penpos6(stem_width, 0);
        penpos7(stem_width, 0);
-       z6l = exact_center + (0, -interline/2);
-       z7l = z6l + (0, -1.5reduced_il);
+       z6l = exact_center + (0, 0);
+       z7l = z6l + (0, -2.2reduced_il);
        fill z6l -- z7l -- z7r -- z6r -- cycle;
 
-       addto currentpicture also currentpicture
-               yscaled -1 shifted (0, 2*(ypart exact_center) - interline);
-       addto currentpicture also currentpicture
-               yscaled -1 shifted (0, 4*(ypart exact_center));
        addto currentpicture also currentpicture 
                xscaled -1 shifted (2x4l,0);
 
+       penpos8(stem_width, 0);
+       penpos9(stem_width, 0);
+       z8l = exact_center + (0, 0);
+       z9l = z8l + (0, -3.2reduced_il);
+       fill z8l -- z9l -- z9r -- z8r -- cycle;
+
+       addto currentpicture also currentpicture
+               yscaled -1 shifted (0, 4*(ypart exact_center));
+
        set_char_box(0, 2head_width#,
                     noteheight#*4*reduction, noteheight#*4*reduction);
 enddef;
 
 
-fet_beginchar("mensural c clef", "mensural2_c", "mens2cclef")
+fet_beginchar("petrucci c clef", "petrucci_c", "petruccicclef")
        if test = 1:
                draw_staff(-1,3, 0.0);
        fi;
-       draw_mensural_ii_c_clef((0,0), 1.0);
+       draw_petrucci_c_clef((0,0), 1.0);
 fet_endchar;
-fet_beginchar("mensural c clef", "mensural2_c_change", "cmens2cclef")
-       draw_mensural_ii_c_clef((1.3 staff_space#,0), .8);
+fet_beginchar("petrucci c clef", "petrucci_c_change", "cpetruccicclef")
+       draw_petrucci_c_clef((1.3 staff_space#,0), .8);
 fet_endchar;
 
 
-def draw_mensural_iii_c_clef(expr exact_center, reduction) =
+def draw_mensural_c_clef(expr exact_center, reduction) =
        % inspired by Ockeghem, "Missa Prolationum", in: MGG, volume
        % 9, table 94.
-       draw_mensural_ii_c_clef(exact_center, reduction);
+       draw_petrucci_c_clef(exact_center, reduction);
 
        addto currentpicture also currentpicture
                shifted (0, -interline);
@@ -687,14 +697,14 @@ def draw_mensural_iii_c_clef(expr exact_center, reduction) =
 enddef;
 
 
-fet_beginchar("mensural c clef", "mensural3_c", "mens3cclef")
+fet_beginchar("mensural c clef", "mensural_c", "menscclef")
        if test = 1:
                draw_staff(-1,3, 0.0);
        fi;
-       draw_mensural_iii_c_clef((0,0), 1.0);
+       draw_mensural_c_clef((0,0), 1.0);
 fet_endchar;
-fet_beginchar("mensural c clef", "mensural3_c_change", "cmens3cclef")
-       draw_mensural_iii_c_clef((0,0), .8);
+fet_beginchar("mensural c clef", "mensural_c_change", "cmenscclef")
+       draw_mensural_c_clef((0,0), .8);
 fet_endchar;
 
 def draw_diamond(expr exact_center, reduction) =
@@ -728,12 +738,13 @@ def draw_diamond(expr exact_center, reduction) =
                cycle;
 enddef;
 
-def draw_mensural_i_f_clef(expr exact_center, reduction) =
-       %
+def draw_petrucci_f_clef(expr exact_center, reduction) =
+       % inspired by L'homme arme super voces musicales in Misse
+       % Josquin, 1502, Petrucci, in: MGG, volume 7, col. 200; also
        % inspired by Gaspar van Weerbeke, "Virgo Maria" (1502), in:
-       % MGG, volume 9, col. 653 ("Motette"), fig. 3.; also by
-       % Andr'e Campra, "Entr'ee des s'er'enades" (1710), in: MGG,
-       % volume 2, col. 1649 ("Contredanse"), fig. 2.
+       % MGG, volume 9, col. 653 ("Motette"), fig. 3.; also by Andr'e
+       % Campra, "Entr'ee des s'er'enades" (1710), in: MGG, volume 2,
+       % col. 1649 ("Contredanse"), fig. 2.
        %
        draw_brevis(exact_center, reduction, true, false);
 
@@ -763,12 +774,13 @@ def draw_mensural_i_f_clef(expr exact_center, reduction) =
 
        draw_diamond(exact_center +
                     (1.6interline*reduction, interline/2), reduction);
-       %% some editions put a stem on top of the upper note head:
-       % penpos8(stem_width, 0);
-       % penpos9(stem_width, 0);
-       % z8l = exact_center + (1.6interline*reduction, interline*reduction);
-       % z9l = z8l + (0, 1.5interline*reduction);
-       % fill z8l -- z9l -- z9r -- z8r -- cycle;
+
+       % upper stem
+       penpos8(stem_width, 0);
+       penpos9(stem_width, 0);
+       z8l = exact_center + (1.6interline*reduction, interline*reduction);
+       z9l = z8l + (0, 1.5interline*reduction);
+       fill z8l -- z9l -- z9r -- z8r -- cycle;
 
        draw_diamond(exact_center +
                     (1.6interline*reduction, -interline/2), reduction);
@@ -783,18 +795,18 @@ def draw_mensural_i_f_clef(expr exact_center, reduction) =
 enddef;
 
 
-fet_beginchar("mensural f clef", "mensural1_f", "mens1fclef")
+fet_beginchar("petrucci f clef", "petrucci_f", "petruccifclef")
        if test = 1:
                draw_staff(-1,3, 0.0);
        fi;
-       draw_mensural_i_f_clef((0,0), 1.0);
+       draw_petrucci_f_clef((0,0), 1.0);
 fet_endchar;
-fet_beginchar("mensural f clef", "mensural1_f_change", "cmens1fclef")
-       draw_mensural_i_f_clef((0,0), .8);
+fet_beginchar("petrucci f clef", "petrucci_f_change", "cpetruccifclef")
+       draw_petrucci_f_clef((0,0), .8);
 fet_endchar;
 
 
-def draw_mensural_ii_f_clef(expr exact_center, reduction) =
+def draw_mensural_f_clef(expr exact_center, reduction) =
        %
        % inspired by Philippe le Duc, "Dite Signori" (1590), in: MGG,
        % volume 3, col. 848 ("Duc"); also by John Dowland, "The First
@@ -830,14 +842,14 @@ def draw_mensural_ii_f_clef(expr exact_center, reduction) =
        set_char_box(0, 3staff_space#, 3staff_space#, 0);
 enddef;
 
-fet_beginchar("mensural f clef", "mensural2_f", "mens2fclef")
+fet_beginchar("mensural f clef", "mensural_f", "mensfclef")
        if test = 1:
                draw_staff(-1,3, 0.0);
        fi;
-       draw_mensural_ii_f_clef((0,0), 1.0);
+       draw_mensural_f_clef((0,0), 1.0);
 fet_endchar;
-fet_beginchar("mensural f clef", "mensural2_f_change", "cmens2fclef")
-       draw_mensural_ii_f_clef((0,0), .8);
+fet_beginchar("mensural f clef", "mensural_f_change", "cmensfclef")
+       draw_mensural_f_clef((0,0), .8);
 fet_endchar;
 
 
@@ -935,6 +947,71 @@ fet_endchar;
 
 
 
+def draw_petrucci_g_clef(expr exact_center, reduction) =
+       % inspired by Josquin Desprez, "Stabat Mater", Libro tertio,
+       % 1519, printed by Petrucci, in: MGG, volume 7, Table 11.
+
+       set_char_box(0.6 staff_space#, 0.8 staff_space#, 0.6 staff_space#, 
+         4.0 staff_space#);
+
+       save reduced_il, reduced_slt;
+
+       reduced_il# = staff_space# * reduction;
+       reduced_slt# = stafflinethickness# * reduction;
+       define_pixels(reduced_il, reduced_slt);
+
+       save za, zb, zc, zd, ze, zf, zg, zh, zi, zj;
+       pair za, zb, zc, zd, ze, zf, zg, zh, zi, zj;
+
+       pickup pencircle
+               xscaled 0.50 reduced_slt
+               yscaled 0.22 reduced_il
+               rotated -35;
+
+       za = exact_center + (+0.00 reduced_il, +0.00 reduced_il);
+       zb = exact_center + (+0.20 reduced_il, +1.20 reduced_il);
+       zc = exact_center + (-0.10 reduced_il, +2.00 reduced_il);
+       zd = exact_center + (-0.50 reduced_il, +3.00 reduced_il);
+       ze = exact_center + (+0.00 reduced_il, +3.70 reduced_il);
+       zf = exact_center + (+0.20 reduced_il, +3.00 reduced_il);
+       zg = exact_center + (-0.20 reduced_il, +2.00 reduced_il);
+       zh = exact_center + (-0.50 reduced_il, +1.70 reduced_il);
+       zi = exact_center + (-0.80 reduced_il, +0.75 reduced_il);
+       zj = exact_center + (-0.60 reduced_il, +0.60 reduced_il);
+
+       draw za{-1,2} .. zb .. zc .. zd .. ze .. zf .. zg .. zh .. zi .. zj;
+
+       save za, zb, zc, zd, ze, zf;
+       pair za, zb, zc, zd, ze, zf;
+
+       pickup pencircle
+               xscaled 0.75 reduced_slt
+               yscaled 0.33 reduced_il
+               rotated -35;
+
+       za = exact_center + (+0.25 reduced_il, +0.45 reduced_il);
+       zb = exact_center + (-0.25 reduced_il, +0.45 reduced_il);
+       zc = exact_center + (-0.25 reduced_il, -0.45 reduced_il);
+       zd = exact_center + (+0.25 reduced_il, -0.45 reduced_il);
+       ze = exact_center + (+0.30 reduced_il, +0.00 reduced_il);
+       zf = exact_center + (+0.00 reduced_il, +0.00 reduced_il);
+
+       draw za .. zb .. zc .. zd .. {up}ze -- zf;
+enddef;
+
+
+fet_beginchar("petrucci g clef", "petrucci_g", "petruccigclef")
+       if test = 1:
+               draw_staff(-1,3, 0.0);
+       fi;
+       draw_petrucci_g_clef((0,0), 1.0);
+fet_endchar;
+fet_beginchar("petrucci g clef", "petrucci_g_change", "cpetruccigclef")
+       draw_petrucci_g_clef((0,0), .8);
+fet_endchar;
+
+
+
 %%%%%%%%
 %
 %
index ad008adc34cbd585da421b1915e40cdb2134051d..21bacb30446566025ec64a5094e1f36c6914f499 100644 (file)
@@ -26,7 +26,7 @@ fet_begingroup("accidentals");
 % a square pen).  [Wanske] does not mention this, so we'll just ignore 
 % this fact
 %
-fet_beginchar("Sharp" , "1", "sharp");
+fet_beginchar("Default Sharp" , "1", "sharp");
        set_char_box(0, 1.1 staff_space#, 1.5 staff_space#, 
                1.5 staff_space#);
 
@@ -82,7 +82,7 @@ fet_beginchar("Sharp" , "1", "sharp");
        labels(1,2,3,4);
        fet_endchar;
 
-fet_beginchar( "Natural", "0", "natural")
+fet_beginchar( "Default Natural", "0", "natural")
        set_char_box(0, 8/12 staff_space#, 1.5 staff_space#, 1.5 staff_space#);
 
        save interbeam, interstem, beamheight, beamwidth, 
@@ -203,13 +203,13 @@ enddef;
 %
 % unfortunately, 600dpi is not enough to show the brush of the stem.
 %
-fet_beginchar("Flat", "-1", "flat")
+fet_beginchar("Default Flat", "-1", "flat")
        set_char_box(1.2 stafflinethickness#, .8 staff_space#, .5 staff_space#, 2 staff_space#);
        draw_meta_flat(0, w, 1/3 staff_space);
        fet_endchar;
 
 
-fet_beginchar("Double flat", "-2", "flatflat")
+fet_beginchar("Default Double Flat", "-2", "flatflat")
        save left_wid, overlap, right_wid;
        left_wid = .7;
        right_wid = .8;
@@ -220,7 +220,7 @@ fet_beginchar("Double flat", "-2", "flatflat")
                right_wid *staff_space, 1/3 staff_space);
        fet_endchar;
 
-fet_beginchar("Double sharp", "2", "sharpsharp")
+fet_beginchar("Default Double Sharp", "2", "sharpsharp")
        set_char_box(0, staff_space#, .5 staff_space#, .5 staff_space#);
        save klaverblad, klaversteel;
 
@@ -270,16 +270,179 @@ def draw_paren =
        .. simple_serif(z1r, z1l, 90) .. z2l{down} -- cycle;
 enddef;
   
-fet_beginchar("Right parenthesis", ")", "rightparen")
+fet_beginchar("Right Parenthesis", ")", "rightparen")
        draw_paren;
 fet_endchar;
 
-fet_beginchar("Left parenthesis", "(", "leftparen")
+fet_beginchar("Left Parenthesis", "(", "leftparen")
        draw_paren;
         currentpicture := currentpicture xscaled -1;
         set_char_box(charwd, charbp, chardp, charht);
 fet_endchar;
 
+%%%%%%%%
+%
+%
+%
+% EDITIO MEDICAEA
+%
+%
+%
+fet_beginchar("Ed. Med. Flat" , "medicaea-1", "medicaeaflat");
+       set_char_box(0, 0.8 staff_space#, 0.6 staff_space#, 
+         2.0 staff_space#);
+
+       pickup pencircle
+               xscaled 0.50 stafflinethickness
+               yscaled 0.22 staff_space;
+
+       save za, zb;
+       pair za, zb;
+
+       za = (0.00 staff_space, +0.90 staff_space);
+       zb = (0.00 staff_space, -0.50 staff_space);
+       draw za -- zb;
+
+       pickup pencircle
+               xscaled 0.50 stafflinethickness
+               yscaled 0.22 staff_space
+               rotated -63;
+
+       save zc, zd, ze;
+       pair zc, zd, ze;
+
+       zc = (0.10 staff_space, -0.50 staff_space);
+       zd = (0.40 staff_space, +0.40 staff_space);
+       ze = (0.10 staff_space, +0.40 staff_space);
+
+       draw zc{(1,2)} .. zd .. ze{(-1,-1)};
+
+       fet_endchar;
+
+%%%%%%%%
+%
+%
+%
+% EDITIO VATICANA
+%
+%
+%
+fet_beginchar("Ed. Vat. Flat" , "vaticana-1", "vaticanaflat");
+        set_char_box(0, 0.8 staff_space#, 0.6 staff_space#, 
+                2.0 staff_space#);
+        define_pixels (stafflinethickness, staff_space);
+
+        save za, zb, zc, zd, ze, zf, zg;
+        pair za, zb, zc, zd, ze, zf, zg;
+        za = (0.00 staff_space, +0.80 staff_space);
+        zb = (0.00 staff_space, -0.03 staff_space);
+        zc = (0.25 staff_space, -0.23 staff_space);
+        zd = (0.50 staff_space, -0.23 staff_space);
+        ze = (0.50 staff_space, +0.00 staff_space);
+        zf = (0.25 staff_space, +0.20 staff_space);
+        zg = (0.15 staff_space, +0.26 staff_space);
+
+        pickup pencircle
+                xscaled 0.50 stafflinethickness
+                yscaled 0.22 staff_space;
+        draw za{down} .. {down}zb .. zc .. zd{up} .. {up}ze .. zf .. zg;
+        fet_endchar;
+
+fet_beginchar("Ed. Vat. Natural" , "vaticana0", "vaticananatural");
+       set_char_box(0, 0.7 staff_space#, 0.6 staff_space#, 
+               2.0 staff_space#);
+       define_pixels (stafflinethickness, staff_space);
+
+       save za, zb, zc, zd;
+       pair za, zb, zc, zd;
+       pickup pencircle
+               xscaled 0.80 stafflinethickness
+               yscaled 0.22 staff_space;
+       za = (0.00 staff_space, +0.65 staff_space);
+       zb = (0.00 staff_space, -0.35 staff_space);
+       zc = (0.00 staff_space, -0.30 staff_space);
+       zd = (0.40 staff_space, -0.08 staff_space);
+       draw za -- zb;
+       draw zc -- zd;
+
+       addto currentpicture also currentpicture
+               xscaled -1
+               yscaled -1
+               shifted (0.40 staff_space, 0.0 staff_space);
+
+       fet_endchar;
+
+%%%%%%%%
+%
+%
+%
+% MENSURAL NOTATION
+%
+%
+%
+fet_beginchar("Mensural Sharp" , "mensural1", "mensuralsharp");
+       set_char_box(0, 0.7 staff_space#, 0.5 staff_space#, 
+               0.5 staff_space#);
+       save stemthick;
+       define_pixels (stemthick, staff_space);
+       stemthick# = stafflinethickness#;
+
+       save za, zb;
+       pair za, zb;
+       pickup pencircle scaled 0.8 stemthick;
+       za = 0.4 * staff_space * (0.8, 1);
+       za = -zb;
+       draw za .. zb;
+
+       addto currentpicture also currentpicture xscaled -1;
+       addto currentpicture also currentpicture shifted (0.20 staff_space, 0);
+
+       fet_endchar;
+
+fet_beginchar("Mensural Flat" , "mensural-1", "mensuralflat");
+       set_char_box(0, 0.7 staff_space#, 0.4 staff_space#, 
+               1.8 staff_space#);
+       save stemthick;
+       define_pixels (stemthick, staff_space);
+       stemthick# = stafflinethickness#;
+
+       save za, zb, zc, zd, ze;
+       pair za, zb, zc, zd, ze;
+       pickup pencircle
+               xscaled 1.4 stemthick
+               yscaled 0.6 stemthick
+               rotated 45;
+
+       za = (0.00 staff_space, +1.80 staff_space);
+       zb = (0.00 staff_space, -0.25 staff_space);
+       zc = (0.35 staff_space, -0.25 staff_space);
+       zd = (0.35 staff_space, +0.25 staff_space);
+       ze = (0.00 staff_space, +0.25 staff_space);
+       draw za -- zb .. zc .. zd .. ze;
+       fet_endchar;
+
+fet_beginchar("Hufnagel Flat" , "hufnagel-1", "hufnagelflat");
+       set_char_box(0, 0.7 staff_space#, 0.4 staff_space#, 
+               1.8 staff_space#);
+       save stemthick;
+       define_pixels (stemthick, staff_space);
+       stemthick# = stafflinethickness#;
+
+       save za, zb, zc, zd, ze, zf;
+       pair za, zb, zc, zd, ze, zf;
+       pickup pencircle
+               xscaled 2.4 stemthick
+               yscaled 0.4 stemthick
+               rotated 45;
+
+       za = (0.00 staff_space, +1.80 staff_space);
+       zb = (0.00 staff_space, -0.15 staff_space);
+       zc = (0.25 staff_space, -0.30 staff_space);
+       zd = (0.50 staff_space, +0.00 staff_space);
+       ze = (0.30 staff_space, +0.30 staff_space);
+       zf = (0.00 staff_space, +0.15 staff_space);
+       draw za -- zb -- zc .. zd .. ze -- zf;
+       fet_endchar;
 
 fet_endgroup("accidentals");
 
index e76878cf5fdf6926904efa7b32e08bcadc4e7a42..7f02a51e5dcdffaf73e07cca64f037f1e9746ba0 100644 (file)
@@ -25,6 +25,7 @@
 (define (default-break-barline glyph dir)
    (let ((result (assoc glyph 
                        '((":|:" . (":|" . "|:"))
+                         ("||:" . ("||" . "|:"))
                          ("|" . ("|" . ""))
                          ("|s" . (nil . "|"))
                          ("|:" . ("|" . "|:"))
index a6f11bd692de919ac1db0597d8756ee0f032e350..e4203218f6f1500b0069bf5f2ab6543a0ce45edb 100644 (file)
          ("hufnagel_fa1" . ("clefs-hufnagel_fa" -1 0))
          ("hufnagel_fa2" . ("clefs-hufnagel_fa" 1 0))
          ("hufnagel_do_fa" . ("clefs-hufnagel_do_fa" 4 0))
-         ("mensural1_c1" . ("clefs-mensural1_c" -4 0))
-         ("mensural1_c2" . ("clefs-mensural1_c" -2 0))
-         ("mensural1_c3" . ("clefs-mensural1_c" 0 0))
-         ("mensural1_c4" . ("clefs-mensural1_c" 2 0))
-         ("mensural2_c1" . ("clefs-mensural2_c" -4 0))
-         ("mensural2_c2" . ("clefs-mensural2_c" -2 0))
-         ("mensural2_c3" . ("clefs-mensural2_c" 0 0))
-         ("mensural2_c4" . ("clefs-mensural2_c" 2 0))
-         ("mensural2_c5" . ("clefs-mensural2_c" 4 0))
-         ("mensural3_c1" . ("clefs-mensural3_c" -2 0))
-         ("mensural3_c2" . ("clefs-mensural3_c" 0 0))
-         ("mensural3_c3" . ("clefs-mensural3_c" 2 0))
-         ("mensural3_c4" . ("clefs-mensural3_c" 4 0))
-         ("mensural1_f" . ("clefs-mensural1_f" 2 0))
-         ("mensural2_f" . ("clefs-mensural2_f" 2 0))
+         ("mensural_c1" . ("clefs-mensural_c" -2 0))
+         ("mensural_c2" . ("clefs-mensural_c" 0 0))
+         ("mensural_c3" . ("clefs-mensural_c" 2 0))
+         ("mensural_c4" . ("clefs-mensural_c" 4 0))
+         ("mensural_f" . ("clefs-mensural_f" 2 0))
          ("mensural_g" . ("clefs-mensural_g" -2 0))
+         ("neo_mensural_c1" . ("clefs-neo_mensural_c" -4 0))
+         ("neo_mensural_c2" . ("clefs-neo_mensural_c" -2 0))
+         ("neo_mensural_c3" . ("clefs-neo_mensural_c" 0 0))
+         ("neo_mensural_c4" . ("clefs-neo_mensural_c" 2 0))
+         ("petrucci_c1" . ("clefs-petrucci_c" -4 0))
+         ("petrucci_c2" . ("clefs-petrucci_c" -2 0))
+         ("petrucci_c3" . ("clefs-petrucci_c" 0 0))
+         ("petrucci_c4" . ("clefs-petrucci_c" 2 0))
+         ("petrucci_c5" . ("clefs-petrucci_c" 4 0))
+         ("petrucci_f" . ("clefs-petrucci_f" 2 0))
+         ("petrucci_g" . ("clefs-petrucci_g" -2 0))
        )
 )
 
     ("clefs-hufnagel_do" . 0)
     ("clefs-hufnagel_fa" . 4)
     ("clefs-hufnagel_do_fa" . 0)
-    ("clefs-mensural1_c" . 0)
-    ("clefs-mensural2_c" . 0)
-    ("clefs-mensural3_c" . 0)
-    ("clefs-mensural1_f" . 4)
-    ("clefs-mensural2_f" . 4)
-    ("clefs-mensural_g" . -4))
+    ("clefs-mensural_c" . 0)
+    ("clefs-mensural_f" . 4)
+    ("clefs-mensural_g" . -4)
+    ("clefs-neo_mensural_c" . 0)
+    ("clefs-petrucci_c" . 0)
+    ("clefs-petrucci_f" . 4)
+    ("clefs-petrucci_g" . -4)
   )
+)
 
 (define (clef-name-to-properties cl)
   (let ((e '())