Am Do., 1. Aug. 2019 um 12:03 Uhr schrieb Nils Nommensen
<[email protected]>:
>
> Hello everyone,
>
> Is there any way to get the accidentals that belong to a specific notehead 
> grob?
> When calling ly:grob-basic-properties on the notehead grob, you get a list 
> with an attribute "parenthesis-friens", which has the object accidental-grob. 
> However, it seems that this is not actually a grob object, because I can't 
> call ly:grob-properties on it.
>
> Is there any way to do this? Any help would be greatly appreciated.

Via 'parenthesis-friends you'll get a list with names of grobs, i.e.
symbols, not the grob itself.

In IR 3.2.77 note-head-interface you'll find the 'accidental-grob in
"internal properties", to be called from NoteHead-grob via
ly:grob-object:

\version "2.19.83"

#(define get-accidental
  (lambda (note)
    (let*  ((acc (ly:grob-object note 'accidental-grob)))
      (if (ly:grob? acc)
          (begin
            (format #t "\n~a:\n~y" acc (ly:grob-properties acc))
            (ly:grob-set-property! acc 'color red))))))

{
    \once \override NoteHead.after-line-breaking = #get-accidental
    cis'
    <b dis' \tweak after-line-breaking #get-accidental fis'>
}

HTH,
  Harm

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to