--- /dev/null
+\version "2.15.24"
+
+\header {
+ texidoc = "Tremoli applied to double stems in a @code{TabVoice}
+should be centered on the double stem.
+"
+}
+\new TabVoice \relative c' {
+ \tabFullNotation
+ a2:32
+}
\ No newline at end of file
\revert TabVoice.Stem #'transparent
\revert TabVoice.Flag #'transparent
\override TabVoice.Stem #'stencil = #tabvoice::draw-double-stem-for-half-notes
+ \override TabVoice.Stem #'X-extent = #tabvoice::make-double-stem-width-for-half-notes
\set autoBeaming = ##t
\revert NoteColumn #'ignore-collision
% beams, dots
(stencil . ,ly:stem-tremolo::print)
(style . ,ly:stem-tremolo::calc-style)
(X-extent . ,ly:stem-tremolo::width)
+ (X-offset . ,(ly:make-simple-closure
+ `(,+
+ ,(ly:make-simple-closure
+ (list ly:self-alignment-interface::centered-on-x-parent))
+ ,(ly:make-simple-closure
+ (list ly:self-alignment-interface::x-aligned-on-self)))))
(Y-offset . ,ly:stem-tremolo::calc-y-offset)
(meta . ((class . Item)
- (interfaces . (stem-tremolo-interface))))))
+ (interfaces . (self-alignment-interface
+ stem-tremolo-interface))))))
(StringNumber
. (
;; if stems are drawn, it is nice to have a double stem for
;; (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)))
+
(define-public (tabvoice::draw-double-stem-for-half-notes grob)
(let ((stem (ly:stem::print grob)))