]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of git://git.sv.gnu.org/lilypond
authorGraham Percival <graham@percival-music.ca>
Fri, 31 Aug 2007 01:27:57 +0000 (18:27 -0700)
committerGraham Percival <graham@percival-music.ca>
Fri, 31 Aug 2007 01:27:57 +0000 (18:27 -0700)
Documentation/user/basic-notation.itely
Documentation/user/lilypond-book.itely
Documentation/user/music-glossary.tely
lily/axis-group-interface.cc
lily/include/axis-group-interface.hh
lily/include/tie-formatting-problem.hh
lily/tie-formatting-problem.cc

index 412e0c81101baf69c54a0ab21907e0389f59833c..eadb2b71a620c8fdba07fb6c08df77260f6d8aa1 100644 (file)
@@ -1055,7 +1055,8 @@ outside the @code{<< \\ >>} construct.  This should be noted when making
 changes at the voice level.  This also means that slurs and ties cannot go
 into or out of a @code{<< \\ >>} construct.  Conversely, parallel voices
 from separate @code{<< \\ >>} constructs on the same staff are the
-same voice.  Here is the same example, with different noteheads for each
+same voice.  Here is the same example, with different noteheads and
+colors for each
 voice.  Note that the change to the note-head style in the main voice does
 not affect
 the inside of the @code{<< \\ >>} constructs.  Also, the change to the
@@ -1068,16 +1069,20 @@ voice in the first @code{<< \\ >>} construct is effective in the second
 @lilypond[quote,verbatim,fragment]
 \new Staff \relative c' {
   \override NoteHead #'style = #'cross
+  \override NoteHead #'color = #red
   c16 d e f
   <<
     { g4 f e } \\
     { \override NoteHead #'style = #'triangle
+      \override NoteHead #'color = #blue
     r8 e4 d c8 ~ }
   >> |
   <<
     { d2 e2 } \\
     { c8 b16 a b8 g ~ g2 } \\
-    { \override NoteHead #'style = #'slash s4 b4 c2 }
+    { \override NoteHead #'style = #'slash 
+      \override NoteHead #'color = #green
+      s4 b4 c2 }
   >>
 }
 @end lilypond
@@ -1128,12 +1133,13 @@ The command @code{\oneVoice} will revert back to the normal setting.
 An expression that appears directly inside a @code{<< >>} belongs to
 the main voice.  This is useful when extra voices appear while the main
 voice is playing.  Here is a more correct rendition of the example from
-the previous section.  The crossed noteheads demonstrate that the main
+the previous section.  The crossed colored noteheads demonstrate that the main
 melody is now in a single voice context.
 
 @lilypond[quote,ragged-right,verbatim]
 \new Staff \relative c' {
   \override NoteHead #'style = #'cross
+  \override NoteHead #'color = #red
   c16 d e f
   \voiceOne
   <<
@@ -2082,7 +2088,7 @@ for example, to tie a tremolo to a chord. For example,
 @lilypond[fragment,verbatim,relative=1,ragged-right,quote]
 \set tieWaitForNote = ##t
 \grace { c16[~ e~ g]~ } <c, e g>2
-\repeat "tremolo" 8 { c32~ c'~ } <c c,>1
+\repeat tremolo 8 { c32~ c'~ } <c c,>1
 e8~ c~ a~ f~ <e' c a f>2
 @end lilypond
 
@@ -3249,7 +3255,7 @@ bracket only lasts one measure, which is a duration of 3/4.
   \time 3/4
   c c c
   \set Staff.voltaSpannerDuration = #(ly:make-moment 3 4)
-  \repeat "volta" 5 { d d d }
+  \repeat volta 5 { d d d }
   \alternative { { e e e f f f }
   { g g g } }
 }
@@ -3393,16 +3399,16 @@ To place tremolo marks between notes, use @code{\repeat} with tremolo
 style
 @lilypond[quote,verbatim,ragged-right]
 \new Voice \relative c' {
-  \repeat "tremolo" 8 { c16 d16 }
-  \repeat "tremolo" 4 { c16 d16 }
-  \repeat "tremolo" 2 { c16 d16 }
+  \repeat tremolo 8 { c16 d16 }
+  \repeat tremolo 4 { c16 d16 }
+  \repeat tremolo 2 { c16 d16 }
 }
 @end lilypond
 
 Tremolo marks can also be put on a single note.  In this case, the
 note should not be surrounded by braces.
 @lilypond[quote,verbatim,ragged-right]
-\repeat "tremolo" 4 c'16
+\repeat tremolo 4 c'16
 @end lilypond
 
 Similar output is obtained using the tremolo subdivision, described in
@@ -3460,8 +3466,8 @@ Percent repeats must be declared within a @code{Voice} context.
 
 @lilypond[quote,verbatim,ragged-right]
 \new Voice \relative c' {
-  \repeat "percent" 4 { c4 }
-  \repeat "percent" 2 { c2 es2 f4 fis4 g4 c4 }
+  \repeat percent 4 { c4 }
+  \repeat percent 2 { c2 es2 f4 fis4 g4 c4 }
 }
 @end lilypond
 
@@ -3471,7 +3477,7 @@ on the @code{countPercentRepeats} property,
 @lilypond[relative=2,fragment,quote,verbatim,ragged-right]
 \new Voice {
 \set countPercentRepeats = ##t
-  \repeat "percent" 4 { c1 }
+  \repeat percent 4 { c1 }
 }
 @end lilypond
 
index 569b8a5d711be018df485b510a35335695873420..9234ab531d4c7a4254eab8d64c0d6b0502ddb9c0 100644 (file)
@@ -793,7 +793,7 @@ cd out
 ...
 @end example
 
-@itemx --padding=@var{amount}
+@itemx --left-padding=@var{amount}
 Pad EPS boxes by this much. @var{amount} is measured in milimeters,
 and is 3.0 by default.  This option should be used if the lines of
 music stick out of the right margin.
index 6ab71d3727b8658347a7288a5cb3752ed23c4342..46e4a6b72af7aeae84c6b03b16e9493d6be60a89 100644 (file)
@@ -4845,7 +4845,7 @@ a @aref{chord}, usually in the distance of a third
 \relative c' {
   e2:32_"a"
   f:32 [ e8:16 f:16 g:16 a:16 ] s4
-  \repeat "tremolo" 8 { e32_"b" g }
+  \repeat tremolo 8 { e32_"b" g }
 }
 @end lilypond
 
index 959043274665b2c12916e1a56442dbbf6bf8ea83..b589ff671ec52d8e34db78f10ce5196b1fc1866a 100644 (file)
@@ -323,6 +323,22 @@ Axis_group_interface::generic_group_extent (Grob *me, Axis a)
   return ly_interval2scm (r - my_coord);
 }
 
+/* This is like generic_group_extent, but it only counts the grobs that
+   are children of some other axis-group. This is uncached; if it becomes
+   commonly used, it may be necessary to cache it somehow. */
+Interval
+Axis_group_interface::staff_extent (Grob *me, Grob *refp, Axis ext_a, Grob *staff, Axis parent_a)
+{
+  extract_grob_set (me, "elements", elts);
+  vector<Grob*> new_elts;
+
+  for (vsize i = 0; i < elts.size (); i++)
+    if (elts[i]->common_refpoint (staff, parent_a) == staff)
+      new_elts.push_back (elts[i]);
+
+  return relative_group_extent (new_elts, refp, ext_a);
+}
+
 
 Grob *
 Axis_group_interface::calc_pure_elts_and_common (Grob *me)
index c9b1a58eb09f8b924bcfd57b41da165a1dc100d8..95c4901f34229261facf30338a72dc9b1c651771 100644 (file)
@@ -39,6 +39,7 @@ struct Axis_group_interface
   static void set_axes (Grob *, Axis, Axis);
   static bool has_axis (Grob *, Axis);
   static void get_children (Grob *, vector<Grob*> *);
+  static Interval staff_extent (Grob *me, Grob *ref, Axis, Grob *staff, Axis);
   DECLARE_GROB_INTERFACE();
 };
 
index cb7d8c6e1632b51c3bc61db0af335c5d38b4f558..69b49322b01c9073525b067cfd2bece76d5e02a1 100644 (file)
@@ -47,6 +47,7 @@ class Tie_formatting_problem
   Tie_configuration_map possibilities_;
 
   Grob *x_refpoint_;
+  Grob *y_refpoint_;
 
   
   Tie_configuration *get_configuration (int position, Direction dir, Drul_array<int> cols, bool tune_y) const;
index 51bee1b6cf3b555f23eb9feb342e98af2871759d..c9e2e30fbbbce5e5ee6622ce68eafc4fcb9013c4 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "tie-formatting-problem.hh"
 
+#include "axis-group-interface.hh"
 #include "paper-column.hh"
 #include "bezier.hh" 
 #include "directional-element-interface.hh"
@@ -61,6 +62,7 @@ Tie_formatting_problem::get_attachment (Real y, Drul_array<int> columns) const
 Tie_formatting_problem::Tie_formatting_problem ()
 {
   x_refpoint_ = 0;
+  y_refpoint_ = 0;
   use_horizontal_spacing_ = true;
 }
 
@@ -231,9 +233,11 @@ Tie_formatting_problem::set_column_chord_outline (vector<Item*> bounds,
   chord_outlines_[key] = Skyline (boxes, details_.skyline_padding_, Y_AXIS, -dir);
   if (bounds[0]->break_status_dir ())
     {
-      Real x = robust_relative_extent (bounds[0],  x_refpoint_, X_AXIS)[-dir];
-      
-      chord_outlines_[key].set_minimum_height (x);
+      Interval iv (Axis_group_interface::staff_extent (bounds[0], x_refpoint_, X_AXIS, y_refpoint_, Y_AXIS));
+      if (iv.is_empty ())
+       iv.add_point (bounds[0]->relative_coordinate (x_refpoint_, X_AXIS));
+
+      chord_outlines_[key].set_minimum_height (iv[-dir]);
     }
   else
     {
@@ -303,10 +307,20 @@ Tie_formatting_problem::from_ties (vector<Grob*> const &ties)
     return;
   
   x_refpoint_ = ties[0];
+  y_refpoint_ = ties[0];
   for (vsize i = 0; i < ties.size (); i++)
     {
-      x_refpoint_ = dynamic_cast<Spanner*> (ties[i])->get_bound (LEFT)->common_refpoint (x_refpoint_, X_AXIS); 
-      x_refpoint_ = dynamic_cast<Spanner*> (ties[i])->get_bound (RIGHT)->common_refpoint (x_refpoint_, X_AXIS); 
+      Spanner *tie = dynamic_cast<Spanner*> (ties[i]);
+      Item *l = tie->get_bound (LEFT);
+      Item *r = tie->get_bound (RIGHT);
+
+      x_refpoint_ = l->common_refpoint (x_refpoint_, X_AXIS); 
+      x_refpoint_ = r->common_refpoint (x_refpoint_, X_AXIS);
+
+      if (!l->break_status_dir ())
+       y_refpoint_ = l->common_refpoint (y_refpoint_, Y_AXIS); 
+      if (!r->break_status_dir ())
+       y_refpoint_ = r->common_refpoint (y_refpoint_, Y_AXIS); 
     }
 
   details_.from_grob (ties[0]);
@@ -378,11 +392,19 @@ Tie_formatting_problem::from_semi_ties (vector<Grob*> const &semi_ties, Directio
       specifications_.push_back (spec);
     }
 
-  x_refpoint_ = semi_ties [0];
+  x_refpoint_ = semi_ties[0];
+  y_refpoint_ = semi_ties[0];
+
   for (vsize i = 0; i < semi_ties.size (); i++)
-    x_refpoint_ = semi_ties[i]->common_refpoint (x_refpoint_, X_AXIS); 
+    {
+      x_refpoint_ = semi_ties[i]->common_refpoint (x_refpoint_, X_AXIS); 
+      y_refpoint_ = semi_ties[i]->common_refpoint (y_refpoint_, Y_AXIS); 
+    }
   for (vsize i = 0; i < heads.size (); i++)
-    x_refpoint_ = heads[i]->common_refpoint (x_refpoint_, X_AXIS); 
+    {
+      x_refpoint_ = heads[i]->common_refpoint (x_refpoint_, X_AXIS); 
+      y_refpoint_ = heads[i]->common_refpoint (y_refpoint_, Y_AXIS) ;
+    }
 
   set_chord_outline (heads, head_dir);