]> git.donarmstrong.com Git - lilypond.git/commitdiff
Support tablature slides.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 12 Dec 2006 13:40:02 +0000 (14:40 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 12 Dec 2006 13:40:02 +0000 (14:40 +0100)
Do this by adding 'extra-dy property for line-spanner.

lily/glissando-engraver.cc
lily/line-spanner.cc
ly/engraver-init.ly
scm/define-grob-properties.scm
scm/lily.scm

index 91dd733cb8cac7badc37e4d80d523fe3312ab005..4c506df38d14efc8d4e9e47cdc327bea35a8f72e 100644 (file)
@@ -73,6 +73,7 @@ Glissando_engraver::stop_translation_timestep ()
 {
   if (last_line_ && last_line_->get_bound (RIGHT))
     last_line_ = 0;
+
   if (line_)
     {
       if (last_line_)
index 48d4b3aa9b5aab0757cf8faac4bd9be6c135eef3..2f99a0dce2fcfad53815a1eacbc4a113c0c91d57 100644 (file)
@@ -205,6 +205,9 @@ Line_spanner::print (SCM smob)
   Offset my_off;
   Offset his_off;
 
+  Real extra_dy = robust_scm2double (me->get_property ("extra-dy"),
+                                    0.0);
+  
   if (bound[RIGHT]->break_status_dir ())
     {
       if (bound[LEFT]->break_status_dir ())
@@ -247,11 +250,11 @@ Line_spanner::print (SCM smob)
       Real yoff = this_common_y->relative_coordinate (all_common_y, Y_AXIS);
 
       Offset p1 (bound[LEFT]->extent (commonx, X_AXIS)[RIGHT],
-                this_ext.center () + yoff);
+                this_ext.center () + yoff - extra_dy / 2);
       Offset p2 (bound[RIGHT]->extent (commonx, X_AXIS)[LEFT],
-                next_ext.center () + yoff);
+                next_ext.center () + yoff + extra_dy / 2);
 
-      Offset dz (p2 -p1);
+      Offset dz (p2 - p1);
       Real len = dz.length ();
 
       Offset dir = dz * (1 / len);
@@ -288,13 +291,15 @@ Line_spanner::print (SCM smob)
          his_off[ax] = bound[LEFT]->relative_coordinate (common[a], ax);
        }
 
-      ofxy = dxy * (off / dxy.length ());
+      ofxy = dxy * (off / dxy.length ()) ;
       dxy -= 2*ofxy;
 
+      dxy[Y_AXIS] += extra_dy;
+      
       Stencil line = line_stencil (me, Offset (0, 0), dxy);
 
       line.translate_axis (bound[LEFT]->extent (bound[LEFT], X_AXIS).length () / 2, X_AXIS);
-      line.translate (ofxy - my_off + his_off);
+      line.translate (ofxy - my_off + his_off + Offset (0, -extra_dy/2));
       return line.smobbed_copy ();
     }
 }
@@ -305,7 +310,8 @@ ADD_INTERFACE (Line_spanner,
               "@code{dashed-line}, @code{trill}, \n"
               "@code{dotted-line} or @code{zigzag}.\n"
               "\n",
-              
+
+              "extra-dy "
               "arrow "
               "gap "
               "thickness "
index 938a0c856e0cb1a666f62f90619080a8ed9c2fd3..afb0be2dc4b663d43f0f6b9742e4e924a06d0f0a 100644 (file)
@@ -654,7 +654,7 @@ AncientRemoveEmptyStaffContext = \context {
   \alias "Voice"
   \consists "Tab_note_heads_engraver"
   \consists "Tab_harmonic_engraver"
-
+  
   \remove "Note_heads_engraver"
   \remove "Fingering_engraver"
   \remove "New_fingering_engraver"
@@ -669,6 +669,8 @@ AncientRemoveEmptyStaffContext = \context {
 
   %% No accidental in tablature !
   \remove Accidental_engraver
+
+  \override Glissando #'extra-dy = #0.75
 }
 
 \context {
index 9d0d665b88b296768033835c256e9f75e9f1b038..24f1fe0a2be4ff1e7611a1c976a901cffb3621a4 100644 (file)
@@ -136,7 +136,8 @@ edges '(@var{left-text} . @var{right-text}).")
                     "How much of the bound a spanner should enclose:
 +1 = completely, 0 = center, -1 not at all.")
      (expand-limit ,integer? "maximum number of measures expanded in church rests.")
-     ;; remove me? 
+     ;; remove me?
+     (extra-dy ,number? "Slope glissandi this much extra.")
      (extra-X-extent ,number-pair? "A grob is enlarged in X dimension
 by this much.")
      (extra-Y-extent ,number-pair? "See @code{extra-X-extent}.")
index 32ab98e88e2a486b72c88d054380da72f3e9063b..d64fd57f4e11327109cfc2bc0d8024b546cec3fc 100644 (file)
@@ -106,6 +106,7 @@ on errors, and print a stack trace.")
 
 (if (ly:get-option 'verbose)
     (begin
+      (ly:set-option 'protected-scheme-parsing #f)
       (debug-enable 'debug)
       (debug-enable 'backtrace)
       (read-enable 'positions)))