--- /dev/null
+\version "2.11.40"
+
+
+morgenliedBeam = \relative c'' \new Voice{
+ \time 3/8
+ % morgenlied
+ c16 b c e g <e b'> |
+ \stemUp
+ c16 b c e g <e b'> |
+}
+
+rachmaninovBeams = \relative \new Voice {
+ \voiceOne
+ \time 4/4
+ \key c \minor
+ <c' e c'>8 <g c g'> <c f> <ees, ees'>~ <ees ees'> <c c'> <des des'> <d d'>
+}
+
+horizontalBeams = {
+ % todo.
+}
+
+nonHorizontalBeams = {
+ \morgenliedBeam
+ \rachmaninovBeams
+}
+\layout {
+ ragged-right = ##t
+ }
+
+% cut & paste from beam-concave.ly
+
+#(define (<> x y) (not (= x y)))
+mustBeHorizontal =
+ \override Staff.Beam #'positions = #(ly:make-simple-closure
+ (ly:make-simple-closure
+ (append
+ (list chain-grob-member-functions `(,cons 0 0))
+ (check-slope-callbacks =))))
+mustNotBeHorizontal =
+ \override Staff.Beam #'positions = #(ly:make-simple-closure
+ (ly:make-simple-closure
+ (append
+ (list chain-grob-member-functions `(,cons 0 0))
+ (check-slope-callbacks <>))))
+
+
+\new Voice {
+ \mustBeHorizontal
+ r1
+ \horizontalBeams
+ \mustNotBeHorizontal
+ \nonHorizontalBeams
+}
+
+/*
+ beam-concave.cc -- implement Concaveness for beams.
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2004 Han-Wen Nienhuys <hanwen@lilypond.org>
+
+*/
+
/*
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"
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]);
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;
}