lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tablature.ly - please test and comment


From: Marc Hohl
Subject: Re: tablature.ly - please test and comment
Date: Sat, 23 May 2009 09:09:12 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090318)

Neil Puttock schrieb:
2009/5/22 Marc Hohl <address@hidden>:

Please have a look at it and reply any corrections/improvements/changes
/etc.
before I will send patches to Carl.

Well done Marc, this is very promising.

Thank you!
I still have a few reservations concerning some details (mostly
minor), which I'll comment on below.

[...]
I will rework the file and adapt the formatting according to your proposals.
% for ties in tablature, fret numbers that are tied to should be invisible
% or -after a line break - put in parentheses. Since this is not (easily?)
% possible in lilypond, we offer three commands:
%
% \clearTabTieBreaks simply makes all tied numbers invisible,
% \drawTabTieBreaks draws numbers that follow a line break
% \markTabTieBreaks draws a red fret number and gives a
%     warning message on the terminal, so the user can put the
%     parentheses manually and finally changes \mark... with \draw...

#(define (tie::tab-clear-tied-fret-numbers grob)
        (let* ((tied-fret-nr (ly:spanner-bound grob RIGHT)))
              (ly:grob-set-property! tied-fret-nr 'transparent #t)))

#(define (tie::tab-draw-tied-fret-numbers grob)
        (let* ((original (ly:grob-original grob))
               (tied-fret-nr (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 -> make fret number visible
                  (ly:grob-set-property! tied-fret-nr 'transparent #f)
                  ;; tie is not split -> make fret number invisible
                  (ly:grob-set-property! tied-fret-nr 'transparent #t))))

#(define (tie::tab-mark-tied-fret-numbers grob)
        (let* ((original (ly:grob-original grob))
               (tied-fret-nr (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 -> change fret number color to red and
print a message
                  (begin (display "\nSplit tie appears in tablature.")
                         (display "\nAffected fret number is marked red.\n")
                         (ly:grob-set-property! tied-fret-nr 'color red))
                  ;; tie is not split -> make fret number invisible
                  (ly:grob-set-property! tied-fret-nr 'transparent #t))))

clearTabTieBreaks = {
 \override Tie #'after-line-breaking = #tie::tab-clear-tied-fret-numbers
}

drawTabTieBreaks = {
 \override Tie #'after-line-breaking = #tie::tab-draw-tied-fret-numbers
}

markTabTieBreaks = {
 \override Tie #'after-line-breaking = #tie::tab-mark-tied-fret-numbers
}

Since none of this works properly (I suspect it will require more than
Scheme hacking to get everything working), I don't think it's suitable
for inclusion.

Hm, I guess you're right - but as a compromise, how about letting the
\clearTabTieBreaks as a default, because it is working most of the time, and
when someone needs a more sophisticated tab staff, he has to write a separate
score for the tablature?

I would propose to rename it as

#(define (tie::handle-tied-fret-numbers grob)
       (let* ((tied-fret-nr (ly:spanner-bound grob RIGHT)))
             (ly:grob-set-property! tied-fret-nr 'transparent #t)))

make it default by

\override Tie #'after-line-breaking = #tie::handle-tied-fret-numbers

and use this as a kind of starting point for future improvements?


[...]

% the defaults for tablature:
% the clef handler will be included and the tablature
% is displayed \tabNumbersOnly-style:
\layout {
  \context {
     \TabStaff
     % the clef handler
     \override Clef #'stencil = #clef::print-modern-tab-if-set
     % no time signature
     \override TimeSignature #'stencil = ##f
     % behaviour of split ties
     \override Tie #'after-line-breaking = #tie::tab-clear-tied-fret-numbers
  }
  \context {
     \TabVoice
     \override Stem #'stencil = ##f
     \override Beam #'stencil = ##f
     \override Dots #'stencil = ##f
     \override Tie  #'stencil = ##f
     \override Slur #'stencil = ##f
     % the direction for glissando lines will be automatically corrected
     \override Glissando #'extra-dy = #glissando::calc-tab-extra-dy
     \override TupletBracket #'stencil = ##f
     \override TupletNumber #'stencil = ##f
     \override DynamicText #'transparent = ##t
     \override DynamicTextSpanner #'stencil = ##f
     \override TextSpanner #'stencil = ##f
     \override Hairpin #'transparent = ##t
     \override Rest #'stencil = ##f
     \override MultiMeasureRest #'stencil = ##f
     \override Script #'stencil = ##f
     \override TextScript #'stencil = ##f
  }
}

I'm concerned about the amount of duplication here; this basically
repeats all the code in \tabNumbersOnly, which is really something we
should try to avoid in included files.
But how to avoid this? One possibility would be to just get rid of the
\tabNumbersOnly, because I don't think that tablatures with and
without stems will ever be mixed together in a file, and when someone wants
to do so, he can \override everything manually.

What do you think?

Marc
Regards,
Neil






reply via email to

[Prev in Thread] Current Thread [Next in Thread]