]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-performer.cc
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / note-performer.cc
index a9acca733a513c64a9e3e7453c04d18403416d27..ff296311ffead109a8de2936f8542a3170b8aa0d 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1996--2006 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 1996--2007 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "performer.hh"
@@ -38,11 +38,10 @@ Note_performer::process_music ()
 {
   if (note_evs_.size ())
     {
-      int transposing = 0;
-
+      Pitch transposing;
       SCM prop = get_property ("instrumentTransposition");
       if (unsmob_pitch (prop))
-       transposing = unsmob_pitch (prop)->semitone_pitch ();
+       transposing = *unsmob_pitch (prop);
 
       while (note_evs_.size ())
        {
@@ -52,7 +51,29 @@ 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");
+              Stream_event *tie_event = 0;
+              for (SCM s = articulations;
+                   !tie_event && scm_is_pair (s);
+                   s = scm_cdr (s))
+                {
+                  Stream_event *ev = unsmob_stream_event (scm_car (s));
+                  if (!ev)
+                    continue;
+         
+                  if (ev->in_event_class ("tie-event"))
+                    tie_event = ev;
+                }
+
+             Moment len = get_event_length (n);
+             if (now_mom().grace_part_)
+               {
+                 len.grace_part_ = len.main_part_;
+                 len.main_part_ = Rational (0);
+               }
+             
+             Audio_note *p = new Audio_note (*pitp, len, 
+                                              tie_event, transposing.negated ());
              Audio_element_info info (p, n);
              announce_element (info);
              notes_.push_back (p);
@@ -67,9 +88,6 @@ Note_performer::stop_translation_timestep ()
 {
   // why don't grace notes show up here?
   // --> grace notes effectively do not get delayed
-  Moment now = now_mom ();
-  for (vsize i = 0; i < notes_.size (); i++)
-    play_element (notes_[i]);
   notes_.clear ();
   note_evs_.clear ();
 }
@@ -82,7 +100,6 @@ Note_performer::listen_note (Stream_event *ev)
 }
 
 ADD_TRANSLATOR (Note_performer, "", "",
-               "note-event ",
                "", "");
 
 Note_performer::Note_performer ()