1 % Pop chords as used in English/American popular music
4 % Written against \version "2.16.0"
6 % Was \raise #1.0 for both
7 chordFlat = \markup { \hspace #0.2 \tiny \raise #0.8 \flat }
8 chordSharp = \markup { \hspace #0.1 \teeny \raise #0.8 \sharp }
15 <c d g>-\markup { "2" }
16 % <c d g>-\markup { "sus2" }
17 <c f g>-\markup { "sus" }
18 % <c f g>-\markup { "sus4" }
19 % <c ees ges>-\markup { \small \raise #1.0 "o" }
20 <c ees ges>-\markup { \raise #0.8 "o" }
21 % <c ees ges>-\markup { "dim" }
22 % <c e gis>-\markup { "aug" } % or +
26 <c e g a>-\markup { "6" }
27 <c ees g a>-\markup { "m6" }
29 % Sevenths (including altered)
31 <c e g bes>-\markup { "7" }
32 <c ees g bes>-\markup { "m7" }
33 <c e g b>-\markup { "maj7" }
34 <c f g bes>-\markup { "7sus4" }
35 <c d g bes>-\markup { "7sus2" }
36 <c e ges bes>-\markup { "7" \chordFlat "5" }
37 <c e gis bes>-\markup { "7" \chordSharp "5" }
38 % <c e gis bes>-\markup { "aug7" } % or +7
39 <c ees g b>-\markup { "m(maj7)" }
40 % <c ees ges beses>-\markup { \small \raise #1.0 { "o" } "7" }
41 <c ees ges beses>-\markup { \raise #0.8 { "o" } "7" }
42 % <c ees ges beses>-\markup { "dim7" }
43 % <c ees ges bes>-\markup { \small \raise #1.0 { $(ly:wide-char->utf-8 #x00f8) } "7" }
44 % <c ees ges bes>-\markup { \raise #0.8 { $(ly:wide-char->utf-8 #x00f8) } "7" }
45 <c ees ges bes>-\markup { "m7" \chordFlat "5" }
46 <c e ges b>-\markup { "maj7" \chordFlat "5" }
47 <c e gis b>-\markup { "maj7" \chordSharp "5" }
49 % Ninths (including altered--incomplete)
51 <c e g bes d'>-\markup { "9" }
52 <c ees g bes d'>-\markup { "m9" }
53 <c e g b d'>-\markup { "maj9" }
54 <c e g d'>-\markup { "add9" }
55 <c e g a d'>-\markup { "6/9" }
56 <c ees g a d'>-\markup { "m6/9" }
57 <c ees g b d'>-\markup { "m(maj9)" }
58 <c e g bes des'>-\markup { "7" \chordFlat "9" }
59 <c e g bes dis'>-\markup { "7" \chordSharp "9" }
60 %dim7add9, dim7b9, dim7#9, 9#5, 9b5, maj9#5, maj9b5, 9sus4, 9sus2
61 <c e gis bes dis'>-\markup { "+7" \chordSharp "9" }
63 % Elevenths (incomplete)
65 <c e g bes d' f'>-\markup { "11" }
66 <c ees g bes d' f'>-\markup { "m11" }
67 <c e g b d' f'>-\markup { "maj11" }
68 <c e g f'>-\markup { "add11" }
69 <c ees g f'>-\markup { "m add11" }
70 <c ees g bes f'>-\markup { "m7add11" }
72 % Thirteenths (incomplete)
74 <c e g bes d' a'>-\markup { "13" }
75 <c ees g bes d' a'>-\markup { "m13" }
76 <c e g b d' a'>-\markup { "maj13" }
77 <c e g a'>-\markup { "add13" }
78 <c e g bes des' a'>-\markup { "13" \chordFlat "9" }
82 <c e g bes des' aes'>-\markup { "7" \chordFlat "9" \chordFlat "13" }
83 <c e gis bes des'>-\markup { "7" \chordSharp "5" \chordFlat "9" }
84 <c e g b d' fis'>-\markup { "maj9" \chordSharp "11" }
85 <c e g bes d' fis'>-\markup { "9" \chordSharp "11" }
86 % <c e g bes d' a'>-\markup { "9/13" }
89 % Add to existing exceptions
90 popChordsAdd = #(append
91 (sequential-music-to-chord-exceptions popChordsMusic #t)
94 % Bah, can't we set this globally? YES! See below...
95 % \set chordNameExceptions = #popChords
97 % Bah, this doesn't work either...
98 % #(set chordNameExceptions popChords)
101 % Let's try fixing the accidentals with some Scheme...
103 #(define (chord-name->pop-markup pitch lowercase?)
105 (let* ((alt (ly:pitch-alteration pitch)))
109 (make-simple-markup (vector-ref #("C" "D" "E" "F" "G" "A" "B") (ly:pitch-notename pitch)))
111 ;; If it's natural, do nothing
115 (make-line-markup (list empty-markup))
119 ;; Otherwise, handle adding the flat symbol
123 (make-hspace-markup 0.3) ;; WAS: 0.4
124 (make-tiny-markup (make-raise-markup 1.0
125 (make-musicglyph-markup "accidentals.flat")))
129 ;; or handle adding the sharp symbol
133 (make-hspace-markup 0.1) ;; WAS: 0.2
134 (make-teeny-markup (make-raise-markup 1.0
135 (make-musicglyph-markup "accidentals.sharp")))
152 \set chordNameExceptions = #popChordsAdd
153 \set chordRootNamer = #chord-name->pop-markup
154 \override ChordName #'extra-spacing-width = #'(-1.25 . 1.25)
163 chordNameExceptions = #popChordsAdd
164 chordRootNamer = #chord-name->pop-markup
165 \override ChordName #'extra-spacing-width = #'(-1.25 . 1.25)