lilypond-user
[Top][All Lists]
Advanced

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

Re: How to change TabNoteHead


From: Rachael Thomas Carlson
Subject: Re: How to change TabNoteHead
Date: Sat, 06 Jul 2013 13:18:55 -0500
User-agent: KMail/4.10.5 (Linux/3.9.9-1-ARCH; KDE/4.10.5; x86_64; ; )

On Saturday, July 06, 2013 07:51:52 PM Thomas Morley wrote:
> 2013/7/6 Rachael Thomas Carlson 
<address@hidden>:
> > Hello:
> > 
> > I am attempting to change the TabNoteHead through what the
> > documentation calls 'Modifying stencils' (chp. 5.5.3).  I can't seem 
to
> > get the stencil override to work.  I have been able to change the
> > TabNoteHead through the use of postscript like in one of the 
snippets
> > (http://lsr.dsi.unimi.it/LSR/Item?id=516) but I would rather use the
> > musicglyphs in the Feta font than have to manually create each 
object.
> > 
> > With that being said, I would love to be able to change the
> > TabNoteHead by any means.  \deadNotes looks great but I need 
more
> > options.
> > 
> > I have attached a png of what I am attempting.
> > 
> > Here is the code that does not work for me:
> > 
> > \version "2.16.2"
> > 
> > tick = {
> > 
> >         \once \override TabNoteHead #'stencil = #ly:text-
interface::print
> >         \once \override TabNoteHead #'text = \markup { \musicglyph
> > 
> > #"noteheads.s0la" }
> > }
> > 
> > \new TabStaff {
> > 
> >         c8 \tick c8 c8 c8 }
> > 
> > Thank you kindly,
> > Rachael
> 
> Hi Rachael,
> 
> the TabNoteHead already supports the text-interface.
> \override TabNoteHead #'stencil = #ly:text-interface::print is 
needless
> than.
> 
> \override TabNoteHead #'text = \markup {...}
> doesn't work, because a new text needs to be inserted very early in
> the compiling-process, afaik.
> 
> You could use:
> 
> \version "2.16.2"
> 
> tick = {
>         \once \override TabNoteHead #'before-line-breaking =
>         #(lambda (grob)
>           (ly:grob-set-property!
>             grob
>             'text
>             #{ \markup { \musicglyph #"noteheads.s0la" } #} ))
> }
> 
> \new TabStaff {
>         c8 \tick c8 c8 c8 }
> 
> Though, I'd prefer one of the following codings
> (I recommend the second if you want to do more frequently)
> 
> \version "2.16.2"
> 
> %%%
> % First possibility.
> %%%
> 
> tick¹ = {
>         \once \override TabNoteHead #'stencil =
>         #(lambda (grob)
>           (grob-interpret-markup grob
>           #{
>                 \markup { \musicglyph #"noteheads.s0la" }
>           #}))
> }
> 
> %%%
> % Second possibility.
> %%%
> 
> #(define (new-stil markup)
> ;; Creates a stencil
>   (lambda (grob)
>     (grob-interpret-markup grob markup)))
> 
> newTabNoteHead =
> #(define-music-function (parser location mrkp)(markup?)
> ;; Uses @code{new-stil} in a music-function.
> ;; Ofcourse it's possible to use:
> ;; @samp{\\once \\override TabNoteHead #'stencil =
> ;;         #(new-stil #{ \\markup { \musicglyph #"noteheads.s0la" } 
#})}
> ;; directly.
> #{
>   \once \override TabNoteHead #'stencil = #(new-stil mrkp)
> #})
> 
> % creating a variable as sort of schortcut.
> tick² = \newTabNoteHead \markup { \musicglyph #"noteheads.s0la" }
> 
> \new TabStaff {
>       \tabFullNotation
>         c8 \tick¹ c8 c8 \tick² c8 }
> 
> HTH,
>   Harm

Harm:

Wow!

You are amazing!  Thank you so much.  The second possibility is going 
to work very well.  Also, thank you for the comments as well.  I really like 
LIlypond but as I am the only person in my area, that I know of, that 
uses Lilypond I am only able to learn from the manual, docs, 
references, self-instruction, and fine people like yourself. 

Thank you!

Rachael



reply via email to

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