]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' into lilypond/translation
authorFrancisco Vila <francisco.vila@hispalinux.es>
Mon, 20 Apr 2009 08:12:40 +0000 (10:12 +0200)
committerFrancisco Vila <francisco.vila@hispalinux.es>
Mon, 20 Apr 2009 08:12:40 +0000 (10:12 +0200)
31 files changed:
Documentation/user/expressive.itely
input/lsr/expressive-marks.snippet-list
input/lsr/making-slurs-with-complex-dash-structure.ly [new file with mode: 0644]
input/lsr/positioning-grace-notes-with-floating-space.ly
input/lsr/printing-bar-numbers-at-regular-intervals.ly
input/lsr/printing-bar-numbers-inside-boxes-or-circles.ly
input/lsr/redefining-grace-note-global-defaults.ly
input/lsr/rhythms.snippet-list
input/new/making-slurs-with-complex-dash-structure.ly [new file with mode: 0644]
input/regression/finger-chords-dot.ly [new file with mode: 0644]
input/regression/spanner-after-line-breaking.ly [new file with mode: 0644]
lily/arpeggio.cc
lily/bezier.cc
lily/hairpin.cc
lily/include/bezier.hh
lily/include/hairpin.hh
lily/include/lookup.hh
lily/include/spanner.hh
lily/line-spanner.cc
lily/lookup.cc
lily/new-fingering-engraver.cc
lily/slur.cc
lily/spanner.cc
lily/tie.cc
lily/vaticana-ligature.cc
ly/predefined-guitar-fretboards.ly
ly/property-init.ly
python/convertrules.py
scm/define-grob-properties.scm
scm/define-grobs.scm
scripts/auxiliar/makelsr.py

index 23ca4faba3522bb527914181799699247cf00210..998461f47c797f3e47f6cde61162b44672129dba 100644 (file)
@@ -575,6 +575,26 @@ c4( e g2)
 g4( e c2)
 @end lilypond
 
+@funindex \slurHalfDashed
+@funindex slurHalfDashed
+@funindex \slurHalfSolid
+@funindex slurHalfSolid
+
+Slurs can also be made half-dashed (the first half dashed, the
+second half solid) or half-solid (the first half solid, the second
+half dashed):
+
+@lilypond[verbatim,quote,relative=1]
+\slurHalfDashed
+g4( e c2)
+\slurHalfSolid
+c4( e g2)
+\slurSolid
+g4( e c2)
+@end lilypond
+
+
+
 @funindex \slurUp
 @funindex slurUp
 
@@ -585,6 +605,8 @@ g4( e c2)
 @code{\slurNeutral},
 @code{\slurDashed},
 @code{\slurDotted},
+@code{\slurHaldDashed},
+@code{\slurHalfSolid},
 @code{\slurSolid}.
 @endpredefined
 
@@ -597,6 +619,9 @@ g4( e c2)
 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
 {positioning-text-markups-inside-slurs.ly}
 
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+{making-slurs-with-complex-dash-structure.ly}
+
 @seealso
 Music Glossary:
 @rglos{slur}.
index 33515ad24d31196f5aae48692306cff9034971af..ddd1b2dc495a6592b49319a0027f4910861d7a99 100644 (file)
@@ -26,6 +26,7 @@ horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly
 inserting-a-caesura.ly
 laissez-vibrer-ties.ly
 line-arrows.ly
+making-slurs-with-complex-dash-structure.ly
 modifying-default-values-for-articulation-shorthand-notation.ly
 piano-template-with-centered-dynamics.ly
 positioning-text-markups-inside-slurs.ly
diff --git a/input/lsr/making-slurs-with-complex-dash-structure.ly b/input/lsr/making-slurs-with-complex-dash-structure.ly
new file mode 100644 (file)
index 0000000..035a9bb
--- /dev/null
@@ -0,0 +1,39 @@
+%% Do not edit this file; it is auto-generated from input/new
+%% This file is in the public domain.
+\version "2.13.1"
+
+\header {
+  lsrtags = "rhythms, expressive-marks"
+  texidoc = "
+Slurs can be made with complex dash patterns by defining
+the @code{dash-definition} property.  @code{dash-definition}
+is a list of @code{dash-elements}.  A @code{dash-element} is a
+list of parameters defining the dash behavior for a segment of
+the slur.
+
+The slur is defined in terms of the bezier parameter t
+which ranges from 0
+at the left end of the slur to 1 at the right end of the slur.
+@code{dash-element} is a list @code{(start-t stop-t dash-fraction
+dash-period)}.  The region of the slur from @code{start-t} to
+@code{stop-t} will have a fraction @code{dash-fraction}
+of each @code{dash-period} black.  @code{dash-period} is
+defined in terms of staff spaces.  @code{dash-fraction} is
+set to 1 for a solid slur.
+"
+  doctitle = "Making slurs with complex dash structure"
+} % begin verbatim
+
+
+\relative c' {
+  \once \override
+    Slur #'dash-definition = #'((0 0.3 0.1 0.75)
+                                (0.3 0.6 1 1)
+                                (0.65 1.0 0.4 0.75))
+  c( d e f)
+  \once \override
+    Slur #'dash-definition = #'((0 0.25 1 1)
+                                (0.3 0.7 0.4 0.75)
+                                (0.75 1.0 1 1))
+  c( d e f)
+}
index 5068f62997025f817ea1fd6b2e11f529079660d7..0b38eadef490203f1c78ee0d3e5a3d64dfbe0820 100644 (file)
@@ -28,5 +28,3 @@ the) graces are put left of the musical columns for the main notes.
     }
   >>
 }
-
-
index d0411a7ca953958d6e7adc402c7d5499fbb5a353..1041ca6bcedc49e17a312baf1cddcf80f7a72267 100644 (file)
@@ -8,7 +8,7 @@
   texidoc = "
 Bar numbers can be printed at regular intervals by setting the property
 @code{barNumberVisibility}. Here the bar numbers are printed every two
-measures except at the end of the line. 
+measures except at the end of the line.
 
 "
   doctitle = "Printing bar numbers at regular intervals"
@@ -21,7 +21,7 @@ measures except at the end of the line.
   \bar ""
   % Print a bar number every second measure
   \set Score.barNumberVisibility = #(every-nth-bar-number-visible 2)
-  c1 | c | c | c | c 
+  c1 | c | c | c | c
   \break
   c1 | c | c | c | c
 }
index 0f30c0928c03c78eddeedf6ce25184f097a27f05..24dafb8010b8886f14647e7e2f3aa08df52c7656 100644 (file)
@@ -8,13 +8,11 @@
   texidoc = "
 Bar numbers can also be printed inside boxes or circles.
 
-
-
 "
   doctitle = "Printing bar numbers inside boxes or circles"
 } % begin verbatim
 
-\relative c'{
+\relative c' {
   % Prevent bar numbers at the end of a line and permit them elsewhere
   \override Score.BarNumber  #'break-visibility = #end-of-line-invisible
   \set Score.barNumberVisibility = #(every-nth-bar-number-visible 4)
index 49950650a48513dc5240226c4c7848a5f87a3bba..c0c63378f8be05105707be014434d6cde4c29507 100644 (file)
@@ -11,7 +11,7 @@ The global defaults for grace notes are stored in the identifiers
 @code{startAcciaccaturaMusic}, @code{stopAcciaccaturaMusic},
 @code{startAppoggiaturaMusic} and @code{stopAppoggiaturaMusic}, which
 are defined in the file @code{ly/grace-init.ly}.  By redefining them
-other effects may be obtained. 
+other effects may be obtained.
 
 "
   doctitle = "Redefining grace note global defaults"
index e2022dc7835ffc89f977f40ce25a2c1dcd0ae451..b63ad8e08a6cc56297147c2973cc7da37ab700b5 100644 (file)
@@ -26,6 +26,7 @@ grouping-beats.ly
 guitar-strum-rhythms.ly
 heavily-customized-polymetric-time-signatures.ly
 making-an-object-invisible-with-the-transparent-property.ly
+making-slurs-with-complex-dash-structure.ly
 manually-controlling-beam-positions.ly
 merging-multi-measure-rests-in-a-polyphonic-part.ly
 modifying-tuplet-bracket-length.ly
diff --git a/input/new/making-slurs-with-complex-dash-structure.ly b/input/new/making-slurs-with-complex-dash-structure.ly
new file mode 100644 (file)
index 0000000..e2d1b8c
--- /dev/null
@@ -0,0 +1,36 @@
+\version "2.13.1"
+
+\header {
+  lsrtags = "rhythms, expressive-marks"
+  texidoc = "
+Slurs can be made with complex dash patterns by defining
+the @code{dash-definition} property.  @code{dash-definition}
+is a list of @code{dash-elements}.  A @code{dash-element} is a
+list of parameters defining the dash behavior for a segment of
+the slur.
+
+The slur is defined in terms of the bezier parameter t
+which ranges from 0
+at the left end of the slur to 1 at the right end of the slur.
+@code{dash-element} is a list @code{(start-t stop-t dash-fraction
+dash-period)}.  The region of the slur from @code{start-t} to
+@code{stop-t} will have a fraction @code{dash-fraction}
+of each @code{dash-period} black.  @code{dash-period} is
+defined in terms of staff spaces.  @code{dash-fraction} is
+set to 1 for a solid slur.
+"
+  doctitle = "Making slurs with complex dash structure"
+}
+
+\relative c' {
+  \once \override
+    Slur #'dash-definition = #'((0 0.3 0.1 0.75)
+                                (0.3 0.6 1 1)
+                                (0.65 1.0 0.4 0.75))
+  c( d e f)
+  \once \override
+    Slur #'dash-definition = #'((0 0.25 1 1)
+                                (0.3 0.7 0.4 0.75)
+                                (0.75 1.0 1 1))
+  c( d e f)
+}
diff --git a/input/regression/finger-chords-dot.ly b/input/regression/finger-chords-dot.ly
new file mode 100644 (file)
index 0000000..d54e97c
--- /dev/null
@@ -0,0 +1,10 @@
+\version "2.13.1"
+
+\header {
+  texidoc = "Scripts right of a chord avoid dots."
+}
+
+\relative c' {
+  \set fingeringOrientations = #'(right)
+  <c-\rightHandFinger #1 >4.. <d-3 f>4. r8.
+}
diff --git a/input/regression/spanner-after-line-breaking.ly b/input/regression/spanner-after-line-breaking.ly
new file mode 100644 (file)
index 0000000..dd5a1ed
--- /dev/null
@@ -0,0 +1,36 @@
+\version "2.13.1"
+
+\header {
+texidoc = "The visibility of left-broken line spanners and hairpins
+which end on the first note (i.e., span no time between bounds) is
+controlled by the callback @code{ly:spanner::kill-zero-spanned-time}.
+"
+}
+
+\paper { ragged-right = ##t }
+
+\relative c' {
+  \override TextSpanner #'bound-details =
+    #'((left
+        (Y . 0)
+        (padding . 0.25)
+        (attach-dir . -1)
+        (text . "L"))
+       (right
+        (Y . 0)
+        (padding . 0.25)
+        (text . "R"))
+       (left-broken
+        (padding . 5)
+        (text . #f))
+       (right-broken
+        (text . #f)))
+  c1\startTextSpan\< \break
+  \override Hairpin #'to-barline = ##f
+  \override Hairpin #'after-line-breaking = ##f
+  c2\stopTextSpan\!
+  \override TextSpanner #'after-line-breaking =
+    #ly:spanner::kill-zero-spanned-time
+  c\startTextSpan\< \break
+  c1\!\stopTextSpan
+}
index 7873b5f39cc807bfe7055c9eb972855a26dd092e..0265b3deddeb5d8a94f4488c1bffb84de3dca00b 100644 (file)
@@ -165,7 +165,7 @@ Arpeggio::brew_chord_slur (SCM smob)
   Bezier curve = slur_shape (dy, height_limit, ratio);
   curve.rotate (M_PI / 2);
 
-  Stencil mol (Lookup::slur (curve, lt, lt));
+  Stencil mol (Lookup::slur (curve, lt, lt, SCM_UNDEFINED));
   mol.translate_axis (heads[LEFT], Y_AXIS);
   return mol.smobbed_copy ();
 }
index 3712b9213ef91c26ab1d5fb74d0fb56127dc5c06..8f55b3ce507efb8c2595dc8f65bcd0f3e16a0bf2 100644 (file)
@@ -265,3 +265,56 @@ Bezier::reverse ()
     b2.control_[CONTROL_COUNT - i - 1] = control_[i];
   *this = b2;
 }
+
+
+/*
+  Subdivide a bezier at T into LEFT_PART and RIGHT_PART
+*/
+void
+Bezier::subdivide (Real t, Bezier &left_part, Bezier &right_part)
+{
+  Offset b2[3];
+  Offset b1[2];
+  Offset b0;
+  for (int i = 0; i < 3; i++)
+    b2[i] = control_[i] + t * (control_[i+1] - control_[i]);
+  for (int i = 0; i < 2; i++)
+    b1[i] = b2[i] + t * (b2[i+1] - b2[i]);
+  b0 = b1[0] + t * (b1[1] - b1[0]);
+  left_part.control_[0] = control_[0];
+  left_part.control_[1] = b2[0];
+  left_part.control_[2] = b1[0];
+  left_part.control_[3] = b0;
+  right_part.control_[0] = b0;
+  right_part.control_[1] = b1[1];
+  right_part.control_[2] = b2[2];
+  right_part.control_[3] = control_[3];
+}
+
+/*
+  Extract a portion of a bezier from T_MIN to T_MAX
+*/
+
+Bezier
+Bezier::extract (Real t_min, Real t_max)
+{
+  Bezier bez1, bez2, bez3, bez4;
+  if (t_min == 0.0)
+    {
+      for (int i = 0; i < CONTROL_COUNT; i++)
+        bez2.control_[i] = control_[i];
+    }
+  else
+    {
+      subdivide (t_min, bez1, bez2);
+    }
+  if (t_max == 1.0)
+    {
+      return bez2;
+    }
+  else
+   {
+     bez2.subdivide ((t_max-t_min)/(1-t_min), bez3, bez4);
+     return bez3;
+  }
+}
index 249c50206a4803f0f10252521b898318596f6efa..bb4fec084bb66c10c64a2ea724731a9285294448 100644 (file)
 #include "note-column.hh"
 #include "warn.hh"
 
-MAKE_SCHEME_CALLBACK (Hairpin, after_line_breaking, 1);
-SCM
-Hairpin::after_line_breaking (SCM smob)
-{
-  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
-  consider_suicide (me);
-
-  return SCM_UNSPECIFIED;
-}
-
 MAKE_SCHEME_CALLBACK (Hairpin, height, 1);
 SCM
 Hairpin::height (SCM smob)
@@ -52,38 +42,12 @@ Hairpin::pure_height (SCM smob, SCM, SCM)
   return ly_interval2scm (Interval (-height, height));
 }
 
-void
-Hairpin::consider_suicide (Spanner*me)
-{
-  Drul_array<bool> broken;
-  Drul_array<Item *> bounds;
-  Direction d = LEFT;
-  do
-    {
-      bounds[d] = me->get_bound (d);
-      broken[d] = bounds[d]->break_status_dir () != CENTER;
-    }
-  while (flip (&d) != LEFT);
-
-  if (broken[LEFT]
-      && ly_is_equal (bounds[RIGHT]->get_column ()->get_property ("when"),
-                     bounds[LEFT]->get_property ("when")))
-    me->suicide ();
-}
-
 MAKE_SCHEME_CALLBACK (Hairpin, print, 1);
-
 SCM
 Hairpin::print (SCM smob)
 {
-  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
+  Spanner *me = unsmob_spanner (smob);
 
-  if (Spanner *orig = dynamic_cast<Spanner*> (me->original ()))
-    {
-      for (vsize i = 0; i < orig->broken_intos_.size (); i++)
-       Hairpin::consider_suicide (orig->broken_intos_[i]);
-    }
-  
   SCM s = me->get_property ("grow-direction");
   if (!is_direction (s))
     {
index a04d449725ab17f346df4d20daa5286df7de0d4c..5cfca578c2ebd5270095076cc91788adb6a3bd42 100644 (file)
@@ -22,6 +22,8 @@ public:
   void reverse ();
   void rotate (Real);
   void translate (Offset);
+  void subdivide (Real, Bezier &, Bezier &);
+  Bezier extract (Real, Real);
 
   Real get_other_coordinate (Axis a, Real x) const;
   vector<Real> solve_point (Axis, Real coordinate) const;
index 5ce62aaba318bb4062bec6a8dbd21a8ecbdff8e2..c4a5300de53a25c90431dac27b166bffa6a23ad9 100644 (file)
@@ -18,8 +18,6 @@ public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (height, (SCM));
   DECLARE_SCHEME_CALLBACK (pure_height, (SCM, SCM, SCM));
-  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
-  static void consider_suicide (Spanner*);
   DECLARE_GROB_INTERFACE();
 };
 
index 8f0844df71efb7a09f875171e77972034a84e9ee..bfe5d57b0326ed37895ae402ab63c1193c5ccba5 100644 (file)
@@ -20,10 +20,11 @@ struct Lookup
   static Stencil rotated_box (Real slope, Real width, Real thick, Real blot);
   static Stencil round_filled_polygon (vector<Offset> const &points, Real blotdiameter);
   static Stencil frame (Box b, Real thick, Real blot);
-  static Stencil slur (Bezier controls, Real cthick, Real thick);
-  static Stencil bezier_sandwich (Bezier top_curve, Bezier bottom_curve);
+  static Stencil slur (Bezier controls, Real cthick, Real thick, 
+                       SCM dash_definition);
+  static Stencil bezier_sandwich (Bezier top_curve, Bezier bottom_curve,
+                                  Real thickness);
   static Stencil beam (Real slope, Real width, Real thick, Real blot);
-  static Stencil dashed_slur (Bezier b, Real thick, Real dash_period, Real dash_fraction);
   static Stencil blank (Box b);
   static Stencil filled_box (Box b);
   static Stencil round_filled_box (Box b, Real blotdiameter);
index 24176326d3084e22f013a0b46fc49045e33c68a5..57dcb9271eab238fab161bb6362e97efde704a1f 100644 (file)
@@ -36,6 +36,7 @@ class Spanner : public Grob
 public:
   DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
   DECLARE_SCHEME_CALLBACK (bounds_width, (SCM));
+  DECLARE_SCHEME_CALLBACK (kill_zero_spanned_time, (SCM));
 
   vector<Spanner*> broken_intos_;
 
index b19151987f012dd9c046be13d1a54b3b73806bc3..2e6eb1b8512d3cbae56320a1b563cf45d2da975f 100644 (file)
@@ -13,7 +13,6 @@
 #include "item.hh"
 #include "lily-proto.hh"
 #include "line-interface.hh"
-#include "moment.hh"
 #include "output-def.hh"
 #include "pointer-group-interface.hh"
 #include "spanner.hh"
@@ -26,7 +25,6 @@ class Line_spanner
 {
 public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_left_bound_info, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_left_bound_info_and_text, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_right_bound_info, (SCM));
@@ -212,28 +210,8 @@ Line_spanner::print (SCM smob)
 {
   Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
 
-  Interval_t<Moment> moments = me->spanned_time ();
-  /*
-    We remove the line at the start of the line.  For piano voice
-    indicators, it makes no sense to have them at the start of the
-    line.
-
-    I'm not sure what the official rules for glissandi are, but
-    usually the 2nd note of the glissando is "exact", so when playing
-    from the start of the line, there is no need to glide.
-
-    From a typographical p.o.v. this makes sense, since the amount of
-    space left of a note at the start of a line is very small.
-
-    --hwn.
-
-  */
-  if (moments.length () == Moment (0,0))
-    return SCM_EOL;
-  
   Drul_array<SCM> bounds (me->get_property ("left-bound-info"),
                          me->get_property ("right-bound-info"));
-
   
   Grob *commonx = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
   commonx = me->common_refpoint (commonx, X_AXIS);
index 014d2ec8aba399a8552c621cae16c6a296bf2240..f856fa5be931541b95a2a6e1828759826d8d7e2b 100644 (file)
@@ -86,28 +86,6 @@ Lookup::beam (Real slope, Real width, Real thick, Real blot)
   return Stencil (b, expr);
 }
 
-Stencil
-Lookup::dashed_slur (Bezier b, Real thick, Real dash_period, Real dash_fraction)
-{
-  SCM l = SCM_EOL;
-
-  Real on = dash_fraction * dash_period;
-  Real off = dash_period - on;
-
-  for (int i = 4; i--;)
-    l = scm_cons (ly_offset2scm (b.control_[i]), l);
-
-  SCM at = (scm_list_n (ly_symbol2scm ("dashed-slur"),
-                       scm_from_double (thick),
-                       scm_from_double (on),
-                       scm_from_double (off),
-                       ly_quote_scm (l),
-                       SCM_UNDEFINED));
-
-  Box box (b.extent (X_AXIS), b.extent (Y_AXIS));
-  return Stencil (box, at);
-}
-
 Stencil
 Lookup::rotated_box (Real slope, Real width, Real thick, Real blot)
 {
@@ -365,47 +343,84 @@ Lookup::frame (Box b, Real thick, Real blot)
   Make a smooth curve along the points
 */
 Stencil
-Lookup::slur (Bezier curve, Real curvethick, Real linethick)
+Lookup::slur (Bezier curve, Real curvethick, Real linethick,
+              SCM dash_details)
 {
+  Stencil return_value;
+
+  /* calculate the offset for the two beziers that make the sandwich
+   *   for the slur
+  */
   Real alpha = (curve.control_[3] - curve.control_[0]).arg ();
   Bezier back = curve;
   Offset perp = curvethick * complex_exp (Offset (0, alpha + M_PI / 2)) * 0.5;
-  back.reverse ();
   back.control_[1] += perp;
   back.control_[2] += perp;
 
   curve.control_[1] -= perp;
   curve.control_[2] -= perp;
-
-  SCM scontrols[8];
-
-  for (int i = 0; i < 4; i++)
-    scontrols[i] = ly_offset2scm (back.control_[i]);
-  for (int i = 0; i < 4; i++)
-    scontrols[i + 4] = ly_offset2scm (curve.control_[i]);
-
-  /*
-    Need the weird order b.o. the way PS want its arguments
-  */
-  int indices[] = {5, 6, 7, 4, 1, 2, 3, 0};
-  SCM list = SCM_EOL;
-  for (int i = 8; i--;)
-    list = scm_cons (scontrols[indices[i]], list);
-
-  SCM at = (scm_list_n (ly_symbol2scm ("bezier-sandwich"),
-                       ly_quote_scm (list),
-                       scm_from_double (linethick),
-                       SCM_UNDEFINED));
-  Box b (curve.extent (X_AXIS),
-        curve.extent (Y_AXIS));
-
-  b[X_AXIS].unite (back.extent (X_AXIS));
-  b[Y_AXIS].unite (back.extent (Y_AXIS));
-
-  b.widen (0.5 * linethick, 0.5 * linethick);
-  return Stencil (b, at);
+/*  Bezier test1, test2, test3, test4;
+  test1 = back.extract(0., 1.0) ;
+  test2 = curve.extract (0., 1.0);
+  test3 = back.extract(0.0, 0.2);
+  test4 = curve.extract (0.0, 0.2);
+  return_value = bezier_sandwich (test1, test2, linethick);
+//  return_value.add_stencil (
+//      bezier_sandwich (test3, test4, linethick));
+  return return_value; */
+
+  if ((dash_details == SCM_UNDEFINED) || (dash_details == SCM_EOL))
+    { /* solid slur  */
+      return_value = bezier_sandwich (back, curve, linethick);
+    }
+  else
+    { /* dashed or combination slur */
+      int num_segments = scm_to_int (scm_length (dash_details));
+      for (int i=0; i<num_segments; i++)
+        {
+          SCM dash_pattern = scm_list_ref (dash_details, scm_from_int (i));
+          Real t_min = robust_scm2double (scm_car (dash_pattern), 0);
+          Real t_max = robust_scm2double (scm_cadr (dash_pattern), 1.0);
+          Real dash_fraction = 
+            robust_scm2double (scm_caddr (dash_pattern), 1.0);
+          Real dash_period = 
+            robust_scm2double (scm_cadddr (dash_pattern), 0.75);
+          Bezier back_segment = back.extract (t_min, t_max);
+          Bezier curve_segment = curve.extract (t_min, t_max);
+          if (dash_fraction == 1.0) 
+            {
+              return_value.add_stencil (bezier_sandwich (back_segment,
+                                                         curve_segment,
+                                                         linethick));
+            }
+          else
+            {
+              Bezier back_dash, curve_dash;
+              Real seg_length = (back_segment.control_[3] - 
+                                 back_segment.control_[0]).length ();
+              int pattern_count = seg_length / dash_period;
+              Real pattern_length = 1.0 / (pattern_count + dash_fraction);
+              Real start_t, end_t;
+              for (int p = 0; p <= pattern_count; p++)
+                {
+                  start_t = p * pattern_length;
+                  end_t = (p + dash_fraction) * pattern_length;
+                  back_dash = 
+                    back_segment.extract (start_t, end_t);
+                  curve_dash =
+                    curve_segment.extract (start_t, end_t);
+                  return_value.add_stencil (bezier_sandwich (back_dash,
+                                                             curve_dash,
+                                                             linethick));
+                }
+            }
+        }/* end for num_segments */
+    }/* end dashed or combination slur */
+  return return_value;
 }
 
+
 /*
  * Bezier Sandwich:
  *
@@ -430,7 +445,7 @@ Lookup::slur (Bezier curve, Real curvethick, Real linethick)
  *
  */
 Stencil
-Lookup::bezier_sandwich (Bezier top_curve, Bezier bottom_curve)
+Lookup::bezier_sandwich (Bezier top_curve, Bezier bottom_curve, Real thickness)
 {
   /*
     Need the weird order b.o. the way PS want its arguments
@@ -447,7 +462,7 @@ Lookup::bezier_sandwich (Bezier top_curve, Bezier bottom_curve)
 
   SCM horizontal_bend = scm_list_n (ly_symbol2scm ("bezier-sandwich"),
                                    ly_quote_scm (list),
-                                   scm_from_double (0.0),
+                                   scm_from_double (thickness),
                                    SCM_UNDEFINED);
 
   Interval x_extent = top_curve.extent (X_AXIS);
@@ -456,6 +471,7 @@ Lookup::bezier_sandwich (Bezier top_curve, Bezier bottom_curve)
   y_extent.unite (bottom_curve.extent (Y_AXIS));
   Box b (x_extent, y_extent);
 
+  b.widen (0.5 * thickness, 0.5 * thickness);
   return Stencil (b, horizontal_bend);
 }
 
index 1cd7cd10e294cbbed8e1629261095df8a7eea7a1..8c249e4fab663f0ffcf70d131eaf1b978fe4782f 100644 (file)
@@ -252,6 +252,9 @@ New_fingering_engraver::position_scripts (SCM orientations,
          && unsmob_grob (ft.head_->get_object ("accidental-grob")))
        Side_position_interface::add_support (f,
                                              unsmob_grob (ft.head_->get_object ("accidental-grob")));
+      else if (unsmob_grob (ft.head_->get_object ("dot")))
+       Side_position_interface::add_support (f,
+                                             unsmob_grob (ft.head_->get_object ("dot")));
                                              
       Self_alignment_interface::set_align_self (f, Y_AXIS);
       Self_alignment_interface::set_center_parent (f, Y_AXIS);
index b1794ad4014828bff6b1c9b8f62f89b944d3e10a..7b0553124a6449dc016305c4fbe604cedeff3840 100644 (file)
@@ -119,15 +119,21 @@ Slur::print (SCM smob)
   Bezier one = get_curve (me);
   Stencil a;
 
-  SCM p = me->get_property ("dash-period");
-  SCM f = me->get_property ("dash-fraction");
-  if (scm_is_number (p) && scm_is_number (f))
-    a = Lookup::dashed_slur (one, line_thick, robust_scm2double (p, 1.0),
-                            robust_scm2double (f, 0));
-  else
+  SCM dash_definition = me->get_property ("dash-definition");
+//  SCM p = me->get_property ("dash-period");
+//  SCM f = me->get_property ("dash-fraction");
+//  SCM interval = me->get_property ("dash-interval");
+//  if (scm_is_number (p) && scm_is_number (f))
+//    a = Lookup::dashed_slur (one, line_thick, robust_scm2double (p, 1.0),
+//                          robust_scm2double (f, 0));
+//  else
     a = Lookup::slur (one,
                      get_grob_direction (me) * base_thick,
-                     line_thick);
+                     line_thick,
+                      dash_definition);
+//                      robust_scm2double (p, 1.0),
+//                      robust_scm2double (f, 0),
+//                      robust_scm2double (interval, 1));
 
 #if DEBUG_SLUR_SCORING
   SCM annotation = me->get_property ("annotation");
@@ -417,8 +423,7 @@ ADD_INTERFACE (Slur,
               "annotation "
               "avoid-slur "    /* UGH. */
               "control-points "
-              "dash-fraction "
-              "dash-period "
+               "dash-definition "
               "details "
               "direction "
               "eccentricity "
index 8533bc72fcbd1392b74aceb48e47085d770b3f53..12346042df772cbb88f0b4380470ba0a1fe14391 100644 (file)
@@ -6,15 +6,14 @@
   (c) 1996--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include "pointer-group-interface.hh"
 #include "libc-extension.hh"
-#include "paper-column.hh"
+#include "moment.hh"
 #include "paper-column.hh"
 #include "paper-score.hh"
+#include "pointer-group-interface.hh"
 #include "stencil.hh"
 #include "system.hh"
 #include "warn.hh"
-#include "moment.hh"
 
 Grob *
 Spanner::clone () const
@@ -78,9 +77,7 @@ Spanner::do_break_processing ()
       for (int a = X_AXIS; a < NO_AXES; a++)
        {
          if (Spanner *parent = dynamic_cast<Spanner *> (get_parent ((Axis)a)))
-           {
-             parent_rank_slice.intersect (parent->spanned_rank_interval ());
-           }
+           parent_rank_slice.intersect (parent->spanned_rank_interval ());
        }
   
       for (vsize i = 1; i < break_points.size (); i++)
@@ -118,7 +115,6 @@ Spanner::do_break_processing ()
          span->set_bound (RIGHT, bounds[RIGHT]);
 
          if (!bounds[LEFT]->get_system ()
-
              || !bounds[RIGHT]->get_system ()
              || bounds[LEFT]->get_system () != bounds[RIGHT]->get_system ())
            {
@@ -178,7 +174,7 @@ Spanner::spanned_time () const
 Item *
 Spanner::get_bound (Direction d) const
 {
-  return spanned_drul_ [d];
+  return spanned_drul_[d];
 }
 
 /*
@@ -209,7 +205,6 @@ Spanner::set_bound (Direction d, Grob *s)
 
     [maybe we should try keeping all columns alive?, and perhaps
     inherit position from their (non-)musical brother]
-
   */
   if (dynamic_cast<Paper_column *> (i))
     Pointer_group_interface::add_grob (i, ly_symbol2scm ("bounded-by-me"), this);
@@ -219,14 +214,13 @@ Spanner::Spanner (SCM s)
   : Grob (s)
 {
   break_index_ = 0;
-  spanned_drul_[LEFT] = 0;
-  spanned_drul_[RIGHT] = 0;
+  spanned_drul_.set (0, 0);
 }
 
 Spanner::Spanner (Spanner const &s)
   : Grob (s)
 {
-  spanned_drul_[LEFT] = spanned_drul_[RIGHT] = 0;
+  spanned_drul_.set (0, 0);
 }
 
 Real
@@ -254,7 +248,7 @@ Spanner::get_system () const
 Grob *
 Spanner::find_broken_piece (System *l) const
 {
-  vsize idx = binary_search (broken_intos_, (Spanner *)l, Spanner::less);
+  vsize idx = binary_search (broken_intos_, (Spanner *) l, Spanner::less);
   if (idx != VPOS)
     return broken_intos_ [idx];
   return 0;
@@ -412,7 +406,6 @@ Spanner::bounds_width (SCM grob)
 {
   Spanner *me = unsmob_spanner (grob);
 
-
   Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
 
   Interval w (me->get_bound (LEFT)->relative_coordinate (common, X_AXIS),
@@ -423,6 +416,33 @@ Spanner::bounds_width (SCM grob)
   return ly_interval2scm (w);
 }
 
+MAKE_SCHEME_CALLBACK (Spanner, kill_zero_spanned_time, 1);
+SCM
+Spanner::kill_zero_spanned_time (SCM grob)
+{
+  Spanner *me = unsmob_spanner (grob);
+  Interval_t<Moment> moments = me->spanned_time ();
+  /*
+    Remove the line or hairpin at the start of the line.  For
+    piano voice indicators, it makes no sense to have them at
+    the start of the line.
+
+    I'm not sure what the official rules for glissandi are, but
+    usually the 2nd note of the glissando is "exact", so when playing
+    from the start of the line, there is no need to glide.
+
+    From a typographical p.o.v. this makes sense, since the amount of
+    space left of a note at the start of a line is very small.
+
+    --hwn.
+
+  */
+  if (moments.length () == Moment (0, 0))
+    me->suicide ();
+
+  return SCM_UNSPECIFIED;
+}
+
 ADD_INTERFACE (Spanner,
               "Some objects are horizontally spanned between objects.  For"
               " example, slurs, beams, ties, etc.  These grobs form a subtype"
index 5c64db64940522c4427a21a868e17fdcc5b9ea8a..955076b6634c1500ef1cc3738aa50f324261d0c5 100644 (file)
@@ -265,17 +265,23 @@ Tie::print (SCM smob)
 
   Stencil a;
 
-  SCM p = me->get_property ("dash-period");
-  SCM f = me->get_property ("dash-fraction");
-  if (scm_is_number (p) && scm_is_number (f))
-    a = Lookup::dashed_slur (b,
-                            line_thick,
-                            robust_scm2double (p, 1.0),
-                            robust_scm2double (f, 0));
-  else
+  SCM dash_definition = me->get_property ("dash-definition");
+//  SCM p = me->get_property ("dash-period");
+//  SCM f = me->get_property ("dash-fraction");
+//  SCM interval = me->get_property ("dash-interval");
+//  if (scm_is_number (p) && scm_is_number (f))
+//    a = Lookup::dashed_slur (b,
+//                          line_thick,
+//                          robust_scm2double (p, 1.0),
+//                          robust_scm2double (f, 0));
+//  else
     a = Lookup::slur (b,
                      get_grob_direction (me) * base_thick,
-                     line_thick);
+                     line_thick,
+                      dash_definition);
+//                      robust_scm2double (p, 1.0),
+//                      robust_scm2double (f, 0),
+//                      robust_scm2double (interval, 1.0));
 
 #if DEBUG_TIE_SCORING
   SCM annotation = me->get_property ("annotation");
index 3a37fb5dce57b1dcc30f727a79a54d54f41fda3f..861e4352a8dff1ff62027fd1f63f6eb1fa18f2c0 100644 (file)
@@ -126,7 +126,7 @@ vaticana_brew_flexa (Grob *me,
   if (solid)
     {
       Stencil solid_head
-       = Lookup::bezier_sandwich (top_curve, bottom_curve);
+       = Lookup::bezier_sandwich (top_curve, bottom_curve, 0.0);
       stencil.add_stencil (solid_head);
     }
   else // outline
@@ -134,13 +134,13 @@ vaticana_brew_flexa (Grob *me,
       Bezier inner_top_curve = top_curve;
       inner_top_curve.translate (Offset (0.0, -line_thickness));
       Stencil top_edge
-       = Lookup::bezier_sandwich (top_curve, inner_top_curve);
+       = Lookup::bezier_sandwich (top_curve, inner_top_curve, 0.0);
       stencil.add_stencil (top_edge);
 
       Bezier inner_bottom_curve = bottom_curve;
       inner_bottom_curve.translate (Offset (0.0, +line_thickness));
       Stencil bottom_edge
-       = Lookup::bezier_sandwich (bottom_curve, inner_bottom_curve);
+       = Lookup::bezier_sandwich (bottom_curve, inner_bottom_curve, 0.0);
       stencil.add_stencil (bottom_edge);
 
       /*
index 815b704417103aaf559738f7084058f57f5592a4..fdcc248d34e5886f192293fe52c39e28e4adfdc2 100644 (file)
 %
 \storePredefinedDiagram \chordmode {d} 
                         #guitar-tuning 
-                        #"x;x;o;2-1;3-2;2-3;"  
+                        #"x;x;o;2-1;3-3;2-2;"  
 \storePredefinedDiagram \chordmode {d:m} 
                         #guitar-tuning 
                         #"x;x;o;2-2;3-3;1-1;"  
index 2d50a6c6019569271214b6c1ca09e0acada8552d..184c317d76b7f72866b12a9499d73510f5a3e710 100644 (file)
@@ -11,16 +11,21 @@ slurDown = \override Slur #'direction = #DOWN
 slurNeutral = \revert Slur #'direction
 
 slurDashed = {
-  \override Slur #'dash-period = #0.75
-  \override Slur #'dash-fraction = #0.4
+  \override Slur #'dash-definition =  #'((0 1 0.4 0.75))
 }
 slurDotted = {
-  \override Slur #'dash-period = #0.75
-  \override Slur #'dash-fraction = #0.1
+  \override Slur #'dash-definition =  #'((0 1 0.1 0.75))
+}
+slurHalfDashed = {
+  \override Slur #'dash-definition =  #'((0 0.5 0.4 0.75)
+                                         (0.5 1 1 1))
+}
+slurHalfSolid = {
+  \override Slur #'dash-definition =  #'((0 0.5 1 1)
+                                         (0.5 1 0.4 0.75))
 }
 slurSolid = {
-  \revert Slur #'dash-period
-  \revert Slur #'dash-fraction
+  \revert Slur #'dash-definition
 }
 
 
@@ -29,16 +34,21 @@ phrasingSlurDown = \override PhrasingSlur #'direction = #DOWN
 phrasingSlurNeutral = \revert PhrasingSlur #'direction
 
 phrasingSlurDashed = {
-  \override PhrasingSlur #'dash-period = #0.75
-  \override PhrasingSlur #'dash-fraction = #0.4
+  \override PhrasingSlur #'dash-definition =  #'((0 1 0.4 0.75))
 }
 phrasingSlurDotted = {
-  \override PhrasingSlur #'dash-period = #0.75
-  \override PhrasingSlur #'dash-fraction = #0.1
+  \override PhrasingSlur #'dash-definition =  #'((0 1 0.1 0.75))
+}
+phrasingSlurHalfDashed = {
+  \override PhrasingSlur #'dash-definition =  #'((0 0.5 0.4 0.75)
+                                                 (0.5 1 1 1))
+}
+phrasingSlurHalfSolid = {
+  \override PhrasingSlur #'dash-definition =  #'((0 0.5 1 1)
+                                                 (0.5 1 0.4 0.75))
 }
 phrasingSlurSolid = {
-  \revert PhrasingSlur #'dash-period
-  \revert PhrasingSlur #'dash-fraction
+  \revert PhrasingSlur #'dash-definition
 }
 
 mergeDifferentlyDottedOn = {
index 72479a952f27d98de986e7ab573aaf87d40630c8..2a70225232b2c5fd9c8e69d74ec3f42e740f37ec 100644 (file)
@@ -2891,12 +2891,19 @@ longer in reversed order.\n"))
     return str
 
 @rule ((2, 13, 1),
-       _ ("\\bar \".\" now produces a thick barline"))
+       _ ("\\bar \".\" now produces a thick barline\n\
+ly:hairpin::after-line-breaking -> ly:spanner::kill-zero-spanned-time\n\
+Dash parameters for slurs and ties are now in dash-definition"))
 def conv(str):
     if re.search(r'\\bar\s*"."', str):
         stderr_write ("\n")
         stderr_write (NOT_SMART % _("\\bar \".\" now produces a thick barline.\n"))
         stderr_write (UPDATE_MANUALLY)
+    str = re.sub (r'ly:hairpin::after-line-breaking', r'ly:spanner::kill-zero-spanned-time', str)
+    if (re.search(r'\'dash-fraction', str) or re.search(r'\'dash-period', str):
+        stderr_write ("\n")
+        stderr_write (NOT_SMART % _("Dash parameters for slurs and ties are now in \'dash-details.\n"))
+        stderr_write (UPDATE_MANUALLY)
     return str
 
 # Guidelines to write rules (please keep this at the end of this file)
index 38e7d93d30ef77324be861549c506e81056913cf..8d166a4d235e399c9c4efc6cbd4aff1c292645c8 100644 (file)
@@ -171,6 +171,9 @@ this should list the control points of a third-order B@'ezier curve.")
 ;; d
 ;;
      (damping ,number? "Amount of beam slope damping.")
+     (dash-definition ,pair? "List of @code{dash-elements} defining the 
+dash structure.  Each @code{dash-element} has a starting t value,
+an ending t-value, a @code{dash-fraction}, and a @code{dash-period}.")
      (dash-fraction ,number? "Size of the dashes, relative to
 @code{dash-period}.  Should be between @code{0.0} (no line) and
 @code{1.0} (continuous line).")
index 97f36809b893f296b2c06bf05c0eb0890e5e163a..f8945f99ba98044186fc35b39763304f3df4fe89 100644 (file)
                                   (padding . 1.5)
                                      ))
                          ))
+       (after-line-breaking . ,ly:spanner::kill-zero-spanned-time)
        (stencil . ,ly:line-spanner::print)
        (left-bound-info . ,ly:line-spanner::calc-left-bound-info)
        (right-bound-info . ,ly:line-spanner::calc-right-bound-info)
      . (
        (stencil . ,ly:hairpin::print)
        (springs-and-rods . ,ly:spanner::set-spacing-rods)
-       (after-line-breaking . ,ly:hairpin::after-line-breaking)
+       (after-line-breaking . ,ly:spanner::kill-zero-spanned-time)
        (grow-direction . ,hairpin::calc-grow-direction)
        (circled-tip . #f)
        (to-barline . #t)
                          ))
        
        (stencil . ,ly:line-spanner::print)
-
+       (after-line-breaking . ,ly:spanner::kill-zero-spanned-time)
        (style . trill)
        (staff-padding . 1.0)
        (padding . 0.5)
                                   (padding . 1.5)
                                      ))
                          ))
+       (after-line-breaking . ,ly:spanner::kill-zero-spanned-time)
        (stencil . ,ly:line-spanner::print)
        (left-bound-info . ,ly:line-spanner::calc-left-bound-info)
        (right-bound-info . ,ly:line-spanner::calc-right-bound-info)
index cb0619f6deae2e726b0b0e28d90062fbbc4123e3..2e72a23272eaf51b82ee1d317aace18602cb44d0 100755 (executable)
@@ -170,7 +170,7 @@ sys.stderr.write ('''
 
 Unsafe files printed in lsr-unsafe.txt: CHECK MANUALLY!
   git add input/lsr/*.ly
-  xargs git-diff HEAD < lsr-unsafe.txt
+  xargs git diff HEAD < lsr-unsafe.txt
 
 ''')