]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/parser.yy (event_that_take_dir): allow postfix notation for ties.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 2 Nov 2002 14:15:19 +0000 (14:15 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 2 Nov 2002 14:15:19 +0000 (14:15 +0000)
* lily/new-tie-engraver.cc (process_acknowledged_grobs): new
engraver. process ties in postfix notation, i.e. c8-~ c

* lilypond-mode.el (LilyPond-command-alist): run LaTeX by default.

* input/regression/beam-postfix-notation.ly (texidoc): new file.

* lily/parser.yy (event_that_take_dir): allows c8-[ for beams.

12 files changed:
ChangeLog
input/regression/beam-postfix-notation.ly
lily/a2-engraver.cc
lily/accidental-engraver.cc
lily/include/tie.hh
lily/new-accidental-engraver.cc
lily/parser.yy
lily/tie-engraver.cc
lily/tie.cc
lilypond-mode.el
ly/engraver-init.ly
scm/music-types.scm

index 92a3a0f9d34e40034ca97785913a27e2f3c09a99..f06a45c602112c7f9a3493bb97ac5ba389b8fb6e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2002-11-02  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * lily/parser.yy (event_that_take_dir): allow postfix notation for ties.
+
+       * lily/new-tie-engraver.cc (process_acknowledged_grobs): new
+       engraver. process ties in postfix notation, i.e. c8-~ c
+
+       * lilypond-mode.el (LilyPond-command-alist): run LaTeX by default.
+
        * input/regression/beam-postfix-notation.ly (texidoc): new file.
 
        * lily/parser.yy (event_that_take_dir): allows c8-[ for beams.
index 9d220c4ddada3055c93b9ed2215825cb0e4b5727..79aec2c28e22a84d90b0743cb954b627f7ba6031 100644 (file)
@@ -1,14 +1,14 @@
 \header {
 
-texidoc = "Beams may be entered in postfix notation, separating the
+texidoc = "Beams and ties may be entered in postfix notation, separating the
     notes and the brackets with a dash."
 
 }
 
 \score
 {
- \notes
+ \notes\relative c''
    {
-       c8-[ c-]
+       c8-[-~ c-]
    }
 }
index 2897e39f9517bca119aee2e96936d5f41bd5afeb..c1b5e47036eee42937a2c96988d4b75be6415528 100644 (file)
@@ -200,19 +200,17 @@ A2_engraver::stop_translation_timestep ()
 }
 
 ENTER_DESCRIPTION(A2_engraver,
-/* descr */       "Part combine engraver for orchestral scores.                \
-                                                                       \
-The markings @emph{a2}, @emph{Solo} and @emph{Solo II}, are            \
-created by this engraver.  It also acts upon instructions of the part  \
-combiner.  Another thing that the this engraver, is forcing of stem,   \
-slur and tie directions, always when both threads are not identical;   \
-up for the musicexpr called @code{one}, down for the musicexpr called  \
-@code{two}.                                                            \
-
-",
+/* descr */       "Part combine engraver for orchestral scores.                "
+"The markings @emph{a2}, @emph{Solo} and @emph{Solo II}, are           "
+"created by this engraver.  It also acts upon instructions of the part "
+"combiner.  Another thing that the this engraver, is forcing of stem,  "
+"slur and tie directions, always when both threads are not identical;  "
+"up for the musicexpr called @code{one}, down for the musicexpr called "
+"@code{two}.                                                           "
+,
 /* creats*/       "TextScript",
 /* accepts */     "",
-/* acks  */       "multi-measure-rest-interface
-slur-interface stem-interface tie-interface note-head-interface dynamic-interface text-interface"
+/* acks  */       "multi-measure-rest-interface "
+"slur-interface stem-interface tie-interface note-head-interface dynamic-interface text-interface"
 ,/* reads */       "combineParts noDirection soloADue soloText soloIIText aDueText split-interval unison solo unisilence unirhythm",
 /* write */       "");
index 75816c76ecf123a1c222c7b3c31029ec0efe94e9..b2ff103ff3a4a6027c8da5da7c5c0d4f5256e728 100644 (file)
@@ -479,10 +479,9 @@ Accidental_engraver::process_music ()
 
 
 ENTER_DESCRIPTION (Accidental_engraver,
-"Make accidentals.  Catches note heads, ties and notices key-change
-events.  Due to interaction with ties (which don't come together
-with note heads), this needs to be in a context higher than Tie_engraver.",
-                  
+"Make accidentals.  Catches note heads, ties and notices key-change "
+" events.  Due to interaction with ties (which don't come together "
+" with note heads), this needs to be in a context higher than Tie_engraver.",
               "Accidental",
 /* accepts */     "",
               "rhythmic-head-interface tie-interface arpeggio-interface",
index 186da434a9c1518c17001e9dfeae9b070702e3f0..7b6a4bc52cefc00f475ad55a1ad829d73252d830 100644 (file)
@@ -17,7 +17,7 @@
 class Tie
 {
 public:
-  static void set_head (Grob*,Direction, Item*head);
+  static void set_head (Grob*,Direction, Grob*head);
   static void set_interface (Grob*);
   static bool has_interface (Grob*);
   static Grob * head (Grob*,Direction) ;
index d8ae2948aeeafc3ac35dc0100f346b0959110e1b..0ad9430607650ace7eba191be1e78d006260e025 100644 (file)
@@ -550,9 +550,9 @@ New_accidental_engraver::process_music ()
 
 
 ENTER_DESCRIPTION (New_accidental_engraver,
-"Make accidentals.  Catches note heads, ties and notices key-change
-events.  Due to interaction with ties (which don't come together
-with note heads), this needs to be in a context higher than Tie_engraver.",
+"Make accidentals.  Catches note heads, ties and notices key-change "
+"events.  Due to interaction with ties (which don't come together "
+"with note heads), this needs to be in a context higher than Tie_engraver.",
                   
               "Accidental",
 /* accepts */     "",
index 5bcdd71b219e2a2ca93ac45a2d1c859dba8ef946..d124c5095dec8c3b7c4f708120b1bfc4a1c4e9f1 100644 (file)
@@ -1431,6 +1431,11 @@ event_that_take_dir:
                m->set_mus_property ("span-direction" , gh_int2scm (STOP));
                $$ = m;
        }
+       | '~' {
+               Music * m = MY_MAKE_MUSIC ("NewTieEvent");
+               m->set_spot (THIS->here_input());
+               $$ = m;
+       }
        | script_abbreviation {
                SCM s = THIS->lexer_->lookup_identifier ("dash" + ly_scm2string ($1));
                Music *a = MY_MAKE_MUSIC("ArticulationEvent");
index 9c71a483b8aeea5e1d324819024d8ba34b83143f..eb9caa579174b27642af4f7b43777b5b9c029a3b 100644 (file)
    just at this time, and note that start at this time.
 
    TODO: Remove the dependency on musical info. We should tie on the
-   basis of position and duration-log of the heads (not of the reqs).
+   basis of position and duration-log of the heads (not of the events).
 
+   New tie event happens at the time of the first note, the 
 */
 class Tie_engraver : public Engraver
 {
   Moment end_mom_;
   Moment next_end_mom_;
 
-  Music *req_;
+  Music *event_;
+  
   Link_array<Grob> now_heads_;
   Link_array<Grob> stopped_heads_;
   Link_array<Grob> ties_;
@@ -57,7 +59,7 @@ public:
 
 Tie_engraver::Tie_engraver ()
 {
-  req_ = 0;
+  event_ = 0;
   tie_column_ = 0;
 }
 
@@ -65,12 +67,19 @@ Tie_engraver::Tie_engraver ()
 bool
 Tie_engraver::try_music (Music *mus)
 {
-  req_ = mus;
-  SCM m = get_property ("automaticMelismata");
-  bool am = gh_boolean_p (m) &&gh_scm2bool (m);
-  if (am)
+  if(mus->is_mus_type( "tie-event"))
     {
-      set_melisma (true);
+      event_ = mus;
+    }
+
+  if (event_)
+    {
+      SCM m = get_property ("automaticMelismata");
+      bool am = gh_boolean_p (m) &&gh_scm2bool (m);
+      if (am)
+       {
+         set_melisma (true);
+       }
     }
   return true;
 }
@@ -103,7 +112,7 @@ head_pitch_compare (Grob  *const&a,Grob  *const&b)
 void
 Tie_engraver::process_acknowledged_grobs ()
 {
-  if (req_)
+  if (event_)
     {
       now_heads_.sort (&head_pitch_compare);
       /*
@@ -153,7 +162,7 @@ Tie_engraver::process_acknowledged_grobs ()
          Tie::set_head (p,RIGHT, dynamic_cast<Item*> (unsmob_grob (ly_cdr (pair))));
          
          ties_.push (p);
-         announce_grob(p, req_->self_scm());
+         announce_grob(p, event_->self_scm());
        }
       else for (SCM s = head_list; gh_pair_p (s); s = ly_cdr (s))
        {
@@ -164,7 +173,7 @@ Tie_engraver::process_acknowledged_grobs ()
          Tie::set_head (p, RIGHT, dynamic_cast<Item*> (unsmob_grob (ly_cdar (s))));
          
          ties_.push (p);
-         announce_grob(p, req_->self_scm());
+         announce_grob(p, event_->self_scm());
        }
 
       if (ties_.size () > 1 && !tie_column_)
@@ -182,8 +191,7 @@ Tie_engraver::process_acknowledged_grobs ()
 void
 Tie_engraver::stop_translation_timestep ()
 {
-  req_ = 0;
-
+  event_ = 0;
   now_heads_.clear ();
 
   /*
@@ -268,6 +276,8 @@ Tie_engraver::start_translation_timestep ()
     it at the top.
    */
   stopped_heads_.reverse();
+
+  event_ = 0;
 }
 
 
index b59f8d21b5193960e9b38277e53a73dc7f0f3045..46c42a819b3cc5c8199c898761ee92ca4e2e7d68 100644 (file)
@@ -37,7 +37,7 @@
 
 
 void
-Tie::set_head (Grob*me,Direction d, Item * h)
+Tie::set_head (Grob*me,Direction d, Grob * h)
 {
   assert (!head (me,d));
   index_set_cell (me->get_grob_property ("heads"), d, h->self_scm ());
index 6c947e00e6a35a39af9914bbd24193c9b3cc4b11..a18d05a9fdc533bbd6b9d7c8472bc0bee99570fb 100644 (file)
@@ -168,7 +168,7 @@ in LilyPond-include-path."
 ;; This is the major configuration variable.
 (defcustom LilyPond-command-alist
   `(
-    ("LilyPond" . ("lilypond %s" . "TeX"))
+    ("LilyPond" . ("lilypond %s" . "LaTeX"))
     ("TeX" . ("tex '\\nonstopmode\\input %t'" . "View"))
 
     ("2Dvi" . ("ly2dvi %s" . "View"))
index bfdf7047eb4cfd17322f6ae34b28937f6828893c..da2571f6bc5cc8e4797e38ebab6381b8a5292a7c 100644 (file)
@@ -162,6 +162,7 @@ VoiceContext = \translator {
        \consists "Phrasing_slur_engraver"
        \consists "Slur_engraver"
        \consists "Tie_engraver"
+       \consists "New_tie_engraver"
        \consists "Porrectus_engraver"
        \consists "Tuplet_engraver"
        \consists "A2_engraver"
index b6098a54f7546fb62c36c4792c474a97d5ce3d56..5f4a5e99687f9b86bc2c8c2f87179c74a8b19531 100644 (file)
@@ -465,6 +465,12 @@ is an articulation (such as @code{-.}, @code{->}, @code{\\tenuto},
        (internal-class-name . "Event")
        (types . (general-music tie-event event))
        ))
+    (NewTieEvent
+     . (
+       (description .  "A tie.  Entered as @var{note}-~.")
+       (internal-class-name . "Event")
+       (types . (general-music new-tie-event event))
+       ))
     (TremoloEvent
      . (
        (description . "Un measured tremolo.")