On 2014-03-24 22:04, Thomas Morley wrote:
How about below?
Also, I added an optional argument, which you can use to specify which
chord-note should be colored.
Default is 'first'.
It's possible to switch to 'last'.
Other settings like 'fourth' at own risk:
Ofcourse specifying 'fourth' will result in an error, if any chord has
not enough notes.

\version "2.18.0"

clr =
#(define-music-function (parser location which color music)
     ((procedure? car) color? ly:music?)
   (music-map
     (lambda (mus)
       (if (music-is-of-type? mus 'event-chord)
           (let* ((evt-chrd-nts (event-chord-notes mus)))
            (if (> (length evt-chrd-nts) 1)
                (let ((first-nh (which evt-chrd-nts)))
                  #{ \tweak #'color #color #first-nh #})
                mus)
             mus)
           mus))
     music))

OMG!, This is exactly what I needed!
A really BIG Thank You!

// Anders
--
English isn't my first language.
So any error or strangeness is due to the translation.
Please correct my English so that I may become better.

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

Reply via email to