%% No accidental in tablature !
\remove "Accidental_engraver"
- %% remove stems, beams, dots and rests ...
- \override Stem #'stencil = ##f
+ %% make the Stems as short as possible to minimize their influence
+ %% on the slur::calc-control-points routine
+ \override Stem #'length = #0
+ \override Stem #'no-stem-extend = ##t
+ \override Stem #'flag-style = #'no-flag
+ \override Stem #'details = #'((lengths 0 0 0 0 0 0)
+ (beamed-lengths 0 0 0)
+ (beamed-minimum-free-lengths 0 0 0)
+ (beamed-extreme-minimum-free-lengths 0 0)
+ (stem-shorten 0 0))
+ %% after all, the stubs of thestems may still be visible, so ...
+ \override Stem #'transparent = ##t
+ %% automatic beams should be suppressed for similar reasons ...
+ autoBeaming = ##f
+ %% ... and we ignore collision warnings that may occur due to
+ %% stem overlapping ...
+ \override NoteColumn #'ignore-collision = ##t
+ %% remove beams, dots and rests ...
\override Beam #'stencil = ##f
\override Dots #'stencil = ##f
\override Rest #'stencil = ##f
\override Tie #'stencil = ##f
\override RepeatTie #'stencil = ##f
\override LaissezVibrerTie #'stencil = ##f
- \override Slur #'stencil = ##f
+ \override Slur #'stencil = #slur::draw-tab-slur
\override PhrasingSlur #'stencil = ##f
%% 'tied to' fret numbers become invisible or parenthesized, respectively)
\override Tie #'after-line-breaking = #tie::handle-tab-note-head
% time signature
\revert TabStaff.TimeSignature #'stencil
% stems (the half note gets a double stem)
+ \revert Stem #'length
+ \revert Stem #'no-stem-extend
+ \revert Stem #'flag-style
+ \revert Stem #'details
+ \revert Stem #'transparent
\override TabVoice.Stem #'stencil = #tabvoice::draw-double-stem-for-half-notes
+ autoBeaming = ##t
+ \revert NoteColumn #'ignore-collision
% beams, dots
\revert TabVoice.Beam #'stencil
\revert TabVoice.Dots #'stencil
(lambda (grob)
(parenthesize-tab-note-head grob))))
;; tab note head is invisible
- (ly:grob-set-property! tied-tab-note-head 'transparent #t))))
\ No newline at end of file
+ (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-symbol (ly:grob-object grob 'staff-symbol))
+ (staff-space (ly:grob-property staff-symbol 'staff-space))
+ (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)))
\ No newline at end of file