lilypond-user
[Top][All Lists]
Advanced

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

Re: entering chords


From: Thomas Morley
Subject: Re: entering chords
Date: Sun, 23 Mar 2014 18:44:11 +0100

2014-03-23 11:59 GMT+01:00 MING TSANG <address@hidden>:
> Lilyponders,
> Help / explanation is appreciated.
> Question 1.
> I find a sample .ly in  recent archive user list for testing and I have
> question I like to clarify.
> When entering chords with <...> construct,
> a:  which note pitch enter first - ie <c' e''>2 or <e'' c'>2?
> b:  what is the difference?
> c:  the sample .ly has several functions -\extractNotes ; \ePU ; ePL etc.
> and I find several things I don't understand.  please refer to .pdf file.
> Only sample output (2.)

What's the question?

>
> Question 2.
> I search LSR and found tweak color notehead sample in <..> construct and use
> it. I am coding every chord with the tweak color.
> a:  how can I code a 'function' so that all chords are tweak ie. don't need
> to enter tweak for every chords?



Do you think of sth like below?

\version "2.18.0"

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

myMusic =
\relative c' {
        <c e g>-!
        <d e f>^"xy"
        <e-1>
        f---2^"foo"
}

\new Staff \clr #red \myMusic

Cheers,
  Harm



reply via email to

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