--- /dev/null
+% 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]
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
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 = 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));
}
/*
(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))))
(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)
)
)
)