(dot-placement-list ,list? "List consisting of
@code{(@var{description} @var{string-number} @var{fret-number}
@var{finger-number})} entries used to define fret diagrams.")
+ (double-stem-separation ,number? "The distance between the two
+stems of a half note in tablature when using @code{\\tabFullNotation},
+not counting the width of the stems themselves, expressed as a multiple
+of the default height of a staff-space in the traditional five-line
+staff.")
(duration-log ,integer? "The 2-log of the note head duration,
i.e., @code{0} = whole note, @code{1} = half note, etc.")
;; and the extreme minima as abolute minimum length.
(direction . ,ly:stem::calc-direction)
+ (double-stem-separation . 0.5)
(duration-log . ,stem::calc-duration-log)
(length . ,(ly:make-unpure-pure-container ly:stem::calc-length ly:stem::pure-calc-length))
(neutral-direction . ,DOWN)
;; (dotted) half notes to distinguish them from quarter notes:
(define-public (tabvoice::make-double-stem-width-for-half-notes grob)
(let ((X-extent (ly:stem::width grob)))
-
- ;; is the note a (dotted) half note?
- (if (= 1 (ly:grob-property grob 'duration-log))
- ;; yes -> return double stem width
- (cons (car X-extent) (+ 0.5 (* 2 (cdr X-extent))))
- ;; no -> return simple stem width
- X-extent)))
+ ;; does the stem exist and is it on a (dotted) half note?
+ (if (and (not (equal? X-extent empty-interval))
+ (= 1 (ly:grob-property grob 'duration-log)))
+
+ ;; yes -> return double stem X-extent
+ (let* ((single-stem-width (- (cdr X-extent) (car X-extent)))
+ (separation (ly:grob-property grob 'double-stem-separation 0.5))
+ (total-width (+ single-stem-width separation))
+ (half-width (/ total-width 2)))
+ (cons (- half-width) half-width))
+ ;; no -> return simple stem X-extent
+ X-extent)))
(define-public (tabvoice::draw-double-stem-for-half-notes grob)
- (let ((stem (ly:stem::print grob)))
-
- ;; is the note a (dotted) half note?
- (if (= 1 (ly:grob-property grob 'duration-log))
- ;; yes -> draw double stem
- (ly:stencil-combine-at-edge stem X RIGHT stem 0.5)
- ;; no -> draw simple stem
- stem)))
+ (let ((stem-stencil (ly:stem::print grob)))
+ ;; does the stem exist and is it on a (dotted) half note?
+ (if (and (ly:stencil? stem-stencil)
+ (= 1 (ly:grob-property grob 'duration-log)))
+
+ ;; yes -> draw double stem
+ (let* ((separation (ly:grob-property grob 'double-stem-separation 0.5))
+ (half-separation (/ separation 2)))
+ (ly:stencil-add
+ (ly:stencil-translate-axis stem-stencil (- half-separation) X)
+ (ly:stencil-translate-axis stem-stencil half-separation X)))
+ ;; no -> draw simple stem (or none at all)
+ stem-stencil)))
;; as default, the glissando line between fret numbers goes
;; upwards, here we have a function to correct this behavior: