From: Han-Wen Nienhuys Date: Tue, 27 Sep 2005 12:32:12 +0000 (+0000) Subject: * lily/stem-tremolo.cc (raw_stencil): read slope property. X-Git-Tag: release/2.7.11~11 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=01afb846676872dca8f4dfb14f1ea83fecaf6b3c;p=lilypond.git * lily/stem-tremolo.cc (raw_stencil): read slope property. * 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. --- diff --git a/ChangeLog b/ChangeLog index 8a327aa9a7..d11701d892 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2005-09-27 Han-Wen Nienhuys + * lily/stem-tremolo.cc (raw_stencil): read slope property. + * lily/include/paper-system.hh (class Paper_system): remove staff_extents_ member. diff --git a/Documentation/topdocs/NEWS.tely b/Documentation/topdocs/NEWS.tely index e8e8e50510..67757d8e3b 100644 --- a/Documentation/topdocs/NEWS.tely +++ b/Documentation/topdocs/NEWS.tely @@ -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}, diff --git a/input/regression/music-map.ly b/input/regression/music-map.ly index c381b74e0a..86057ddbb8 100644 --- a/input/regression/music-map.ly +++ b/input/regression/music-map.ly @@ -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 - << pplyMusic #(lambda (x) (music-map notes-to-skip x)) + << \applyMusic #(lambda (x) (music-map notes-to-skip x)) \foobar { d2 d2 } >> } diff --git a/input/wilhelmus.ly b/input/wilhelmus.ly index d7cbcf5026..07d7cc1ee9 100644 --- a/input/wilhelmus.ly +++ b/input/wilhelmus.ly @@ -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 = { diff --git a/lily/include/paper-system.hh b/lily/include/paper-system.hh index 7cf6285ed5..b86077cc7d 100644 --- a/lily/include/paper-system.hh +++ b/lily/include/paper-system.hh @@ -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; }; diff --git a/lily/paper-system.cc b/lily/paper-system.cc index 0d206a0aae..b99458ec5b 100644 --- a/lily/paper-system.cc +++ b/lily/paper-system.cc @@ -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 (); } diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index dc7bc03573..167c87a474 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -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"); diff --git a/scm/page-layout.scm b/scm/page-layout.scm index 172b5f4ff7..11219da49a 100644 --- a/scm/page-layout.scm +++ b/scm/page-layout.scm @@ -28,7 +28,8 @@ "\n"))) (define-method (node-system-numbers (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))))