X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fly-syntax-constructors.scm;h=60af06436e64fa88f003d38d82cac029fbe6f33e;hb=aa049c284313d3c358c5f4c1980944dcdf1d2130;hp=92276e745f1ca9fbc31e367b6d02fa7633e82d2e;hpb=a396a31d3d8df664dbadef65f0e807759d6b355e;p=lilypond.git diff --git a/scm/ly-syntax-constructors.scm b/scm/ly-syntax-constructors.scm index 92276e745f..60af06436e 100644 --- a/scm/ly-syntax-constructors.scm +++ b/scm/ly-syntax-constructors.scm @@ -1,6 +1,6 @@ ;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; Copyright (C) 2006--2010 Erik Sandberg +;;;; Copyright (C) 2006--2011 Erik Sandberg ;;;; ;;;; LilyPond is free software: you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by @@ -90,19 +90,23 @@ '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