2 // midi-def.cc -- implement midi output
4 // source file of the GNU LilyPond music typesetter
6 // (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
10 #include "midi-def.hh"
13 // classes, alphasorted
17 // routines, alphasorted
21 int Midi_def::den_i_s = 4;
22 int Midi_def::num_i_s = 4;
26 set_tempo( Moment( 1, 4 ), 60 );
27 outfile_str_ = "lelie.midi";
30 Midi_def::Midi_def( Midi_def const& midi_c_r )
32 whole_seconds_f_ = midi_c_r.whole_seconds_f_;
33 outfile_str_ = midi_c_r.outfile_str_;
41 Midi_def::duration_to_seconds_f( Moment moment )
46 return Moment( whole_seconds_f_ ) * moment;
50 Midi_def::get_tempo_i( Moment moment )
52 return Moment( whole_seconds_f_ ) * Moment( 60 ) * moment;
56 Midi_def::print() const
59 mtor << "Midi {4/min: " << Real( 60 ) / ( whole_seconds_f_ * 4 );
60 mtor << "out: " << outfile_str_;
66 Midi_def::set_tempo( Moment moment, int count_per_minute_i )
68 whole_seconds_f_ = Moment( count_per_minute_i ) / Moment( 60 ) / moment;