2 // midi-score.cc -- implement Midi_score
4 // copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
8 Midi_score::Midi_score( int format_i
, int tracks_i
, int tempo_i
)
15 Midi_score::~Midi_score()
20 Midi_score::add_track( Midi_track
* midi_track_p
)
22 midi_track_p_list_
.bottom().add( midi_track_p
);
26 Midi_score::output_mudela( String filename_str
)
28 mtor
<< "Lily output to " << filename_str
<< " ..." << endl
;
30 Lily_stream
lily_stream( filename_str
);
31 for ( PCursor
<Midi_track
*> midi_track_l_pcur( midi_track_p_list_
.top() ); midi_track_l_pcur
.ok(); midi_track_l_pcur
++ ) {
32 midi_track_l_pcur
->output_mudela( lily_stream
);
33 lily_stream
.newline();
36 lily_stream
<< "score {";
37 lily_stream
.newline();
39 for ( PCursor
<Midi_track
*> midi_track_l_pcur( midi_track_p_list_
.top() ); midi_track_l_pcur
.ok(); midi_track_l_pcur
++ ) {
40 lily_stream
<< "\tstaff { melodic music { ";
41 lily_stream
<< midi_track_l_pcur
->name_str();
42 lily_stream
<< " } }";
43 lily_stream
.newline();
47 lily_stream
<< "commands {";
49 midi_parser_l_g
->midi_time_p_
->output_mudela( lily_stream
, true );
52 lily_stream
.newline();
53 lily_stream
<< "midi {";
55 midi_parser_l_g
->midi_tempo_p_
->output_mudela( lily_stream
, true );
61 lily_stream
.newline();
69 for ( PCursor
<Midi_track
*> i( midi_track_p_list_
.top() ); i
.ok(); i
++ )