\version "2.13.4"
\header{ texidoc = "In tablature, notes that are tied to are invisible
- except after a line break or within a second volta;
- here, the fret number is displayed in parentheses."
- }
+ except after a line break or within a second volta;
+ here, the fret number is displayed in parentheses.
-tietest = \relative c {
- \override Voice.StringNumber #'transparent = ##t % remove circled string numbers
- \repeat volta 2 {
- f2 ~ f4 e
- g8 g ~ g g ~ g g~ g g ~
- g1
- c1 ~ \break c2 ~ c
+ As an option, the notes that are tied to may become
+ invisible completely, even after line breaks."
+ }
+
+firstpart = \relative c {
+ f2 ~ f4 e
+ g8 g ~ g g ~ g g~ g g ~
+ g1
+}
+
+secondpart = \relative c' {
+ c1 ~ \break c2 ~ c
+}
+
+thirdpart = \relative c' {
+ \repeat volta 2 {
< c\3 e\2 g\1 >4 < c\3 e\2 g\1 > ~ < c\3 e\2 g\1 >\laissezVibrer r
c4. d8 e2 ~
+ }
+ \alternative { { e2 r } { e2\repeatTie e2^\fermata } }
+ }
+
+\context StaffGroup <<
+ \context Staff {
+ \clef "G_8"
+ \override Voice.StringNumber #'transparent = ##t % remove circled string numbers
+ \firstpart
+ \secondpart
+ \thirdpart
}
- \alternative { { e2 r } { e2\repeatTie e2^\fermata } }
- \bar "|."
-}
+ \context TabStaff {
+ \firstpart
+ \secondpart
+ \thirdpart
+ }
+>>
\context StaffGroup <<
- \context Staff <<
+ \context Staff {
\clef "G_8"
- \tietest
- >>
- \context TabStaff <<
- \tietest
- >>
+ \override Voice.StringNumber #'transparent = ##t % remove circled string numbers
+ \firstpart
+ \secondpart
+ \thirdpart
+ \secondpart
+ \thirdpart
+ }
+ \context TabStaff {
+ \hideSplitTiedTabNotes
+ \firstpart
+ \secondpart
+ \thirdpart
+ \showSplitTiedTabNotes
+ \secondpart
+ \thirdpart
+ }
>>
-
\override Slur #'stencil = ##f
\override PhrasingSlur #'stencil = ##f
%% 'tied to' fret numbers become invisible or parenthesized, respectively)
- \override Tie #'after-line-breaking = #tie::handle-tab-tie
- \override RepeatTie #'after-line-breaking = #repeat-tie::parenthesize-tab-note-head
+ \override Tie #'after-line-breaking = #tie::handle-tab-note-head
+ \override RepeatTie #'after-line-breaking = #repeat-tie::handle-tab-note-head
%% ... and all kinds of markups, spanners etc.
\override TupletBracket #'stencil = ##f
\override TupletNumber #'stencil = ##f
stemNeutral = \revert Stem #'direction
-%% tabFullNotation
+%% tablature
+% switch to full notation
tabFullNotation = {
% time signature
\revert TabStaff.TimeSignature #'stencil
\revert TabStaff.Arpeggio #'stencil
}
+%tie/repeat tie behaviour
+hideSplitTiedTabNotes = {
+ \override TabVoice.TabNoteHead #'(details tied-properties break-visibility) = #all-invisible
+ \override TabVoice.TabNoteHead #'(details tied-properties parenthesize) = ##f
+ \override TabVoice.TabNoteHead #'(details repeat-tied-properties note-head-visible) = ##f
+ \override TabVoice.TabNoteHead #'(details repeat-tied-properties parenthesize) = ##f
+}
+
+showSplitTiedTabNotes = {
+ \override TabVoice.TabNoteHead #'(details tied-properties break-visibility) = #begin-of-line-visible
+ \override TabVoice.TabNoteHead #'(details tied-properties parenthesize) = ##t
+ \override TabVoice.TabNoteHead #'(details repeat-tied-properties note-head-visible) = ##t
+ \override TabVoice.TabNoteHead #'(details repeat-tied-properties parenthesize) = ##t
+}
%% text length
(parentheses-item::calc-parenthesis-stencils grob)))
(parentheses-item::calc-parenthesis-stencils grob))))
-;; the handler for ties in tablature;; split ties yield in a parenthesized
-;; fret number, otherwise the fret number will be invisible.
-(define-public (tie::handle-tab-tie grob)
+;; the handler for ties in tablature; according to TabNoteHead #'details,
+;; the 'tied to' note is handled differently after a line break
+(define-public (tie::handle-tab-note-head grob)
(let* ((original (ly:grob-original grob))
(tied-tab-note-head (ly:spanner-bound grob RIGHT))
(siblings (if (ly:grob? original)
(if (and (>= (length siblings) 2)
(eq? (car (last-pair siblings)) grob))
- ;; tie is split -> parenthesize
- (ly:grob-set-property! tied-tab-note-head 'stencil
- (lambda (grob)
- (parenthesize-tab-note-head grob)))
+ ;; tie is split -> get TabNoteHead #'details
+ (let* ((details (ly:grob-property tied-tab-note-head 'details))
+ (tied-properties (assoc-get 'tied-properties details '()))
+ (tab-note-head-parenthesized (assoc-get 'parenthesize tied-properties #t))
+ ;; we need the begin-of-line entry in the 'break-visibility vector
+ (tab-note-head-visible
+ (vector-ref (assoc-get 'break-visibility
+ tied-properties #(#f #f #t)) 2)))
+
+ (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)))
;; tie is not split -> make fret number invisible
(ly:grob-set-property! tied-tab-note-head 'transparent #t))))
;; repeat ties occur within alternatives in a repeat construct;
-;; 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))))
\ No newline at end of file