From: Han-Wen Nienhuys Date: Wed, 28 Jan 2004 00:01:48 +0000 (+0000) Subject: * scm/music-functions.scm (determine-split-list): bugfix: only use X-Git-Tag: release/2.1.23~157 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b5c032a34d103966f81ecaad177b63cd649719ed;p=lilypond.git * scm/music-functions.scm (determine-split-list): bugfix: only use new-active for both voices if both indexes advance. This fixes the biggest outstanding problem with new-pc. * lily/new-part-combine-iterator.cc (construct_children): set more directions. --- diff --git a/ChangeLog b/ChangeLog index c1e3a041f6..ea6c0459c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-01-28 Han-Wen Nienhuys + + * scm/music-functions.scm (determine-split-list): bugfix: only use + new-active for both voices if both indexes advance. This fixes the + biggest outstanding problem with new-pc. + + * lily/new-part-combine-iterator.cc (construct_children): set more + directions. + 2004-01-27 Han-Wen Nienhuys * scripts/convert-ly.py (conv): add instrument rule. diff --git a/input/regression/new-part-combine.ly b/input/regression/new-part-combine.ly index 1e315e6e36..e83d6bdde3 100644 --- a/input/regression/new-part-combine.ly +++ b/input/regression/new-part-combine.ly @@ -14,8 +14,13 @@ theMusic = \context Staff \notes { c4 d8-. } -vone = \notes \relative a' { g2 g g g4 g f' c c( c) c c c ~ c } -vtwo = \notes \relative a' { f2 f4 f f2 g4 g c, f f f f f~ f ~ f } +vone = \notes \relative a' { g2 g g g4 g f' c c( c) c c c ~ c + c2. c4 c + } +vtwo = \notes \relative a' { f2 f4 f f2 g4 g c, f f f f f~ f ~ f + f4 f2. ~ f4 + + } \score { \newpartcombine \vone \vtwo diff --git a/input/test/trills.ly b/input/test/trills.ly index f44aa93316..f74c9ea466 100644 --- a/input/test/trills.ly +++ b/input/test/trills.ly @@ -19,20 +19,6 @@ title="Marques des agr\\'ements et leur signification" invisible = \property Voice.NoteHead \override #'transparent = ##t visible = \property Voice.NoteHead \revert #'transparent -% Ugly hack to get reasonable position of the pincé and Cheute -startHorizScript = { - \property Voice.scriptHorizontal = ##t - \property Voice.Script \override #'padding = #0.3 - \property Voice.Script \override #'extra-offset = #'(-.6 . 0) - % Avoid collision with the dots of dotted notes - \property Voice.Dots \override #'extra-X-extent = #'(-0.7 . 0) -} -endHorizScript = { - \property Voice.scriptHorizontal \unset - \property Voice.Dots \revert #'padding - \property Voice.Script \revert #'padding - \property Voice.Script \revert #'extra-offset -} \score { @@ -55,8 +41,8 @@ endHorizScript = { { \property Voice.Script \override #'extra-offset = #'(-0.8 . 2.0) b_\turn}>> - \startHorizScript %{ FIXME \comma does not exist + \startHorizScript c^\comma \time 3/8 @@ -64,8 +50,8 @@ endHorizScript = { b8 c4_\comma c8 b4_\comma b8 c4^\comma _\comma -%} \endHorizScript +%} \time 2/2 \slurDown <<{c2}{s4 \invisible d1*1/4 ( \visible }>> e2) <<{a,2}{s4 \invisible b1*1/4 ( \visible }>> d2) diff --git a/lily/grob-pq-engraver.cc b/lily/grob-pq-engraver.cc index bf46d20166..5324d53623 100644 --- a/lily/grob-pq-engraver.cc +++ b/lily/grob-pq-engraver.cc @@ -11,6 +11,10 @@ #include "grob.hh" #include "warn.hh" +/* + TODO: should junk this engraver. + */ + struct Grob_mom { Grob * grob_ ; @@ -28,6 +32,7 @@ int compare (Grob_mom const &a, Grob_mom const &b) return Moment::compare (a.end_, b.end_); } +/****************/ class Grob_pq_engraver: public Engraver { @@ -59,7 +64,8 @@ Grob_pq_engraver::acknowledge_grob (Grob_info gi) { Music * m = gi.music_cause (); - if (m) + if (m + && !gi.grob_->internal_has_interface (ly_symbol2scm ("multi-measure-interface"))) { Moment n = now_mom (); Moment l = m->get_length (); diff --git a/lily/instrument-name-engraver.cc b/lily/instrument-name-engraver.cc index c380223009..74f0754cd1 100644 --- a/lily/instrument-name-engraver.cc +++ b/lily/instrument-name-engraver.cc @@ -79,7 +79,8 @@ Instrument_name_engraver::create_text () if (text_->get_grob_property ("text") != txt) text_->set_grob_property ("text", txt); -} + announce_grob (text_, SCM_EOL); + } void Instrument_name_engraver::acknowledge_grob (Grob_info i) @@ -172,6 +173,7 @@ Vocal_name_engraver::create_text () if (text_->get_grob_property ("text") != txt) text_->set_grob_property ("text", txt); + announce_grob (text_, SCM_EOL); } diff --git a/lily/new-part-combine-iterator.cc b/lily/new-part-combine-iterator.cc index 48a8039e35..ecb4534c17 100644 --- a/lily/new-part-combine-iterator.cc +++ b/lily/new-part-combine-iterator.cc @@ -216,8 +216,6 @@ New_pc_iterator::construct_children () "one", props); one_.set_translator (one); - one->execute_pushpop_property (ly_symbol2scm ("Stem"), - ly_symbol2scm ("direction"), gh_int2scm (1)); set_translator (one); first_iter_ = unsmob_iterator (get_iterator (unsmob_music (gh_car (lst)))); @@ -226,13 +224,34 @@ New_pc_iterator::construct_children () Translator_group *two = tr->find_create_translator (ly_symbol2scm ("Voice"), "two", props); two_.set_translator (two); - two_.report_to ()->execute_pushpop_property (ly_symbol2scm ("Stem"), - ly_symbol2scm ("direction"), gh_int2scm (-1)); set_translator (two); second_iter_ = unsmob_iterator (get_iterator (unsmob_music (gh_cadr (lst)))); set_translator (tr); + + + char const * syms[] = { + "Stem", + "DynamicLineSpanner", + "Tie", + "Dots", + "Slur", + "TextScript", + "Script", + 0 + }; + + for (char const**p = syms; *p; p++) + { + SCM sym = ly_symbol2scm (*p); + one->execute_pushpop_property (sym, + ly_symbol2scm ("direction"), gh_int2scm (1)); + + two->execute_pushpop_property (sym, + ly_symbol2scm ("direction"), gh_int2scm (-1)); + } + } void diff --git a/scm/define-grob-interfaces.scm b/scm/define-grob-interfaces.scm index 9012a85e45..fbf6f2a2eb 100644 --- a/scm/define-grob-interfaces.scm +++ b/scm/define-grob-interfaces.scm @@ -58,6 +58,13 @@ extents of a cluster spanner at this X position. '( )) + +(ly:add-interface + 'multi-measure-interface + "Multi measure rest, and friends (mmrest number, mmrest text)." + '()) + + (ly:add-interface 'note-name-interface "Note name" diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 93f0974f64..6d83c4278f 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -435,7 +435,7 @@ (meta . ((interfaces . (font-interface self-alignment-interface side-position-interface text-interface break-aligned-interface item-interface )))) )) - (InstrumentName + (VocalName . ( (breakable . #t) (Y-offset-callbacks . (,Side_position_interface::aligned_on_support_refpoints)) @@ -443,7 +443,7 @@ (space-alist . ((left-edge . (extra-space . 1.0)) )) (molecule-callback . ,Text_item::brew_molecule) - (break-align-symbol . instrument-name) + (break-align-symbol . clef) (break-visibility . ,begin-of-line-visible) (baseline-skip . 2) (font-family . roman) @@ -574,7 +574,7 @@ (thick-thickness . 6.6) (hair-thickness . 2.0) (padding . 1) - (meta . ((interfaces . (multi-measure-rest-interface rest-interface font-interface staff-symbol-referencer-interface)))) + (meta . ((interfaces . (multi-measure-rest-interface multi-measure-interface rest-interface font-interface staff-symbol-referencer-interface)))) )) (MultiMeasureRestNumber @@ -588,7 +588,7 @@ (padding . 1.3) (staff-padding . 1.3) (font-family . number) - (meta . ((interfaces . (side-position-interface self-alignment-interface font-interface spanner-interface text-interface)))) + (meta . ((interfaces . (side-position-interface multi-measure-interface self-alignment-interface font-interface spanner-interface text-interface)))) )) (MultiMeasureRestText . ( @@ -601,7 +601,7 @@ (padding . 1.5) (staff-padding . 1.5) (font-family . roman) - (meta . ((interfaces . (side-position-interface self-alignment-interface font-interface spanner-interface text-interface)))) + (meta . ((interfaces . (side-position-interface multi-measure-interface self-alignment-interface font-interface spanner-interface text-interface)))) )) (NoteCollision . ( diff --git a/scm/music-functions.scm b/scm/music-functions.scm index d0ca581467..081163c8af 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -866,6 +866,7 @@ Rest can contain a list of beat groupings (if (equal? (ly:get-mus-property ev 'name) 'NoteEvent) (assoc-remove! active 'tie) active) ) + (define (active" new-active1 + active2 "->" new-active2 + (vector-length ev1) (vector-length ev2) (vector-length result) "\n"))) + (if (not (or (equal? m1 (when result ri)) (equal? m2 (when result ri)))) @@ -955,24 +961,32 @@ Rest can contain a list of beat groupings ((ly:moment ri 0) (put 'apart (1- ri))) - (analyse-time-step (1+ i1) i2 (1+ ri) new-active1 new-active2)) + (analyse-time-step (1+ i1) i2 (1+ ri) new-active1 active2)) ((ly:moment ri 0) (put 'apart (1- ri))) - (analyse-time-step i1 (1+ i2) (1+ ri) new-active1 new-active2)) + (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)) + (durs1 (sort (map (lambda (x) (ly:get-mus-property x 'duration)) notes1) ly:duration (length notes1) 1) (put 'apart)) ((> (length notes2) 1) (put 'apart)) + ((and + (= (length durs1) 1) + (= (length durs2) 1) + (not (equal? (car durs1) (car durs2)))) + + (put 'apart)) (else (if (and (= (length pitches1) 1) (= (length pitches2) 1)