From 7095841e441b2ad2d8ca798e6d1d241e57bdd0c5 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Tue, 3 Feb 2004 11:30:26 +0000 Subject: [PATCH] * input/regression/new-part-combine-solo.ly: more cases. * lily/slur.cc (height): robustness fix. * lily/new-part-combine-iterator.cc (process): add apart-spanner. * input/mutopia/F.Schubert/morgenlied.ly (melody): revert stemUp/stemDown. * scm/music-functions.scm (determine-split-list): further analysis. * input/regression/new-part-combine-solo.ly: new file --- ChangeLog | 9 +++++++ input/mutopia/F.Schubert/morgenlied.ly | 2 +- input/regression/new-part-combine-solo.ly | 7 +++-- lily/new-part-combine-iterator.cc | 3 ++- lily/slur.cc | 5 +++- scm/music-functions.scm | 31 +++++++++++++---------- 6 files changed, 38 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 17d9fec648..b113a02f0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2004-02-03 Han-Wen Nienhuys + * input/regression/new-part-combine-solo.ly: more cases. + + * lily/slur.cc (height): robustness fix. + + * lily/new-part-combine-iterator.cc (process): add apart-spanner. + + * input/mutopia/F.Schubert/morgenlied.ly (melody): revert + stemUp/stemDown. + * scm/music-functions.scm (determine-split-list): further analysis. * lily/script-engraver.cc (try_music): discard duplicate diff --git a/input/mutopia/F.Schubert/morgenlied.ly b/input/mutopia/F.Schubert/morgenlied.ly index 0a246875e6..85d4e05323 100644 --- a/input/mutopia/F.Schubert/morgenlied.ly +++ b/input/mutopia/F.Schubert/morgenlied.ly @@ -54,7 +54,7 @@ melody = \notes \relative c'' \repeat volta 2 \context Voice = singer { e4 c8 << \new Voice { \stemUp f8. g16 } - { \stemDown f8.[ g16] } >> a8 | + { \stemDown f8.[ g16] } >> \stemBoth a8 | fis4 g8 c16[ b a g] f[ e] | d4 f8 a16[ g fis g] f[ d] | g4. r8 gis gis | diff --git a/input/regression/new-part-combine-solo.ly b/input/regression/new-part-combine-solo.ly index 50cb4eb820..8b96e7df68 100644 --- a/input/regression/new-part-combine-solo.ly +++ b/input/regression/new-part-combine-solo.ly @@ -8,11 +8,14 @@ A Solo indication is only printed once; (shared) rests do not require reprinting a solo indication. +Solo 1/2 can not be used when a spanner is active, so there is no solo + over any of the tied notes. + " } -vone = \notes \relative a' { g4 r8 g8 g8 r8 g8 r8 } -vtwo = \notes \relative g' { e4. e8 r2 } +vone = \notes \relative a' { g4 r8 g8 g8 r8 g8 r8 g2 ~ g2 ~ g4 } +vtwo = \notes \relative g' { e4. e8 r2 e4 r4 r2 e4 } \score { << \property Score.skipBars = ##t diff --git a/lily/new-part-combine-iterator.cc b/lily/new-part-combine-iterator.cc index d41eab19c6..9c096a628a 100644 --- a/lily/new-part-combine-iterator.cc +++ b/lily/new-part-combine-iterator.cc @@ -346,7 +346,8 @@ New_pc_iterator::process (Moment m) if (tag == ly_symbol2scm ("chords")) chords_together (); else if (tag == ly_symbol2scm ("apart") - || tag == ly_symbol2scm ("apart-silence")) + || tag == ly_symbol2scm ("apart-silence") + || tag == ly_symbol2scm ("apart-spanner")) apart (tag == ly_symbol2scm ("apart-silence")); else if (tag == ly_symbol2scm ("unisono")) unisono (false); diff --git a/lily/slur.cc b/lily/slur.cc index 1ccb8a861f..8d69ddb2c2 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -529,7 +529,10 @@ Slur::height (SCM smob, SCM ax) assert (a == Y_AXIS); SCM mol = me->get_uncached_molecule (); - return ly_interval2scm (unsmob_molecule (mol)->extent (a)); + Interval ext; + if (Molecule * m = unsmob_molecule (mol)) + ext = m->extent (a); + return ly_interval2scm (ext); } /* diff --git a/scm/music-functions.scm b/scm/music-functions.scm index 2d3b1197e4..c40d4b0783 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -829,7 +829,7 @@ Rest can contain a list of beat groupings ;; (define-public (determine-split-list evl1 evl2) "EVL1 and EVL2 should be ascending" - (define pc-debug #f) + (define pc-debug #t) (define ev1 (list->vector evl1)) (define ev2 (list->vector evl2)) (define (when v i) @@ -842,14 +842,10 @@ Rest can contain a list of beat groupings (define (f? x) (equal? (ly:get-mus-property x 'name) 'NoteEvent)) (filter f? (map car (what v i)))) + (define moments (uniq-list + (merge (map car evl1) (map car evl2) ly:momentvector - (map (lambda (x) - (cons x '())) - (uniq-list - (merge (map car evl1) (map car evl2) ly:moment ri 0) (put 'apart (1- ri))) (analyse-time-step i1 (1+ i2) (1+ ri) active1 new-active2)) (else + (if (and (equal? active1 active2) (equal? new-active2 new-active1)) (let* ((notes1 (get-note-evs ev1 i1)) @@ -1007,8 +1004,10 @@ Rest can contain a list of beat groupings )))) - ;; active states different: - (put 'apart)) + ;; active states different: + ;; must mark differently so + ;; it doesn't transform into solo + (put 'apart-spanner)) (analyse-time-step (1+ i1) (1+ i2) (1+ ri) new-active1 new-active2))) )))) @@ -1087,8 +1086,12 @@ Rest can contain a list of beat groupings (else (analyse-solo12 (1+ i1) (1+ i2) (1+ ri))) ))))) - + (set! result (list->vector + (map (lambda (x) + (cons x '())) moments))) + (analyse-time-step 0 0 0 '() '()) + (if pc-debug (display result)) (analyse-solo12 0 0 0) (if pc-debug (display result)) -- 2.39.5