]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.127.jcn3
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 2 Feb 2001 10:29:22 +0000 (11:29 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 2 Feb 2001 10:29:22 +0000 (11:29 +0100)
1.3.127.jcn3
============

* Small beam cleanup, changed y-position-hs,height-hs user overrides to
  staff-position,height (height:name suggestions?), now in staff-spaces.

CHANGES
Documentation/user/refman.itely
Documentation/user/tricks.itely
VERSION
input/features/beam-position.ly
lily/beam.cc
scm/beam.scm
scm/generic-property.scm
scm/grob-property-description.scm
scm/interface-description.scm

diff --git a/CHANGES b/CHANGES
index 0d4c60ba31c25625f087a6dbde9fd547d920343d..7a2644bad93edd5e4c311290492eaa2cfb230381 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+1.3.127.jcn3
+============
+
+* Small beam cleanup, changed y-position-hs,height-hs user overrides to
+  staff-position,height (height:name suggestions?), now in staff-spaces.
+
 1.3.127.jcn2
 ============
 
index 57a51016beccc4a563202214f57c9550cbe4de47..dce6226bdd6b5f51ca6502f8230611e87560f169 100644 (file)
@@ -312,6 +312,13 @@ numbers and dots.
 @node Modifying music
 @section Modifying music
 @cindex Modifying music
+
+FIXME: more verbose titling:
+music expressions?
+Repeat?
+Repeated music?
+Repeating music expressions?
+
 @menu
 * Relative::                    
 * Transpose::                   
@@ -1157,6 +1164,10 @@ warning message will appear and no ties will be created.
 @subsubsection Tuplet
 @cindex Tuplet
 
+A @rgrob{TupletBracket} is typeset automatically for music that
+is time scaled, see @ref{Times}.
+
+
 See @ref{Times}.
 
 @c.   {Volta}
@@ -1164,7 +1175,9 @@ See @ref{Times}.
 @subsubsection Volta
 @cindex Volta
 
-See @ref{Repeat}.
+A @rgrob{VoltaBracket} is typeset automatically for music that contains a
+repetition, see @ref{Repeat}.
+
 
 @c.   {Crescendo and Decrescendo}
 @node Crescendo and Decrescendo
index f1525f530f00b766e41ad792a34cb870cb1cb4bd..7f6a5d1fb18e1973344bb5dc9217613fe0c4b4d1 100644 (file)
@@ -133,26 +133,26 @@ extension can be controlled through @code{Voice.Stem}'s grob-property
 @end quotation
 
 The beam symbol can be tweaked through @code{Voice.Beam}'s
-grob-properties @code{height-hs} and @code{y-position-hs}.
+grob-properties @code{height} and @code{staff-position},
+in staff-spaces.
 
-Set @code{height-hs} to zero, to get horizontal beams:
+Set @code{height} to zero, to get horizontal beams:
 
 @quotation
 @lilypond[fragment,relative,verbatim]
   \property Voice.Beam \set #'direction = #1
-  \property Voice.Beam \set #'height-hs = #0
+  \property Voice.Beam \set #'height = #0
   [a''8 e' d c]
 @end lilypond
 @end quotation
 
-Both are in half spaces.  Here's how you'd specify a weird looking beam
-that instead of being horizontal, falls two staff spaces (ie, four half
-spaces):
+Here's how you'd specify a weird looking beam that instead of being
+horizontal, falls two staff spaces:
 
 @quotation
 @lilypond[fragment,relative,verbatim]
-  \property Voice.Beam \set #'y-position-hs = #4
-  \property Voice.Beam \set #'height-hs = #-4
+  \property Voice.Beam \set #'staff-position = #2
+  \property Voice.Beam \set #'height = #-2
   [c'8 c] 
 @end lilypond
 @end quotation
diff --git a/VERSION b/VERSION
index 4606ef3a639a9baebfefe99f702173902dd6c28f..bd5dec172ac6eff5abf5a8ec451d670e504ff5e0 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=127
-MY_PATCH_LEVEL=jcn2
+MY_PATCH_LEVEL=jcn3
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index bf14a7fee8c92c256eb78358cf3c9704aa531b0e..b581904761dc6d9614ba360df9759db3094ac754 100644 (file)
@@ -1,7 +1,7 @@
 
 fragment = \notes {
-  \property Voice.Beam \set #'y-position-hs = #4
-  \property Voice.Beam \set #'height-hs = #-4
+  \property Voice.Beam \set #'staff-position = #2
+  \property Voice.Beam \set #'height = #-2
   [c'8 c]
 }
 
index f7c2f126ebfe88643961837a5c8af422a272fc29..d58054aa8f3c13c095ca3120c0f3490457504a1d 100644 (file)
 /*
   [TODO]
 
-  * remove *-hs variables, and do all y-position stuff in staff-space.
-    This is not trivial, as Stem, and Stem_info both use point dimensions
-    (indicated by _f suffix) in several places too.
-
   * shorter! (now +- 1000 lines)
   * less hairy code
-  * move paper vars to scm
-
   */
 
 
@@ -331,6 +325,7 @@ Beam::least_squares (SCM smob)
   Real y = 0;
   Real dy = 0;
 
+  /* Stem_info, and thus y,dy in this function are corrected for beam-dir */
   Real first_ideal = Stem::calc_stem_info (first_visible_stem (me)).idealy_f_;
   if (first_ideal == Stem::calc_stem_info (last_visible_stem (me)).idealy_f_)
     {
@@ -361,8 +356,10 @@ Beam::least_squares (SCM smob)
       dy = dydx * dx;
     }
 
-  me->set_grob_property ("y", gh_double2scm (y));
-  me->set_grob_property ("dy", gh_double2scm (dy));
+  /* Store true, not dir-corrected values */
+  Direction dir = Directional_element_interface::get (me);
+  me->set_grob_property ("y", gh_double2scm (y * dir));
+  me->set_grob_property ("dy", gh_double2scm (dy * dir));
   return SCM_UNSPECIFIED;
 }
 
@@ -375,9 +372,11 @@ Beam::cancel_suspect_slope (SCM smob)
   if (visible_stem_count (me) <= 1)
     return SCM_UNSPECIFIED;
   
-  Real y = gh_scm2double (me->get_grob_property ("y"));
-  Real dy = gh_scm2double (me->get_grob_property ("dy"));
-
+  /* Stem_info, and thus y,dy in this function are corrected for beam-dir */
+  Direction dir = Directional_element_interface::get (me);
+  Real y = gh_scm2double (me->get_grob_property ("y")) * dir;
+  Real dy = gh_scm2double (me->get_grob_property ("dy")) * dir;
+  
  /* steep slope running against lengthened stem is suspect */
   Real first_ideal = Stem::calc_stem_info (first_visible_stem (me)).idealy_f_;
   Real last_ideal = Stem::calc_stem_info (last_visible_stem (me)).idealy_f_;
@@ -392,7 +391,8 @@ Beam::cancel_suspect_slope (SCM smob)
       || ((y + dy - last_ideal > lengthened) && (dydx < -steep)))
     {
       Real adjusted_y = y + dy / 2;
-      me->set_grob_property ("y", gh_double2scm (adjusted_y));
+      /* Store true, not dir-corrected values */
+      me->set_grob_property ("y", gh_double2scm (adjusted_y * dir));
       me->set_grob_property ("dy", gh_double2scm (0)); 
     }
   return SCM_UNSPECIFIED;
@@ -417,8 +417,10 @@ Beam::slope_damping (SCM smob)
 
   if (damping)
     {
-      Real y = gh_scm2double (me->get_grob_property ("y"));
-      Real dy = gh_scm2double (me->get_grob_property ("dy"));
+      /* y,dy in this function are corrected for beam-dir */
+      Direction dir = Directional_element_interface::get (me);
+      Real y = gh_scm2double (me->get_grob_property ("y")) * dir;
+      Real dy = gh_scm2double (me->get_grob_property ("dy")) * dir;
       
       // ugh -> use commonx
       Real dx = last_visible_stem (me)->relative_coordinate (0, X_AXIS)
@@ -428,8 +430,9 @@ Beam::slope_damping (SCM smob)
 
       Real damped_dy = dydx * dx;
       Real adjusted_y = y + (dy - damped_dy) / 2;
-      me->set_grob_property ("y", gh_double2scm (adjusted_y));
-      me->set_grob_property ("dy", gh_double2scm (damped_dy));
+      /* Store true, not dir-corrected values */
+      me->set_grob_property ("y", gh_double2scm (adjusted_y * dir));
+      me->set_grob_property ("dy", gh_double2scm (damped_dy * dir));
     }
     return SCM_UNSPECIFIED;
 }
@@ -458,8 +461,10 @@ Beam::quantise_dy (SCM smob)
   
   if (a.size () > 1)
     {
-      Real y = gh_scm2double (me->get_grob_property ("y"));
-      Real dy = gh_scm2double (me->get_grob_property ("dy"));
+      /* y,dy in this function are corrected for beam-dir */
+      Direction dir = Directional_element_interface::get (me);
+      Real y = gh_scm2double (me->get_grob_property ("y")) * dir;
+      Real dy = gh_scm2double (me->get_grob_property ("dy")) * dir;
 
       Real staff_space = Staff_symbol_referencer::staff_space (me);
       
@@ -470,58 +475,37 @@ Beam::quantise_dy (SCM smob)
       
       Real quantised_dy = q * sign (dy);
       Real adjusted_y = y + (dy - quantised_dy) / 2;
-      me->set_grob_property ("y", gh_double2scm (adjusted_y));
-      me->set_grob_property ("dy", gh_double2scm (quantised_dy));
+      /* Store true, not dir-corrected values */
+      me->set_grob_property ("y", gh_double2scm (adjusted_y * dir));
+      me->set_grob_property ("dy", gh_double2scm (quantised_dy * dir));
     }
   return SCM_UNSPECIFIED;
 }
 
-
-/*
-  What to do?  Why do we have two dimensions (staff-position and
-  staff-space)?  Do other grobs export staff-position to the user,
-  should we junk that?
-  
-  height-hs -> staff-position-height
-  y-position-hs -> staff-position
-
-  or
-
-  height-hs -> height / 2
-  y-postion-hs -> y-position / 2
-
-  
-  UGHUGH.  IF this callback is omitted, we hang.
-  FIXME: until here, we used only stem_info, which acts as if dir=up.
-*/
+/* It's tricky to have the user override y,dy directly, so we use this
+   translation func.  Also, if our staff_space != 1 (smaller staff, eg),
+   user will expect staff-position to be discrete values. */
 MAKE_SCHEME_CALLBACK (Beam, user_override, 1);
 SCM
 Beam::user_override (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  Real half_space = Staff_symbol_referencer::staff_space (me) / 2;
-
-  Real y = gh_scm2double (me->get_grob_property ("y"));
-  Real dy = gh_scm2double (me->get_grob_property ("dy"));
+  Real staff_space = Staff_symbol_referencer::staff_space (me);
 
-  
-  SCM s = me->get_grob_property ("y-position-hs");
+  SCM s = me->get_grob_property ("staff-position");
   if (gh_number_p (s))
-    y = gh_scm2double (s) * half_space;
-  else
-    // ughugh
-    y *= Directional_element_interface::get (me);
+    {
+      Real y = gh_scm2double (s) * staff_space;
+      me->set_grob_property ("y", gh_double2scm (y));
+    }
 
-  s = me->get_grob_property ("height-hs");
+  /* Name suggestions? Tilt, slope, vertical-* ? */
+  s = me->get_grob_property ("height");
   if (gh_number_p (s))
-    dy = gh_scm2double (s) * half_space;
-  else
-    // ughugh
-    dy *= Directional_element_interface::get (me);
-
-  
-  me->set_grob_property ("y", gh_double2scm (y));
-  me->set_grob_property ("dy", gh_double2scm (dy));
+    {
+      Real dy = gh_scm2double (s) * staff_space;
+      me->set_grob_property ("dy", gh_double2scm (dy));
+    }
   
   return SCM_UNSPECIFIED;
 }
index 8ae7f3004472b6ea86acaa7eefff4a10954e2513..3fa8fc33ce8d415ceccd27cc0d64bef05aef21c7 100644 (file)
 
 ;; TODO
 ;;  - take #forced stems into account (now done in C++)?
-;;  - take y-position of chord or beam into account
+;;  - take staff-position of chord or beam into account
 
index f7256676a6346fc9930d7b6f8a9a17b9a0f4f5bf..81b181683dadab4a2b60e9245bd5cf5d21fdd5e6 100644 (file)
@@ -25,8 +25,8 @@
         (list 'autoKneeGap number? 'auto-knee-gap)
         (list 'autoInterstaffKneeGap number? 'auto-interstaff-knee-gap)
         (list 'beamDirAlgorithm symbol? 'beam-dir-algorithm)
-        (list 'beamHeight number? 'height-hs)
-        (list 'beamVerticalPosition number? 'y-position-hs)
+        (list 'beamHeight number? 'height)
+        (list 'beamVerticalPosition number? 'staff-position)
         )
        )
   )
index 8eb13e78ce5fa9e255d4913dbe78e043d0de19f8..6de59927dae6f4d96d4048eb7bce5a984628112b 100644 (file)
@@ -107,6 +107,7 @@ Align_interface::center_on_element). .")
 (grob-property-description 'dot-count integer? "number of dots.")
 (grob-property-description 'duration-log integer? "2-log of the notehead duration.")
 (grob-property-description 'duration-log integer? "log of the duration, ie. 0=whole note, 1 = half note, etc.")
+(grob-property-description 'dy number? "set by beam: vertical travel height")
 (grob-property-description 'edge-height pair? "a cons that specifies the heights of the vertical egdes '(LEFT-height . RIGHT-height).")
 (grob-property-description 'edge-text pair? "a cons that specifies the texts to be set at the edges '(LEFT-text . RIGHT-text).")
 (grob-property-description 'elements list? "list of grobs, type depending on the Grob where this is set in.")
@@ -156,8 +157,7 @@ is used by @ref{note-collision-interface}.")
 FIXME: in Tie this is a pair of grob pointers, pointing to the two heads of the  tie.
 
 .")
-(grob-property-description 'height number? "in staffspace .")
-(grob-property-description 'height-hs number? "in halfspace.  Only used by Beam.") ; Remove-me 
+(grob-property-description 'height number? "in staffspace.")
 (grob-property-description 'height-quants procedure? "function of type (beam staff-line-thickness) -> list of quants.  Default value: default-beam-dy-quants.
 .")
 (grob-property-description 'horizontal-shift integer? "integer that identifies ranking of note-column for horizontal shifting. This is used by @ref{note-collision-interface}.")
@@ -318,5 +318,4 @@ function of type (beam multiplicity dy staff-line-thickness) -> real.  Default v
 (grob-property-description 'word-space number? "elongate left by this much (FIXME: cumbersome semantics).")
 (grob-property-description 'x-gap number? "horizontal gap between notehead and tie.")
 (grob-property-description 'y-free number? "minimal vertical gap between slur and noteheads or stems.")
-(grob-property-description 'y-position number? "position of left edge.")
-(grob-property-description 'y-position-hs number? "in half space, position of left edge.  Only used by @ref{Beam}.") ;FXIME
+(grob-property-description 'y number? "set by beam: position of left edge.")
index 0806189af77f2bd502b3d4499c44cc26579b8d17..60f0a19779dd09aef08e0f041f48a4a23dc6fb76 100644 (file)
@@ -70,7 +70,7 @@
 #'thickness= weight of beams, in staffspace
   "
    '(
-    y-position 
+     staff-position
     height 
     flag-width-function 
     damping