;;;; This file is part of LilyPond, the GNU music typesetter.
;;;;
-;;;; Copyright (C) 2010 Mike Solomon <mikesol@stanfordalumni.org>
+;;;; Copyright (C) 2010--2011 Mike Solomon <mikesol@stanfordalumni.org>
;;;;
;;;; LilyPond is free software: you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
((make-named-spreadsheet '(clarinet bass-clarinet low-bass-clarinet))
`((bottom-group-key-names
. (()
- ((f
+ ((ees
. ((offset . (0.0 . ,(* 0 (+ 0.75 CL-RH-HAIR))))
- (stencil . ,bass-clarinet-rh-f-key-stencil)
- (text? . ("F" . #f))
+ (stencil . ,bass-clarinet-rh-ees-key-stencil)
+ (text? . ("E" . 0))
(complexity . trill))))
- ((f
+ ((ees
. ((offset . (0.0 . ,(* 0 (+ 0.75 CL-RH-HAIR))))
- (stencil . ,low-bass-clarinet-rh-f-key-stencil)
- (text? . ("F" . #f))
+ (stencil . ,low-bass-clarinet-rh-ees-key-stencil)
+ (text? . ("E" . 0))
(complexity . trill)))
(d
. ((offset . (,(+ 1.5 CL-RH-HAIR) . ,(* -1 (+ 0.75 CL-RH-HAIR))))
,(make-right-hand-key-addresses '(one two three four))
(-0.5 . -0.7)))))
(bottom-right-group-key-addresses
- . (,(make-right-hand-key-addresses '(fis e ees gis))
+ . (,(make-right-hand-key-addresses '(fis e f gis))
,(make-right-hand-key-addresses '(fis e ees gis f))
,(make-right-hand-key-addresses '(fis e ees gis f d))))
(right-hand-key-addresses
- . (,(make-right-hand-key-addresses '(fis e ees gis))
+ . (,(make-right-hand-key-addresses '(fis e f gis))
,(make-right-hand-key-addresses '(fis e ees gis f))
,(make-right-hand-key-addresses
'(low-d low-cis low-c fis e ees gis f d)))))))
(stencil . ,clarinet-rh-fis-key-stencil)
(text? . ("F" . 1))
(complexity . trill)))
- (e
+ (gis
. ((offset . (,(+ 1.5 CL-RH-HAIR)
. ,(* 3 (+ 0.75 CL-RH-HAIR))))
- (stencil . ,clarinet-rh-e-key-stencil)
- (text? . ("E" . #f))
+ (stencil . ,clarinet-rh-gis-key-stencil)
+ (text? . ("G" . 1))
(complexity . trill)))
- (ees
+ (e
. ((offset . (0.0 . ,(* 2 (+ 0.75 CL-RH-HAIR))))
- (stencil . ,clarinet-rh-ees-key-stencil)
- (text? . ("E" . 0))
+ (stencil . ,clarinet-rh-e-key-stencil)
+ (text? . ("E" . #f))
(complexity . trill)))
- (gis
+ (f
. ((offset . (,(+ 1.5 CL-RH-HAIR)
. ,(* 1 (+ 0.75 CL-RH-HAIR))))
- (stencil . ,clarinet-rh-gis-key-stencil)
- (text? . ("G" . 1))
+ (stencil . ,clarinet-rh-f-key-stencil)
+ (text? . ("F" . #f))
(complexity . trill))))
(assoc-get 'bottom-group-key-names change-points)))))
(graphical-commands
(key-list-loop key-list)))
(define-markup-command
- (woodwind-diagram layout props instrument input-list)
+ (woodwind-diagram layout props instrument user-draw-commands)
(symbol? list?)
#:category instrument-specific-markup ; markup category
+ #:properties ((size 1)
+ (thickness 0.1)
+ (graphical #t))
"Make a woodwind-instrument diagram. For example, say
@example
-\\markup \\woodwind-diagram #'oboe #'(1.4 0.1 #t ((lh . (d ees)) (cc . (five3qT1q)) (rh . (gis))))
+\\markup \\woodwind-diagram
+ #'oboe #'((lh . (d ees)) (cc . (five3qT1q)) (rh . (gis)))
@end example
@noindent
instrument, invoke @code{(print-keys-verbose 'instrument)}.
Lastly, substituting an empty list for the pressed-key alist will result in
-a diagram with all of the keys drawn but none filled. ie...
+a diagram with all of the keys drawn but none filled, for example:
@example
-\\markup \\woodwind-diagram #'oboe #'(1.4 0.1 #t ())
+\\markup \\woodwind-diagram #'oboe #'()
@end example"
- (let* ((radius (car input-list))
- (thick (cadr input-list))
- (display-graphic (caddr input-list))
- (xy-stretch `(1.0 . 2.5))
- (chosen-instrument (assoc-get instrument woodwind-data-alist))
- (chosen-instrument
- (if (not chosen-instrument)
- (ly:error "~a is not a valid woodwind instrument."
- instrument)
- chosen-instrument))
- (stencil-info
- (assoc-get
- (if display-graphic 'graphical-commands 'text-commands)
- chosen-instrument))
- (user-draw-commands (cadddr input-list))
- (pressed-info
- (if (null? user-draw-commands)
- (uniform-draw-instructions (assoc-get 'keys chosen-instrument))
- (translate-draw-instructions
- (append '((hd . ())) user-draw-commands)
- (assoc-get 'keys chosen-instrument))))
- (draw-info
- (function-chain
- pressed-info
- (assoc-get 'draw-instructions stencil-info)))
- (extra-offset-info
- (function-chain
- pressed-info
- (assoc-get 'extra-offset-instructions stencil-info))))
- (assemble-stencils
- (assoc-get 'stencil-alist stencil-info)
- (assoc-get 'keys chosen-instrument)
- draw-info
- extra-offset-info
- radius
- thick
- xy-stretch
- layout
- props)))
\ No newline at end of file
+ (let* ((radius size)
+ (thick (* size thickness))
+ (display-graphic graphical)
+ (xy-stretch `(1.0 . 2.5))
+ (chosen-instrument (assoc-get instrument woodwind-data-alist))
+ (chosen-instrument
+ (if (not chosen-instrument)
+ (ly:error "~a is not a valid woodwind instrument."
+ instrument)
+ chosen-instrument))
+ (stencil-info
+ (assoc-get
+ (if display-graphic 'graphical-commands 'text-commands)
+ chosen-instrument))
+ (pressed-info
+ (if (null? user-draw-commands)
+ (uniform-draw-instructions (assoc-get 'keys chosen-instrument))
+ (translate-draw-instructions
+ (append '((hd . ())) user-draw-commands)
+ (assoc-get 'keys chosen-instrument))))
+ (draw-info
+ (function-chain
+ pressed-info
+ (assoc-get 'draw-instructions stencil-info)))
+ (extra-offset-info
+ (function-chain
+ pressed-info
+ (assoc-get 'extra-offset-instructions stencil-info))))
+ (assemble-stencils
+ (assoc-get 'stencil-alist stencil-info)
+ (assoc-get 'keys chosen-instrument)
+ draw-info
+ extra-offset-info
+ radius
+ thick
+ xy-stretch
+ layout
+ props)))