]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/beam-concave.cc
Doc-hu: translated first section of lilypond-book
[lilypond.git] / lily / beam-concave.cc
index e703f9e9f796c62a837fe36843584c32fe70c461..7ca626b60907f75aceeac1a81542adb7b0d1c372 100644 (file)
@@ -1,5 +1,34 @@
+/*
+  This file is part of LilyPond, the GNU music typesetter.
+
+  Copyright (C) 2004 Han-Wen Nienhuys <hanwen@lilypond.org>
+
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
 /*
   Determine whether a beam is concave.
 /*
   Determine whether a beam is concave.
+
+  A beam is concave when the middle notes get closer to the
+  beam than the left and right edge notes.
+
+  This is determined in two ways: by looking at the positions of the
+  middle notes, or by looking at the deviation of the inside notes
+  compared to the line connecting first and last.
+
+  The tricky thing is what to do with beams with chords. There are no
+  real guidelines in this case.
 */
 
 #include "pointer-group-interface.hh"
 */
 
 #include "pointer-group-interface.hh"
@@ -118,7 +147,6 @@ Beam::calc_concaveness (SCM smob)
        Hmmm.. wait, for the beams in the last measure of morgenlied,
        this doesn't look so good. Let's try the heads farthest from
        the beam.
        Hmmm.. wait, for the beams in the last measure of morgenlied,
        this doesn't look so good. Let's try the heads farthest from
        the beam.
-
       */
       Interval posns = Stem::head_positions (stems[i]);
 
       */
       Interval posns = Stem::head_positions (stems[i]);
 
@@ -128,7 +156,7 @@ Beam::calc_concaveness (SCM smob)
 
   Real concaveness = 0.0;
 
 
   Real concaveness = 0.0;
 
-  if (is_concave_single_notes (far_positions, beam_dir))
+  if (is_concave_single_notes (beam_dir == UP ? close_positions : far_positions, beam_dir))
     {
       concaveness = 10000;
     }
     {
       concaveness = 10000;
     }