]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/regression/rehearsal-mark-number.ly: new file.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 18 Jan 2004 12:04:11 +0000 (12:04 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 18 Jan 2004 12:04:11 +0000 (12:04 +0000)
* input/regression/rehearsal-mark-letter.ly: new file.

* scm/translation-functions.scm (number->mark-string): new function
(format-mark-letters): new function
(format-mark-numbers): new function

* lily/mark-engraver.cc (process_music): rehearsalMark is now
integer; formatting is done through markFormatter property.

* scm/define-translator-properties.scm: fold all *-done properties
into positioning-done.

* lily/beam.cc (position_beam): new function
(brew_molecule): make sure that positions are calced before making
the molecule.

* ps/music-drawing-routines.ps: take blot as 4th argument.

* lily/beam.cc (brew_molecule): fix beam offsets: overlap with the
stem do avoid small dents.

28 files changed:
ChangeLog
VERSION
input/regression/rehearsal-mark-letter.ly [new file with mode: 0644]
input/regression/rehearsal-mark-number.ly [new file with mode: 0644]
input/regression/rehearsal-mark.ly [deleted file]
lily/accidental-placement.cc
lily/align-interface.cc
lily/beam.cc
lily/break-align-interface.cc
lily/dot-column.cc
lily/include/beam.hh
lily/include/lookup.hh
lily/lookup.cc
lily/mark-engraver.cc
lily/note-collision.cc
lily/rest-collision.cc
lily/stem-tremolo.cc
ly/engraver-init.ly
ps/music-drawing-routines.ps
scm/define-grob-properties.scm
scm/define-translator-properties.scm
scm/molecule.scm
scm/output-pdf.scm
scm/output-pdftex.scm
scm/output-ps.scm
scm/output-sketch.scm
scm/output-tex.scm
scm/translation-functions.scm

index 129bdae74e37f7d3e0ca26f98026a518f6b1c152..4dcc8561a1a40740dea94426ce31713ff3627ff4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,35 @@
+2004-01-18  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * input/regression/rehearsal-mark-number.ly: new file.
+
+       * input/regression/rehearsal-mark-letter.ly: new file.
+
+       * scm/translation-functions.scm (number->mark-string): new function
+       (format-mark-letters): new function
+       (format-mark-numbers): new function
+
+       * lily/mark-engraver.cc (process_music): rehearsalMark is now
+       integer; formatting is done through markFormatter property.
+       
+       * scm/define-translator-properties.scm: fold all *-done properties
+       into positioning-done.
+
+       * lily/beam.cc (position_beam): new function
+       (brew_molecule): make sure that positions are calced before making
+       the molecule.
+
+       * scm/output*.scm (beam):  take 4th argument for function.
+
+       * ps/music-drawing-routines.ps: take blot as 4th argument.
+
+       * lily/beam.cc (brew_molecule): fix beam offsets: overlap with the
+       stem do avoid small dents.
+       
+
 2004-01-17  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * VERSION: release 2.1.11
+
        * input/regression/balloon.ly: new file.
 
        * lily/balloon.cc (brew_molecule): new file: draw boxes around
diff --git a/VERSION b/VERSION
index bcf807ce684925f57222390e007854b21224dcda..9ae81bfaf81895fa9fbc20eb873d8f79f7d12219 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,5 +2,5 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=1
 PATCH_LEVEL=11
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=hwn1
 
diff --git a/input/regression/rehearsal-mark-letter.ly b/input/regression/rehearsal-mark-letter.ly
new file mode 100644 (file)
index 0000000..3ee5d35
--- /dev/null
@@ -0,0 +1,30 @@
+
+
+\header { texidoc= "Rehearsal marks in letter style: the I is skipped,
+and after Z, we continue with double letters.  The mark may be set
+with @code{\mark NUMBER}, or with @code{Score.rehearsalMark}."
+      }
+
+\version "2.1.7"
+
+
+global =  \notes {
+  s1 | \mark #6
+  s1 | \mark \default
+  s1 | \mark \default
+  s1 | \mark \default
+  \property Score.rehearsalMark = #24
+  s1 | \mark \default
+  s1 | \mark \default
+  }
+
+
+one =  \notes \relative c {
+  c''1 c c c c c c 
+}
+
+
+\score{
+\context Staff << \global \one >>
+}
+
diff --git a/input/regression/rehearsal-mark-number.ly b/input/regression/rehearsal-mark-number.ly
new file mode 100644 (file)
index 0000000..b48fddb
--- /dev/null
@@ -0,0 +1,33 @@
+\header { texidoc= "
+
+Marks can be printed as numbers.  
+By setting @code{markFormatter} we may choose a different style of mark printing. Also, marks can be specified manually, with a markup argument" 
+         
+      }
+
+\version "2.1.7"
+
+
+global =  \notes {
+    \property Score.markFormatter = #format-mark-numbers 
+  s1 | \mark \markup { \musicglyph #"scripts-coda" }
+  s1 | \mark \default
+  s1 | \mark \default
+    \property Score.markFormatter
+    = #(lambda (mark  context)
+       (make-bold-markup (make-box-markup (number->string mark))))
+       
+    s1 | \mark \default
+    s1 | \mark \default
+  }
+
+
+one =  \notes \relative c {
+  c''1 c c c c c c 
+}
+
+
+\score{
+\context Staff << \global \one >>
+}
+
diff --git a/input/regression/rehearsal-mark.ly b/input/regression/rehearsal-mark.ly
deleted file mode 100644 (file)
index 4969852..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-\header { texidoc= " Rehearsal marks are printed over barlines. They
-can be incremented automatically or manually.  "}
-
-
-\version "2.1.7"
-
-
-global =  \notes {
-  s1 | \mark "A"
-  s1 | \mark \default 
-  s1 | \mark \default 
-  s1 | \mark "12"
-  s1 | \mark \default 
-  s1 | \mark "A2"
-  s1 | \mark \markup { mark \column < up \bold down > }
-  s1
-}
-
-one =  \notes \relative c {
-  c''1 c c c c c c 
-}
-
-
-\score{
-\context Staff << \global \one >>
-}
-
index 13aef52ad4a4f1ffa28d52bbfb81cc26df3d7cff..46c765daf2c679e42766320a9d4ecc981d41aed5 100644 (file)
@@ -27,9 +27,9 @@ Accidental_placement::alignment_callback(SCM s, SCM )
   Grob * me =unsmob_grob (s);
 
   Grob * par = me->get_parent (X_AXIS);
-  if (!to_boolean (par->get_grob_property ("alignment-done")))
+  if (!to_boolean (par->get_grob_property ("positioning-done")))
     {
-      par->set_grob_property ("alignment-done", SCM_BOOL_T);
+      par->set_grob_property ("positioning-done", SCM_BOOL_T);
       position_accidentals (par);
     }
 
@@ -450,4 +450,4 @@ Accidental_placement::position_accidentals (Grob * me)
 ADD_INTERFACE(Accidental_placement,
              "accidental-placement-interface",
              "Take care of complex accidental collisions.",
-             "left-padding padding right-padding accidental-grobs alignment-done")
+             "left-padding padding right-padding accidental-grobs positioning-done")
index 68ee8e506a0f3e37572500eb03e80646738ab606..3b020ea677e33cfa50ffc16e929d80adf1dde244 100644 (file)
@@ -21,7 +21,7 @@ Align_interface::alignment_callback (SCM element_smob, SCM axis)
   Grob * me = unsmob_grob (element_smob);
   Axis ax = (Axis)gh_scm2int (axis);
   Grob * par = me->get_parent (ax);
-  if (par && !to_boolean (par->get_grob_property ("alignment-done")))
+  if (par && !to_boolean (par->get_grob_property ("positioning-done")))
     {
       Align_interface::align_elements_to_extents (par, ax);
     }
@@ -35,7 +35,7 @@ Align_interface::fixed_distance_alignment_callback (SCM element_smob, SCM axis)
   Grob * me = unsmob_grob (element_smob);
   Axis ax = (Axis)gh_scm2int (axis);
   Grob * par = me->get_parent (ax);
-  if (par && !to_boolean (par->get_grob_property ("alignment-done")))
+  if (par && !to_boolean (par->get_grob_property ("positioning-done")))
     {
       Align_interface::align_to_fixed_distance (par, ax);
     }
@@ -48,7 +48,7 @@ Align_interface::fixed_distance_alignment_callback (SCM element_smob, SCM axis)
 void
 Align_interface::align_to_fixed_distance (Grob *me , Axis a)
 {
-  me->set_grob_property ("alignment-done", SCM_BOOL_T);
+  me->set_grob_property ("positioning-done", SCM_BOOL_T);
   
   SCM d =   me->get_grob_property ("stacking-dir");
   
@@ -126,7 +126,7 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a)
 void
 Align_interface::align_elements_to_extents (Grob * me, Axis a)
 {
-  me->set_grob_property ("alignment-done", SCM_BOOL_T);
+  me->set_grob_property ("positioning-done", SCM_BOOL_T);
   
   SCM d =   me->get_grob_property ("stacking-dir");
   
@@ -286,7 +286,7 @@ find_fixed_alignment_parent  (Grob *g)
 
 ADD_INTERFACE (Align_interface, "align-interface",
   " Order grobs top to bottom/left to right/right to left etc.",
-  "forced-distance stacking-dir align-dir threshold alignment-done center-element elements axes");
+  "forced-distance stacking-dir align-dir threshold positioning-done center-element elements axes");
 
 
 struct Foobar
index 7cb39016357d92ded6ceda97d0ae89e47e4bbec3..e049696eb8c5f261290bd8f93cbab890eb3f86c0 100644 (file)
@@ -300,6 +300,8 @@ SCM
 Beam::brew_molecule (SCM grob)
 {
   Grob *me = unsmob_grob (grob);
+  position_beam (me);
+  
   Link_array<Grob> stems=
     Pointer_group_interface__extract_grobs (me, (Grob*)0, "stems");
   Grob* xcommon = common_refpoint_of_array (stems, me, X_AXIS);
@@ -335,7 +337,7 @@ Beam::brew_molecule (SCM grob)
 
   SCM last_beaming = SCM_EOL;;
   Real last_xposn = -1;
-  Real last_width = -1 ;
+  Real last_stem_width = -1 ;
 
   Real gap_length =0.0;
   SCM scm_gap = me->get_grob_property ("gap");
@@ -392,29 +394,28 @@ Beam::brew_molecule (SCM grob)
        how much to stick out for beams across linebreaks
        */
       Real break_overshoot = 3.0;
-      Real w = (i>0 && st)? xposn - last_xposn : break_overshoot;
-      Real stem_offset = 0.0;
-      Real width_corr = 0.0;
-      if (i == 1)
-       {
-         stem_offset -= last_width/2;
-         width_corr += last_width/2;
-       }
-         
-      if (i == stems.size() -1)
+      Real w = (i > 0 && st) ? xposn - last_xposn : break_overshoot;
+
+      Real stem_offset =0.0;
+      if (i > 0)
        {
-         width_corr += stem_width/2;
+         w += last_stem_width / 2;
+         stem_offset = -last_stem_width / 2;
        }
 
-         
-      Molecule whole = Lookup::beam (dydx, w + width_corr, thick);
+      if (st)
+       w += stem_width/ 2 ;
+      
+
+      Real blot = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"));
+      Molecule whole = Lookup::beam (dydx, w, thick, blot);
       Molecule gapped;
 
       int gap_count = 0;
       if (gh_number_p (me->get_grob_property ("gap-count")))
        {
          gap_count = gh_scm2int (me->get_grob_property ("gap-count"));
-         gapped = Lookup::beam (dydx, w + width_corr - 2 * gap_length, thick);
+         gapped = Lookup::beam (dydx, w - 2 * gap_length, thick, blot);
 
          full_beams.sort (default_compare);
          if (stem_dir == UP)
@@ -459,7 +460,7 @@ Beam::brew_molecule (SCM grob)
          Real w = (i>0 && st) ? (xposn - last_xposn) : break_overshoot;
          w = w/2 <? nw_f;
 
-         Molecule half = Lookup::beam (dydx, w, thick);
+         Molecule half = Lookup::beam (dydx, w, thick, blot);
          for (int j = lfliebertjes.size(); j--;)
            {
              Molecule b (half);
@@ -478,7 +479,7 @@ Beam::brew_molecule (SCM grob)
 
 
       last_xposn = xposn;
-      last_width = stem_width;
+      last_stem_width = stem_width;
       last_beaming = this_beaming;
     }
 
@@ -786,22 +787,32 @@ SCM
 Beam::after_line_breaking (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  
+
+  position_beam (me);
+  return SCM_UNSPECIFIED;
+}
+
+void
+Beam::position_beam (Grob *me)
+{
+  if (to_boolean (me->get_grob_property ("positioning-done")))
+    return ;
+
+  me->set_grob_property ("positioning-done", SCM_BOOL_T);
+
   /* Copy to mutable list. */
   SCM s = ly_deep_copy (me->get_grob_property ("positions"));
   me->set_grob_property ("positions", s);
 
   if (ly_car (s) == SCM_BOOL_F)
     {
-
       // one wonders if such genericity is necessary  --hwn.
       SCM callbacks = me->get_grob_property ("position-callbacks");
       for (SCM i = callbacks; gh_pair_p (i); i = ly_cdr (i))
-       gh_call1 (ly_car (i), smob);
+       gh_call1 (ly_car (i), me->self_scm ());
     }
 
   set_stem_lengths (me);  
-  return SCM_UNSPECIFIED;
 }
 
 
@@ -1556,6 +1567,6 @@ ADD_INTERFACE (Beam, "beam-interface",
 "the ideal slope, how close the result is to the ideal stems, etc.). We "
 "take the best scoring combination. "
 ,
-  "knee position-callbacks concaveness-gap concaveness-threshold dir-function quant-score auto-knee-gap gap gap-count chord-tremolo beamed-stem-shorten shorten least-squares-dy damping flag-width-function neutral-direction positions space-function thickness");
+  "knee positioning-done position-callbacks concaveness-gap concaveness-threshold dir-function quant-score auto-knee-gap gap gap-count chord-tremolo beamed-stem-shorten shorten least-squares-dy damping flag-width-function neutral-direction positions space-function thickness");
 
 
index 4742c948a6d3fbe24fada56f758d76506cb9b13f..07a99d272f10fc6c6bf551cc3d03720fdfb78d99 100644 (file)
@@ -32,9 +32,9 @@ Break_align_interface::alignment_callback (SCM element_smob, SCM axis)
 
   assert (a == X_AXIS);
   Grob *par = me->get_parent (a);
-  if (par && !to_boolean (par->get_grob_property ("break-alignment-done")))
+  if (par && !to_boolean (par->get_grob_property ("positioning-done")))
     {
-      par->set_grob_property ("break-alignment-done", SCM_BOOL_T);
+      par->set_grob_property ("positioning-done", SCM_BOOL_T);
       Break_align_interface::do_alignment (par);
     }
     
@@ -253,11 +253,11 @@ ADD_INTERFACE (Break_aligned_interface, "break-aligned-interface",
               "\n"
               "Rules for this spacing are much more complicated than this. \n"
               "See [Wanske] page 126 -- 134, [Ross] pg 143 -- 147\n",
-              "break-align-symbol break-alignment-done space-alist");
+              "break-align-symbol space-alist");
 
 ADD_INTERFACE (Break_align_interface, "break-alignment-interface",
   "See @ref{break-aligned-interface}.",
-  "break-alignment-done");
+  "positioning-done");
 
 
 
index f74c6451ae22945b64c2c613791d1710678e6d06..bf7170e6256040f7ed184688d49ae10f11c20d69 100644 (file)
@@ -32,9 +32,9 @@ Dot_column::force_shift_callback (SCM element_smob, SCM axis)
   assert (a == Y_AXIS);
   me = me->get_parent (X_AXIS);
 
-  if (!to_boolean (me->get_grob_property ("collision-done")))
+  if (!to_boolean (me->get_grob_property ("positioning-done")))
     {
-      me->set_grob_property ("collision-done", SCM_BOOL_T);
+      me->set_grob_property ("positioning-done", SCM_BOOL_T);
   
       do_shifts (me);
     }
@@ -291,5 +291,5 @@ Dot_column::add_head (Grob * me, Grob *rh)
 
 ADD_INTERFACE (Dot_column, "dot-column-interface",
   "Interface that groups dots so they form a column",
-  "collision-done direction stem");
+  "positioning-done direction stem");
 
index e9252050421cbcff6810e016c50fef2359235df1..ed610a9975797896ab5f9e3f0dd2c6512e44d0f5 100644 (file)
@@ -29,7 +29,7 @@ public:
   static void set_beaming (Grob*,Beaming_info_list *);
   static void set_stemlens (Grob*);
   static int get_beam_count (Grob*me);
-
+  static void position_beam (Grob* me);
   static Real get_beam_translation (Grob*me);
   static Real get_thickness (Grob*me);
 
index 5c237fb1626bc4c2cbea906a0e607b1c7a4906bc..43d5f68761593804c7ce971bf87d89593917be34 100644 (file)
@@ -26,7 +26,7 @@ struct Lookup
   static Molecule slur (Bezier controls, Real cthick, Real thick);
   static Molecule bezier_sandwich (Bezier top_curve, Bezier bottom_curve);
   static Molecule horizontal_slope (Real width, Real slope, Real height);
-  static Molecule beam (Real slope, Real width, Real thick);
+  static Molecule beam (Real slope, Real width, Real thick, Real blot);
   static Molecule dashed_slur (Bezier, Real thick, Real dash);
   static Molecule blank (Box b);
   static Molecule filled_box (Box b);
index caa1996ed4e928c0134f1bcffa0064a363fdcb91..0e8a40acb8bd597f10739d5b72ffeebe10319ebc 100644 (file)
@@ -40,22 +40,20 @@ Lookup::dot (Offset p, Real radius)
 }
 
 Molecule 
-Lookup::beam (Real slope, Real width, Real thick) 
+Lookup::beam (Real slope, Real width, Real thick, Real blot
 {
   Real height = slope * width; 
   Real min_y = (0 <? height) - thick/2;
   Real max_y = (0 >? height) + thick/2;
 
-  
-
   Box b (Interval (0, width),
         Interval (min_y, max_y));
-
   
   SCM at = scm_list_n (ly_symbol2scm ("beam"),
                    gh_double2scm (width),
                    gh_double2scm (slope),
                    gh_double2scm (thick),
+                   gh_double2scm (blot),
                    SCM_UNDEFINED);
   return Molecule (b, at);
 }
index f2808db11966c7d4ed65e7aeb119b59822ea36ae..705d96a0e39dc54a7e1235693485b4d5b781cd98 100644 (file)
@@ -7,18 +7,13 @@
 */
 
 #include <ctype.h>
+
 #include "bar-line.hh"
 
-#include "staff-symbol.hh"
 #include "engraver-group-engraver.hh"
 #include "engraver.hh"
-#include "lily-guile.hh"
-#include "paper-column.hh"
-#include "paper-def.hh"
-#include "side-position-interface.hh"
-#include "staff-symbol-referencer.hh"
 #include "item.hh"
-#include "group-interface.hh"
+#include "warn.hh"
 #include "text-item.hh"
 
 /**
@@ -36,11 +31,11 @@ protected:
   virtual void stop_translation_timestep ();
   virtual void acknowledge_grob (Grob_info);
   void create_items (Music*);
-  virtual bool try_music (Music *req);
+  virtual bool try_music (Music *ev);
   virtual void process_music ();
   
 private:
-  Music * mark_req_;
+  Music * mark_ev_;
 };
 
 
@@ -50,7 +45,7 @@ private:
 Mark_engraver::Mark_engraver ()
 {
   text_ =0;
-  mark_req_ = 0;
+  mark_ev_ = 0;
 }
 
 void
@@ -77,7 +72,7 @@ Mark_engraver::stop_translation_timestep ()
       typeset_grob (text_);
       text_ =0;
     }
-  mark_req_ = 0;
+  mark_ev_ = 0;
 }
 
 
@@ -95,7 +90,7 @@ Mark_engraver::create_items (Music *rq)
 bool
 Mark_engraver::try_music (Music* r)
 {
-  mark_req_ = r;
+  mark_ev_ = r;
   return true;
 }
 
@@ -110,79 +105,42 @@ Mark_engraver::try_music (Music* r)
 void
 Mark_engraver::process_music ()
 {
-  if (mark_req_)
+  if (mark_ev_)
     {
-      create_items (mark_req_);
+      create_items (mark_ev_);
 
       /*
        automatic marks.
        */
+
       
-      SCM m = mark_req_->get_mus_property ("label");
-      if (Text_item::markup_p (m))
-       {
-         text_->set_grob_property ("text",m);
-       }
-      else 
+      SCM m = mark_ev_->get_mus_property ("label");
+      SCM proc = get_property ("markFormatter");
+      if (!Text_item::markup_p (m) &&
+         gh_procedure_p (proc))
        {
-         String t ;
-         
-         if (!gh_string_p (m) && !gh_number_p (m)) 
+         if (!gh_number_p (m)) 
            m =  get_property ("rehearsalMark");
-         
-         if (gh_number_p (m))
+
+         if (scm_integer_p (m) == SCM_BOOL_T
+             && scm_exact_p (m) == SCM_BOOL_T)
            {
              int mark_count = gh_scm2int (m);
-             t = to_string (mark_count);
              mark_count ++;
-             m = gh_int2scm (mark_count);
-           }
-         else if (gh_string_p (m))
-           {
-             t = ly_scm2string (m);
-             String next;
-             if (t.length ())
-               {
-                 char c = t[0];
-                 c++;
-                 t = to_string (c);
-               }
-             m = scm_makfrom0str (t.to_str0 ());
+             daddy_trans_->set_property ("rehearsalMark",
+                                         gh_int2scm (mark_count));
            }
-         else
-           {
-             m = gh_int2scm (1);
-             t = to_string (1);
-           }
-         
-         text_->set_grob_property ("text",
-                                   scm_makfrom0str (t.to_str0 ()));
 
-         SCM series = SCM_EOL;
-         SCM family = ly_symbol2scm ("number");
-         for (int i=0; i < t.length (); i++)
-           {
-             if (!isdigit (t[i])) 
-               {
-                 /*
-                   This looks strange, since \mark "A"
-                   isn't printed in bold.
-                   
-                  */
-                 
-                 // series = ly_symbol2scm ("bold");
-                 family = ly_symbol2scm ("roman");
-                 break;
-               }
-           }
-         if (gh_symbol_p (series))
-           text_->set_grob_property ("font-series",  series);
-         if (gh_symbol_p (family))
-           text_->set_grob_property ("font-family",  family);
+         if (gh_number_p (m))
+           m = scm_call_2 (proc, m, daddy_trans_->self_scm ());
+         else
+           warning ("rehearsalMark does not have integer value.");
        }
 
-      if (gh_number_p (m) || gh_string_p (m))
-       daddy_trans_->set_property ("rehearsalMark", m);
+      if (Text_item::markup_p (m))
+       text_->set_grob_property ("text", m);
+      else
+       warning ("Mark label should be markup object.");
     }
 }
 
@@ -191,5 +149,5 @@ ENTER_DESCRIPTION(Mark_engraver,
 /* creats*/       "RehearsalMark",
 /* accepts */     "mark-event",
 /* acks  */       "bar-line-interface",
-/* reads */       "rehearsalMark stavesFound",
+/* reads */       "rehearsalMark markFormatter stavesFound",
 /* write */       "");
index 5d9290904bffd7adb846e6a68c6875072f5e48e3..50958af832b8d4360f6f30c884f2f4bf110e97ce 100644 (file)
@@ -28,9 +28,9 @@ Note_collision_interface::force_shift_callback (SCM element_smob, SCM axis)
   
    me = me->get_parent (a);
 
-   if (! to_boolean (me->get_grob_property ("collision-done")))
+   if (! to_boolean (me->get_grob_property ("positioning-done")))
     {
-      me->set_grob_property ("collision-done", SCM_BOOL_T);
+      me->set_grob_property ("positioning-done", SCM_BOOL_T);
       do_shifts (me);
     }
   
@@ -444,4 +444,4 @@ ADD_INTERFACE (Note_collision_interface, "note-collision-interface",
 "directions and horizontal shifts. Most of the interesting properties "
 "are to be set in @ref{note-column-interface}: these are "
 "@code{force-hshift} and @code{horizontal-shift}. ",
-  "merge-differently-dotted merge-differently-headed collision-done");
+  "merge-differently-dotted merge-differently-headed positioning-done");
index 31a83715dbd5f8bd2b9b71d447d7f451dab977b4..6a7eceecaba2586874b35c919319f024559528db 100644 (file)
@@ -29,9 +29,9 @@ Rest_collision::force_shift_callback (SCM element_smob, SCM axis)
 
   Grob * rc = unsmob_grob (them->get_grob_property ("rest-collision"));
 
-  if (rc && !to_boolean (rc->get_grob_property ("rest-collision-done")))
+  if (rc && !to_boolean (rc->get_grob_property ("positioning-done")))
     {
-      rc->set_grob_property ("rest-collision-done", SCM_BOOL_T);
+      rc->set_grob_property ("positioning-done", SCM_BOOL_T);
 
       do_shift (rc);
     }
@@ -243,5 +243,5 @@ Rest_collision::do_shift (Grob *me)
 ADD_INTERFACE (Rest_collision,"rest-collision-interface",
   "Move around ordinary rests (not multi-measure-rests) to avoid "
 "conflicts.",
-  "maximum-rest-count minimum-distance rest-collision-done elements");
+  "maximum-rest-count minimum-distance positioning-done elements");
 
index 445926bbada1b74a830845eda03a471f0c048389..6ca35377f90cb08f195d0839fd713ea0a54891e7 100644 (file)
@@ -82,10 +82,12 @@ Stem_tremolo::raw_molecule (Grob *me)
   Real ss = Staff_symbol_referencer::staff_space (me);
   Real thick = gh_scm2double (me->get_grob_property ("beam-thickness"));
   Real width = gh_scm2double (me->get_grob_property ("beam-width"));
+  Real blot = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"));
+
   width *= ss;
   thick *= ss;
   
-  Molecule a (Lookup::beam (dydx, width, thick));
+  Molecule a (Lookup::beam (dydx, width, thick, blot));
   a.translate (Offset (-width/2, width / 2 * dydx));
   
   int tremolo_flags = 0;
index 19b561b567b4a925fca93de56e90d82427d7e3d8..6722db4821de08ffff40fd92b968bc8272c292a7 100644 (file)
@@ -475,7 +475,8 @@ AncientRemoveEmptyStaffContext = \translator {
 
        fingeringOrientations = #'(up down)
        tupletNumberFormatFunction = #denominator-tuplet-formatter
-       
+       markFormatter = #format-mark-letters
+       rehearsalMark = #1 
        subdivideBeams = ##f
        allowBeamBreak = ##f
        extraNatural = ##t
@@ -523,9 +524,7 @@ AncientRemoveEmptyStaffContext = \translator {
 
        %%
        bassFigureFormatFunction = #make-bass-figure-markup
-       metronomeMarkFormatter = #make-metronome-markup
-
-
+       metronomeMarkFormatter = #format-metronome-markup
        graceSettings = #`#(
                 (Voice Stem direction 1)
 
index b665aff49a98416b292921c35f73a48ee74aec36..f3cae4c6a01e5a02fde391fd62ddf92a51397b83 100644 (file)
 } bind def
 
 % Nice beam with rounded corners
-/draw_beam % slope width thick 
+/draw_beam % slope width thick  blot
 {
-       currentdict /testing known {
-               %% real thin lines for testing
-               /blot 0.005 def
-       }{
-               /blot blot-diameter def
-       } ifelse
+       /blot exch def 
        blot setlinewidth
 
        0 setlinecap
index d5809adf658c9bf342fc2535b0ebe05717c95024..5141b56c17ce93cfff3557a562961b9c6f3e4ff8 100644 (file)
@@ -68,7 +68,6 @@ the grob to the nearest open space.
 (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.")
 (grob-property-description 'align-dir ly:dir? "Which side to align? -1: left side, 0: around center of width, 1: right side.")
-(grob-property-description 'alignment-done boolean? "boolean to administrate whether we've done the alignment already (to ensure that the process is done only once).")
 (grob-property-description 'all-elements grob-list? "list of all grobs in this line. Needed for protecting grobs from GC.")
 (grob-property-description 'arch-angle number? "turning angle of the hook of a system brace" )
 (grob-property-description 'arch-height ly:dimension? "height of the hook of a system brace.")
@@ -511,7 +510,6 @@ columns.
 (grob-property-description 'right-items grob-list? "")
 (grob-property-description 'cause scheme? "Any kind of causation objects (i.e. music, or perhaps translator) that was the cause for this grob.  ")
 (grob-property-description 'font ly:font-metric? "Cached font metric object")
-(grob-property-description 'break-alignment-done boolean? "mark flag to signal we've done alignment already.")
 (grob-property-description
  'staff-padding ly:dimension?
  "Maintain this much space to the staff.  It's effect is similar to
@@ -520,10 +518,12 @@ staff in a row more often, when the heights of the notes vary.
 ")
 
 (grob-property-description 'staff-symbol ly:grob? "the staff symbol grob that we're in.")
-(grob-property-description 'collision-done boolean? "")
+(grob-property-description 'positioning-done boolean?
+                          "Used to signal that a positioning element
+did it's job. This ensures that a positioning is only done once.")
+
 (grob-property-description 'rest ly:grob? "the staff symbol grob that we're in.")
 (grob-property-description 'rest-collision ly:grob? "rest collision that a rest is in.")
-(grob-property-description 'rest-collision-done boolean? "Is this rest collision processed yet?")
 
 (grob-property-description 'script-molecule pair? "Index code for script -- internal, see script.cc.")
 
index 1f46f5df736298e59d65234e9051c42244de9dc6..3f11acf9d6b942afde0817658ef650d84588c6a0 100644 (file)
@@ -302,8 +302,13 @@ signature at this point in the measure.  The format is the same as for keySignat
 ) 
 (translator-property-description 'localKeySignatureChanges list? "Experimental.
  [DOCME]")
+
 (translator-property-description 'majorSevenSymbol markup? "How should
 the major7 be formatted in a chord name?")
+(translator-property-description 'markFormatter procedure? "Procedure
+taking as arguments context and rehearsal mark. It should return the
+formatted mark as a markup object.")
+
 (translator-property-description 'measureLength ly:moment? "Length of one
 measure in the current time signature last?")
 (translator-property-description 'measurePosition ly:moment? "How much
@@ -361,7 +366,7 @@ that indicates how to print sustain pedals: text, bracket or mixed
 (translator-property-description 'pedalUnaCordaStyle symbol? "see pedalSustainStyle.")
 (translator-property-description 'pedalSostenutoStyle symbol? "see pedalSustainStyle.")
 
-(translator-property-description 'rehearsalMark number-or-string? "The
+(translator-property-description 'rehearsalMark integer? "The
 last rehearsal mark printed.")
 (translator-property-description 'repeatCommands list? "This property is read to find any command of the form (volta . X), where X is a string or #f")
 (translator-property-description 'scriptDefinitions list? "
index fb604872eda404fdb76160024eb415a84709d11a..443f6e5c83781532d54271aec8e792f61c1b262a 100644 (file)
@@ -72,13 +72,13 @@ encloses the contents.
   (let* (
         (x-ext (interval-widen (ly:molecule-get-extent mol 0) padding))
         (y-ext (interval-widen (ly:molecule-get-extent mol 1) padding))
+        (y-rule (make-filled-box-molecule (cons 0 thick) y-ext))
         (x-rule (make-filled-box-molecule (interval-widen x-ext thick)
-                              (cons 0 thick)))
-        (y-rule (make-filled-box-molecule (cons 0 thick) y-ext)))
-    
-    (set! mol (ly:molecule-combine-at-edge mol 0 1 y-rule (* 0.5 padding)))
-    (set! mol (ly:molecule-combine-at-edge mol 0 -1  y-rule (* 0.5 padding)))
-    (set! mol (ly:molecule-combine-at-edge mol 1 1  x-rule 0.0))  
-    (set! mol (ly:molecule-combine-at-edge mol 1 -1 x-rule 0.0))
+                                          (cons 0 thick)))
+        )
+    (set! mol (ly:molecule-combine-at-edge mol X 1 y-rule padding))
+    (set! mol (ly:molecule-combine-at-edge mol X -1 y-rule padding))
+    (set! mol (ly:molecule-combine-at-edge mol Y 1 x-rule 0.0))  
+    (set! mol (ly:molecule-combine-at-edge mol Y -1 x-rule 0.0))
     
     mol))
index 96153a63ccfd41263efa3cbb2c9940ecd45cd6d0..4ca3f8991f919a5d070e9dc87e1095c6982b9768 100644 (file)
@@ -52,7 +52,7 @@
 (define (setgray g) (string-append (ly:number->string g) "g "))
 (define (setlineparams) "1 j 1 J ")
 
-(define (beam width slope thick)
+(define (beam width slope thick blot)
   (let ((ht (* slope width)))
     (string-append (moveto 0 (- (/ thick 2)))
                   (rlineto width ht)
index 3ecd63b72666f3283d6ebe96735336912cd06ac6..cd13c67aba4d68858e56b7eefe4c1858f4721fea 100644 (file)
@@ -48,8 +48,8 @@
     
     ))
 
-(define (beam width slope thick)
-  (embedded-pdf (list 'beam  width slope thick)))
+(define (beam width slope thick blot)
+  (embedded-pdf (list 'beam  width slope thick blot)))
 
 (define (bracket arch_angle arch_width arch_height height arch_thick thick)
   (embedded-pdf (list 'bracket  arch_angle arch_width arch_height height arch_thick thick)))
index bf42f7e22c17e6e50e460ecb29dda9f788d47c79..801d31185a8160ea90708e703453a55b4901f65d 100644 (file)
@@ -35,9 +35,9 @@
 
 
 ;; Interface functions
-(define (beam width slope thick)
+(define (beam width slope thick blot)
   (string-append
-   (numbers->string (list slope width thick)) " draw_beam" ))
+   (numbers->string (list slope width thick blot)) " draw_beam" ))
 
 ;; two beziers
 (define (bezier-sandwich l thick)
index 86cf11c949780f7b2324424669503255d216fa00..ed2bad7ed8efe610ca92eff790c27801d65b6dda 100644 (file)
 (define (font-load-command name-mag command)
   "")
 
-(define (beam x y width slope thick)
+(define (beam x y width slope thick blot)
   (apply sketch-filled-rectangle
         (list width (* slope width) 0 thick x y)))
 
index 87017e644efb25422a0032c68b72edeb0d91eb76..4e43277a6dda7e31d1c269b2e74e8f7d7d9e95b8 100644 (file)
@@ -88,8 +88,8 @@
 (define (dot x y radius)
   (embedded-ps (list 'dot x y radius)))
 
-(define (beam width slope thick)
-  (embedded-ps (list 'beam  width slope thick)))
+(define (beam width slope thick blot)
+  (embedded-ps (list 'beam  width slope thick blot)))
 
 (define (bracket arch_angle arch_width arch_height height arch_thick thick)
   (embedded-ps (list 'bracket  arch_angle arch_width arch_height height arch_thick thick)))
index 76b8eb6f2f33219cc37d898f9fc5d60491303c65..eec30297023cda0c774a062f2a1c213cb1e154e3 100644 (file)
@@ -12,7 +12,7 @@
 
 
 ;; metronome marks
-(define-public (make-metronome-markup event context)
+(define-public (format-metronome-markup event context)
   (let*
       ((dur  (ly:get-mus-property event 'tempo-unit))
        (count (ly:get-mus-property event 'metronome-count))
       
   ))))
 
+
+
+(define number->mark-letter-vector (make-vector 25 #\A))
+
+(do ((i 0 (1+ i))
+     (j 0 (1+ j)) )
+    ((>= i 26))
+  (if (= i (- (char->integer #\I) (char->integer #\A)))
+      (set! i (1+ i)))
+  (vector-set! number->mark-letter-vector j
+              (integer->char (+ i (char->integer #\A))))  )
+
+(define-public (number->mark-string n)
+  "Double letters for big marks."
+  (let*
+      ((l (vector-length number->mark-letter-vector)))
+    (display n) (newline)
+    (display l) (newline)
+    
+  (if (>= n l)
+      (string-append (number->mark-string (1- (quotient n l)))
+                    (number->mark-string (remainder n l)))
+      (make-string 1 (vector-ref number->mark-letter-vector n)))))
+
+
+(define-public (format-mark-letters mark context)
+  (make-bold-markup (number->mark-string (1- mark))))
+
+(define-public (format-mark-numbers mark context)
+  (make-bold-markup (number->string mark)))
+