lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: entering chords


From: address@hidden
Subject: Re: entering chords
Date: Tue, 25 Mar 2014 09:47:14 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]