X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdefine-music-display-methods.scm;h=4e846a5a64cd4b9c38bcb75a69936fcba7d673a1;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=b1b9111e13c58839086288e8d49834eaf695ed2e;hpb=d3137d1b07b473666711575dbebf8e70ebd4caca;p=lilypond.git diff --git a/scm/define-music-display-methods.scm b/scm/define-music-display-methods.scm index b1b9111e13..4e846a5a64 100644 --- a/scm/define-music-display-methods.scm +++ b/scm/define-music-display-methods.scm @@ -1,7 +1,7 @@ ;;; define-music-display-methods.scm -- data for displaying music ;;; expressions using LilyPond notation. ;;; -;;; (c) 2005--2007 Nicolas Sceaux +;;; (c) 2005--2008 Nicolas Sceaux ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -881,21 +881,48 @@ Otherwise, return #f." "\\melismaEnd")) ;;; \tempo +;;; Check for all three different syntaxes of tempo: +;;; \tempo string duration=note, \tempo duration=note and \tempo string (define-extra-display-method ContextSpeccedMusic (expr parser) "If expr is a tempo, return \"\\tempo x = nnn\", otherwise return #f." - (with-music-match (expr (music 'ContextSpeccedMusic + (or (with-music-match (expr (music 'ContextSpeccedMusic + element (music 'SequentialMusic + elements ((music 'PropertySet + value ?unit-text + symbol 'tempoText) + (music 'PropertySet + symbol 'tempoWholesPerMinute) + (music 'PropertySet + value ?unit-duration + symbol 'tempoUnitDuration) + (music 'PropertySet + value ?unit-count + symbol 'tempoUnitCount))))) + (format #f "\\tempo ~a ~a = ~a" + (scheme-expr->lily-string ?unit-text) + (duration->lily-string ?unit-duration #:force-duration #t) + ?unit-count)) + (with-music-match (expr (music 'ContextSpeccedMusic + element (music 'SequentialMusic + elements ((music 'PropertyUnset + symbol 'tempoText) + (music 'PropertySet + symbol 'tempoWholesPerMinute) + (music 'PropertySet + value ?unit-duration + symbol 'tempoUnitDuration) + (music 'PropertySet + value ?unit-count + symbol 'tempoUnitCount))))) + (format #f "\\tempo ~a = ~a" + (duration->lily-string ?unit-duration #:force-duration #t) + ?unit-count)) + (with-music-match (expr (music 'ContextSpeccedMusic element (music 'SequentialMusic elements ((music 'PropertySet - symbol 'tempoWholesPerMinute) - (music 'PropertySet - value ?unit-duration - symbol 'tempoUnitDuration) - (music 'PropertySet - value ?unit-count - symbol 'tempoUnitCount))))) - (format #f "\\tempo ~a = ~a" - (duration->lily-string ?unit-duration #:force-duration #t) - ?unit-count))) + value ?tempo-text + symbol 'tempoText))))) + (format #f "\\tempo ~a" (scheme-expr->lily-string ?tempo-text))))) ;;; \clef (define clef-name-alist #f)