Re: [tablatures] cross-style note heads in tablature

[ Thread Index | Date Index | More lilynet.net/tablatures Archives ]


-------- Original-Nachricht --------
> Datum: Thu, 10 Sep 2009 09:43:08 +0200
> Von: Marc Hohl <marc@xxxxxxxxxx>
> An: tablatures@xxxxxxxxxxx
> Betreff: Re: [tablatures] cross-style note heads in tablature

> Patrick Schmidt schrieb:
> > [...]
> > I didn't manage to engrave cross-style note heads inside or outside
> chords in tablature staves with this code. Here's my example:
> >
> >   
> [...]
> 
> sorry, I had tuned my 2.13.3 so it worked for me, but of course not 
> anywhere else.
> 
> Please add some callbacks like this:
> 
> \version "2.13.3"
> 
> #(define-public (tab-note-head::calc-glyph-name grob)
>   (let ((style (ly:grob-property grob 'style)))
>    (case style
>       ((cross) "2cross"))))
> 
> #(define (tab-note-head::whiteout-if-style-set grob)
>   (let ((style (ly:grob-property grob 'style)))
>        (if (and (symbol? style)
>                 (eq? style 'cross))
>            (stencil-whiteout (ly:note-head::print grob))
>            (ly:text-interface::print grob))))
> \layout {
>   \context {
>     \TabVoice
>     \override TabNoteHead #'glyph-name = #tab-note-head::calc-glyph-name
>     \override TabNoteHead #'stencil =
> #tab-note-head::whiteout-if-style-set
>   }
> }
> 
> x =
> #(define-music-function (parser location note) (ly:music?)
>  (if (eq? (ly:music-property note 'name) 'NoteEvent)
>      ;; yes -> add a tweak
>      (begin (set! (ly:music-property note 'tweaks)
>                    (acons 'style 'cross (ly:music-property note 'tweaks)))
>       note)
>       #{
>         \override TabNoteHead #'style = #'cross
>         \override NoteHead #'style = #'cross
>         $note
>         \revert TabNoteHead #'style
>         \revert NoteHead #'style
>       #}))
> 
> xhead = \relative c {
>   \x< c  e  g>4
>   <c e \x g>
>  
> }
> 
> \score {
>   <<
>    \new Staff = "guitar traditional" <<
>         \clef "treble_8"
>         \context Voice = "xhead"  \xhead
>      >>
>    \new TabStaff = "guitar tab" <<
>         \context TabVoice = "xhead"  \xhead
>      >>
>   >>
> }
> 
> I installed a clean 2.13.3 and checked, it works as expected.
> 
> Marc
> 

Thanks for your very quick help! With \relative c everything is fine but not with \relative c' (see last mail). In the tablature staff only two crosses appear and even though in the above example (<c e \x g>) there should be an x instead of the g LilyPond seems to engrave an x instead of the e. Did I oversee something??

thanks again,
patrick 

-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/