Marc Hohl schrieb:
Neil Puttock schrieb:
2009/5/16 Marc Hohl <m...@hohlart.de>:
[...]
It seems to me that (at least at the moment) there is no simple way
to draw parentheses automatically around fret numbers, so I propose
a different attempt:
a command \showTabTieBreaks is provided, which shows the user where the
broken tab ties are by indicating it (for example in red), and the
user can put the
parentheses manually, or simply clear these numbers by invoking
\clearTabTieBreaks.
I tried implementing this, but I failed by defining a general routine
which is called inside the callback.
First I define my commands for marking, drawing or simply clearing a
fret number
\version "2.13.0"
markTabTieBreaks = #(define (process-tied-fretnumber grob)
(begin (display "mark called\n")
(ly:grob-set-property! grob 'color
(rgb-color 1 0 0))))
drawTabTieBreaks = #(define (process-tied-fretnumber grob)
(begin (display "draw called\n")
(ly:grob-set-property! grob
'transparent #f)))
clearTabTieBreaks = #(define (process-tied-fretnumber grob)
(begin (display "clear called\n")
(ly:grob-set-property! grob
'transparent #t)))
% I want \markTabTieBreaks as default, so I call
\markTabTieBreaks
#(define (tie::handle-tab-tie grob)
(let* ((original (ly:grob-original grob))
(tied-tabnotehead (ly:spanner-bound grob RIGHT))
(siblings (if (ly:grob? original)
(ly:spanner-broken-into original) '() )))
(if (and (>= (length siblings) 2)
(eq? (car (last-pair siblings)) grob))
;; tie is split
(process-tied-fretnumber tied-tabnotehead)
;; tie is not split -> make fret number invisible
(ly:grob-set-property! tied-tabnotehead 'transparent #t))))
% Here I call process-tied-fretnumber, which should draw a red number,
but it doesn't. It seems that
% the last definition (in this case \clearTabTieBreaks) is valid and
futher calls of one of the
% \...TabTieBreak-commands doesn't change anything.
test = \relative c {
\markTabTieBreaks
f2 ~ f4 \parenthesize e
g8 g ~ g g ~ g g~ g g ~
g1
c1 ~ \break c2 ~ c
< c\3 e\2 g\1 >4 < c\3 e\2 g\1 > ~ < c\3 e\2 g\1 > < c\3 e\2 g\1 >
\bar "|."
}
\score {
<< \new Staff { \clef "G_8" \test }
\new TabStaff { \clef "tab"
\override Tie #'stencil = ##f
\override Stem #'stencil = ##f
\override Beam #'stencil = ##f
\override Dots #'stencil = ##f
\override Tie #'after-line-breaking =
#tie::handle-tab-tie
\test }
>>
}
Surely I am missing something, but where is my mistake?
Marc
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user