2 midi-def.cc -- implement midi output def functions
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
13 #include "output-def.hh"
16 #include "scm-hash.hh"
19 get_tempo (Output_def * def,
22 SCM wis = ly_symbol2scm ("whole-in-seconds");
23 Moment *w = unsmob_moment (def->lookup_variable (wis));
25 Moment wholes_per_min = Moment (60);
28 programming_error ("wholes-in-seconds not set.");
36 int beats_per_min = int ((wholes_per_min / one_beat_mom).main_part_);
37 return int (beats_per_min);
41 set_tempo (Output_def * def,
43 int beats_per_minute_i)
45 Moment beats_per_second = Moment (beats_per_minute_i) / Moment (60);
47 Moment m = Moment (1)/Moment (beats_per_second * one_beat_mom);
48 def->set_variable (ly_symbol2scm ("whole-in-seconds"), m.smobbed_copy ());