]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/ly-syntax-constructors.scm
Doc-de: updates to notation manual
[lilypond.git] / scm / ly-syntax-constructors.scm
index 92276e745f1ca9fbc31e367b6d02fa7633e82d2e..60af06436e64fa88f003d38d82cac029fbe6f33e 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;; Copyright (C) 2006--2010 Erik Sandberg <mandolaerik@gmail.com>
+;;;; Copyright (C) 2006--2011 Erik Sandberg <mandolaerik@gmail.com>
 ;;;;
 ;;;; LilyPond is free software: you can redistribute it and/or modify
 ;;;; it under the terms of the GNU General Public License as published by
              'element (ly:music-transpose music pitch)))
 
 (define-ly-syntax-simple (tempo text duration tempo)
-  (let ((props (list
-                 (make-property-set 'tempoWholesPerMinute
-                       (ly:moment-mul (ly:make-moment tempo 1)
-                                      (ly:duration-length duration)))
-                 (make-property-set 'tempoUnitDuration duration)
-                 (make-property-set 'tempoUnitCount tempo))))
-    (set! props (cons 
-            (if text (make-property-set 'tempoText text)
-                     (make-property-unset 'tempoText)) 
-            props))
+  (let* ((range-tempo? (pair? tempo))
+        (tempo-count (if range-tempo?
+                         (round (/ (+ (car tempo) (cdr tempo)) 2))
+                         tempo))
+        (props (list
+                (make-property-set 'tempoWholesPerMinute
+                                   (ly:moment-mul (ly:make-moment tempo-count 1)
+                                                  (ly:duration-length duration)))
+                (make-property-set 'tempoUnitDuration duration)
+                (make-property-set 'tempoUnitCount tempo))))
+    (set! props (cons
+                (if text (make-property-set 'tempoText text)
+                     (make-property-unset 'tempoText))
+                props))
     (context-spec-music
-      (make-sequential-music props)
-      'Score)))
+     (make-sequential-music props)
+     'Score)))
 
 (define-ly-syntax-simple (tempoText text)
   (context-spec-music