+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
@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.
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
return at_mom_;
}
+void
+Audio_column::offset_at_mom (Moment m)
+{
+ at_mom_ += m;
+}
+
vector<Audio_item*> audio_items_;
+protected:
+ void offset_at_mom (Moment m);
+ friend class Score_performer;
+
private:
Audio_column (Audio_column const &);
void header (Midi_stream &);
Audio_column *audio_column_;
+ bool skipping_;
+ Moment skip_start_mom_;
+ Moment offset_mom_;
};
#endif // SCORE_PERFORMER_HH
(c) 1996--2006 Jan Nieuwenhuizen <janneke@gnu.org>
*/
+#include "moment.hh"
#include "score-performer.hh"
#include "audio-column.hh"
Score_performer::Score_performer ()
{
performance_ = 0;
+ skipping_ = false;
}
Score_performer::~Score_performer ()
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);
}