-;; the correspondig fret numbers are shown in parentheses:
-(define-public (repeat-tie::parenthesize-tab-note-head grob)
- (let ((tied-tab-note-head (ly:grob-object grob 'note-head)))
-
- (ly:grob-set-property! tied-tab-note-head 'stencil
- (lambda (grob) (parenthesize-tab-note-head grob)))))
+;; TabNoteHead #'details handles the appearance in this case
+(define-public (repeat-tie::handle-tab-note-head grob)
+ (let* ((tied-tab-note-head (ly:grob-object grob 'note-head))
+ (details (ly:grob-property tied-tab-note-head 'details))
+ (repeat-tied-properties (assoc-get 'repeat-tied-properties details '()))
+ (tab-note-head-visible (assoc-get 'note-head-visible repeat-tied-properties #t))
+ (tab-note-head-parenthesized (assoc-get 'parenthesize repeat-tied-properties #t)))
+
+ (if tab-note-head-visible
+ ;; tab note head is visible
+ (if tab-note-head-parenthesized
+ (ly:grob-set-property! tied-tab-note-head 'stencil
+ (lambda (grob)
+ (parenthesize-tab-note-head grob))))
+ ;; tab note head is invisible
+ (ly:grob-set-property! tied-tab-note-head 'transparent #t))))
+
+;; the slurs should not be too far apart from the corresponding fret number, so
+;; we move the slur towards the TabNoteHeads:
+(define-public (slur::draw-tab-slur grob)
+ ;; TODO: use a less "brute-force" method to decrease
+ ;; the distance between the slur ends and the fret numbers
+ (let* ((staff-space (ly:staff-symbol-staff-space grob))
+ (control-points (ly:grob-property grob 'control-points))
+ (new-control-points (map
+ (lambda (p)
+ (cons (car p)
+ (- (cdr p)
+ (* staff-space
+ (ly:grob-property grob 'direction)
+ 0.35))))
+ control-points)))
+
+ (ly:grob-set-property! grob 'control-points new-control-points)
+ (ly:slur::print grob)))