Skip to content

Instantly share code, notes, and snippets.

@tfausak
Created November 16, 2012 02:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tfausak/4083481 to your computer and use it in GitHub Desktop.
Save tfausak/4083481 to your computer and use it in GitHub Desktop.
Syntax highlighting for sheet music.
\version "2.16.1"
sharp = #(define-music-function (parser location note) (ly:music?) #{
\once \override NoteHead #'color = #(rgb-color .75 .25 0)
\once \override Stem #'color = #(rgb-color .75 .25 0)
#note
#})
flat = #(define-music-function (parser location note) (ly:music?) #{
\once \override NoteHead #'color = #(rgb-color 0 .25 .75)
\once \override Stem #'color = #(rgb-color 0 .25 .75)
#note
#})
\relative c' {
\override Staff.BarLine #'color = #(rgb-color .5 .5 .5)
\override Staff.Clef #'color = #(rgb-color .25 .25 .25)
\override Staff.KeyCancellation #'color = #(rgb-color .25 .25 .25)
\override Staff.KeySignature #'color = #(rgb-color .25 .25 .25)
\override Staff.StaffSymbol #'color = #(rgb-color .5 .5 .5)
\override Staff.TimeSignature #'color = #(rgb-color .25 .25 .25)
\override Voice.Accidental #'color = #(rgb-color .25 .25 .25)
\override Voice.NoteHead #'color = #(rgb-color 0 0 0)
\override Voice.Stem #'color = #(rgb-color 0 0 0)
% Circle of fifths
\key c \major
c
d
e
f
g
a
b
c
\key g \major
g
a
b
c
d
e
\sharp fis
g
\key d \major
d,
e
\sharp fis
g
a
b
\sharp cis
d
\key a \major
a
b
\sharp cis
d
e
\sharp fis
\sharp gis
a
\key e \major
e,
\sharp fis
\sharp gis
a
b
\sharp cis
\sharp dis
e
\key b \major
b
\sharp cis
\sharp dis
e
\sharp fis
\sharp gis
\sharp ais
b
\key fis \major
\sharp fis,
\sharp gis
\sharp ais
b
\sharp cis
\sharp dis
\sharp eis
\sharp fis
\key des \major
\flat des,
\flat ees
f
\flat ges
\flat aes
\flat bes
c
\flat des
\key aes \major
\flat aes
\flat bes
c
\flat des
\flat ees
f
g
\flat aes
\key ees \major
\flat ees,
f
g
\flat aes
\flat bes
c
d
\flat ees
\key bes \major
\flat bes
c
d
\flat ees
f
g
a
\flat bes
\key f \major
f,
g
a
\flat bes
c
d
e
f
% Excerpt from W. Ferling's 48 Famous Studies, #13
\key d \major
\time 9/8
\sharp fis4.( ~ \sharp fis8 g8 \sharp fis8 e b \sharp cis) |
d4. a4.( ~ a8 d \sharp fis) |
\pageBreak
g4.(\< \sharp cis!8 \flat bes g e \sharp cis!\! \flat bes) |
a( \sharp cis, \sharp gis' a \sharp cis,\> \flat bes' a e'-- g,!\!\p) |
\sharp fis4.( ~ \sharp fis8 a d \sharp fis e d) |
\crescTextCresc
b4.( ~ b8\< \breathe \sharp dis\! e g \sharp fis e) |
a( \sharp fis \sharp dis c'! a \sharp fis d !c a) |
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment