2 // midi-def.cc -- implement midi output
4 // source file of the LilyPond music typesetter
6 // (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
10 #include "midi-def.hh"
13 // classes, alphasorted
17 // routines, alphasorted
21 set_tempo( Moment( 1, 4 ), 60 );
22 outfile_str_ = "lelie.midi";
25 Midi_def::Midi_def( Midi_def const& midi_c_r )
27 whole_seconds_f_ = midi_c_r.whole_seconds_f_;
28 outfile_str_ = midi_c_r.outfile_str_;
36 Midi_def::duration_to_seconds_f( Moment moment )
41 return whole_seconds_f_ * moment;
45 Midi_def::get_tempo_i( Moment moment )
47 return Moment( whole_seconds_f_ ) * Moment( 60 ) * moment;
51 Midi_def::print() const
54 mtor << "Midi {4/min: " << Real( 60 ) / ( whole_seconds_f_ * 4 );
55 mtor << "out: " << outfile_str_;
61 Midi_def::set_tempo( Moment moment, int count_per_minute_i )
63 whole_seconds_f_ = Moment( count_per_minute_i ) / Moment( 60 ) / moment;