27.03.2013 Views

in Snippets - LilyPond

in Snippets - LilyPond

in Snippets - LilyPond

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Editorial annotations 151<br />

<br />

<br />

A t<strong>in</strong>y e<br />

<br />

<br />

<br />

A big c<br />

Chang<strong>in</strong>g the appearance of a slur from solid to dotted or<br />

dashed<br />

The appearance of slurs may be changed from solid to dotted or dashed.<br />

\relative c' {<br />

c4( d e c)<br />

\slurDotted<br />

c4( d e c)<br />

\slurSolid<br />

c4( d e c)<br />

\slurDashed<br />

c4( d e c)<br />

\slurSolid<br />

c4( d e c)<br />

}<br />

<br />

<br />

<br />

Color<strong>in</strong>g notes depend<strong>in</strong>g on their pitch<br />

It is possible to color note heads depend<strong>in</strong>g on their pitch and/or their names: the function used<br />

<strong>in</strong> this example even makes it possible to dist<strong>in</strong>guish enharmonics.<br />

%Association list of pitches to colors.<br />

#(def<strong>in</strong>e color-mapp<strong>in</strong>g<br />

(list<br />

(cons (ly:make-pitch 0 0 NATURAL) (x11-color 'red))<br />

(cons (ly:make-pitch 0 0 SHARP) (x11-color 'green))<br />

(cons (ly:make-pitch 0 1 FLAT) (x11-color 'green))<br />

(cons (ly:make-pitch 0 2 NATURAL) (x11-color 'red))<br />

(cons (ly:make-pitch 0 2 SHARP) (x11-color 'green))<br />

(cons (ly:make-pitch 0 3 FLAT) (x11-color 'red))<br />

(cons (ly:make-pitch 0 3 NATURAL) (x11-color 'green))<br />

(cons (ly:make-pitch 0 4 SHARP) (x11-color 'red))<br />

(cons (ly:make-pitch 0 5 NATURAL) (x11-color 'green))<br />

(cons (ly:make-pitch 0 5 FLAT) (x11-color 'red))<br />

(cons (ly:make-pitch 0 6 SHARP) (x11-color 'red))<br />

(cons (ly:make-pitch 0 1 NATURAL) (x11-color 'blue))<br />

(cons (ly:make-pitch 0 3 SHARP) (x11-color 'blue))<br />

(cons (ly:make-pitch 0 4 FLAT) (x11-color 'blue))<br />

(cons (ly:make-pitch 0 5 SHARP) (x11-color 'blue))<br />

(cons (ly:make-pitch 0 6 FLAT) (x11-color 'blue))))<br />

%Compare pitch and alteration (not octave).<br />

#(def<strong>in</strong>e (pitch-equals? p1 p2)<br />

(and<br />

(= (ly:pitch-alteration p1) (ly:pitch-alteration p2))<br />

(= (ly:pitch-notename p1) (ly:pitch-notename p2))))

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!