]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/piano-pedal-engraver.cc
* lily/include/debug.hh: deprecate.
[lilypond.git] / lily / piano-pedal-engraver.cc
index 61d00a4e9601953bb21a3402d81585c6d8983ebb..666cda769e3ed5842da8d0428b15f60bab8ca075 100644 (file)
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+ (c) 2000--2002 Jan Nieuwenhuizen <janneke@gnu.org>
+  
+  Chris Jackson <chris@fluffhouse.org.uk> - extended to support
+  bracketed pedals.
+*/
 
 #include "engraver.hh"
 #include "musical-request.hh"
-#include "score-element.hh"
+#include "grob.hh"
 #include "item.hh"
-#include "lookup.hh"
 #include "lily-guile.hh"
-#include "note-head.hh"
-#include "stem.hh"
 #include "side-position-interface.hh"
 #include "staff-symbol-referencer.hh"
-#include "dictionary.hh"
-#include "dictionary-iter.hh"
-#include "text-item.hh"
-
-/*
-  Urg.
-  This is almost text
-  Problem is:
-    * we have no kerning
-    * symbols are at wrong place in font
-*/
+#include "item.hh"
+#include "axis-group-interface.hh"
+#include "translator-group.hh"
+#include "directional-element-interface.hh"
+#include "note-column.hh"
 
-class Sustain_pedal : public Item
+struct Pedal_info
 {
-public:
-  VIRTUAL_COPY_CONS (Score_element);
+  char const * name_;
+  Span_req* start_req_l_;
+  Drul_array<Span_req*> req_l_drul_;
+  Item* item_p_;
+  Spanner* bracket_p_;     // A single portion of a pedal bracket
+  Spanner* finished_bracket_p_;
 
-protected:
-  virtual Molecule do_brew_molecule () const;
-  virtual void after_line_breaking ();
+  /*
+    This grob contains all the pedals of the same type on the same staff
+   */
+  Spanner* line_spanner_;
+  Spanner* finished_line_spanner_;
+  Span_req* current_bracket_req_;
 };
 
-void
-Sustain_pedal::after_line_breaking ()
-{
-  Side_position_interface i (this);
-  Direction d =  i.get_direction ();
-  i.set_direction (d);
-}
 
-Molecule
-Sustain_pedal::do_brew_molecule () const
+class Piano_pedal_engraver : public Engraver
 {
-  Molecule mol;
-  SCM glyph = get_elt_property ("glyph");
-  if (glyph == SCM_UNDEFINED)
-    return mol;
-  String text = ly_scm2string (glyph);
-
-  for (int i = 0; i < text.length_i (); i++)
-    {
-      // leuke koor dump door tiepo, snapnie helemaal:
-      //String idx = ("pedal-") + text[i];
-      // urg, Byte* ??
-      // braak: waarom vindt String het zo moeilijk om
-      // String + char te doen?
-      //String idx = "pedal-" + String (&text.byte_C ()[i], 1);
-      String idx = String ("pedal-") + String (&text.byte_C ()[i], 1);
-      Molecule m = lookup_l ()->afm_find (idx);
-      if (m.empty_b ())
-       continue;
-      Real kern = 0;
-      if (i)
-       {
-         SCM s = scm_eval (gh_list (ly_symbol2scm ("pedal-kerning"),
-                                    ly_str02scm (String (&text.byte_C ()[i - 1], 1).ch_C ()),
-                                    ly_str02scm (String (&text.byte_C ()[i], 1).ch_C ()),
-                                    SCM_UNDEFINED));
-         if (gh_number_p (s))
-           {
-             Staff_symbol_referencer_interface st (this);
-             Real staff_space = st.staff_space ();
-             kern = gh_scm2double (s) * staff_space;
-           }
-       }
-      mol.add_at_edge (X_AXIS, RIGHT, m, kern);
-    }
-    
-  return mol;
-}
+public:
+  TRANSLATOR_DECLARATIONS (Piano_pedal_engraver);
+  ~Piano_pedal_engraver ();
+protected:
+  virtual void initialize ();
+  virtual void finalize ();
+  virtual bool try_music (Music*);
+  virtual void stop_translation_timestep ();
+  virtual void start_translation_timestep ();
+  virtual void acknowledge_grob (Grob_info);
+  virtual void process_acknowledged_grobs ();
 
+private:
 
+  Pedal_info *info_list_;
 
-/*
-   TODO:
-     * it would be real cool if an engraver could be initialised with a
-       string, ie:
-
-          Piano_pedal_engraver::"sostenuto"
-          Piano_pedal_engraver::"sustain"
-          Piano_pedal_engraver::"una-chorda"
- */
-
-/**
-   engrave Piano pedals
- */
-class Piano_pedal_engraver : public Engraver
-{
-  struct Pedal_info
-  {
-    Span_req* start_req_l_;
-    Drul_array<Span_req*> req_l_drul_;
-    Item* item_p_;
-  };
+  /*
+    Record a stack of the current pedal spanners, so if more than one pedal
+    occurs simultaneously then extra space can be added between them.
 
-public:
-  VIRTUAL_COPY_CONS (Translator);
-  Piano_pedal_engraver ();
 
-protected:
-  virtual bool do_try_music (Music*);
-  virtual void do_process_music ();
-  virtual void do_pre_move_processing ();
-  virtual void do_post_move_processing ();
-  virtual void acknowledge_element (Score_element_info);
+    Why 4, why not 3. Why not 3423 ?  ---hwn.
+  */
+  
+  Spanner *previous_p_ [4];
+  
+  int spanner_count_;
 
-private:
-  Dictionary<Pedal_info> info_dict_;
+  /*
+    Left and right flare widths of a \___/, as specified by the grob
+    property edge-widen.
+   */
+  Drul_array<SCM> edge_width_drul_;
+  
+  void create_text_grobs (Pedal_info *p, SCM pedaltype);
+  void create_bracket_grobs (Pedal_info *p, SCM pedaltype);
+  void typeset_all ();
 };
 
-ADD_THIS_TRANSLATOR (Piano_pedal_engraver);
 
 Piano_pedal_engraver::Piano_pedal_engraver ()
 {
-  (void)info_dict_["Sostenuto"];
-  (void)info_dict_["Sustain"];
-  (void)info_dict_["UnaChorda"];
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  info_list_ = 0;
+}
+
+void
+Piano_pedal_engraver::initialize ()
+{
+  info_list_ = new Pedal_info[4];
+  Pedal_info *p = info_list_;
+
+  spanner_count_ = 0;
+  for (int i = 0; i < 3; ++i)
+    previous_p_[i] = 0; 
+
+
+  char * names [] = { "Sostenuto", "Sustain", "UnaCorda", 0  };
+  char **np = names ;
+  do
     {
-      Pedal_info& p = i.val_ref ();
-      p.item_p_ = 0;
-      p.req_l_drul_[START] = 0;
-      p.req_l_drul_[STOP] = 0;
-      p.start_req_l_ = 0;
+      p->name_ = *np;
+      p->item_p_ = 0;
+      p->bracket_p_ = 0;
+      p->finished_bracket_p_ = 0;
+      p->line_spanner_ = 0;
+      p->finished_line_spanner_ = 0;
+      p->current_bracket_req_ = 0;
+      p->req_l_drul_[START] = 0;
+      p->req_l_drul_[STOP] = 0;
+      p->start_req_l_ = 0;
+
+      p++;
     }
+  while (* (np ++));
+}
+
+Piano_pedal_engraver::~Piano_pedal_engraver ()
+{
+  delete[] info_list_;
 }
 
 /*
-  Urg: Code dup
-  I'm a script
- */
+   Urg: Code dup
+   I'm a script
 */
 void
-Piano_pedal_engraver::acknowledge_element (Score_element_info info)
+Piano_pedal_engraver::acknowledge_grob (Grob_info info)
 {
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  for (Pedal_info*p = info_list_; p && p->name_; p ++)
     {
-      Pedal_info& p = i.val_ref ();
-      if (p.item_p_)
+      if (Note_column::has_interface (info.grob_l_))
        {
-         if (Note_head* n = dynamic_cast<Note_head*> (info.elem_l_))
-           {
-             Side_position_interface st (p.item_p_);
-             st.add_support (n);
-             if (st.get_axis( ) == X_AXIS
-                 && !p.item_p_->parent_l (Y_AXIS))
-               p.item_p_->set_parent (n, Y_AXIS);
-           }
-         if (Stem* s = dynamic_cast<Stem*> (info.elem_l_))
+         if (p->line_spanner_)
            {
-             Side_position_interface st (p.item_p_);
-             st.add_support (s);
-           }
+             Side_position_interface::add_support (p->line_spanner_, info.grob_l_);
+             
+             add_bound_item (p->line_spanner_,info.grob_l_);
+           }     
+         if (p->bracket_p_)
+           add_bound_item (p->bracket_p_,info.grob_l_);                  
+         
        }
     }
 }
 
 bool
-Piano_pedal_engraver::do_try_music (Music *m)
+Piano_pedal_engraver::try_music (Music *m)
 {
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  if (Span_req * s = dynamic_cast<Span_req*> (m))
     {
-      Pedal_info& p = i.val_ref ();
-      if (Span_req * s = dynamic_cast<Span_req*>(m))
+      for (Pedal_info*p = info_list_; p->name_; p ++)
        {
-         if (s->span_type_str_ == i.key ())
+         if (ly_scm2string (s->get_mus_property ("span-type")) == "abort")
+           {
+             p->req_l_drul_[START] = 0;
+             p->req_l_drul_[STOP] = 0;
+             
+             if (p->bracket_p_)
+               p->bracket_p_->suicide (); /* as in dynamic-engraver.cc */
+             p->bracket_p_ = 0;
+           }  
+         if (scm_equal_p (s->get_mus_property ("span-type"),
+                          ly_str02scm (p->name_))==SCM_BOOL_T)
            {
-             p.req_l_drul_[s->span_dir_] = s;
+             p->req_l_drul_[s->get_span_dir ()] = s;
              return true;
            }
        }
@@ -191,109 +175,339 @@ Piano_pedal_engraver::do_try_music (Music *m)
 }
 
 void
-Piano_pedal_engraver::do_process_music ()
+Piano_pedal_engraver::process_acknowledged_grobs ()
 {
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  for (Pedal_info*p = info_list_; p && p->name_; p ++)
     {
-      Pedal_info& p = i.val_ref ();
-      SCM s = SCM_UNDEFINED;
-      if (p.req_l_drul_[STOP] && p.req_l_drul_[START])
+      if (p->req_l_drul_[STOP] || p->req_l_drul_[START])
        {
-         if (!p.start_req_l_)
+         if (!p->line_spanner_)
            {
-             p.req_l_drul_[STOP]->warning (_f ("can't find start of piano pedal: %s", i.key ()));
+             String name  = String (p->name_) + "PedalLineSpanner";
+             p->line_spanner_ = new Spanner (get_property (name.ch_C ()));
+             Side_position_interface::set_axis (p->line_spanner_, Y_AXIS);
+             Music * rq = (p->req_l_drul_[START]  ?  p->req_l_drul_[START]  :  p->req_l_drul_[STOP]);
+             announce_grob (p->line_spanner_, rq->self_scm ());
            }
-         else
+      
+         /* Choose the appropriate grobs to add to the line spanner
+          These can be text items or text-spanners
+         */
+         SCM type = ly_cdr (scm_assoc (ly_symbol2scm ("pedal-type"), 
+                                       get_property ( (String (p->name_) + "Pedal").ch_C ())));
+         if (type == ly_symbol2scm ("text") ||      // Ped.     *Ped.  *
+             type == ly_symbol2scm ("mixed")  )    // Ped. _____/\____|
            {
-             s = get_property ("stopStart" + i.key ());
+             if (! p->item_p_)
+               create_text_grobs (p, type);
            }
-         p.start_req_l_ = p.req_l_drul_[START];
+         if (type == ly_symbol2scm ("bracket") ||   // |_________/\____|
+             type == ly_symbol2scm ("mixed")  )
+          {
+            create_bracket_grobs (p, type);
+          }
        }
-      else if (p.req_l_drul_[STOP])
+    }
+}
+
+
+void
+Piano_pedal_engraver::create_text_grobs (Pedal_info *p, SCM pedaltype)
+{
+  SCM b;
+  SCM s = SCM_EOL;
+  SCM strings = get_property ( ("pedal" + String (p->name_) + "Strings").ch_C ());
+
+  if (scm_ilength (strings) >= 3)
+    {
+      if (p->req_l_drul_[STOP] && p->req_l_drul_[START]) 
        {
-         if (!p.start_req_l_)
+         if (pedaltype == ly_symbol2scm ("text")) 
+           {
+             if (!p->start_req_l_)
+               {
+                 p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'",  p->name_));
+               }
+             else
+               {
+                 s = ly_cadr (strings);
+               }
+             p->start_req_l_ = p->req_l_drul_[START];
+           }
+       }
+      else if (p->req_l_drul_[STOP])
+       { 
+         if (pedaltype == ly_symbol2scm ("text"))
            {
-             p.req_l_drul_[STOP]->warning (_f ("can't find start of piano pedal: %s", i.key ()));
+             if (!p->start_req_l_)
+               {
+                 p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", p->name_));
+               }
+             else
+               {
+                 s = ly_caddr (strings);
+                 spanner_count_ --;
+               }
+             p->start_req_l_ = 0;
            }
-         else
+       }
+      else if (p->req_l_drul_[START])
+       {
+         p->start_req_l_ = p->req_l_drul_[START];
+         s = ly_car (strings);
+         if (pedaltype == ly_symbol2scm ("text"))
            {
-             s = get_property ("stop" + i.key ());
+             spanner_count_ ++;
+             previous_p_[spanner_count_] = p->line_spanner_;
+             if (spanner_count_ > 1)
+               // add extra space below the previous already-occuring pedal
+               Side_position_interface::add_support (p->line_spanner_,
+                                                    previous_p_[spanner_count_ - 1]);
            }
-         p.start_req_l_ = 0;
        }
-      else if (p.req_l_drul_[START])
+      
+      if (gh_string_p (s))
        {
-         p.start_req_l_ = p.req_l_drul_[START];
-         s = get_property ("start" + i.key ());
+         String propname = String (p->name_) + "Pedal";
+         b = get_property (propname.ch_C ());
+         p->item_p_ = new Item (b);
+         p->item_p_->set_grob_property ("text", s);
+         Axis_group_interface::add_element (p->line_spanner_, p->item_p_);
+         
+         announce_grob (p->item_p_,
+                        (p->req_l_drul_[START]
+                        ? p->req_l_drul_[START]
+                        : p->req_l_drul_[STOP])->self_scm ());
+         
        }
+      if (pedaltype == ly_symbol2scm ("text")) 
+       {
+         p->req_l_drul_[START] = 0;
+         p->req_l_drul_[STOP] = 0;
+       }
+    }
+}
 
-      if (s != SCM_UNDEFINED)
+void
+Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, SCM pedaltype)
+{
+
+  if (p->req_l_drul_[STOP])
+    {
+      if (!p->start_req_l_)
        {
-         if (i.key () == "Sustain")
-           {
-             p.item_p_ = new Sustain_pedal;
-             p.item_p_->set_elt_property ("glyph", s);
-           }
-         else
-           {
-             p.item_p_ = new Text_item;
-             p.item_p_->set_elt_property ("text", s);
-             // guh
-             p.item_p_->set_elt_property ("style", ly_str02scm ("italic"));
-           }
+         p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", p->name_));
+       }
+      else if (!p->req_l_drul_[START])
+       spanner_count_ -- ;
 
-         Side_position_interface si (p.item_p_);
-         si.set_axis (Y_AXIS);
+      assert (!p->finished_bracket_p_ && p->bracket_p_);
 
-         /* Hmm,
-            If set to empty, it can't be centred
-            Howto centre non-fat text?
-            p.item_p_->set_empty (X_AXIS);
-         */
-         p.item_p_->set_elt_property ("self-alignment-X", gh_int2scm (0));
-         p.item_p_->add_offset_callback (Side_position_interface::aligned_on_self, X_AXIS);
-         p.item_p_->add_offset_callback (Side_position_interface::centered_on_parent, X_AXIS);
-         announce_element (Score_element_info (p.item_p_,
-                                               p.req_l_drul_[START]
-                                               ? p.req_l_drul_[START]
-                                               : p.req_l_drul_[STOP]));
+      Grob *cmc = unsmob_grob (get_property ("currentMusicalColumn"));
+      p->bracket_p_->set_bound (RIGHT, cmc);
+
+      /*
+       Set properties so that the molecule-creating function will
+       know whether the right edge should be flared ___/
+       */
+      SCM eleft = ly_car (p->bracket_p_->get_grob_property ("edge-widen"));
+      SCM eright = (p->req_l_drul_[START]  ? edge_width_drul_[RIGHT] : gh_double2scm (0));
+      p->bracket_p_->set_grob_property ("edge-widen", gh_cons (eleft, eright));
+      
+      p->finished_bracket_p_ = p->bracket_p_;
+      p->bracket_p_ = 0;
+      p->current_bracket_req_ = 0;
+      p->start_req_l_ = p->req_l_drul_[START];
+    }
+
+  if (p->req_l_drul_[START])
+    {
+      p->start_req_l_ = p->req_l_drul_[START];
+      p->current_bracket_req_ = p->req_l_drul_[START];
+
+      p->bracket_p_  = new Spanner (get_property ("PianoPedalBracket"));
+
+      /*
+       Set properties so that the molecule-creating function will
+       know whether the left edge should be flared \___
+      */
+
+      SCM ew = p->bracket_p_->get_grob_property ("edge-widen");
+      edge_width_drul_[LEFT] =  ly_car (ew);
+      edge_width_drul_[RIGHT] = ly_cdr (ew);
+      
+      SCM eleft = ( (bool) p->req_l_drul_[STOP]  ? 
+                   edge_width_drul_[LEFT]  :
+                   gh_double2scm (0));
+      SCM eright = gh_double2scm (0);
+      p->bracket_p_->set_grob_property ("edge-widen", gh_cons (eleft, eright));
+
+      /* Set this property for 'mixed style' pedals,    Ped._______/\ ,  
+        so the molecule function will shorten the ____ line by the length of the Ped. text.
+      */
+      
+      p->bracket_p_->set_grob_property ("text-start", 
+                                      pedaltype == ly_symbol2scm ("mixed") ? 
+                                      gh_bool2scm ( (bool) ! p->req_l_drul_[STOP]) :
+                                      gh_bool2scm (false));
+
+      /*
+       Mixed style: Store a pointer to the preceding text for use in
+       calculating the length of the line 
+      */
+      if (p->item_p_)
+       p->bracket_p_->set_grob_property ("pedal-text", p->item_p_->self_scm ());
+      
+      p->bracket_p_->set_bound (LEFT, unsmob_grob (get_property ("currentMusicalColumn")));
+      Axis_group_interface::add_element (p->line_spanner_, p->bracket_p_);           
+
+      add_bound_item (p->line_spanner_, p->bracket_p_->get_bound (LEFT));
+      announce_grob (p->bracket_p_, p->req_l_drul_[START]->self_scm ());
+
+      if (!p->req_l_drul_[STOP])
+       {
+         spanner_count_ ++;
+         previous_p_[spanner_count_] = p->line_spanner_;       
+
+         if (spanner_count_ > 1) 
+           // position new pedal spanner below the current one
+           Side_position_interface::add_support (p->line_spanner_, previous_p_[spanner_count_ - 1]);
        }
     }
+
+  p->req_l_drul_[START] = 0;
+  p->req_l_drul_[STOP] = 0;
 }
 
 void
-Piano_pedal_engraver::do_pre_move_processing ()
+Piano_pedal_engraver::finalize ()
+{  
+  for (Pedal_info*p = info_list_; p && p->name_; p ++)
+    {
+      /*
+       suicide?
+       */
+      if (p->line_spanner_
+         && !p->line_spanner_->live())
+       p->line_spanner_ = 0;
+      
+      if (p->line_spanner_)
+       {
+         p->finished_line_spanner_ = p->line_spanner_;
+         typeset_all ();
+       }
+      if (p->bracket_p_
+         && !p->bracket_p_->live())
+       p->bracket_p_ = 0;
+      if (p->bracket_p_)
+       {
+         p->current_bracket_req_->origin ()->warning (_ ("unterminated pedal bracket"));
+         p->bracket_p_->suicide ();
+         p->bracket_p_ = 0;
+       }
+    }
+}
+
+  
+void
+Piano_pedal_engraver::stop_translation_timestep ()
+{
+  for (Pedal_info*p = info_list_; p && p->name_; p ++)
+    {
+      if (!p->bracket_p_)
+       {
+         p->finished_line_spanner_ = p->line_spanner_;
+         p->line_spanner_ = 0;
+       }
+    }
+  
+  typeset_all ();
+}
+
+
+void
+Piano_pedal_engraver::typeset_all ()
 {
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  Item * sustain = 0;
+  for (Pedal_info*p = info_list_; p->name_; p ++)
     {
-      Pedal_info& p = i.val_ref ();
-      if (p.item_p_)
+      /*
+       Handle suicide. 
+       */
+      if (p->finished_line_spanner_
+         && !p->finished_line_spanner_->live ())
+       p->finished_line_spanner_ = 0;
+      if (p->finished_bracket_p_
+         && !p->finished_bracket_p_->live())
+       p->finished_bracket_p_ = 0;
+
+
+      if (p->name_ == String ("Sustain"))
+       sustain = p->item_p_;
+
+      if (p->item_p_)
        {
-         side_position (p.item_p_).add_staff_support ();
          /*
            Hmm.
          */
-         if (i.key () != "Sustain")
+         if (p->name_ != String ("Sustain"))
            {
-             if (Item* sustain = info_dict_["Sustain"].item_p_)
+             if (sustain)
                {
-                 Side_position_interface st (p.item_p_);
-                 st.add_support (sustain);
+                 Side_position_interface::add_support (p->item_p_,sustain);
                }
            }
-         typeset_element (p.item_p_);
+         typeset_grob (p->item_p_);
+         p->item_p_ = 0;
+       }
+      
+      if (p->finished_bracket_p_)
+       {
+         Grob * l = p->finished_bracket_p_->get_bound (LEFT);
+         Grob * r = p->finished_bracket_p_->get_bound (RIGHT);      
+         if (!r)
+           {
+             p->finished_bracket_p_->set_bound (RIGHT, unsmob_grob (get_property ("currentMusicalColumn")));
+           }
+
+         typeset_grob (p->finished_bracket_p_);
+         p->finished_bracket_p_ =0;
+       }
+
+      if (p->finished_line_spanner_)
+       {
+         Side_position_interface::add_staff_support (p->finished_line_spanner_);
+         Grob * l = p->finished_line_spanner_->get_bound (LEFT);
+         Grob * r = p->finished_line_spanner_->get_bound (RIGHT);      
+         if (!r && l)
+           p->finished_line_spanner_->set_bound (RIGHT, l);
+         else if (!l && r)
+           p->finished_line_spanner_->set_bound (LEFT, r);
+         else if (!r && !l)
+           {
+             Grob * cc = unsmob_grob (get_property ("currentMusicalColumn"));
+             Item * ci = dynamic_cast<Item*> (cc);
+             p->finished_line_spanner_->set_bound (RIGHT, ci);
+             p->finished_line_spanner_->set_bound (LEFT, ci);    
+           }
+         typeset_grob (p->finished_line_spanner_);
+         p->finished_line_spanner_ = 0;
        }
-      p.item_p_ = 0;
     }
 }
 
 void
-Piano_pedal_engraver::do_post_move_processing ()
+Piano_pedal_engraver::start_translation_timestep ()
 {
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  for (Pedal_info*p = info_list_; p->name_; p ++)
     {
-      Pedal_info& p = i.val_ref ();
-      p.req_l_drul_[STOP] = 0;
-      p.req_l_drul_[START] = 0;
+      p->req_l_drul_[STOP] = 0;
+      p->req_l_drul_[START] = 0;
     }
 }
+ENTER_DESCRIPTION (Piano_pedal_engraver,
+/* descr */       "Engrave piano pedal symbols and brackets.",
+/* creats*/       "SostenutoPedal SustainPedal UnaCordaPedal SostenutoPedalLineSpanner SustainPedalLineSpanner UnaCordaPedalLineSpanner",
+/* acks  */       "note-column-interface",
+/* reads */       "pedalSostenutoStrings pedalSustainStrings pedalUnaCordaStrings",
+/* write */       "");