2 // midi-score.cc -- implement Midi_score
4 // copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
10 #include "duration.hh"
11 #include "source-file.hh"
13 #include "midi-main.hh" // *tors
14 #include "midi-event.hh"
15 #include "lily-stream.hh"
16 #include "track-column.hh"
17 #include "midi-track.hh"
18 #include "midi-score.hh"
20 Midi_score::Midi_score( int format_i
, int tracks_i
, int tempo_i
)
27 Midi_score::~Midi_score()
32 Midi_score::add_track( Midi_track
* midi_track_p
)
34 midi_track_p_list_
.bottom().add( midi_track_p
);
38 Midi_score::output_mudela( String filename_str
)
40 mtor
<< "Lily output to " << filename_str
<< " ..." << endl
;
42 Lily_stream
lily_stream( filename_str
);
43 for ( PCursor
<Midi_track
*> midi_track_l_pcur( midi_track_p_list_
.top() ); midi_track_l_pcur
.ok(); midi_track_l_pcur
++ ) {
44 midi_track_l_pcur
->output_mudela( lily_stream
);
48 lily_stream
<< "score {\n";
50 for ( PCursor
<Midi_track
*> midi_track_l_pcur( midi_track_p_list_
.top() ); midi_track_l_pcur
.ok(); midi_track_l_pcur
++ ) {
51 lily_stream
<< "\tstaff { melodic music { ";
52 lily_stream
<< midi_track_l_pcur
->name_str();
53 lily_stream
<< " } }\n";
56 lily_stream
<< "\tcommands { meter { 4*4 } }\n";
57 lily_stream
<< "\tmidi { tempo 4:60 }\n";