]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 10 Mar 2006 09:43:17 +0000 (09:43 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 10 Mar 2006 09:43:17 +0000 (09:43 +0000)
ChangeLog
Documentation/topdocs/NEWS.tely
Documentation/user/basic-notation.itely
lily/audio-column.cc
lily/include/audio-column.hh
lily/include/score-performer.hh
lily/score-performer.cc

index 9c7b3d87eaa65d39928444cef6e897c253b367ba..787fac3763662d891293cb7fc66673d0229cc307 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-03-08  Johannes Schindelin  <Johannes.Schindelin@gmx.de>
+
+       * lily/audio-column.cc, lily/score-performer.cc: MIDI output now
+       respects the Score.skipTypesetting property.
+       
 2006-03-09  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * scm/framework-ps.scm (ps-embed-cff): no Setup section in
index 1ecc6c72f0196a38aa8df8dc08c72542cdd9d006..e6caa29df685cf86ffd44758f7d8a4853e700539 100644 (file)
@@ -64,6 +64,11 @@ which scares away people.
 
 @end ignore
 
+@item The property @code{Score.skipTypesetting} is also respected
+by the MIDI output now.
+
+This feature was contributed by Johannes Schindelin.
+
 @item A score may now be specified to take a fixed number of
 systems, by setting the @code{system-count} variable in the
 @code{\layout} block.
index e64483f204c3a18c20cd5b7017ea6fb9ba7ad509..ee27fdbcdf6be98203e6c9989eee3491fd2769f4 100644 (file)
@@ -860,6 +860,10 @@ Skipping parts of a score can be controlled in a more fine-grained
 fashing with the property @code{Score.skipTypesetting}.  When it is
 set, no typesetting is performed at all.
 
+This property is also used to control output to the MIDI file. Note that
+it skips all events, including tempo and instrument changes. You have
+been warned.
+
 @lilypond[quote,fragment,ragged-right,verbatim]
 \relative c'' {
   c8 d
index c9c880ec0755d5cb8a98feb099c78a9aea026498..d0a36518a573584bcee77c14d75fa0b75a78a5c5 100644 (file)
@@ -29,3 +29,9 @@ Audio_column::at_mom () const
   return at_mom_;
 }
 
+void
+Audio_column::offset_at_mom (Moment m)
+{
+  at_mom_ += m;
+}
+
index 77eee19537d2731c83f81f745722237d3be66f33..1cc827a2767fff90abde602dbaf450f40af3f493 100644 (file)
@@ -26,6 +26,10 @@ public:
 
   vector<Audio_item*> audio_items_;
 
+protected:
+  void offset_at_mom (Moment m);
+  friend class Score_performer;
+
 private:
   Audio_column (Audio_column const &);
 
index ca77b9a7f92defa7d3c3b0f8d3a3fc73150f6e4a..e38f430c62ed679415addf4cb6f5020876d1225f 100644 (file)
@@ -37,6 +37,9 @@ private:
   void header (Midi_stream &);
 
   Audio_column *audio_column_;
+  bool skipping_;
+  Moment skip_start_mom_;
+  Moment offset_mom_;
 };
 
 #endif // SCORE_PERFORMER_HH
index ed9e4077755fa465dcb2630ef648878f5f68782d..5bff2797dac2ded126f08553acd8e2a15e166544 100644 (file)
@@ -6,6 +6,7 @@
   (c) 1996--2006 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
+#include "moment.hh"
 #include "score-performer.hh"
 
 #include "audio-column.hh"
@@ -28,6 +29,7 @@ ADD_TRANSLATOR_GROUP (Score_performer,
 Score_performer::Score_performer ()
 {
   performance_ = 0;
+  skipping_ = false;
 }
 
 Score_performer::~Score_performer ()
@@ -68,8 +70,27 @@ Score_performer::finish ()
 void
 Score_performer::one_time_step ()
 {
-  precomputed_recurse_over_translators (context (), PROCESS_MUSIC, UP);
-  do_announces ();
+  if (to_boolean (context ()->get_property ("skipTypesetting")))
+    {
+      if (!skipping_)
+        {
+         skip_start_mom_ = audio_column_->at_mom ();
+         skipping_ = true;
+        }
+    }
+  else
+    {
+      if (skipping_)
+        {
+         offset_mom_ -= audio_column_->at_mom () - skip_start_mom_;
+         skipping_ = false;
+       }
+
+      audio_column_->offset_at_mom (offset_mom_);
+      precomputed_recurse_over_translators (context (), PROCESS_MUSIC, UP);
+      do_announces ();
+    }
+
   precomputed_recurse_over_translators (context (), STOP_TRANSLATION_TIMESTEP, UP);
 }