Kenny Stephens <kfstephensii <at> yahoo.com> writes: > Our church has a handbell group whose members are not all musically literate. > To > keep themselves from having to learn to read music, they mark their notes > using > differently colored highlighters. > > Is there a means by which I can color the notes based on its absolute pitch > --- > not its pitch class? Some of the music spans three octaves. The requirements > are: > 1) b4 and b5 are different colors. > 2) b\flat4 and b4 are different colors. > 3) different pitches can be assigned to the same color (some "ringers" play > two or more handbells). > > I've only been playing around with Lilypond for about a week (though I've > logged > numerous hours) for typesetting organ music; but this is different. I did find > an example using Scheme and 'staff-position,' but this fails condition 1. > > Ideas, suggestions or solutions would be appreciated.
Using the same idea as the example you mentioned (http://lilypond.org/doc/v2.11/Documentation/user/lilypond-learning/Advanced-tweaks-with-Scheme) you can base the color on the pitch: #(define (color-notehead grob) (pitch-to-color (ly:event-property (ly:grob-property grob 'cause) 'pitch))) Now you'd just have to figure out how to implement the pitch-to-color function. For example this colors all the flat notes blue: #(define (pitch-to-color pitch) (if (eqv? (ly:pitch-alteration pitch) -1/2) (x11-color 'blue))) You might want to get a little fancy to make sure enharmonic spellings of the same pitch are the same color, but for most cases that shouldn't be a problem. -----Jay _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user