\version "1.5.68"
\header{
-title= "Stems and Beams"
-subtitle = "proofsheet"
-enteredby = "jcn"
-copyright = "public domain"
-TestedFeatures = "This file tests the length of stems and placement
+ title= "Stems and Beams"
+ subtitle = "proofsheet"
+ enteredby = "jcn"
+ copyright = "public domain"
+ TestedFeatures = "This file tests the length of stems and placement
of beams"
-
+
}
-beamintervals = \notes{
- \time 7/4
- \stemUp
-\transpose c'{
- [ c8 d ] [ c e ] [ c f ] [ c g ] [ c a ] [ c b ] [ c c' ] |
- [ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] |
- }\transpose c''{
- [ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] |
- \stemDown}
- \transpose c'''{
- [ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] |
-} \transpose c''{
- [ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] |
- [ c d ] [ c e ] [ c f ] [ c g ] [ c a ] [ c b ] [ c c' ] |
- }}
+beamintervals = \notes{
+ \time 7/4
+ \stemUp
+ \transpose c''{
+ [ c8 d ] [ c e ] [ c f ] [ c g ] [ c a ] [ c b ] [ c c' ] |
+ [ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] |
+ }
+ \transpose c'''{
+ [ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] |
+ \stemDown
+ }
+ \transpose c''''{
+ [ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] |
+ }
+ \transpose c'''{
+ [ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] |
+ [ c d ] [ c e ] [ c f ] [ c g ] [ c a ] [ c b ] [ c c' ] |
+ }
+}
\score{
- \notes\transpose c'{
- \stemUp
- \time 17/4
- g,4 a, b, c d e f g a b c' d' e' f' g' a' b' |
- \stemDown
- b' a' g' f' e' d' c' b a g f e d c b, a, g, |
- \beamintervals
- \transpose d \beamintervals
- \transpose e \beamintervals
- \transpose f \beamintervals
- \transpose g \beamintervals
- \transpose a \beamintervals
- \transpose b \beamintervals
- }
+ \notes{
+ \time 19/4
+
+ %% 3.50 (standard) - 0.24 (beam-thickness / 2) = 3.26 ...
+ %% yields beams almost as [Ross] wants them.
+
+ %% Differences are only half a beam-thickness, probably giving
+ %% Lily's beams a slightly better slope
+
+ \property Staff.Stem \set #'beamed-lengths = #'(3.26)
+
+ \relative c'{
+ \stemUp
+ g4 a b c d e f g a b c d e f g a b c d
+ \stemDown
+ d c b a g f e d c b a g f e d c b a g
+ }
+ \beamintervals
+ \transpose d' \beamintervals
+ \transpose e' \beamintervals
+ \transpose f' \beamintervals
+ \transpose g' \beamintervals
+ \transpose a' \beamintervals
+ \transpose b' \beamintervals
+ }
+ \paper{
+ indent = 0.0\mm
+ }
}
+
+%%% Local variables:
+%%% LilyPond-indent-level:2
+%%% End:
+/*
+ beam-quanting.cc -- implement Beam quanting functions
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ Jan Nieuwenhuizen <janneke@gnu.org>
+
+*/
+
+
+
#include <math.h>
#include "grob.hh"
qscores.push (qs);
}
- /*
- This is a longish function, but we don't separate this out into
- neat modular separate subfunctions, as the subfunctions would be
- called for many values of YL, YR. By precomputing various
- parameters outside of the loop, we can save a lot of time.
- */
-
+ /* This is a longish function, but we don't separate this out into
+ neat modular separate subfunctions, as the subfunctions would be
+ called for many values of YL, YR. By precomputing various
+ parameters outside of the loop, we can save a lot of time. */
for (int i = qscores.size (); i--;)
{
qscores[i].demerits
Real rad = Staff_symbol_referencer::staff_radius (me);
int beam_count = get_beam_count (me);
- Real beam_translation = beam_count < 4
- ? (2*ss + slt - thickness) / 2.0
- : (3*ss + slt - thickness) / 3.0;
+ Real beam_translation = get_beam_translation (me);
Real reasonable_score = (knee_b) ? 200000 : 100;
for (int i = qscores.size (); i--;)
Stem_info info = stem_infos[i];
Direction d = info.dir_;
- score[d] += pen
- * (0 >? (d * (info.shortest_y_ - current_y)));
+ score[d] += pen * (0 >? (d * (info.shortest_y_ - current_y)));
- Real ideal_score = shrink_extra_weight (d * current_y - d * info.ideal_y_);
+ Real ideal_score = shrink_extra_weight (d * (current_y - info.ideal_y_));
- /*
-
- we introduce a power, to make the scoring strictly
- convex. Otherwise a symmetric knee beam (up/down/up/down) does
- not have an optimum in the middle.
-
- */
+ /* We introduce a power, to make the scoring strictly
+ convex. Otherwise a symmetric knee beam (up/down/up/down)
+ does not have an optimum in the middle. */
if (knee)
ideal_score = pow (ideal_score, 1.1);
score[d] += STEM_LENGTH_DEMERIT_FACTOR * ideal_score;
/*
TODO:
-
- * Junk stem_info.
-
* Use Number_pair i.s.o Interval to represent (yl, yr).
- Determine auto knees based on positions if it's set by the user.
}
-/*
- this returns the translation between 2 adjoining beams.
- */
+/* Return the translation between 2 adjoining beams. */
Real
Beam::get_beam_translation (Grob *me)
{
return l;
}
-/*
- Calculate the Y position of the stem-end, given the Y-left, Y-right
- in POS for stem S. This Y position is relative to S.
- */
+/* Return the Y position of the stem-end, given the Y-left, Y-right
+ in POS for stem S. This Y position is relative to S. */
Real
Beam::calc_stem_y (Grob *me, Grob* s, Grob ** common,
Real xl, Real xr,