« Return to Thread: Overriding NoteHead stencil in a chord produces unwanted X offset

Re: Overriding NoteHead stencil in a chord produces unwanted X offset

by Neil Puttock :: Rate this Message:

Reply to Author | View in Thread

2009/7/4 Mark Polesky <markpolesky@...>:

> \relative  c' {
>  <c
>  \tweak #'duration-log #2 \tweak #'X-extent #'(0 . 1.65) cis'
>  g'>1
> }

Why not use an artificial harmonic instead?  They're automatically
centred on semibreves:

centreFill =
#(define-music-function (parser location note) (ly:music?)
   (if (eq? (ly:music-property note 'name) 'NoteEvent)
       (begin
         (set! (ly:music-property note 'articulations)
               (cons harmonic
                     (ly:music-property note 'articulations)))
         (set! (ly:music-property note 'tweaks)
               (acons 'stencil (lambda (grob) (grob-interpret-markup
                                               grob
                                               (make-musicglyph-markup
"noteheads.s2")))
                      (ly:music-property note 'tweaks)))))
   note)

\relative  c' { <c \centreFill cis' g'>1 }

Regards,
Neil


_______________________________________________
lilypond-user mailing list
lilypond-user@...
http://lists.gnu.org/mailman/listinfo/lilypond-user

 « Return to Thread: Overriding NoteHead stencil in a chord produces unwanted X offset