2 midi-def.cc -- implement Midi_def
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
11 #include "midi-def.hh"
12 #include "performance.hh"
19 set_tempo (Moment (1, 4), 60);
29 Midi_def::get_tempo_i (Moment one_beat_mom)
31 Moment w = *unsmob_moment (scope_p_->scm_elem ("whole-in-seconds"));
32 Moment wholes_per_min = Moment(60) /w;
33 int beats_per_min = wholes_per_min / one_beat_mom;
34 return int (beats_per_min);
38 Midi_def::set_tempo (Moment one_beat_mom, int beats_per_minute_i)
40 Moment beats_per_second = Moment (beats_per_minute_i) / Moment (60);
42 Moment m = Moment(1)/Moment(beats_per_second * one_beat_mom);
43 scope_p_->set ("whole-in-seconds", m.smobbed_copy());
47 int Midi_def::default_count_i_=0;
50 Midi_def::get_next_default_count () const
52 return default_count_i_++;
56 Midi_def::reset_default_count ()