]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.5.43
authorfred <fred>
Wed, 27 Mar 2002 02:47:28 +0000 (02:47 +0000)
committerfred <fred>
Wed, 27 Mar 2002 02:47:28 +0000 (02:47 +0000)
Documentation/user/refman.itely
input/test/pedal.ly [new file with mode: 0644]
lily/piano-pedal-engraver.cc
lily/text-spanner.cc
lilypond-font-lock.el

index 13eb20e0a4bbcc66a66c08e1fd32727e5ab66310..ec472a3fd43e5fe46100a3ea5c3cb1bb59423843 100644 (file)
@@ -1948,7 +1948,7 @@ c''4 \spanrequest \stop "Sustain"
 The symbols that are printed can be modified by setting
 @code{pedal@var{X}Strings}, where @var{X} is one of the pedal types:
 Sustain, Sostenuto or UnaCorda.  Refer to the generated documentation of
-@rgrob{PianoPedal} for more information.
+@rgrob{SustainPedal}, for example, for more information.
 
 Pedals can also be indicated by a sequence of brackets, by setting the 
 @code{pedal-type} property of SustainPedal grobs: 
@@ -1967,13 +1967,25 @@ c''4 \sustainDown d''4 e''4 c'4 \sustainUp \sustainDown f'4 g'4 a'4 \sustainUp
 @end lilypond
 
 The default '*Ped' style for sustain and damper pedals corresponds to
-@code{\pedal-type = #'text}. However @code{mixed} is the default style
+@code{\pedal-type = #'text}. However, @code{mixed} is the default style
 for a sostenuto pedal:
 
 @lilypond[fragment,verbatim]
 c''4 \sostenutoDown d''4 e''4 c'4 f'4 g'4 a'4 \sostenutoUp
 @end lilypond
 
+For fine-tuning of the appearance of a pedal bracket, the properties
+@code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
+@code{PianoPedalBracket} grobs (see the detailed documentation of
+@rgrob{PianoPedalBracket}) can be modified.  For example, the bracket
+may be extended to the end of the note head.
+
+@lilypond[fragment,verbatim]
+\property Staff.PianoPedalBracket \override #'shorten-pair = #'(0 . -1.0)
+c''4 \sostenutoDown d''4 e''4 c'4 f'4 g'4 a'4 \sostenutoUp
+@end lilypond
+
+
 
 @c .   {Arpeggio}
 @node Arpeggio
diff --git a/input/test/pedal.ly b/input/test/pedal.ly
new file mode 100644 (file)
index 0000000..3c5559e
--- /dev/null
@@ -0,0 +1,39 @@
+\version "1.5.43"
+\header{
+    texidoc = "Piano pedal symbols merge stop and start.  The strings are configurable. 
+Text style, bracket style, and a mixture of both are supported.  "
+}
+
+
+
+
+\score{
+    \context Staff \notes\relative c'{
+
+       c4 d e f g
+       \sustainDown b c
+       c, [d16  c  c c] [e e \sustainUp \sustainDown e e ] f4 \sustainUp 
+       g\sustainDown  b \sustainUp c 
+       \property Staff.pedalSustainStrings = #'("-" "-P" "P")
+       \property Staff.SustainPedal \override #'padding = #-2
+       c, \sustainDown d e \sustainUp \sustainDown f
+       \sustainUp g b c
+
+       \property Staff.SustainPedal \override #'pedal-type = #'bracket
+
+       c4 d e \sustainDown b c c, \sustainUp \sustainDown [d8 c] [e8 e \sustainUp \sustainDown] f4 d
+       \sustainUp g \sustainDown b b, \sustainUp c'
+
+       \property Staff.UnaCordaPedal \override #'pedal-type = #'mixed
+
+       c4 d \unaCorda e f g
+       b \treCorde c
+
+
+    }
+    \paper{
+    }
+    \midi{
+       \tempo 4 = 60
+    }
+}
index 2570e2807595f6c73eecb5e4f311c924a11c4c44..5c9ca83d6399a47149274195b9673a46d2ceb37e 100644 (file)
@@ -291,8 +291,8 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, SCM pedaltype)
 
       p->bracket_p_->set_bound (RIGHT, unsmob_grob(get_property ("currentMusicalColumn")));
 
-      // Set a property so that the molecule-creating function will know whether the right edge should be angled ___/
-      p->bracket_p_->set_grob_property("angle-right", gh_bool2scm((bool) p->req_l_drul_[START]) );
+      // Set a property so that the molecule-creating function will know whether the right edge should be flared ___/
+      p->bracket_p_->set_grob_property("right-widen", gh_bool2scm((bool) p->req_l_drul_[START]) );
       add_bound_item (p->line_spanner_, p->bracket_p_->get_bound (RIGHT));       
 
       p->finished_bracket_p_ = p->bracket_p_;
@@ -309,8 +309,8 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, SCM pedaltype)
       p->bracket_p_  = new Spanner (get_property ("PianoPedalBracket"));
       p->bracket_p_->set_interface (ly_symbol2scm ("piano-pedal-interface"));
 
-      // Set a property so that the molecule-creating function will know whether the left edge should be angled \___
-      p->bracket_p_->set_grob_property("angle-left", gh_bool2scm((bool) p->req_l_drul_[STOP]) );
+      // Set a property so that the molecule-creating function will know whether the left edge should be flared \___
+      p->bracket_p_->set_grob_property("left-widen", gh_bool2scm((bool) p->req_l_drul_[STOP]) );
 
       // Set this property for 'mixed style' pedals,    Ped._______/\ ,  
       // so the molecule function will shorten the ____ line by the length of the Ped. text. 
@@ -321,8 +321,6 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, SCM pedaltype)
       if (p->item_p_)
        p->bracket_p_->set_parent (p->item_p_, Y_AXIS);
       
-      Side_position_interface::set_axis (p->bracket_p_, Y_AXIS);
-      Side_position_interface::set_direction (p->bracket_p_, UP);
       p->bracket_p_->set_bound (LEFT, unsmob_grob (get_property ("currentMusicalColumn")));
       Axis_group_interface::add_element (p->line_spanner_, p->bracket_p_);           
 
index 127de061a356e6d738e68920da7d5d3249ccfab4..554bc1d1f45e22fe960b41022e4be138ed8ceb50 100644 (file)
@@ -181,8 +181,6 @@ Text_spanner::brew_molecule (SCM smob)
    Pedal up-down (restart) indicated by the angled right and left edges 
    of consecutive pedals touching exactly to form an __/\__
    Chris Jackson <chris@fluffhouse.org.uk>
-
-   TODO: Pedal line extending to the end of the note
 */
 
 void 
@@ -190,31 +188,31 @@ Text_spanner::setup_pedal_bracket(Spanner *s)
 {
 
   Real thick = s->paper_l ()->get_var ("stafflinethickness");  
-  Real ss = Staff_symbol_referencer::staff_space (s);
 
-  Drul_array<bool> a, broken;
+  Drul_array<bool> w, broken;
   Drul_array<Real> height, width, shorten, r;
 
+  SCM pa = s->get_grob_property ("if-text-padding");
+  SCM ew = s->get_grob_property ("edge-width");
+  SCM eh = s->get_grob_property ("edge-height");
+  SCM sp = s->get_grob_property ("shorten-pair");
+  SCM wl = s->get_grob_property ("left-widen");
+  SCM wr = s->get_grob_property ("right-widen");
+
   // Pedal has an angled left edge \__  or an angled right edge __/ 
-  a[LEFT] = a[RIGHT] = false;
-  SCM al = s->get_grob_property ("angle-left");
-  SCM ar = s->get_grob_property ("angle-right");
-  if (gh_boolean_p (al) )  
-    a[LEFT]   = to_boolean (al);
-  if (gh_boolean_p (ar) )  
-    a[RIGHT]  = to_boolean (ar);
-  
-  height[LEFT] = ( to_boolean (s->get_grob_property ("text-start")) ?
-                  0 :
-                  ss );
-  height[RIGHT] = ss;
+  w[LEFT] = w[RIGHT] = false;
+  if (gh_boolean_p (wl) )  
+    w[LEFT]   = to_boolean (wl);
+  if (gh_boolean_p (wr) )  
+    w[RIGHT]  = to_boolean (wr);
   
   Direction d = LEFT;
   Interval e;
   Real padding = 0;
-  SCM pa = (s->get_grob_property ("if-text-padding"));
+
   if (gh_number_p (pa) )
     padding = gh_scm2double (pa);
+
   do {
     Item *b = s->get_bound (d);
 
@@ -223,18 +221,24 @@ Text_spanner::setup_pedal_bracket(Spanner *s)
       r[d] = d * (e[-d] + padding);
 
     broken[d] = b->break_status_dir () != CENTER;
-    width[d]  = (a[d]  ? ss*d/2 :  0);
-    if (broken[d])
-      height[d] =  0;
+    width[d]  =  0;
+    height[d] =  0;
+    shorten[d] = 0;
+    if ( w[d] && gh_pair_p (ew) )
+      width[d] +=  gh_scm2double (index_cell (ew, d)) * d;
+    if ( !broken[d] && (gh_pair_p (eh) ) )
+      height[d] = gh_scm2double (index_cell (eh, d));
+    if ( gh_pair_p (sp) )
+      shorten[d] =  gh_scm2double (index_cell (sp, d));
   }
   while (flip (&d) != LEFT);
   
-  shorten[RIGHT] =  shorten[LEFT]  =  0;
   Real extra_short = 0;
   // For 'Mixed' style pedals, i.e.  a bracket preceded by text:  Ped._____|
   // need to shorten by the extent of the text grob
   if ( to_boolean (s->get_grob_property ("text-start")) )
     {
+      height[LEFT] = 0;
       Grob * textbit = s->get_parent(Y_AXIS);
       extra_short = padding;
       if (textbit->has_interface(ly_symbol2scm("piano-pedal-interface")))
@@ -267,10 +271,6 @@ Text_spanner::setup_pedal_bracket(Spanner *s)
     // Shorten bracket on the right so it ends just before the spanned note.
     shorten[RIGHT]  +=  thick  -  (r[LEFT]  +  r[RIGHT]);
 
-  // Hmm. TODO: This should be set in grob-description.scm, but side-positioning
-  // of consecutive brackets only seems to work if direction is +1 within the engraver. 
-  s->set_grob_property ("direction", gh_int2scm(-1)); 
-
   s->set_grob_property ("edge-height", gh_cons ( gh_double2scm ( height[LEFT] ) , 
                                                 gh_double2scm ( height[RIGHT]) ) );
   s->set_grob_property ("edge-width",  gh_cons ( gh_double2scm ( width[LEFT]  ), 
index 4a09294c56a41af73aff863feb981ee13ed92500..a678a121fdbc9586efb06f3d82766cc15ae27151 100644 (file)
           (lambda (x) (modify-syntax-entry
                        (car x) (cdr x) LilyPond-mode-syntax-table)))
          '(( ?\( . "." ) ( ?\) . "." ) 
-           ( ?\[ . "." ) ( ?\] . "." )
+           ( ?\[ . "(]" ) ( ?\] . ")[" )
            ( ?\{  .  "(}2b" )
            ( ?\}  .  "){4b" )
            ( ?\< . "." )( ?\> . ".")