]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.88.jcn1
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 20 Sep 2000 21:32:31 +0000 (23:32 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 20 Sep 2000 21:32:31 +0000 (23:32 +0200)
1.3.88.jcn1
===========

* Added feature to part combiner that should allow part-switching only
  for entire measures.  Currently, it is controlled by a new
  property changeMoments (A . B):
    - only switch when !(A mod now),
    - decide whether to switch based on music during time period B.

* Made bugfix: Sequential_iterator::get_music (M): mustn't return music
  later than M.

* Added skip (M) to some iterators.

1.3.88
======

21 files changed:
CHANGES
VERSION
input/test/part-combine-moments.ly [new file with mode: 0644]
input/test/part-combine-staff.ly
lily/grace-iterator.cc
lily/include/music-iterator.hh
lily/include/music-wrapper-iterator.hh
lily/include/part-combine-music-iterator.hh
lily/include/sequential-music-iterator.hh
lily/include/simple-music-iterator.hh
lily/music-iterator.cc
lily/music-wrapper-iterator.cc
lily/part-combine-music-iterator.cc
lily/request-chord-iterator.cc
lily/sequential-music-iterator.cc
lily/simple-music-iterator.cc
ly/declarations-as.ly
ly/engraver.ly
ly/params-as.ly
mutopia/Coriolan/coriolan-paper.ly
mutopia/Coriolan/coriolan-part-combine-paper.ly

diff --git a/CHANGES b/CHANGES
index 0ceb0ebc13aad2631815e559b657f25749fd725a..ee4762dde3d0bfcefdafc0d679a0db98269c7620 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,20 @@
+1.3.88.jcn1
+===========
+
+* Added feature to part combiner that should allow part-switching only
+  for entire measures.  Currently, it is controlled by a new 
+  property changeMoments (A . B):
+    - only switch when !(A mod now),
+    - decide whether to switch based on music during time period B.
+
+* Made bugfix: Sequential_iterator::get_music (M): mustn't return music 
+  later than M.
+
+* Added skip (M) to some iterators.
+
+1.3.88
+======
+
 1.3.87.hwn1
 ===========
 
diff --git a/VERSION b/VERSION
index b283fed4ca9b5dface0cd3240658d3a22f6088ea..75f47b1b5c21f16b648acb59b1cbc0137fda2f9c 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=88
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=jcn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/input/test/part-combine-moments.ly b/input/test/part-combine-moments.ly
new file mode 100644 (file)
index 0000000..79c8ff4
--- /dev/null
@@ -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
+               }
+       }
+}
index 0446b20bd044c49bc7be0d2c4264f02cf924b020..7590a333e0a46b6be4c3a70a4d03c883ce23be72 100644 (file)
@@ -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 {
index ddcd3a401b34a33eb764f8a1c1c0fbca42463e11..c2459b310ec0975c6ab03e11bc30c2a9645355b7 100644 (file)
@@ -27,7 +27,7 @@ Grace_iterator::construct_children ()
 }
 
 void
-Grace_iterator::process (Moment m)
+Grace_iterator::process (Moment)
 {
   Global_translator * t = dynamic_cast<Global_translator*>(report_to_l ());
   if (t)
index 2f9c6cf7cc887f3109c0b8353a75972315dbc396..25d099ecccd105416885da1ceb89a8d829aebad8 100644 (file)
     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).
 
-    * This removes all events at M from the pending queue.
+  skip (M) -- remove all events at M from the pending queue.
 
-  Because next (M) is rolled into process () as a side effect,
-  we need to roll next (M) into get_music too.  Urg.
-    
 */
 class Music_iterator
 {
@@ -75,6 +72,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 
index cbe4fa382715944a173161b5a9c088ebd4a0d47a..d7a346a56632ddc1361afa8eab60d6d425d5fa70 100644 (file)
@@ -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);
index 4400e458ee5b9438209c4f54e18d24c6130b8be4..12ffb1aa124cf7f2151d2a3dbbd9bd0cf82a0726 100644 (file)
@@ -18,6 +18,8 @@ public:
   VIRTUAL_COPY_CONS (Music_iterator);
   Part_combine_music_iterator ();
 
+  enum State { UNKNOWN, UNRELATED=1, SOLO1=2, SOLO2=4, UNIRHYTHM=8, UNISON=16, UNISILENCE=32, SPLIT_INTERVAL=64 };
 protected:
   virtual ~Part_combine_music_iterator ();
 
@@ -30,11 +32,13 @@ protected:
 
 private:
   void change_to (Music_iterator*, String, String);
+  int get_state (Moment m);
 
   Music_iterator * first_iter_p_;
   Music_iterator * second_iter_p_;
   Moment first_until_;
   Moment second_until_;
+  int state_;
 };
 
 #endif /* PART_COMBINE_MUSIC_ITERATOR_HH */
index 5661f260bd6bd58579af7fe6e2e7f636ebc8a645..92f0ecea5ce08bca812d3f9242e1c26fda1e7417 100644 (file)
@@ -27,6 +27,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);
index 6d86c1c35cddb93f57bca56ce245bf6165512d46..c9b861dce39c6b58a081acd47dce24d31d0e66b0 100644 (file)
@@ -21,7 +21,8 @@ public:
   Simple_music_iterator ();
   Simple_music_iterator (Simple_music_iterator const &);
   virtual void process (Moment);
-  virtual bool ok()const;
+  virtual bool ok ()const;
+  virtual void skip (Moment);
   virtual Moment pending_moment ()const;
   virtual void construct_children ();
 };
index 51ae61f1ce333ff0c6bd46d767dfb3492989f3e0..3806c4e7f7e69a30d47ad029a184428b9dca5a46 100644 (file)
@@ -85,6 +85,12 @@ Music_iterator::pending_moment () const
 }
 
 
+void
+Music_iterator::skip (Moment)
+{
+  assert (0);
+}
+
 void
 Music_iterator::process (Moment)
 {
index 834494c88d1db95fc19bf8fc4a3cea04aa298cc9..c052d14ff511dfc0d095dc375d58835c05653b8a 100644 (file)
@@ -40,6 +40,12 @@ Music_wrapper_iterator::ok () const
   return child_iter_p_ && child_iter_p_->ok ();
 }
 
+void
+Music_wrapper_iterator::skip (Moment m)
+{
+  child_iter_p_->skip (m);
+}
+
 void
 Music_wrapper_iterator::process (Moment m)
 {
index 9fa9bd7fe3b26f042fbe13428776fabd34c00d88..695331e35b2ed588772facb4be2275507f816cb3 100644 (file)
@@ -43,7 +43,6 @@ Part_combine_music_iterator::pending_moment () const
 bool
 Part_combine_music_iterator::ok () const
 {
-  //hmm
   return first_iter_p_->ok () || second_iter_p_->ok ();
 }
 
@@ -107,170 +106,252 @@ Part_combine_music_iterator::change_to (Music_iterator *it, String to_type,
     error (_f ("none of these in my family: `%s'", to_id.ch_C ()));
 }
 
-void
-Part_combine_music_iterator::process (Moment m)
-{
 
-  /*
-    TODO:
-    - Use three named contexts (be it Thread or Voice): one, two, solo.
-      Let user pre-set (pushproperty) stem direction, remove
-      dynamic-engraver, and such.
-    - staff-combiner must switch only on per-measure basis (maybe even on
-      per-line-basis, but that's not feasible).  Maybe set minimum lengths
-      of matching rhythm for combine/split?
-   */
-  Part_combine_music const * p = dynamic_cast<Part_combine_music const* > (music_l_);
-
-  Moment now = pending_moment ();
-
-  Array<Musical_pitch> first_pitches;
-  Array<Duration> first_durations;
-  if (first_iter_p_->ok ())
+static void
+get_music_info (Moment m, Music_iterator* iter, Array<Musical_pitch> *pitches, Array<Duration> *durations)
+{
+  if (iter->ok ())
     {
-      /* get_music () also performs next, modifying iterator */
-      Music_iterator *mi = first_iter_p_->clone ();
-      for (SCM i = mi->get_music (now); gh_pair_p (i); i = gh_cdr (i))
+      for (SCM i = iter->get_music (m); gh_pair_p (i); i = gh_cdr (i))
        {
          Music *m = unsmob_music (gh_car (i));
          if (Melodic_req *r = dynamic_cast<Melodic_req *> (m))
-           first_pitches.push (r->pitch_);
+           pitches->push (r->pitch_);
          if (Rhythmic_req *r = dynamic_cast<Rhythmic_req *> (m))
-                   first_durations.push (r->duration_);
+           durations->push (r->duration_);
        }
-      delete mi;
     }
+}
   
-  Array<Musical_pitch> second_pitches;
-  Array<Duration> second_durations;
-  if (second_iter_p_->ok ())
-    {
-      Music_iterator *mi = second_iter_p_->clone ();
-      for (SCM i = mi->get_music (now); gh_pair_p (i); i = gh_cdr (i))
-       {
-         Music *m = unsmob_music (gh_car (i));
-         if (Melodic_req *r = dynamic_cast<Melodic_req *> (m))
-           second_pitches.push (r->pitch_);
-         if (Rhythmic_req *r = dynamic_cast<Rhythmic_req *> (m))
-           second_durations.push (r->duration_);
-       }
-      delete mi;
-    }
+int
+Part_combine_music_iterator::get_state (Moment)
+{
+  int state = UNKNOWN;
+  Part_combine_music const *p = dynamic_cast<Part_combine_music const* > (music_l_);
+  Translator_group *first_translator = first_iter_p_->report_to_l ()->find_create_translator_l (p->what_str_, "one");
+
+  SCM s = first_translator->get_property (ly_symbol2scm ("changeMoment"));
+  Moment change_mom = *unsmob_moment (gh_car (s));
+  Moment diff_mom = *unsmob_moment (gh_cdr (s));
   
-  SCM interval = SCM_BOOL_F;
-  if (first_pitches.size () && second_pitches.size ())
-    {
-      first_pitches.sort (Musical_pitch::compare);
-      second_pitches.sort (Musical_pitch::compare);
-      interval = gh_int2scm (first_pitches.top ().steps ()
-                            - second_pitches[0].steps ());
-    }
-  if (first_durations.size ())
-    {
-      first_durations.sort (Duration::compare);
-      Moment new_until = now + first_durations.top ().length_mom ();
-      if (new_until > first_until_)
-       first_until_ = new_until;
-    }
+  Moment now = pending_moment ();
 
-    if (second_durations.size ())
+  if (!now.mod_rat (change_mom))
     {
-      second_durations.sort (Duration::compare);
-      Moment new_until = now + second_durations.top ().length_mom ();
-      if (new_until > second_until_)
-       second_until_ = new_until;
-    }
+      SCM interval = SCM_BOOL_F;
+      Moment first_mom = first_until_ - now;
+      Moment second_mom = second_until_ - now;
+
+      bool first = true;
+      Music_iterator *first_iter = first_iter_p_->clone ();
+      Music_iterator *second_iter = second_iter_p_->clone ();
+      while ((first_mom <? second_mom) < diff_mom
+            && (first_iter->ok () || second_iter->ok ()))
+       {
+         Moment m;
+         if (!second_iter->ok ())
+           m = first_iter->pending_moment ();
+         else if (!first_iter->ok ())
+           m = second_iter->pending_moment ();
+         else
+           m = first_iter->pending_moment () <? second_iter->pending_moment ();
+
+         Array<Musical_pitch> first_pitches;
+         Array<Duration> first_durations;
+         get_music_info (m, first_iter, &first_pitches, &first_durations);
+      
+         Array<Musical_pitch> second_pitches;
+         Array<Duration> second_durations;
+         get_music_info (m, second_iter, &second_pitches, &second_durations);
+
+         if (first_pitches.size () && second_pitches.size ())
+           {
+             first_pitches.sort (Musical_pitch::compare);
+             second_pitches.sort (Musical_pitch::compare);
+             interval = gh_int2scm (first_pitches.top ().steps ()
+                                    - second_pitches[0].steps ());
+           }
+         if (first_durations.size ())
+           {
+             first_durations.sort (Duration::compare);
+             first_mom += first_durations.top ().length_mom ();
+             if (first)
+               first_until_ = first_mom + now;
+           }
+
+         if (second_durations.size ())
+           {
+             second_durations.sort (Duration::compare);
+             second_mom += second_durations.top ().length_mom ();
+             if (first)
+               second_until_ = second_mom + now;
+           }
+         first = false;
 
 #if 0 /* DEBUG */
-  printf ("now: %s\n", now.str ().ch_C ());
-  printf ("first: ");
-  for (int i = 0; i < first_pitches.size (); i++)
-    {
-      printf ("%s, ", first_pitches[i].str ().ch_C ());
-    }
-  printf ("\nsecond: ");
-  for (int i = 0; i < second_pitches.size (); i++)
-    {
-      printf ("%s, ", second_pitches[i].str ().ch_C ());
-    }
-  printf ("\n");
+         printf ("now: %s\n", now.str ().ch_C ());
+         printf ("first: ");
+         for (int i = 0; i < first_pitches.size (); i++)
+           {
+             printf ("%s, ", first_pitches[i].str ().ch_C ());
+           }
+         printf ("\nsecond: ");
+         for (int i = 0; i < second_pitches.size (); i++)
+           {
+             printf ("%s, ", second_pitches[i].str ().ch_C ());
+           }
+         printf ("\n");
 #endif
 
-  Translator_group * fir = first_iter_p_->report_to_l ();
-  Translator_group * sir = second_iter_p_->report_to_l ();
-
-  bool solo_b = (first_pitches.empty () != second_pitches.empty ())
-    && !(first_until_ > now && second_until_ > now);
-
-  bool unirhythm_b = !solo_b && !compare (&first_durations, &second_durations);
-  bool unison_b = unirhythm_b && !first_pitches.empty ()
-    &&!compare (&first_pitches, &second_pitches);
-  bool unisilence_b = unirhythm_b && first_pitches.empty ();
+         if (!first_pitches.empty () && second_pitches.empty ()
+             && !(second_until_ > now))
+           {
+             state |= UNRELATED;
+             state &= ~UNISILENCE;
+             if (!(state & ~(UNRELATED | SOLO1 | UNISILENCE)))
+               state |= SOLO1;
+           }
+         else
+           state &= ~SOLO1;
+
+         if (first_pitches.empty () && !second_pitches.empty ()
+             && !(first_until_ > now))
+           {
+             state |= UNRELATED;
+             state &= ~UNISILENCE;
+             if (!(state & ~(UNRELATED | SOLO2 | UNISILENCE)))
+               state |= SOLO2;
+           }
+         else
+           state &= ~SOLO2;
+
+         if (!compare (&first_durations, &second_durations))
+           {
+             state &= ~UNISILENCE;
+             if (!(state & ~(UNIRHYTHM | UNISON)))
+               state |= UNIRHYTHM;
+           }
+         else
+           state &= ~(UNIRHYTHM | UNISILENCE);
+         
+         if (!first_pitches.empty ()
+             &&!compare (&first_pitches, &second_pitches))
+           {
+             state &= ~UNISILENCE;
+             if (!(state & ~(UNIRHYTHM | UNISON)))
+               state |= UNISON;
+           }
+         else
+           state &= ~(UNISON);
+           
+         if (first_pitches.empty () && second_pitches.empty ())
+           {
+             if (!(state & ~(UNIRHYTHM | UNISILENCE)))
+               state |= UNISILENCE;
+           }
+         else
+           state &= ~(UNISILENCE);
+
+         if (gh_number_p (interval))
+           {
+             SCM s = first_translator->get_property (ly_symbol2scm ("splitInterval"));
+             int i = gh_scm2int (interval);
+             if (gh_pair_p (s)
+                 && gh_number_p (gh_car (s))
+                 && gh_number_p (gh_cdr (s))
+                 && i >= gh_scm2int (gh_car (s))
+                 && i <= gh_scm2int (gh_cdr (s)))
+               {
+                 if (!(state & ~(SPLIT_INTERVAL | UNIRHYTHM | UNISON)))
+                   state |= SPLIT_INTERVAL;
+               }
+             else
+               state &= ~(SPLIT_INTERVAL);
+           }
+
+#if 0
+         Moment next = (first_mom <? second_mom) + now;
+         if (first_iter->ok ())
+           first_iter->skip (next);
+         if (second_iter->ok ())
+           second_iter->skip (next);
+#else
+         if (first_iter->ok ())
+           first_iter->skip (first_mom + now);
+         if (second_iter->ok ())
+           second_iter->skip (second_mom + now);
+#endif
+       }
+      delete first_iter;
+      delete second_iter;
+    }
+  return state;
+}
 
-  Translator_group * fd = fir->find_create_translator_l (p->what_str_, "one");
-  Translator_group * sd = sir->find_create_translator_l (p->what_str_, "two");
+void
+Part_combine_music_iterator::process (Moment m)
+{
 
-  bool split_interval_b = false;
-  if (gh_number_p (interval))
-    {
-      SCM s = fd->get_property (ly_symbol2scm ("splitInterval"));
-      int i = gh_scm2int (interval);
-      if (gh_pair_p (s)
-         && gh_number_p (gh_car (s))
-         && gh_number_p (gh_cdr (s))
-         && i >= gh_scm2int (gh_car (s))
-         && i <= gh_scm2int (gh_cdr (s)))
-       split_interval_b = true;
-    }
+  /*
+    TODO:
+    - Use three named contexts (be it Thread or Voice): one, two, solo.
+      Let user pre-set (pushproperty) stem direction, remove
+      dynamic-engraver, and such.
+   */
+  int state = get_state (m);
+  if (state)
+    state_ = state;
+  else
+    state = state_;
+  
+  Part_combine_music const *p = dynamic_cast<Part_combine_music const* > (music_l_);
 
   bool combined_b = first_iter_p_->report_to_l ()->daddy_trans_l_
     == second_iter_p_->report_to_l ()->daddy_trans_l_;
 
   String to_id =  combined_b ? "one" : "two";
-  if ((!unirhythm_b && combined_b)
-      || (split_interval_b && combined_b)
-      || (solo_b && combined_b)
-      /*|| (unisilence_b && combined_b) */
-      || ((unirhythm_b || unison_b || unisilence_b)
-         && !combined_b && !split_interval_b && !solo_b))
+  if ((!(state & UNIRHYTHM) && combined_b)
+      || ((state & SPLIT_INTERVAL) && combined_b)
+      || ((state & (SOLO1 | SOLO2)) && combined_b)
+      || (((state & (UNIRHYTHM | UNISILENCE))
+          && !combined_b && !(state & SPLIT_INTERVAL)
+          && !(state & (SOLO1 | SOLO2)))))
     {
       combined_b = !combined_b;
       to_id =  combined_b ? "one" : "two";
       change_to (second_iter_p_, p->what_str_, to_id);
     }
 
-  if (!combined_b)
-    sir = second_iter_p_->report_to_l ();
-
-  SCM b = unirhythm_b ? SCM_BOOL_T : SCM_BOOL_F;
-  fd->set_property ("unirhythm", b);
-  sd->set_property ("unirhythm", b);
-
-  b = split_interval_b ? SCM_BOOL_T : SCM_BOOL_F;
-  fd->set_property ("split-interval", b);
-  sd->set_property ("split-interval",  b);
 
-  b = unisilence_b ? SCM_BOOL_T : SCM_BOOL_F;
-  fd->set_property ("unisilence", b);
-  sd->set_property ("unisilence", b);
+  Translator_group *first_translator = first_iter_p_->report_to_l ()->find_create_translator_l (p->what_str_, "one");
+  Translator_group *second_translator = second_iter_p_->report_to_l ()->find_create_translator_l (p->what_str_, "two");
 
-  b = unison_b ? SCM_BOOL_T : SCM_BOOL_F;
-  fd->set_property ("unison", b);
-  sd->set_property ("unison", b);
-
-  b = solo_b  ? SCM_BOOL_T : SCM_BOOL_F;
-  if (first_pitches.size ())
-    {
-      fd->set_property ("solo", b);
-      sd->set_property ("solo", SCM_BOOL_F);
-    }
-
-  if (second_pitches.size ())
-    {
-      fd->set_property ("solo", SCM_BOOL_F);
-      sd->set_property ("solo", b);
-    }
+  /*
+    hmm
+   */
+  SCM b = (state & UNIRHYTHM) ? SCM_BOOL_T : SCM_BOOL_F;
+  first_translator->set_property ("unirhythm", b);
+  second_translator->set_property ("unirhythm", b);
+
+  b = (state & SPLIT_INTERVAL) ? SCM_BOOL_T : SCM_BOOL_F;
+  first_translator->set_property ("split-interval", b);
+  second_translator->set_property ("split-interval",  b);
+
+  b = (state & UNISILENCE) ? SCM_BOOL_T : SCM_BOOL_F;
+  first_translator->set_property ("unisilence", b);
+  second_translator->set_property ("unisilence", b);
+
+  // difference in definition...
+  //b = ((state & UNISON) ? SCM_BOOL_T : SCM_BOOL_F;
+  b = ((state & UNISON) && (state & UNIRHYTHM)) ? SCM_BOOL_T : SCM_BOOL_F;
+  first_translator->set_property ("unison", b);
+  second_translator->set_property ("unison", b);
+
+  SCM b1 = (state & SOLO1)  ? SCM_BOOL_T : SCM_BOOL_F;
+  SCM b2 = (state & SOLO1)  ? SCM_BOOL_T : SCM_BOOL_F;
+  first_translator->set_property ("solo", b1);
+  second_translator->set_property ("solo", b2);
 
   if (first_iter_p_->ok ())
     first_iter_p_->process (m);
index f463190a342dc3223c4939a5cdf54c902aba8516..080240a8b519b726b25d9dc6d8e1e3fe58d0009c 100644 (file)
@@ -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_sequence *> (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);
 }
index 975f46018739ba7563b7f213e61e33e5485a25c5..8e78b281e96fe8926507282e90ad7ac25fc8a290 100644 (file)
@@ -88,6 +88,32 @@ Sequential_music_iterator::set_sequential_music_translator()
     set_translator (child_report);
 }
 
+void
+Sequential_music_iterator::skip (Moment until)
+{
+  while (1)
+    {
+      SCM nm = iter_p_->get_music (until - here_mom_);
+      
+      Moment m = 0;
+      for (SCM i = nm; gh_pair_p(i); i = gh_cdr (i))
+       m = m >? unsmob_music (gh_car (i))->length_mom ();
+
+      delete iter_p_;
+
+      cursor_ = gh_cdr (cursor_);
+
+      iter_p_ = 0;
+      if (gh_pair_p (cursor_))
+       iter_p_ = get_iterator_p (unsmob_music (gh_car (cursor_)));
+      else
+       return;
+
+      if (m > Moment (0))
+       return;
+    }
+}
+
 /*
   [todo: translate]
   
@@ -110,9 +136,12 @@ Sequential_music_iterator::set_sequential_music_translator()
   redenering helderder is.
 */
 
+#if 1
 SCM
 Sequential_music_iterator::get_music (Moment until)const
 {
+  if (until < pending_moment ())
+    return SCM_EOL;
   SCM s = SCM_EOL;
   SCM curs = cursor_;
   Music_iterator * iter = iter_p_->clone ();
@@ -138,6 +167,41 @@ Sequential_music_iterator::get_music (Moment until)const
     }
   return s;
 }
+#else
+SCM
+Sequential_music_iterator::get_music (Moment until) const
+{
+  Sequential_music_iterator* i = dynamic_cast<Sequential_music_iterator *> (this->clone ());
+  SCM s = SCM_EOL;
+  while (1) 
+      {
+       Moment local_until = until - i->here_mom_;
+       while (i->iter_p_->ok ()) 
+         {
+           Moment here = i->iter_p_->pending_moment ();
+           if (here != local_until)
+             goto finalise;
+           
+           s = gh_append2 (i->iter_p_->get_music (local_until), s);
+           i->iter_p_->skip (local_until);
+         }
+         
+         if (!i->iter_p_->ok ()) 
+           {
+             i->leave_element ();
+             
+             if (gh_pair_p (i->cursor_))
+               i->start_next_element ();
+             else
+               goto finalise;
+           }
+       }
+ finalise:
+  delete i;
+  return s;
+}
+#endif
+
  
 void
 Sequential_music_iterator::process (Moment until)
index a25147d4e9e7f6a0a806c40733cd8baf830dcd22..b185f8ac24b6c97cb0532ba0a49aa138b9947222 100644 (file)
@@ -20,7 +20,8 @@ Simple_music_iterator::Simple_music_iterator ()
 Simple_music_iterator::Simple_music_iterator (Simple_music_iterator const &src)
   : Music_iterator (src)
 {
-  last_processed_mom_ = -1;
+  last_processed_mom_ = src.last_processed_mom_;
+  length_mom_ = src.length_mom_;
 }
 
 void
@@ -44,6 +45,13 @@ Simple_music_iterator::pending_moment ()const
     return length_mom_;
 }
 
+void
+Simple_music_iterator::skip (Moment m)
+{
+  music_l_ = 0;
+  last_processed_mom_ = m;
+}
+
 void
 Simple_music_iterator::process (Moment m)
 {
@@ -59,6 +67,5 @@ Simple_music_iterator::process (Moment m)
                                          classname (music_l_)));
     }
 #endif
-  music_l_ = 0;
-  last_processed_mom_ = m;
+  skip (m);
 }
index ceae9b08aa8fd78a82fb62e9d8721422baa3ec14..d0caa74ac3c6679de2c9bbfc3794539593e3fbff 100644 (file)
@@ -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"
index 0fdd838bea38dc310be20df3c92b87a1653bf8fd..03e7cd96890497b4446ff4c8ea3f90c65d281a86 100644 (file)
@@ -366,6 +366,7 @@ ScoreContext = \translator {
        aDueText = #"\\`a2"
        soloADue = ##t
        splitInterval = #'(0 . 1)
+       changeMoment = #`(,(make-moment 0 0) . ,(make-moment 1 512))
 
        defaultClef = #"treble"
 
index 58ab2b6bd28bb7f41bb153c1eedc53f5c0f8f566..f805540d6973a8796b34d4442e29e5612018dcf4 100644 (file)
@@ -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
index 08cc643ca32eef9a7e2b19554cab39d8e16f710f..e8d1a3358c3473b30f0270dc9fb9101311a1b3ca 100644 (file)
@@ -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
index b78365c2a89f8e8ecb1927b3c01e354c647f3452..844bf454e3ebe602bef00871b4363437a48bf0d0 100644 (file)
@@ -50,6 +50,7 @@
                soloIIText = #""
                aDueText = #""
                splitInterval = #'(1 . 0)
+               changeMoment = #`(,(make-moment 1 1) . ,(make-moment 1 1))
        }
        \translator {
                \StaffGroupContext