X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fharp-pedals.scm;h=f4767834d100c61cfa3439b8e69822a84cb8ba68;hb=5507e6b9805037fb91f1a137dcd7f99f969bc8a2;hp=8f7756acbafb3e7b34e6e6038a951c66c9ed379d;hpb=338ddfdb1451f099f60b8da97a957c99696eb71c;p=lilypond.git diff --git a/scm/harp-pedals.scm b/scm/harp-pedals.scm index 8f7756acba..f4767834d1 100644 --- a/scm/harp-pedals.scm +++ b/scm/harp-pedals.scm @@ -2,13 +2,13 @@ ;;;; ;;;; source file of the GNU LilyPond music typesetter ;;;; -;;;; (c) 2008 Reinhold Kainhofer +;;;; (c) 2008--2009 Reinhold Kainhofer (define-builtin-markup-command (harp-pedal layout props definition-string) (string?) instrument-specific-markup ; markup type for the documentation! - ((size 1.0) + ((size 1.2) (harp-pedal-details) (thickness 0.5)) "Make a harp pedal diagram. @@ -66,7 +66,7 @@ divider) and @code{space-after-divider} (box spacing after the divider). ;; ;; (define-builtin-markup-command (harp-pedal-verbose layout props pedal-list) (list?) ;; instrument-specific-markup ; markup type -;; ((size 1.0) +;; ((size 1.2) ;; (harp-pedal-details) ;; (thickness 0.5)) ;; "Make a harp pedal diagram containing the directions indicated in @var{pedal-list}." @@ -129,12 +129,17 @@ divider) and @code{space-after-divider} (box spacing after the divider). (box-hheight (* size (/ (assoc-get 'box-height details 1.0) 2))) ; half the box-height, saves some divisions by 2 (spacebeforedivider (* size (assoc-get 'space-before-divider details 0.8))) ; full space between boxes before the first divider (spaceafterdivider (* size (assoc-get 'space-after-divider details 0.8))) ; full space between boxes - ;(spacebeforedivider (/ (+ box-width (* 8 spaceafterdivider)) 8)) + (circle-thickness (* (ly:output-def-lookup layout 'line-thickness) + (assoc-get 'circle-thickness details 0.5))) + (circle-x-padding (* size (assoc-get 'circle-x-padding details 0.15))) + (circle-y-padding (* size (assoc-get 'circle-y-padding details 0.2))) (box-x-dimensions (lambda (prev-x p space) (cons (+ prev-x space) (+ prev-x space box-width)))) (box-y-dimensions (lambda (prev-x p space) (cons (- (* p dy) box-hheight) (+ (* p dy) box-hheight)))) - (divider-stencil (lambda (xpos) (make-line-stencil line-width xpos (- 0 dy box-hheight) xpos (+ dy box-hheight)))) + (divider-stencil (lambda (xpos) (make-line-stencil line-width + xpos (- 0 dy box-hheight) + xpos (+ dy box-hheight)))) (result (let process-pedal ((remaining pedal-list) (prev-x 0) (stencils '()) @@ -150,20 +155,28 @@ divider) and @code{space-after-divider} (box spacing after the divider). (stencil (make-filled-box-stencil (box-x-dimensions prev-x p space) (box-y-dimensions prev-x p space))) - ;(circle-stencil (if circled (rounded-box-stencil stencil 0.05 0.3 0.1 ) stencil)) - (circle-stencil (if circled (circle-stencil stencil 0.05 0.2 ) stencil)) + (pedal-stencil + (if circled + (oval-stencil stencil circle-thickness + circle-x-padding circle-y-padding) + stencil)) (new-prev-x (+ prev-x space box-width))) - (process-pedal (cdr remaining) new-prev-x (cons circle-stencil stencils) #f space))) + (process-pedal (cdr remaining) new-prev-x + (cons pedal-stencil stencils) #f space))) ((#\|) ; Divider line (let* ((xpos (+ prev-x space)) (stencil (divider-stencil xpos)) (new-prev-x (+ prev-x space))) - (process-pedal (cdr remaining) new-prev-x (cons stencil stencils) circled spaceafterdivider))) + (process-pedal (cdr remaining) new-prev-x + (cons stencil stencils) + circled spaceafterdivider))) ((#\o) ; Next pedal should be circled (process-pedal (cdr remaining) prev-x stencils #t space)) (else - (ly:warning "Unhandled entry in harp-pedal: ~a" (car remaining)) - (process-pedal (cdr remaining) prev-x stencils circled space)))))) + (ly:warning "Unhandled entry in harp-pedal: ~a" + (car remaining)) + (process-pedal (cdr remaining) + prev-x stencils circled space)))))) (final-x (car result)) (stencils (cdr result))) ; Add the horizontal line and combine all stencils: