2 midi-output.cc -- implement Midi_output
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>, Jan Nieuwehuizen <jan@digicash.com>
13 #include "midi-stream.hh"
14 #include "midi-def.hh"
15 #include "midi-output.hh"
16 #include "midi-walker.hh"
17 #include "midi-item.hh"
18 #include "staff-column.hh"
19 #include "musicalrequest.hh"
22 Midi_output:: Midi_output(Score
* score_l
, Midi_def
* midi_l
)
26 Midi_stream
midi_stream(midi_l
->outfile_str_
,
27 score_l
->staffs_
.size(),
29 // oeps, not tempo, but clocks per 4 (384 convention)
30 // must set tempo in tempo request
31 // midi_l->get_tempo_i(Moment(1, 4)));
33 midi_stream_l_
= &midi_stream
;
36 for (iter_top(score_l
->staffs_
,i
); i
.ok(); i
++) {
37 do_staff(i
, track_i
++);
43 Midi_output::do_staff(Staff
*st_l
,int track_i
)
45 Midi_track
midi_track( track_i
);
46 Midi_tempo
midi_tempo( midi_l_
->get_tempo_i( Moment( 1, 4 ) ) );
47 midi_track
.add( Moment( 0.0 ), &midi_tempo
);
48 for (Midi_walker
w (st_l
, &midi_track
); w
.ok(); w
++)
51 *midi_stream_l_
<< midi_track
;