]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.113
authorfred <fred>
Tue, 26 Mar 2002 22:48:12 +0000 (22:48 +0000)
committerfred <fred>
Tue, 26 Mar 2002 22:48:12 +0000 (22:48 +0000)
input/test/follow-thread.ly
input/test/metronome.ly [new file with mode: 0644]
lily/note-head-line-engraver.cc
mf/feta-banier.mf

index d0df4d38736ae9154846372d534acf8fa4bca5c3..d22f1fcf9b6ed52486b971cf8936dc33564a743e 100644 (file)
@@ -4,21 +4,25 @@
     \context PianoStaff <
         \context Staff=one \notes\relative c''{
            \context Thread
-            a
+%{         
+            d,
            \translator Staff=two
-           a,
+           c
 
-% smaller = easier to debug.
-%{     a
+           b
            \translator Staff=one
-           a''
+           a'
 %}
-               s2
+           [c,8
+           \translator Staff=two
+           c]
+           s2.
+
        }
-       \context Staff=two { \clef bass; \skip 1; }
+       \context Staff=two { \clef bass; \skip 1*2; }
     >
     \paper{
-        linewidth = 70.\mm;
+        linewidth = 90.\mm;
        \translator {
            \ScoreContext
            followThread = ##t
diff --git a/input/test/metronome.ly b/input/test/metronome.ly
new file mode 100644 (file)
index 0000000..431799d
--- /dev/null
@@ -0,0 +1,32 @@
+
+\version "1.3.110";
+
+% Test scm markup text and kerning
+
+% Warning
+%  
+% This is not a feature, it is a hack.  If you change anything,
+% it will probably break (that's because scm markup text is a
+% bit broken and needs fixing).  Chances are, it's already
+% broken by the time you read this.  Don't complain.
+%
+% FIXME: put in an item, and typeset by an engraver.
+
+#(define note '(rows (music "noteheads-2" ((kern . -0.1) "flags-stem"))))
+#(define eight-note `(rows ,note ((kern . -0.1) (music ((raise . 3.5) "flags-u3")))))
+#(define dotted-eight-note `(rows ,eight-note (music "dots-dot")))
+
+
+\score{
+       \notes\relative c''{
+               a1-#`(rows ,dotted-eight-note " = 64")
+               }
+       \paper{
+               linewidth = -1.\mm;
+               \translator{
+                       \ScoreContext
+                       TextScript \override #'font-shape = #'upright
+                       TextScript \override #'direction = #1
+               }
+       }
+}
index 57e62f5e6deee6632aa785aae11373aae1eb4a0b..9ca614859b51aae8d4495eba7f31611d7a50eda7 100644 (file)
@@ -11,6 +11,7 @@
 #include "item.hh"
 #include "musical-request.hh"
 #include "spanner.hh"
+#include "stem.hh"
 #include "rhythmic-head.hh"
 #include "side-position-interface.hh"
 #include "staff-symbol-referencer.hh"
@@ -38,6 +39,7 @@ private:
   Request* req_;
   Request* last_req_;
   Translator* last_staff_;
+  bool follow_;
   Grob* head_;
   Grob* last_head_;
 };
@@ -47,6 +49,7 @@ Note_head_line_engraver::Note_head_line_engraver ()
   line_ = 0;
   req_ = 0;
   last_req_ = 0;
+  follow_ = false;
   head_ = 0;
   last_head_ = 0;
   last_staff_ = 0;
@@ -80,36 +83,55 @@ Note_head_line_engraver::acknowledge_grob (Grob_info info)
          if (staff != last_staff_)
            {
              if (last_head_)
-               last_req_ = (Request*)1; // ugh
+               follow_ = true;
              last_staff_ = staff;
            }
        }
     }
 }
 
+static Grob*
+beam_l (Grob *h)
+{
+  if (Grob *s = Rhythmic_head::stem_l (h))
+    return Stem::beam_l (s);
+  return 0;
+}
+
 void
 Note_head_line_engraver::create_grobs ()
 {
-  if (!line_ && last_req_ && last_head_ && head_)
+  if (!line_ && (follow_ || last_req_) && last_head_ && head_
+      && (last_head_ != head_))
     {
-      /* type Glissando? */
-      line_ = new Spanner (get_property ("NoteHeadLine"));
-      line_->set_bound (RIGHT, head_);
-      line_->set_bound (LEFT, last_head_);
-
-      line_->set_parent (head_, X_AXIS);
-      line_->set_parent (head_, Y_AXIS);
+      /* Don't follow if there's a beam.
 
-      line_->set_parent (last_head_, X_AXIS);
-      line_->set_parent (last_head_, Y_AXIS);
-
-      if ((int)last_req_ == 1) // ugh
-       last_req_ = 0;
+        Hmm, this doesn't work, as head_ does not yet have a beam.
+        Should probably store follow_ in line_, and suicide at some
+        later point */
+      if (!(follow_
+           && beam_l (last_head_) && beam_l (last_head_) == beam_l (head_)))
+       {
+         if (follow_)
+           line_ = new Spanner (get_property ("FollowThread"));
+         else
+           line_ = new Spanner (get_property ("Glissando"));
+         
+         line_->set_bound (LEFT, last_head_);
+         line_->set_bound (RIGHT, head_);
+         
+         /* Note, mustn't set y-parent of breakable symbol to simple item:
+            one of the two broken parts won't have an y-parent! */
+         /* X parent is set by set_bound */
+         line_->set_parent (Staff_symbol_referencer::staff_symbol_l (last_head_),
+                            Y_AXIS);
+         
+         announce_grob (line_, last_req_);
+       }
       
-      announce_grob (line_, last_req_);
       last_req_ = 0;
-      last_head_ = head_;
-      head_ = 0;
+      follow_ = false;
+      last_head_ = 0;
     }
 }
 
@@ -121,8 +143,7 @@ Note_head_line_engraver::stop_translation_timestep ()
       typeset_grob (line_);
       line_ = 0;
     }
-  if (req_)
-    last_req_ = req_;
+  last_req_ = req_;
   req_ = 0;
 }
 
index 246f599bfe3e29c6be75e60e1354b28aea5dafe5..8f68b5f5cfc999f9766f2544f36a38c15e47509f 100644 (file)
@@ -432,4 +432,19 @@ fet_beginchar("grace dash (down)", "dgrace", "dgracedash")
        y_mirror_char;
 fet_endchar;
 
+% ustem?
+fet_beginchar("stem (up)", "stem", "stem")
+       set_char_box(stemthickness#/2, 0, 3.5staff_space#, stemthickness#/2);
+       pickup pencircle scaled stemthickness;
+       draw (0, 0.2staff_space) .. (0, 3.5staff_space);
+fet_endchar;
+
+% do we want this?
+fet_beginchar("stem (down)", "dstem", "dstem")
+       set_char_box(stemthickness#/2, -3.5staff_space#, 0, stemthickness#/2);
+       pickup pencircle scaled stemthickness;
+       draw (0, -0.2staff_space) .. (-3.5staff_space, 0);
+fet_endchar;
+
+
 fet_endgroup("flags");