(space-before-divider . 0.1)
(space-after-divider . 1.2))) {
\harp-pedal #"o^ovo-|vovo-o^"}
+ \revert Voice.TextScript #'harp-pedal-details #'box-width
+ \override Voice.TextScript #'harp-pedal-details #'circle-thickness = #3
+ \override Voice.TextScript #'harp-pedal-details #'circle-x-padding = #0.6
+ \override Voice.TextScript #'harp-pedal-details #'circle-y-padding = #-0.3
+ c1^\markup \harp-pedal #"o^ovo-|vovo-o^"
}
include the following:
@itemize @bullet
@item
-@code{box-offset} -- Vertical shift of the center of flat / sharp pedal
+@code{box-offset} -- Vertical shift of the center of flat / sharp pedal
boxes above / below the horizontal line. Default value 0.8.
@item
@code{box-width} -- Width of each pedal box. Default value 0.4.
@item
@code{box-height} -- Height of each pedal box. Default value 1.0.
@item
-@code{space-before-divider} -- Space between boxes before the first divider
+@code{space-before-divider} -- Space between boxes before the first divider
(so that the diagram can be made symmetric). Default value 0.8.
@item
-@code{space-after-divider} -- Space between boxes after the first divider.
+@code{space-after-divider} -- Space between boxes after the first divider.
Default value 0.8.
+@item
+@code{circle-thickness} -- Thickness (in unit of the line-thickness) of the
+ellipse around circled pedals. Default value 0.5.
+@item
+@code{circle-x-padding} -- Padding in X direction of the ellipse around
+circled pedals. Default value 0.15.
+@item
+@code{circle-y-padding} -- Padding in Y direction of the ellipse around
+circled pedals. Default value 0.2.
@end itemize")
(head-direction ,ly:dir? "Are the note heads left or right in a
(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 '())
(box-y-dimensions prev-x p space)))
(pedal-stencil
(if circled
- (ellipse-stencil stencil 0.05 0.1 )
+ (ellipse-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
(interval-center x-ext)
(interval-center y-ext))))))
-(define-public (ellipse-stencil stencil thickness padding)
- "Add an ellipse around STENCIL, producing a new stencil."
+(define-public (ellipse-stencil stencil thickness x-padding y-padding)
+ "Add an ellipse around STENCIL, padded by the padding pair,
+ producing a new stencil."
(let* ((x-ext (ly:stencil-extent stencil X))
(y-ext (ly:stencil-extent stencil Y))
- (x-length (+ (interval-length x-ext) padding thickness))
- (y-length (+ (interval-length y-ext) padding thickness))
+ (x-length (+ (interval-length x-ext) x-padding thickness))
+ (y-length (+ (interval-length y-ext) y-padding thickness))
;(aspect-ratio (/ x-length y-length))
(x-radius (* 0.707 x-length) )
(y-radius (* 0.707 y-length) )