On 2019-05-01 11:17 am, dtsmarin wrote:
This was an example to show what I'm after.
I need to *change* the stencil (e.g. flat to be sharp ) not the colour etc.
I know how to change stencil for a single accidental with \override but
\tweak Accidental.stencil doesn't work.

Hmm... \tweaking a stencil should most definitely work.

Here are two examples affecting specific Accidentals within chords. The first replaces the stencil in question, ignoring the original stencil. The second uses grob-transformer to obtain the original value without having to know how it was produced.

%%%%
\version "2.19.82"

#(define (foo grob)
  (grob-interpret-markup grob
    (markup #:with-color (x11-color 'purple)
            #:circle #:vcenter #:fontsize 2 #:bold "#")))

baz = #(grob-transformer 'stencil (lambda (grob orig)
  (grob-interpret-markup grob
    (markup #:with-color blue
            #:rotate 15 #:box #:stencil orig))))

\fixed c' {
  <d fis a \tweak Accidental.stencil #foo cis'>4
  <\tweak Accidental.stencil #baz ees g bes d'>4
}
%%%%


-- Aaron Hill
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to