]> git.donarmstrong.com Git - lilypond.git/commitdiff
(create_audio_elements): play instrument
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 26 Mar 2004 01:14:46 +0000 (01:14 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 26 Mar 2004 01:14:46 +0000 (01:14 +0000)
changes before notes arrive. This fixes instrument of the first
note in a score.

ChangeLog
lily/staff-performer.cc

index cbb023fe7b084f5a661a3e0162b39e81e7cc10ff..c9292c873b23ffaf53c6c8a89bacce1bcd3f8d1f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,11 @@
 2004-03-26  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/staff-performer.cc (create_audio_elements): play instrument
+       changes before notes arrive. This fixes instrument of the first
+       note in a score.
+
        * scripts/convert-ly.py (FatalConversionError.conv): add #'() case
        to 1.9.0 conversion.
-       
 
        * lily/mark-engraver.cc: doc string.
 
index 4969d4f85e5877e24c9ff79c93424c187b36c5cb..bc0d86f7d6b52eda706cb1270f335a67971d76f9 100644 (file)
@@ -84,6 +84,12 @@ Staff_performer::create_audio_elements ()
       announce_element (Audio_element_info (instrument_name_, 0));
       instrument_ = new Audio_instrument (str);
       announce_element (Audio_element_info (instrument_, 0));
+
+      /*
+       Have to be here before notes arrive into the staff.
+       */
+      play_element (instrument_);
+      play_element (instrument_name_);
     }
   Performer_group_performer::create_audio_elements ();
 }
@@ -105,16 +111,8 @@ Staff_performer::stop_translation_timestep ()
       play_element (tempo_);
       tempo_ = 0;
     }
-  if (instrument_name_)
-    {
-      play_element (instrument_name_);
-      instrument_name_ = 0;
-    }
-  if (instrument_)
-    {
-      play_element (instrument_);
-      instrument_ = 0;
-    }
+  instrument_name_ = 0;
+  instrument_ = 0;
   Performer_group_performer::stop_translation_timestep ();
 }