X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdefine-music-display-methods.scm;h=b1b9111e13c58839086288e8d49834eaf695ed2e;hb=0b19893c69df343145301d5b639fbeef9bfd5b8e;hp=66beb27cea6373b35ae9d3f39942878dcbb2b10e;hpb=3920b02188c3c6b0190626a936c586fe687a4a2d;p=lilypond.git diff --git a/scm/define-music-display-methods.scm b/scm/define-music-display-methods.scm index 66beb27cea..b1b9111e13 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--2006 Nicolas Sceaux +;;; (c) 2005--2007 Nicolas Sceaux ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -155,6 +155,7 @@ 'HarmonicEvent 'BeamForbidEvent 'AbsoluteDynamicEvent + 'TupletSpanEvent 'TrillSpanEvent 'GlissandoEvent 'ArpeggioEvent @@ -598,6 +599,7 @@ Otherwise, return #f." (fig (ly:music-property figure 'figure)) (bracket-start (ly:music-property figure 'bracket-start)) (bracket-stop (ly:music-property figure 'bracket-stop))) + (format #f "~a~a~a~a" (if (null? bracket-start) "" "[") (cond ((null? fig) "_") @@ -605,12 +607,12 @@ Otherwise, return #f." (else fig)) (if (null? alteration) "" - (case alteration - ((-4) "--") - ((-2) "-") - ((0) "!") - ((2) "+") - ((4) "++") + (cond + ((= alteration DOUBLE-FLAT) "--") + ((= alteration FLAT) "-") + ((= alteration NATURAL) "!") + ((= alteration SHARP) "+") + ((= alteration DOUBLE-SHARP) "++") (else ""))) (if (null? bracket-stop) "" "]")))) @@ -687,9 +689,6 @@ Otherwise, return #f." (define-display-method UnfoldedRepeatedMusic (expr parser) (repeat->lily-string expr "unfold" parser)) -(define-display-method FoldedRepeatedMusic (expr parser) - (repeat->lily-string expr "fold" parser)) - (define-display-method PercentRepeatedMusic (expr parser) (repeat->lily-string expr "percent" parser)) @@ -829,10 +828,14 @@ Otherwise, return #f." ;;; Layout properties (define-display-method OverrideProperty (expr parser) - (let ((symbol (ly:music-property expr 'symbol)) - (properties (ly:music-property expr 'grob-property-path)) - (value (ly:music-property expr 'grob-value)) - (once (ly:music-property expr 'once))) + (let* ((symbol (ly:music-property expr 'symbol)) + (property-path (ly:music-property expr 'grob-property-path)) + (properties (if (pair? property-path) + property-path + (list (ly:music-property expr 'grob-property)))) + (value (ly:music-property expr 'grob-value)) + (once (ly:music-property expr 'once))) + (format #f "~a\\override ~a~a #'~a = ~a~a" (if (or (null? once) (not once)) @@ -895,10 +898,15 @@ Otherwise, return #f." ?unit-count))) ;;; \clef -(define clef-name-alist (map (lambda (name+vals) - (cons (cdr name+vals) - (car name+vals))) - supported-clefs)) +(define clef-name-alist #f) +(define-public (memoize-clef-names clefs) + "Initialize `clef-name-alist', if not already set." + (if (not clef-name-alist) + (set! clef-name-alist + (map (lambda (name+vals) + (cons (cdr name+vals) + (car name+vals))) + clefs)))) (define-extra-display-method ContextSpeccedMusic (expr parser) "If `expr' is a clef change, return \"\\clef ...\" @@ -910,13 +918,15 @@ Otherwise, return #f." value ?clef-glyph symbol 'clefGlyph) (music 'PropertySet - symbol 'middleCPosition) + symbol 'middleCClefPosition) (music 'PropertySet value ?clef-position symbol 'clefPosition) (music 'PropertySet value ?clef-octavation - symbol 'clefOctavation))))) + symbol 'clefOctavation) + (music 'ApplyContext + procedure ly:set-middle-C!))))) (let ((clef-prop+name (assoc (list ?clef-glyph ?clef-position 0) clef-name-alist))) (if clef-prop+name