From 1fc600282e9c26760fc9b4e31029adbcbc3b183e Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 22:45:08 +0000 Subject: [PATCH] lilypond-1.3.21 --- input/test/beam-control.fly | 16 ++++++++++++++++ lily/beam.cc | 31 ++++++++++++++++--------------- lilypond-mode.el | 6 +++--- ly/init.fly | 4 ++-- ly/init.sly | 2 +- scm/generic-property.scm | 4 ++-- 6 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 input/test/beam-control.fly diff --git a/input/test/beam-control.fly b/input/test/beam-control.fly new file mode 100644 index 0000000000..761628da71 --- /dev/null +++ b/input/test/beam-control.fly @@ -0,0 +1,16 @@ +% beam-control.fly + +% from upper staffline (position 4) to centre (position 0) +\property Voice.beamVerticalPosition = #4 +\property Voice.beamHeight = #-4 +[c'8 c] + +% from center to one above centre (position 2) +\property Voice.beamVerticalPosition = #0 +\property Voice.beamHeight = #2 +[c c] + +% normal beam-algorithm +\property Voice.beamHeight = ##f +\property Voice.beamVerticalPosition = ##f +[c e] [e c] diff --git a/lily/beam.cc b/lily/beam.cc index 6fe8f9b525..e3d816526d 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -284,19 +284,22 @@ Beam::do_post_processing () y *= directional_element (this).get (); dy *= directional_element (this).get (); - /* set or read dy as necessary */ - SCM s = get_elt_property ("height"); + Staff_symbol_referencer_interface st (this); + Real half_space = st.staff_space () / 2; + + /* check for user-override of dy */ + SCM s = remove_elt_property ("height-hs"); if (gh_number_p (s)) - dy = gh_scm2double (s); - else - set_elt_property ("height", gh_double2scm (dy)); + { + dy = gh_scm2double (s) * half_space; + } + set_elt_property ("height", gh_double2scm (dy)); - /* set or read y as necessary */ - s = get_elt_property ("y-position"); + /* check for user-override of y */ + s = remove_elt_property ("y-position-hs"); if (gh_number_p (s)) { - y = gh_scm2double (s); - set_stem_length (y, dy); + y = gh_scm2double (s) * half_space; } else { @@ -307,8 +310,6 @@ Beam::do_post_processing () set_stem_length (y, dy); y_shift = check_stem_length_f (y, dy); - Staff_symbol_referencer_interface st (this); - Real half_space = st.staff_space () / 2; if (y_shift > half_space / 4) { y += y_shift; @@ -321,12 +322,12 @@ Beam::do_post_processing () if (abs (y_shift) > half_space / 2) quant_dir = sign (y_shift) * directional_element (this).get (); y = quantise_y_f (y, dy, quant_dir); - set_stem_length (y, dy); } - - // UGH. Y is not in staff position unit? - set_elt_property ("y-position", gh_double2scm (y)); } + // UGH. Y is not in staff position unit? + // Ik dacht datwe daar juist van weg wilden? + set_stem_length (y, dy); + set_elt_property ("y-position", gh_double2scm (y)); } /* diff --git a/lilypond-mode.el b/lilypond-mode.el index e4e6e4d234..a6c7d67787 100644 --- a/lilypond-mode.el +++ b/lilypond-mode.el @@ -184,9 +184,9 @@ (let ((basename "emacs-lily") (suffix (if (string-match "^[\\]score" (buffer-substring start end)) ".ly" - (if (> 50 (abs (- start end))) - ".fly") - ".sly"))) + (if (< 50 (abs (- start end))) + ".fly" + ".sly")))) (write-region start end (concat basename suffix) nil 'nomsg) (lily-compile-file lily-command lily-parameters (concat basename suffix)))) diff --git a/ly/init.fly b/ly/init.fly index 8786d94ed8..6c9992e379 100644 --- a/ly/init.fly +++ b/ly/init.fly @@ -6,9 +6,9 @@ \include "declarations.ly" \score { - \notes\relative c { + \context Voice \notes\relative c { \maininput } \paper { } - \midi{ } + \midi { } } diff --git a/ly/init.sly b/ly/init.sly index ea78a1782e..afe59cc20e 100644 --- a/ly/init.sly +++ b/ly/init.sly @@ -6,7 +6,7 @@ \include "declarations.ly" \score { - \notes\relative c { + \context Voice \notes\relative c { \maininput } \paper { diff --git a/scm/generic-property.scm b/scm/generic-property.scm index 533c663b89..fcf6fcbfb6 100644 --- a/scm/generic-property.scm +++ b/scm/generic-property.scm @@ -6,8 +6,8 @@ (list 'autoKneeGap number? 'auto-knee-gap) (list 'autoInterstaffKneeGap number? 'auto-interstaff-knee-gap) (list 'beamDirAlgorithm symbol? 'beam-dir-algorithm) - (list 'beamSlope number? 'height) - (list 'beamVerticalPosition number? 'y-position) + (list 'beamHeight number? 'height-hs) + (list 'beamVerticalPosition number? 'y-position-hs) ) ) ) -- 2.39.5