lilypond-user
[Top][All Lists]
Advanced

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

Re: tablature.ly


From: Neil Puttock
Subject: Re: tablature.ly
Date: Sun, 26 Apr 2009 20:49:03 +0100

2009/4/25 Marc Hohl <address@hidden>:
> Hello tablature users*,

Like Carl, I'm not a tablature user, so I can only comment on matters of coding.

Some suggestions and thoughts follow below:

> % some publications use the triangled note head
> % for palm mute, so here we go:
> palmMuteOn = { \set shapeNoteStyles = #'#(do do do do do do do ) }

You can use make-vector here, since every entry is the same symbol:

palmMuteOn = { \set shapeNoteStyles = #(make-vector 7 'do)

> palmMuteOff = { \unset shapeNoteStyles }
> % for single notes (or groups of notes within { ...} :
> palmMute =  #(define-music-function (parser location note) (ly:music?)
>      #{
>         \set shapeNoteStyles = #'#(do do do do do do do )
>         $note
>         \unset shapeNoteStyles
>      #})

You've just defined palmMuteOn/Off.  Why not use them here?

palmMute =  #(define-music-function (parser location note) (ly:music?)
      #{
         \palmMuteOn
         $note
         \palmMuteOff
      #})

> % for single notes or groups of notes within {...}:
> deadNotes = #(define-music-function (parser location notes) (ly:music?)
>   #{
>      \override NoteHead #'style = #'cross
>      \set tablatureFormat = #x-tab-format
>      $notes
>      \unset tablatureFormat
>      \revert NoteHead #'style
>   #})

As above, using deadNotesOn/Off.

> #(define-markup-command (customTabClef layout props tuning) (pair?)
>    (let* ((num-strings (length tuning))
>           ;; the number of strings has to be in 4...7
>           (num-strings (cond ((< num-strings 4) 4)
>                              ((> num-strings 7) 7)
>                              (else num-strings)))

This looks a bit strange, since you've just defined num-strings.  You
can use min and max to keep it within range:

(let* ((num-strings (min (max (length tuning) 4) 7))

>           (raise-value (- (* num-strings 0.4) 0.9))

You can junk this, since #:vcenter in the markup below will do it automatically.

>           (font-size (- (* num-strings 1.5) 7))
>           (base-skip (cond ((= 4 num-strings) 1.55)
>                            ((= 5 num-strings) 1.84)
>                            ((= 6 num-strings)  2.00)
>                            ((= 7 num-strings) 2.08)))

Can you rework these so they're not hard-coded?

Imagine a user doesn't like the default staff-space setting for
TabStaff (1.5).  If they change it, none of these empirical values
will work properly.

>           (new-props (cons (list
>                              '(font-family . sans)
>                              (cons 'baseline-skip base-skip))
>                             props)))
>       (interpret-markup layout new-props
>         (markup #:raise raise-value #:bold #:fontsize font-size
>                #:column ("T" "A" "B")))))

Do you want the TAB column left-aligned rather than centred (like the
LSR snippet)?

> % Wrappers for the different clefs
> % the argument is the string-tuning, which is automatically set.
> sansSerifTabClef = #(define-music-function (parser location tuning) (pair?)
>   #{
>      \override TabStaff.Clef #'stencil = #ly:text-interface::print

Use grob-interpret-markup instead of ly:text-interface::print:

\override TabStaff.Clef #'stencil = $(lambda (grob)
(grob-interpret-markup grob (make-customTabClef-markup tuning)))

The docs are slightly lagging behind here, but
ly:text-interface::print should only be used with objects which
support text-interface.

>      \override TabStaff.Clef #'text = \markup \customTabClef $tuning

Can be removed if using grob-interpret-markup.

> calligraphicTabClef = #(define-music-function (parser location tuning)
> (pair?)
>   #{
>      \revert TabStaff.Clef #'stencil
>      \set TabStaff.stringTunings = $tuning
>   #})

On a general note, I'd prefer to keep the string tunings separate from
setting the clef.  To set the traditional tab clef, we have the
command \clef tab, so it would be nice to be able to set the modern
style using e.g. \clef moderntab without having to use a new function.

Regards,
Neil




reply via email to

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