From d3060eee305bf1cc660ccca7a6f4c97179ef0cf4 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 14 Jun 2006 11:55:57 +0000 Subject: [PATCH] * lily/stem.cc (get_beaming): return max of scm_ilength. Fixes slurring from/to beams. * ly/lilypond-book-preamble.ly: new file. * lily/slur.cc: add inspect-index feature. --- ChangeLog | 19 ++++++++++++++----- lily/slur-scoring.cc | 10 +++++++++- lily/slur.cc | 3 ++- lily/stem.cc | 4 +++- ly/init.ly | 4 ++-- ly/lilypond-book-preamble.ly | 12 ++++++++++++ scm/define-grob-properties.scm | 4 +++- 7 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 ly/lilypond-book-preamble.ly diff --git a/ChangeLog b/ChangeLog index 6bcfcbfdcd..ccdae1a0ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-06-14 Han-Wen Nienhuys + + * lily/stem.cc (get_beaming): return max of scm_ilength. Fixes + slurring from/to beams. + + * ly/lilypond-book-preamble.ly: new file. + + * lily/slur.cc: add inspect-index feature. + 2006-06-13 Graham Percival * Documentation/user/tutorial.itely: trivial fix. @@ -26,21 +35,21 @@ format. * lily/stem.cc (calc_stem_end_position): calc quantized-positions - for beamed case. Backportme. + for beamed case. * lily/note-spacing.cc (stem_dir_correction): don't inspect - stem_end_position, but estimate instead. Backportme. + stem_end_position, but estimate instead. * lily/tuplet-bracket.cc (calc_positions): look at stem-end-position for tuplet bracket slope. Fixes sloped tuplet - brackets narrower than beams. Backportme. + brackets narrower than beams. * lily/lexer.ll: set version-seen? even if version is - INVALID. Backportme. + INVALID. * lily/rest.cc (y_offset_callback): bugfix: decide position override based on scm_is_number(). Fixes \rest on center staff - line. Backportme. + line. * lily/beaming-pattern.cc (best_splitpoint_index): fix beaming patterns for 16th triplets. diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index f4b312e5bd..ef5002538b 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -354,8 +354,16 @@ Slur_score_state::get_best_curve () bool debug_slurs = to_boolean (slur_->layout () ->lookup_variable (ly_symbol2scm ("debug-slur-scoring"))); SCM inspect_quants = slur_->get_property ("inspect-quants"); + SCM inspect_index = slur_->get_property ("inspect-index"); if (debug_slurs - && scm_is_pair (inspect_quants)) + && scm_is_integer (inspect_index)) + { + opt_idx = scm_to_int (inspect_index); + configurations_[opt_idx]->calculate_score (*this); + opt = configurations_[opt_idx]->score (); + } + else if (debug_slurs + && scm_is_pair (inspect_quants)) { opt_idx = get_closest_index (inspect_quants); configurations_[opt_idx]->calculate_score (*this); diff --git a/lily/slur.cc b/lily/slur.cc index 92610d47e7..557200b239 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -286,12 +286,13 @@ ADD_INTERFACE (Slur, "slur-interface", "eccentricity " "encompass-objects " "height-limit " + "inspect-quants " + "inspect-index " "line-thickness " "note-columns " "positions " "quant-score " "ratio " "thickness " - ); diff --git a/lily/stem.cc b/lily/stem.cc index 4bfac0eb6e..d95ff4be39 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -65,7 +65,9 @@ Stem::get_beaming (Grob *me, Direction d) return 0; SCM lst = index_get_cell (pair, d); - return scm_ilength (lst); + + int len = scm_ilength (lst); + return max (len, 0); } Interval diff --git a/ly/init.ly b/ly/init.ly index 71633013a6..1a9ec369cb 100644 --- a/ly/init.ly +++ b/ly/init.ly @@ -16,7 +16,7 @@ #(define toplevel-scores '()) #(define output-count 0) #(define $defaultheader #f) -#(define version-seen? #f) +#(define version-seen #f) \maininput %% there is a problem at the end of the input file @@ -30,7 +30,7 @@ (not (ly:get-option 'old-relative-used))) (old-relative-not-used-message input-file-name))%% there is a problem at the end of the input file -#(if (and (not version-seen?) +#(if (and (not version-seen) (defined? 'input-file-name)) (version-not-seen-message input-file-name)) diff --git a/ly/lilypond-book-preamble.ly b/ly/lilypond-book-preamble.ly new file mode 100644 index 0000000000..9ff3e6349f --- /dev/null +++ b/ly/lilypond-book-preamble.ly @@ -0,0 +1,12 @@ + + +#(set! toplevel-score-handler print-score-with-defaults) +#(set! toplevel-music-handler + (lambda (p m) + (if (not (eq? (ly:music-property m \'void) #t)) + (print-score-with-defaults + p (scorify-music m p))))) + +#(ly:set-option (quote no-point-and-click)) +#(define inside-lilypond-book #t) +#(define version-seen #t) diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index 2c84e2d822..27018602d0 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -242,7 +242,9 @@ of note-column for horizontal shifting. This is used by Choices are @code{around}, @code{inside}, @code{outside}. If unset, script and slur ignore eachother.") (inspect-quants ,number-pair? "If debugging is set, -set beam quant to this position, and print the respective scores.") +set beam/slur quant to this position, and print the respective scores.") + (inspect-index ,integer? "If debugging is set, +set beam/slur configuration to this index, and print the respective scores.") (implicit ,boolean? "Is this an implicit bass figure?") (keep-inside-line ,boolean? "If set, this column cannot have things sticking into the margin.") -- 2.39.2