The sample clr you provide does not output exactly what I am looking.  I am 
looking for a "function" that will tweak the first enter pitch to have color 
for all the <..> entries not all the pitch inside the <..> to have the same 
color.



On Sunday, March 23, 2014 1:44:13 PM, Thomas Morley <[email protected]> 
wrote:
 
2014-03-23 11:59 GMT+01:00 MING TSANG <[email protected]>:
> 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?
Sorry, the question 1 question is "only output (2.)" has the correct desire 
output. all the others contain some undesired result.   I am seeking if the 
"\extractNote" can also produce the same output as (2.) in the .pdf. ie 
\extractNote can extract properly for the <<{..}\\{..}>> construct note entry. 
Sample (1.) and (3.) notes were not extract properly.  For sample (4.) I think 
this has to do with which note enter first for the <..> construct.  
>
> 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
The sample clr you provide does not output exactly what I am looking.  I am 
looking for a "function" that will tweak the first enter pitch to have color 
only (red or blue) for all the <..> entries not all the pitch inside the <..> 
to have the same color.
Cheers,
  Harm

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

Reply via email to