From 063403e99a28794c119829bbec251455fb6ff9bd Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 23:55:53 +0000 Subject: [PATCH] lilypond-1.3.89 --- input/test/part-combine-moments.ly | 99 +++++++++++++++++++ input/test/part-combine-staff.ly | 9 +- lily/grace-iterator.cc | 2 +- lily/include/music-iterator.hh | 22 +++-- lily/include/music-wrapper-iterator.hh | 1 + lily/include/sequential-music-iterator.hh | 8 +- lily/include/simple-music-iterator.hh | 6 +- lily/music-iterator.cc | 15 +++ lily/request-chord-iterator.cc | 7 +- lily/simple-music-iterator.cc | 22 ++--- ly/declarations-as.ly | 9 +- ly/params-as.ly | 7 +- mutopia/Coriolan/coriolan-paper.ly | 2 + .../Coriolan/coriolan-part-combine-paper.ly | 1 + 14 files changed, 170 insertions(+), 40 deletions(-) create mode 100644 input/test/part-combine-moments.ly diff --git a/input/test/part-combine-moments.ly b/input/test/part-combine-moments.ly new file mode 100644 index 0000000000..79c8ff46d9 --- /dev/null +++ b/input/test/part-combine-moments.ly @@ -0,0 +1,99 @@ +\score{ + \context PianoStaff < + \context StaffCombineStaff=one \skip 1*2; + \context StaffCombineStaff=two \skip 1*2; + \context StaffCombineStaff=one \partcombine StaffCombineStaff + \context StaffCombineVoice=one \notes\relative c'' + { + c4 d e f\break + c2 e4 f\break + } + \context StaffCombineVoice=two \notes\relative c'' + { + c4 d e f + c2 e2 + } + > + \paper { + + textheight = 295.0\mm; + linewidth = 180.0\mm; + + \translator{ \HaraKiriStaffContext } + % + % The Voice combine hierarchy + % + \translator{ + \ThreadContext + \name "VoiceCombineThread"; + \consists "Rest_engraver"; + } + \translator{ + \VoiceContext + \name "VoiceCombineVoice"; + soloText = #"I." + soloIIText = #"II." + \remove "Rest_engraver"; + \accepts "VoiceCombineThread"; + } + \translator{ + \HaraKiriStaffContext + \consists "Mark_engraver"; + \name "VoiceCombineStaff"; + \accepts "VoiceCombineVoice"; + } + + % + % The Staff combine hierarchy + % + \translator{ + \ThreadContext + \name "StaffCombineThread"; + } + \translator{ + \VoiceContext + \name "StaffCombineVoice"; + \accepts "StaffCombineThread"; + \consists "Thread_devnull_engraver"; + } + \translator { + \HaraKiriStaffContext + \name "StaffCombineStaff"; + \accepts "StaffCombineVoice"; + + soloADue = ##t + soloText = #"" + soloIIText = #"" + aDueText = #"" + splitInterval = #'(1 . 0) + changeMoment = #`(,(make-moment 1 1) . ,(make-moment 1 1)) + + } + \translator { + \StaffGroupContext + \accepts "VoiceCombineStaff"; + \accepts "StaffCombineStaff"; + } + \translator{ \HaraKiriStaffContext } + + \translator { + \ScoreContext + \accepts "VoiceCombineStaff"; + \accepts "StaffCombineStaff"; + skipBars = ##t + + barScriptPadding = #2.0 % dimension \pt + markScriptPadding = #4.0 + + %% urg: in pt? + barNumberScriptPadding = #15 + %% URG: this changes dynamics too + %%textStyle = #"italic" + timeSignatureStyle = #"C" + instrumentScriptPadding = #60 %% urg, this is in pt + instrScriptPadding = #40 %% urg, this is in pt + marginScriptHorizontalAlignment = #1 + maximumRestCount = #1 + } + } +} diff --git a/input/test/part-combine-staff.ly b/input/test/part-combine-staff.ly index 0446b20bd0..7590a333e0 100644 --- a/input/test/part-combine-staff.ly +++ b/input/test/part-combine-staff.ly @@ -1,7 +1,7 @@ \score{ \context PianoStaff < - \context StaffCombineStaff=one \skip 1*6; - \context StaffCombineStaff=two \skip 1*6; + \context StaffCombineStaff=one \skip 1*7; + \context StaffCombineStaff=two \skip 1*7; \context StaffCombineStaff=one \partcombine StaffCombineStaff \context StaffCombineVoice=one \notes\relative c'' { @@ -10,7 +10,8 @@ c d e f c4 d e f\break a8 a a a b b b b - a,4 a a a + a,4 a a a\break + c2 e4 f\break } \context StaffCombineVoice=two \notes\relative c'' { @@ -20,6 +21,7 @@ c,4 d e f a8 a a a b b b b a4 a a a + c2 e2 } > \paper { @@ -74,6 +76,7 @@ soloIIText = #"" aDueText = #"" splitInterval = #'(1 . 0) + changeMoment = #`(,(make-moment 1 1) . ,(make-moment 1 1)) } \translator { diff --git a/lily/grace-iterator.cc b/lily/grace-iterator.cc index ddcd3a401b..c2459b310e 100644 --- a/lily/grace-iterator.cc +++ b/lily/grace-iterator.cc @@ -27,7 +27,7 @@ Grace_iterator::construct_children () } void -Grace_iterator::process (Moment m) +Grace_iterator::process (Moment) { Global_translator * t = dynamic_cast(report_to_l ()); if (t) diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index 2f9c6cf7cc..1709a5d8e8 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -35,19 +35,28 @@ thus changing the state of the interpretation context. get_music (M) -- return all events starting at M (pre: no events - before M). Side effects: + before M). No side-effects - * This removes all events at M from the pending queue. + skip (M) -- remove all events starting before M (leave the ones that + start M). no side-effects on interpretation context - Because next (M) is rolled into process () as a side effect, - we need to roll next (M) into get_music too. Urg. - + + TODO: + + merge pending_moment and process. + */ class Music_iterator { +protected: + Moment music_length_; + public: VIRTUAL_COPY_CONS (Music_iterator); + Moment music_length_mom () const; + + Music_iterator (); Music_iterator (Music_iterator const&); virtual ~Music_iterator (); @@ -57,7 +66,7 @@ public: then its children. Returns the iterator that succeeded */ Music_iterator * try_music (Music *) const; - + /** The translation unit that we this iterator is reporting to now. */ @@ -75,6 +84,7 @@ public: virtual bool ok () const; virtual SCM get_music (Moment until)const; virtual void process (Moment until); + virtual void skip (Moment until); /** Construct sub-iterators, and set the translator to diff --git a/lily/include/music-wrapper-iterator.hh b/lily/include/music-wrapper-iterator.hh index cbe4fa3827..d7a346a566 100644 --- a/lily/include/music-wrapper-iterator.hh +++ b/lily/include/music-wrapper-iterator.hh @@ -30,6 +30,7 @@ public: virtual Moment pending_moment () const; virtual bool ok () const; virtual SCM get_music (Moment)const; + virtual void skip (Moment); protected: virtual void process (Moment); diff --git a/lily/include/sequential-music-iterator.hh b/lily/include/sequential-music-iterator.hh index 5661f260bd..d4f83c4585 100644 --- a/lily/include/sequential-music-iterator.hh +++ b/lily/include/sequential-music-iterator.hh @@ -26,6 +26,7 @@ public: virtual void construct_children (); virtual Moment pending_moment () const; virtual bool ok () const; + virtual void skip (Moment); virtual SCM get_music (Moment)const; protected: @@ -38,12 +39,7 @@ private: SCM cursor_; Music_iterator * iter_p_; - /* - perhaps these can be virtual and protected iso. private? - */ - void start_next_element(); - void leave_element(); - void set_sequential_music_translator(); + void descend_to_child (); }; #endif // SEQUENTIAL_MUSIC_ITERATOR_HH diff --git a/lily/include/simple-music-iterator.hh b/lily/include/simple-music-iterator.hh index 6d86c1c35c..963eb0c616 100644 --- a/lily/include/simple-music-iterator.hh +++ b/lily/include/simple-music-iterator.hh @@ -14,16 +14,16 @@ class Simple_music_iterator : public Music_iterator { protected: - Moment length_mom_; + Moment last_processed_mom_; public: VIRTUAL_COPY_CONS (Music_iterator); Simple_music_iterator (); Simple_music_iterator (Simple_music_iterator const &); virtual void process (Moment); - virtual bool ok()const; + virtual bool ok ()const; virtual Moment pending_moment ()const; - virtual void construct_children (); + virtual void skip (Moment); }; #endif /* SIMPLE_MUSIC_ITERATOR_HH */ diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index 51ae61f1ce..8c3c2fe3a6 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -51,6 +51,7 @@ Music_iterator::Music_iterator (Music_iterator const& src) // clone_i_ = src.clone_i_ + 1; handle_ = *src.handle_.clone (); music_l_ = src.music_l_; + music_length_ = src.music_length_; } Music_iterator::~Music_iterator () @@ -96,6 +97,11 @@ Music_iterator::ok () const return false; } +void +Music_iterator::skip (Moment ) +{ +} + SCM Music_iterator::get_music (Moment)const { @@ -150,9 +156,18 @@ Music_iterator::static_get_iterator_p (Music *m) } p->music_l_ = m; + p->music_length_ = m->length_mom (); + return p; } + +Moment +Music_iterator::music_length_mom() const +{ + return music_length_; +} + void Music_iterator::init_translator (Music *m, Translator_group *report_l) { diff --git a/lily/request-chord-iterator.cc b/lily/request-chord-iterator.cc index f463190a34..080240a8b5 100644 --- a/lily/request-chord-iterator.cc +++ b/lily/request-chord-iterator.cc @@ -45,9 +45,8 @@ Request_chord_iterator::elt_l () const return (Request_chord*) music_l_; } - SCM -Request_chord_iterator::get_music (Moment)const +Request_chord_iterator::get_music (Moment) const { SCM s = SCM_EOL; if (music_l_) @@ -65,7 +64,6 @@ Request_chord_iterator::get_music (Moment)const void Request_chord_iterator::process (Moment m) { - last_processed_mom_ = m; if (music_l_) { for (SCM s = dynamic_cast (music_l_)->music_list (); @@ -83,7 +81,6 @@ Request_chord_iterator::process (Moment m) mus->origin ()->warning (_f ("Huh? Not a Request: `%s'", classname (mus))); } - - music_l_ =0; } + skip (m); } diff --git a/lily/simple-music-iterator.cc b/lily/simple-music-iterator.cc index a25147d4e9..c4a78e9583 100644 --- a/lily/simple-music-iterator.cc +++ b/lily/simple-music-iterator.cc @@ -20,19 +20,13 @@ Simple_music_iterator::Simple_music_iterator () Simple_music_iterator::Simple_music_iterator (Simple_music_iterator const &src) : Music_iterator (src) { - last_processed_mom_ = -1; -} - -void -Simple_music_iterator::construct_children () -{ - length_mom_ = music_l_->length_mom (); + last_processed_mom_ = src.last_processed_mom_; } bool Simple_music_iterator::ok ()const { - return last_processed_mom_ < length_mom_; + return last_processed_mom_ < music_length_mom (); } Moment @@ -41,7 +35,14 @@ Simple_music_iterator::pending_moment ()const if (music_l_) return Moment (0); else - return length_mom_; + return music_length_mom (); +} + +void +Simple_music_iterator::skip (Moment m) +{ + music_l_ = 0; + last_processed_mom_ = m; } void @@ -59,6 +60,5 @@ Simple_music_iterator::process (Moment m) classname (music_l_))); } #endif - music_l_ = 0; - last_processed_mom_ = m; + skip (m); } diff --git a/ly/declarations-as.ly b/ly/declarations-as.ly index ceae9b08aa..d0caa74ac3 100644 --- a/ly/declarations-as.ly +++ b/ly/declarations-as.ly @@ -6,10 +6,11 @@ breve = \duration #'( -1 0) longa = \duration #'( -2 0 ) maxima = \duration #'( -3 0 ) -#(eval-string (ly-gulp-file "generic-property.scm")) - -% urg, move to basic property? -#(eval-string (ly-gulp-file "slur.scm")) +#(begin + (eval-string (ly-gulp-file "slur.scm")) + (eval-string (ly-gulp-file "generic-property.scm")) + (eval-string (ly-gulp-file "basic-properties.scm")) + ) \include "nederlands.ly" % dutch \include "chord-modifiers.ly" diff --git a/ly/params-as.ly b/ly/params-as.ly index 58ab2b6bd2..f805540d69 100644 --- a/ly/params-as.ly +++ b/ly/params-as.ly @@ -15,6 +15,9 @@ indent = 8.0\char; staffspace = (\staffheight - 1.0 ) / 4.0; stafflinethickness = \staffspace / 2.0; +% deprecated +interline = \staffspace; + %{ The space taken by a note is determined by the formula @@ -26,8 +29,10 @@ arithmetic_basicspace. The smallest space is the one following the shortest note in the measure. Typically arithmetic_basicspace is set to the width of a quarter note head. %} +% quartwidth == 1.32 * staffspace arithmetic_basicspace = 2.; -arithmetic_multiplier = 0.9 * \quartwidth ; +%arithmetic_multiplier = 0.9 * \quartwidth ; +arithmetic_multiplier = 0.9 * 1.32 * \staffspace; % catch suspect beam slopes, set slope to zero if diff --git a/mutopia/Coriolan/coriolan-paper.ly b/mutopia/Coriolan/coriolan-paper.ly index 08cc643ca3..e8d1a3358c 100644 --- a/mutopia/Coriolan/coriolan-paper.ly +++ b/mutopia/Coriolan/coriolan-paper.ly @@ -1,4 +1,5 @@ \paper{ + \paper_sixteen textheight = 295.0\mm; linewidth = 180.0\mm; @@ -50,6 +51,7 @@ soloIIText = #"" aDueText = #"" splitInterval = #'(1 . 0) + changeMoment = #`(,(make-moment 1 1) . ,(make-moment 1 1)) } \translator { \StaffGroupContext diff --git a/mutopia/Coriolan/coriolan-part-combine-paper.ly b/mutopia/Coriolan/coriolan-part-combine-paper.ly index b78365c2a8..844bf454e3 100644 --- a/mutopia/Coriolan/coriolan-part-combine-paper.ly +++ b/mutopia/Coriolan/coriolan-part-combine-paper.ly @@ -50,6 +50,7 @@ soloIIText = #"" aDueText = #"" splitInterval = #'(1 . 0) + changeMoment = #`(,(make-moment 1 1) . ,(make-moment 1 1)) } \translator { \StaffGroupContext -- 2.39.5