]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/stem.cc (calc_stem_info): Use get_direction_beam_count.
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 11 Aug 2002 17:42:15 +0000 (17:42 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 11 Aug 2002 17:42:15 +0000 (17:42 +0000)
* lily/beam.cc (get_direction_beam_count): New function.

ChangeLog
input/bugs/melisma-tie-rest.ly [deleted file]
input/bugs/steep-beam.ly [deleted file]
input/mutopia/J.S.Bach/baerenreiter-sarabande.ly
input/regression/abe.ly
input/regression/lyric-combine.ly
input/test/beam-chord.ly
lily/beam.cc
lily/include/beam.hh
lily/stem.cc

index 0ff74860433d22d5fc9e1f7fe22afb72089a1397..021c84da94f11e1145ee15e8df9dedeb90c7aacd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2002-08-11  Jan Nieuwenhuizen  <janneke@gnu.org>
 
+       * input: some fixes.
+       
+       * lily/stem.cc (calc_stem_info): Use get_direction_beam_count.
+
+       * lily/beam.cc (get_direction_beam_count): New function.
+
        * GNUmakefile.in: Fix config.h dependency.
 
        * input/test/beam-dir-function.ly: Fix for new default
diff --git a/input/bugs/melisma-tie-rest.ly b/input/bugs/melisma-tie-rest.ly
deleted file mode 100644 (file)
index 4350483..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-\header{
-    texidoc = "Lyric extenders that start because of an autmatic tie melisma,
-extend during a subsequent rest, and cannot be forced to stop."
-}
-\score{
-    <
-       \addlyrics
-       \context Staff = soprano {
-           \property Staff.automaticMelismata = ##t
-           \context Voice=soprano\notes\relative c'' {
-               c4 ~ c r2 r1 c
-               c4 ~ c
-               \melismaEnd
-               \property Staff.tieMelismaBusy = ##f
-               r2 r1 c
-           }
-       }
-       \context Lyrics = "soprano-1" \lyrics {
-           hey __ stop?
-           hey __ STOP!!!
-       }
-    >
-}
-
diff --git a/input/bugs/steep-beam.ly b/input/bugs/steep-beam.ly
deleted file mode 100644 (file)
index 6f37eb3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-\version "1.5.68"
-
-\header {
-texidoc = "1st beam should prob. be horizontal."
-}
-
-\score { \notes <{  [ r8 g''16 des'] [r8 c16 a] }>}
index 6f78570d62ffa8ef505b6262eca070e6b28bbe36..b2ab3df5503dbfaf15507a4421e592fa57b827f8 100644 (file)
@@ -1,4 +1,5 @@
 
+
 #(set! point-and-click line-column-location)
 
 forcedBreak = \notes { }
index ecf0fd8f2efe563992db73108a6dabe74949bb39..d2e948b0df1707aea7c578775870e7a75eee311e 100644 (file)
@@ -15,7 +15,7 @@ texidoc="Automatic beamer behaves nicely."
     \translator {
       \StaffContext
        \remove "Clef_engraver"
-       \remove "Staff_symbol_engraver"
+%%     \remove "Staff_symbol_engraver"
     }
   }
 }
index 3a72cb4d48e8a9eb8a5939dfa39138b3e0466165..98c51a104edce3dc1071bf6ec8e972cc7a202460 100644 (file)
@@ -2,7 +2,7 @@
 \header{
 texidoc="
 Lyrics can be set to a melody automatically.  Excess lyrics will be
-dumped.  Lyrics will not be set over rests.  You can have melismata
+discarded.  Lyrics will not be set over rests.  You can have melismata
 either by setting a property melismaBusy, or by setting
 automaticMelismas (which will set melismas during slurs and ties).  If
 you want a different order than first Music, then Lyrics, you must
@@ -11,14 +11,6 @@ precook a chord of staves/lyrics and label those.  Of course
 extenders do not assume anything about lyric lengths, so they continue
 to work.
 "
-
-
-filename =      "twinkle-pop.ly"
-xtitle =        "Ah, vous dirais-je, maman "
-description =   "twinkle twinkle in pop-song-settings"
-composer =      "traditional"
-enteredby =     "HWN, chords by Johan Vromans"
-copyright =     "public domain"
 }
 
 
@@ -26,26 +18,26 @@ copyright =          "public domain"
 m = \notes  \relative c'' {
        \property Staff.automaticMelismata = ##t
        \autoBeamOff
-       g4  r8 \times 2/3 { g'8( f )e } r8 \grace { [d16 c b] } e4
+       g8 () a  r8 \times 2/3 { g'8( f )e } r8 \grace { [d16 c b] } e4
        \emptyText
        d8.^"melisma"   \melisma c16
        \melismaEnd
        b }
 
-noisebeat = \notes \relative c'' {g16 g g g }
-noise =   { \noisebeat \noisebeat \noisebeat  \noisebeat \noisebeat \noisebeat }
-textI =   \lyrics  { la2 __ la -- la __ la la la la la  }
-textII =   \lyrics  { da -- da __ da -- da da da da da  }
+noise = \repeat unfold 6 \notes \relative c'' {g16 g g g }
+q
+textI = \context LyricsVoice = "middle-1" \lyrics { la2 __ la -- la __ la la la la la  }
+textII = \context LyricsVoice = "middle-1" \lyrics { da -- da __ da -- da da da da da  }
 
 \score {
-    \notes < \context Staff = SA \m
+    \notes < \context Staff = SA \noise
       \context Lyrics = LA { s1 }
       \context Staff = SB { s1 }
       \context Lyrics = LB { s1 }
       \context Staff = SC \noise
       
       \addlyrics
-         \context Staff = SB \m
+         \context Staff = SB \context Voice="middle" \m
          < \context Lyrics = LA \textI
            \context Lyrics = LB \textII
          >
index 268998f916519e74f3c1f88d42c123bc5754d51a..fba54aa63bf13ecaa3032372364875c9049c02c7 100644 (file)
@@ -1,10 +1,17 @@
 \version "1.5.68"
 
-
+\header {
+texidoc = "Hmm. what's this supposed to test?"
+}
 \score{
        \notes\transpose c'{
-               \property Score.beamQuantisation = #'none
-
+\property Voice.Beam \set #'position-callbacks =
+ #`(,Beam::least_squares
+                              ,Beam::check_concave
+                              ,Beam::slope_damping
+                              ,Beam::shift_region_to_valid
+       
+                             )
                [a'8 <a' g''>]
                [c <c e,>]
                [a'16 <a' g''>]
@@ -14,6 +21,6 @@
        }
        \paper{
 
-               linewidth = 60.0\mm
+               linewidth = 66.0\mm
        }
 }
index d3e2d0b525037ee662b59a5a5e3d8fa3a5ff0f6c..8c06658d4a5ef99390e6a43e9e43b5f25cb282e2 100644 (file)
@@ -161,7 +161,7 @@ Beam::before_line_breaking (SCM smob)
     {
       Direction d = get_default_dir (me);
 
-      consider_auto_knees (me, d);
+      consider_auto_knees (me);
       set_stem_directions (me, d);
 
       connect_beams (me);
@@ -625,7 +625,7 @@ struct Int_set
   knee-beams, should set the directions manually.
  */
 void
-Beam::consider_auto_knees (Grob* me, Direction d)
+Beam::consider_auto_knees (Grob* me)
 {
   SCM scm = me->get_grob_property ("auto-knee-gap");
   if (!gh_number_p (scm))
@@ -636,7 +636,6 @@ Beam::consider_auto_knees (Grob* me, Direction d)
   Int_set gaps;
 
   gaps.set_full ();
-  
 
   Link_array<Grob> stems=
     Pointer_group_interface__extract_grobs (me, (Grob*)0, "stems");
@@ -1444,7 +1443,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis)
 }
 
 bool
-Beam::knee_b (Grob*me)
+Beam::knee_b (Grob* me)
 {
   SCM k = me->get_grob_property ("knee");
   if (gh_boolean_p (k))
@@ -1469,6 +1468,26 @@ Beam::knee_b (Grob*me)
   return knee;
 }
 
+int
+Beam::get_direction_beam_count (Grob *me, Direction d )
+{
+  Link_array<Grob>stems = 
+    Pointer_group_interface__extract_grobs (me, (Grob*) 0, "stems");
+  int bc = 0;
+  
+  for (int i = stems.size (); i--;)
+    {
+      /*
+       Should we take invisible stems into account?
+       */
+      if (Stem::get_direction (stems[i]) == d)
+        bc = bc >? (Stem::beam_multiplicity (stems[i]).length () + 1);
+    }
+
+  return bc;
+}
+
+
 ADD_INTERFACE (Beam, "beam-interface",
   "A beam.
 
index b9d74d91ab3f201418fab05258da67d49f5817c0..b06afc0e4e20d1d256f53efe866f862d9c736b80 100644 (file)
@@ -48,11 +48,12 @@ public:
                                      Real, Real, Real, Real,
                                      int, Direction, Direction);
   
-  
+
+  static int get_direction_beam_count (Grob *me, Direction d);
 private:
   static Direction get_default_dir (Grob*);
   static void set_stem_directions (Grob*, Direction );
-  static void consider_auto_knees (Grob*, Direction d);
+  static void consider_auto_knees (Grob*);
   static void set_stem_shorten (Grob*);
   static Real calc_stem_y (Grob*, Grob* s, Grob**c,
                           Real, Real,
index 20c5bc79e8c6a60ff5fac58a2348f389db455084..2ed0f4fb784e996f51cdd523ea4612880fac5407 100644 (file)
@@ -804,7 +804,7 @@ Stem::calc_stem_info (Grob*me)
   Real half_space = staff_space / 2;
 
   Grob * beam = get_beam (me);
-  int beam_count = beam_multiplicity(me).length()+1;
+  int beam_count = Beam::get_direction_beam_count (beam, mydir);
   Real beam_translation= Beam::get_beam_translation (beam);
   Real thick = gh_scm2double (beam->get_grob_property ("thickness"));
   Real note_start = chord_start_y (me);