]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.21
authorfred <fred>
Tue, 26 Mar 2002 22:45:08 +0000 (22:45 +0000)
committerfred <fred>
Tue, 26 Mar 2002 22:45:08 +0000 (22:45 +0000)
input/test/beam-control.fly [new file with mode: 0644]
lily/beam.cc
lilypond-mode.el
ly/init.fly
ly/init.sly
scm/generic-property.scm

diff --git a/input/test/beam-control.fly b/input/test/beam-control.fly
new file mode 100644 (file)
index 0000000..761628d
--- /dev/null
@@ -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]
index 6fe8f9b5254c54b3f76da16c1eba6fe0f788493c..e3d816526dc31cd1ee4f699e661446ad210410bf 100644 (file)
@@ -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)); 
 }
 
 /*
index e4e6e4d2348fa0fe1a7294759c37f114d815a365..a6c7d67787b83e4d08462cc402511cfbd889a8d5 100644 (file)
   (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))))
 
index 8786d94ed8502d405d96f6c9db06e788d327ff62..6c9992e379dc81b2cd1dd7ec950d7f3e68c9a4d5 100644 (file)
@@ -6,9 +6,9 @@
 \include "declarations.ly"
 
 \score { 
-  \notes\relative c {
+  \context Voice \notes\relative c {
     \maininput
   }
   \paper { }  
-  \midi{ }
+  \midi { }
 }
index ea78a1782eb2f6b88b9cc273830bdadba9e4cc17..afe59cc20e36f02420466175c94d3be5dfe2dc11 100644 (file)
@@ -6,7 +6,7 @@
 \include "declarations.ly"
 
 \score { 
-  \notes\relative c {
+  \context Voice \notes\relative c {
     \maininput
   }
   \paper {
index 533c663b89936ac989759c0a1f0b8fd9bd128958..fcf6fcbfb69669eb57bbcf1ddb069183c458a2ac 100644 (file)
@@ -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)
         )
        )
   )