4 ;; 60 seconds in a minute, 4 beats per whole note.
5 (defconstant +seconds-per-minute
+ 60)
6 (defconstant +beats-per-whole-note
+ 4)
8 (defun duration-to-frames (duration tempo
&optional
(frequency 50))
9 "Returns a /fractional/ duration -- the conversion routine is
10 responsible for dealing with these fractions as it sees fit."
11 (let ((count (/ (/ (* frequency
+seconds-per-minute
+)
12 (/ tempo
+beats-per-whole-note
+))
13 (duration-denominator duration
))))
15 (do ((dots (duration-dots duration
) (1- dots
))
16 (extra (/ count
2) (/ extra
2)))