Keith,
What you have to do is \include the file "pop-chords.ly" in the file
that you're working with. "pop-chords.ly" takes care of the rest. For
example, make a file out of the code pasted at the end of this email.
Save it in a new folder on your desktop and move a copy of
"pop-chords.ly" into that folder as well. Then, run the file. You'll
get some chords in LilyPond's default style. Then, uncomment the second
line in the file (remove the '%' from %\include "pop-chords.ly"). Then,
run the file again and you'll get the custom, 'pop-style' chord symbols
instead.
Hope that helps,
David
%%begin code snippet%%
\version "2.13.16"
%\include "pop-chords.ly"
music = {
\relative c' {
c2 c g g c c g g a a g g f f c'1
}
}
myChords = {
\chordmode {
c1:sus2 g:7/f c:maj7 g:m6 a:maj7.3- g:7 f:/c c:maj7
}
}
\score {
<<
\new ChordNames {
\myChords
}
\new Staff {
\music
}
>>
}
%%end code snippet%%
On 03/28/2010 08:48 PM, keith Luke wrote:
David,
Thanks for the reply. What I'd like to know is what part of the
following "pop-chords.ly"
belongs in the \include statement and which part of it is the code that
generates the score. I tried a few things and I don't get errors, just
the compiling/parsing messages.
Here is the file:
% Pop chords as used in English/American popular music
% by James L. Hammons
% Written against \version "2.11.52"
chordFlat = \markup { \hspace #0.2 \tiny \raise #1.0 \flat }
chordSharp = \markup { \hspace #0.1 \teeny \raise #1.0 \sharp }
popChordsMusic =
{
% Triads
<c g>-\markup { "5" }
<c d g>-\markup { "2" }
% <c d g>-\markup { "sus2" }
<c f g>-\markup { "sus" }
% <c f g>-\markup { "sus4" }
% <c ees ges>-\markup { \small \raise #1.0 "o" }
<c ees ges>-\markup { \raise #0.8 "o" }
% <c ees ges>-\markup { "dim" }
% <c e gis>-\markup { "aug" }
% or +
% Sixths
<c e g a>-\markup { "6" }
<c ees g a>-\markup { "m6" }
% Sevenths (including altered)
<c e g bes>-\markup { "7" }
<c ees g bes>-\markup { "m7" }
<c e g b>-\markup { "maj7" }
<c f g bes>-\markup { "7sus4" }
<c d g bes>-\markup { "7sus2" }
<c e ges bes>-\markup { "7" \chordFlat "5" }
<c e gis bes>-\markup { "7" \chordSharp "5" }
% <c e gis bes>-\markup { "aug7" }
% or +7
<c ees g b>-\markup { "m(maj7)" }
% <c ees ges beses>-\markup { \small \raise #1.0 { "o" } "7" }
<c ees ges beses>-\markup { \raise #0.8 { "o" } "7" }
% <c ees ges beses>-\markup { "dim7" }
% <c ees ges bes>-\markup { \small \raise #1.0 {
#(ly:export (ly:wide- char->utf-8 #x00f8)) } "7" }
% <c ees ges bes>-\markup { \raise #0.8 { #(ly:export
(ly:wide-char- >utf-8 #x00f8)) } "7" }
<c ees ges bes>-\markup { "m7" \chordFlat "5" }
<c e ges b>-\markup { "maj7" \chordFlat "5" }
<c e gis b>-\markup { "maj7" \chordSharp "5" }
% Ninths (including altered--incomplete)
<c e g bes d'>-\markup { "9" }
<c ees g bes d'>-\markup { "m9" }
<c e g b d'>-\markup { "maj9" }
<c e g d'>-\markup { "add9" }
<c e g a d'>-\markup { "6/9" }
<c ees g a d'>-\markup { "m6/9" }
<c ees g b d'>-\markup { "m(maj9)" }
<c e g bes des'>-\markup { "7" \chordFlat "9" }
<c e g bes dis'>-\markup { "7" \chordSharp "9" }
%dim7add9, dim7b9, dim7#9, 9#5, 9b5, maj9#5, maj9b5, 9sus4, 9sus2
% Elevenths (incomplete)
<c e g bes d' f'>-\markup { "11" }
<c ees g bes d' f'>-\markup { "m11" }
<c e g b d' f'>-\markup { "maj11" }
<c e g f'>-\markup { "add11" }
<c ees g f'>-\markup { "m add11" }
<c ees g bes f'>-\markup { "m7add11" }
% Thirteenths (incomplete)
<c e g bes d' a'>-\markup { "13" }
<c ees g bes d' a'>-\markup { "m13" }
<c e g b d' a'>-\markup { "maj13" }
<c e g a'>-\markup { "add13" }
% Misc add chords
<c e g bes des' aes'>-\markup { "7" \chordFlat "9" \chordFlat "13" }
<c e gis bes des'>-\markup { "7" \chordSharp "5" \chordFlat "9" }
<c e g b d' fis'>-\markup { "maj9" \chordSharp "11" }
<c e g bes d' fis'>-\markup { "9" \chordSharp "11" }
}
% Add to existing exceptions
popChordsAdd = #(append
(sequential-music-to-chord-exceptions popChordsMusic #t)
ignatzekExceptions)
% Bah, can't we set this globally? YES! See below...
% \set chordNameExceptions = #popChords
% Bah, this doesn't work either...
% #(set chordNameExceptions popChords)
% Let's try fixing the accidentals with some Scheme...
#(define (chord-name->pop-markup pitch)
(let* ((alt (ly:pitch-alteration pitch)))
(make-line-markup
(list
(make-simple-markup (vector-ref #("C" "D" "E" "F" "G" "A" "B") (ly:pitch-notename
pitch)))
;; If it's natural, do nothing
(if (= alt 0)
(make-line-markup (list empty-markup))
(if (= alt FLAT)
;; Otherwise, handle adding the flat symbol
(make-line-markup
(list
(make-hspace-markup 0.3) ;; WAS: 0.4
(make-tiny-markup (make-raise-markup 1.0
(make-musicglyph-markup "accidentals.flat")))
)
)
;; or handle adding the sharp symbol
(make-line-markup
(list
(make-hspace-markup 0.1) ;; WAS: 0.2
(make-teeny-markup (make-raise-markup 1.0
(make-musicglyph-markup "accidentals.sharp")))
)
)
)
)
)
)
)
)
%{
popChords =
{
\set chordNameExceptions = #popChordsAdd
\set chordRootNamer = #chord-name->pop-markup
\override ChordName #'extra-spacing-width = #'(-1.25 . 1.25)
}
%}
\layout
{
\context
{
\Score
chordNameExceptions = #popChordsAdd
chordRootNamer = #chord-name->pop-markup
\override ChordName #'extra-spacing-width = #'(-1.25 . 1.25)
}
}
I did have pop-chords.ly
in the same directory as my source code, but I'm going to try an put it
in the /usr/shar/lilypond/current/ly folder.
I'm on Windows usingLilyPond 2.12.2.
Thanks,
Keith
On Sun, Mar 28, 2010 at 11:18 AM, David
Stocker <address@hidden>
wrote:
Hi Keith,
Save a copy of the file " pop-chords.ly" in the
same directory that you
want to use it. Alternatively, you can put a copy of the file into your
LilyPond installation in .../usr/share/lilypond/current/ly (Linux,
similar on Windows). After that, just do \include " pop-chords.ly"
in
the top of the file you want to use it in.
Also, you can have a look at some of the chord suffixes I've been
fooling around with. Just run LilyPond on the file to see what the
suffixes look like by themselves. I'm working on how to incorporate
this into a file like " pop-chords.ly" and
even make an expanded set of
chord modifiers to use in \chordmode.
Best regards,
David
On 03/28/2010 04:53 PM, keith Luke wrote:
David,
I d
I saw your post regarding pop-chords. I tried copying the file and
running it through LilyPond, but I don't get any PDF file created. The
only messages that shows in the log file are:
# -*-compilation-*-
Processing `C:/LilyPond
Data/Pop-chords-test.ly'
Parsing...
Do you have an example of using pop-chords.ly? I'm
working on an
arrangement which has lots of altered chords and I would like to see if
I can use "jazz nomenclature" rather than the LilyPond default.
Thanks,
Keith Luke
--
David Stocker
804-598-3762
http://notesettersinc.com
|