]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 4 Sep 2006 17:08:02 +0000 (17:08 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 4 Sep 2006 17:08:02 +0000 (17:08 +0000)
ChangeLog
lily/audio-item.cc
lily/drum-note-performer.cc
lily/include/audio-item.hh
lily/note-performer.cc
lily/tie-performer.cc

index ff27e6840b940e8b69c23c44fa4675959db8453e..4501574500139ecd34553bbc8fc50b3fcce83475 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2006-09-04  Michael Welsh Duggan  <md5i@cs.cmu.edu>
+
+       * lily/tie-performer.cc: remove unused last_event_ property.
+       (class Tie_performer): add now_tied_heads_ property for
+       partially-tied heads.
+       (acknowledge_audio_element): when adding an Audio_note, put the
+       note in now_tied_heads_ if the audio note is partially tied.
+       (stop_translation_timestep): always include entries in
+       now_tied_heads_ in heads_to_tie_.
+
+       * lily/drum-note-performer.cc (process_music): look for tie-events
+       in the articulations; pass to Audio_note constructor.
+
+       * lily/note-performer.cc (process_music): look for tie-events in
+       the articulations; pass to Audio_note constructor.
+
+       * lily/audio-item.cc (Audio_note): Initialize tie_event_ in
+       constructor.
+
+       * lily/include/audio-item.hh (class Audio_note): add tie_event_.
+       include initializer in constructor.
+
 2006-09-02  Joe Neeman  <joeneeman@gmail.com>
 
        * lily/simple-spacer.cc (get_line_forces): Ignore loose columns
index 0e4ded6386cfc23d852df3548cd9ffe54ce3ca8e..fe8c5539e1c6e593a339553132a0abbd889e7277 100644 (file)
@@ -21,12 +21,13 @@ Audio_item::Audio_item ()
   audio_column_ = 0;
 }
 
-Audio_note::Audio_note (Pitch p, Moment m, int transposing_i)
+Audio_note::Audio_note (Pitch p, Moment m, bool tie_event, int transposing_i)
 {
   pitch_ = p;
   length_mom_ = m;
   tied_ = 0;
   transposing_ = transposing_i;
+  tie_event_ = tie_event;
 }
 
 void
index 9a8e7e8e2ad23c9071bf698c743e553dabf0aea7..2926fb8961279339ac29f3c1e9e1ba89e38082c3 100644 (file)
@@ -10,6 +10,7 @@
 #include "audio-item.hh"
 #include "audio-column.hh"
 #include "global-context.hh"
+#include "music.hh"
 #include "pitch.hh"
 #include "stream-event.hh"
 #include "translator.icc"
@@ -51,7 +52,22 @@ Drum_note_performer::process_music ()
 
       if (Pitch *pit = unsmob_pitch (defn))
        {
-         Audio_note *p = new Audio_note (*pit, get_event_length (n), 0);
+          SCM articulations = n->get_property ("articulations");
+          Music *tie_event = 0;
+          for (SCM s = articulations;
+               !tie_event && scm_is_pair (s);
+               s = scm_cdr (s))
+            {
+              Music *m = unsmob_music (scm_car (s));
+              if (!m)
+                continue;
+         
+              if (m->is_mus_type ("tie-event"))
+                tie_event = m;
+            }
+
+         Audio_note *p = new Audio_note (*pit, get_event_length (n), 
+                                          tie_event, 0);
          Audio_element_info info (p, n);
          announce_element (info);
          notes_.push_back (p);
index 1e7bfec32af1955df611231fdb9080ba9a07fbea..11f3cd31f5b90f2211578e0ed5f80c44968f415b 100644 (file)
@@ -55,7 +55,7 @@ public:
 class Audio_note : public Audio_item
 {
 public:
-  Audio_note (Pitch p, Moment m, int transposing_i = 0);
+  Audio_note (Pitch p, Moment m, bool tie_event, int transposing_i);
 
   void tie_to (Audio_note *);
 
@@ -63,6 +63,7 @@ public:
   Moment length_mom_;
   int transposing_;
   Audio_note *tied_;
+  bool tie_event_;
 };
 
 class Audio_piano_pedal : public Audio_item
index 73a3def1c9a1b960c202da561a94aac00c790396..8a39546b41c32c2e4062c54bceedb1211eccd8ac 100644 (file)
@@ -10,6 +10,7 @@
 #include "audio-item.hh"
 #include "audio-column.hh"
 #include "global-context.hh"
+#include "music.hh"
 #include "stream-event.hh"
 #include "warn.hh"
 
@@ -52,7 +53,22 @@ Note_performer::process_music ()
 
          if (Pitch *pitp = unsmob_pitch (pit))
            {
-             Audio_note *p = new Audio_note (*pitp, get_event_length (n), - transposing);
+              SCM articulations = n->get_property ("articulations");
+              Music *tie_event = 0;
+              for (SCM s = articulations;
+                   !tie_event && scm_is_pair (s);
+                   s = scm_cdr (s))
+                {
+                  Music *m = unsmob_music (scm_car (s));
+                  if (!m)
+                    continue;
+         
+                  if (m->is_mus_type ("tie-event"))
+                    tie_event = m;
+                }
+
+             Audio_note *p = new Audio_note (*pitp, get_event_length (n), 
+                                              tie_event, - transposing);
              Audio_element_info info (p, n);
              announce_element (info);
              notes_.push_back (p);
index 5e1256453e5efc6474586e4a83a3dc37fad9b20f..c22fe255ec0d06e4ebadd7a7a994bb204fa0d374 100644 (file)
@@ -17,8 +17,8 @@
 class Tie_performer : public Performer
 {
   Stream_event *event_;
-  Stream_event *last_event_;
   vector<Audio_element_info> now_heads_;
+  vector<Audio_element_info> now_tied_heads_;
   vector<Audio_element_info> heads_to_tie_;
 
   bool ties_created_;
@@ -36,7 +36,6 @@ public:
 Tie_performer::Tie_performer ()
 {
   event_ = 0;
-  last_event_ = 0;
   ties_created_ = false;
 }
 
@@ -59,7 +58,11 @@ Tie_performer::acknowledge_audio_element (Audio_element_info inf)
 {
   if (Audio_note *an = dynamic_cast<Audio_note *> (inf.elem_))
     {
-      now_heads_.push_back (inf);
+      if (an->tie_event_)
+        now_tied_heads_.push_back (inf);
+      else
+        now_heads_.push_back (inf);
+
       for (vsize i = heads_to_tie_.size (); i--;)
        {
          Stream_event *right_mus = inf.event_;
@@ -91,17 +94,20 @@ Tie_performer::stop_translation_timestep ()
   if (ties_created_)
     {
       heads_to_tie_.clear ();
-      last_event_ = 0;
       ties_created_ = false;
     }
 
   if (event_)
     {
       heads_to_tie_ = now_heads_;
-      last_event_ = event_;
     }
+
+  for (vsize i = now_tied_heads_.size(); i--;)
+    heads_to_tie_.push_back (now_tied_heads_[i]);
+
   event_ = 0;
   now_heads_.clear ();
+  now_tied_heads_.clear ();
 }
 
 ADD_TRANSLATOR (Tie_performer,