]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.1.57
authorfred <fred>
Tue, 26 Mar 2002 22:23:33 +0000 (22:23 +0000)
committerfred <fred>
Tue, 26 Mar 2002 22:23:33 +0000 (22:23 +0000)
17 files changed:
Documentation/metadoc/musicnotes.sty
Documentation/tex/lilypond-regtest.doc
input/test/beam-extreme.ly [new file with mode: 0644]
input/test/chord-table.ly
input/test/rhythm-melody.fly
input/test/rhythm.ly
input/test/slur-symmetry-1.ly
input/test/slur-symmetry-2.ly [new file with mode: 0644]
input/test/slur-symmetry-3.ly [new file with mode: 0644]
input/test/slur-symmetry.ly
input/test/tie.ly
lily/parser.yy
lily/sequential-music-iterator.cc
lily/tie.cc
scm/lily.scm
tex/fetdefs.tex [new file with mode: 0644]
tex/lilyponddefs.tex

index bc4a69f543a6cd994d0d89324480348d98e7c9f8..31d2f83a9c531dadb14cbf2f258c0d3166817847 100644 (file)
@@ -4,6 +4,7 @@
 \def\fetdef#1#2{%
   \def#1{\hbox{\char#2}}}
 
+% huh? from where
 \input feta20.sty
 
 \font\fetasixteenfont=feta16
index d774479de65bcc079c3d75c5db2f86070af1e997..a92910cdeebf5aae4d8efb0ece2e238d13cf9869 100644 (file)
@@ -70,6 +70,22 @@ hidden just as with breakable bar lines.
 %
 % \mud elafile{beam-repeat.ly}
 
+Beams should behave reasonably well, even under extreme circumstances.
+Stems may be short, but noteheads should never touch the beam.
+
+\mudelafile{beam-extreme.ly}
+
+Slurs should look nice and symmetric.  The curvature may increase
+only to avoid noteheads, and as little as possible.
+
+\mudelafile{slur-symmetry.ly}
+\mudelafile{slur-symmetry-1.ly}
+
+Ties are strictly horizontal.  They are placed in between note heads.
+The horizontal middle should not overlap with a staffline.
+
+\mudelafile{tie.ly}
+
 Beams can be typeset over fixed distance aligned staffs, beam
 beautification doesn't really work, but knees do. Beams should be
 behave well, wherever the switching point is.
diff --git a/input/test/beam-extreme.ly b/input/test/beam-extreme.ly
new file mode 100644 (file)
index 0000000..4bdb1b0
--- /dev/null
@@ -0,0 +1,12 @@
+\score{
+       \notes\relative c''{
+               [g8 c c,]
+               [c16 c'' a f]
+               \stemup 
+               [c,,32 c'' a f]
+
+       }
+       \paper{
+               linewidth=-1.;
+       }
+}
index c2b30c2c920cc074c322dacf3a0feef46ac64479..907782915f533ecc9ae523775490fbd026b31ee2 100644 (file)
@@ -5,7 +5,7 @@ enteredby =     "jcn";
 }
 
 tab = \notes\transpose c'''\chords{
-       c1 c-m c-4 c-m.4 c-5+ c-5- c-m.5- c-5-.5+ c-6\break %c-m6\break
+       c1 c-m c-4 c-m4 c-5+ c-5- c-m5- c-5-.5+ c-6\break %c-m6\break
 }
 
 \score{
index 7365625e35bda18da86f4367b00fd61b4755804c..9ccd77a4bf2b68b985d7aa362910803e36d4da71 100644 (file)
@@ -1 +1,2 @@
-\rhythm { 4. 8 8. 16 } { c'' d e f }
+%\rhythm { 4. 8 8. 16 } { c'' d e f }
+\rhythm { c4. c8 c8. c16 } { c'' d e f }
index c4125e26a37c278be62188e118905eca46f0ba6d..4fe37cb58526e262d941075c52ac62ade9510407 100644 (file)
@@ -1,5 +1,7 @@
 \score{
        \context Voice \notes\relative c''{
-               c4. 8 4. 8
+               % still thinking 'bout this
+               %c4. 8 4. 8
+               c4. c8 c4. c8
        }
 }
index 4811a63d4cb83b51a2a025b3eb629f22b3828d4a..6e2ea7c67b83709c12a7ff7e18235d01685be68c 100644 (file)
@@ -1,15 +1,14 @@
-\header{
-% should look the same
-title="symmetry";
-}
 \score{
-       \notes\relative c'{
-               [g'8( e )c' g,] r2
-               \break
-               [d''8( f )a, d'] r2
-       }
+       \notes\relative c''<
+               \time 4/4;
+               \context Staff{
+                       f8(f f)f f(g g)f f(a a)f f(b b)f
+               }
+               \context Staff=x{
+                       e,(e e)e e(d d)e e(c c)e e(b b)e
+               }
+       >
        \paper{
-               castingalgorithm = \Wordwrap;
-               linewidth = 50.0\mm;
+               linewidth=-1.;
        }
 }
diff --git a/input/test/slur-symmetry-2.ly b/input/test/slur-symmetry-2.ly
new file mode 100644 (file)
index 0000000..93c2df1
--- /dev/null
@@ -0,0 +1,16 @@
+\header{
+% should look the same
+title="symmetry";
+}
+\score{
+       \notes\relative c'{
+               [g'8( e )c' g,]
+               [d'( f' )a, a]
+               [d( f )a, d']
+               [g,( e, )c' c]
+       }
+       \paper{
+               castingalgorithm = \Wordwrap;
+               linewidth = 50.0\mm;
+       }
+}
diff --git a/input/test/slur-symmetry-3.ly b/input/test/slur-symmetry-3.ly
new file mode 100644 (file)
index 0000000..4811a63
--- /dev/null
@@ -0,0 +1,15 @@
+\header{
+% should look the same
+title="symmetry";
+}
+\score{
+       \notes\relative c'{
+               [g'8( e )c' g,] r2
+               \break
+               [d''8( f )a, d'] r2
+       }
+       \paper{
+               castingalgorithm = \Wordwrap;
+               linewidth = 50.0\mm;
+       }
+}
index 93c2df18257b1ea1274e0b744f12343c8667f51c..41ebe836b3c644b8b43eb074c9c08b59d0f58b05 100644 (file)
@@ -1,16 +1,14 @@
-\header{
-% should look the same
-title="symmetry";
-}
 \score{
-       \notes\relative c'{
-               [g'8( e )c' g,]
-               [d'( f' )a, a]
-               [d( f )a, d']
-               [g,( e, )c' c]
-       }
+       \notes\relative c'<
+               \time 6/8;
+               \context Staff{
+                       e8(e)e e(d)e e(c)e e(b)e
+               }
+               \context Staff=x{
+                       f'8(f)f f(g)f f(a)f f(b)f
+               }
+       >
        \paper{
-               castingalgorithm = \Wordwrap;
-               linewidth = 50.0\mm;
+               linewidth=-1.;
        }
 }
index 90e9389b40fecac273a492034aaae5b1321bbe78..36998a23f592123017044c40fbd3261d9f578e57 100644 (file)
@@ -1,20 +1,12 @@
-\version "1.1.52";
-
-tie = \notes\transpose c''{
-
-       e4 ~ e e e ~ |
-       e ~ a a a ~ |
-       a d d d ~ |
-       e e e e |
-       g,, g,, g,, g,, ~ |
-       g,, g,, g,, g,, |
-}
-
 \score{
-       \tie
-       \paper{ 
-             indent = 0.0\pt;
-               linewidth= 30.\mm;
-               castingalgorithm = \Wordwrap;
+       \notes\relative c''{
+               %b2~b4~b8~b16~b32~b64 r64\break
+               %a2~a4~a8~a16~a32~a64 r64
+               d2~d4~d8~d16~d32~d64 r64\break
+               a2~a4~a8~a16~a32~a64 r64
+               %c2~c4~c8~c16~c32~c64 r64
+       }
+       \paper{
+               linewidth=0.;
        }
 }
index 7973a73d6baa8f949bef84dedfc351476d8d0b3f..bc65f297bd88b2b1960a94df533dc3f8fbfae049 100644 (file)
@@ -241,7 +241,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %type <pitch_arr>      pitch_list
 %type <music>  chord
 %type <pitch_arr>      chord_additions chord_subtractions chord_notes
-%type <pitch>  chord_addsub chord_note chord_inversion
+%type <pitch>  chord_note chord_inversion
 %type <midi>   midi_block midi_body
 %type <duration>       duration_length
 
@@ -1451,14 +1451,22 @@ chord_additions:
        | '-' chord_notes {
                $$ = $2;
        }
+       | '-' CHORDMODIFIER_PITCH {
+               $$ = new Array<Musical_pitch>;
+               $$->push (*$2);
+       }
+       | '-' CHORDMODIFIER_PITCH chord_notes {
+               $$ = $3;
+               $$->push (*$2);
+       }
        ;
 
 chord_notes:
-       chord_addsub {
+       chord_note {
                $$ = new Array<Musical_pitch>;
                $$->push (*$1);
        }
-       | chord_notes '.' chord_addsub {
+       | chord_notes '.' chord_note {
                $$ = $1;
                $$->push (*$3);
        }
@@ -1478,12 +1486,6 @@ chord_subtractions:
        forevery : X : optional_X sucks. Devise  a solution.
 */
 
-
-chord_addsub:
-       chord_note
-       | CHORDMODIFIER_PITCH
-       ;
-
 chord_inversion:
        {
                $$ = 0;
index a6602b7709da149979392255fb0871179d7d0526..eb572cd81775f1344b8ddd9ddf5c884884af0836 100644 (file)
@@ -10,6 +10,9 @@
 #include "debug.hh"
 #include "sequential-music-iterator.hh"
 #include "music-list.hh"
+// hmm
+//#include "request-chord-iterator.hh"
+#include "request-iterator.hh"
 
 void
 Sequential_music_iterator::do_print() const
@@ -141,9 +144,10 @@ Sequential_music_iterator::next_music_l ()
        }
       else
        {
-         // urg FIXME: grace-iterator::next_music_l () fools me!
-         if (dynamic_cast<Grace_iterator*> (iter_p_))
-           iter_p_ = 0;
+         // urg FIXME: sequential children should be iterated to finish
+         if (dynamic_cast<Request_chord_iterator*> (iter_p_))
+           delete iter_p_;
+         iter_p_ = 0;
          leave_element ();
          
          if (cursor_)
index dc7ac39b9ce60072f60674c0693000b76f4b0260..86eab96d1d58ec54f971115cba59ebf9962b19ff 100644 (file)
@@ -35,11 +35,15 @@ Tie::Tie()
   ugh: direction of the Tie is more complicated.  See [Ross] p136 and further
  */
 Direction
-Tie::get_default_dir() const
+Tie::get_default_dir () const
 {
-  int m= (head_l_drul_[LEFT]->position_i_ 
+  int m = (head_l_drul_[LEFT]->position_i_ 
          + head_l_drul_[RIGHT]->position_i_) /2;
-  return(m < 0)? DOWN : UP;
+  /*
+    If dir is not determined: inverse of stem: down
+    (see stem::get_default_dir ())
+   */
+  return (m <= 0)? DOWN : UP;
 }
 
 void
@@ -60,91 +64,116 @@ Tie::do_add_processing()
 void
 Tie::do_post_processing()
 {
-  // URG: share code with slur!
   assert (head_l_drul_[LEFT] || head_l_drul_[RIGHT]);
 
-  // URG
-  Real notewidth = paper_l ()->note_width () * 0.8;
   Real interline_f = paper_l ()->get_realvar (interline_scm_sym);
+  Real internote_f = interline_f / 2;
+  Real x_gap_f = paper_l ()->get_var ("tie_x_gap");
+  Real y_gap_f = paper_l ()->get_var ("tie_y_gap");
 
   /* 
-   [OSU]: slur and tie placement
+   Slur and tie placement [OSU]
+
+   Ties:
 
-   ties:
-   * x = inner raakpunt - d * gap
+       * x = inner vertical tangent - d * gap
 
-   * y = length < 5ss : horizontal raakpunt
-     y = length >= 5ss : y next interline - d * 0.25 ss
-     --> height <= 5 length ?? we use <= 3 length, now...
    */
 
-  Real gap_f = paper_l ()->get_var ("slur_x_gap");
 
+  /*
+    OSU: not different for outer notes, so why all this code?
+    ie,  can we drop this, or should it be made switchable.
+   */
+#if 0
   Direction d = LEFT;
   do
     {
-      dy_f_drul_[d] = .5 * interline_f * (head_l_drul_[d] 
-                      ? head_l_drul_[d]->position_i_
-                      : head_l_drul_[(Direction)-d]->position_i_);
-    }
-  while (flip(&d) != LEFT);
-
-  do
-    {
-      // tie attached to outer notehead
+      Real head_width_f = head_l_drul_[d]
+       ? head_l_drul_[d]->extent (X_AXIS).length ()
+       : 0;
+      /*
+       side attached to outer (upper or lower) notehead of chord
+      */
       if (head_l_drul_[d]
-         && head_l_drul_[d]->remove_elt_property (extremal_scm_sym) != SCM_BOOL_F)
-       {
-         if (d == LEFT)
-           dx_f_drul_[d] += notewidth;
-         dx_f_drul_[d] += -d * gap_f;
-         /* attach to outer 3/4 end of head */
-         dy_f_drul_[d] += dir_ * 0.25 * interline_f;
-       }
-      // tie attached to inner notehead
-      else if (head_l_drul_[d] && d == LEFT)
+         /*
+           && head_l_drul_[d]->remove_elt_property (extremal_scm_sym) != SCM_BOOL_F)
+           ugh, ugh:
+
+               a~a~a;
+
+           to second tie, middle notehead seems not extremal
+
+           Getting scared a bit by score-element's comment:
+           // is this a good idea?
+         */
+         && (head_l_drul_[d]->get_elt_property (extremal_scm_sym)
+             != SCM_BOOL_F))
        {
-         dx_f_drul_[d] += -d * notewidth;
+       if (d == LEFT)
+           dx_f_drul_[d] += head_width_f;
+         dx_f_drul_[d] += -d * x_gap_f;
        }
-      // uhm? loose end of tie // tie attached to stem
+      /*
+       side attached to inner notehead
+      */
       else
        {
-         dx_f_drul_[d] = -d * (spanned_drul_[d]->extent (X_AXIS).length () 
-                               -0.5 * notewidth);
+         dx_f_drul_[d] += -d * head_width_f;
        }
-    }
-  while (flip(&d) != LEFT);
+    } while (flip (&d) != LEFT);
 
-  // now that both are set, do dependent
-  do
-    {
-      // tie attached to outer notehead
-      if (!head_l_drul_[d])
-       {
-         dy_f_drul_[d] = dy_f_drul_[(Direction) -d];
-       }
-    }
-  while (flip(&d) != LEFT);
+#else
 
-  /*
-    Avoid too steep ties
-      * slur from notehead to stemend: c''()b''
+  if (head_l_drul_[LEFT])
+    dx_f_drul_[LEFT] = head_l_drul_[LEFT]->extent (X_AXIS).length ();
+  dx_f_drul_[LEFT] += x_gap_f;
+  dx_f_drul_[RIGHT] -= x_gap_f;
+
+#endif
+
+  /* 
+   Slur and tie placement [OSU]  -- check this
+
+   Ties:
+
+       * y = dx <  5ss: horizontal tangent
+        y = dx >= 5ss: y next interline - d * 0.25 ss
+
+        which probably means that OSU assumes that
+
+           dy <= 5 dx
+
+        for smal slurs
    */
-  Real damp_f = paper_l ()->get_var ("tie_slope_damping");
-  Offset d_off = Offset (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT],
-    dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]);
-  d_off.x () += extent (X_AXIS).length ();
-
-  Real ratio_f = abs (d_off.y () / d_off.x ());
-  if (ratio_f > damp_f)
-    dy_f_drul_[(Direction)(- dir_ * sign (d_off.y ()))] +=
-      dir_ * (ratio_f - damp_f) * d_off.x ();
+
+  int ypos_i = head_l_drul_[LEFT] ? head_l_drul_[LEFT]->position_i_
+    : head_l_drul_[RIGHT]->position_i_;
+
+  Real y_f = internote_f * ypos_i; 
+
+  Real dx_f = extent (X_AXIS).length () + dx_f_drul_[RIGHT] - dx_f_drul_[LEFT];
+  if (dx_f < paper_l ()->get_var ("tie_staffspace_length"))
+    {
+      if (abs (ypos_i) % 2)
+       y_f += dir_ * internote_f;
+      y_f += dir_ * y_gap_f;
+    }
+  else
+    {
+      if (! (abs (ypos_i) % 2))
+       y_f += dir_ * internote_f;
+      y_f += dir_ * internote_f;
+      y_f -= dir_ * y_gap_f;
+    }
+  
+  dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = y_f;
 }
 
 void
 Tie::do_substitute_element_pointer (Score_element*o, Score_element*n)
 {
-  Note_head *new_l =n?dynamic_cast<Note_head *> (n):0;
+  Note_head *new_l = n ? dynamic_cast<Note_head *> (n) : 0;
   if (dynamic_cast <Item *> (o) == head_l_drul_[LEFT])
     head_l_drul_[LEFT] = new_l;
   else if (dynamic_cast <Item *> (o) == head_l_drul_[RIGHT])
index 5914bf1f8ff345bf890804af0d5fe6ab60d66306..139b94cfa81b2c7ce19064e0f09e57df06e28fc2 100644 (file)
@@ -94,8 +94,8 @@
    (("" "Span_bar") . (extra_space 0.0))
    (("" "Time_signature") . (extra_space 0.0))
    (("" "begin-of-note") . (minimum_space 1.5))
-   (("Clef_item" "Key_item") . (minimum_space 3.5))
-   (("Key_item" "Time_signature") . (extra_space 2.0))
+   (("Clef_item" "Key_item") . (minimum_space 4.0))
+   (("Key_item" "Time_signature") . (extra_space 1.0))
    (("Clef_item"  "Time_signature") . (minimum_space 3.5))
    (("Staff_bar" "Clef_item") .   (minimum_space 1.0))
    (("Clef_item"  "Staff_bar") .  (minimum_space 3.7))
diff --git a/tex/fetdefs.tex b/tex/fetdefs.tex
new file mode 100644 (file)
index 0000000..076cee8
--- /dev/null
@@ -0,0 +1,15 @@
+% fetdefs.tex
+% encapsulating tex backend for auto-generated feta definitions
+
+% fix chord.cc::banter_str before removing these
+\def\fetdef#1#2{%
+  \def#1{\hbox{\char#2}}}
+
+\fetdef\sharp{16}
+\fetdef\flat{18}
+\font\fetasixteenfont=feta16
+\def\fetafont{\fetasixteenfont}
+\def\textflat{{\fetafont\raise 1ex\hbox{\flat}}}
+\def\textsharp{{\fetafont\raise1ex\hbox{\sharp}}}
+
+\endinput
index 696bf389a3ad28485da66e0f7993d0faf624beaa..ada0b6442d8fffdeaf8847178d787010b4e12c6c 100644 (file)
@@ -57,5 +57,7 @@
         nolilyfooter\texsuffix\endcsname
 \fi
 
+% fix chord.cc::banter_str before removing these
+\input fetdefs
 
 \endinput