2 midi-def.cc -- implement Midi_def
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
11 #include "midi-def.hh"
12 #include "performance.hh"
19 set_tempo (Moment (Rational (1, 4)), 60);
23 Midi_def::get_tempo_i (Moment one_beat_mom
)
25 Moment w
= *unsmob_moment (scope_p_
->scm_elem ("whole-in-seconds"));
26 Moment wholes_per_min
= Moment (60) /w
;
27 int beats_per_min
= int ((wholes_per_min
/ one_beat_mom
).main_part_
);
28 return int (beats_per_min
);
32 Midi_def::set_tempo (Moment one_beat_mom
, int beats_per_minute_i
)
34 Moment beats_per_second
= Moment (beats_per_minute_i
) / Moment (60);
36 Moment m
= Moment (1)/Moment (beats_per_second
* one_beat_mom
);
37 scope_p_
->set ("whole-in-seconds", m
.smobbed_copy ());
41 int Midi_def::score_count_i_
=0;
44 Midi_def::get_next_score_count () const
46 return score_count_i_
++;
50 Midi_def::reset_score_count ()