2 midi-def.cc -- implement midi output def functions
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2006 Jan Nieuwenhuizen <janneke@gnu.org>
11 #include "output-def.hh"
14 #include "scm-hash.hh"
17 get_tempo (Output_def *def,
20 SCM wis = ly_symbol2scm ("whole-in-seconds");
21 Moment *w = unsmob_moment (def->lookup_variable (wis));
23 Moment wholes_per_min = Moment (60);
26 programming_error ("wholes-in-seconds not set.");
32 Rational beats_per_min = (wholes_per_min / one_beat_mom).main_part_;
33 return beats_per_min.to_int ();
37 set_tempo (Output_def *def,
39 int beats_per_minute_i)
41 Moment beats_per_second = Moment (beats_per_minute_i) / Moment (60);
43 Moment m = Moment (1) / Moment (beats_per_second * one_beat_mom);
44 def->set_variable (ly_symbol2scm ("whole-in-seconds"), m.smobbed_copy ());