2017-02-20 16:31 GMT+01:00 zaord <ewen.dav...@gmail.com>: > Hello, > > I coded a script that adds markup. This function \ diag allows me to display > a customized diagram (here left hand "button board" of an accordion) and I > would like to apply it to all the elements of a chordmode {}. > The script below works very well but only for a chordmode with 1 element.
I have my doubts. Usually TextScript is not allowed in ChordNames-context, unless you include the relevant engraver. > If > the Chordmode have two elements, then the diagram is writing over himself > but don't follow the score ! > > In another hand, lilypond does not recreate new diagrams and the diagrams > are superpozed ... You need to iterate your function over the argument applying it to every event-chord found. Something at the lines of diag= #(define-music-function (parser location music) (ly:music?) (music-map (lambda (m) (if (music-is-of-type? m 'event-chord) #{ <>^\markup \complete #m $m #} m)) music)) And later: \new ChordNames \with { \consists "Text_engraver" } \diag \chordNames HTH, Harm _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user