From 8ef2a2e0109f6d6db85cc3f2c1f3421935b04192 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Wed, 19 Jan 2000 17:45:57 +0100 Subject: [PATCH] patch::: 1.3.20.jcn1 1.3.20.jcn1 ========== * SCM properties beamHeight and beamVerticalposition now use staff-spaces: input/test/beam-control.fly * Added \context Voice to .fly and .sly; the default \context Staff is almost never what you expect * Fixed decision for .sly/.fly in lilypond-mode. --- CHANGES | 9 +++++++++ VERSION | 2 +- input/test/beam-control.fly | 16 ++++++++++++++++ lily/beam.cc | 27 +++++++++++++++------------ lilypond-mode.el | 6 +++--- ly/init.fly | 4 ++-- ly/init.sly | 2 +- scm/generic-property.scm | 4 ++-- 8 files changed, 49 insertions(+), 21 deletions(-) create mode 100644 input/test/beam-control.fly diff --git a/CHANGES b/CHANGES index 01c0f2c09e..e37a5a70e8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,12 @@ +1.3.20.jcn1 +========== + +* SCM properties beamHeight and beamVerticalposition now use staff-spaces: + input/test/beam-control.fly +* Added \context Voice to .fly and .sly; the default \context Staff is almost + never what you expect +* Fixed decision for .sly/.fly in lilypond-mode. + 1.3.19.hwn1 ========== diff --git a/VERSION b/VERSION index 3c2e8037c5..a0a9e46b93 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=20 -MY_PATCH_LEVEL= +MY_PATCH_LEVEL=jcn1 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/test/beam-control.fly b/input/test/beam-control.fly new file mode 100644 index 0000000000..ba927360c0 --- /dev/null +++ b/input/test/beam-control.fly @@ -0,0 +1,16 @@ +% beam-control.fly + +% from upper staffline to centre +\property Voice.beamVerticalPosition = #2 +\property Voice.beamHeight = #2 +[c'8 c] + +% from one above centre to centre +\property Voice.beamVerticalPosition = #2 +\property Voice.beamHeight = #-1 +[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..44714c7d70 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -284,18 +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 staff_space = st.staff_space (); + + /* check for user-override of dy */ + SCM s = remove_elt_property ("Height"); if (gh_number_p (s)) - dy = gh_scm2double (s); - else - set_elt_property ("height", gh_double2scm (dy)); + { + dy = gh_scm2double (s) * staff_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 ("verticalPosition"); if (gh_number_p (s)) { - y = gh_scm2double (s); + y = gh_scm2double (s) * staff_space; set_stem_length (y, dy); } else @@ -307,7 +311,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) { @@ -323,10 +326,10 @@ Beam::do_post_processing () 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_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..ff15c7c2a1 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) + (list 'beamVerticalPosition number? 'verticalPosition) ) ) ) -- 2.39.5