]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/stem-tremolo.cc (raw_stencil): read slope property.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 27 Sep 2005 12:32:12 +0000 (12:32 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 27 Sep 2005 12:32:12 +0000 (12:32 +0000)
* lily/include/paper-system.hh (class Paper_system): remove
staff_extents_ member.

* lily/include/paper-system.hh (class Paper_system): remove
number_ variable. Remove is_title_. Remove break_before_penalty_

* scm/lily-library.scm (paper-system-title?): new function.

* scm/page-layout.scm (ly:optimal-page-breaks): read next-space
and next-padding.
(optimal-page-breaks): rename from ly:optimal-page-breaks.

* lily/paper-system.cc (internal_get_property): new function.

* scm/page-layout.scm (ly:optimal-page-breaks): add support for
pagetopspace

* lily/paper-system.cc (read_left_bound): new function. Read
line-break-system-details from left bound to determine extents.

ChangeLog
Documentation/topdocs/NEWS.tely
input/regression/music-map.ly
input/wilhelmus.ly
lily/include/paper-system.hh
lily/paper-system.cc
lily/stem-tremolo.cc
scm/page-layout.scm

index 8a327aa9a7eb261417884c4be307db6186aa8462..d11701d8928b931508fccfba9409e7d19714428c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2005-09-27  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/stem-tremolo.cc (raw_stencil): read slope property.
+
        * lily/include/paper-system.hh (class Paper_system): remove
        staff_extents_ member.
 
index e8e8e50510bf8fca78c7207b59f6ef0ea846aa3f..67757d8e3b2b4769de019f00dcb15da9825cc9f7 100644 (file)
@@ -45,10 +45,22 @@ This document is also available in @uref{NEWS.pdf,PDF}.
 
 
 @itemize @bullet
+@item
+The slope of a stem-tremolo may be set manually
+
+@lilypond[fragment,relative=1,raggedright]
+c8:16[ 
+\once \override StemTremolo #'slope = #0.45
+c:16 c:16 c:16 ]
+@end lilypond 
+
+This feature was sponsored by Sven Axelsson.
 
 @item 
 Vertical spacing for page layout can now be tuned for each system
-individually.  This feature was sponsored by Trevor Baca.
+individually.  
+
+This feature was sponsored by Trevor Baca.
 
 @item
 Laissez vibrer ties can be created with @code{\laissezVibrer},
index c381b74e0a01c54f9afa7dc41c3e051950faea94..86057ddbb80e9bfb14ff26e764f24c68d784166b 100644 (file)
@@ -2,11 +2,11 @@
 
   texidoc =
 
-  "With @code{music-map}, you can apply functions operating on a single
-piece of music to an entire music expression. In this example, the the
-function @code{notes-to-skip} changes a note to a skip. When applied
-to an entire music expression in the 1st measure, the scripts and
-dynamics are left over. These are put onto the 2nd measure."
+  "With @code{music-map}, you can apply functions operating on a
+single piece of music to an entire music expression. In this example,
+the the function @code{notes-to-skip} changes a note to a skip. When
+applied to an entire music expression in the 1st measure, the scripts
+and dynamics are left over. These are put onto the 2nd measure."
 
 }
 
@@ -35,7 +35,7 @@ foobar =  \transpose c c' { c4\>-^ c4-^ c4\!-^ c4-^  }
 \relative c''  \context Voice {
   \foobar
 
-  << \applyMusic #(lambda (x) (music-map notes-to-skip x))
+  << \applyMusic #(lambda (x) (music-map notes-to-skip x))
      \foobar
      { d2 d2 } >> 
 }
index d7cbcf502681304e35eea8e47bfb25665ff88f6f..07d7cc1ee9843473d97bd45a2088df8c9f17c1a7 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.6.0"
+\version "2.7.10"
 
 \header {
   texidoc = "Wilhelmus van Nassouwe"
@@ -35,15 +35,15 @@ noclefs =  {
 setMargins = {
   %% first line left margin
   %% justified:
-  %% \context Staff \applycontext #(set-extra-space 'TimeSignature 'first-note 4.5)
+  %% \context Staff \applyContext #(set-extra-space 'TimeSignature 'first-note 4.5)
   %% raggedright:
-  \context Staff \applycontext #(set-extra-space 'TimeSignature 'first-note 9.5)
+  \context Staff \applyContext #(set-extra-space 'TimeSignature 'first-note 9.5)
   
   %% next lines left margin
-  \context Staff \applycontext #(set-extra-space 'KeySignature 'staff-bar 15)
+  \context Staff \applyContext #(set-extra-space 'KeySignature 'staff-bar 15)
   
   %% next lines small key-signature margin
-  \context Staff \applycontext #(set-extra-space 'LeftEdge 'key-signature 1.0)
+  \context Staff \applyContext #(set-extra-space 'LeftEdge 'key-signature 1.0)
 }
 
 pipeSymbol = {
index 7cf6285ed503b25dc1836d13fb7d7296889b9de8..b86077cc7d2c3186eaf20284b20918c8aafe9448 100644 (file)
@@ -33,6 +33,7 @@ public:
   SCM internal_get_property (SCM sym) const;
   void internal_set_property (SCM sym, SCM val);
   bool is_title () const;
+
   Real break_before_penalty () const;
 };
 
index 0d206a0aae64135f1c7fcd00953ce44034eeeb7c..b99458ec5b48a8abd28630e8722aab836bad18a6 100644 (file)
@@ -34,6 +34,7 @@ Paper_system::mark_smob (SCM smob)
 {
   Paper_system *system = (Paper_system *) SCM_CELL_WORD_1 (smob);
   scm_gc_mark (system->mutable_property_alist_);
+  scm_gc_mark (system->immutable_property_alist_);
   return system->stencil_.expr ();
 }
 
index dc7bc0357349effde51578c6723095e624a41f39..167c87a47482e493db681edd6d522f5dee691efd 100644 (file)
@@ -54,22 +54,27 @@ Stem_tremolo::raw_stencil (Grob *me)
 {
   Grob *stem = unsmob_grob (me->get_object ("stem"));
   Spanner *beam = Stem::get_beam (stem);
-  Real dydx;
-  if (beam)
+
+  SCM slope = me->get_property ("slope");
+  Real dydx = 0.25;
+  if (scm_is_number (slope))
     {
-      Real dy = 0;
-      SCM s = beam->get_property ("positions");
-      if (is_number_pair (s))
-       dy = -scm_to_double (scm_car (s)) +scm_to_double (scm_cdr (s));
-
-      Real dx = Beam::last_visible_stem (beam)->relative_coordinate (0, X_AXIS)
-       - Beam::first_visible_stem (beam)->relative_coordinate (0, X_AXIS);
-      dydx = dx ? dy / dx : 0;
+      dydx = robust_scm2double (slope, 0.0);
     }
   else
-    // urg
-    dydx = 0.25;
-
+    {
+      if (beam)
+       {
+         Real dy = 0;
+         SCM s = beam->get_property ("positions");
+         if (is_number_pair (s))
+           dy = - scm_to_double (scm_car (s)) + scm_to_double (scm_cdr (s));
+
+         Real dx = Beam::last_visible_stem (beam)->relative_coordinate (0, X_AXIS)
+           - Beam::first_visible_stem (beam)->relative_coordinate (0, X_AXIS);
+         dydx = dx ? dy / dx : 0;
+       }
+    }
   Real ss = Staff_symbol_referencer::staff_space (me);
   Real thick = robust_scm2double (me->get_property ("beam-thickness"), 1);
   Real width = robust_scm2double (me->get_property ("beam-width"), 1);
@@ -172,4 +177,8 @@ Stem_tremolo::print (SCM grob)
 
 ADD_INTERFACE (Stem_tremolo, "stem-tremolo-interface",
               "A beam slashing a stem to indicate a tremolo.",
-              "stem beam-width beam-thickness flag-count");
+              "stem "
+              "slope "
+              "beam-width "
+              "beam-thickness "
+              "flag-count");
index 172b5f4ff76af317b1b1fb20384d01634b2591ba..11219da49ac807288f4159fabe1481c022656006 100644 (file)
@@ -28,7 +28,8 @@
        "\n")))
 
 (define-method (node-system-numbers (node <optimally-broken-page-node>))
-  (map ly:paper-system-property (node-lines node) 'number))
+  (map (lambda (ps) (ly:paper-system-property ps 'number))
+       (node-lines node)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
@@ -471,8 +472,6 @@ DONE."
   (set! force-equalization-factor
        (ly:output-def-lookup paper 'verticalequalizationfactor 0.3))
 
-  (display lines)
-  
   (let* ((best-break-node (walk-lines '() '() lines))
         (break-nodes (get-path best-break-node '()))
         (last-node (car (last-pair break-nodes))))