From e012a172277f78d4954d269fd4973ad3fd6e5d60 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 20 Jul 2006 10:42:21 +0000 Subject: [PATCH] * scm/define-grob-properties.scm (all-user-grob-properties): add strict-grace-spacing * lily/spacing-determine-loose-columns.cc (is_loose_column): support float_grace_columns_. * Documentation/topdocs/NEWS.tely (Top): doc tupletFullLengthNote. * input/regression/spacing-loose-grace.ly: new file. * Documentation/topdocs/NEWS.tely (Top): document new feature. --- ChangeLog | 11 +++++++++ Documentation/topdocs/NEWS.tely | 25 +++++++++++++++++++++ input/regression/spacing-loose-grace.ly | 30 +++++++++++++++++++++++++ lily/include/spacing-spanner.hh | 3 ++- lily/spacing-basic.cc | 24 -------------------- lily/spacing-determine-loose-columns.cc | 3 ++- lily/spacing-loose-columns.cc | 3 +-- scm/define-grob-properties.scm | 2 ++ 8 files changed, 73 insertions(+), 28 deletions(-) create mode 100644 input/regression/spacing-loose-grace.ly diff --git a/ChangeLog b/ChangeLog index e65e10d455..852e9973c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2006-07-20 Han-Wen Nienhuys + * lily/spacing-determine-loose-columns.cc (is_loose_column): + support float_grace_columns_. + + * lily/spacing-options.cc (init_from_grob): new file. + + * Documentation/topdocs/NEWS.tely (Top): doc tupletFullLengthNote. + + * input/regression/spacing-loose-grace.ly: new file. + + * Documentation/topdocs/NEWS.tely (Top): document new feature. + * lily/tuplet-engraver.cc (struct Tuplet_description): read tupletFullLengthNote too. Choose right bound depending on value. diff --git a/Documentation/topdocs/NEWS.tely b/Documentation/topdocs/NEWS.tely index f357cd2611..98c083dd82 100644 --- a/Documentation/topdocs/NEWS.tely +++ b/Documentation/topdocs/NEWS.tely @@ -65,6 +65,31 @@ which scares away people. * only show user-visible changes. @end ignore + +@item +Tuplet brackets can be made to run to prefatory matter or +the next note + +@lilypond[ragged-right] +\new RhythmicStaff { + \set tupletFullLength = ##t + \time 4/4 + \times 4/5 { + c4 c1 + } + \set tupletFullLengthNote = ##t + \time 2/4 + \times 2/3 { + c4 c c + } + \time 3/4 + c4 +} +@end lilypond + + +This feature was sponsored by Trevor Bača. + @item Falls and doits can be added to notes diff --git a/input/regression/spacing-loose-grace.ly b/input/regression/spacing-loose-grace.ly new file mode 100644 index 0000000000..2d3d2432c0 --- /dev/null +++ b/input/regression/spacing-loose-grace.ly @@ -0,0 +1,30 @@ + +\header + +{ + + texidoc = "With @code{strict-grace-spacing}, grace notes don't influence +spacing." + +} + +\version "2.9.12" +\paper { + ragged-right = ##t +} + +<< + \override Score.SpacingSpanner #'strict-grace-spacing = ##t + \new Staff { + c'4 + \afterGrace + c'4 + { c'16[ c'16 c'16 c'16] } + c'4 + } + \new Staff { + c'16[ c'16 c'16 c'16] + c'16[ c'16 c'16 c'16] + c'4 + } +>> diff --git a/lily/include/spacing-spanner.hh b/lily/include/spacing-spanner.hh index 7f560e2880..a8d9888397 100644 --- a/lily/include/spacing-spanner.hh +++ b/lily/include/spacing-spanner.hh @@ -19,11 +19,12 @@ struct Spacing_options bool packed_; bool stretch_uniformly_; bool float_nonmusical_columns_; + bool float_grace_columns_; Rational global_shortest_; Real increment_; Real shortest_duration_space_; - void init (); + Spacing_options(); void init_from_grob (Grob *me); Real get_duration_space (Moment d, bool *) const; }; diff --git a/lily/spacing-basic.cc b/lily/spacing-basic.cc index 659d3f8b8e..86dd575d1e 100644 --- a/lily/spacing-basic.cc +++ b/lily/spacing-basic.cc @@ -192,27 +192,3 @@ Spacing_spanner::note_spacing (Grob *me, Grob *lc, Grob *rc, } /****************************************************************/ - -void -Spacing_options::init_from_grob (Grob *me) -{ - increment_ = robust_scm2double (me->get_property ("spacing-increment"), 1); - - packed_ = to_boolean (me->get_property ("packed-spacing")); - stretch_uniformly_ = to_boolean (me->get_property ("uniform-stretching")); - float_nonmusical_columns_ - = to_boolean (me->get_property ("strict-note-spacing")); - shortest_duration_space_ = robust_scm2double (me->get_property ("shortest-duration-space"), 1); -} - -void -Spacing_options::init () -{ - increment_ = 1.2; - packed_ = false; - stretch_uniformly_ = false; - float_nonmusical_columns_ = false; - shortest_duration_space_ = 2.0; - - global_shortest_ = Rational (1, 8); -} diff --git a/lily/spacing-determine-loose-columns.cc b/lily/spacing-determine-loose-columns.cc index 34f4c97214..93f70b5cec 100644 --- a/lily/spacing-determine-loose-columns.cc +++ b/lily/spacing-determine-loose-columns.cc @@ -32,7 +32,8 @@ static bool is_loose_column (Grob *l, Grob *c, Grob *r, Spacing_options const *options) { - if (options->float_nonmusical_columns_ + if ((options->float_nonmusical_columns_ + ||options->float_grace_columns_) && Paper_column::when_mom (c).grace_part_) return true; diff --git a/lily/spacing-loose-columns.cc b/lily/spacing-loose-columns.cc index 0570741117..cc73fc138e 100644 --- a/lily/spacing-loose-columns.cc +++ b/lily/spacing-loose-columns.cc @@ -92,12 +92,11 @@ set_loose_columns (System *which, Column_x_positions const *posns) else if (Note_spacing::has_interface (spacing)) { Spacing_options options; - options.init (); fixed = robust_relative_extent (col, col, X_AXIS)[RIGHT]; Moment dt = Paper_column::when_mom (right) - Paper_column::when_mom (col); - bool expand; + bool expand = false; space = options.get_duration_space (dt, &expand); Note_spacing::get_spacing (spacing, right, space, options.increment_, &space, &fixed); diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index 9e7f8e3989..2633e6db70 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -423,6 +423,8 @@ that overlap completely.") (strict-note-spacing ,boolean? "If set, unbroken columns with non-musical material (clefs, barlines, etc.) are not spaced separately, but put before musical columns.") + (strict-grace-spacing ,boolean? "If set, grace notes +are not spaced separately, but put before musical columns.") (string-count ,integer? "The number of strings in a fret diagram.") (stroke-style ,string? "set to \"grace\" to turn stroke through flag on.") -- 2.39.2